From 12727b136690f21b83182f05db72d7aeaa93ea5d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Fri, 13 May 2016 18:36:36 +0200 Subject: [PATCH] Revert "Belege runden, und Rundungsdifferenzen auf Extrakonten buchen." This reverts commit 422f2f17365ea7879c14b902c5db1e4cd7023e48. --- SL/DB/MetaSetup/Default.pm | 2 -- SL/Form.pm | 8 ++----- SL/IS.pm | 23 +++---------------- SL/OE.pm | 6 ++--- bin/mozilla/am.pl | 2 +- bin/mozilla/is.pl | 5 ---- bin/mozilla/oe.pl | 7 +++--- locale/de/all | 3 --- locale/en/all | 3 --- .../defaults_add_rnd_accno_ids.sql | 6 ----- templates/webpages/am/edit_accounts.html | 2 -- .../client_config/_default_accounts.html | 10 -------- templates/webpages/is/form_footer.html | 8 +------ templates/webpages/is/form_header.html | 2 -- templates/webpages/oe/form_footer.html | 6 ----- 15 files changed, 12 insertions(+), 81 deletions(-) delete mode 100644 sql/Pg-upgrade2/defaults_add_rnd_accno_ids.sql diff --git a/SL/DB/MetaSetup/Default.pm b/SL/DB/MetaSetup/Default.pm index 96c4b0f1f..d8f350686 100644 --- a/SL/DB/MetaSetup/Default.pm +++ b/SL/DB/MetaSetup/Default.pm @@ -91,8 +91,6 @@ __PACKAGE__->meta->columns( revtrans => { type => 'boolean', default => 'false' }, rfqnumber => { type => 'text' }, rmanumber => { type => 'text' }, - rndgain_accno_id => { type => 'integer' }, - rndloss_accno_id => { type => 'integer' }, sales_delivery_order_show_delete => { type => 'boolean', default => 'true' }, sales_order_show_delete => { type => 'boolean', default => 'true' }, sales_purchase_order_ship_missing_column => { type => 'boolean', default => 'false' }, diff --git a/SL/Form.pm b/SL/Form.pm index fbcbe56f3..d712c94b1 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -2886,9 +2886,7 @@ sub create_links { d.closedto, d.revtrans, (SELECT cu.name FROM currencies cu WHERE cu.id=d.currency_id) AS defaultcurrency, (SELECT c.accno FROM chart c WHERE d.fxgain_accno_id = c.id) AS fxgain_accno, - (SELECT c.accno FROM chart c WHERE d.fxloss_accno_id = c.id) AS fxloss_accno, - (SELECT c.accno FROM chart c WHERE d.rndgain_accno_id = c.id) AS rndgain_accno, - (SELECT c.accno FROM chart c WHERE d.rndloss_accno_id = c.id) AS rndloss_accno + (SELECT c.accno FROM chart c WHERE d.fxloss_accno_id = c.id) AS fxloss_accno FROM defaults d|; $ref = selectfirst_hashref_query($self, $dbh, $query); map { $self->{$_} = $ref->{$_} } keys %$ref; @@ -2901,9 +2899,7 @@ sub create_links { current_date AS transdate, d.closedto, d.revtrans, (SELECT cu.name FROM currencies cu WHERE cu.id=d.currency_id) AS defaultcurrency, (SELECT c.accno FROM chart c WHERE d.fxgain_accno_id = c.id) AS fxgain_accno, - (SELECT c.accno FROM chart c WHERE d.fxloss_accno_id = c.id) AS fxloss_accno, - (SELECT c.accno FROM chart c WHERE d.rndgain_accno_id = c.id) AS rndgain_accno, - (SELECT c.accno FROM chart c WHERE d.rndloss_accno_id = c.id) AS rndloss_accno + (SELECT c.accno FROM chart c WHERE d.fxloss_accno_id = c.id) AS fxloss_accno FROM defaults d|; $ref = selectfirst_hashref_query($self, $dbh, $query); map { $self->{$_} = $ref->{$_} } keys %$ref; diff --git a/SL/IS.pm b/SL/IS.pm index caa2c3469..10892dec1 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -968,14 +968,7 @@ SQL } } - # Invoice Summary includes Rounding - my $rounding = $form->round_amount( - $form->round_amount($netamount + $tax, 2, 1) - $form->round_amount($netamount + $tax, 2), 2 - ); - my $rnd_accno = $rounding == 0 ? 0 - : $rounding > 0 ? $form->{rndgain_accno} - : $form->{rndloss_accno}; - $form->{amount}{ $form->{id} }{ $form->{AR} } = $form->round_amount($netamount + $tax, 2, 1); + $form->{amount}{ $form->{id} }{ $form->{AR} } = $netamount + $tax; $form->{paid} = $form->round_amount($form->{paid} * $form->{exchangerate} + $diff, 2); @@ -1080,14 +1073,6 @@ SQL do_query($form, $dbh, $query, @values); } } - if (!$payments_only && ($rnd_accno != 0)) { - $query = - qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, tax_id, taxkey, project_id, chart_link) - VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, (SELECT id FROM tax WHERE taxkey=0), 0, ?, (SELECT link FROM chart WHERE accno = ?))|; - @values = (conv_i($trans_id), $rnd_accno, $rounding, conv_date($form->{invdate}), conv_i($project_id), $rnd_accno); - do_query($form, $dbh, $query, @values); - $rnd_accno = 0; - } } # deduct payment differences from diff @@ -1252,7 +1237,7 @@ SQL return; } - $amount = $form->round_amount( $netamount + $tax, 2, 1); + $amount = $netamount + $tax; # save AR record #erweiterung fuer lieferscheinnummer (donumber) 12.02.09 jb @@ -1897,9 +1882,7 @@ sub retrieve_invoice { (SELECT c.accno FROM chart c WHERE d.income_accno_id = c.id) AS income_accno, (SELECT c.accno FROM chart c WHERE d.expense_accno_id = c.id) AS expense_accno, (SELECT c.accno FROM chart c WHERE d.fxgain_accno_id = c.id) AS fxgain_accno, - (SELECT c.accno FROM chart c WHERE d.fxloss_accno_id = c.id) AS fxloss_accno, - (SELECT c.accno FROM chart c WHERE d.rndgain_accno_id = c.id) AS rndgain_accno, - (SELECT c.accno FROM chart c WHERE d.rndloss_accno_id = c.id) AS rndloss_accno + (SELECT c.accno FROM chart c WHERE d.fxloss_accno_id = c.id) AS fxloss_accno ${query_transdate} FROM defaults d|; diff --git a/SL/OE.pm b/SL/OE.pm index 61af6211c..7cd5de158 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -690,7 +690,7 @@ SQL my $tax = 0; map { $tax += $form->round_amount($taxaccounts{$_}, 2) } keys %taxaccounts; - $amount = $form->round_amount($netamount + $tax, 2, 1); + $amount = $form->round_amount($netamount + $tax, 2); $netamount = $form->round_amount($netamount, 2); if ($form->{currency} eq $form->{defaultcurrency}) { @@ -956,9 +956,7 @@ sub retrieve { (SELECT c.accno FROM chart c WHERE d.income_accno_id = c.id) AS income_accno, (SELECT c.accno FROM chart c WHERE d.expense_accno_id = c.id) AS expense_accno, (SELECT c.accno FROM chart c WHERE d.fxgain_accno_id = c.id) AS fxgain_accno, - (SELECT c.accno FROM chart c WHERE d.fxloss_accno_id = c.id) AS fxloss_accno, - (SELECT c.accno FROM chart c WHERE d.rndgain_accno_id = c.id) AS rndgain_accno, - (SELECT c.accno FROM chart c WHERE d.rndloss_accno_id = c.id) AS rndloss_accno + (SELECT c.accno FROM chart c WHERE d.fxloss_accno_id = c.id) AS fxloss_accno $query_add FROM defaults d|; my $ref = selectfirst_hashref_query($form, $dbh, $query); diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index 62c645a6f..09a671e93 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -590,7 +590,7 @@ sub delete_account { $form->{title} = $locale->text('Delete Account'); foreach my $id ( - qw(inventory_accno_id income_accno_id expense_accno_id fxgain_accno_id fxloss_accno_id rndgain_accno_id rndloss_accno_id) + qw(inventory_accno_id income_accno_id expense_accno_id fxgain_accno_id fxloss_accno_id) ) { if ($form->{id} == $form->{$id}) { $form->error($locale->text('Cannot delete default account!')); diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 37981eb5d..3a3d433bb 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -463,11 +463,6 @@ sub form_footer { } } - $form->{rounding} = $form->round_amount( - $form->round_amount($form->{invtotal}, 2, 1) - $form->round_amount($form->{invtotal}, 2), 2 - ); - $form->{invtotal} = $form->round_amount( $form->{invtotal}, 2, 1 ); - # follow ups if ($form->{id}) { $form->{follow_ups} = FU->follow_ups('trans_id' => $form->{id}) || []; diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 11e220a68..86f0298f7 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -539,6 +539,9 @@ sub form_footer { |; } } + +# $form->{invsubtotal} = $form->format_amount(\%myconfig, $form->{invsubtotal}, 2, 0); # template does this + } else { foreach my $item (split / /, $form->{taxaccounts}) { if ($form->{"${item}_base"}) { @@ -560,10 +563,6 @@ sub form_footer { } } - $form->{rounding} = $form->round_amount( - $form->round_amount($form->{invtotal}, 2, 1) - $form->round_amount($form->{invtotal}, 2) - ); - $form->{invtotal} = $form->round_amount( $form->{invtotal}, 2, 1); $form->{oldinvtotal} = $form->{invtotal}; $TMPL_VAR{ALL_DELIVERY_TERMS} = SL::DB::Manager::DeliveryTerm->get_all_sorted(); diff --git a/locale/de/all b/locale/de/all index 393f44126..796aa9ca0 100755 --- a/locale/de/all +++ b/locale/de/all @@ -2320,9 +2320,6 @@ $self->{texts} = { 'Risk' => 'Risiko', 'Risk levels' => 'Risikograde', 'Risks' => 'Risikograde', - 'Rounding' => 'Rundung', - 'Rounding Gain' => 'Rundungserträge', - 'Rounding Loss' => 'Rundungsaufwendungen', 'Row' => 'Zeile', 'Row #1: amount has to be different from zero.' => 'Zeile #1: Der Wert darf nicht 0 sein.', 'Row number' => 'Zeilennummer', diff --git a/locale/en/all b/locale/en/all index e371413d7..bf275f642 100644 --- a/locale/en/all +++ b/locale/en/all @@ -1787,9 +1787,6 @@ $self->{texts} = { 'Revenues EU without UStId' => '', 'Review of Aging list' => '', 'Right' => '', - 'Rounding' => '', - 'Rounding Gain' => '', - 'Rounding Loss' => '', 'Row #1: amount has to be different from zero.' => '', 'Row number' => '', 'Row was created from current record' => '', diff --git a/sql/Pg-upgrade2/defaults_add_rnd_accno_ids.sql b/sql/Pg-upgrade2/defaults_add_rnd_accno_ids.sql deleted file mode 100644 index deee948b1..000000000 --- a/sql/Pg-upgrade2/defaults_add_rnd_accno_ids.sql +++ /dev/null @@ -1,6 +0,0 @@ --- @tag: defaults_add_rnd_accno_ids --- @description: adds new columns 'rndgain_accno_id' and 'rndloss_accno_id' in table defaults, used to book roundings --- @depends: release_3_1_0 -ALTER TABLE defaults ADD COLUMN rndgain_accno_id Integer; -ALTER TABLE defaults ADD COLUMN rndloss_accno_id Integer; - diff --git a/templates/webpages/am/edit_accounts.html b/templates/webpages/am/edit_accounts.html index 12a284c25..2bcaa0d30 100644 --- a/templates/webpages/am/edit_accounts.html +++ b/templates/webpages/am/edit_accounts.html @@ -27,8 +27,6 @@ $(function() { - -
diff --git a/templates/webpages/client_config/_default_accounts.html b/templates/webpages/client_config/_default_accounts.html index bb92517f2..51c9d2eed 100644 --- a/templates/webpages/client_config/_default_accounts.html +++ b/templates/webpages/client_config/_default_accounts.html @@ -30,16 +30,6 @@ [% L.chart_picker('defaults.fxloss_accno_id', SELF.defaults.fxloss_accno_id, category='E,A', choose=1, style=style) %] - - [% LxERP.t8("Rounding Gain") %] - [% L.chart_picker('defaults.rndgain_accno_id', SELF.defaults.rndgain_accno_id, category='I,A', choose=1, style=style) %] - - - - [% LxERP.t8("Rounding Loss") %] - [% L.chart_picker('defaults.rndloss_accno_id', SELF.defaults.rndloss_accno_id, category='E,A', choose=1, style=style) %] - - [% LxERP.t8("Current assets account") %] [% L.chart_picker('defaults.ar_paid_accno_id', SELF.defaults.ar_paid_accno_id, type='AR_paid', choose=1, style=style) %] diff --git a/templates/webpages/is/form_footer.html b/templates/webpages/is/form_footer.html index 7980bcac4..d91527cf5 100644 --- a/templates/webpages/is/form_footer.html +++ b/templates/webpages/is/form_footer.html @@ -107,13 +107,6 @@ [%- END %] -[%- IF rounding %] - - [% 'Rounding' | $T8 %] - [% LxERP.format_amount(rounding, 2) %] - -[%- END %] - [%# tax %] [% FOREACH item = taxaccounts_array %] [% SET description_ref = item _ '_description' %] @@ -131,6 +124,7 @@ [%- END %] [%- END %] + [% 'Total' | $T8 %] [% LxERP.format_amount(invtotal, 2) %] diff --git a/templates/webpages/is/form_header.html b/templates/webpages/is/form_header.html index f9a8879c6..c84b85bba 100644 --- a/templates/webpages/is/form_header.html +++ b/templates/webpages/is/form_header.html @@ -162,8 +162,6 @@ - - [%- IF show_exchangerate %] diff --git a/templates/webpages/oe/form_footer.html b/templates/webpages/oe/form_footer.html index fbeb52992..0956f204f 100644 --- a/templates/webpages/oe/form_footer.html +++ b/templates/webpages/oe/form_footer.html @@ -107,12 +107,6 @@ [% 'Subtotal' | $T8 %] [% LxERP.format_amount(invsubtotal, 2) %] -[%- END %] -[%- IF rounding %] - - [% 'Rounding' | $T8 %] - [% LxERP.format_amount(rounding, 2) %] - [%- END %] [% tax %] -- 2.20.1