From 0766610f86417cf4a08cec7dad0f2e09376cb13a Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 30 Mar 2018 13:35:12 +0000 Subject: [PATCH] Bug 19166: (follow-up) Add ADJ_REASON auhtorised value category and minor fixes MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This patch adds the ADJ_REASON authorised value category tot he atomic update, and fixes code to display a hint of no reasons are defined other minor updates to remove warns in logs To test: Apply patches Run updates Check authorised value categories to see ADJ_REASON exists Add an adjustment, not you have no reaosn drop down Note there is a hint if you hover Add a value to ADJ_REASON add another adjustment, note you can now add reasons (or not) Signed-off-by: Séverine QUEUNE Signed-off-by: Séverine QUEUNE Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize Signed-off-by: Nick Clemens --- acqui/invoice.pl | 7 ++++--- installer/data/mysql/atomicupdate/bug_19166.perl | 1 + koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/acqui/invoice.pl b/acqui/invoice.pl index 66c3582f2e..4fe4b224d8 100755 --- a/acqui/invoice.pl +++ b/acqui/invoice.pl @@ -157,6 +157,7 @@ my @orders_loop = (); my $orders = $details->{'orders'}; my @foot_loop; my %foot; +my $shipmentcost = $details->{shipmentcost} || 0; my $total_quantity = 0; my $total_tax_excluded = 0; my $total_tax_included = 0; @@ -211,15 +212,15 @@ $template->param( shipmentdate => $details->{'shipmentdate'}, billingdate => $details->{'billingdate'}, invoiceclosedate => $details->{'closedate'}, - shipmentcost => $details->{'shipmentcost'}, + shipmentcost => $shipmentcost, orders_loop => \@orders_loop, foot_loop => \@foot_loop, total_quantity => $total_quantity, total_tax_excluded => $total_tax_excluded, total_tax_included => $total_tax_included, total_tax_value => $total_tax_value, - total_tax_excluded_shipment => $total_tax_excluded + $details->{shipmentcost}, - total_tax_included_shipment => $total_tax_included + $details->{shipmentcost}, + total_tax_excluded_shipment => $total_tax_excluded + $shipmentcost, + total_tax_included_shipment => $total_tax_included + $shipmentcost, invoiceincgst => $bookseller->invoiceincgst, currency => Koha::Acquisition::Currencies->get_active, budgets_loop => \@budgets_loop, diff --git a/installer/data/mysql/atomicupdate/bug_19166.perl b/installer/data/mysql/atomicupdate/bug_19166.perl index 5539daa25a..76a901cc39 100644 --- a/installer/data/mysql/atomicupdate/bug_19166.perl +++ b/installer/data/mysql/atomicupdate/bug_19166.perl @@ -15,6 +15,7 @@ if( CheckVersion( $DBversion ) ) { CONSTRAINT invoice_adjustments_fk_budget_id FOREIGN KEY (budget_id) REFERENCES aqbudgets (budget_id) ON DELETE SET NULL ON UPDATE CASCADE ) " ); + $dbh->do("INSERT IGNORE INTO authorised_value_categories (category_name) VALUES ('ADJ_REASON')"); SetVersion( $DBversion ); print "Upgrade to $DBversion done (Bug 19166 - Add the ability to add adjustments to an invoice)\n"; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt index d872b4170a..7295eb185e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt @@ -106,7 +106,7 @@ [% reasons = AuthorisedValues.Get("ADJ_REASON") %] - [% IF reasons %] + [% IF reasons.0 %] [% reasons = AuthorisedValues.Get("ADJ_REASON") %] - [% IF reasons %] + [% IF reasons.0 %]