+ $vendors
+ $contact
+
+ | . $locale->text('Credit Limit') . qq| |
+ $form->{creditlimit}; | . $locale->text('Remaining') . qq| $form->{creditremaining} |
+
- | . $locale->text('Vendor') . qq| |
- $vendor |
-
- |
- . $locale->text('Contact Person') . qq| |
- $contact |
-
- {vendor_id}>
-
-
-
-
- |
-
-
-
- | . $locale->text('Credit Limit') . qq| |
- $form->{creditlimit} |
- |
- | . $locale->text('Remaining') . qq| |
- $form->{creditremaining} |
-
-
- |
-
- | . $locale->text('Record in') . qq| |
- |
-
+ | . $locale->text('Record in') . qq| |
+ |
+
$taxzone
$department
@@ -479,6 +468,7 @@ onchange="document.getElementById('update_button').click();">| .
+ $employees
| . $locale->text('Invoice Number') . qq| |
|
@@ -498,13 +488,13 @@ onchange="document.getElementById('update_button').click();">| .
| . $locale->text('Order Date') . qq| |
- |
- |
+
+ |
| . $locale->text('Quotation Date') . qq| |
- |
- |
+
+ |
| . $locale->text('Project Number') . qq| |
@@ -519,14 +509,7 @@ onchange="document.getElementById('update_button').click();">| .
$jsscript
-{fxgain_accno}>
-{fxloss_accno}>
-
-
-
-
-
|;
foreach $item (split / /, $form->{taxaccounts}) {
@@ -542,6 +525,8 @@ $jsscript
sub form_footer {
$lxdebug->enter_sub();
+ $auth->assert('vendor_invoice_edit');
+
$form->{invtotal} = $form->{invsubtotal};
if (($rows = $form->numtextrows($form->{notes}, 25, 8)) < 2) {
@@ -639,6 +624,20 @@ sub form_footer {
$form->{invtotal} =
$form->format_amount(\%myconfig, $form->{invtotal}, 2, 0);
+ my $follow_ups_block;
+ 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|
+
+ | . $locale->text("There are #1 unfinished follow-ups of which #2 are due.", scalar @{ $follow_ups }, $num_due) . qq| |
+
+|;
+ }
+ }
+
print qq|
@@ -654,6 +653,7 @@ sub form_footer {
| $notes |
$intnotes |
+ $follow_ups_block
|
@@ -662,7 +662,7 @@ sub form_footer {
$subtotal
$tax
- 0
+
| . $locale->text('Total') . qq| |
$form->{invtotal} |
@@ -685,11 +685,11 @@ sub form_footer {
Dateiname |
Webdavlink |
|;
- foreach $file (keys %{ $form->{WEBDAV} }) {
+ foreach $file (@{ $form->{WEBDAV} }) {
$webdav_list .= qq|
- $file |
- $form->{WEBDAV}{$file} |
+ $file->{name} |
+ $file->{type} |
|;
}
@@ -701,9 +701,6 @@ sub form_footer {
print $webdav_list;
}
print qq|
-{jscalendar}>
-|;
- print qq|
@@ -733,7 +730,9 @@ sub form_footer {
|;
- my @triggers = ();
+ my @triggers = ();
+ my $totalpaid = 0;
+
$form->{paidaccounts}++ if ($form->{"paid_$form->{paidaccounts}"});
for $i (1 .. $form->{paidaccounts}) {
@@ -745,6 +744,8 @@ sub form_footer {
$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"} =
@@ -776,9 +777,9 @@ sub form_footer {
qq|
| |;
$column_data{"source_$i"} =
- qq|{"source_$i"}> | |;
+ qq| | |;
$column_data{"memo_$i"} =
- qq|{"memo_$i"}> | |;
+ qq| | |;
map { print qq|$column_data{"${_}_$i"}\n| } @column_index;
@@ -788,7 +789,22 @@ sub form_footer {
push(@triggers, "datepaid_$i", "BL", "trigger_datepaid_$i");
}
+ my $paid_missing = $form->{oldinvtotal} - $totalpaid;
+
print qq|
+
+ |
+ |
+ | . $locale->text('Total') . qq| |
+ | . H($form->format_amount(\%myconfig, $totalpaid, 2)) . qq| |
+
+
+ |
+ |
+ | . $locale->text('Missing amount') . qq| |
+ | . H($form->format_amount(\%myconfig, $paid_missing, 2)) . qq| |
+
+
{oldinvtotal}>
{paidaccounts}>
@@ -805,8 +821,12 @@ sub form_footer {
$invdate = $form->datetonum($form->{invdate}, \%myconfig);
$closedto = $form->datetonum($form->{closedto}, \%myconfig);
+ print qq|
+|;
+
if ($form->{id}) {
- my $show_storno = !$form->{storno} && !IS->has_storno(\%myconfig, $form, "ap");
+ my $show_storno = !$form->{storno} && !IS->has_storno(\%myconfig, $form, "ap") && (($totalpaid == 0) || ($totalpaid eq ""));
print qq|
@@ -822,13 +842,13 @@ sub form_footer {
}
print qq|
+
|;
}
- print qq||;
-
if (!$form->{id} && ($invdate > $closedto)) {
print qq| | .
@@ -837,7 +857,7 @@ sub form_footer {
}
print $form->write_trigger(\%myconfig, scalar(@triggers) / 3, @triggers);
- $form->hide_form(qw(rowcount callback draft_id draft_description login password));
+ $form->hide_form(qw(rowcount callback draft_id draft_description vendor_discount));
# button for saving history
if($form->{id} ne "") {
@@ -849,9 +869,13 @@ sub form_footer {
. qq|">|;
}
# /button for saving history
-
+ # mark_as_paid button
+ if($form->{id} ne "") {
+ print qq| |;
+ }
+ # /mark_as_paid button
print qq|
-
| |