Lines 869-875
sub parse_input_into_order_line_fields {
Link Here
|
869 |
my @enumchrons = $fields->{enumchrons} ? @{ $fields->{enumchrons} } : (); |
869 |
my @enumchrons = $fields->{enumchrons} ? @{ $fields->{enumchrons} } : (); |
870 |
my @budget_codes = $fields->{budget_codes} ? @{ $fields->{budget_codes} } : (); |
870 |
my @budget_codes = $fields->{budget_codes} ? @{ $fields->{budget_codes} } : (); |
871 |
my $c_quantity = $fields->{c_quantity}; |
871 |
my $c_quantity = $fields->{c_quantity}; |
872 |
my $c_budget_code = $fields->{c_budget_code}; |
872 |
my $c_budget = GetBudgetByCode( $fields->{c_budget_code} ); |
|
|
873 |
my $c_budget_code = $c_budget->{budget_id}; |
873 |
my $c_discount = $fields->{c_discount}; |
874 |
my $c_discount = $fields->{c_discount}; |
874 |
my $c_sort1 = $fields->{c_sort1}; |
875 |
my $c_sort1 = $fields->{c_sort1}; |
875 |
my $c_sort2 = $fields->{c_sort2}; |
876 |
my $c_sort2 = $fields->{c_sort2}; |
Lines 919-936
sub parse_input_into_order_line_fields {
Link Here
|
919 |
c_replacement_price => $c_replacement_price, |
920 |
c_replacement_price => $c_replacement_price, |
920 |
c_price => $c_price, |
921 |
c_price => $c_price, |
921 |
marcrecord => $marcrecord, |
922 |
marcrecord => $marcrecord, |
|
|
923 |
tags => $fields->{tags}, |
924 |
subfields => $fields->{subfields}, |
925 |
field_values => $fields->{field_values}, |
926 |
serials => $fields->{serials}, |
927 |
order_vendornote => $fields->{order_vendornote}, |
928 |
order_internalnote => $fields->{order_internalnote}, |
929 |
all_currency => $fields->{all_currency}, |
922 |
}; |
930 |
}; |
923 |
|
931 |
|
924 |
if ($client) { |
|
|
925 |
$order_line_fields->{tags} = $fields->{tags}; |
926 |
$order_line_fields->{subfields} = $fields->{subfields}; |
927 |
$order_line_fields->{field_values} = $fields->{field_values}; |
928 |
$order_line_fields->{serials} = $fields->{serials}; |
929 |
$order_line_fields->{order_vendornote} = $fields->{order_vendornote}; |
930 |
$order_line_fields->{order_internalnote} = $fields->{order_internalnote}; |
931 |
$order_line_fields->{all_currency} = $fields->{all_currency}; |
932 |
} |
933 |
|
934 |
return $order_line_fields; |
932 |
return $order_line_fields; |
935 |
} |
933 |
} |
936 |
|
934 |
|
Lines 962-991
sub create_items_and_generate_order_hash {
Link Here
|
962 |
my $itemcreation = 0; |
960 |
my $itemcreation = 0; |
963 |
my @itemnumbers; |
961 |
my @itemnumbers; |
964 |
|
962 |
|
965 |
for ( my $i = 0 ; $i < $loop_limit ; $i++ ) { |
963 |
if( C4::Context->preference('AcqCreateItem') ne 'cataloguing' ) { |
966 |
$itemcreation = 1; |
964 |
for ( my $i = 0 ; $i < $loop_limit ; $i++ ) { |
967 |
my $item = Koha::Item->new( |
965 |
$itemcreation = 1; |
968 |
{ |
966 |
my $item = Koha::Item->new( |
969 |
biblionumber => $fields->{biblionumber}, |
967 |
{ |
970 |
homebranch => @{ $fields->{homebranch} }[$i], |
968 |
biblionumber => $fields->{biblionumber}, |
971 |
holdingbranch => @{ $fields->{holdingbranch} }[$i], |
969 |
homebranch => @{ $fields->{homebranch} }[$i], |
972 |
itemnotes_nonpublic => @{ $fields->{itemnotes_nonpublic} }[$i], |
970 |
holdingbranch => @{ $fields->{holdingbranch} }[$i], |
973 |
itemnotes => @{ $fields->{itemnotes} }[$i], |
971 |
itemnotes_nonpublic => @{ $fields->{itemnotes_nonpublic} }[$i], |
974 |
location => @{ $fields->{location} }[$i], |
972 |
itemnotes => @{ $fields->{itemnotes} }[$i], |
975 |
ccode => @{ $fields->{ccode} }[$i], |
973 |
location => @{ $fields->{location} }[$i], |
976 |
itype => @{ $fields->{itype} }[$i], |
974 |
ccode => @{ $fields->{ccode} }[$i], |
977 |
notforloan => @{ $fields->{notforloan} }[$i], |
975 |
itype => @{ $fields->{itype} }[$i], |
978 |
uri => @{ $fields->{uri} }[$i], |
976 |
notforloan => @{ $fields->{notforloan} }[$i], |
979 |
copynumber => @{ $fields->{copynumber} }[$i], |
977 |
uri => @{ $fields->{uri} }[$i], |
980 |
price => @{ $fields->{price} }[$i], |
978 |
copynumber => @{ $fields->{copynumber} }[$i], |
981 |
replacementprice => @{ $fields->{replacementprice} }[$i], |
979 |
price => @{ $fields->{price} }[$i], |
982 |
itemcallnumber => @{ $fields->{itemcallnumber} }[$i], |
980 |
replacementprice => @{ $fields->{replacementprice} }[$i], |
983 |
coded_location_qualifier => @{ $fields->{coded_location_qualifier} }[$i], |
981 |
itemcallnumber => @{ $fields->{itemcallnumber} }[$i], |
984 |
barcode => @{ $fields->{barcode} }[$i], |
982 |
coded_location_qualifier => @{ $fields->{coded_location_qualifier} }[$i], |
985 |
enumchron => @{ $fields->{enumchron} }[$i], |
983 |
barcode => @{ $fields->{barcode} }[$i], |
986 |
} |
984 |
enumchron => @{ $fields->{enumchron} }[$i], |
987 |
)->store; |
985 |
} |
988 |
push( @itemnumbers, $item->itemnumber ); |
986 |
)->store; |
|
|
987 |
push( @itemnumbers, $item->itemnumber ); |
988 |
} |
989 |
} |
989 |
} |
990 |
|
990 |
|
991 |
if ( $itemcreation == 1 ) { |
991 |
if ( $itemcreation == 1 ) { |
Lines 1106-1117
sub create_items_and_generate_order_hash {
Link Here
|
1106 |
$order->store; |
1106 |
$order->store; |
1107 |
|
1107 |
|
1108 |
my $basket = Koha::Acquisition::Baskets->find($basket_id); |
1108 |
my $basket = Koha::Acquisition::Baskets->find($basket_id); |
1109 |
if ( $basket->effective_create_items eq 'ordering' && !$basket->is_standing ) { |
1109 |
if ( C4::Context->preference('AcqCreateItem') ne 'cataloguing' && $basket->effective_create_items eq 'ordering' && !$basket->is_standing ) { |
1110 |
my @tags = @{ $fields->{tags} }; |
1110 |
my $tags = $fields->{tags} || []; |
1111 |
my @subfields = @{ $fields->{subfields} }; |
1111 |
my $subfields = $fields->{subfields} || []; |
1112 |
my @field_values = @{ $fields->{field_values} }; |
1112 |
my $field_values = $fields->{field_values} || []; |
1113 |
my @serials = @{ $fields->{serials} }; |
1113 |
my $serials = $fields->{serials} || []; |
1114 |
my $xml = TransformHtmlToXml( \@tags, \@subfields, \@field_values ); |
1114 |
my $xml = TransformHtmlToXml( $tags, $subfields, $field_values ); |
1115 |
my $record = MARC::Record::new_from_xml( $xml, 'UTF-8' ); |
1115 |
my $record = MARC::Record::new_from_xml( $xml, 'UTF-8' ); |
1116 |
for ( my $qtyloop = 1 ; $qtyloop <= $fields->{c_quantity} ; $qtyloop++ ) { |
1116 |
for ( my $qtyloop = 1 ; $qtyloop <= $fields->{c_quantity} ; $qtyloop++ ) { |
1117 |
my ( $biblionumber, undef, $itemnumber ) = |
1117 |
my ( $biblionumber, undef, $itemnumber ) = |