@@ -, +, @@ --- installer/data/mysql/account_credit_types.sql | 2 ++ installer/data/mysql/atomicupdate/bug_23354.perl | 11 +++++++++++ 2 files changed, 13 insertions(+) --- a/installer/data/mysql/account_credit_types.sql +++ a/installer/data/mysql/account_credit_types.sql @@ -6,3 +6,5 @@ INSERT INTO account_credit_types ( code, description, can_be_added_manually, is_ ('DISCOUNT', 'A discount applied to a patrons fine', 0, 1), ('REFUND', 'A refund applied to a patrons fine', 0, 1), ('LOST_RETURN', 'Lost item fee refund', 0, 1); + +INSERT INTO authorised_values (category,authorised_value,lib) VALUES ('PAYMENT_TYPE','CASH','Cash'); --- a/installer/data/mysql/atomicupdate/bug_23354.perl +++ a/installer/data/mysql/atomicupdate/bug_23354.perl @@ -5,6 +5,17 @@ if( CheckVersion( $DBversion ) ) { INSERT IGNORE INTO account_offset_types ( type ) VALUES ( 'Purchase' ); }); + my $sth = $dbh->prepare(q{ + SELECT COUNT(*) FROM authorised_values WHERE category = 'PAYMENT_TYPE' AND authorised_value = 'CASH' + }); + $sth->execute; + my $already_exists = $sth->fetchrow; + if ( not $already_exists ) { + $dbh->do(q{ + INSERT INTO authorised_values (category,authorised_value,lib) VALUES ('PAYMENT_TYPE','CASH','Cash') + }); + } + # Updating field in account_debit_types unless ( column_exists('account_debit_types', 'can_be_invoiced') ) { $dbh->do( --