Bugzilla – Attachment 31811 Details for
Bug 12975
Refactor VAT and price calculation - basketgroup page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12975: Use the centralize VAT and prices calculation - basketgroup.pl
Bug-12975-Use-the-centralize-VAT-and-prices-calcul.patch (text/plain), 4.11 KB, created by
Jonathan Druart
on 2014-09-22 14:11:22 UTC
(
hide
)
Description:
Bug 12975: Use the centralize VAT and prices calculation - basketgroup.pl
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-09-22 14:11:22 UTC
Size:
4.11 KB
patch
obsolete
>From 1a3e196b3cbb86c37cca8d86de2e20090ccaa030 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Mon, 22 Sep 2014 16:09:14 +0200 >Subject: [PATCH] Bug 12975: Use the centralize VAT and prices calculation - > basketgroup.pl > >Bug 12969 introduces a subroutine to centralize VAT and prices >calculation. >It should be use in the acqui/basketgroup.pl script. > >Test plan: >0/ Don't apply the patch >1/ Create 4 suppliers with the different configurations >2/ Create a basket and create several orders >3/ Close the basket and create the corresponding basket groups. >4/ Print the basket group >5/ Verify you don't see any difference before and after applying the >patch on the pdf file. >--- > acqui/basketgroup.pl | 37 +++++-------------------------------- > 1 file changed, 5 insertions(+), 32 deletions(-) > >diff --git a/acqui/basketgroup.pl b/acqui/basketgroup.pl >index ef62921..4e89c4e 100755 >--- a/acqui/basketgroup.pl >+++ b/acqui/basketgroup.pl >@@ -169,28 +169,7 @@ sub printbasketgrouppdf{ > croak $@; > } > >- $ord->{rrp} = ConvertCurrency( $ord->{'currency'}, $ord->{rrp} ); >- if ( $bookseller->{'listincgst'} ) { >- $ord->{rrpgsti} = sprintf( "%.2f", $ord->{rrp} ); >- $ord->{gstgsti} = sprintf( "%.2f", $ord->{gstrate} * 100 ); >- $ord->{rrpgste} = sprintf( "%.2f", $ord->{rrp} / ( 1 + ( $ord->{gstgsti} / 100 ) ) ); >- $ord->{gstgste} = sprintf( "%.2f", $ord->{gstgsti} / ( 1 + ( $ord->{gstgsti} / 100 ) ) ); >- $ord->{ecostgsti} = sprintf( "%.2f", $ord->{ecost} ); >- $ord->{ecostgste} = sprintf( "%.2f", $ord->{ecost} / ( 1 + ( $ord->{gstgsti} / 100 ) ) ); >- $ord->{gstvalue} = sprintf( "%.2f", ( $ord->{ecostgsti} - $ord->{ecostgste} ) * $ord->{quantity}); >- $ord->{totalgste} = sprintf( "%.2f", $ord->{quantity} * $ord->{ecostgste} ); >- $ord->{totalgsti} = sprintf( "%.2f", $ord->{quantity} * $ord->{ecostgsti} ); >- } else { >- $ord->{rrpgsti} = sprintf( "%.2f", $ord->{rrp} * ( 1 + ( $ord->{gstrate} ) ) ); >- $ord->{rrpgste} = sprintf( "%.2f", $ord->{rrp} ); >- $ord->{gstgsti} = sprintf( "%.2f", $ord->{gstrate} * 100 ); >- $ord->{gstgste} = sprintf( "%.2f", $ord->{gstrate} * 100 ); >- $ord->{ecostgsti} = sprintf( "%.2f", $ord->{ecost} * ( 1 + ( $ord->{gstrate} ) ) ); >- $ord->{ecostgste} = sprintf( "%.2f", $ord->{ecost} ); >- $ord->{gstvalue} = sprintf( "%.2f", ( $ord->{ecostgsti} - $ord->{ecostgste} ) * $ord->{quantity}); >- $ord->{totalgste} = sprintf( "%.2f", $ord->{quantity} * $ord->{ecostgste} ); >- $ord->{totalgsti} = sprintf( "%.2f", $ord->{quantity} * $ord->{ecostgsti} ); >- } >+ $ord = C4::Acquisition::populate_order_with_prices({ order => $ord, booksellerid => $bookseller->{id}, ordering => 1 }); > my $bib = GetBiblioData($ord->{biblionumber}); > my $itemtypes = GetItemTypes(); > >@@ -212,17 +191,11 @@ sub printbasketgrouppdf{ > } > } > >- my $ba_order = { >- isbn => ($ord->{isbn} ? $ord->{isbn} : undef), >- itemtype => ( $ord->{itemtype} and $bib->{itemtype} ? $itemtypes->{$bib->{itemtype}}->{description} : undef ), >- en => ( $en ? $en : undef ), >- edition => ( $edition ? $edition : undef ), >- }; >- for my $key ( qw/ gstrate author title itemtype publishercode copyrightdate publicationyear discount quantity rrpgsti rrpgste gstgsti gstgste ecostgsti ecostgste gstvalue totalgste totalgsti order_vendornote / ) { >- $ba_order->{$key} = $ord->{$key}; >- } >+ $ord->{itemtype} = $ord->{itemtype} and $bib->{itemtype} ? $itemtypes->{$bib->{itemtype}}->{description} : undef; >+ $ord->{en} = $en ? $en : undef; >+ $ord->{edition} = $edition ? $edition : undef; > >- push(@ba_orders, $ba_order); >+ push(@ba_orders, $ord); > } > $orders{$basket->{basketno}} = \@ba_orders; > } >-- >2.1.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12975
:
31811
|
31830
|
31879
|
31981
|
35594