1 $DBversion = 'XXX'; # will be replaced by the RM
2 if( CheckVersion( $DBversion ) ) {
5 INSERT IGNORE INTO account_offset_types ( type ) VALUES ( 'Purchase' );
9 INSERT IGNORE INTO account_credit_types ( code, description, can_be_added_manually, is_system )
10 VALUES ('PURCHASE', 'Purchase', 0, 1);
13 my $sth = $dbh->prepare(q{
14 SELECT COUNT(*) FROM authorised_values WHERE category = 'PAYMENT_TYPE' AND authorised_value = 'CASH'
17 my $already_exists = $sth->fetchrow;
18 if ( not $already_exists ) {
20 INSERT INTO authorised_values (category,authorised_value,lib) VALUES ('PAYMENT_TYPE','CASH','Cash')
24 # Updating field in account_debit_types
25 unless ( column_exists('account_debit_types', 'can_be_invoiced') ) {
28 ALTER TABLE account_debit_types
30 can_be_added_manually can_be_invoiced tinyint(1) NOT NULL DEFAULT 1
34 unless ( column_exists('account_debit_types', 'can_be_sold') ) {
37 ALTER IGNORE TABLE account_debit_types
39 can_be_sold tinyint(1) DEFAULT 0
47 INSERT IGNORE INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`, `lang`) VALUES
48 ('pos', 'RECEIPT', '', 'Point of sale receipt', 0, 'Receipt', '[% PROCESS "accounts.inc" %]
50 [% IF ( LibraryName ) %]
52 <th colspan="2" class="centerednames">
53 <h3>[% LibraryName | html %]</h3>
58 <th colspan="2" class="centerednames">
59 <h2>[% Branches.GetName( payment.branchcode ) | html %]</h2>
63 <th colspan="2" class="centerednames">
64 <h3>[% payment.date | $KohaDates %]</h3>
67 <td>Transaction ID: </td>
68 <td>[% payment.accountlines_id %]</td>
71 <td>Operator ID: </td>
72 <td>[% payment.manager_id %]</td>
75 <td>Payment type: </td>
76 <td>[% payment.payment_type %]</td>
80 <th colspan="2" class="centerednames">
81 <h2><u>Fee receipt</u></h2>
86 <th>Description of charges</th>
90 [% FOREACH offset IN offsets %]
92 <td>[% PROCESS account_type_description account=offset.debit %]</td>
93 <td>[% offset.amount * -1 | $Price %]</td>
98 <tr class="highlight">
100 <td>[% payment.amount * -1| $Price %]</td>
104 <td>[% collected | $Price %]</td>
108 <td>[% change | $Price %]</td>
111 </table>', 'print', 'default');
114 SetVersion( $DBversion );
115 print "Upgrade to $DBversion done (Bug 23354 - Add 'Purchase' account offset type)\n";
116 print "Upgrade to $DBversion done (Bug 23354 - Add 'RECEIPT' notice for Point of Sale)\n";