Skip to content

OBPHI-6759 Rollback of invoice doesn't reverse order status #4892

Merged
awalkowiak merged 1 commit intorelease/0.9.2-hotfix1from
OBPIH-6759
Oct 14, 2024
Merged

OBPHI-6759 Rollback of invoice doesn't reverse order status #4892
awalkowiak merged 1 commit intorelease/0.9.2-hotfix1from
OBPIH-6759

Conversation

@alannadolny
Copy link
Collaborator

No description provided.

@alannadolny alannadolny self-assigned this Oct 11, 2024
@github-actions github-actions bot added the flag: schema change Hilights a pull request that contains a change to the database schema label Oct 11, 2024
LEFT OUTER JOIN order_adjustment ON order_adjustment.order_id = `order`.id
LEFT OUTER JOIN (
SELECT adjustment_id, SUM(invoiced_amount) as invoiced_amount
SELECT adjustment_id, SUM(invoiced_amount) as invoiced_amount, IF(SUM(quantity_invoiced) > 0, 1, 0) as quantity_invoiced
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this work properly for the partial amount invoicing? Let's say you have the adjustment invoiced in two or more invoices, and if it is fully and not yet fully invoiced?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, it works, because we are looking into the amount and the quantity_invoiced that you are pointing out here.
When we are starting invoicing an adjustment it is already included in this count, but splitting it between a few invoices won't increase the counter, so we are not able to have more adjustments than we had on the PO as it was possible at the beginning. It's a way for handling adjustments with 0 amount because we are not able to split them between invoices, so as an example:
3 adjustments, first with 5 amount, second with 5, and the last one with 0:

  • I am invoicing the first adj, but only 3 amount -> total amount: 10, invoiced amount 3, quantity invoiced 1, adj count: 3 [PARTIALLY_INOVICED]
  • I am invoicing the first adj second time, 2 amount -> total amount: 10, invoiced amount 5, quantity invoiced 1, adj count: 3 [PARTIALLY_INOVICED]
  • I am invoicing the second adj, full amount -> total amount: 10, invoiced amount 10, quantity invoiced 2, adj count: 3 [PARTIALLY_INOVICED]
  • I am invoicing the last adj -> total amount: 10, invoiced amount 10, quantity invoiced 3, adj count: 3 [INVOICED]

@awalkowiak awalkowiak merged commit 4d5a732 into release/0.9.2-hotfix1 Oct 14, 2024
@awalkowiak awalkowiak deleted the OBPIH-6759 branch October 14, 2024 08:45
jwalbers pushed a commit to jwalbers/openboxes that referenced this pull request Oct 29, 2024
jwalbers pushed a commit to jwalbers/openboxes that referenced this pull request Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flag: schema change Hilights a pull request that contains a change to the database schema

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants