From bd445c3b974457ca896bde93236b22a9100f258c Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 13 Feb 2015 14:53:10 +0100 Subject: [PATCH] Bug 11062: rename shipmentcost with shipping For more consistency, the shipmentcost variables and labels will be renamed with shipping. --- C4/Acquisition.pm | 12 ++++++------ C4/Budgets.pm | 12 ++++++------ acqui/invoice.pl | 10 +++++----- acqui/orderreceive.pl | 6 +++--- acqui/parcels.pl | 6 +++--- acqui/spent.pl | 12 ++++++------ koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt | 12 ++++++------ koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt | 6 +++--- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt | 8 ++++---- 9 files changed, 42 insertions(+), 42 deletions(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index 8c52de3..75a4784 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -2408,7 +2408,7 @@ Return a list of invoices that match all given criteria. $order_by is "column_name (asc|desc)", where column_name is any of 'invoicenumber', 'booksellerid', 'shipmentdate', 'billingdate', 'closedate', -'shipmentcost', 'shipmentcost_budgetid'. +'shipping', 'shipmentcost_budgetid'. asc is the default if omitted @@ -2418,7 +2418,7 @@ sub GetInvoices { my %args = @_; my @columns = qw(invoicenumber booksellerid shipmentdate billingdate - closedate shipmentcost shipmentcost_budgetid); + closedate shipping shipmentcost_budgetid); my $dbh = C4::Context->dbh; my $query = qq{ @@ -2608,7 +2608,7 @@ sub GetInvoiceDetails { shipmentdate => $shipmentdate, billingdate => $billingdate, closedate => $closedate, - shipmentcost => $shipmentcost, + shipping => $shipping, shipmentcost_budgetid => $shipmentcost_budgetid ); @@ -2622,7 +2622,7 @@ sub AddInvoice { return unless(%invoice and $invoice{invoicenumber}); my @columns = qw(invoicenumber booksellerid shipmentdate billingdate - closedate shipmentcost shipmentcost_budgetid); + closedate shipping shipmentcost_budgetid); my @set_strs; my @set_args; @@ -2656,7 +2656,7 @@ sub AddInvoice { shipmentdate => $shipmentdate, billingdate => $billingdate, closedate => $closedate, - shipmentcost => $shipmentcost, + shipping => $shipping, shipmentcost_budgetid => $shipmentcost_budgetid ); @@ -2672,7 +2672,7 @@ sub ModInvoice { return unless(%invoice and $invoice{invoiceid}); my @columns = qw(invoicenumber booksellerid shipmentdate billingdate - closedate shipmentcost shipmentcost_budgetid); + closedate shipping shipmentcost_budgetid); my @set_strs; my @set_args; diff --git a/C4/Budgets.pm b/C4/Budgets.pm index a78b44f..b1c8cc1 100644 --- a/C4/Budgets.pm +++ b/C4/Budgets.pm @@ -344,14 +344,14 @@ sub GetBudgetSpent { my $sum = $sth->fetchrow_array; $sth = $dbh->prepare(qq| - SELECT SUM(shipmentcost) AS sum + SELECT SUM(shipping) AS sum FROM aqinvoices WHERE shipmentcost_budgetid = ? AND closedate IS NOT NULL |); $sth->execute($budget_id); - my ($shipmentcost_sum) = $sth->fetchrow_array; - $sum += $shipmentcost_sum; + my ($shipping_sum) = $sth->fetchrow_array; + $sum += $shipping_sum; return $sum; } @@ -370,14 +370,14 @@ sub GetBudgetOrdered { my $sum = $sth->fetchrow_array; $sth = $dbh->prepare(qq| - SELECT SUM(shipmentcost) AS sum + SELECT SUM(shipping) AS sum FROM aqinvoices WHERE shipmentcost_budgetid = ? AND closedate IS NULL |); $sth->execute($budget_id); - my ($shipmentcost_sum) = $sth->fetchrow_array; - $sum += $shipmentcost_sum; + my ($shipping_sum) = $sth->fetchrow_array; + $sum += $shipping_sum; return $sum; } diff --git a/acqui/invoice.pl b/acqui/invoice.pl index 9fcef0e..7fcd365 100755 --- a/acqui/invoice.pl +++ b/acqui/invoice.pl @@ -78,13 +78,13 @@ elsif ( $op && $op eq 'reopen' ) { elsif ( $op && $op eq 'mod' ) { my $shipmentdate = $input->param('shipmentdate'); my $billingdate = $input->param('billingdate'); - my $shipmentcost = $input->param('shipmentcost'); + my $shipping = $input->param('shipping'); my $shipment_budget_id = $input->param('shipment_budget_id'); ModInvoice( invoiceid => $invoiceid, shipmentdate => C4::Dates->new($shipmentdate)->output("iso"), billingdate => C4::Dates->new($billingdate)->output("iso"), - shipmentcost => $shipmentcost, + shipping => $shipping, shipmentcost_budgetid => $shipment_budget_id ); if ($input->param('reopen')) { @@ -167,15 +167,15 @@ $template->param( shipmentdate => $details->{'shipmentdate'}, billingdate => $details->{'billingdate'}, invoiceclosedate => $details->{'closedate'}, - shipmentcost => $details->{'shipmentcost'}, + shipping => $details->{'shipping'}, 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 + $details->{shipping}, + total_tax_included_shipment => $total_tax_included + $details->{shipping}, invoiceincgst => $bookseller->{invoiceincgst}, currency => GetCurrency()->{currency}, budgets_loop => \@budgets_loop, diff --git a/acqui/orderreceive.pl b/acqui/orderreceive.pl index 23b1b8f..b32c520 100755 --- a/acqui/orderreceive.pl +++ b/acqui/orderreceive.pl @@ -42,7 +42,7 @@ to know on what supplier this script has to display receive order. the id of this invoice. -=item freight +=item shipping =item biblio @@ -84,7 +84,7 @@ my $dbh = C4::Context->dbh; my $invoiceid = $input->param('invoiceid'); my $invoice = GetInvoice($invoiceid); my $booksellerid = $invoice->{booksellerid}; -my $freight = $invoice->{shipmentcost}; +my $shipping = $invoice->{shipping}; my $datereceived = $invoice->{shipmentdate}; my $ordernumber = $input->param('ordernumber'); @@ -205,7 +205,7 @@ $template->param( ordernumber => $order->{'ordernumber'}, subscriptionid => $order->{subscriptionid}, booksellerid => $order->{'booksellerid'}, - freight => $freight, + shipping => $shipping, name => $bookseller->{'name'}, date => format_date($order->{entrydate}), title => $order->{'title'}, diff --git a/acqui/parcels.pl b/acqui/parcels.pl index e3b8f5f..952d0f2 100755 --- a/acqui/parcels.pl +++ b/acqui/parcels.pl @@ -101,7 +101,7 @@ our ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( my $invoicenumber = $input->param('invoice'); my $shipmentdate = $input->param('shipmentdate'); -my $shipmentcost = $input->param('shipmentcost'); +my $shipping = $input->param('shipping'); my $shipmentcost_budgetid = $input->param('shipmentcost_budgetid'); if($shipmentdate) { $shipmentdate = C4::Dates->new($shipmentdate)->output('iso'); @@ -117,7 +117,7 @@ if ( $op and $op eq 'new' ) { $template->{'VARS'}->{'duplicate_invoices'} = \@invoices; $template->{'VARS'}->{'invoicenumber'} = $invoicenumber; $template->{'VARS'}->{'shipmentdate'} = $shipmentdate; - $template->{'VARS'}->{'shipmentcost'} = $shipmentcost; + $template->{'VARS'}->{'shipping'} = $shipping; $template->{'VARS'}->{'shipmentcost_budgetid'} = $shipmentcost_budgetid; } @@ -129,7 +129,7 @@ if ($op and $op eq 'confirm') { invoicenumber => $invoicenumber, booksellerid => $booksellerid, shipmentdate => $shipmentdate, - shipmentcost => $shipmentcost, + shipping => $shipping, shipmentcost_budgetid => $shipmentcost_budgetid, ); if(defined $invoiceid) { diff --git a/acqui/spent.pl b/acqui/spent.pl index c3c4693..852f795 100755 --- a/acqui/spent.pl +++ b/acqui/spent.pl @@ -105,19 +105,19 @@ while ( my $data = $sth->fetchrow_hashref ) { my $total = $subtotal; $query = qq{ - SELECT invoicenumber, shipmentcost + SELECT invoicenumber, shipping FROM aqinvoices WHERE shipmentcost_budgetid = ? }; $sth = $dbh->prepare($query); $sth->execute($bookfund); -my @shipmentcosts; +my @shippings; while (my $data = $sth->fetchrow_hashref) { - push @shipmentcosts, { - shipmentcost => sprintf("%.2f", $data->{shipmentcost}), + push @shippings, { + shipping => sprintf("%.2f", $data->{shipping}), invoicenumber => $data->{invoicenumber} }; - $total += $data->{shipmentcost}; + $total += $data->{shipping}; } $sth->finish; @@ -127,7 +127,7 @@ $template->param( fund => $bookfund, spent => \@spent, subtotal => $subtotal, - shipmentcosts => \@shipmentcosts, + shippings => \@shippings, total => $total, fund_code => $fund_code ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt index 456a231..4df2a9c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt @@ -46,7 +46,7 @@ $(document).ready(function() { 'invoicenumber': $(row).find('td:nth-child(2) a').text(), 'shipmentdate': $(row).attr('data-shipmentdate'), 'billingdate': $(row).attr('data-billingdate'), - 'shipmentcost': $(row).attr('data-shipmentcost'), + 'shipping': $(row).attr('data-shipping'), 'shipment_budgetid': $(row).attr('data-shipment_budgetid'), 'closedate': $(row).attr('data-closedate'), }); $('#merge_invoice_form').append(''); @@ -56,13 +56,13 @@ $(document).ready(function() { } else { $('#merge_table tbody').empty(); $.each(invoices, function (idx, invoice) { - var row = $('' + invoice.invoicenumber + '' + invoice.shipmentdate + '' + invoice.billingdate + '' + invoice.shipmentcost + ''); + var row = $('' + invoice.invoicenumber + '' + invoice.shipmentdate + '' + invoice.billingdate + '' + invoice.shipping + ''); $(row).appendTo('#merge_table tbody'); $(row).click(function () { $('#merge_table tbody tr').removeClass('active'); $(this).addClass('active'); $('#merge_invoicenumber').text(invoice.invoicenumber); - $.each(['invoiceid', 'shipmentdate', 'billingdate', 'shipmentcost', 'shipment_budgetid'], function (idx, prop) { + $.each(['invoiceid', 'shipmentdate', 'billingdate', 'shipping', 'shipment_budgetid'], function (idx, prop) { $('#merge_' + prop).val(invoice[prop]); }); if (invoice.closedate) { @@ -115,7 +115,7 @@ $(document).ready(function() { [% FOREACH invoice IN invoices %] - + [% invoice.is_linked_to_subscriptions %] [% invoice.invoicenumber %] @@ -177,8 +177,8 @@ $(document).ready(function() {
  • -
  • -
  • +
  • +
  • - + @@ -176,8 +176,8 @@
    [% INCLUDE 'date-format.inc' %]
  • - - + +
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt index dbc69d6..c35ca5f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt @@ -91,16 +91,16 @@ [% END %] - [% IF shipmentcosts.size %] + [% IF shippings.size %] Sub total [% subtotal %] - [% FOREACH shipmentcost IN shipmentcosts %] + [% FOREACH shipping IN shippings %] - Shipping cost for invoice [% shipmentcost.invoicenumber %] - [% shipmentcost.shipmentcost %] + Shipping cost for invoice [% shipping.invoicenumber %] + [% shipping.shipping %] [% END %] [% END %] -- 2.1.0