Order.pm (interchange-5.8.2) | : | Order.pm (interchange-5.10.0) | ||
---|---|---|---|---|
skipping to change at line 2129 | skipping to change at line 2129 | |||
} | } | |||
} | } | |||
foreach $i (0 .. $#$cart) { | foreach $i (0 .. $#$cart) { | |||
#::logDebug("updating line $i quantity: " . ::uneval($cart->[$i])); | #::logDebug("updating line $i quantity: " . ::uneval($cart->[$i])); | |||
my $line = $cart->[$i]; | my $line = $cart->[$i]; | |||
$line->{mv_ip} = $i; | $line->{mv_ip} = $i; | |||
$quantity = $CGI::values{"quantity$i"}; | $quantity = $CGI::values{"quantity$i"}; | |||
next unless defined $quantity; | next unless defined $quantity; | |||
my $do_update; | my $do_update; | |||
## Allow explicit negative numbers in items | ||||
my $intro = ''; | ||||
$line->{mv_negative} and $intro = '-?'; | ||||
my $old_item = $old_items{$i} ||= { %$line } if $raise_event; | my $old_item = $old_items{$i} ||= { %$line } if $raise_event; | |||
if ($quantity =~ m/^\d*$/) { | if ($quantity =~ m/^$intro\d*$/) { | |||
$line->{'quantity'} = $quantity || 0; | $line->{'quantity'} = $quantity || 0; | |||
$do_update = 1; | $do_update = 1; | |||
$altered_items{$i} = 1 | $altered_items{$i} = 1 | |||
if $quantity_raise_event | if $quantity_raise_event | |||
and $line->{quantity} != $old_item->{quantity}; | and $line->{quantity} != $old_item->{quantity}; | |||
} | } | |||
elsif ($quantity =~ m/^[\d.]+$/ | elsif ($quantity =~ m/^$intro[\d.]+$/ | |||
and $Vend::Cfg->{FractionalItems} ) { | and $Vend::Cfg->{FractionalItems} ) { | |||
$line->{'quantity'} = $quantity; | $line->{'quantity'} = $quantity; | |||
$do_update = 1; | $do_update = 1; | |||
$altered_items{$i} = 1 | $altered_items{$i} = 1 | |||
if $quantity_raise_event | if $quantity_raise_event | |||
and $line->{quantity} != $old_item->{quantity}; | and $line->{quantity} != $old_item->{quantity}; | |||
} | } | |||
# This allows a last-positioned input of item quantity to | # This allows a last-positioned input of item quantity to | |||
# remove the item | # remove the item | |||
elsif ($quantity =~ s/.*\00$/0/) { | elsif ($quantity =~ s/.*\00$/0/) { | |||
End of changes. 3 change blocks. | ||||
2 lines changed or deleted | 7 lines changed or added |