-
-
-
-
+ |
-
- $vendors
- |
- . $locale->text('Contact Person') . qq| |
- $contact |
-
-
-
-
-
-
- |
-
-
-
- | . $locale->text('Credit Limit') . qq| |
- $form->{creditlimit} |
- |
- | . $locale->text('Remaining') . qq| |
- $form->{creditremaining} |
-
-
- |
+ $vendors
+
+
+
+ $contact
+
+ | . $locale->text('Credit Limit') . qq| |
+ $form->{creditlimit}; | . $locale->text('Remaining') . qq| $form->{creditremaining} |
+
| . $locale->text('Record in') . qq| |
- |
+ |
$taxzone
@@ -523,13 +501,13 @@ sub form_header {
| . $locale->text('Order Date') . qq| |
- |
- |
+
+ |
| . $locale->text('Quotation Date') . qq| |
- |
- |
+
+ |
| . $locale->text('Project Number') . qq| |
@@ -710,11 +688,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} |
|;
}
@@ -726,9 +704,6 @@ sub form_footer {
print $webdav_list;
}
print qq|
-{jscalendar}>
-|;
- print qq|
@@ -758,7 +733,9 @@ sub form_footer {
|;
- my @triggers = ();
+ my @triggers = ();
+ my $totalpaid = 0;
+
$form->{paidaccounts}++ if ($form->{"paid_$form->{paidaccounts}"});
for $i (1 .. $form->{paidaccounts}) {
@@ -770,6 +747,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"} =
@@ -813,7 +792,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}>
@@ -830,6 +824,10 @@ 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");
@@ -851,9 +849,6 @@ sub form_footer {
}
- print qq||;
-
if (!$form->{id} && ($invdate > $closedto)) {
print qq| | .
@@ -874,7 +869,12 @@ sub form_footer {
. qq|">|;
}
# /button for saving history
-
+ # mark_as_paid button
+ if($form->{id} ne "") {
+ print qq| |;
+ }
+ # /mark_as_paid button
print qq|
@@ -884,6 +884,12 @@ print qq|
$lxdebug->leave_sub();
}
+sub mark_as_paid {
+ $lxdebug->enter_sub();
+ &mark_as_paid_common(\%myconfig,"ap");
+ $lxdebug->leave_sub();
+}
+
sub update {
$lxdebug->enter_sub();
@@ -1055,6 +1061,8 @@ sub use_as_template {
sub post_payment {
$lxdebug->enter_sub();
+
+ $form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
for $i (1 .. $form->{paidaccounts}) {
if ($form->{"paid_$i"}) {
$datepaid = $form->datetonum($form->{"datepaid_$i"}, \%myconfig);
@@ -1076,19 +1084,19 @@ sub post_payment {
($form->{AP}) = split /--/, $form->{AP};
($form->{AP_paid}) = split /--/, $form->{AP_paid};
if (IR->post_payment(\%myconfig, \%$form)){
-
- if(!exists $form->{addition} && $form->{id} ne "") {
+ if (!exists $form->{addition} && $form->{id} ne "") {
# saving the history
- $form->{snumbers} = qq|invnumber_| . $form->{invnumber};
+ $form->{snumbers} = qq|invnumber_| . $form->{invnumber};
$form->{addition} = "PAYMENT POSTED";
$form->{what_done} = $form->{currency} . qq| | . $form->{paid} . qq| | . $locale->text("POSTED");
$form->save_history($form->dbconnect(\%myconfig));
- # /saving the history
- $form->redirect($locale->text(' Payment posted!'));
+ # /saving the history
}
+
+ $form->redirect($locale->text('Payment posted!'));
}
- $form->error($locale->text('Cannot post payment!'));
+ $form->error($locale->text('Cannot post payment!'));
$lxdebug->leave_sub();
}
@@ -1096,6 +1104,8 @@ sub post_payment {
sub post {
$lxdebug->enter_sub();
+ $form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
+
$form->isblank("invdate", $locale->text('Invoice Date missing!'));
$form->isblank("vendor", $locale->text('Vendor missing!'));
@@ -1139,6 +1149,7 @@ sub post {
($form->{AP}) = split /--/, $form->{AP};
($form->{AP_paid}) = split /--/, $form->{AP_paid};
+ $form->{storno} = 0;
$form->{id} = 0 if $form->{postasnew};
| | |