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

Design: Deleting Cash Payments #2159

Closed
jniles opened this issue Sep 27, 2017 · 1 comment
Closed

Design: Deleting Cash Payments #2159

jniles opened this issue Sep 27, 2017 · 1 comment
Assignees
Labels

Comments

@jniles
Copy link
Collaborator

jniles commented Sep 27, 2017

This issue covers the design for deleting Cash Payments using the proposal described in #2044.

Design
Deleting cash payments will be done from the Cash Payment Registry and the Posting Journal (via the transaction edit modal). It is not allowed on posted records. A deleted Cash Payment will remove the lines from the posting_journal, cash, and cash_item. It will also remove the record_uuid from the document_map.

There are some conditional rules on this operation:

  1. If the cash payment is posted, it cannot be deleted. The only way to reverse a posted record is by using a credit note.
  2. If the cash payment has a referencing transaction, it cannot be deleted. This is most likely a voucher that is reversing the cash payment (as a credit note).

The steps to implement this are:

  1. Create a routing function from HTTP DELETE /transactions/:uuid that will determine if the transaction is a cash payment, voucher, or invoice.
  2. Create the safelyDeleteCashPayment(uuid) in the finance/cash.js. module.
  3. Write the SQL logic to determine if the cash payment should be deleted as described in the above rules.
  4. Put in the client-side "delete" button on the transaction modal and on the Cash Payment registry.
@jniles jniles added the design label Sep 27, 2017
@jniles jniles changed the title design: deleting Cash Payments Design: Deleting Cash Payments Sep 27, 2017
@jniles jniles self-assigned this Sep 27, 2017
jniles added a commit that referenced this issue Sep 29, 2017
This commit implements the server-side logic and code for deleting cash
payments.  An integration tests shows that the functionality is intact.
This goes halfway to addressing #2159.
jniles added a commit that referenced this issue Sep 29, 2017
This commit implements the client-side for deleting a cash record.  It
simply adds a new value to the dropdown that can be clicked to remove
the record.

TODO - add end-to-end tests.

Closes #2159.
@jniles jniles mentioned this issue Oct 9, 2017
3 tasks
jniles added a commit that referenced this issue Oct 9, 2017
This commit implements the server-side logic and code for deleting cash
payments.  An integration tests shows that the functionality is intact.
This goes halfway to addressing #2159.
jniles added a commit that referenced this issue Oct 9, 2017
This commit implements the client-side for deleting a cash record.  It
simply adds a new value to the dropdown that can be clicked to remove
the record.

TODO - add end-to-end tests.

Closes #2159.
jniles added a commit that referenced this issue Oct 9, 2017
This commit implements the server-side logic and code for deleting cash
payments.  An integration tests shows that the functionality is intact.
This goes halfway to addressing #2159.
jniles added a commit that referenced this issue Oct 9, 2017
This commit implements the client-side for deleting a cash record.  It
simply adds a new value to the dropdown that can be clicked to remove
the record.

TODO - add end-to-end tests.

Closes #2159.
jniles added a commit that referenced this issue Oct 11, 2017
This commit implements the server-side logic and code for deleting cash
payments.  An integration tests shows that the functionality is intact.
This goes halfway to addressing #2159.
jniles added a commit that referenced this issue Oct 11, 2017
This commit implements the client-side for deleting a cash record.  It
simply adds a new value to the dropdown that can be clicked to remove
the record.

TODO - add end-to-end tests.

Closes #2159.
jniles added a commit that referenced this issue Oct 13, 2017
This commit implements the server-side logic and code for deleting cash
payments.  An integration tests shows that the functionality is intact.
This goes halfway to addressing #2159.
jniles added a commit that referenced this issue Oct 13, 2017
This commit implements the client-side for deleting a cash record.  It
simply adds a new value to the dropdown that can be clicked to remove
the record.

TODO - add end-to-end tests.

Closes #2159.
bors bot added a commit that referenced this issue Oct 16, 2017
2188: feature: delete records r=DedrickEnc a=jniles

This PR implements  deleting cash payments following the proposal in #2044 and the design discussed in #2159.  It does much of the heavy lifting for the other two delete issues - vouchers (#2161) and invoices (#2160).

TODO:
 - [x] End to End Tests
 - [x] Delete Invoices #2160.
 - [x] Delete Vouchers #2161.
@jniles
Copy link
Collaborator Author

jniles commented Oct 16, 2017

Closed in #2188.

@jniles jniles closed this as completed Oct 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant