OBPIH-6693 fix adjustment invoice statuses#4871
OBPIH-6693 fix adjustment invoice statuses#4871awalkowiak merged 5 commits intorelease/0.9.2-hotfix1from
Conversation
| BigDecimal getInvoicedUnitPrice() { | ||
| return invoiceItems?.sum { | ||
| if (it.invoice?.isRegularInvoice && !it.inverse) { | ||
| if (it.invoice?.datePosted != null && it.invoice?.isRegularInvoice && !it.inverse) { |
There was a problem hiding this comment.
I don't like it here. This might break the getUnitPriceAvailableToInvoice. I think this should be a separate transient (invoiced unit price on posted invoices)
There was a problem hiding this comment.
(as you can see, on the OrderItem there are both quantityInvoiced and postedQuantityInvoiced for the same reason)
…voicedUnitPrice and use this value to determine if hwo much was invoiced
| return !postedPurchaseInvoiceItems.empty | ||
| Boolean getIsFullyInvoiced() { | ||
| return Math.abs(unitPriceOnPostedInvoices) >= Math.abs(totalAdjustments) | ||
| } |
There was a problem hiding this comment.
I removed the isInvoiced transient because it is not used anywhere anymore and if we will ever need this in the future I think we are going to use the derived status like we use in other domains.
| Boolean fullyInvoiced = invoicedUnitPrice == totalAdjustments | ||
|
|
||
| if (!isInvoiced) { | ||
| if (postedPurchaseInvoiceItems.empty) { |
There was a problem hiding this comment.
Could you add some comments inside this method (especially on the latter ifs checks)? Looking at the ordering of the if checks it overall makes sense and should work now, but I am afraid, that if someone starts adjusting here something, then it might easily get broken.
…s for order adjustmen dervied status
✨ Description of Change
Link to GitHub issue or Jira ticket: OBPIH-6693
Description:
📷 Screenshots & Recordings (optional)