From 3b3ef5ba0b9d0d6fb45e082cbfafa524243ae6f7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Tue, 25 Aug 2009 11:12:27 +0200 Subject: [PATCH] Anzeige von Kundendaten in der Verkaufsrechnungssuche. --- SL/AR.pm | 14 +++++++---- bin/mozilla/ar.pl | 61 ++++++++++++++++++++++++++++++++--------------- locale/de/ar | 4 ++++ 3 files changed, 55 insertions(+), 24 deletions(-) diff --git a/SL/AR.pm b/SL/AR.pm index 7ee12fad2..7357ae9d6 100644 --- a/SL/AR.pm +++ b/SL/AR.pm @@ -419,14 +419,18 @@ sub ar_transactions { qq| a.marge_total, a.marge_percent, | . qq| a.transaction_description, | . qq| pr.projectnumber AS globalprojectnumber, | . - qq| c.name, | . + qq| c.name, c.customernumber, c.country, c.ustid, | . qq| e.name AS employee, | . - qq| e2.name AS salesman | . + qq| e2.name AS salesman, | . + qq| tz.description AS taxzone, | . + qq| pt.description AS payment_terms | . qq|FROM ar a | . qq|JOIN customer c ON (a.customer_id = c.id) | . qq|LEFT JOIN employee e ON (a.employee_id = e.id) | . qq|LEFT JOIN employee e2 ON (a.salesman_id = e2.id) | . - qq|LEFT JOIN project pr ON (a.globalproject_id = pr.id)|; + qq|LEFT JOIN project pr ON (a.globalproject_id = pr.id)| . + qq|LEFT JOIN tax_zones tz ON (tz.id = c.taxzone_id)| . + qq|LEFT JOIN payment_terms pt ON (pt.id = c.payment_id)|; my $where = "1 = 1"; if ($form->{customer_id}) { @@ -470,7 +474,7 @@ sub ar_transactions { } } - my @a = (transdate, invnumber, name); + my @a = qw(transdate invnumber name); push @a, "employee" if $form->{l_employee}; my $sortdir = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC'; my $sortorder = join(', ', map { "$_ $sortdir" } @a); @@ -652,7 +656,7 @@ sub storno { # now copy acc_trans entries $query = qq|SELECT a.*, c.link FROM acc_trans a LEFT JOIN chart c ON a.chart_id = c.id WHERE a.trans_id = ? ORDER BY a.acc_trans_id|; - my $rowref = selectall_hashref_query($form, $dbh, $query, $id); + my $rowref = selectall_hashref_query($form, $dbh, $query, $id); # kill all entries containing payments, which are the last 2n rows, of which the last has link =~ /paid/ while ($rowref->[-1]{link} =~ /paid/) { diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index 528d2c4ed..d5ec4edb8 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -96,8 +96,8 @@ sub add { $form->{addition} = "ADDED"; $form->save_history($form->dbconnect(\%myconfig)); } - # /saving the history - + # /saving the history + $form->{title} = "Add"; $form->{callback} = "ar.pl?action=add" unless $form->{callback}; @@ -318,8 +318,8 @@ sub form_header { my $n = ($form->{creditremaining} =~ /-/) ? "0" : "1"; - $customer = ($form->{selectcustomer}) - ? qq|| + $customer = ($form->{selectcustomer}) + ? qq|| : qq||; $employee = qq| @@ -685,8 +685,8 @@ $jsscript $column_data{exchangerate} = "" . $locale->text('Exch') . ""; $column_data{AR_paid} = "" . $locale->text('Account') . ""; $column_data{source} = "" . $locale->text('Source') . ""; - $column_data{memo} = "" . $locale->text('Memo') . ""; - $column_data{paid_project_id} = "" . $locale->text('Project Number') . ""; + $column_data{memo} = "" . $locale->text('Memo') . ""; + $column_data{paid_project_id} = "" . $locale->text('Project Number') . ""; print " @@ -883,9 +883,9 @@ $follow_ups_block print qq| {id}); name=history id=history value=| . $locale->text('history') . qq|> |; } # /button for saving history - # mark_as_paid button - if($form->{id} ne "") { - print qq||; } # /mark_as_paid button @@ -905,7 +905,7 @@ sub mark_as_paid { $auth->assert('general_ledger'); - &mark_as_paid_common(\%myconfig,"ar"); + &mark_as_paid_common(\%myconfig,"ar"); $lxdebug->leave_sub(); } @@ -1064,7 +1064,7 @@ sub post { my $transdate = $form->datetonum($form->{transdate}, \%myconfig); $form->error($locale->text('Cannot post transaction for a closed period!')) if ($form->date_closed($form->{"transdate"}, \%myconfig)); - $form->error($locale->text('Zero amount posting!')) + $form->error($locale->text('Zero amount posting!')) unless grep $_*1, map $form->parse_amount(\%myconfig, $form->{"amount_$_"}), 1..$form->{rowcount}; $form->isblank("exchangerate", $locale->text('Exchangerate missing!')) @@ -1108,7 +1108,7 @@ sub post { $form->{addition} = "POSTED"; $form->save_history($form->dbconnect(\%myconfig)); } - # /saving the history + # /saving the history remove_draft() if $form->{remove_draft}; $form->redirect($locale->text('Transaction posted!')) unless $inline; @@ -1128,7 +1128,7 @@ sub post_as_new { $form->{addition} = "POSTED AS NEW"; $form->save_history($form->dbconnect(\%myconfig)); } - # /saving the history + # /saving the history &post; $lxdebug->leave_sub(); @@ -1201,7 +1201,7 @@ sub yes { $form->{addition} = "DELETED"; $form->save_history($form->dbconnect(\%myconfig)); } - # /saving the history + # /saving the history $form->redirect($locale->text('Transaction deleted!')); } $form->error($locale->text('Cannot delete transaction!')); @@ -1246,9 +1246,9 @@ sub search { | if $form->{selectdepartment}; $form->{title} = $locale->text('AR Transactions'); - + $form->{javascript} .= qq||; - + # use JavaScript Calendar or not $form->{jsscript} = 1; $jsscript = ""; @@ -1412,6 +1412,24 @@ sub search { | . $locale->text('Transaction description') . qq| + + | . $locale->text('Customer') . qq| + + + + | . $locale->text('Customer Number') . qq| + + | . $locale->text('Country') . qq| + + | . $locale->text('USt-IdNr.') . qq| + + | . $locale->text('Steuersatz') . qq| + + + + | . $locale->text('Payment Terms') . qq| + + @@ -1480,7 +1498,7 @@ sub ar_transactions { @columns = qw(transdate id type invnumber ordnumber name netamount tax amount paid datepaid due duedate transaction_description notes salesman employee shippingpoint shipvia - marge_total marge_percent globalprojectnumber); + marge_total marge_percent globalprojectnumber customernumber country ustid taxzone payment_terms); my @hidden_variables = map { "l_${_}" } @columns; push @hidden_variables, "l_subtotal", qw(open closed customer invnumber ordnumber transaction_description notes project_id transdatefrom transdateto); @@ -1510,6 +1528,11 @@ sub ar_transactions { 'globalprojectnumber' => { 'text' => $locale->text('Project Number'), }, 'marge_total' => { 'text' => $locale->text('Ertrag'), }, 'marge_percent' => { 'text' => $locale->text('Ertrag prozentual'), }, + 'customernumber' => { 'text' => $locale->text('Customer Number'), }, + 'country' => { 'text' => $locale->text('Country'), }, + 'ustid' => { 'text' => $locale->text('USt-IdNr.'), }, + 'taxzone' => { 'text' => $locale->text('Steuersatz'), }, + 'payment_terms' => { 'text' => $locale->text('Payment Terms'), }, ); foreach my $name (qw(id transdate duedate invnumber ordnumber name datepaid employee shippingpoint shipvia transaction_description)) { @@ -1657,9 +1680,9 @@ sub storno { $form->{addition} = "STORNO"; $form->save_history($form->dbconnect(\%myconfig)); } - # /saving the history + # /saving the history - $form->redirect(sprintf $locale->text("Transaction %d cancelled."), $form->{storno_id}); + $form->redirect(sprintf $locale->text("Transaction %d cancelled."), $form->{storno_id}); $lxdebug->leave_sub(); } diff --git a/locale/de/ar b/locale/de/ar index d71f1845a..695989ddc 100644 --- a/locale/de/ar +++ b/locale/de/ar @@ -58,6 +58,7 @@ $self->{texts} = { 'Contact' => 'Kontakt', 'Continue' => 'Weiter', 'Could not spawn the printer command.' => 'Die Druckanwendung konnte nicht gestartet werden.', + 'Country' => 'Land', 'Create and edit RFQs' => 'Lieferantenanfragen erfassen und bearbeiten', 'Create and edit customers and vendors' => 'Kunden und Lieferanten erfassen und bearbeiten', 'Create and edit dunnings' => 'Mahnungen erfassen und bearbeiten', @@ -183,6 +184,7 @@ $self->{texts} = { 'Paid' => 'bezahlt', 'Part Number' => 'Artikelnummer', 'Part description' => 'Artikelbeschreibung', + 'Payment Terms' => 'Zahlungskonditionen', 'Payment date missing!' => 'Tag der Zahlung fehlt!', 'Payment posted!' => 'Zahlung gebucht!', 'Pick List' => 'Sammelliste', @@ -222,6 +224,7 @@ $self->{texts} = { 'Shipping Point' => 'Versandort', 'Skip' => 'Überspringen', 'Source' => 'Beleg', + 'Steuersatz' => 'Steuersatz', 'Storno' => 'Storno', 'Storno (one letter abbreviation)' => 'S', 'Storno Invoice' => 'Stornorechnung', @@ -251,6 +254,7 @@ $self->{texts} = { 'Transactions, AR transactions, AP transactions' => 'Dialogbuchen, Debitorenrechnungen, Kreditorenrechnungen', 'Trying to call a sub without a name' => 'Es wurde versucht, eine Unterfunktion ohne Namen aufzurufen.', 'Type' => 'Typ', + 'USt-IdNr.' => 'USt-IdNr.', 'Unit' => 'Einheit', 'Unknown dependency \'%s\'.' => 'Unbekannte Abhängigkeit \'%s\'.', 'Update' => 'Erneuern', -- 2.20.1