quantityreceived drives other parts of acq noticeably budget balances
ensure that a number (usually 0) is set in NewOrder
give field a valid default and set as not null
reinterpret exsting nulls in table as zero
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
$orderinfo->{'subscription'} = 0;
}
$orderinfo->{'entrydate'} ||= C4::Dates->new()->output("iso");
+ if (!$orderinfo->{quantityreceived}) {
+ $orderinfo->{quantityreceived} = 0;
+ }
my $ordernumber=InsertInTable("aqorders",$orderinfo);
return ( $orderinfo->{'basketno'}, $ordernumber );
SetVersion ($DBversion);
}
+$DBversion = '3.01.00.115';
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do('UPDATE aqorders SET quantityreceived = 0 WHERE quantityreceived IS NULL');
+ $dbh->do('ALTER TABLE aqorders MODIFY COLUMN quantityreceived smallint(6) NOT NULL DEFAULT 0');
+ print "Upgrade to $DBversion done ( Default aqorders.quantityreceived to 0 )\n";
+ SetVersion ($DBversion);
+}
=item DropAllForeignKeys($table)
use strict;
sub kohaversion {
- our $VERSION = '3.01.00.114';
+ our $VERSION = '3.01.00.115';
# version needs to be set this way
# so that it can be picked up by Makefile.PL
# during install