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

(-)a/installer/data/mysql/atomicupdate/bug_23049_debit.perl (-4 / +4 lines)
Lines 4-10 if ( CheckVersion($DBversion) ) { Link Here
4
    $dbh->do(
4
    $dbh->do(
5
        qq{
5
        qq{
6
            CREATE TABLE IF NOT EXISTS account_debit_types (
6
            CREATE TABLE IF NOT EXISTS account_debit_types (
7
              code varchar(16) NOT NULL,
7
              code varchar(64) NOT NULL,
8
              description varchar(200) NULL,
8
              description varchar(200) NULL,
9
              can_be_added_manually tinyint(4) NOT NULL DEFAULT '1',
9
              can_be_added_manually tinyint(4) NOT NULL DEFAULT '1',
10
              default_amount decimal(28, 6) NULL,
10
              default_amount decimal(28, 6) NULL,
Lines 16-22 if ( CheckVersion($DBversion) ) { Link Here
16
    $dbh->do(
16
    $dbh->do(
17
        qq{
17
        qq{
18
            CREATE TABLE IF NOT EXISTS ac_debit_types_branches (
18
            CREATE TABLE IF NOT EXISTS ac_debit_types_branches (
19
                debit_type_code VARCHAR(16),
19
                debit_type_code VARCHAR(64),
20
                branchcode VARCHAR(10),
20
                branchcode VARCHAR(10),
21
                FOREIGN KEY (debit_type_code) REFERENCES account_debit_types(code) ON DELETE CASCADE,
21
                FOREIGN KEY (debit_type_code) REFERENCES account_debit_types(code) ON DELETE CASCADE,
22
                FOREIGN KEY (branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE
22
                FOREIGN KEY (branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE
Lines 58-64 if ( CheckVersion($DBversion) ) { Link Here
58
              can_be_added_manually
58
              can_be_added_manually
59
            )
59
            )
60
            SELECT
60
            SELECT
61
              SUBSTR(authorised_value, 1, 16),
61
              SUBSTR(authorised_value, 1, 64),
62
              lib,
62
              lib,
63
              authorised_value,
63
              authorised_value,
64
              1
64
              1
Lines 73-79 if ( CheckVersion($DBversion) ) { Link Here
73
        qq{
73
        qq{
74
            ALTER IGNORE TABLE accountlines
74
            ALTER IGNORE TABLE accountlines
75
            ADD
75
            ADD
76
              debit_type varchar(16) DEFAULT NULL
76
              debit_type varchar(64) DEFAULT NULL
77
            AFTER
77
            AFTER
78
              accounttype
78
              accounttype
79
          }
79
          }
(-)a/installer/data/mysql/kohastructure.sql (-3 / +3 lines)
Lines 2627-2633 CREATE TABLE `cash_registers` ( Link Here
2627
2627
2628
DROP TABLE IF EXISTS `account_debit_types`;
2628
DROP TABLE IF EXISTS `account_debit_types`;
2629
CREATE TABLE `account_debit_types` (
2629
CREATE TABLE `account_debit_types` (
2630
  `code` varchar(16) NOT NULL,
2630
  `code` varchar(64) NOT NULL,
2631
  `default_amount` decimal(28,6) DEFAULT NULL,
2631
  `default_amount` decimal(28,6) DEFAULT NULL,
2632
  `description` varchar(200) DEFAULT NULL,
2632
  `description` varchar(200) DEFAULT NULL,
2633
  `can_be_added_manually` tinyint(4) NOT NULL DEFAULT '1',
2633
  `can_be_added_manually` tinyint(4) NOT NULL DEFAULT '1',
Lines 2640-2646 CREATE TABLE `account_debit_types` ( Link Here
2640
2640
2641
DROP TABLE IF EXISTS `ac_debit_types_branches`;
2641
DROP TABLE IF EXISTS `ac_debit_types_branches`;
2642
CREATE TABLE `ac_debit_types_branches` (
2642
CREATE TABLE `ac_debit_types_branches` (
2643
    `debit_type_code` VARCHAR(16),
2643
    `debit_type_code` VARCHAR(64),
2644
    `branchcode` VARCHAR(10),
2644
    `branchcode` VARCHAR(10),
2645
    FOREIGN KEY (`debit_type_code`) REFERENCES `account_debit_types` (`code`) ON DELETE CASCADE,
2645
    FOREIGN KEY (`debit_type_code`) REFERENCES `account_debit_types` (`code`) ON DELETE CASCADE,
2646
    FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE
2646
    FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE
Lines 2660-2666 CREATE TABLE `accountlines` ( Link Here
2660
  `amount` decimal(28,6) default NULL,
2660
  `amount` decimal(28,6) default NULL,
2661
  `description` LONGTEXT,
2661
  `description` LONGTEXT,
2662
  `accounttype` varchar(80) default NULL,
2662
  `accounttype` varchar(80) default NULL,
2663
  `debit_type` varchar(16) default NULL,
2663
  `debit_type` varchar(64) default NULL,
2664
  `status` varchar(16) default NULL,
2664
  `status` varchar(16) default NULL,
2665
  `payment_type` varchar(80) default NULL, -- optional authorised value PAYMENT_TYPE
2665
  `payment_type` varchar(80) default NULL, -- optional authorised value PAYMENT_TYPE
2666
  `amountoutstanding` decimal(28,6) default NULL,
2666
  `amountoutstanding` decimal(28,6) default NULL,
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/debit_types.tt (-27 / +24 lines)
Lines 6-23 Link Here
6
[% INCLUDE 'doc-head-open.inc' %]
6
[% INCLUDE 'doc-head-open.inc' %]
7
<title>Koha &rsaquo; Administration &rsaquo;
7
<title>Koha &rsaquo; Administration &rsaquo;
8
    [% IF op =='add_form' %]
8
    [% IF op =='add_form' %]
9
        Account types &rsaquo;
9
       Debit types &rsaquo;
10
       [% IF debit_type.code %]
10
       [% IF debit_type.code %]
11
           Modify account [% type %] type
11
           Modify debit type
12
       [% ELSE %]
12
       [% ELSE %]
13
           New account [% type %] type
13
           New debit type
14
       [% END %]
14
       [% END %]
15
    [% ELSE %]
15
    [% ELSE %]
16
        [% IF op == 'delete_confirm' %]
16
       [% IF op == 'delete_confirm' %]
17
            Account types &rsaquo; Confirm deletion of account [% type %] type
17
           Debit types &rsaquo; Confirm deletion of debit type
18
        [% ELSE %]
18
       [% ELSE %]
19
            Account types
19
           Debit types
20
        [% END %]
20
       [% END %]
21
    [% END %]
21
    [% END %]
22
</title>
22
</title>
23
[% INCLUDE 'doc-head-close.inc' %]
23
[% INCLUDE 'doc-head-close.inc' %]
Lines 30-40 Link Here
30
<div id="breadcrumbs">
30
<div id="breadcrumbs">
31
    <a href="/cgi-bin/koha/mainpage.pl">Home</a>
31
    <a href="/cgi-bin/koha/mainpage.pl">Home</a>
32
&rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
32
&rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
33
&rsaquo; <a href="/cgi-bin/koha/admin/debit_types.pl">Account types</a>
33
&rsaquo; <a href="/cgi-bin/koha/admin/debit_types.pl">Debit types</a>
34
[% IF op == 'add_form' %]
34
[% IF op == 'add_form' %]
35
&rsaquo; [% IF debit_type.code %]Modify[% ELSE %]New[% END %] Account [% type %] type
35
&rsaquo; [% IF debit_type.code %]Modify[% ELSE %]New[% END %] debit type
36
[% ELSIF op == 'delete_confirm' %]
36
[% ELSIF op == 'delete_confirm' %]
37
&rsaquo; Confirm deletion of account [% type %] type
37
&rsaquo; Confirm deletion of debit type
38
[% END %]
38
[% END %]
39
</div>
39
</div>
40
40
Lines 47-59 Link Here
47
                <div class="dialog [% m.type %]">
47
                <div class="dialog [% m.type %]">
48
                    [% SWITCH m.code %]
48
                    [% SWITCH m.code %]
49
                    [% CASE 'error_on_saving' %]
49
                    [% CASE 'error_on_saving' %]
50
                        An error occurred when saving this account type.
50
                        An error occurred when saving this debit type.
51
                    [% CASE 'error_on_delete' %]
51
                    [% CASE 'error_on_delete' %]
52
                        An error occurred when deleting this account type. Check the logs.
52
                        An error occurred when deleting this debit type. Check the logs.
53
                    [% CASE 'success_on_saving' %]
53
                    [% CASE 'success_on_saving' %]
54
                        Account type saved successfully.
54
                        Debit type saved successfully.
55
                    [% CASE 'success_on_delete' %]
55
                    [% CASE 'success_on_delete' %]
56
                        Account type deleted successfully.
56
                        Debit type deleted successfully.
57
                    [% CASE %]
57
                    [% CASE %]
58
                        [% m.code %]
58
                        [% m.code %]
59
                    [% END %]
59
                    [% END %]
Lines 62-70 Link Here
62
62
63
                [% IF op == 'add_form' %]
63
                [% IF op == 'add_form' %]
64
                    [% IF debit_type %]
64
                    [% IF debit_type %]
65
                        <h3>Modify an account [% type %] type</h3>
65
                        <h3>Modify a debit type</h3>
66
                    [% ELSE %]
66
                    [% ELSE %]
67
                        <h3>New account [% type %] type</h3>
67
                        <h3>New debit type</h3>
68
                    [% END %]
68
                    [% END %]
69
69
70
                    <form action="/cgi-bin/koha/admin/debit_types.pl" name="Aform" method="post" class="validated">
70
                    <form action="/cgi-bin/koha/admin/debit_types.pl" name="Aform" method="post" class="validated">
Lines 73-92 Link Here
73
                        <fieldset class="rows">
73
                        <fieldset class="rows">
74
                            <ol>
74
                            <ol>
75
                                <li>
75
                                <li>
76
                                    <label for="code" class="required">Account [% type | html %] type code: </label>
76
                                    <label for="code" class="required">Debit type code: </label>
77
                                    [% IF debit_type %]
77
                                    [% IF debit_type %]
78
                                        <strong>[% debit_type.code | html %]</strong>
78
                                        <strong>[% debit_type.code | html %]</strong>
79
                                        <input type="hidden" name="code" value="[% code %]" />
79
                                        <input type="hidden" name="code" value="[% code %]" />
80
                                    [% ELSE %]
80
                                    [% ELSE %]
81
                                    <input type="text" name="code" id="code" size="10" maxlength="5" class="required" required="required"><span class="required">Required. Maximum length is 16 letters</span>
81
                                    <input type="text" name="code" id="code" size="80" maxlength="64" class="required" required="required"><span class="required">Required. Maximum length is 64 letters</span>
82
                                    [% END %]
82
                                    [% END %]
83
                                </li>
83
                                </li>
84
                                [% IF type == 'debit' %]
85
                                <li>
84
                                <li>
86
                                    <label for="default_amount">Default amount: </label>
85
                                    <label for="default_amount">Default amount: </label>
87
                                    <input type="text" name="default_amount" id="default_amount" size="80" maxlength="100" value="[% debit_type.default_amount | html %]" />
86
                                    <input type="text" pattern="^\d+(\.\d{2})?$" name="default_amount" id="default_amount" size="80" maxlength="100" value="[% debit_type.default_amount | $Price on_editing => 1 %]" step="any" min="0"/>
88
                                </li>
87
                                </li>
89
                                [% END %]
90
                                <li>
88
                                <li>
91
                                    <label for="description" class="required">Description: </label>
89
                                    <label for="description" class="required">Description: </label>
92
                                    <input type="text" name="description" id="description" required="required" class="required" size="80" maxlength="100" value="[% debit_type.description | html %]" /> <span class="required">Required</span>
90
                                    <input type="text" name="description" id="description" required="required" class="required" size="80" maxlength="100" value="[% debit_type.description | html %]" /> <span class="required">Required</span>
Lines 125-136 Link Here
125
123
126
                [% IF op == 'delete_confirm' %]
124
                [% IF op == 'delete_confirm' %]
127
                    <div class="dialog alert">
125
                    <div class="dialog alert">
128
                        <h3>Delete account [% type | html %] type "[% debit_type.description | html %]?"</h3>
126
                        <h3>Delete debit type "[% debit_type.description | html %]?"</h3>
129
                        <table>
127
                        <table>
130
                            <tr><th>Account type code</th>
128
                            <tr><th>Debit type code</th>
131
                                <td>[% debit_type.code | html %]</td>
129
                                <td>[% debit_type.code | html %]</td>
132
                            </tr>
130
                            </tr>
133
                            <tr><th>Account type description</th>
131
                            <tr><th>Debit type description</th>
134
                                <td>[% debit_type.description | html %]</td>
132
                                <td>[% debit_type.description | html %]</td>
135
                            </tr>
133
                            </tr>
136
                        </table>
134
                        </table>
Lines 156-162 Link Here
156
                        <table id="table_debit_types">
154
                        <table id="table_debit_types">
157
                            <thead>
155
                            <thead>
158
                                <th>System</th>
156
                                <th>System</th>
159
                                <th>Account type code</th>
157
                                <th>Code</th>
160
                                <th>Description</th>
158
                                <th>Description</th>
161
                                <th>Default amount</th>
159
                                <th>Default amount</th>
162
                                <th>Can be added manually</th>
160
                                <th>Can be added manually</th>
163
- 

Return to bug 23049