@@ -, +, @@ if not needed --- 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(-) --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -6011,6 +6011,27 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = "3.09.00.XXX"; +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) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt @@ -451,23 +451,27 @@ $(document).ready(function() [% END %] [% END %] -
  • - [% IF ( close ) %] - Tax rate: - [% gstrate %]% - [% ELSE %] - - [% gstrate %]% + [% ELSE %] + + [% END %] - - [% END %] -
  • + [% ELSE %] + + + [% END %]
  • [% IF ( close ) %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt @@ -156,8 +156,9 @@ if (f.company.value == "") { [% END %]
  • -
      -
    1. + [% IF gst_values %] +
        +
      1. -
      2. -
      +
    2. +
    + [% ELSE %] + + [% END %]
    1. %
    2. --