Merge branch 'master' of vc.linet-services.de:public/lx-office-erp
[kivitendo-erp.git] / SL / RP.pm
index 113e9dd..f98d475 100644 (file)
--- a/SL/RP.pm
+++ b/SL/RP.pm
@@ -1219,7 +1219,7 @@ sub aging {
       phone as customerphone, fax as customerfax, ${ct}number,
       "invnumber", "transdate",
       (amount - COALESCE((SELECT sum(amount)*$ml FROM acc_trans LEFT JOIN chart ON (acc_trans.chart_id=chart.id) WHERE link ilike '%paid%' AND acc_trans.trans_id=${arap}.id AND acc_trans.transdate <= (date $todate)),0)) as "open", "amount",
-      "duedate", invoice, ${arap}.id,
+      "duedate", invoice, ${arap}.id, date_part('days', now() - duedate) as overduedays,
       (SELECT $buysell
        FROM exchangerate
        WHERE (${arap}.curr = exchangerate.curr)
@@ -1293,27 +1293,6 @@ sub get_customer {
   $main::lxdebug->leave_sub();
 }
 
-sub get_taxaccounts {
-  $main::lxdebug->enter_sub();
-
-  my ($self, $myconfig, $form) = @_;
-
-  # connect to database
-  my $dbh = $form->dbconnect($myconfig);
-
-  # get tax accounts
-  my $query =
-    qq|SELECT c.accno, c.description, t.rate
-       FROM chart c, tax t
-       WHERE (c.link LIKE '%CT_tax%') AND (c.id = t.chart_id)
-       ORDER BY c.accno|;
-  $form->{taxaccounts} = selectall_hashref_quert($form, $dbh, $query);
-
-  $dbh->disconnect;
-
-  $main::lxdebug->leave_sub();
-}
-
 sub tax_report {
   $main::lxdebug->enter_sub();