- my $AcqCreateItem = C4::Context->preference('AcqCreateItem');
- if ($AcqCreateItem eq 'receiving') {
- $template->param(
- AcqCreateItemReceiving => 1,
- UniqueItemFields => C4::Context->preference('UniqueItemFields'),
- );
- } elsif ($AcqCreateItem eq 'ordering') {
- my $fw = ($acq_fw) ? 'ACQ' : '';
- my @itemnumbers = GetItemnumbersFromOrder($order->{ordernumber});
- my @items;
- foreach (@itemnumbers) {
- my $item = GetItem($_);
- if($item->{homebranch}) {
- $item->{homebranchname} = GetBranchName($item->{homebranch});
- }
- if($item->{holdingbranch}) {
- $item->{holdingbranchname} = GetBranchName($item->{holdingbranch});
- }
- if(my $code = GetAuthValCode("items.notforloan", $fw)) {
- $item->{notforloan} = GetKohaAuthorisedValueLib($code, $item->{notforloan});
- }
- if(my $code = GetAuthValCode("items.restricted", $fw)) {
- $item->{restricted} = GetKohaAuthorisedValueLib($code, $item->{restricted});
- }
- if(my $code = GetAuthValCode("items.location", $fw)) {
- $item->{location} = GetKohaAuthorisedValueLib($code, $item->{location});
- }
- if(my $code = GetAuthValCode("items.ccode", $fw)) {
- $item->{collection} = GetKohaAuthorisedValueLib($code, $item->{ccode});
- }
- if(my $code = GetAuthValCode("items.materials", $fw)) {
- $item->{materials} = GetKohaAuthorisedValueLib($code, $item->{materials});
- }
- my $itemtype = getitemtypeinfo($item->{itype});
- $item->{itemtype} = $itemtype->{description};
- push @items, $item;
- }
- $template->param(items => \@items);
- }
-
- $order->{quantityreceived} = '' if $order->{quantityreceived} == 0;
- $order->{unitprice} = '' if $order->{unitprice} == 0;
-
- my $rrp;
- my $ecost;
- my $unitprice;
- if ( $bookseller->{listincgst} ) {
- if ( $bookseller->{invoiceincgst} ) {
- $rrp = $order->{rrp};
- $ecost = $order->{ecost};
- $unitprice = $order->{unitprice};
- } else {
- $rrp = $order->{rrp} / ( 1 + $order->{gstrate} );
- $ecost = $order->{ecost} / ( 1 + $order->{gstrate} );
- $unitprice = $order->{unitprice} / ( 1 + $order->{gstrate} );
- }
- } else {
- if ( $bookseller->{invoiceincgst} ) {
- $rrp = $order->{rrp} * ( 1 + $order->{gstrate} );
- $ecost = $order->{ecost} * ( 1 + $order->{gstrate} );
- $unitprice = $order->{unitprice} * ( 1 + $order->{gstrate} );
- } else {
- $rrp = $order->{rrp};
- $ecost = $order->{ecost};
- $unitprice = $order->{unitprice};
- }
- }