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

(-)a/installer/data/mysql/updatedatabase.pl (+21 lines)
Lines 6020-6025 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
6020
   SetVersion ($DBversion);
6020
   SetVersion ($DBversion);
6021
}
6021
}
6022
6022
6023
$DBversion = "3.09.00.XXX";
6024
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
6025
    my $gst_booksellers = $dbh->selectcol_arrayref("SELECT DISTINCT(gstrate) FROM aqbooksellers");
6026
    my $gist_syspref = C4::Context->preference("gist");
6027
    # remove the undef values and construct and array with the syspref and the supplier values
6028
    my @gstrates = map { defined $_ ? $_ : () } @$gst_booksellers;
6029
    push @gstrates, split ('\|', $gist_syspref);
6030
    # we want to compare integer (or float)
6031
    $_ = $_ + 0 for @gstrates;
6032
    use List::MoreUtils qw/uniq/;
6033
    # remove duplicate values
6034
    @gstrates = uniq sort @gstrates;
6035
    my $new_syspref_value = join '|', @gstrates;
6036
    # update the syspref with the new values
6037
    my $sth = $dbh->prepare("UPDATE systempreferences set value=? WHERE variable='gist'");
6038
    $sth->execute( $new_syspref_value );
6039
6040
    print "Upgrade to $DBversion done (Bug 8832, Set the syspref gist with the existing values)\n";
6041
    SetVersion ($DBversion);
6042
}
6043
6023
=head1 FUNCTIONS
6044
=head1 FUNCTIONS
6024
6045
6025
=head2 TableExists($table)
6046
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt (-16 / +20 lines)
Lines 451-473 $(document).ready(function() Link Here
451
                [% END %]
451
                [% END %]
452
            </li>
452
            </li>
453
            [% END %]
453
            [% END %]
454
            <li>
454
            [% IF ( gst_values ) %]
455
                [% IF ( close ) %]
455
                <li>
456
                    <span class="label">Tax rate: </span>
456
                    [% IF ( close ) %]
457
                    <input type="hidden" size="20" name="gstrate" id="gstrate" value="[% gstrate %]" />[% gstrate %]%
457
                        <span class="label">Tax rate: </span>
458
                [% ELSE %]
458
                        <input type="hidden" size="20" name="gstrate" id="gstrate" value="[% gstrate %]" />[% gstrate %]%
459
                    <label for="gst">Tax rate: </label>
459
                    [% ELSE %]
460
                    <select name="gstrate" id="gstrate" onchange="updateCosts();">
460
                        <label for="gst">Tax rate: </label>
461
                    [% FOREACH gst IN gst_values %]
461
                        <select name="gstrate" id="gstrate" onchange="updateCosts();">
462
                      [% IF ( gst.option == gstrate ) %]
462
                        [% FOREACH gst IN gst_values %]
463
                        <option value="[% gst.option %]" selected="selected">[% gst.option * 100 | format("%.1f") %]%</option>
463
                          [% IF ( gst.option == gstrate ) %]
464
                      [% ELSE %]
464
                            <option value="[% gst.option %]" selected="selected">[% gst.option * 100 | format("%.1f") %]%</option>
465
                        <option value="[% gst.option %]">[% gst.option * 100 | format("%.1f") %]%</option>
465
                          [% ELSE %]
466
                      [% END %]
466
                            <option value="[% gst.option %]">[% gst.option * 100 | format("%.1f") %]%</option>
467
                          [% END %]
468
                        [% END %]
469
                        </select>
467
                    [% END %]
470
                    [% END %]
468
                    </select>
471
                [% ELSE %]
469
                [% END %]
472
                    <input type="hidden" name="gstrate" value="0" />
470
            </li>
473
                </li>
474
            [% END %]
471
            <li>
475
            <li>
472
                <label for="discount">Discount: </label>
476
                <label for="discount">Discount: </label>
473
                [% IF ( close ) %]
477
                [% IF ( close ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt (-5 / +8 lines)
Lines 156-163 if (f.company.value == "") { Link Here
156
                    <label for="invoice_gstno">Don't include tax</label> <input type="radio" id="invoice_gstno" name="invoice_gst" value="0" checked="checked" />
156
                    <label for="invoice_gstno">Don't include tax</label> <input type="radio" id="invoice_gstno" name="invoice_gst" value="0" checked="checked" />
157
                [% END %]</li>
157
                [% END %]</li>
158
            </ol>
158
            </ol>
159
             <ol>
159
            [% IF gst_values %]
160
                <li>
160
                <ol>
161
                  <li>
161
                    <label for="gst">Tax rate</label>
162
                    <label for="gst">Tax rate</label>
162
                    <select name="gstrate" id="gstrate">
163
                    <select name="gstrate" id="gstrate">
163
                    [% FOREACH gst IN gst_values %]
164
                    [% FOREACH gst IN gst_values %]
Lines 168-175 if (f.company.value == "") { Link Here
168
                      [% END %]
169
                      [% END %]
169
                    [% END %]
170
                    [% END %]
170
                    </select>
171
                    </select>
171
                </li>
172
                  </li>
172
            </ol>
173
                </ol>
174
            [% ELSE %]
175
                <input type="hidden" name="gstrate" value="0" />
176
            [% END %]
173
            <ol>
177
            <ol>
174
            <li><label for="discount">Discount</label>
178
            <li><label for="discount">Discount</label>
175
                <input type="text" size="6" id="discount" name="discount" value="[% discount %]" />%</li>
179
                <input type="text" size="6" id="discount" name="discount" value="[% discount %]" />%</li>
176
- 

Return to bug 8832