View | Details | Raw Unified | Return to bug 30563
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/add-syspref-RequireCashRegister.pl (+17 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => '30563',
5
    description => 'Add system preference RequireCashRegister',
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
10
        $dbh->do(q{
11
            INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`)
12
            VALUES ('RequireCashRegister', '0', NULL, 'Require a cash register when collecting a payment', 'YesNo')
13
        });
14
15
        say $out 'System preference RequireCashRegister added';
16
    },
17
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 568-573 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
568
('RentalsInNoissuesCharge','1',NULL,'Rental charges block checkouts (added to noissuescharge).','YesNo'),
568
('RentalsInNoissuesCharge','1',NULL,'Rental charges block checkouts (added to noissuescharge).','YesNo'),
569
('ReplyToDefault','',NULL,'Use this email address as the replyto in emails','Free'),
569
('ReplyToDefault','',NULL,'Use this email address as the replyto in emails','Free'),
570
('ReportsLog','0',NULL,'If ON, log information about reports.','YesNo'),
570
('ReportsLog','0',NULL,'If ON, log information about reports.','YesNo'),
571
('RequireCashRegister','0',NULL,'Require a cash register when collecting a payment','YesNo'),
571
('RequireStrongPassword','1','','Require a strong login password for staff and patrons','YesNo'),
572
('RequireStrongPassword','1','','Require a strong login password for staff and patrons','YesNo'),
572
('ReservesControlBranch','PatronLibrary','ItemHomeLibrary|PatronLibrary','Branch checked for members reservations rights','Choice'),
573
('ReservesControlBranch','PatronLibrary','ItemHomeLibrary|PatronLibrary','Branch checked for members reservations rights','Choice'),
573
('ReservesMaxPickUpDelay','7','','Define the Maximum delay to pick up an item on hold','Integer'),
574
('ReservesMaxPickUpDelay','7','','Define the Maximum delay to pick up an item on hold','Integer'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/accounting.pref (+8 lines)
Lines 26-31 Accounting: Link Here
26
                1: "Use"
26
                1: "Use"
27
                0: "Don't use"
27
                0: "Don't use"
28
            - " cash registers with the accounting system to track payments."
28
            - " cash registers with the accounting system to track payments."
29
        -
30
            - "When collecting a payment, "
31
            - pref: RequireCashRegister
32
              default: no
33
              choices:
34
                no: "require a cash register only when the CASH payment type is selected"
35
                yes: "always require a cash register"
36
            - " (Requires UseCashRegisters)"
29
        -
37
        -
30
            - pref: EnablePointOfSale
38
            - pref: EnablePointOfSale
31
              default: no
39
              default: no
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt (-6 / +24 lines)
Lines 187-197 Link Here
187
187
188
    [% IF Koha.Preference('UseCashRegisters') %]
188
    [% IF Koha.Preference('UseCashRegisters') %]
189
    <li>
189
    <li>
190
        <label for="cash_register">Cash register: </label>
190
        [% IF Koha.Preference('RequireCashRegister') %]
191
        <select name="cash_register" id="cash_register">
191
            <label for="cash_register" class="required">
192
        [% ELSE %]
193
            <label for="cash_register">
194
        [% END %]
195
            Cash register:
196
        </label>
197
198
        [% IF Koha.Preference('RequireCashRegister') %]
199
            <select name="cash_register" id="cash_register" required>
200
        [% ELSE %]
201
            <select name="cash_register" id="cash_register">
202
        [% END %]
192
            <option id="noregister" disabled selected="selected" value="">-- Select an option--</option>
203
            <option id="noregister" disabled selected="selected" value="">-- Select an option--</option>
193
            [% PROCESS options_for_registers %]
204
            [% PROCESS options_for_registers %]
194
        </select>
205
        </select>
206
207
        [% IF Koha.Preference('RequireCashRegister') %]
208
            <span class="required">Required</span>
209
        [% END %]
195
    </li>
210
    </li>
196
    [% END %]
211
    [% END %]
197
</ol>
212
</ol>
Lines 420-428 Link Here
420
                    },
435
                    },
421
                    [% IF Koha.Preference('UseCashRegisters') %]
436
                    [% IF Koha.Preference('UseCashRegisters') %]
422
                    cash_register: {
437
                    cash_register: {
423
                        required: function() {
438
                        [% IF Koha.Preference('RequireCashRegister') %]
424
                            return $('#payment_type').val() == 'CASH'
439
                            required: true
425
                        }
440
                        [% ELSE %]
441
                            required: function() {
442
                                return $('#payment_type').val() == 'CASH'
443
                            }
444
                        [% END %]
426
                    }
445
                    }
427
                    [% END %]
446
                    [% END %]
428
                },
447
                },
429
- 

Return to bug 30563