From 9f07753bc46cf5614fe454656f352bc74de5920a Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 1 Mar 2013 14:01:36 +0100 Subject: [PATCH] =?utf8?q?=C3=9Cberfl=C3=BCssige=20Tabellen=20customertax,?= =?utf8?q?=20vendortax,=20partstax=20entfernt?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fixt #2186. --- SL/AM.pm | 12 +- SL/DB/CustomerTax.pm | 13 -- SL/DB/Helper/ALL.pm | 3 - SL/DB/Helper/Mappings.pm | 3 - SL/DB/MetaSetup/CustomerTax.pm | 26 ---- SL/DB/MetaSetup/PartsTax.pm | 26 ---- SL/DB/MetaSetup/VendorTax.pm | 26 ---- SL/DB/PartsTax.pm | 13 -- SL/DB/VendorTax.pm | 13 -- SL/IC.pm | 28 +---- SL/IR.pm | 91 +++++++------- SL/IS.pm | 119 +++++++++--------- SL/RP.pm | 39 +----- bin/mozilla/rp.pl | 4 - locale/de/all | 2 - .../delete_customertax_vendortax_partstax.sql | 7 ++ templates/webpages/rp/report.html | 46 ------- 17 files changed, 120 insertions(+), 351 deletions(-) delete mode 100644 SL/DB/CustomerTax.pm delete mode 100644 SL/DB/MetaSetup/CustomerTax.pm delete mode 100644 SL/DB/MetaSetup/PartsTax.pm delete mode 100644 SL/DB/MetaSetup/VendorTax.pm delete mode 100644 SL/DB/PartsTax.pm delete mode 100644 SL/DB/VendorTax.pm create mode 100644 sql/Pg-upgrade2/delete_customertax_vendortax_partstax.sql diff --git a/SL/AM.pm b/SL/AM.pm index 5645c4dd7..591f580b7 100644 --- a/SL/AM.pm +++ b/SL/AM.pm @@ -475,11 +475,9 @@ sub delete_account { do_query($form, $dbh, $query, $form->{id}); } - foreach my $table (qw(partstax customertax vendortax tax)) { - $query = qq|DELETE FROM $table - WHERE chart_id = ?|; - do_query($form, $dbh, $query, $form->{id}); - } + $query = qq|DELETE FROM tax + WHERE chart_id = ?|; + do_query($form, $dbh, $query, $form->{id}); # delete chart of account record $query = qq|DELETE FROM chart @@ -1779,8 +1777,8 @@ sub get_tax { taxkey, taxdescription, round(rate * 100, 2) AS rate, - chart_id, - (id IN (SELECT tax_id + chart_id, + (id IN (SELECT tax_id FROM acc_trans)) AS tax_already_used FROM tax WHERE id = ? |; diff --git a/SL/DB/CustomerTax.pm b/SL/DB/CustomerTax.pm deleted file mode 100644 index 2efc60e18..000000000 --- a/SL/DB/CustomerTax.pm +++ /dev/null @@ -1,13 +0,0 @@ -# This file has been auto-generated only because it didn't exist. -# Feel free to modify it at will; it will not be overwritten automatically. - -package SL::DB::CustomerTax; - -use strict; - -use SL::DB::MetaSetup::CustomerTax; - -# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. -__PACKAGE__->meta->make_manager_class; - -1; diff --git a/SL/DB/Helper/ALL.pm b/SL/DB/Helper/ALL.pm index 928b6654c..83161c518 100644 --- a/SL/DB/Helper/ALL.pm +++ b/SL/DB/Helper/ALL.pm @@ -24,7 +24,6 @@ use SL::DB::CustomVariable; use SL::DB::CustomVariableConfig; use SL::DB::CustomVariableValidity; use SL::DB::Customer; -use SL::DB::CustomerTax; use SL::DB::Datev; use SL::DB::Default; use SL::DB::DeliveryOrder; @@ -57,7 +56,6 @@ use SL::DB::Order; use SL::DB::OrderItem; use SL::DB::Part; use SL::DB::PartsGroup; -use SL::DB::PartsTax; use SL::DB::PaymentTerm; use SL::DB::PeriodicInvoice; use SL::DB::PeriodicInvoicesConfig; @@ -86,7 +84,6 @@ use SL::DB::Unit; use SL::DB::UnitsLanguage; use SL::DB::VC; use SL::DB::Vendor; -use SL::DB::VendorTax; use SL::DB::Warehouse; 1; diff --git a/SL/DB/Helper/Mappings.pm b/SL/DB/Helper/Mappings.pm index d04d05e1b..5267449ba 100644 --- a/SL/DB/Helper/Mappings.pm +++ b/SL/DB/Helper/Mappings.pm @@ -56,7 +56,6 @@ my %lxoffice_package_names = ( custom_variable_configs => 'custom_variable_config', custom_variables => 'custom_variable', custom_variables_validity => 'custom_variable_validity', - customertax => 'customer_tax', datev => 'datev', defaults => 'default', delivery_orders => 'delivery_order', @@ -85,7 +84,6 @@ my %lxoffice_package_names = ( oe => 'order', parts => 'part', partsgroup => 'parts_group', - partstax => 'parts_tax', payment_terms => 'payment_term', periodic_invoices => 'periodic_invoice', periodic_invoices_configs => 'periodic_invoices_config', @@ -109,7 +107,6 @@ my %lxoffice_package_names = ( units => 'unit', units_language => 'units_language', vendor => 'vendor', - vendortax => 'vendor_tax', ); my (%lxoffice_tables_to_packages, %lxoffice_tables_to_manager_packages, %lxoffice_packages_to_tables); diff --git a/SL/DB/MetaSetup/CustomerTax.pm b/SL/DB/MetaSetup/CustomerTax.pm deleted file mode 100644 index 252299578..000000000 --- a/SL/DB/MetaSetup/CustomerTax.pm +++ /dev/null @@ -1,26 +0,0 @@ -# This file has been auto-generated. Do not modify it; it will be overwritten -# by rose_auto_create_model.pl automatically. -package SL::DB::CustomerTax; - -use strict; - -use base qw(SL::DB::Object); - -__PACKAGE__->meta->setup( - table => 'customertax', - - columns => [ - customer_id => { type => 'integer' }, - chart_id => { type => 'integer' }, - itime => { type => 'timestamp', default => 'now()' }, - mtime => { type => 'timestamp' }, - id => { type => 'serial', not_null => 1 }, - ], - - primary_key_columns => [ 'id' ], - - allow_inline_column_values => 1, -); - -1; -; diff --git a/SL/DB/MetaSetup/PartsTax.pm b/SL/DB/MetaSetup/PartsTax.pm deleted file mode 100644 index 9bcdb5d4d..000000000 --- a/SL/DB/MetaSetup/PartsTax.pm +++ /dev/null @@ -1,26 +0,0 @@ -# This file has been auto-generated. Do not modify it; it will be overwritten -# by rose_auto_create_model.pl automatically. -package SL::DB::PartsTax; - -use strict; - -use base qw(SL::DB::Object); - -__PACKAGE__->meta->setup( - table => 'partstax', - - columns => [ - parts_id => { type => 'integer' }, - chart_id => { type => 'integer' }, - itime => { type => 'timestamp', default => 'now()' }, - mtime => { type => 'timestamp' }, - id => { type => 'serial', not_null => 1 }, - ], - - primary_key_columns => [ 'id' ], - - allow_inline_column_values => 1, -); - -1; -; diff --git a/SL/DB/MetaSetup/VendorTax.pm b/SL/DB/MetaSetup/VendorTax.pm deleted file mode 100644 index bbd3988f1..000000000 --- a/SL/DB/MetaSetup/VendorTax.pm +++ /dev/null @@ -1,26 +0,0 @@ -# This file has been auto-generated. Do not modify it; it will be overwritten -# by rose_auto_create_model.pl automatically. -package SL::DB::VendorTax; - -use strict; - -use base qw(SL::DB::Object); - -__PACKAGE__->meta->setup( - table => 'vendortax', - - columns => [ - vendor_id => { type => 'integer' }, - chart_id => { type => 'integer' }, - itime => { type => 'timestamp', default => 'now()' }, - mtime => { type => 'timestamp' }, - id => { type => 'serial', not_null => 1 }, - ], - - primary_key_columns => [ 'id' ], - - allow_inline_column_values => 1, -); - -1; -; diff --git a/SL/DB/PartsTax.pm b/SL/DB/PartsTax.pm deleted file mode 100644 index 3bea19be4..000000000 --- a/SL/DB/PartsTax.pm +++ /dev/null @@ -1,13 +0,0 @@ -# This file has been auto-generated only because it didn't exist. -# Feel free to modify it at will; it will not be overwritten automatically. - -package SL::DB::PartsTax; - -use strict; - -use SL::DB::MetaSetup::PartsTax; - -# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. -__PACKAGE__->meta->make_manager_class; - -1; diff --git a/SL/DB/VendorTax.pm b/SL/DB/VendorTax.pm deleted file mode 100644 index a4c6fc914..000000000 --- a/SL/DB/VendorTax.pm +++ /dev/null @@ -1,13 +0,0 @@ -# This file has been auto-generated only because it didn't exist. -# Feel free to modify it at will; it will not be overwritten automatically. - -package SL::DB::VendorTax; - -use strict; - -use SL::DB::MetaSetup::VendorTax; - -# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. -__PACKAGE__->meta->make_manager_class; - -1; diff --git a/SL/IC.pm b/SL/IC.pm index 8d46c2d90..d458862ea 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -156,18 +156,6 @@ SQL } $trq->finish; - # now get accno for taxes - $query = - qq|SELECT c.accno - FROM chart c, partstax pt - WHERE (pt.chart_id = c.id) AND (pt.parts_id = ?)|; - $sth = prepare_execute_query($form, $dbh, $query, conv_i($form->{id})); - while (my ($key) = $sth->fetchrow_array) { - $form->{amount}{$key} = $key; - } - - $sth->finish; - # is it an orphan my @referencing_tables = qw(invoice orderitems inventory rmaitems); my %column_map = ( ); @@ -295,9 +283,6 @@ sub save { do_query($form, $dbh, qq|DELETE FROM assembly WHERE id = ?|, conv_i($form->{id})); } - # delete tax records - do_query($form, $dbh, qq|DELETE FROM partstax WHERE parts_id = ?|, conv_i($form->{id})); - # delete translations do_query($form, $dbh, qq|DELETE FROM translation WHERE parts_id = ?|, conv_i($form->{id})); @@ -470,17 +455,6 @@ sub save { } } - # insert taxes - foreach my $item (split(/ /, $form->{taxaccounts})) { - if ($form->{"IC_tax_$item"}) { - $query = - qq|INSERT INTO partstax (parts_id, chart_id) - VALUES (?, (SELECT id FROM chart WHERE accno = ?))|; - @values = (conv_i($form->{id}), $item); - do_query($form, $dbh, $query, @values); - } - } - # add assembly records if ($form->{item} eq 'assembly') { @@ -617,7 +591,7 @@ sub delete { my %columns = ( "assembly" => "id", "parts" => "id" ); - for my $table (qw(prices partstax makemodel inventory assembly translation parts)) { + for my $table (qw(prices makemodel inventory assembly translation parts)) { my $column = defined($columns{$table}) ? $columns{$table} : "parts_id"; do_query($form, $dbh, qq|DELETE FROM $table WHERE $column = ?|, @values); } diff --git a/SL/IR.pm b/SL/IR.pm index 48c5134fa..1f0ae58f7 100644 --- a/SL/IR.pm +++ b/SL/IR.pm @@ -270,32 +270,32 @@ sub post_invoice { # allocated >= 0 # add entry for inventory, this one is for the sold item $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, taxkey, tax_id) VALUES (?, ?, ?, ?, - (SELECT taxkey_id - FROM taxkeys + (SELECT taxkey_id + FROM taxkeys WHERE chart_id= ? AND startdate <= ? ORDER BY startdate DESC LIMIT 1), - (SELECT tax_id - FROM taxkeys + (SELECT tax_id + FROM taxkeys WHERE chart_id= ? AND startdate <= ? ORDER BY startdate DESC LIMIT 1), (SELECT chart_link FROM chart WHERE id = ?))|; - @values = ($ref->{trans_id}, $ref->{inventory_accno_id}, $linetotal, $ref->{transdate}, $ref->{inventory_accno_id}, $ref->{transdate}, $ref->{inventory_accno_id}, $ref->{transdate}, + @values = ($ref->{trans_id}, $ref->{inventory_accno_id}, $linetotal, $ref->{transdate}, $ref->{inventory_accno_id}, $ref->{transdate}, $ref->{inventory_accno_id}, $ref->{transdate}, $ref->{inventory_accno_id}); do_query($form, $dbh, $query, @values); # add expense $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, taxkey, tax_id) VALUES (?, ?, ?, ?, - (SELECT taxkey_id - FROM taxkeys + (SELECT taxkey_id + FROM taxkeys WHERE chart_id= ? - AND startdate <= ? + AND startdate <= ? ORDER BY startdate DESC LIMIT 1), - (SELECT tax_id - FROM taxkeys + (SELECT tax_id + FROM taxkeys WHERE chart_id= ? - AND startdate <= ? + AND startdate <= ? ORDER BY startdate DESC LIMIT 1), (SELECT chart_link FROM chart WHERE id = ?))|; @values = ($ref->{trans_id}, $ref->{expense_accno_id}, ($linetotal * -1), $ref->{transdate}, $ref->{expense_accno_id}, $ref->{transdate}, $ref->{expense_accno_id}, $ref->{transdate}, @@ -504,20 +504,20 @@ sub post_invoice { $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, taxkey, project_id, tax_id, chart_link) VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, - (SELECT taxkey_id - FROM taxkeys - WHERE chart_id= (SELECT id - FROM chart - WHERE accno = ?) - AND startdate <= ? + (SELECT taxkey_id + FROM taxkeys + WHERE chart_id= (SELECT id + FROM chart + WHERE accno = ?) + AND startdate <= ? ORDER BY startdate DESC LIMIT 1), ?, - (SELECT tax_id - FROM taxkeys - WHERE chart_id= (SELECT id - FROM chart - WHERE accno = ?) - AND startdate <= ? + (SELECT tax_id + FROM taxkeys + WHERE chart_id= (SELECT id + FROM chart + WHERE accno = ?) + AND startdate <= ? ORDER BY startdate DESC LIMIT 1), (SELECT link FROM chart WHERE accno = ?))|; @values = ($trans_id, $accno, $form->{amount}{$trans_id}{$accno}, @@ -558,20 +558,20 @@ sub post_invoice { if ($form->{amount}{ $form->{id} }{ $form->{AP} } != 0) { $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, taxkey, project_id, tax_id, chart_link) VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, - (SELECT taxkey_id - FROM taxkeys - WHERE chart_id= (SELECT id - FROM chart - WHERE accno = ?) - AND startdate <= ? + (SELECT taxkey_id + FROM taxkeys + WHERE chart_id= (SELECT id + FROM chart + WHERE accno = ?) + AND startdate <= ? ORDER BY startdate DESC LIMIT 1), ?, - (SELECT tax_id - FROM taxkeys - WHERE chart_id= (SELECT id - FROM chart - WHERE accno = ?) - AND startdate <= ? + (SELECT tax_id + FROM taxkeys + WHERE chart_id= (SELECT id + FROM chart + WHERE accno = ?) + AND startdate <= ? ORDER BY startdate DESC LIMIT 1), (SELECT link FROM chart WHERE accno = ?))|; @values = (conv_i($form->{id}), $form->{AP}, $amount, @@ -585,18 +585,18 @@ sub post_invoice { $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, gldate, source, memo, taxkey, project_id, tax_id, chart_link) VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, ?, ?, ?, - (SELECT taxkey_id - FROM taxkeys - WHERE chart_id= (SELECT id - FROM chart WHERE accno = ?) - AND startdate <= ? + (SELECT taxkey_id + FROM taxkeys + WHERE chart_id= (SELECT id + FROM chart WHERE accno = ?) + AND startdate <= ? ORDER BY startdate DESC LIMIT 1), ?, - (SELECT tax_id - FROM taxkeys - WHERE chart_id= (SELECT id - FROM chart WHERE accno = ?) - AND startdate <= ? + (SELECT tax_id + FROM taxkeys + WHERE chart_id= (SELECT id + FROM chart WHERE accno = ?) + AND startdate <= ? ORDER BY startdate DESC LIMIT 1), (SELECT link FROM chart WHERE accno = ?))|; @values = (conv_i($form->{id}), $accno, $form->{"paid_$i"}, $form->{"datepaid_$i"}, @@ -1314,7 +1314,6 @@ sub retrieve_item { my $i = 0; while (my $ptr = $stw->fetchrow_hashref("NAME_lc")) { - # if ($customertax{$ref->{accno}}) { if (($ptr->{accno} eq "") && ($ptr->{rate} == 0)) { $i++; $ptr->{accno} = $i; diff --git a/SL/IS.pm b/SL/IS.pm index 052dcfd3f..1deeb2a47 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -863,19 +863,19 @@ sub post_invoice { $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 tax_id - FROM taxkeys - WHERE chart_id= (SELECT id - FROM chart - WHERE accno = ?) - AND startdate <= ? + (SELECT tax_id + FROM taxkeys + WHERE chart_id= (SELECT id + FROM chart + WHERE accno = ?) + AND startdate <= ? ORDER BY startdate DESC LIMIT 1), (SELECT taxkey_id - FROM taxkeys - WHERE chart_id= (SELECT id - FROM chart - WHERE accno = ?) - AND startdate <= ? + FROM taxkeys + WHERE chart_id= (SELECT id + FROM chart + WHERE accno = ?) + AND startdate <= ? ORDER BY startdate DESC LIMIT 1), ?, (SELECT link FROM chart WHERE accno = ?))|; @@ -892,19 +892,19 @@ sub post_invoice { $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 tax_id - FROM taxkeys - WHERE chart_id= (SELECT id - FROM chart - WHERE accno = ?) - AND startdate <= ? + (SELECT tax_id + FROM taxkeys + WHERE chart_id= (SELECT id + FROM chart + WHERE accno = ?) + AND startdate <= ? ORDER BY startdate DESC LIMIT 1), - (SELECT taxkey_id - FROM taxkeys - WHERE chart_id= (SELECT id - FROM chart - WHERE accno = ?) - AND startdate <= ? + (SELECT taxkey_id + FROM taxkeys + WHERE chart_id= (SELECT id + FROM chart + WHERE accno = ?) + AND startdate <= ? ORDER BY startdate DESC LIMIT 1), ?, (SELECT link FROM chart WHERE accno = ?))|; @@ -956,19 +956,19 @@ sub post_invoice { $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 tax_id - FROM taxkeys - WHERE chart_id= (SELECT id - FROM chart - WHERE accno = ?) - AND startdate <= ? + (SELECT tax_id + FROM taxkeys + WHERE chart_id= (SELECT id + FROM chart + WHERE accno = ?) + AND startdate <= ? ORDER BY startdate DESC LIMIT 1), - (SELECT taxkey_id - FROM taxkeys - WHERE chart_id= (SELECT id - FROM chart - WHERE accno = ?) - AND startdate <= ? + (SELECT taxkey_id + FROM taxkeys + WHERE chart_id= (SELECT id + FROM chart + WHERE accno = ?) + AND startdate <= ? ORDER BY startdate DESC LIMIT 1), ?, (SELECT link FROM chart WHERE accno = ?))|; @@ -983,19 +983,19 @@ sub post_invoice { $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, gldate, source, memo, tax_id, taxkey, project_id, chart_link) VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, ?, ?, ?, - (SELECT tax_id - FROM taxkeys - WHERE chart_id= (SELECT id - FROM chart - WHERE accno = ?) - AND startdate <= ? + (SELECT tax_id + FROM taxkeys + WHERE chart_id= (SELECT id + FROM chart + WHERE accno = ?) + AND startdate <= ? ORDER BY startdate DESC LIMIT 1), - (SELECT taxkey_id - FROM taxkeys - WHERE chart_id= (SELECT id - FROM chart - WHERE accno = ?) - AND startdate <= ? + (SELECT taxkey_id + FROM taxkeys + WHERE chart_id= (SELECT id + FROM chart + WHERE accno = ?) + AND startdate <= ? ORDER BY startdate DESC LIMIT 1), ?, (SELECT link FROM chart WHERE accno = ?))|; @@ -1042,19 +1042,19 @@ sub post_invoice { $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, cleared, fx_transaction, tax_id, taxkey, project_id, chart_link) VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, '0', '1', - (SELECT tax_id - FROM taxkeys - WHERE chart_id= (SELECT id - FROM chart - WHERE accno = ?) - AND startdate <= ? + (SELECT tax_id + FROM taxkeys + WHERE chart_id= (SELECT id + FROM chart + WHERE accno = ?) + AND startdate <= ? ORDER BY startdate DESC LIMIT 1), - (SELECT taxkey_id - FROM taxkeys - WHERE chart_id= (SELECT id - FROM chart - WHERE accno = ?) - AND startdate <= ? + (SELECT taxkey_id + FROM taxkeys + WHERE chart_id= (SELECT id + FROM chart + WHERE accno = ?) + AND startdate <= ? ORDER BY startdate DESC LIMIT 1), ?, (SELECT link FROM chart WHERE accno = ?))|; @@ -2034,7 +2034,6 @@ sub retrieve_item { my $i = 0; while (my $ptr = $stw->fetchrow_hashref('NAME_lc')) { - # if ($customertax{$ref->{accno}}) if (($ptr->{accno} eq "") && ($ptr->{rate} == 0)) { $i++; $ptr->{accno} = $i; diff --git a/SL/RP.pm b/SL/RP.pm index 4bb82f2b2..c4a2eb515 100644 --- a/SL/RP.pm +++ b/SL/RP.pm @@ -522,8 +522,8 @@ sub get_accounts_g { FROM acc_trans acc INNER JOIN chart c ON (acc.chart_id = c.id AND c.link LIKE '%AR_paid%') WHERE 1=1 $inwhere AND acc.trans_id = ac.trans_id) - / (SELECT amount FROM ar WHERE id = ac.trans_id) - ELSE 0 + / (SELECT amount FROM ar WHERE id = ac.trans_id) + ELSE 0 /* ar amount is zero, or we are checking with a non-ar-transaction, so we return 0 in both cases as multiplicator of ac.amount */ END ) AS amount, c.$category @@ -1392,9 +1392,7 @@ sub tax_report { my $sortorder = join ', ', $form->sort_columns(qw(transdate invnumber name)); $sortorder = $form->{sort} if ($form->{sort} && grep({ $_ eq $form->{sort} } qw(id transdate invnumber name netamount tax))); - my $query = ''; - if ($form->{report} !~ /nontaxable/) { - $query = + my $query = qq|SELECT a.id, '0' AS invoice, $transdate AS transdate, a.invnumber, n.name, a.netamount, ac.amount * $ml AS tax FROM acc_trans ac @@ -1416,42 +1414,11 @@ sub tax_report { JOIN $table n ON (n.id = a.${table}_id) JOIN ${table}tax t ON (t.${table}_id = n.id) JOIN invoice i ON (i.trans_id = a.id) - JOIN partstax p ON (p.parts_id = i.parts_id) WHERE $where $accno AND (a.invoice = '1') ORDER BY $sortorder|; - } else { - # only gather up non-taxable transactions - $query = - qq|SELECT a.id, '0' AS invoice, $transdate AS transdate, a.invnumber, n.name, a.netamount - FROM acc_trans ac - JOIN ${arap} a ON (a.id = ac.trans_id) - JOIN $table n ON (n.id = a.${table}_id) - WHERE - $where - AND (a.invoice = '0') - AND (a.netamount = a.amount) - - UNION - - SELECT a.id, '1' AS invoice, $transdate AS transdate, a.invnumber, n.name, i.sellprice * i.qty AS netamount - FROM acc_trans ac - JOIN ${arap} a ON (a.id = ac.trans_id) - JOIN $table n ON (n.id = a.${table}_id) - JOIN invoice i ON (i.trans_id = a.id) - WHERE - $where - AND (a.invoice = '1') - AND ( - a.${table}_id NOT IN (SELECT ${table}_id FROM ${table}tax t (${table}_id)) - OR - i.parts_id NOT IN (SELECT parts_id FROM partstax p (parts_id)) - ) - GROUP BY a.id, a.invnumber, $transdate, n.name, i.sellprice, i.qty - ORDER by $sortorder|; - } $form->{TR} = selectall_hashref_query($form, $dbh, $query); diff --git a/bin/mozilla/rp.pl b/bin/mozilla/rp.pl index 9f6d848fd..c3a13dac3 100644 --- a/bin/mozilla/rp.pl +++ b/bin/mozilla/rp.pl @@ -94,8 +94,6 @@ use strict; # $locale->text('Receipts') # $locale->text('Payments') # $locale->text('Project Transactions') -# $locale->text('Non-taxable Sales') -# $locale->text('Non-taxable Purchases') # $locale->text('Business evaluation') # $form->parse_html_template('rp/html_report_susa') @@ -134,8 +132,6 @@ sub report { ap_aging => $::locale->text('Search AP Aging'), tax_collected => $::locale->text('Tax collected'), tax_paid => $::locale->text('Tax paid'), - nontaxable_sales => $::locale->text('Non-taxable Sales'), - nontaxable_purchases => $::locale->text('Non-taxable Purchases'), receipts => $::locale->text('Receipts'), payments => $::locale->text('Payments'), projects => $::locale->text('Project Transactions'), diff --git a/locale/de/all b/locale/de/all index 6b05e8327..f606fad29 100644 --- a/locale/de/all +++ b/locale/de/all @@ -1285,8 +1285,6 @@ $self->{texts} = { 'No vendor has been selected yet.' => 'Es wurde noch kein Lieferant ausgewählt.', 'No warehouse has been created yet or the quantity of the bins is not configured yet.' => 'Es wurde noch kein Lager angelegt, bzw. die dazugehörigen Lagerplätze sind noch nicht konfiguriert.', 'No.' => 'Position', - 'Non-taxable Purchases' => 'Nicht zu versteuernde Einkäufe', - 'Non-taxable Sales' => 'Nicht zu versteuernde Verkäufe', 'None' => 'Kein', 'Not Discountable' => 'Nicht rabattierfähig', 'Not delivered' => 'Nicht geliefert', diff --git a/sql/Pg-upgrade2/delete_customertax_vendortax_partstax.sql b/sql/Pg-upgrade2/delete_customertax_vendortax_partstax.sql new file mode 100644 index 000000000..0d48468b5 --- /dev/null +++ b/sql/Pg-upgrade2/delete_customertax_vendortax_partstax.sql @@ -0,0 +1,7 @@ +-- @tag: delete_customertax_vendortax_partstax +-- @description: Alte Tabellen löschen +-- @depends: release_3_0_0 +-- @charset: utf-8 +DROP TABLE customertax; +DROP TABLE vendortax; +DROP TABLE partstax; diff --git a/templates/webpages/rp/report.html b/templates/webpages/rp/report.html index afffd5c0c..649140a33 100644 --- a/templates/webpages/rp/report.html +++ b/templates/webpages/rp/report.html @@ -308,52 +308,6 @@ [%- END %] - -[%- IF 0 # is_nontaxable %] - - - - - - - - [% 'From' | $T8 %] - [% L.date_tag('fromdate', fromdate) %] - [% 'Bis' | $T8 %] - [% L.date_tag('todate', todate) %] - -[%- PROCESS cash_or_accrual %] - - [% 'Include in Report' | $T8 %] - - - - - - - - - - - - - - - - - - - - - - -
[% 'ID' | $T8 %][% 'Invoice' | $T8 %][% 'Date' | $T8 %]
- [% LxERP.t8('Customer') IF db == 'ar' %] - [% LxERP.t8('Vendor') IF db == 'ap' %] - [% 'Amount' | $T8 %][% 'Total' | $T8 %]
[% 'Subtotal' | $T8 %]
- - -[%- END %]
-- 2.20.1