Now we need to calculate the prices (ecost, rrp, unitprice) and tax
(tax_rate, tax_value) when the price is set for an order.
This only appends in the 3 files impacted by this patch.
addorder*.pl on ordering
finishreceive.pl on receiving
Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>
Signed-off-by: Francois Charbonnier <francois.charbonnier@inlibro.com>
Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Sonia Bouis <koha@univ-lyon3.fr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
$orderinfo->{unitprice} = $orderinfo->{ecost} if not defined $orderinfo->{unitprice} or $orderinfo->{unitprice} eq '';
+ $orderinfo = C4::Acquisition::populate_order_with_prices(
+ {
+ order => $orderinfo,
+ booksellerid => $orderinfo->{booksellerid},
+ ordering => 1,
+ }
+ );
+
# if we already have $ordernumber, then it's an ordermodif
my $order = Koha::Acquisition::Order->new($orderinfo);
if ( $orderinfo->{ordernumber} ) {
# remove uncertainprice flag if we have found a price in the MARC record
$orderinfo{uncertainprice} = 0 if $orderinfo{listprice};
+
+ %orderinfo = %{
+ C4::Acquisition::populate_order_with_prices(
+ {
+ order => \%orderinfo,
+ booksellerid => $booksellerid,
+ ordering => 1,
+ receiving => 1,
+ }
+ )
+ };
+
my $order = Koha::Acquisition::Order->new( \%orderinfo )->insert;
# 4th, add items if applicable
}
}
+ $order = C4::Acquisition::populate_order_with_prices(
+ {
+ order => $order,
+ booksellerid => $booksellerid,
+ receiving => 1
+ }
+ );
+
# save the quantity received.
if ( $quantityrec > 0 ) {
( $datereceived, $new_ordernumber ) = ModReceiveOrder(