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

(-)a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css (+4 lines)
Lines 93-98 h1,h2,h3,h4,h5,h6 { Link Here
93
	margin : .3em 0;
93
	margin : .3em 0;
94
}
94
}
95
95
96
hr {
97
    clear: both;
98
}
99
96
p {
100
p {
97
	margin: .5em 0 .5em 0;
101
	margin: .5em 0 .5em 0;
98
}
102
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt (-111 / +154 lines)
Lines 76-200 Link Here
76
            </ol>
76
            </ol>
77
          <input type="hidden" name="op" value="mod" />
77
          <input type="hidden" name="op" value="mod" />
78
          <input type="hidden" name="invoiceid" value="[% invoiceid %]" />
78
          <input type="hidden" name="invoiceid" value="[% invoiceid %]" />
79
        </fieldset>
79
            <fieldset class="action">
80
        <fieldset class="action">
80
                <input type="submit" value="Save" />
81
            <input type="submit" value="Save" />
81
                [% UNLESS orders_loop.size %]
82
            [% UNLESS orders_loop.size %]
82
                <a href="invoice.pl?op=delete&invoiceid=[% invoiceid %]" id="delete">Delete</a>
83
            <a href="invoice.pl?op=delete&invoiceid=[% invoiceid %]" id="delete">Delete</a>
83
                [% END %]
84
            [% END %]
84
            </fieldset>
85
        </fieldset>
85
        </fieldset>
86
      </form>
86
      </form>
87
      <form action="/cgi-bin/koha/acqui/invoice.pl" method="post" class="validated">
87
88
          <input type="hidden" name="invoiceid" value="[% invoiceid %]" />
88
      <hr />
89
              <table id="invoice_adj_table">
89
90
                  <tr>
90
        <h3>Adjustments</h3>
91
                     <th>Id</th>
91
92
                     <th>Amount</th>
92
        <form action="/cgi-bin/koha/acqui/invoice.pl" method="post" class="validated">
93
                     <th>Reason</th>
93
            <fieldset class="rows">
94
                     <th>Note</th>
94
                <input type="hidden" name="invoiceid" value="[% invoiceid %]" />
95
                     <th>Fund</th>
95
                [% IF (adjustments.count > 0) %]
96
                     <th>Encumber while invoice open</th>
96
                    <table id="invoice_adj_table">
97
                     <th>&nbsp</th>
97
                        <tr>
98
                  </tr>
98
                            <th>Id</th>
99
                  [% IF (adjustments.count > 0) %]
99
                            <th>Amount</th>
100
                  <tr><td colspan="7">Current adjustments</td></tr>
100
                            <th>Reason</th>
101
                  [% total_adj = 0 %]
101
                            <th>Note</th>
102
                  [% FOREACH adjustment IN adjustments %]
102
                            <th>Fund</th>
103
                  [% total_adj = total_adj + adjustment.adjustment %]
103
                            <th>Encumber while invoice open</th>
104
                  <tr>
104
                            <th>&nbsp</th>
105
                      <td><input type="hidden" name="adjustment_id" value="[% adjustment.adjustment_id %]" />[% adjustment.adjustment_id %]</td>
105
                        </tr>
106
                      <td><input type="text" name="adjustment" id="adjustment_[% adjustment.adjustment_id %]" value="[% adjustment.adjustment | $Price %]" /></td>
106
                        [% total_adj = 0 %]
107
                      <td>
107
                        [% FOREACH adjustment IN adjustments %]
108
                          [% reasons = AuthorisedValues.Get("ADJ_REASON") %]
108
                            [% total_adj = total_adj + adjustment.adjustment %]
109
                          [% IF reasons.0 %]
109
                            <tr>
110
                          <select id="reason_[% adjustment.adjustment_id %]" name="reason">
110
                                <td><input type="hidden" name="adjustment_id" value="[% adjustment.adjustment_id %]" />[% adjustment.adjustment_id %]</td>
111
                                  <option value="">No reason</option>
111
                                <td><input type="text" name="adjustment" id="adjustment_[% adjustment.adjustment_id %]" value="[% adjustment.adjustment | $Price %]" /></td>
112
                              [% FOREACH reason IN reasons %]
112
                                <td>
113
                                [% IF ( adjustment.reason == reason.authorised_value ) %]
113
                                    [% reasons = AuthorisedValues.Get("ADJ_REASON") %]
114
                                  <option selected="selected" value="[% reason.authorised_value %]">
114
                                    [% IF reasons.0 %]
115
                                [% ELSE %]
115
                                        <select id="reason_[% adjustment.adjustment_id %]" name="reason">
116
                                  <option value="[% reason.authorised_value %]">
116
                                            <option value="">No reason</option>
117
                                [% END %]
117
                                            [% FOREACH reason IN reasons %]
118
                                  [% reason.lib %]
118
                                                [% IF ( adjustment.reason == reason.authorised_value ) %]
119
                                  </option>
119
                                                    <option selected="selected" value="[% reason.authorised_value %]">
120
                              [% END %]
120
                                                [% ELSE %]
121
                          </select>
121
                                                    <option value="[% reason.authorised_value %]">
122
                          [% ELSE %]
122
                                                [% END %]
123
                          <p title="Define values in authorised value category ADJ_REASON to enable">None</p>
123
                                                [% reason.lib %]
124
                          <input type="hidden" name="reason" id="reason_[% adjustment.adjustment_id %]" value="" />
124
                                                </option>
125
                          [% END %]
125
                                            [% END %]
126
                      </td>
126
                                        </select>
127
                      <td><input type="text" name="note" id="note_new" value="[% adjustment.note %]"/></td>
127
                                    [% ELSE %]
128
                      <td>
128
                                        <p title="Define values in authorised value category ADJ_REASON to enable">None</p>
129
                          <select id="budget_id_[% adjustment.adjustment_id %]" name="budget_id">
129
                                        <input type="hidden" name="reason" id="reason_[% adjustment.adjustment_id %]" value="" />
130
                                  <option value="">No fund</option>
130
                                    [% END %]
131
                              [% FOREACH budget IN budgets_loop %]
131
                                </td>
132
                                [% IF ( budget.budget_id == adjustment.budget_id ) %]
132
                                <td><input type="text" name="note" id="note_[% adjustment.adjustment_id %]" value="[% adjustment.note %]"/></td>
133
                                  <option selected="selected" value="[% budget.budget_id %]">
133
                                <td>
134
                                    <select id="budget_id_[% adjustment.adjustment_id %]" name="budget_id">
135
                                            <option value="">No fund</option>
136
                                        [% FOREACH budget IN budgets_loop %]
137
                                            [% IF ( budget.budget_id == adjustment.budget_id ) %]
138
                                                <option selected="selected" value="[% budget.budget_id %]">
139
                                            [% ELSE %]
140
                                                <option value="[% budget.budget_id %]">
141
                                            [% END %]
142
                                            [% budget.budget_name %]
143
                                            </option>
144
                                        [% END %]
145
                                    </select>
146
                                </td>
147
                                [% IF adjustment.encumber_open %]
148
                                    <td>
149
                                        <input type="checkbox" name="encumber_open" id="encumber_[% adjustment.adjustment_id %]" value="[% adjustment.adjustment_id %]" checked="checked" />
150
                                    </td>
134
                                [% ELSE %]
151
                                [% ELSE %]
135
                                  <option value="[% budget.budget_id %]">
152
                                    <td>
153
                                        <input type="checkbox" name="encumber_open" id="encumber_[% adjustment.adjustment_id %]" value="[% adjustment.adjustment_id %]" />
154
                                    </td>
136
                                [% END %]
155
                                [% END %]
137
                                  [% budget.budget_name %]
156
                                <td>
138
                                  </option>
157
                                    <a class="btn btn-default btn-xs delete_adjustment" href="/cgi-bin/koha/acqui/invoice.pl?op=del_adj&adjustment_id=[% adjustment.adjustment_id %]&invoiceid=[% invoiceid %]"><i class="fa fa-trash"></i> Delete</a>
139
                              [% END %]
158
                                </td>
140
                          </select>
159
                            </tr>
141
                      </td>
160
                        [% END %]
142
                      [% IF adjustment.encumber_open %]
161
                    </table>
143
                      <td>
162
                [% END %]
144
                          <input type="checkbox" name="encumber_open" id="encumber_[% adjustment.adjustment_id %]"  value="[% adjustment.adjustment_id %]" checked/>
163
145
                      </td>
164
                <p>
146
                      [% ELSE %]
165
                    <a href="#" id="show_invoice_adjustment" class="toggle_invoice_adjustment"><i class="fa fa-plus"></i> Add an adjustment</a>
147
                      <td>
166
                </p>
148
                          <input type="checkbox" name="encumber_open" id="encumber_[% adjustment.adjustment_id %]"  value="[% adjustment.adjustment_id %]" />
167
149
                      </td>
168
                <fieldset id="add_invoice_adjustment" style="display:none">
150
                      [% END %]
169
                    <h4>Add an adjustment</h4>
151
                      <td>
170
                    <input type="hidden" name="adjustment_id" value="new" />
152
                          <a class="btn btn-default btn-xs" href="/cgi-bin/koha/acqui/invoice.pl?op=del_adj&adjustment_id=[% adjustment.adjustment_id %]&invoiceid=[% invoiceid %]"><i class="fa fa-trash"></i> Delete</a>
171
                    <ol>
153
                      </td>
172
                        <li>
154
                  </tr>
173
                            <label for="adjustment_new">Amount: </label>
155
                  [% END %]
174
                            <input type="text" name="adjustment" id="adjustment_new" />
156
                  [% END %]
175
                        </li>
157
                  <tr><td colspan="7">Add an adjustment</td></tr>
176
                        [% reasons = AuthorisedValues.Get("ADJ_REASON") %]
158
                      <td><input type="hidden" name="adjustment_id" value="new" />New</td>
177
                        [% IF reasons.0 %]
159
                      <td><input type="text" name="adjustment" id="adjustment_new]" /></td>
178
                            <li>
160
                      <td>
179
                                <label for="reason_[% adjustment.adjustment_id %]">Reason: </label>
161
                          [% reasons = AuthorisedValues.Get("ADJ_REASON") %]
180
                                <select id="reason_[% adjustment.adjustment_id %]" name="reason">
162
                          [% IF reasons.0 %]
181
                                    <option value="">No reason</option>
163
                          <select id="reason_[% adjustment.adjustment_id %]" name="reason">
182
                                    [% FOREACH reason IN reasons %]
164
                                  <option value="">No reason</option>
183
                                        <option value="[% reason.authorised_value %]">
165
                                [% FOREACH reason IN reasons %]
184
                                            [% reason.lib %]
166
                                  <option value="[% reason.authorised_value %]">
185
                                        </option>
167
                                  [% reason.lib %]
186
                                    [% END %]
168
                                  </option>
187
                                </select>
188
                            </li>
189
                        [% ELSE %]
190
                            <li>
191
                                <span class="label">Reason: </span>
192
                                <span>None</span>
193
                                <div class="hint">Define values in authorised value category ADJ_REASON to enable</div>
194
                            </li>
195
                        [% END %]
196
                        <li>
197
                            <label for="note_new">Note: </label>
198
                            <input type="text" name="note" id="note_new" value=""/>
199
                        </li>
200
                        <li>
201
                            <label for="budget_id_new">Fund: </label>
202
                            <select id="budget_id_new" name="budget_id">
203
                                <option selected="selected" value="">No fund</option>
204
                                [% FOREACH budget IN budgets_loop %]
205
                                    <option value="[% budget.budget_id %]">
206
                                    [% budget.budget_name %]
207
                                    </option>
169
                                [% END %]
208
                                [% END %]
170
                          </select>
209
                            </select>
171
                          [% ELSE %]
210
                        </li>
172
                          <p title="Define values in authorised value category ADJ_REASON to enable">None</p>
211
                        <li>
173
                          [% END %]
212
                            <label for="encumber_new">Encumber while invoice open? </label>
174
                      </td>
213
                            <input type="checkbox" name="encumber_open" id="encumber_new" value="new" />
175
                      <td><input type="text" name="note" id="note_new" value=""/></td>
214
                            <input type="hidden" name="delete" value="">
176
                      <td>
215
                        </li>
177
                          <select id="budget_id_[% adjustment.adjustment_id %]" name="budget_id">
216
                        <li>
178
                               <option selected="selected" value="">No fund</option>
217
                            <span class="label">&nbsp;</span>
179
                               [% FOREACH budget IN budgets_loop %]
218
                            <a href="#" id="cancel_invoice_adjustment" class="toggle_invoice_adjustment" style="display:none"><i class="fa fa-remove"></i> Cancel</a>
180
                               <option value="[% budget.budget_id %]">
219
                        </li>
181
                               [% budget.budget_name %]
220
                    </ol>
182
                               </option>
221
                </fieldset>
183
                               [% END %]
222
                <fieldset class="action">
184
                          </select>
223
                    <input type="hidden" name="op" value="mod_adj" />
185
                      </td>
224
                    <input type="submit" value="Update adjustments" />
186
                      <td><input type="checkbox" name="encumber_open" id="encumber_new" value="new" /></td>
225
                </fieldset>
187
                      <td><input type="hidden" name="delete" value=""></td>
226
            </fieldset>
188
                  </tr>
227
        </form>
189
                </table>
190
          <input type="hidden" name="op" value="mod_adj" />
191
          <input type="submit" value="Update adjustments" />
192
      </form>
193
      <p>
228
      <p>
194
          <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid %]">Go to receipt page</a>
229
          <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid %]">Go to receipt page</a>
195
          [% IF Koha.Preference('AcqEnableFiles') %]| <a href="/cgi-bin/koha/acqui/invoice-files.pl?invoiceid=[% invoiceid %]">Manage invoice files</a>[% END %]
230
          [% IF Koha.Preference('AcqEnableFiles') %]| <a href="/cgi-bin/koha/acqui/invoice-files.pl?invoiceid=[% invoiceid %]">Manage invoice files</a>[% END %]
196
      </p>
231
      </p>
197
      <h2>Invoice details</h2>
232
      <h2>Invoice details</h2>
233
      <fieldset>
198
      [% IF orders_loop.size %]
234
      [% IF orders_loop.size %]
199
          <label for="show_all_details">
235
          <label for="show_all_details">
200
            <input type="checkbox" style="vertical-align: middle;" id="show_all_details" />
236
            <input type="checkbox" style="vertical-align: middle;" id="show_all_details" />
Lines 315-320 Link Here
315
                </tbody>
351
                </tbody>
316
            </table>
352
            </table>
317
        [% END %]
353
        [% END %]
354
        </fieldset>
318
    </div>
355
    </div>
319
  </div>
356
  </div>
320
  <div class="yui-b">
357
  <div class="yui-b">
Lines 326-332 Link Here
326
    [% Asset.js("js/acquisitions-menu.js") %]
363
    [% Asset.js("js/acquisitions-menu.js") %]
327
    [% INCLUDE 'calendar.inc' %]
364
    [% INCLUDE 'calendar.inc' %]
328
    [% INCLUDE 'datatables.inc' %]
365
    [% INCLUDE 'datatables.inc' %]
329
    <script type="text/javascript">
366
    <script>
330
        function updateColumnsVisibility(visible) {
367
        function updateColumnsVisibility(visible) {
331
            if ( visible ) {
368
            if ( visible ) {
332
                $("table .tax_excluded, .tax_included").show();
369
                $("table .tax_excluded, .tax_included").show();
Lines 369-374 Link Here
369
406
370
            $("#show_all_details").prop('checked', false);
407
            $("#show_all_details").prop('checked', false);
371
            updateColumnsVisibility(false);
408
            updateColumnsVisibility(false);
409
            $(".toggle_invoice_adjustment").on("click", function(e){
410
                e.preventDefault();
411
                $("#show_invoice_adjustment, #cancel_invoice_adjustment, #add_invoice_adjustment").toggle();
412
            });
413
            $("a.delete_adjustment").click(function(){
414
                return ( confirm( _("Are you sure you want to delete this file ?") ) );
415
            });
372
        });
416
        });
373
    </script>
417
    </script>
374
[% END %]
418
[% END %]
375
- 

Return to bug 19166