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

(-)a/acqui/invoice.pl (-3 / +4 lines)
Lines 157-162 my @orders_loop = (); Link Here
157
my $orders = $details->{'orders'};
157
my $orders = $details->{'orders'};
158
my @foot_loop;
158
my @foot_loop;
159
my %foot;
159
my %foot;
160
my $shipmentcost = $details->{shipmentcost} || 0;
160
my $total_quantity = 0;
161
my $total_quantity = 0;
161
my $total_tax_excluded = 0;
162
my $total_tax_excluded = 0;
162
my $total_tax_included = 0;
163
my $total_tax_included = 0;
Lines 211-225 $template->param( Link Here
211
    shipmentdate     => $details->{'shipmentdate'},
212
    shipmentdate     => $details->{'shipmentdate'},
212
    billingdate      => $details->{'billingdate'},
213
    billingdate      => $details->{'billingdate'},
213
    invoiceclosedate => $details->{'closedate'},
214
    invoiceclosedate => $details->{'closedate'},
214
    shipmentcost     => $details->{'shipmentcost'},
215
    shipmentcost     => $shipmentcost,
215
    orders_loop      => \@orders_loop,
216
    orders_loop      => \@orders_loop,
216
    foot_loop        => \@foot_loop,
217
    foot_loop        => \@foot_loop,
217
    total_quantity   => $total_quantity,
218
    total_quantity   => $total_quantity,
218
    total_tax_excluded => $total_tax_excluded,
219
    total_tax_excluded => $total_tax_excluded,
219
    total_tax_included => $total_tax_included,
220
    total_tax_included => $total_tax_included,
220
    total_tax_value  => $total_tax_value,
221
    total_tax_value  => $total_tax_value,
221
    total_tax_excluded_shipment => $total_tax_excluded + $details->{shipmentcost},
222
    total_tax_excluded_shipment => $total_tax_excluded + $shipmentcost,
222
    total_tax_included_shipment => $total_tax_included + $details->{shipmentcost},
223
    total_tax_included_shipment => $total_tax_included + $shipmentcost,
223
    invoiceincgst    => $bookseller->invoiceincgst,
224
    invoiceincgst    => $bookseller->invoiceincgst,
224
    currency         => Koha::Acquisition::Currencies->get_active,
225
    currency         => Koha::Acquisition::Currencies->get_active,
225
    budgets_loop     => \@budgets_loop,
226
    budgets_loop     => \@budgets_loop,
(-)a/installer/data/mysql/atomicupdate/bug_19166.perl (+1 lines)
Lines 15-20 if( CheckVersion( $DBversion ) ) { Link Here
15
            CONSTRAINT invoice_adjustments_fk_budget_id FOREIGN KEY (budget_id) REFERENCES aqbudgets (budget_id) ON DELETE SET NULL ON UPDATE CASCADE
15
            CONSTRAINT invoice_adjustments_fk_budget_id FOREIGN KEY (budget_id) REFERENCES aqbudgets (budget_id) ON DELETE SET NULL ON UPDATE CASCADE
16
        )
16
        )
17
        " );
17
        " );
18
    $dbh->do("INSERT IGNORE INTO authorised_value_categories (category_name) VALUES ('ADJ_REASON')");
18
    SetVersion( $DBversion );
19
    SetVersion( $DBversion );
19
    print "Upgrade to $DBversion done (Bug 19166 - Add the ability to add adjustments to an invoice)\n";
20
    print "Upgrade to $DBversion done (Bug 19166 - Add the ability to add adjustments to an invoice)\n";
20
}
21
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt (-4 / +3 lines)
Lines 106-112 Link Here
106
                      <td><input type="text" name="adjustment" id="adjustment_[% adjustment.adjustment_id %]" value="[% adjustment.adjustment | $Price %]" /></td>
106
                      <td><input type="text" name="adjustment" id="adjustment_[% adjustment.adjustment_id %]" value="[% adjustment.adjustment | $Price %]" /></td>
107
                      <td>
107
                      <td>
108
                          [% reasons = AuthorisedValues.Get("ADJ_REASON") %]
108
                          [% reasons = AuthorisedValues.Get("ADJ_REASON") %]
109
                          [% IF reasons %]
109
                          [% IF reasons.0 %]
110
                          <select id="reason_[% adjustment.adjustment_id %]" name="reason">
110
                          <select id="reason_[% adjustment.adjustment_id %]" name="reason">
111
                                  <option value="">No reason</option>
111
                                  <option value="">No reason</option>
112
                              [% FOREACH reason IN reasons %]
112
                              [% FOREACH reason IN reasons %]
Lines 159-165 Link Here
159
                      <td><input type="text" name="adjustment" id="adjustment_new]" /></td>
159
                      <td><input type="text" name="adjustment" id="adjustment_new]" /></td>
160
                      <td>
160
                      <td>
161
                          [% reasons = AuthorisedValues.Get("ADJ_REASON") %]
161
                          [% reasons = AuthorisedValues.Get("ADJ_REASON") %]
162
                          [% IF reasons %]
162
                          [% IF reasons.0 %]
163
                          <select id="reason_[% adjustment.adjustment_id %]" name="reason">
163
                          <select id="reason_[% adjustment.adjustment_id %]" name="reason">
164
                                  <option value="">No reason</option>
164
                                  <option value="">No reason</option>
165
                                [% FOREACH reason IN reasons %]
165
                                [% FOREACH reason IN reasons %]
Lines 286-292 Link Here
286
          </table>
286
          </table>
287
        [% ELSE %]
287
        [% ELSE %]
288
            <div class="dialog message"><p>No orders yet</p>
288
            <div class="dialog message"><p>No orders yet</p>
289
            [% IF adjustments.count > 0 || shipmentcost > 0 %]
289
            [% IF adjustments && adjustments.count > 0 || shipmentcost && shipmentcost > 0 %]
290
            <p>Adjustments plus shipping:[% total_adj + shipmentcost | $Price %]</p>
290
            <p>Adjustments plus shipping:[% total_adj + shipmentcost | $Price %]</p>
291
            [% END %]
291
            [% END %]
292
            </div>
292
            </div>
293
- 

Return to bug 19166