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 567-572 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
567
('RentalsInNoissuesCharge','1',NULL,'Rental charges block checkouts (added to noissuescharge).','YesNo'),
567
('RentalsInNoissuesCharge','1',NULL,'Rental charges block checkouts (added to noissuescharge).','YesNo'),
568
('ReplyToDefault','',NULL,'Use this email address as the replyto in emails','Free'),
568
('ReplyToDefault','',NULL,'Use this email address as the replyto in emails','Free'),
569
('ReportsLog','0',NULL,'If ON, log information about reports.','YesNo'),
569
('ReportsLog','0',NULL,'If ON, log information about reports.','YesNo'),
570
('RequireCashRegister','0',NULL,'Require a cash register when collecting a payment','YesNo'),
570
('RequireStrongPassword','1','','Require a strong login password for staff and patrons','YesNo'),
571
('RequireStrongPassword','1','','Require a strong login password for staff and patrons','YesNo'),
571
('ReservesControlBranch','PatronLibrary','ItemHomeLibrary|PatronLibrary','Branch checked for members reservations rights','Choice'),
572
('ReservesControlBranch','PatronLibrary','ItemHomeLibrary|PatronLibrary','Branch checked for members reservations rights','Choice'),
572
('ReservesMaxPickUpDelay','7','','Define the Maximum delay to pick up an item on hold','Integer'),
573
('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 170-180 Link Here
170
170
171
    [% IF Koha.Preference('UseCashRegisters') %]
171
    [% IF Koha.Preference('UseCashRegisters') %]
172
    <li>
172
    <li>
173
        <label for="cash_register">Cash register: </label>
173
        [% IF Koha.Preference('RequireCashRegister') %]
174
        <select name="cash_register" id="cash_register">
174
            <label for="cash_register" class="required">
175
        [% ELSE %]
176
            <label for="cash_register">
177
        [% END %]
178
            Cash register:
179
        </label>
180
181
        [% IF Koha.Preference('RequireCashRegister') %]
182
            <select name="cash_register" id="cash_register" required>
183
        [% ELSE %]
184
            <select name="cash_register" id="cash_register">
185
        [% END %]
175
            <option id="noregister" disabled selected="selected" value="">-- Select an option--</option>
186
            <option id="noregister" disabled selected="selected" value="">-- Select an option--</option>
176
            [% PROCESS options_for_registers %]
187
            [% PROCESS options_for_registers %]
177
        </select>
188
        </select>
189
190
        [% IF Koha.Preference('RequireCashRegister') %]
191
            <span class="required">Required</span>
192
        [% END %]
178
    </li>
193
    </li>
179
    [% END %]
194
    [% END %]
180
</ol>
195
</ol>
Lines 403-411 Link Here
403
                    },
418
                    },
404
                    [% IF Koha.Preference('UseCashRegisters') %]
419
                    [% IF Koha.Preference('UseCashRegisters') %]
405
                    cash_register: {
420
                    cash_register: {
406
                        required: function() {
421
                        [% IF Koha.Preference('RequireCashRegister') %]
407
                            return $('#payment_type').val() == 'CASH'
422
                            required: true
408
                        }
423
                        [% ELSE %]
424
                            required: function() {
425
                                return $('#payment_type').val() == 'CASH'
426
                            }
427
                        [% END %]
409
                    }
428
                    }
410
                    [% END %]
429
                    [% END %]
411
                },
430
                },
412
- 

Return to bug 30563