GithubHelp home page GithubHelp logo

jitendrapurohit / nz.co.fuzion.accountsync Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eileenmcnaughton/nz.co.fuzion.accountsync

0.0 2.0 0.0 271 KB

Account Sync Extension (supports Xero Sync with generic aspects)

License: GNU Affero General Public License v3.0

PHP 94.12% CSS 0.04% JavaScript 4.54% HTML 1.30%

nz.co.fuzion.accountsync's Introduction

This extension supports the CiviXero extension by doing the non Xero specific parts. It is a dependency although CiviCRM has no dependency management

IT PROVIDES
1) tables for storing event sync info - in particular civicrm_account_contact & civicrm_invoice_contact

2) apis for storing data in these tables

3) hooks civicrm_accountPullPreSave & civicrm_accountPushAlterMapped
 note that the civicrm_accountPullPreSave differs from a standard pre hook in that setting save to FALSE will cause the record to be skipped ie.

 hook_civicrm_accountPullPreSave($entity, &$data, &$save, &$params) {
   if (not_cool($entity)) {
     $save = FALSE;
   }
 }

 the accountPushAlterMapped hook also allows you to stop something from being pushed through although it's primary use is to change the mapping (e.g alter account codes based on client specific logic

 hook_accountPushAlterMapped($entity, &$data, &$save, &$params) {}

4) api invoice.getderived. This turned out to be a fairly important api as the line items for a given contact id are not easily retrieved. If the contribution is for a participant_payment then the participant entity rather than the contribution entity links to the civicrm_line_item table. I may not have used the best process to build this 'invoice' entity but it's a much better starting place for accounts interaction. It also resolves all accounting codes with is relevant for accounts interaction
5) api to update civicrm contributions based on related invoice status

6) api for cancelling payments based on civicrm_account_invoice - ie taking those items where the status in accounts is cancelled & not in CiviCRM. GOTCHA - cancelling an invoice via the API doesn't cancel the event registraion - feature ? bug?

TODO


1) Think more about how people will create matches for accounts data to get them in sync. Currently this is do-able via hooks & so far my experience has been that the approach has been quite customer specific and involves a good deal of manual effort. It may be beyond the scope of this extension.

2) Currently there is nothing in place to update contacts from accounts package data - I think that is out of the scope of this extension

3) in my previous Xero implementation overpaid invoices would be adjusted in CiviCRM. I haven't figured out how this would look in the brave new world of CiviAccounts. I'm not currently storing the amount except in the extension specific field. Another unhandled situation is when the total value of the contribution is edited not to match the total of the price set

4) there is a merge hook - but it only works when one contact has an accountsync contact & the other doesn't.


THOUGHTS on whether to enforce the contribution_id & contact_id in these tables
1) I should either be relaxed & store the invoice ids / contact ids from the accounts data regardless or
2) I should use the FKs to restrict the data in the 'parent' table from being deleted. In theory contributions
can't be deleted anyway & in theory neither can contacts who have made contributions.

nz.co.fuzion.accountsync's People

Contributors

agileware-dev avatar agileware-fj avatar eileenmcnaughton avatar kenwest avatar petednz avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.