Lines 849-855
sub parse_input_into_order_line_fields {
Link Here
|
849 |
my $fields = $args->{fields}; |
849 |
my $fields = $args->{fields}; |
850 |
my $marcrecord = $args->{marcrecord}; |
850 |
my $marcrecord = $args->{marcrecord}; |
851 |
|
851 |
|
852 |
my $quantity = $fields->{quantity} || 1; |
852 |
my $quantity = $fields->{quantity} || $fields->{c_quantity} || 1; |
853 |
my @homebranches = $fields->{homebranches} ? @{ $fields->{homebranches} } : (); |
853 |
my @homebranches = $fields->{homebranches} ? @{ $fields->{homebranches} } : (); |
854 |
my @holdingbranches = $fields->{holdingbranches} ? @{ $fields->{holdingbranches} } : (); |
854 |
my @holdingbranches = $fields->{holdingbranches} ? @{ $fields->{holdingbranches} } : (); |
855 |
my @itypes = $fields->{itypes} ? @{ $fields->{itypes} } : (); |
855 |
my @itypes = $fields->{itypes} ? @{ $fields->{itypes} } : (); |
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_id = $fields->{c_budget_id}; |
872 |
my $c_budget_code = $fields->{c_budget_code}; |
873 |
my $c_discount = $fields->{c_discount}; |
873 |
my $c_discount = $fields->{c_discount}; |
874 |
my $c_sort1 = $fields->{c_sort1}; |
874 |
my $c_sort1 = $fields->{c_sort1}; |
875 |
my $c_sort2 = $fields->{c_sort2}; |
875 |
my $c_sort2 = $fields->{c_sort2}; |
Lines 879-887
sub parse_input_into_order_line_fields {
Link Here
|
879 |
# If using the cronjob, we want to default to the account budget if not mapped on the record |
879 |
# If using the cronjob, we want to default to the account budget if not mapped on the record |
880 |
if ( !$client && ( !@budget_codes || scalar(@budget_codes) == 0 ) ) { |
880 |
if ( !$client && ( !@budget_codes || scalar(@budget_codes) == 0 ) ) { |
881 |
for ( 1 .. $quantity ) { |
881 |
for ( 1 .. $quantity ) { |
882 |
my $item_budget = GetBudgetByCode($c_budget_id); |
882 |
my $item_budget = GetBudgetByCode($c_budget_code); |
883 |
if ($item_budget) { |
883 |
if ($item_budget) { |
884 |
push( @budget_codes, $item_budget ); |
884 |
push( @budget_codes, $item_budget->{budget_id} ); |
885 |
} else { |
885 |
} else { |
886 |
push( @budget_codes, $budget_id ); |
886 |
push( @budget_codes, $budget_id ); |
887 |
} |
887 |
} |
Lines 912-918
sub parse_input_into_order_line_fields {
Link Here
|
912 |
basket_id => $basket_id, |
912 |
basket_id => $basket_id, |
913 |
budget_id => $budget_id, |
913 |
budget_id => $budget_id, |
914 |
c_quantity => $c_quantity, |
914 |
c_quantity => $c_quantity, |
915 |
c_budget_id => $c_budget_id, |
915 |
c_budget_code => $c_budget_code, |
916 |
c_discount => $c_discount, |
916 |
c_discount => $c_discount, |
917 |
c_sort1 => $c_sort1, |
917 |
c_sort1 => $c_sort1, |
918 |
c_sort2 => $c_sort2, |
918 |
c_sort2 => $c_sort2, |
Lines 996-1004
sub create_items_and_generate_order_hash {
Link Here
|
996 |
for ( my $i = 0 ; $i < $loop_limit ; $i++ ) { |
996 |
for ( my $i = 0 ; $i < $loop_limit ; $i++ ) { |
997 |
$budget_ids[$i] = $budget_id if !$budget_ids[$i]; # Use default budget if no budget provided |
997 |
$budget_ids[$i] = $budget_id if !$budget_ids[$i]; # Use default budget if no budget provided |
998 |
$budget_hash->{ $budget_ids[$i] }->{quantity} += 1; |
998 |
$budget_hash->{ $budget_ids[$i] }->{quantity} += 1; |
999 |
$budget_hash->{ $budget_ids[$i] }->{price} = @{ $fields->{price} }[$i]; |
999 |
$budget_hash->{ $budget_ids[$i] }->{price} = @{ $fields->{price} }[$i] || $fields->{c_price}; |
1000 |
$budget_hash->{ $budget_ids[$i] }->{replacementprice} = |
1000 |
$budget_hash->{ $budget_ids[$i] }->{replacementprice} = |
1001 |
@{ $fields->{replacementprice} }[$i]; |
1001 |
@{ $fields->{replacementprice} }[$i] || $fields->{c_replacement_price}; |
1002 |
$budget_hash->{ $budget_ids[$i] }->{itemnumbers} //= []; |
1002 |
$budget_hash->{ $budget_ids[$i] }->{itemnumbers} //= []; |
1003 |
push @{ $budget_hash->{ $budget_ids[$i] }->{itemnumbers} }, |
1003 |
push @{ $budget_hash->{ $budget_ids[$i] }->{itemnumbers} }, |
1004 |
$itemnumbers[$i]; |
1004 |
$itemnumbers[$i]; |
Lines 1062-1068
sub create_items_and_generate_order_hash {
Link Here
|
1062 |
basketno => $basket_id, |
1062 |
basketno => $basket_id, |
1063 |
quantity => $fields->{c_quantity}, |
1063 |
quantity => $fields->{c_quantity}, |
1064 |
branchcode => C4::Context->userenv()->{'branch'}, |
1064 |
branchcode => C4::Context->userenv()->{'branch'}, |
1065 |
budget_id => $fields->{c_budget_id}, |
1065 |
budget_id => $fields->{c_budget_code}, |
1066 |
uncertainprice => 1, |
1066 |
uncertainprice => 1, |
1067 |
sort1 => $fields->{c_sort1}, |
1067 |
sort1 => $fields->{c_sort1}, |
1068 |
sort2 => $fields->{c_sort2}, |
1068 |
sort2 => $fields->{c_sort2}, |
Lines 1242-1247
sub _create_item_fields_from_syspref {
Link Here
|
1242 |
c_discount => $marc_fields_to_order->{discount}, |
1242 |
c_discount => $marc_fields_to_order->{discount}, |
1243 |
c_sort1 => $marc_fields_to_order->{sort1}, |
1243 |
c_sort1 => $marc_fields_to_order->{sort1}, |
1244 |
c_sort2 => $marc_fields_to_order->{sort2}, |
1244 |
c_sort2 => $marc_fields_to_order->{sort2}, |
|
|
1245 |
c_replacement_price => $marc_fields_to_order->{replacementprice}, |
1245 |
}; |
1246 |
}; |
1246 |
|
1247 |
|
1247 |
return $item_fields; |
1248 |
return $item_fields; |
1248 |
- |
|
|