Had a need for different discount options. Item discount or transaction discount.

Made a patch which seems to work quite well. Would like to expend to add things like percent discount or value discount, but my JS/AJax/D AHAH is not that good yet.

Please review and let me know what you think.

CommentFileSizeAuthor
#2 erp-discount-2.patch36.7 KBleenx
erp-discount.patch37.21 KBleenx

Comments

burningdog’s picture

Wow, big patch! Can you detail a bit more of how you did this and what changes you've made?

Your patch won't apply for anyone else - please read the Advanced patch contributor guide for how to patch with git so that the rest of us can play with your code :)

leenx’s picture

StatusFileSize
new36.7 KB

Building with drush make and this patch works, but I see that there has been a change with the git migration - http://drupal.org/node/745224

I have re-tested with patch -p1 and posting my new patch.

As for explaining what I did ...
Quotes/Invoices and Cash Sales
Added two fields, one for the transaction discount and the other in the data for each line, for item discount.

Also setup a conf items, to enable these options as well as been able to label the transaction discount, ie, Discount/Excess

Also added a total for the transaction, which I wish I knew how to align up nicely, but that can come later.

Also tried to add a recalc [+] button on each line, so the forms look a little more balanced, but the don't always work, needs more work.

For Items, I started with an option to disable discounts on item, the DB has been built, but I have not yet added the logic.

Thanks, enjoy.
LeeT

singularo’s picture

Interesting patch.

This would give the ability to do a discount per line item, which is just like what MYOB retail manager does.

How we do it at the moment is with a single service item called DISCOUNT, which you simply put 1 in the qty, and -20 or whatever in the amount column.

You don't really need individual recalc buttons, clicking add line does the same thing.

Does it add a setting that allows enabling/disabling the discount functionality?

leenx’s picture

Thanks, I hope it makes as much sense to everybody else as it does to us.

The reason for discount per line, is that you might not want the original price changed. Something I have been thinking of, is making it so that people can't mess with the item price. Later you would be able to see how much discounts you have been giving and stuff like that. Currently set as a percent, but if I can work out the AJax/DAHAH stuff, would be nice to be a fixed figure, which could work out the percent or if the figure put in had a percent, then work out the other way around.

Sorry, I think i did not explain the extra recalc [+] button. The items end with [X], but the insert form, looks odd, without a similar button, so I added a button [+] there, so it looked a little more balanced, but it does not always work, which I don't understand. Hope to fix it in future.

Yes, there are two options. One to disable/enable transaction discount and another to disable/enable line discounts. And a label, so that transaction discounts can be called what ever the company using it might want to call it. In our sponsors cases, they wanted it as Excess, not discount.

Enjoy
LeeT

singularo’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)