Here in Canada, invoices items should be included in the following order: Price Shipment Taxes Subtotal Total At least, as an option. Right now, our library gets the wrong Total since shipping is added to the subtotal, not including the taxes. I looked for preferences, but the code seemed very clear in acqui/invoice.pl: my $total_gsti_shipment = $total_est_gsti + $details->{shipmentcost}; Unless a nice solution already exists, I think this ordering should be customizable. Comments and input (on what else should be affected) are very welcomed.
Created attachment 28891 [details] [review] Bug 11062 - Invoice's shipment/shipping cost should be included PRE-gst tax (as an option) Koha's users don't have the option to enter shipping tax. This fix allow to vendors add a specific tax (included in gist preference) to shipping cost. Modified: added two columns, shippingincgst and sgstrate in aqbooksellers. Some files changed: C4/Bookseller.pm installer/data/mysql/kohastructure.sql installer/data/mysql/updatedatabase.pl acqui/updatesupplier.pl acqui/supplier.pl acqui/parcels.pl t/db_dependent/Bookseller.t acqui/invoice.pl - total_gste_shipment and total_gsti_shipment calcul changed koha-tmpl/intranet-tmpl/prog/en/modiles/acqui/supplier.tt - Shipping tax rate and shipping include tax or don't include tax, added koha-tmpl/intranet-tmpl/prog/en/modiles/acqui/parcels.tt - "(tax exc.)" or "(tax inc)" added beside "Shipping cost". koha-tmpl/intranet-tmpl/prog/en/modiles/acqui/invoice.tt - if shipping "tax exc", add "Shipping cost (tax inc)" below "Shipping cost" 0) Apply the patch 1) Run updatedatabase.pl to add the two columns to aqbooksellers 2) Add some tax rates in gist preferences 3) Edit a vendor 4) Chose shipping prices: include tax or not 5) Chose a shipping tax rate 6) Save 7) Create an order in a vendor's basket 8) click button receive shipment 9) Validate "(tax exc.)" or "(tax inc)" added beside "Shipping cost". 10) Click link "Receive order" in pending orders 11) Save 12) Click Finish receiving 13) Validate shipping "tax ex", add "Shipping cost (tax inc)" below "Shipping cost" if shipping "tax exc". 14) Validate last line "Total + Shipment cost (CDN)"
I've tried to apply the patch against master 3.17.00.013 Applying: Bug 11062 - Invoice's shipment/shipping cost should be included PRE-gst tax (as an option) Using index info to reconstruct a base tree... Falling back to patching base and 3-way merge... Auto-merging t/db_dependent/Bookseller.t Auto-merging installer/data/mysql/updatedatabase.pl CONFLICT (content): Merge conflict in installer/data/mysql/updatedatabase.pl Auto-merging acqui/supplier.pl Auto-merging acqui/parcels.pl Auto-merging acqui/invoice.pl CONFLICT (content): Merge conflict in acqui/invoice.pl Failed to merge in the changes. Patch failed at 0001 Bug 11062 - Invoice's shipment/shipping cost should be included PRE-gst tax (as an option) So I pass the patch to "Patch doesn't apply" status.
Created attachment 31033 [details] [review] Bug 11062 - Invoice's shipment/shipping cost should be included PRE-gst tax (as an option) Koha's users don't have the option to enter shipping tax. This fix allow to vendors add a specific tax (included in gist preference) to shipping cost. Modified: added two columns, shippingincgst and sgstrate in aqbooksellers. Some files changed: C4/Bookseller.pm installer/data/mysql/kohastructure.sql installer/data/mysql/updatedatabase.pl acqui/updatesupplier.pl acqui/supplier.pl acqui/parcels.pl t/db_dependent/Bookseller.t acqui/invoice.pl - total_gste_shipment and total_gsti_shipment calcul changed koha-tmpl/intranet-tmpl/prog/en/modiles/acqui/supplier.tt - Shipping tax rate and shipping include tax or don't include tax, added koha-tmpl/intranet-tmpl/prog/en/modiles/acqui/parcels.tt - "(tax exc.)" or "(tax inc)" added beside "Shipping cost". koha-tmpl/intranet-tmpl/prog/en/modiles/acqui/invoice.tt - if shipping "tax exc", add "Shipping cost (tax inc)" below "Shipping cost" 0) Apply the patch 1) Run updatedatabase.pl to add the two columns to aqbooksellers 2) Add some tax rates in gist preferences 3) Edit a vendor 4) Chose shipping prices: include tax or not 5) Chose a shipping tax rate 6) Save 7) Create an order in a vendor's basket 8) click button receive shipment 9) Validate "(tax exc.)" or "(tax inc)" added beside "Shipping cost". 10) Click link "Receive order" in pending orders 11) Save 12) Click Finish receiving 13) Validate shipping "tax ex", add "Shipping cost (tax inc)" below "Shipping cost" if shipping "tax exc". 14) Validate last line "Total + Shipment cost (CDN)"
Today I've tried to apply the patch against master 3.17.00.016 There has been a conflict: Applying: Bug 11062 - Invoice's shipment/shipping cost should be included PRE-gst tax (as an option) Using index info to reconstruct a base tree... Falling back to patching base and 3-way merge... Auto-merging t/db_dependent/Bookseller.t Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt Auto-merging installer/data/mysql/updatedatabase.pl CONFLICT (content): Merge conflict in installer/data/mysql/updatedatabase.pl Auto-merging installer/data/mysql/kohastructure.sql Auto-merging acqui/updatesupplier.pl Auto-merging acqui/supplier.pl CONFLICT (content): Merge conflict in acqui/supplier.pl Auto-merging C4/Bookseller.pm CONFLICT (content): Merge conflict in C4/Bookseller.pm Failed to merge in the changes. Patch failed at 0001 Bug 11062 - Invoice's shipment/shipping cost should be included PRE-gst tax (as an option) So I pass the patch to "Patch doesn't apply" status.
Most part of this feature is going to be implemented by the Jonathan Druart's GST refactoring work. See http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12825 We will wait his development to be upstreamed before working again on this one.
Created attachment 35994 [details] [review] Bug 11062: rename shipmentcost with shipping For more consistency, the shipmentcost variables and labels will be renamed with shipping.
Created attachment 35995 [details] [review] Bug 11062: Fill shipping tax excluded This patch adds the ability to enter the shipping tax excluded. Note that the total will continue to be calculated using the shipping tax included.
Created attachment 35996 [details] [review] Bug 11062: Update DB entry 3 new DB field: aqbooksellers.invoiceincgst aqbooksellers.shipping_tax_rate aqinvoices.shipping_tax_rate 1 DB field renamed aqinvoices.shipmentcost => aqinvoices.shipping
Patches to apply on top of kohac/ft/bug_13323 (cf bug 13323 for more information).
Could this be revived now that bug 13323 has been closed?