Skip to content

OBPIH-6497 [backend] Determine encumbered and invoiceable items or adjustments (fix after QA)#4778

Merged
awalkowiak merged 3 commits intodevelopfrom
OBPIH-6497-2
Aug 7, 2024
Merged

OBPIH-6497 [backend] Determine encumbered and invoiceable items or adjustments (fix after QA)#4778
awalkowiak merged 3 commits intodevelopfrom
OBPIH-6497-2

Conversation

@alannadolny
Copy link
Collaborator

No description provided.

@alannadolny alannadolny self-assigned this Aug 6, 2024
@github-actions github-actions bot added the domain: backend Changes or discussions relating to the backend server label Aug 6, 2024
Boolean isInvoiceable() {
return encumbered && (canceled || quantityAvailableToInvoice > 0)
return hasPrepaymentInvoice &&
!hasRegularInvoice &&
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this !hasRegularInvoice correct? What if an order item will be split across multiple shipments and then multiple final invoices (= multiple regular invoices)?

Copy link
Collaborator

Choose a reason for hiding this comment

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

btw, for order adjustments it makes sense, but I am not sue if it makes sense for order items

Copy link
Member

Choose a reason for hiding this comment

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

yes an order item can be split across multiple shipments, but I'm not sure if we support a shipment item being split across multiple invoices. I think we expect that a shipment item can only be invoiced once. This is because if we want to invoice a quantity 2 but a quantity 4 was shipped, then that indicates 2 qty was returned (or whatever) and the shipment item should then be considered fully invoiced (even though we only invoiced quantity 2 of 4).

Copy link
Member

Choose a reason for hiding this comment

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

btw here's an example of what an invoice would look like if we have multiple shipments for each order item

5580b76c-fef9-4d3d-9b25-7a7770d73d7a


Boolean isInvoiceable() {
return !isInvoiced && order.placed
return hasPrepaymentInvoice && !hasRegularInvoice && order.placed
Copy link
Member

Choose a reason for hiding this comment

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

Is this because isInvoiced used for non-prepay flows?

Copy link
Collaborator

Choose a reason for hiding this comment

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

isInvoiced looks for posted invoices, and here we want to have both posted and not yet posted invoices

orderStatus | hasRegularInvoice || isInvoiceable
OrderStatus.PENDING | false || false
OrderStatus.PLACED | false || true
OrderStatus.PENDING | false || false
Copy link
Member

Choose a reason for hiding this comment

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

hasRegularInvoice should be true here right? Otherwise it;s the same as the first case

@awalkowiak
Copy link
Collaborator

I will be taking over this one

plus remove isEncumbered for clarity
@awalkowiak awalkowiak merged commit ae0390b into develop Aug 7, 2024
@awalkowiak awalkowiak deleted the OBPIH-6497-2 branch August 7, 2024 13:16
Copy link
Member

@jmiranda jmiranda left a comment

Choose a reason for hiding this comment

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

Can we please follow the convention for properties like quantity?

quantityDescriptionOfQuantity

like

quantityOrdered
quantityShipped
quantityOnHand
quantityAvailableToPromise

I've seen a few times where the descriptor leaks into the beginning of the property name

invoicedQuantity
postedQuantityInvoicedInStandardUom

these should probably be

quantityInvoiced

and

quantityPosted 
quantityPostedInStandardUom

If there's a good reason place the descriptor upfront please let me know ... otherwise it should always be.

quantity<descriptor>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: backend Changes or discussions relating to the backend server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants