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

Qty discounts, #1899

Merged
merged 12 commits into from
Jul 30, 2016
Merged

Qty discounts, #1899

merged 12 commits into from
Jul 30, 2016

Conversation

einhverfr
Copy link
Member

fixes #1790

@coveralls
Copy link

coveralls commented Jul 30, 2016

Coverage Status

Coverage decreased (-0.004%) to 24.718% when pulling dcdbef2 on einhverfr:qty_discounts into f122b2f on ledgersmb:master.

@einhverfr einhverfr merged commit 276ed61 into ledgersmb:master Jul 30, 2016
@einhverfr einhverfr deleted the qty_discounts branch July 30, 2016 06:49
@@ -173,6 +124,11 @@ sub price_matrix {
- ($sellprice * ($mref->{pricebreak} / 100));
}
$ref->{sellprice} = $sellprice;
if ($mref->{qty} > $form->{qtycache}->{$ref->{id}}){
Copy link
Member

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...

Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Qty discounts via pricematrix
3 participants