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}) {
}
}
- 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);
# 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/) {
$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};
my $n = ($form->{creditremaining} =~ /-/) ? "0" : "1";
- $customer = ($form->{selectcustomer})
- ? qq|<select name="customer" onchange="document.getElementById('update_button').click();">$form->{selectcustomer}</select>|
+ $customer = ($form->{selectcustomer})
+ ? qq|<select name="customer" onchange="document.getElementById('update_button').click();">$form->{selectcustomer}</select>|
: qq|<input name=customer value="$form->{customer}" size=35>|;
$employee = qq|
$column_data{exchangerate} = "<th>" . $locale->text('Exch') . "</th>";
$column_data{AR_paid} = "<th>" . $locale->text('Account') . "</th>";
$column_data{source} = "<th>" . $locale->text('Source') . "</th>";
- $column_data{memo} = "<th>" . $locale->text('Memo') . "</th>";
- $column_data{paid_project_id} = "<th>" . $locale->text('Project Number') . "</th>";
+ $column_data{memo} = "<th>" . $locale->text('Memo') . "</th>";
+ $column_data{paid_project_id} = "<th>" . $locale->text('Project Number') . "</th>";
print "
<tr>
print qq| <input type=button class=submit onclick=set_history_window($form->{id}); name=history id=history value=| . $locale->text('history') . qq|> |;
}
# /button for saving history
- # mark_as_paid button
- if($form->{id} ne "") {
- print qq|<input type="submit" class="submit" name="action" value="|
+ # mark_as_paid button
+ if($form->{id} ne "") {
+ print qq|<input type="submit" class="submit" name="action" value="|
. $locale->text('mark as paid') . qq|">|;
}
# /mark_as_paid button
$auth->assert('general_ledger');
- &mark_as_paid_common(\%myconfig,"ar");
+ &mark_as_paid_common(\%myconfig,"ar");
$lxdebug->leave_sub();
}
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!'))
$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;
$form->{addition} = "POSTED AS NEW";
$form->save_history($form->dbconnect(\%myconfig));
}
- # /saving the history
+ # /saving the history
&post;
$lxdebug->leave_sub();
$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!'));
| if $form->{selectdepartment};
$form->{title} = $locale->text('AR Transactions');
-
+
$form->{javascript} .= qq|<script type="text/javascript" src="js/common.js"></script>|;
-
+
# use JavaScript Calendar or not
$form->{jsscript} = 1;
$jsscript = "";
<td align=right><input name="l_transaction_description" class=checkbox type=checkbox value=Y></td>
<td nowrap>| . $locale->text('Transaction description') . qq|</td>
</tr>
+ <tr>
+ <td colspan=4 align=left><b>| . $locale->text('Customer') . qq| </td>
+ </tr>
+ <tr>
+ <td align=right><input name="l_customernumber" class=checkbox type=checkbox value=Y></td>
+ <td nowrap>| . $locale->text('Customer Number') . qq|</td>
+ <td align=right><input name="l_country" class=checkbox type=checkbox value=Y></td>
+ <td nowrap>| . $locale->text('Country') . qq|</td>
+ <td align=right><input name="l_ustid" class=checkbox type=checkbox value=Y></td>
+ <td nowrap>| . $locale->text('USt-IdNr.') . qq|</td>
+ <td align=right><input name="l_taxzone" class=checkbox type=checkbox value=Y></td>
+ <td nowrap>| . $locale->text('Steuersatz') . qq|</td>
+ </tr>
+ <tr>
+ <td align=right><input name="l_payment" class=checkbox type=checkbox value=Y></td>
+ <td nowrap>| . $locale->text('Payment Terms') . qq|</td>
+ </tr>
+
</table>
</td>
</tr>
@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);
'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)) {
$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();
}
'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',
'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',
'Shipping Point' => 'Versandort',
'Skip' => 'Überspringen',
'Source' => 'Beleg',
+ 'Steuersatz' => 'Steuersatz',
'Storno' => 'Storno',
'Storno (one letter abbreviation)' => 'S',
'Storno Invoice' => 'Stornorechnung',
'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',