Browse Source

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>
21.05.x
Mazen Khallaf 3 years ago
committed by Jonathan Druart
parent
commit
4ddf2e8ec0
  1. 2
      acqui/basketgroup.pl
  2. 4
      acqui/neworderempty.pl
  3. 4
      acqui/orderreceive.pl
  4. 2
      acqui/parcels.pl
  5. 4
      acqui/supplier.pl
  6. 13
      installer/data/mysql/atomicupdate/bug_27485-rename_syspref.perl
  7. 2
      installer/data/mysql/localization/de-DE/custom.sql
  8. 2
      installer/data/mysql/mandatory/sysprefs.sql
  9. 2
      installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql
  10. 2
      installer/data/mysql/ru-RU/mandatory/system_preferences_optimal_values_insert_only.sql
  11. 2
      koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt
  12. 2
      koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref
  13. 2
      t/Prices.t

2
acqui/basketgroup.pl

@ -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;
}

4
acqui/neworderempty.pl

@ -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') :

4
acqui/orderreceive.pl

@ -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;

2
acqui/parcels.pl

@ -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,
);

4
acqui/supplier.pl

@ -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)

13
installer/data/mysql/atomicupdate/bug_27485-rename_syspref.perl

@ -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");
}

2
installer/data/mysql/localization/de-DE/custom.sql

@ -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';

2
installer/data/mysql/mandatory/sysprefs.sql

@ -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'),

2
installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql

@ -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';

2
installer/data/mysql/ru-RU/mandatory/system_preferences_optimal_values_insert_only.sql

@ -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 - Расширенное содержимое

2
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt

@ -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>

2
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref

@ -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."
-

2
t/Prices.t

@ -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;

Loading…
Cancel
Save