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

(-)a/acqui/invoice.pl (+4 lines)
Lines 103-108 elsif ( $op && $op eq 'mod' ) { Link Here
103
    } elsif ($input->param('close')) {
103
    } elsif ($input->param('close')) {
104
        CloseInvoice($invoiceid);
104
        CloseInvoice($invoiceid);
105
    } elsif ($input->param('merge')) {
105
    } elsif ($input->param('merge')) {
106
107
        output_and_exit( $input, $cookie, $template, 'insufficient_permission' )
108
            unless $logged_in_patron->has_permission( { acquisition => 'merge_invoices' } );
109
106
        my @sources = $input->multi_param('merge');
110
        my @sources = $input->multi_param('merge');
107
        MergeInvoices($invoiceid, \@sources);
111
        MergeInvoices($invoiceid, \@sources);
108
        defined($invoice_files) && $invoice_files->MergeFileRecIds(@sources);
112
        defined($invoice_files) && $invoice_files->MergeFileRecIds(@sources);
(-)a/installer/data/mysql/atomicupdate/bug_24157.perl (-1 / +6 lines)
Lines 20-25 if( CheckVersion( $DBversion ) ) { Link Here
20
        (11, 'delete_invoices', 'Delete invoices')
20
        (11, 'delete_invoices', 'Delete invoices')
21
    |);
21
    |);
22
22
23
    $dbh->do(q|
24
        INSERT IGNORE INTO permissions (module_bit, code, description) VALUES
25
        (11, 'merge_invoices', 'Merge invoices')
26
    |);
27
23
    SetVersion( $DBversion );
28
    SetVersion( $DBversion );
24
    print "Upgrade to $DBversion done (Bug 24157: Add new permissions reopen_closed_invoices, edit_invoices, delete_invoices, delete_baskets)\n";
29
    print "Upgrade to $DBversion done (Bug 24157: Add new permissions reopen_closed_invoices, edit_invoices, delete_invoices, merge_invoices, delete_baskets)\n";
25
}
30
}
(-)a/installer/data/mysql/userpermissions.sql (+1 lines)
Lines 68-73 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
68
   (11, 'reopen_closed_invoices', 'Reopen closed invoices'),
68
   (11, 'reopen_closed_invoices', 'Reopen closed invoices'),
69
   (11, 'edit_invoices', 'Edit invoices'),
69
   (11, 'edit_invoices', 'Edit invoices'),
70
   (11, 'delete_invoices', 'Delete invoices'),
70
   (11, 'delete_invoices', 'Delete invoices'),
71
   (11, 'merge_invoices', 'Merge invoices'),
71
   (11, 'delete_baskets', 'Delete baskets'),
72
   (11, 'delete_baskets', 'Delete baskets'),
72
   (12, 'suggestions_manage', 'Manage purchase suggestions'),
73
   (12, 'suggestions_manage', 'Manage purchase suggestions'),
73
   (13, 'edit_news', 'Write news for the OPAC and staff interfaces'),
74
   (13, 'edit_news', 'Write news for the OPAC and staff interfaces'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc (+5 lines)
Lines 705-710 Link Here
705
            Delete invoices
705
            Delete invoices
706
        </span>
706
        </span>
707
        <span class="permissioncode">([% name | html %])</span>
707
        <span class="permissioncode">([% name | html %])</span>
708
    [%- CASE 'merge_invoices' -%]
709
        <span class="sub_permission merge_invoices_subpermission">
710
            Merge invoices
711
        </span>
712
        <span class="permissioncode">([% name | html %])</span>
708
    [%- CASE 'delete_baskets' -%]
713
    [%- CASE 'delete_baskets' -%]
709
        <span class="sub_permission delete_baskets_subpermission">
714
        <span class="sub_permission delete_baskets_subpermission">
710
            Delete baskets
715
            Delete baskets
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt (-40 / +45 lines)
Lines 30-36 Link Here
30
          <table id="resultst">
30
          <table id="resultst">
31
            <thead>
31
            <thead>
32
              <tr>
32
              <tr>
33
                <th>&nbsp;</th>
33
                [% IF CAN_user_acquisition_merge_invoices %]
34
                  <th>&nbsp;</th>
35
                [% END %]
34
                <th>&nbsp;</th>
36
                <th>&nbsp;</th>
35
                <th>Invoice no.</th>
37
                <th>Invoice no.</th>
36
                <th>Vendor</th>
38
                <th>Vendor</th>
Lines 45-51 Link Here
45
            <tbody>
47
            <tbody>
46
              [% FOREACH invoice IN invoices %]
48
              [% FOREACH invoice IN invoices %]
47
                <tr data-invoiceid="[% invoice.invoiceid | html %]" data-booksellerid="[% invoice.booksellerid | html %]" data-shipmentdate="[% invoice.shipmentdate | $KohaDates %]" data-billingdate="[% invoice.billingdate | $KohaDates %]" data-shipmentcost="[% invoice.shipmentcost | html %]" data-shipment_budgetid="[% invoice.shipmentcost_budgetid | html %]" data-closedate="[% invoice.closedate | $KohaDates %]">
49
                <tr data-invoiceid="[% invoice.invoiceid | html %]" data-booksellerid="[% invoice.booksellerid | html %]" data-shipmentdate="[% invoice.shipmentdate | $KohaDates %]" data-billingdate="[% invoice.billingdate | $KohaDates %]" data-shipmentcost="[% invoice.shipmentcost | html %]" data-shipment_budgetid="[% invoice.shipmentcost_budgetid | html %]" data-closedate="[% invoice.closedate | $KohaDates %]">
48
                  <td>[% invoice.is_linked_to_subscriptions | html %]</td>
50
                  [% IF CAN_user_acquisition_merge_invoices %]
51
                      <td>[% invoice.is_linked_to_subscriptions | html %]</td>
52
                  [% END %]
49
                  <td><input type="checkbox" class="select-invoice" value="[% invoice.invoiceid | html %]" /></td>
53
                  <td><input type="checkbox" class="select-invoice" value="[% invoice.invoiceid | html %]" /></td>
50
                  <td><a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoice.invoiceid | uri %]">[% invoice.invoicenumber | html %]</a></td>
54
                  <td><a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoice.invoiceid | uri %]">[% invoice.invoicenumber | html %]</a></td>
51
                  <td><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% invoice.booksellerid | uri %]">[% invoice.suppliername | html %]</a></td>
55
                  <td><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% invoice.booksellerid | uri %]">[% invoice.suppliername | html %]</a></td>
Lines 101-146 Link Here
101
              [% END %]
105
              [% END %]
102
            </tbody>
106
            </tbody>
103
          </table>
107
          </table>
104
          <a class="submit" id="merge" href="#merge_invoices">Merge selected invoices</a>
108
          [% IF CAN_user_acquisition_merge_invoices %]
105
            <div id="merge_invoices">
109
              <a class="submit" id="merge" href="#merge_invoices">Merge selected invoices</a>
106
                <form id="merge_invoice_form" action="/cgi-bin/koha/acqui/invoice.pl" method="post">
110
              <div id="merge_invoices">
107
                <fieldset class="rows">
111
                  <form id="merge_invoice_form" action="/cgi-bin/koha/acqui/invoice.pl" method="post">
108
                    <ol>
112
                  <fieldset class="rows">
109
                    <li><h2>Merge invoices</h2></li>
113
                      <ol>
110
                    <li><table id="merge_table">
114
                      <li><h2>Merge invoices</h2></li>
111
                        <thead><tr><th>Invoice no.</th><th>Shipment date</th><th>Billing date</th><th>Shipment cost</th></tr></thead>
115
                      <li><table id="merge_table">
112
                        <tbody>
116
                          <thead><tr><th>Invoice no.</th><th>Shipment date</th><th>Billing date</th><th>Shipment cost</th></tr></thead>
113
                        </tbody>
117
                          <tbody>
114
                    </table></li>
118
                          </tbody>
115
                    <li><label for="merge_invoicenumber" class="required">Invoice number:</label>
119
                      </table></li>
116
                            <input type="text" size="10" id="merge_invoicenumber" name="invoicenumber" value="" class="required" required="required" />
120
                      <li><label for="merge_invoicenumber" class="required">Invoice number:</label>
117
                            <span class="required">Required</span>
121
                              <input type="text" size="10" id="merge_invoicenumber" name="invoicenumber" value="" class="required" required="required" />
118
                            </li>
122
                              <span class="required">Required</span>
119
                    <li><label for="merge_shipmentdate">Shipment date:</label>
123
                              </li>
120
                            <input type="text" size="10" id="merge_shipmentdate" name="shipmentdate" value="" class="datepicker" /></li>
124
                      <li><label for="merge_shipmentdate">Shipment date:</label>
125
                              <input type="text" size="10" id="merge_shipmentdate" name="shipmentdate" value="" class="datepicker" /></li>
121
126
122
                    <li><label for="merge_billingdate">Billing date:</label>
127
                      <li><label for="merge_billingdate">Billing date:</label>
123
                            <input type="text" size="10" id="merge_billingdate" name="billingdate" value="" class="datepicker" /></li>
128
                              <input type="text" size="10" id="merge_billingdate" name="billingdate" value="" class="datepicker" /></li>
124
129
125
                    <li><label for="merge_shipmentcost">Shipment cost:</label>
130
                      <li><label for="merge_shipmentcost">Shipment cost:</label>
126
                            <input type="text" size="10" id="merge_shipmentcost" name="shipmentcost" value="" /></li>
131
                              <input type="text" size="10" id="merge_shipmentcost" name="shipmentcost" value="" /></li>
127
                    <li><label for="merge_shipment_budgetid">Fund:</label>
132
                      <li><label for="merge_shipment_budgetid">Fund:</label>
128
                            <select id="merge_shipment_budgetid" name="shipment_budget_id">
133
                              <select id="merge_shipment_budgetid" name="shipment_budget_id">
129
                                <option value="">No fund</option>
134
                                  <option value="">No fund</option>
130
                              [% FOREACH budget IN budgets_loop %]
135
                                [% FOREACH budget IN budgets_loop %]
131
                                  <option value="[% budget.budget_id | html %]">[% budget.budget_name | html %]
136
                                    <option value="[% budget.budget_id | html %]">[% budget.budget_name | html %]
132
                                  </option>
137
                                    </option>
133
                              [% END %]
138
                                [% END %]
134
                            </select></li>
139
                              </select></li>
135
140
136
                    <li><span class="label">Status:</span> <span id="merge_status"></span></li>
141
                      <li><span class="label">Status:</span> <span id="merge_status"></span></li>
137
                    <li><input type="submit" value="Merge" /></li>
142
                      <li><input type="submit" value="Merge" /></li>
138
                    </ol>
143
                      </ol>
139
                    <input type="hidden" name="op" value="mod" />
144
                      <input type="hidden" name="op" value="mod" />
140
                    <input type="hidden" id="merge_invoiceid" name="invoiceid" value="" />
145
                      <input type="hidden" id="merge_invoiceid" name="invoiceid" value="" />
141
                </fieldset>
146
                  </fieldset>
142
                </form>
147
                  </form>
143
            </div>
148
              </div>
149
          [% END %]
144
        [% ELSE %]
150
        [% ELSE %]
145
          <p>Sorry, but there are no results for your search.</p>
151
          <p>Sorry, but there are no results for your search.</p>
146
          <p>Search was:
152
          <p>Search was:
147
- 

Return to bug 24157