-
-
Notifications
You must be signed in to change notification settings - Fork 149
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
Qty discounts, #1899
Qty discounts, #1899
Conversation
@@ -173,6 +124,11 @@ sub price_matrix { | |||
- ($sellprice * ($mref->{pricebreak} / 100)); | |||
} | |||
$ref->{sellprice} = $sellprice; | |||
if ($mref->{qty} > $form->{qtycache}->{$ref->{id}}){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@einhverfr just ran into a problem with the quantity cache, I think: when loading an existing invoice from the database, the price matrix is applied to each item individually instead of running the pricematrix at the end.
(which explains part of the cases of 'rowcount' being '' or undefined...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that this: https://github.com/ledgersmb/LedgerSMB/blob/master/lib/LedgerSMB/IS.pm#L1600
loop needs to be split in a loop loading from the database and a loop applying the prices from the price matrix.
I'm assuming there's something similar going on in the 'ir' and 'oe' sides of things.
fixes #1790