$form->{salesman_id} = $form->{old_salesman_id} if $form->{old_salesman_id};
$form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
- $form->{radier} = ($form->current_date(\%myconfig) eq $form->{gldate}) ? 1 : 0;
my $set_duedate_url = "$form->{script}?action=set_duedate";
my $form = $main::form;
my %myconfig = %main::myconfig;
my $locale = $main::locale;
- my $cgi = $main::cgi;
-
- $main::auth->assert('vendor_invoice_edit');
- $form->{invtotal} = $form->{invsubtotal};
-
- my ($rows, $introws);
- if (($rows = $form->numtextrows($form->{notes}, 25, 8)) < 2) {
- $rows = 2;
- }
- if (($introws = $form->numtextrows($form->{intnotes}, 35, 8)) < 2) {
- $introws = 2;
- }
- $rows = ($rows > $introws) ? $rows : $introws;
- my $notes =
- qq|<textarea name=notes rows=$rows cols=25 wrap=soft>$form->{notes}</textarea>|;
- my $intnotes =
- qq|<textarea name=intnotes rows=$rows cols=35 wrap=soft>$form->{intnotes}</textarea>|;
-
- $form->{taxincluded} = ($form->{taxincluded}) ? "checked" : "";
-
- my $taxincluded = "";
- if ($form->{taxaccounts}) {
- $taxincluded = qq|
- <input name=taxincluded class=checkbox type=checkbox value=1 $form->{taxincluded}> <b>|
- . $locale->text('Tax Included') . qq|</b>
-|;
- }
-
- my ($tax, $subtotal);
- if (!$form->{taxincluded}) {
-
- foreach my $item (split / /, $form->{taxaccounts}) {
- if ($form->{"${item}_base"}) {
- $form->{invtotal} += $form->{"${item}_total"} =
- $form->round_amount(
- $form->{"${item}_base"} * $form->{"${item}_rate"},
- 2);
- $form->{"${item}_total"} =
- $form->format_amount(\%myconfig, $form->{"${item}_total"}, 2);
-
- $tax .= qq|
- <tr>
- <th align=right>$form->{"${item}_description"} |
- . $form->{"${item}_rate"} * 100 .qq|%</th>
- <td align=right>$form->{"${item}_total"}</td>
- </tr>
-|;
- }
- }
+ $main::auth->assert('invoice_edit');
- $form->{invsubtotal} =
- $form->format_amount(\%myconfig, $form->{invsubtotal}, 2, 0);
+ $form->{invtotal} = $form->{invsubtotal};
+ $form->{oldinvtotal} = $form->{invtotal};
- $subtotal = qq|
- <tr>
- <th align=right>| . $locale->text('Subtotal') . qq|</th>
- <td align=right>$form->{invsubtotal}</td>
- </tr>
-|;
+ # note rows
+ $form->{rows} = max 2,
+ $form->numtextrows($form->{notes}, 26, 8),
+ $form->numtextrows($form->{intnotes}, 35, 8);
- }
- if ($form->{taxincluded}) {
- foreach my $item (split / /, $form->{taxaccounts}) {
- if ($form->{"${item}_base"}) {
- $form->{"${item}_total"} =
- $form->round_amount(
- ($form->{"${item}_base"} * $form->{"${item}_rate"} /
- (1 + $form->{"${item}_rate"})
- ),
- 2);
- $form->{"${item}_base"} =
- $form->round_amount($form->{"${item}_base"}, 2);
- $form->{"${item}_netto"} =
- $form->round_amount(
- ($form->{"${item}_base"} - $form->{"${item}_total"}),
- 2);
- $form->{"${item}_netto"} =
- $form->format_amount(\%myconfig, $form->{"${item}_netto"}, 2);
- $form->{"${item}_total"} =
- $form->format_amount(\%myconfig, $form->{"${item}_total"}, 2);
-
- $tax .= qq|
- <tr>
- <th align=right>Enthaltene $form->{"${item}_description"} |
- . $form->{"${item}_rate"} * 100 .qq|%</th>
- <td align=right>$form->{"${item}_total"}</td>
- </tr>
- <tr>
- <th align=right>Nettobetrag</th>
- <td align=right>$form->{"${item}_netto"}</td>
- </tr>
-|;
+ # tax, total and subtotal calculations
+ my ($tax, $subtotal);
+ $form->{taxaccounts_array} = [ split / /, $form->{taxaccounts} ];
+
+ foreach my $item (@{ $form->{taxaccounts_array} }) {
+ if ($form->{"${item}_base"}) {
+ if ($form->{taxincluded}) {
+ $form->{"${item}_total"} = $form->round_amount( ($form->{"${item}_base"} * $form->{"${item}_rate"}
+ / (1 + $form->{"${item}_rate"})), 2);
+ $form->{"${item}_netto"} = $form->round_amount( ($form->{"${item}_base"} - $form->{"${item}_total"}), 2);
+ } else {
+ $form->{"${item}_total"} = $form->round_amount( $form->{"${item}_base"} * $form->{"${item}_rate"}, 2);
+ $form->{invtotal} += $form->{"${item}_total"};
}
}
-
}
- $form->{oldinvtotal} = $form->{invtotal};
- $form->{invtotal} =
- $form->format_amount(\%myconfig, $form->{invtotal}, 2, 0);
-
- my $follow_ups_block;
+ # follow ups
if ($form->{id}) {
- my $follow_ups = FU->follow_ups('trans_id' => $form->{id});
-
- if (@{ $follow_ups} ) {
- my $num_due = sum map { $_->{due} * 1 } @{ $follow_ups };
- $follow_ups_block = qq|
- <tr>
- <td colspan="2">| . $locale->text("There are #1 unfinished follow-ups of which #2 are due.", scalar @{ $follow_ups }, $num_due) . qq|</td>
- </tr>
-|;
- }
- }
-
- our $colspan;
- print qq|
- <tr>
- <td colspan=$colspan>
- <table cellspacing="0">
- <tr valign=bottom>
- <td>
- <table>
- <tr>
- <th align=left>| . $locale->text('Notes') . qq|</th>
- <th align=left>| . $locale->text('Internal Notes') . qq|</th>
- </tr>
- <tr valign=top>
- <td>$notes</td>
- <td>$intnotes</td>
- </tr>
- $follow_ups_block
- </table>
- </td>
- <td colspan=2 align=right width=100%>
- $taxincluded
- <br>
- <table width=100%>
- $subtotal
- $tax
- <tr>
- <th align=right>| . $locale->text('Total') . qq|</th>
- <td align=right>$form->{invtotal}</td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
-|;
- my $webdav_list;
- if ($main::webdav) {
- $webdav_list = qq|
- <tr>
- <td><hr size=3 noshade></td>
- </tr>
- <tr>
- <th class=listtop align=left>Dokumente im Webdav-Repository</th>
- </tr>
- <table width=100%>
- <td align=left width=30%><b>Dateiname</b></td>
- <td align=left width=70%><b>Webdavlink</b></td>
-|;
- foreach my $file (@{ $form->{WEBDAV} }) {
- $webdav_list .= qq|
- <tr>
- <td align="left">$file->{name}</td>
- <td align="left"><a href="$file->{link}">$file->{type}</a></td>
- </tr>
-|;
- }
- $webdav_list .= qq|
- </table>
- </tr>
-|;
-
- print $webdav_list;
- }
- print qq|
- <tr>
- <td colspan=$colspan>
- <table width=100%>
- <tr>
- <th colspan=6 class=listheading>| . $locale->text('Payments') . qq|</th>
- </tr>
-|;
-
- my @column_index;
- if ($form->{currency} eq $form->{defaultcurrency}) {
- @column_index = qw(datepaid source memo paid AP_paid);
- } else {
- @column_index = qw(datepaid source memo paid exchangerate AP_paid);
+ $form->{follow_ups} = FU->follow_ups('trans_id' => $form->{id}) || [];
+ $form->{follow_ups_unfinished} = ( sum map { $_->{due} * 1 } @{ $form->{follow_ups} } ) || 0;
}
- my %column_data;
- $column_data{datepaid} = "<th>" . $locale->text('Date') . "</th>";
- $column_data{paid} = "<th>" . $locale->text('Amount') . "</th>";
- $column_data{exchangerate} = "<th>" . $locale->text('Exch') . "</th>";
- $column_data{AP_paid} = "<th>" . $locale->text('Account') . "</th>";
- $column_data{source} = "<th>" . $locale->text('Source') . "</th>";
- $column_data{memo} = "<th>" . $locale->text('Memo') . "</th>";
-
- print qq|
- <tr>
-|;
- map { print "$column_data{$_}\n" } @column_index;
- print qq|
- </tr>
-|;
-
- my @triggers = ();
+ # payments
my $totalpaid = 0;
-
$form->{paidaccounts}++ if ($form->{"paid_$form->{paidaccounts}"});
- for my $i (1 .. $form->{paidaccounts}) {
-
- print qq|
- <tr>
-|;
+ $form->{paid_indices} = [ 1 .. $form->{paidaccounts} ];
+ for my $i (1 .. $form->{paidaccounts}) {
$form->{"selectAP_paid_$i"} = $form->{selectAP_paid};
- $form->{"selectAP_paid_$i"} =~
- s/option>\Q$form->{"AP_paid_$i"}\E/option selected>$form->{"AP_paid_$i"}/;
-
+ $form->{"selectAP_paid_$i"} =~ s/option>\Q$form->{"AP_paid_$i"}\E/option selected>$form->{"AP_paid_$i"}/;
$totalpaid += $form->{"paid_$i"};
-
- # format amounts
- if ($form->{"paid_$i"}) {
- $form->{"paid_$i"} =
- $form->format_amount(\%myconfig, $form->{"paid_$i"}, 2);
- }
- $form->{"exchangerate_$i"} =
- $form->format_amount(\%myconfig, $form->{"exchangerate_$i"});
-
- my $exchangerate = qq| |;
- if ($form->{currency} ne $form->{defaultcurrency}) {
- if ($form->{"forex_$i"}) {
- $exchangerate =
- qq|<input type=hidden name="exchangerate_$i" value=$form->{"exchangerate_$i"}>$form->{"exchangerate_$i"}|;
- } else {
- $exchangerate =
- qq|<input name="exchangerate_$i" size=10 value=$form->{"exchangerate_$i"}>|;
- }
- }
- $exchangerate .= qq|
-<input type=hidden name="forex_$i" value=$form->{"forex_$i"}>
-|;
-
- $column_data{"paid_$i"} =
- qq|<td align=center><input name="paid_$i" size=11 value="$form->{"paid_$i"}" onBlur=\"check_right_number_format(this)\"></td>|;
- $column_data{"exchangerate_$i"} = qq|<td align=center>$exchangerate</td>|;
- $column_data{"AP_paid_$i"} =
- qq|<td align=center><select name="AP_paid_$i">$form->{"selectAP_paid_$i"}</select></td>|;
- $column_data{"datepaid_$i"} =
- qq|<td align=center><input name="datepaid_$i" id="datepaid_$i" size=11 title="$myconfig{dateformat}" value="$form->{"datepaid_$i"}" onBlur=\"check_right_date_format(this)\">
- <input type="button" name="datepaid_$i" id="trigger_datepaid_$i" value="?"></td>|;
- $column_data{"source_$i"} =
- qq|<td align=center><input name="source_$i" size=11 value="$form->{"source_$i"}"></td>|;
- $column_data{"memo_$i"} =
- qq|<td align=center><input name="memo_$i" size=11 value="$form->{"memo_$i"}"></td>|;
-
- map { print qq|$column_data{"${_}_$i"}\n| } @column_index;
-
- print qq|
- </tr>
-|;
- push(@triggers, "datepaid_$i", "BL", "trigger_datepaid_$i");
- }
-
- my $paid_missing = $form->{oldinvtotal} - $totalpaid;
-
- print qq|
- <tr>
- <td></td>
- <td></td>
- <td align="center">| . $locale->text('Total') . qq|</td>
- <td align="center">| . H($form->format_amount(\%myconfig, $totalpaid, 2)) . qq|</td>
- </tr>
- <tr>
- <td></td>
- <td></td>
- <td align="center">| . $locale->text('Missing amount') . qq|</td>
- <td align="center">| . H($form->format_amount(\%myconfig, $paid_missing, 2)) . qq|</td>
- </tr>
-
- <input type=hidden name=oldinvtotal value=$form->{oldinvtotal}>
- <input type=hidden name=paidaccounts value=$form->{paidaccounts}>
- <input type=hidden name=selectAP_paid value="$form->{selectAP_paid}">
- </table>
- </td>
- </tr>
- <tr>
- <td><hr size=3 noshade></td>
- </tr>
-</table>
-<br>
-|;
-
- my $invdate = $form->datetonum($form->{invdate}, \%myconfig);
- my $closedto = $form->datetonum($form->{closedto}, \%myconfig);
-
- print qq|<input class=submit type=submit name=action id=update_button value="|
- . $locale->text('Update') . qq|">
-|;
-
- if ($form->{id}) {
- my $show_storno = !$form->{storno} && !IS->has_storno(\%myconfig, $form, "ap") && (($totalpaid == 0) || ($totalpaid eq ""));
-
- print qq|<input class=submit type=submit name=action value="|
- . $locale->text('Post Payment') . qq|">
-|;
- print qq|<input class=submit type=submit name=action value="|
- . $locale->text('Storno') . qq|">
-| if ($show_storno);
- if ($form->{radier}) {
- print qq|
- <input class=submit type=submit name=action value="|
- . $locale->text('Delete') . qq|">
-|;
- }
- print qq|<input class=submit type=submit name=action value="|
- . $locale->text('Use As Template') . qq|">
- <input type="button" class="submit" onclick="follow_up_window()" value="|
- . $locale->text('Follow-Up')
- . qq|">
-|;
-
}
- if (!$form->{id} && ($invdate > $closedto)) {
- print qq| <input class=submit type=submit name=action value="|
- . $locale->text('Post') . qq|"> | .
- NTI($cgi->submit('-name' => 'action', '-value' => $locale->text('Save draft'),
- '-class' => 'submit'));
- }
-
- print $form->write_trigger(\%myconfig, scalar(@triggers) / 3, @triggers);
- $form->hide_form(qw(rowcount callback draft_id draft_description vendor_discount));
-
- # button for saving history
- if($form->{id} ne "") {
- print qq|
- <input type="button" class="submit" onclick="set_history_window(|
- . Q($form->{id})
- . qq|);" 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="|
- . $locale->text('mark as paid') . qq|">|;
- }
- # /mark_as_paid button
-print qq|</form>
-</body>
-</html>
-|;
+ print $form->parse_html_template('ir/form_footer', {
+ is_type_credit_note => ($form->{type} eq "credit_note"),
+ totalpaid => $totalpaid,
+ paid_missing => $form->{invtotal} - $totalpaid,
+ show_storno => $form->{id} && !$form->{storno} && !IS->has_storno(\%myconfig, $form, "ap") && !$totalpaid,
+ show_delete => ($form->current_date(\%myconfig) eq $form->{gldate}),
+ });
+##print $form->parse_html_template('ir/_payments'); # parser
+##print $form->parse_html_template('webdav/_list'); # parser
$main::lxdebug->leave_sub();
}
'AP Transaction' => 'Kreditorenbuchung',
'AR' => 'Verkauf',
'AR Transaction' => 'Debitorenbuchung',
- 'Account' => 'Konto',
'Add Purchase Order' => 'Lieferantenauftrag erfassen',
'Add Quotation' => 'Angebot erfassen',
'Add Request for Quotation' => 'Anfrage erfassen',
'Address' => 'Adresse',
'Advance turnover tax return' => 'Umsatzsteuervoranmeldung',
'All reports' => 'Alle Berichte (Kontenübersicht, Summen- u. Saldenliste, GuV, BWA, Bilanz, Projektbuchungen)',
- 'Amount' => 'Betrag',
'Apr' => 'Apr',
'April' => 'April',
'Are you sure you want to delete Invoice Number' => 'Soll die Rechnung mit folgender Nummer wirklich gelöscht werden:',
'Date' => 'Datum',
'Dec' => 'Dez',
'December' => 'Dezember',
- 'Delete' => 'Löschen',
'Delete drafts' => 'Entwürfe löschen',
'Delivered' => 'Geliefert',
'Delivery Date' => 'Lieferdatum',
'Enter longdescription' => 'Langtext eingeben',
'Error in database control file \'%s\': %s' => 'Fehler in Datenbankupgradekontrolldatei \'%s\': %s',
'Ertrag' => 'Ertrag',
- 'Exch' => 'Wechselkurs.',
'Exchangerate for payment missing!' => 'Es fehlt der Wechselkurs für die Bezahlung!',
'Exchangerate missing!' => 'Es fehlt der Wechselkurs!',
'Extended' => 'Gesamt',
'Feb' => 'Feb',
'February' => 'Februar',
'File' => 'Datei',
- 'Follow-Up' => 'Wiedervorlage',
'GL Transaction' => 'Dialogbuchung',
'General ledger and cash' => 'Finanzbuchhaltung und Zahlungsverkehr',
'Group' => 'Warengruppe',
'History' => 'Historie',
'In-line' => 'im Text',
- 'Internal Notes' => 'interne Bemerkungen',
'Invnumber missing!' => 'Rechnungsnummer fehlt!',
'Invoice' => 'Rechnung',
'Invoice Date missing!' => 'Rechnungsdatum fehlt!',
'May' => 'Mai',
'May ' => 'Mai',
'May set the BCC field when sending emails' => 'Beim Verschicken von Emails das Feld \'BCC\' setzen',
- 'Memo' => 'Memo',
'Message' => 'Nachricht',
'Missing \'description\' field.' => 'Fehlendes Feld \'description\'.',
'Missing \'tag\' field.' => 'Fehlendes Feld \'tag\'.',
- 'Missing amount' => 'Fehlbetrag',
'Missing parameter #1 in call to sub #2.' => 'Fehlernder Parameter \'#1\' in Funktionsaufruf \'#2\'.',
'Missing parameter (at least one of #1) in call to sub #2.' => 'Fehlernder Parameter (mindestens einer aus \'#1\') in Funktionsaufruf \'#2\'.',
'More than one control file with the tag \'%s\' exist.' => 'Es gibt mehr als eine Kontrolldatei mit dem Tag \'%s\'.',
'No part was found matching the search parameters.' => 'Es wurde kein Artikel gefunden, auf den die Suchparameter zutreffen.',
'No vendor has been selected yet.' => 'Es wurde noch kein Lieferant ausgewählt.',
'No.' => 'Position',
- 'Notes' => 'Bemerkungen',
'Nov' => 'Nov',
'November' => 'November',
'Number' => 'Nummer',
'Part description' => 'Artikelbeschreibung',
'Payment date missing!' => 'Tag der Zahlung fehlt!',
'Payment posted!' => 'Zahlung gebucht!',
- 'Payments' => 'Zahlungsausgänge',
'Phone' => 'Telefon',
'Pick List' => 'Sammelliste',
'Please enter values' => 'Bitte Werte eingeben',
- 'Post' => 'Buchen',
- 'Post Payment' => 'Zahlung buchen',
'Postscript' => 'Postscript',
'Preview' => 'Druckvorschau',
'Price' => 'Preis',
'Sales Invoice' => 'Rechnung',
'Sales Order' => 'Kundenauftrag',
'Sales quotation' => 'Angebot',
- 'Save draft' => 'Entwurf speichern',
'Screen' => 'Bildschirm',
'Select a Customer' => 'Endkunde auswählen',
'Select a customer' => 'Einen Kunden auswählen',
'Shipping Address' => 'Lieferadresse',
'Show details' => 'Details anzeigen',
'Skip' => 'Überspringen',
- 'Source' => 'Beleg',
- 'Storno' => 'Storno',
'Storno Invoice' => 'Stornorechnung',
'Storno Packing List' => 'Stornolieferschein',
'Street' => 'Straße',
'Subject' => 'Betreff',
'Subtotal' => 'Zwischensumme',
- 'Tax Included' => 'Steuer im Preis inbegriffen',
'The \'tag\' field must only consist of alphanumeric characters or the carachters - _ ( )' => 'Das Feld \'tag\' darf nur aus alphanumerischen Zeichen und den Zeichen - _ ( ) bestehen.',
'The LDAP server "#1:#2" is unreachable. Please check config/authentication.pl.' => 'Der LDAP-Server "#1:#2" ist nicht erreichbar. Bitte überprüfen Sie die Angaben in config/authentication.pl.',
'The config file "config/authentication.pl" contained invalid Perl code:' => 'Die Konfigurationsdatei "config/authentication.pl" enthielt ungütigen Perl-Code:',
'The connection to the authentication database failed:' => 'Die Verbindung zur Authentifizierungsdatenbank schlug fehl:',
'The connection to the template database failed:' => 'Die Verbindung zur Vorlagendatenbank schlug fehl:',
'The creation of the authentication database failed:' => 'Das Anlegen der Authentifizierungsdatenbank schlug fehl:',
- 'There are #1 unfinished follow-ups of which #2 are due.' => 'Es gibt #1 Wiedervorlage(n), von denen #2 fällig ist/sind.',
'To (email)' => 'An',
- 'Total' => 'Summe',
'Transactions, AR transactions, AP transactions' => 'Dialogbuchen, Debitorenrechnungen, Kreditorenrechnungen',
'Transfer To Stock' => 'Lagereingang',
'Trying to call a sub without a name' => 'Es wurde versucht, eine Unterfunktion ohne Namen aufzurufen.',
'Unit' => 'Einheit',
'Unknown dependency \'%s\'.' => 'Unbekannte Abhängigkeit \'%s\'.',
- 'Update' => 'Erneuern',
- 'Use As Template' => 'Als Vorlage verwenden',
'Value' => 'Wert',
'Variable' => 'Variable',
'Vendor' => 'Lieferant',
'config/authentication.pl: Missing parameters in "LDAP_config". Required parameters are "host", "attribute" and "base_dn".' => 'config/authentication.pl: Fehlende Parameter in "LDAP_config". Benötigt werden "host", "attribute" und "base_dn".',
'customer' => 'Kunde',
'emailed to' => 'gemailt an',
- 'history' => 'Historie',
'invoice' => 'Rechnung',
- 'mark as paid' => 'als bezahlt markieren',
'no' => 'nein',
'none (pricegroup)' => 'keine',
'packing_list' => 'Versandliste',
'buchen' => 'post',
'zahlung_buchen' => 'post_payment',
'entwurf_speichern' => 'save_draft',
+ 'entwurf_speichern' => 'save_draft',
'Überspringen' => 'skip',
'storno' => 'storno',
'erneuern' => 'update',
--- /dev/null
+[%- USE LxERP %]
+ <tr>
+ <td>
+ <table width="100%">
+ <tr class="listheading">
+[% IF is_type_credit_note %]
+ <th colspan="6" class="listheading">Zahlungsausgänge</th>
+[% ELSE %]
+ <th colspan="6" class="listheading">Zahlungseingänge</th>
+[%- END %]
+ </tr>
+
+
+ <tr>
+ <th>Datum</th>
+ <th>Beleg</th>
+ <th>Memo</th>
+ <th>Betrag</th>
+[% IF show_exchangerate %]
+ <th>Wechselkurs.</th>
+[% END %]
+ <th>Konto</th>
+ </tr>
+
+
+[% FOREACH i = paid_indices %]
+ [% SET datepaid = 'datepaid_' _ i %]
+ [% SET source = 'source_' _ i %]
+ [% SET memo = 'memo_' _ i %]
+ [% SET paid = 'paid_' _ i %]
+ [% SET selectAP_paid_ref = 'selectAP_paid_' _ i %]
+
+ <tr>
+
+ <td align="center">
+ <input id="datepaid_[% i %]" name="datepaid_[% i %]" size="11" title="[% dateformat %]" value="[% $datepaid %]">
+ <input type="button" name="datepaid_[% i %]" id="trigger_datepaid_[% i %]" value="?">
+ </td>
+ <td align=center><input name="source_[% i %]" size="11" value="[% $source %]"></td>
+ <td align="center"><input name="memo_[% i %]" size="11" value="[% $memo %]"></td>
+ <td align="center"><input name="paid_[% i %]" size="11" value="[% LxERP.format_amount($paid, 2, 1) %]"></td>
+[% IF show_exchangerate %]
+ <td align="center">
+ [% SET forex = 'forex_' _ i %]
+ [% SET exchangerate = 'exchangerate_' _ i %]
+ [% IF forex %]
+ <input type="hidden" name="exchangerate_[% i %]" value="[% LxERP.format_amount($exchangerate, 2) %]">
+ [% LxERP.format_amount(exchangerate, 2) %]
+ [% ELSE %]
+ <input name="exchangerate_[% i %]" size="10" value="[% LxERP.format_amount($exchangerate, 2, 1) %]">
+ [% END %]
+ <input type="hidden" name="forex_[% i %]" value="[% $forex %]">;
+ </td>
+[% END %]
+ <td align="center"><select name="AP_paid_[% i %]">[% $selectAP_paid_ref %]</select></td>
+
+ </tr>
+ <script type='text/javascript'>
+ Calendar.setup({ inputField : "datepaid_[% i %]", ifFormat :"[% myconfig_jsc_dateformat %]", align : "TR", button : "trigger_datepaid_[% i %]" });
+ $('input[name="paid_[% i %]"]').blur(function(){ check_right_number_format(this) });
+ $('#datepaid_[% i %]').blur(function(){ check_right_date_format(this) });
+ </script>
+
+[% END # foreach %]
+
+ <tr>
+ <td></td>
+ <td></td>
+ <td align="center">Summe</td>
+ <td align="center">[% LxERP.foramt_amount(totalpaid, 2) | html %]</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td align="center">Fehlbetrag</td>
+ <td align="center">[% LxERP.format_amount(paid_missing, 2) | html %]</td>
+ </tr>
+
+ <input type="hidden" name="paidaccounts" value="[% paidaccounts %]">
+ <input type="hidden" name="selectAP_paid" value="[% selectAP_paid %]">
+ <input type="hidden" name="oldinvtotal" value="[% oldinvtotal %]">
+
+ <input type="hidden" name="oldtotalpaid" value="[% totalpaid %]">
+ </table>
+
+ </td>
+ </tr>
--- /dev/null
+[%- USE LxERP %]
+ <tr>
+ <td>
+ <table width="100%">
+ <tr class="listheading">
+[% IF is_type_credit_note %]
+ <th colspan="6" class="listheading"><translate>Payments</translate></th>
+[% ELSE %]
+ <th colspan="6" class="listheading"><translate>Incoming Payments</translate></th>
+[%- END %]
+ </tr>
+
+
+ <tr>
+ <th><translate>Date</translate></th>
+ <th><translate>Source</translate></th>
+ <th><translate>Memo</translate></th>
+ <th><translate>Amount</translate></th>
+[% IF show_exchangerate %]
+ <th><translate>Exch</translate></th>
+[% END %]
+ <th><translate>Account</translate></th>
+ </tr>
+
+
+[% FOREACH i = paid_indices %]
+ [% SET datepaid = 'datepaid_' _ i %]
+ [% SET source = 'source_' _ i %]
+ [% SET memo = 'memo_' _ i %]
+ [% SET paid = 'paid_' _ i %]
+ [% SET selectAP_paid_ref = 'selectAP_paid_' _ i %]
+
+ <tr>
+
+ <td align="center">
+ <input id="datepaid_[% i %]" name="datepaid_[% i %]" size="11" title="[% dateformat %]" value="[% $datepaid %]">
+ <input type="button" name="datepaid_[% i %]" id="trigger_datepaid_[% i %]" value="?">
+ </td>
+ <td align=center><input name="source_[% i %]" size="11" value="[% $source %]"></td>
+ <td align="center"><input name="memo_[% i %]" size="11" value="[% $memo %]"></td>
+ <td align="center"><input name="paid_[% i %]" size="11" value="[% LxERP.format_amount($paid, 2, 1) %]"></td>
+[% IF show_exchangerate %]
+ <td align="center">
+ [% SET forex = 'forex_' _ i %]
+ [% SET exchangerate = 'exchangerate_' _ i %]
+ [% IF forex %]
+ <input type="hidden" name="exchangerate_[% i %]" value="[% LxERP.format_amount($exchangerate, 2) %]">
+ [% LxERP.format_amount(exchangerate, 2) %]
+ [% ELSE %]
+ <input name="exchangerate_[% i %]" size="10" value="[% LxERP.format_amount($exchangerate, 2, 1) %]">
+ [% END %]
+ <input type="hidden" name="forex_[% i %]" value="[% $forex %]">;
+ </td>
+[% END %]
+ <td align="center"><select name="AP_paid_[% i %]">[% $selectAP_paid_ref %]</select></td>
+
+ </tr>
+ <script type='text/javascript'>
+ Calendar.setup({ inputField : "datepaid_[% i %]", ifFormat :"[% myconfig_jsc_dateformat %]", align : "TR", button : "trigger_datepaid_[% i %]" });
+ $('input[name="paid_[% i %]"]').blur(function(){ check_right_number_format(this) });
+ $('#datepaid_[% i %]').blur(function(){ check_right_date_format(this) });
+ </script>
+
+[% END # foreach %]
+
+ <tr>
+ <td></td>
+ <td></td>
+ <td align="center"><translate>Total</translate></td>
+ <td align="center">[% LxERP.foramt_amount(totalpaid, 2) | html %]</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td align="center"><translate>Missing amount</translate></td>
+ <td align="center">[% LxERP.format_amount(paid_missing, 2) | html %]</td>
+ </tr>
+
+ <input type="hidden" name="paidaccounts" value="[% paidaccounts %]">
+ <input type="hidden" name="selectAP_paid" value="[% selectAP_paid %]">
+ <input type="hidden" name="oldinvtotal" value="[% oldinvtotal %]">
+
+ <input type="hidden" name="oldtotalpaid" value="[% totalpaid %]">
+ </table>
+
+ </td>
+ </tr>
--- /dev/null
+[%- USE HTML %]
+[%- USE LxERP %]
+ <tr>
+ <td>
+ <table width="100%">
+ <tr valign="bottom">
+ <td>
+ <table>
+ <tr>
+ <th align="left">Bemerkungen</th>
+ <th align="left">interne Bemerkungen</th>
+ </tr>
+ <tr valign="top">
+ <td>
+ <textarea name="notes" rows="[% rows %]" cols="26" wrap="soft">[% notes %]</textarea>
+ </td>
+ <td>
+ <textarea name="intnotes" rows="[% rows %]" cols="35" wrap="soft">[% intnotes %]</textarea>
+ </td>
+ </tr>
+[%- IF id && follow_ups.size %]
+ <tr>
+ <td colspan="2">
+ [%- LxERP.format_string('Es gibt #1 Wiedervorlage(n), von denen #2 fällig ist/sind.',
+ follow_ups.size, follow_ups_unfinished) | html
+ %]
+ <td>
+ </tr>
+[%- END %]
+ </table>
+ </td>
+ <td align="right">
+ [%- IF taxaccounts %]
+ <input name="taxincluded" class="checkbox" type="checkbox" [% IF taxincluded %]checked[% END %]>
+ <b>Steuer im Preis inbegriffen</b>
+ <br>
+ <br>
+ [%- END %]
+ <table>
+
+[%- UNLESS taxincluded %]
+ <tr>
+ <th align="right">Zwischensumme</th>
+ <td align="right">[% LxERP.format_amount(invsubtotal, 2) %]</td>
+ </tr>
+[%- END %]
+
+[%# tax %]
+[% FOREACH item = taxaccounts_array %]
+[% SET description_ref = item _ '_description' %]
+[% SET rate_ref = item _ '_rate' %]
+[% SET total_ref = item _ '_total' %]
+[% SET netto_ref = item _ '_netto' %]
+ <tr>
+ <th align="right">Enthaltene [% $description_ref | html %] [% $rate_ref * 100 %]%</th>
+ <td align="right">[% LxERP.format_amount($total_ref, 2) %]</td>
+ </tr>
+ [%- IF taxincluded %]
+ <tr>
+ <th align="right">Nettobetrag</th>
+ <td align="right">[% LxERP.format_amount($netto_ref, 2) %]</td>
+ </tr>
+ [%- END %]
+[%- END %]
+
+ <tr>
+ <th align="right">Summe</th>
+ <td align="right">[% LxERP.format_amount(invtotal, 2) %]</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+[% PROCESS 'webdav/_list_de.html' %]
+
+[% PROCESS 'ir/_payments_de.html' %]
+
+ <tr>
+ <td><hr size="3" noshade></td>
+ </tr>
+ <tr>
+ <td>
+[% print_options %]
+ </td>
+ </tr>
+ </table>
+
+
+
+ [% IF id %]
+
+ <input class="submit" type="submit" accesskey="u" name="action" id="update_button" value="Erneuern">
+[% IF show_storno %]
+ <input class="submit" type="submit" name="action" value="Storno">
+[% END %]
+ <input class="submit" type="submit" name="action" value="Zahlung buchen">
+ <input class="submit" type="submit" name="action" value="Als Vorlage verwenden">
+
+[% IF show_delete %]
+ <input class="submit" type="submit" name="action" value="Löschen">
+[% END %]
+
+ <input type="button" class="submit" onclick="follow_up_window()" value="Wiedervorlage">
+
+ [% ELSE # no id %]
+ [% UNLESS locked %]
+ <input class="submit" type="submit" name="action" id="update_button" value="Erneuern">
+ <input class="submit" type="submit" name="action" value="Buchen">
+ <input class="submit" type="submit" name="action" value="Entwurf speichern">
+ [%- END %]
+ [% END # id %]
+
+ [% IF id %]
+ [%#- button for saving history %]
+ <input type="button" class="submit" onclick="set_history_window([% id | html %]);" name="history" id="history" value="Historie">
+
+ <input type="submit" class="submit" name="action" value="als bezahlt markieren">
+ [% END %]
+
+<input type="hidden" name="rowcount" value="[% rowcount %]">
+<input type="hidden" name="callback" value="[% callback %]">
+<input type="hidden" name="draft_id" value="[% draft_id %]">
+<input type="hidden" name="draft_description" value="[% draft_description %]">
+<input type="hidden" name="vendor_discount" value="[% vendor_discount %]">
+
+</form>
+
+</body>
+
+</html>
--- /dev/null
+[%- USE HTML %]
+[%- USE LxERP %]
+ <tr>
+ <td>
+ <table width="100%">
+ <tr valign="bottom">
+ <td>
+ <table>
+ <tr>
+ <th align="left"><translate>Notes</translate></th>
+ <th align="left"><translate>Internal Notes</translate></th>
+ </tr>
+ <tr valign="top">
+ <td>
+ <textarea name="notes" rows="[% rows %]" cols="26" wrap="soft">[% notes %]</textarea>
+ </td>
+ <td>
+ <textarea name="intnotes" rows="[% rows %]" cols="35" wrap="soft">[% intnotes %]</textarea>
+ </td>
+ </tr>
+[%- IF id && follow_ups.size %]
+ <tr>
+ <td colspan="2">
+ [%- LxERP.format_string('<translate>There are #1 unfinished follow-ups of which #2 are due.</translate>',
+ follow_ups.size, follow_ups_unfinished) | html
+ %]
+ <td>
+ </tr>
+[%- END %]
+ </table>
+ </td>
+ <td align="right">
+ [%- IF taxaccounts %]
+ <input name="taxincluded" class="checkbox" type="checkbox" [% IF taxincluded %]checked[% END %]>
+ <b><translate>Tax Included</translate></b>
+ <br>
+ <br>
+ [%- END %]
+ <table>
+
+[%- UNLESS taxincluded %]
+ <tr>
+ <th align="right"><translate>Subtotal</translate></th>
+ <td align="right">[% LxERP.format_amount(invsubtotal, 2) %]</td>
+ </tr>
+[%- END %]
+
+[%# tax %]
+[% FOREACH item = taxaccounts_array %]
+[% SET description_ref = item _ '_description' %]
+[% SET rate_ref = item _ '_rate' %]
+[% SET total_ref = item _ '_total' %]
+[% SET netto_ref = item _ '_netto' %]
+ <tr>
+ <th align="right">Enthaltene [% $description_ref | html %] [% $rate_ref * 100 %]%</th>
+ <td align="right">[% LxERP.format_amount($total_ref, 2) %]</td>
+ </tr>
+ [%- IF taxincluded %]
+ <tr>
+ <th align="right">Nettobetrag</th>
+ <td align="right">[% LxERP.format_amount($netto_ref, 2) %]</td>
+ </tr>
+ [%- END %]
+[%- END %]
+
+ <tr>
+ <th align="right"><translate>Total</translate></th>
+ <td align="right">[% LxERP.format_amount(invtotal, 2) %]</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+[% PROCESS 'webdav/_list_<translate>master</translate>.html' %]
+
+[% PROCESS 'ir/_payments_<translate>master</translate>.html' %]
+
+ <tr>
+ <td><hr size="3" noshade></td>
+ </tr>
+ <tr>
+ <td>
+[% print_options %]
+ </td>
+ </tr>
+ </table>
+
+
+
+ [% IF id %]
+
+ <input class="submit" type="submit" accesskey="u" name="action" id="update_button" value="<translate>Update</translate>">
+[% IF show_storno %]
+ <input class="submit" type="submit" name="action" value="<translate>Storno</translate>">
+[% END %]
+ <input class="submit" type="submit" name="action" value="<translate>Post Payment</translate>">
+ <input class="submit" type="submit" name="action" value="<translate>Use As Template</translate>">
+
+[% IF show_delete %]
+ <input class="submit" type="submit" name="action" value="<translate>Delete</translate>">
+[% END %]
+
+ <input type="button" class="submit" onclick="follow_up_window()" value="<translate>Follow-Up</translate>">
+
+ [% ELSE # no id %]
+ [% UNLESS locked %]
+ <input class="submit" type="submit" name="action" id="update_button" value="<translate>Update</translate>">
+ <input class="submit" type="submit" name="action" value="<translate>Post</translate>">
+ <input class="submit" type="submit" name="action" value="<translate>Save Draft</translate>">
+ [%- END %]
+ [% END # id %]
+
+ [% IF id %]
+ [%#- button for saving history %]
+ <input type="button" class="submit" onclick="set_history_window([% id | html %]);" name="history" id="history" value="<translate>history</translate>">
+
+ <input type="submit" class="submit" name="action" value="<translate>mark as paid</translate>">
+ [% END %]
+
+<input type="hidden" name="rowcount" value="[% rowcount %]">
+<input type="hidden" name="callback" value="[% callback %]">
+<input type="hidden" name="draft_id" value="[% draft_id %]">
+<input type="hidden" name="draft_description" value="[% draft_description %]">
+<input type="hidden" name="vendor_discount" value="[% vendor_discount %]">
+
+</form>
+
+</body>
+
+</html>