Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(journal): improve posting core with issue fixes #339

Merged
merged 6 commits into from
Apr 21, 2016

Conversation

jniles
Copy link
Collaborator

@jniles jniles commented Apr 20, 2016

This pull request improves the posting experience by introducing fixes requested in various issues. Here is what has changed:

Fiscal Year
The fiscal year schema has been updated as requested by #279 in preparation for creating the client-side fiscal year module. It also updates the posting journal's core checks to ensure that integration tests continue to behave appropriately.

Specifically, here is what changed:

  1. period.period_start --> period.start_date
  2. period.period_stop --> period.end_date
  3. fiscal_year.previous_fiscal_year -->
    fiscal_year.previous_fiscal_year_id.
  4. REMOVED fiscal_year.transaction_start_number
  5. REMOVED fiscal_year.transaction_stop_number
  6. REMOVED fiscal_year.start_year
  7. REMOVED fiscal_year.start_month
  8. ADDED fiscal_year.start_date DATE
  9. ADDED fiscal_year.created_at
  10. ADDED fiscal_year.updated_at
  11. fiscal_year.fiscal_year_txt --> fiscal_year.label

Journal Vouchers and Journal Core

  1. The @Date, @currencyId, @enterpriseId, and @projectid are all performed in a single SQL SELECT ... INTO statement for both the cash and voucher posting. This improves readability and performance.
  2. gain_account_id and loss_account_id are implemented as an enterprise setting, as required by Move the gain/loss on rounding accounts to the enterprise entity #327 and requested in Proposal: refactor cashboxes #324.

Cashboxes

  1. Removes the now useless gain/loss accounts and renames virement to transfer.
  2. To support (1), I updated the client and API extensively (to ensure tests pass).

Accounts

  1. In the confusion of debugging cashbox errors, I discovered redundant methods list() and read() in the AccountService, of which I removed list() as being non-standard.
  2. The /accounts API also uses detailed instead of full in the query string, as detailed is used in more other APIs.

This PR should pass all end-to-end tests that pass in master. Note that there is still a bug with #338.


Hi! Thank you for contributing!

Before submitting this pull request, please verify that you have:

  • Run your code through JSHint. Check out our styleguide
  • Run integration tests.
  • Run end-to-end tests.
  • Accurately described the changes your are making in this pull request.

For a more detailed checklist, see the official review checklist
that this PR will be evaluated against.

Ensuring that the above checkboxes are completed will help speed the review process
and help build a stronger application. Thanks!

Jonathan Niles and others added 6 commits April 20, 2016 13:59
This commit updates the fiscal year schema as requested by #279 in
preparation for creating the client-side fiscal year module.  It also
updates the posting journal's core checks to ensure that integration
tests continue to behave appropriately.

Specifically, here is what changed:
 1) `period.period_start` --> `period.start_date`
 2) `period.period_stop` --> `period.end_date`
 3) `fiscal_year.previous_fiscal_year` -->
 `fiscal_year.previous_fiscal_year_id`.
 4) REMOVED `fiscal_year.transaction_start_number`
 5) REMOVED `fiscal_year.transaction_stop_number`
 6) REMOVED `fiscal_year.start_year`
 7) REMOVED `fiscal_year.start_month`
 8) ADDED `fiscal_year.start_date` DATE
 9) ADDED `fiscal_year.created_at`
 10) ADDED `fiscal_year.updated_at`
 11) `fiscal_year.fiscal_year_txt` --> `fiscal_year.label`
This commit implements the initial cash posting journal route by porting
journal/voucher.js to the journal/cash.js.

It also implements the following optimizations/cleanups:
  1) The @Date, @currencyId, @enterpriseId, and @projectid are all
  performed in a single SQL `SELECT ... INTO` statement for both the
  cash and voucher posting.  This improves readability and performance.
  2) `gain_account_id` and `loss_account_id` are implemented as an
  enterprise setting, as required by #327 and requested in #324.

In a future commit, the gain/loss accounts should be removed from the
cashboxes.

Closes #327.
This commit refactors cashboxes to no longer manage the gain/loss on
exchange accounts and implements suggestions found in #324.  The
cashboxes API has changed slightly and modernized.  Next, the
client-side services will be analyzed to ensure they will continue to
behave properly.
This commit updates and refactors the cashbox client with newer
standards, JSDoc syntax, and the new database schema.
This commit removes unused appstate variables from application.js and
fixes errors in the client cashboxes client to allow end to end tests to
pass.
This commit does a lot of work:
 1) Both cashboxes and account use "?detailed=1" query string parameter
 instead of "?full=1".  Tests, services and controllers have been
 updated to reflect this.
 2) The `Accounts.list()` method has been removed.  It's replacement is
 the standards-compliant `Accounts.read()` method, which doesn't attach
 children to the accounts list.
 3) Cashboxes client no longer offers `<select>` elements for gain/loss
 on exchange accounts.
 4) The Cashbox Currency Modal now uses `bh-submit` to manage the
 loading state.

Closes #324.
@jniles
Copy link
Collaborator Author

jniles commented Apr 21, 2016

@sfount, can I get an amen?

data.type = 'primary';
}
// converts is_auxiliary into radio buttons
data.type = (data.is_auxiliary) ? 'auxiliary' : 'primary';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend investigating ng-true-value and ng-false-value for driving these radio button states.

I know this module will have to be re-factored to use ui-router very soon so this can be included in that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem.

@sfount sfount merged commit 7f9ae02 into IMA-WorldHealth:master Apr 21, 2016
@jniles jniles deleted the chore-improve-cashboxes branch April 25, 2016 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants