Lines 346-357
sub receipt_items {
Link Here
|
346 |
} |
346 |
} |
347 |
push @{ $branch_map{$b} }, $item; |
347 |
push @{ $branch_map{$b} }, $item; |
348 |
} |
348 |
} |
349 |
my $gir_occurence = 0; |
349 |
my $gir_occurrence = 0; |
350 |
while ( $gir_occurence < $quantity ) { |
350 |
while ( $gir_occurrence < $quantity ) { |
351 |
my $branch = $inv_line->girfield( 'branch', $gir_occurence ); |
351 |
my $branch = $inv_line->girfield( 'branch', $gir_occurrence ); |
352 |
my $item = shift @{ $branch_map{$branch} }; |
352 |
my $item = shift @{ $branch_map{$branch} }; |
353 |
if ($item) { |
353 |
if ($item) { |
354 |
my $barcode = $inv_line->girfield( 'barcode', $gir_occurence ); |
354 |
my $barcode = $inv_line->girfield( 'barcode', $gir_occurrence ); |
355 |
if ( $barcode && !$item->barcode ) { |
355 |
if ( $barcode && !$item->barcode ) { |
356 |
my $rs = $schema->resultset('Item')->search( |
356 |
my $rs = $schema->resultset('Item')->search( |
357 |
{ |
357 |
{ |
Lines 373-379
sub receipt_items {
Link Here
|
373 |
else { |
373 |
else { |
374 |
$logger->warn("Unmatched item at branch:$branch"); |
374 |
$logger->warn("Unmatched item at branch:$branch"); |
375 |
} |
375 |
} |
376 |
++$gir_occurence; |
376 |
++$gir_occurrence; |
377 |
} |
377 |
} |
378 |
return; |
378 |
return; |
379 |
|
379 |
|
Lines 657-676
sub quote_item {
Link Here
|
657 |
} |
657 |
} |
658 |
|
658 |
|
659 |
if ( $order_quantity == 1 && $item->quantity > 1 ) { |
659 |
if ( $order_quantity == 1 && $item->quantity > 1 ) { |
660 |
my $occurence = 1; # occ zero already added |
660 |
my $occurrence = 1; # occ zero already added |
661 |
while ( $occurence < $item->quantity ) { |
661 |
while ( $occurrence < $item->quantity ) { |
662 |
|
662 |
|
663 |
# check budget code |
663 |
# check budget code |
664 |
$budget = _get_budget( $schema, |
664 |
$budget = _get_budget( $schema, |
665 |
$item->girfield( 'fund_allocation', $occurence ) ); |
665 |
$item->girfield( 'fund_allocation', $occurrence ) ); |
666 |
|
666 |
|
667 |
if ( !$budget ) { |
667 |
if ( !$budget ) { |
668 |
my $bad_budget = |
668 |
my $bad_budget = |
669 |
$item->girfield( 'fund_allocation', $occurence ); |
669 |
$item->girfield( 'fund_allocation', $occurrence ); |
670 |
carp 'Skipping line with no budget info'; |
670 |
carp 'Skipping line with no budget info'; |
671 |
$logger->trace( |
671 |
$logger->trace( |
672 |
"girfield skipped for invalid budget:$bad_budget"); |
672 |
"girfield skipped for invalid budget:$bad_budget"); |
673 |
++$occurence; ## lets look at the next one not this one again |
673 |
++$occurrence; ## lets look at the next one not this one again |
674 |
next; |
674 |
next; |
675 |
} |
675 |
} |
676 |
|
676 |
|
Lines 703-718
sub quote_item {
Link Here
|
703 |
} |
703 |
} |
704 |
my $new_item = { |
704 |
my $new_item = { |
705 |
itype => |
705 |
itype => |
706 |
$item->girfield( 'stock_category', $occurence ), |
706 |
$item->girfield( 'stock_category', $occurrence ), |
707 |
location => |
707 |
location => |
708 |
$item->girfield( 'collection_code', $occurence ), |
708 |
$item->girfield( 'collection_code', $occurrence ), |
709 |
itemcallnumber => |
709 |
itemcallnumber => |
710 |
$item->girfield( 'shelfmark', $occurence ) |
710 |
$item->girfield( 'shelfmark', $occurrence ) |
711 |
|| $item->girfield( 'classification', $occurence ) |
711 |
|| $item->girfield( 'classification', $occurrence ) |
712 |
|| title_level_class($item), |
712 |
|| title_level_class($item), |
713 |
holdingbranch => |
713 |
holdingbranch => |
714 |
$item->girfield( 'branch', $occurence ), |
714 |
$item->girfield( 'branch', $occurrence ), |
715 |
homebranch => $item->girfield( 'branch', $occurence ), |
715 |
homebranch => $item->girfield( 'branch', $occurrence ), |
716 |
}; |
716 |
}; |
717 |
if ( $new_item->{itype} ) { |
717 |
if ( $new_item->{itype} ) { |
718 |
$item_hash->{itype} = $new_item->{itype}; |
718 |
$item_hash->{itype} = $new_item->{itype}; |
Lines 744-750
sub quote_item {
Link Here
|
744 |
); |
744 |
); |
745 |
} |
745 |
} |
746 |
|
746 |
|
747 |
++$occurence; |
747 |
++$occurrence; |
748 |
} |
748 |
} |
749 |
|
749 |
|
750 |
# increment quantity in orderline for EXISTING budget in $budgets |
750 |
# increment quantity in orderline for EXISTING budget in $budgets |
Lines 772-787
sub quote_item {
Link Here
|
772 |
price => $item->price, |
772 |
price => $item->price, |
773 |
replacementprice => $item->price, |
773 |
replacementprice => $item->price, |
774 |
itype => |
774 |
itype => |
775 |
$item->girfield( 'stock_category', $occurence ), |
775 |
$item->girfield( 'stock_category', $occurrence ), |
776 |
location => |
776 |
location => |
777 |
$item->girfield( 'collection_code', $occurence ), |
777 |
$item->girfield( 'collection_code', $occurrence ), |
778 |
itemcallnumber => |
778 |
itemcallnumber => |
779 |
$item->girfield( 'shelfmark', $occurence ) |
779 |
$item->girfield( 'shelfmark', $occurrence ) |
780 |
|| $item->girfield( 'classification', $occurence ) |
780 |
|| $item->girfield( 'classification', $occurrence ) |
781 |
|| $item_hash->{itemcallnumber}, |
781 |
|| $item_hash->{itemcallnumber}, |
782 |
holdingbranch => |
782 |
holdingbranch => |
783 |
$item->girfield( 'branch', $occurence ), |
783 |
$item->girfield( 'branch', $occurrence ), |
784 |
homebranch => $item->girfield( 'branch', $occurence ), |
784 |
homebranch => $item->girfield( 'branch', $occurrence ), |
785 |
}; |
785 |
}; |
786 |
my $itemnumber; |
786 |
my $itemnumber; |
787 |
( undef, undef, $itemnumber ) = |
787 |
( undef, undef, $itemnumber ) = |
Lines 795-801
sub quote_item {
Link Here
|
795 |
); |
795 |
); |
796 |
} |
796 |
} |
797 |
|
797 |
|
798 |
++$occurence; |
798 |
++$occurrence; |
799 |
} |
799 |
} |
800 |
} |
800 |
} |
801 |
} |
801 |
} |