Bugzilla – Attachment 12815 Details for
Bug 8832
can't enter a tax rate on vendor or when ordering
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8832: Update the gist pref and hide the tax rate value if not needed
Bug-8832-Update-the-gist-pref-and-hide-the-tax-rat.patch (text/plain), 5.93 KB, created by
Jonathan Druart
on 2012-10-15 13:48:38 UTC
(
hide
)
Description:
Bug 8832: Update the gist pref and hide the tax rate value if not needed
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2012-10-15 13:48:38 UTC
Size:
5.93 KB
patch
obsolete
>From 41de76f9788130ae03abb3dcd6f842cb06b1de73 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Mon, 15 Oct 2012 15:49:30 +0200 >Subject: [PATCH] Bug 8832: Update the gist pref and hide the tax rate value > if not needed > >The gist system preference will be updated with the existing values and >with the supplier's gstrate values. >The "Tax rate" part becomes hidden if the syspref is not filled. >--- > installer/data/mysql/updatedatabase.pl | 21 ++++++++++++ > .../prog/en/modules/acqui/neworderempty.tt | 36 +++++++++++--------- > .../prog/en/modules/acqui/supplier.tt | 12 ++++--- > 3 files changed, 49 insertions(+), 20 deletions(-) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index e67bf3e..dcc7549 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -6011,6 +6011,27 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { > SetVersion ($DBversion); > } > >+$DBversion = "3.09.00.062"; >+if (C4::Context->preference("Version") < TransformToNum($DBversion)) { >+ my $gst_booksellers = $dbh->selectcol_arrayref("SELECT DISTINCT(gstrate) FROM aqbooksellers"); >+ my $gist_syspref = C4::Context->preference("gist"); >+ # remove the undef values and construct and array with the syspref and the supplier values >+ my @gstrates = map { defined $_ ? $_ : () } @$gst_booksellers; >+ push @gstrates, split ('\|', $gist_syspref); >+ # we want to compare integer (or float) >+ $_ = $_ + 0 for @gstrates; >+ use List::MoreUtils qw/uniq/; >+ # remove duplicate values >+ @gstrates = uniq sort @gstrates; >+ my $new_syspref_value = join '|', @gstrates; >+ # update the syspref with the new values >+ my $sth = $dbh->prepare("UPDATE systempreferences set value=? WHERE variable='gist'"); >+ $sth->execute( $new_syspref_value ); >+ >+ print "Upgrade to $DBversion done (Bug 8832, Set the syspref gist with the existing values)\n"; >+ SetVersion ($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >index 96c6fb6..5533ebc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >@@ -451,23 +451,27 @@ $(document).ready(function() > [% END %] > </li> > [% END %] >- <li> >- [% IF ( close ) %] >- <span class="label">Tax rate: </span> >- <input type="hidden" size="20" name="gstrate" id="gstrate" value="[% gstrate %]" />[% gstrate %]% >- [% ELSE %] >- <label for="gst">Tax rate: </label> >- <select name="gstrate" id="gstrate" onchange="updateCosts();"> >- [% FOREACH gst IN gst_values %] >- [% IF ( gst.option == gstrate ) %] >- <option value="[% gst.option %]" selected="selected">[% gst.option * 100 | format("%.1f") %]%</option> >- [% ELSE %] >- <option value="[% gst.option %]">[% gst.option * 100 | format("%.1f") %]%</option> >- [% END %] >+ [% IF ( gst_values ) %] >+ <li> >+ [% IF ( close ) %] >+ <span class="label">Tax rate: </span> >+ <input type="hidden" size="20" name="gstrate" id="gstrate" value="[% gstrate %]" />[% gstrate %]% >+ [% ELSE %] >+ <label for="gst">Tax rate: </label> >+ <select name="gstrate" id="gstrate" onchange="updateCosts();"> >+ [% FOREACH gst IN gst_values %] >+ [% IF ( gst.option == gstrate ) %] >+ <option value="[% gst.option %]" selected="selected">[% gst.option * 100 | format("%.1f") %]%</option> >+ [% ELSE %] >+ <option value="[% gst.option %]">[% gst.option * 100 | format("%.1f") %]%</option> >+ [% END %] >+ [% END %] >+ </select> > [% END %] >- </select> >- [% END %] >- </li> >+ [% ELSE %] >+ <input type="hidden" name="gstrate" value="0" /> >+ </li> >+ [% END %] > <li> > <label for="discount">Discount: </label> > [% IF ( close ) %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt >index 9cbc169..201c080 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt >@@ -156,8 +156,9 @@ if (f.company.value == "") { > <label for="invoice_gstno">Don't include tax</label> <input type="radio" id="invoice_gstno" name="invoice_gst" value="0" checked="checked" /> > [% END %]</li> > </ol> >- <ol> >- <li> >+ [% IF gst_values %] >+ <ol> >+ <li> > <label for="gst">Tax rate</label> > <select name="gstrate" id="gstrate"> > [% FOREACH gst IN gst_values %] >@@ -168,8 +169,11 @@ if (f.company.value == "") { > [% END %] > [% END %] > </select> >- </li> >- </ol> >+ </li> >+ </ol> >+ [% ELSE %] >+ <input type="hidden" name="gstrate" value="0" /> >+ [% END %] > <ol> > <li><label for="discount">Discount</label> > <input type="text" size="6" id="discount" name="discount" value="[% discount %]" />%</li> >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8832
:
12536
|
12537
|
12548
|
12549
|
12815
|
12911
|
13234