diff --git a/C4/Circulation.pm b/C4/Circulation.pm index b5a5172de1..bb5b718233 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -3336,9 +3336,10 @@ sub GetOfflineOperation { } sub AddOfflineOperation { + my ( $userid, $branchcode, $timestamp, $action, $barcode, $cardnumber, $amount ) = @_; my $dbh = C4::Context->dbh; - my $sth = $dbh->prepare("INSERT INTO pending_offline_operations (userid, branchcode, timestamp, action, barcode, cardnumber) VALUES(?,?,?,?,?,?)"); - $sth->execute( @_ ); + my $sth = $dbh->prepare("INSERT INTO pending_offline_operations (userid, branchcode, timestamp, action, barcode, cardnumber, amount) VALUES(?,?,?,?,?,?,?)"); + $sth->execute( $userid, $branchcode, $timestamp, $action, $barcode, $cardnumber, $amount ); return "Added."; } @@ -3357,6 +3358,8 @@ sub ProcessOfflineOperation { $report = ProcessOfflineReturn( $operation ); } elsif ( $operation->{action} eq 'issue' ) { $report = ProcessOfflineIssue( $operation ); + } elsif ( $operation->{action} eq 'payment' ) { + $report = ProcessOfflinePayment( $operation ); } DeleteOfflineOperation( $operation->{operationid} ) if $operation->{operationid}; @@ -3426,6 +3429,16 @@ sub ProcessOfflineIssue { } } +sub ProcessOfflinePayment { + my $operation = shift; + + my $borrower = C4::Members::GetMemberDetails( undef, $operation->{cardnumber} ); # Get borrower from operation cardnumber + my $amount = $operation->{amount}; + + recordpayment( $borrower->{borrowernumber}, $amount ); + + return "Success." +} =head2 TransferSlip diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index c74c39bbc5..15eb4d7f1b 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1559,17 +1559,17 @@ CREATE TABLE `patronimage` ( -- information related to patron images -- so MyISAM is better in this case DROP TABLE IF EXISTS `pending_offline_operations`; -CREATE TABLE `pending_offline_operations` ( - `operationid` int(11) NOT NULL AUTO_INCREMENT, - `userid` varchar(30) NOT NULL, - `branchcode` varchar(10) NOT NULL, +CREATE TABLE pending_offline_operations ( + operationid int(11) NOT NULL AUTO_INCREMENT, + userid varchar(30) NOT NULL, + branchcode varchar(10) NOT NULL, `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `action` varchar(10) NOT NULL, - `barcode` varchar(20) NOT NULL, - `cardnumber` varchar(16) DEFAULT NULL, - PRIMARY KEY (`operationid`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - + barcode varchar(20) DEFAULT NULL, + cardnumber varchar(16) DEFAULT NULL, + amount decimal(28,6) DEFAULT NULL, + PRIMARY KEY (operationid) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 8a6a5b8e2b..8cb05398ff 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -5828,8 +5828,6 @@ if(C4::Context->preference("Version") < TransformToNum($DBversion) ) { SetVersion($DBversion); } - - $DBversion = "3.09.00.050"; if (C4::Context->preference("Version") < TransformToNum($DBversion)) { $dbh->do("ALTER TABLE authorised_values MODIFY category varchar(16) NOT NULL DEFAULT '';"); @@ -6528,6 +6526,13 @@ if ( CheckVersion($DBversion) ) { $DBversion = "3.11.00.100"; if (C4::Context->preference("Version") < TransformToNum($DBversion)) { print "Upgrade to $DBversion done (3.12-alpha release)\n"; +} + +$DBversion = "3.11.00.XXX"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("ALTER TABLE `pending_offline_operations` CHANGE `barcode` `barcode` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL"); + $dbh->do("ALTER TABLE `pending_offline_operations` ADD `amount` DECIMAL( 28, 6 ) NULL DEFAULT NULL"); + print "Upgrade to $DBversion done (Bug 8220 - Allow koc uploads to go to process queue)\n"; SetVersion ($DBversion); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt index cb0662a2de..f5e82b4a83 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt @@ -53,8 +53,12 @@
Your file was processed.
+ +[% FOREACH message IN messages %] + [% IF ( message.message ) %] + [% IF ( message.ERROR_file_version ) %] +Warning: This file is version [% message.upload_version %], but I only know how to import version [% message.current_version %]. I'll try my best.
+ [% END %] + [% END %] +[% END %] + + + + + +