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

(-)a/installer/data/mysql/updatedatabase.pl (+21 lines)
Lines 6011-6016 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
6011
    SetVersion ($DBversion);
6011
    SetVersion ($DBversion);
6012
}
6012
}
6013
6013
6014
$DBversion = "3.09.00.XXX";
6015
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
6016
    my $gst_booksellers = $dbh->selectcol_arrayref("SELECT DISTINCT(gstrate) FROM aqbooksellers");
6017
    my $gist_syspref = C4::Context->preference("gist");
6018
    # remove the undef values and construct and array with the syspref and the supplier values
6019
    my @gstrates = map { defined $_ ? $_ : () } @$gst_booksellers;
6020
    push @gstrates, split ('\|', $gist_syspref);
6021
    # we want to compare integer (or float)
6022
    $_ = $_ + 0 for @gstrates;
6023
    use List::MoreUtils qw/uniq/;
6024
    # remove duplicate values
6025
    @gstrates = uniq sort @gstrates;
6026
    my $new_syspref_value = join '|', @gstrates;
6027
    # update the syspref with the new values
6028
    my $sth = $dbh->prepare("UPDATE systempreferences set value=? WHERE variable='gist'");
6029
    $sth->execute( $new_syspref_value );
6030
6031
    print "Upgrade to $DBversion done (Bug 8832, Set the syspref gist with the existing values)\n";
6032
    SetVersion ($DBversion);
6033
}
6034
6014
=head1 FUNCTIONS
6035
=head1 FUNCTIONS
6015
6036
6016
=head2 TableExists($table)
6037
=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