Bug 27485: Rename system preference gist to TaxRates

Test Plan:

1. Create a vendor
2. Create a basket
3. Add an order to the basket (note the existence of the option 'gist'
4  Apply patch
5. Create another order (note the existence of the option 'TaxRates'
    instead)
6. Run 'prove t/Prices.t' to confirm the tests were successful
7. If everything above is correct then patch was successful

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Mazen Khallaf 2021-01-20 21:23:28 +00:00 committed by Jonathan Druart
parent c6009f3220
commit 4ddf2e8ec0
13 changed files with 28 additions and 15 deletions

View File

@ -208,7 +208,7 @@ sub printbasketgrouppdf{
-type => 'application/pdf',
-attachment => ( $basketgroup->{name} || $basketgroupid ) . '.pdf'
);
my $pdf = printpdf($basketgroup, $bookseller, $baskets, \%orders, $bookseller->tax_rate // C4::Context->preference("gist")) || die "pdf generation failed";
my $pdf = printpdf($basketgroup, $bookseller, $baskets, \%orders, $bookseller->tax_rate // C4::Context->preference("TaxRates")) || die "pdf generation failed";
print $pdf;
}

View File

@ -405,10 +405,10 @@ if ( defined $from_subscriptionid ) {
my (undef, $barcode_subfield) = GetMarcFromKohaField( 'items.barcode' );
# get option values for gist syspref
# get option values for TaxRates syspref
my @gst_values = map {
option => $_ + 0.0
}, split( '\|', C4::Context->preference("gist") );
}, split( '\|', C4::Context->preference("TaxRates") );
my $quantity = $input->param('rr_quantity_to_order') ?
$input->param('rr_quantity_to_order') :

View File

@ -124,10 +124,10 @@ my $budget = GetBudget( $order->budget_id );
my $datereceived = $order->datereceived ? dt_from_string( $order->datereceived ) : dt_from_string;
# get option values for gist syspref
# get option values for TaxRates syspref
my @gst_values = map {
option => $_ + 0.0
}, split( '\|', C4::Context->preference("gist") );
}, split( '\|', C4::Context->preference("TaxRates") );
my $order_internalnote = $order->order_internalnote;
my $order_vendornote = $order->order_vendornote;

View File

@ -201,7 +201,7 @@ $template->param(
name => $bookseller->name,
shipmentdate_today => dt_from_string,
booksellerid => $booksellerid,
GST => C4::Context->preference('gist'),
GST => C4::Context->preference('TaxRates'),
budgets => $budget_loop,
);

View File

@ -100,10 +100,10 @@ if ( $op eq 'display' ) {
} else {
my @currencies = Koha::Acquisition::Currencies->search;
# get option values from gist syspref
# get option values from TaxRates syspref
my @gst_values = map {
option => $_ + 0.0
}, split( '\|', C4::Context->preference("gist") );
}, split( '\|', C4::Context->preference("TaxRates") );
$template->param(
# set active ON by default for supplier add (id empty for add)

View File

@ -0,0 +1,13 @@
$DBversion = 'XXX'; # will be replaced by the RM
if( CheckVersion( $DBversion ) ) {
# you can use $dbh here like:
$dbh->do(q{UPDATE systempreferences set variable="TaxRates" WHERE variable="gist"});
# or perform some test and warn
# if( !column_exists( 'biblio', 'biblionumber' ) ) {
# warn "There is something wrong";
# }
# Always end with this (adjust the bug info)
NewVersion( $DBversion, XXXXX, "Description");
}

View File

@ -33,7 +33,7 @@ UPDATE systempreferences SET value =
WHERE variable = 'OPACSearchForTitleIn';
-- Sunday = 0, Monday = 1, etc.
UPDATE systempreferences SET value = '1' WHERE variable = 'CalendarFirstDayOfWeek';
UPDATE systempreferences SET value = '0.07|0.19|0.00' WHERE variable = 'gist';
UPDATE systempreferences SET value = '0.07|0.19|0.00' WHERE variable = 'TaxRates';
UPDATE systempreferences SET value = 'Dieser Text wird über den Systemparameter <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=RoutingListNote#jumped">RoutingListNote</a> konfiguriert.' where variable = 'RoutingListNote';
UPDATE systempreferences SET value = 'barcode stocknumber' WHERE variable = 'uniqueitemfields';
UPDATE systempreferences SET value = 'de-DE,en' WHERE variable = 'language';

View File

@ -211,7 +211,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
('finesMode','off','off|production','Choose the fines mode, \'off\' (no charges), \'production\' (accrue overdue fines). Requires accruefines cronjob.','Choice'),
('FRBRizeEditions','0','','If ON, Koha will query one or more ISBN web services for associated ISBNs and display an Editions tab on the details pages','YesNo'),
('GDPR_Policy','','Enforced|Permissive|Disabled','General Data Protection Regulation - policy', 'Choice'),
('gist','0','','Default Goods and Services tax rate NOT in %, but in numeric form (0.12 for 12%), set to 0 to disable GST','Integer'),
('TaxRates','0','','Default Goods and Services tax rate NOT in %, but in numeric form (0.12 for 12%), set to 0 to disable GST','Integer'),
('GoogleJackets','0',NULL,'if ON, displays jacket covers from Google Books API','YesNo'),
('GoogleOpenIDConnect', '0', NULL, 'if ON, allows the use of Google OpenID Connect for login', 'YesNo'),
('GoogleOAuth2ClientID', '', NULL, 'Client ID for the web app registered with Google', 'Free'),

View File

@ -22,7 +22,7 @@ UPDATE systempreferences SET value = 'Господин|Госпожа|Мисте
UPDATE systempreferences SET value = 'metric' WHERE variable = 'dateformat';
UPDATE systempreferences SET value = 'udc' WHERE variable = 'DefaultClassificationSource';
UPDATE systempreferences SET value = '1' WHERE variable = 'ExtendedPatronAttributes';
UPDATE systempreferences SET value = '0.20' WHERE variable = 'gist';
UPDATE systempreferences SET value = '0.20' WHERE variable = 'TaxRates';
UPDATE systempreferences SET value = '942hv' WHERE variable = 'itemcallnumber';
UPDATE systempreferences SET value = 'ru-RU,uk-UA,en,fr-FR,de-DE' WHERE variable = 'language';
UPDATE systempreferences SET value = 'ru-RU,uk-UA,en,fr-FR,de-DE' WHERE variable = 'opaclanguages';

View File

@ -6,7 +6,7 @@ UPDATE systempreferences SET value='OPENOFFICE.ORG' WHERE variable='MIME';
-- Acquisitions - Поступления
UPDATE systempreferences SET value='0.20' WHERE variable='gist';
UPDATE systempreferences SET value='0.20' WHERE variable='TaxRates';
-- EnhancedContent - Расширенное содержимое

View File

@ -406,7 +406,7 @@
[% END %]
</select>
[% IF !gst_found %]<span class="required">Tax rate not defined in system preference gist!</span>[% END %]
[% IF !gst_found %]<span class="required">Tax rate not defined in system preference TaxRates!</span>[% END %]
[% ELSE %]
<input type="hidden" name="tax_rate" value="0" />
</li>

View File

@ -36,7 +36,7 @@ Acquisitions:
CH: 360'000.00 (CH)
-
- Tax rates are
- pref: gist
- pref: TaxRates
- . Enter in numeric form, 0.12 for 12%. The first item in the list will be selected by default. For more than one value, separate with | (pipe).
- "Please note: The database will only accept values up to 4 decimals precision, further values will be rounded."
-

View File

@ -18,7 +18,7 @@ use_ok('C4::Acquisition');
use_ok('C4::Context');
use_ok('Koha::Number::Price');
t::lib::Mocks::mock_preference( 'gist', '0.02|0.05|0.196' );
t::lib::Mocks::mock_preference( 'TaxRates', '0.02|0.05|0.196' );
use Test::DBIx::Class;