X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fis.pl;h=177b0e3f542fe89620e53be423f7365bbbf2f1c4;hb=a0a30f41301f5f52c26febd9366182be858e54bb;hp=9b1d61c90f6e1fc0f14a866a16219e68739f7102;hpb=4d8a65151cff0399654ea47c196ab38361a976e8;p=kivitendo-erp.git
diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl
index 9b1d61c90..177b0e3f5 100644
--- a/bin/mozilla/is.pl
+++ b/bin/mozilla/is.pl
@@ -31,22 +31,36 @@
#
#======================================================================
+use SL::FU;
use SL::IS;
use SL::PE;
use Data::Dumper;
+use List::Util qw(max sum);
require "bin/mozilla/io.pl";
+require "bin/mozilla/invoice_io.pl";
require "bin/mozilla/arap.pl";
require "bin/mozilla/drafts.pl";
+use strict;
+
+my $edit;
+my $payment;
+my $print_post;
+
1;
# end of main
sub add {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
+
+ my $form = $main::form;
+ my $locale = $main::locale;
+
+ $main::auth->assert('invoice_edit');
- return $lxdebug->leave_sub() if (load_draft_maybe());
+ return $main::lxdebug->leave_sub() if (load_draft_maybe());
if ($form->{type} eq "credit_note") {
$form->{title} = $locale->text('Add Credit Note');
@@ -60,35 +74,30 @@ sub add {
}
- $form->{callback} =
- "$form->{script}?action=add&type=$form->{type}&login=$form->{login}&password=$form->{password}"
- unless $form->{callback};
+ $form->{callback} = "$form->{script}?action=add&type=$form->{type}" unless $form->{callback};
- $form{jsscript} = "date";
+ $form->{jsscript} = "date";
- if ($myconfig{acs} =~ "AR--Add Sales Invoice" || $myconfig{acs} =~ "AR--AR")
- {
- $form->error("Access Denied");
- }
&invoice_links;
&prepare_invoice;
&display_form;
- $lxdebug->leave_sub();
+ $main::lxdebug->leave_sub();
}
sub edit {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
+
+ my $form = $main::form;
+
+ $main::auth->assert('invoice_edit');
# show history button
$form->{javascript} = qq||;
#/show hhistory button
- if ($myconfig{acs} =~ "AR--Add Sales Invoice" || $myconfig{acs} =~ "AR--AR")
- {
- $form->error("Access Denied");
- }
$edit = 1;
+ my ($language_id, $printer_id);
if ($form->{print_and_post}) {
$form->{action} = "print";
$form->{resubmit} = 1;
@@ -104,17 +113,22 @@ sub edit {
&display_form;
- $lxdebug->leave_sub();
+ $main::lxdebug->leave_sub();
}
sub invoice_links {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
+
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+
+ $main::auth->assert('invoice_edit');
$form->{vc} = 'customer';
# create links
- $form->{webdav} = $webdav;
- $form->{lizenzen} = $lizenzen;
+ $form->{webdav} = $main::webdav;
+ $form->{lizenzen} = $main::lizenzen;
$form->create_links("AR", \%myconfig, "customer");
@@ -125,27 +139,32 @@ sub invoice_links {
}
}
+ my $payment_id;
if ($form->{payment_id}) {
$payment_id = $form->{payment_id};
}
+ my $language_id;
if ($form->{language_id}) {
$language_id = $form->{language_id};
}
+ my $taxzone_id;
if ($form->{taxzone_id}) {
$taxzone_id = $form->{taxzone_id};
}
+ my $id;
if ($form->{id}) {
$id = $form->{id};
}
+ my $shipto_id;
if ($form->{shipto_id}) {
$shipto_id = $form->{shipto_id};
}
- $cp_id = $form->{cp_id};
+ my $cp_id = $form->{cp_id};
IS->get_customer(\%myconfig, \%$form);
#quote all_customer Bug 133
- foreach $ref (@{ $form->{all_customer} }) {
+ foreach my $ref (@{ $form->{all_customer} }) {
$ref->{name} = $form->quote($ref->{name});
}
if ($id) {
@@ -184,16 +203,17 @@ sub invoice_links {
# forex
$form->{forex} = $form->{exchangerate};
- $exchangerate = ($form->{exchangerate}) ? $form->{exchangerate} : 1;
+ my $exchangerate = ($form->{exchangerate}) ? $form->{exchangerate} : 1;
- foreach $key (keys %{ $form->{AR_links} }) {
- foreach $ref (@{ $form->{AR_links}{$key} }) {
+ foreach my $key (keys %{ $form->{AR_links} }) {
+ foreach my $ref (@{ $form->{AR_links}{$key} }) {
$form->{"select$key"} .=
"\n";
}
if ($key eq "AR_paid") {
- for $i (1 .. scalar @{ $form->{acc_trans}{$key} }) {
+ next unless $form->{acc_trans}{$key};
+ for my $i (1 .. scalar @{ $form->{acc_trans}{$key} }) {
$form->{"AR_paid_$i"} =
"$form->{acc_trans}{$key}->[$i-1]->{accno}--$form->{acc_trans}{$key}->[$i-1]->{description}";
@@ -223,11 +243,16 @@ sub invoice_links {
($form->datetonum($form->{invdate}, \%myconfig) <=
$form->datetonum($form->{closedto}, \%myconfig));
- $lxdebug->leave_sub();
+ $main::lxdebug->leave_sub();
}
sub prepare_invoice {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
+
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+
+ $main::auth->assert('invoice_edit');
if ($form->{type} eq "credit_note") {
$form->{type} = "credit_note";
@@ -239,75 +264,62 @@ sub prepare_invoice {
if ($form->{id}) {
- map { $form->{$_} =~ s/\"/"/g }
- qw(invnumber ordnumber quonumber shippingpoint shipvia notes intnotes);
-
- # # get pricegroups for parts
- # IS->get_pricegroups_for_parts(\%myconfig, \%$form);
-
my $i = 0;
- foreach $ref (@{ $form->{invoice_details} }) {
+ foreach my $ref (@{ $form->{invoice_details} }) {
$i++;
map { $form->{"${_}_$i"} = $ref->{$_} } keys %{$ref};
- $form->{"discount_$i"} =
- $form->format_amount(\%myconfig, $form->{"discount_$i"} * 100);
- ($dec) = ($form->{"sellprice_$i"} =~ /\.(\d+)/);
- $dec = length $dec;
- $decimalplaces = ($dec > 2) ? $dec : 2;
- $form->{"sellprice_$i"} =
- $form->format_amount(\%myconfig, $form->{"sellprice_$i"},
- $decimalplaces);
+ $form->{"discount_$i"} = $form->format_amount(\%myconfig, $form->{"discount_$i"} * 100);
+ my ($dec) = ($form->{"sellprice_$i"} =~ /\.(\d+)/);
+ $dec = length $dec;
+ my $decimalplaces = ($dec > 2) ? $dec : 2;
- (my $dec_qty) = ($form->{"qty_$i"} =~ /\.(\d+)/);
- $dec_qty = length $dec_qty;
+ $form->{"sellprice_$i"} = $form->format_amount(\%myconfig, $form->{"sellprice_$i"}, $decimalplaces);
+ (my $dec_qty) = ($form->{"qty_$i"} =~ /\.(\d+)/);
+ $dec_qty = length $dec_qty;
- $form->{"qty_$i"} =
- $form->format_amount(\%myconfig, $form->{"qty_$i"}, $dec_qty);
+ $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"}, $dec_qty);
- map { $form->{"${_}_$i"} =~ s/\"/"/g }
- qw(partnumber description unit partnotes);
- $form->{rowcount} = $i;
+ $form->{rowcount} = $i;
}
+
+ # get pricegroups for parts
+ IS->get_pricegroups_for_parts(\%myconfig, \%$form);
+ set_pricegroup($_) for 1 .. $form->{rowcount};
}
- $lxdebug->leave_sub();
+ $main::lxdebug->leave_sub();
}
sub form_header {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
- if ($form->{old_employee_id}) {
- $form->{employee_id} = $form->{old_employee_id};
- }
- if ($form->{old_salesman_id}) {
- $form->{salesman_id} = $form->{old_salesman_id};
- }
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+ my $locale = $main::locale;
+ my $cgi = $main::cgi;
- if ($edit) {
+ $main::auth->assert('invoice_edit');
+ $form->{employee_id} = $form->{old_employee_id} if $form->{old_employee_id};
+ $form->{salesman_id} = $form->{old_salesman_id} if $form->{old_salesman_id};
+
+ if ($edit) {
if ($form->{type} eq "credit_note") {
$form->{title} = $locale->text('Edit Credit Note');
-
- if ($form->{storno}) {
- $form->{title} = $locale->text('Edit Storno Credit Note');
- }
+ $form->{title} = $locale->text('Edit Storno Credit Note') if $form->{storno};
} else {
$form->{title} = $locale->text('Edit Sales Invoice');
-
- if ($form->{storno}) {
- $form->{title} = $locale->text('Edit Storno Invoice');
- }
+ $form->{title} = $locale->text('Edit Storno Invoice') if $form->{storno};
}
}
$form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
- $form->{radier} =
- ($form->current_date(\%myconfig) eq $form->{gldate}) ? 1 : 0;
+ $form->{radier} = ($form->current_date(\%myconfig) eq $form->{gldate}) ? 1 : 0;
$payment = qq||;
- foreach $item (@{ $form->{payment_terms} }) {
+ foreach my $item (@{ $form->{payment_terms} }) {
if ($form->{payment_id} eq $item->{id}) {
$payment .= qq||;
} else {
@@ -315,42 +327,38 @@ sub form_header {
}
}
- my $set_duedate_url =
- "$form->{script}?login=$form->{login}&password=$form->{password}&action=set_duedate";
+ my $set_duedate_url = "$form->{script}?action=set_duedate";
my $pjx = new CGI::Ajax( 'set_duedate' => $set_duedate_url );
push(@ { $form->{AJAX} }, $pjx);
my @old_project_ids = ($form->{"globalproject_id"});
- map({ push(@old_project_ids, $form->{"project_id_$_"})
- if ($form->{"project_id_$_"}); } (1..$form->{"rowcount"}));
-
- $form->get_lists("contacts" => "ALL_CONTACTS",
- "shipto" => "ALL_SHIPTO",
- "projects" => { "key" => "ALL_PROJECTS",
- "all" => 0,
- "old_id" => \@old_project_ids },
- "employees" => "ALL_SALESMEN",
- "taxzones" => "ALL_TAXZONES",
- "currencies" => "ALL_CURRENCIES",
- "customers" => "ALL_CUSTOMERS");
+ map { push @old_project_ids, $form->{"project_id_$_"} if $form->{"project_id_$_"}; } 1..$form->{"rowcount"};
+
+ $form->get_lists("contacts" => "ALL_CONTACTS",
+ "shipto" => "ALL_SHIPTO",
+ "projects" => { "key" => "ALL_PROJECTS",
+ "all" => 0,
+ "old_id" => \@old_project_ids },
+ "employees" => "ALL_SALESMEN",
+ "taxzones" => "ALL_TAXZONES",
+ "currencies" => "ALL_CURRENCIES",
+ "customers" => "ALL_CUSTOMERS",
+ "price_factors" => "ALL_PRICE_FACTORS");
my %labels;
my @values = (undef);
foreach my $item (@{ $form->{"ALL_CONTACTS"} }) {
push(@values, $item->{"cp_id"});
- $labels{$item->{"cp_id"}} = $item->{"cp_name"} .
- ($item->{"cp_abteilung"} ? " ($item->{cp_abteilung})" : "");
+ $labels{$item->{"cp_id"}} = join(',', $item->{"cp_name"}, $item->{"cp_givenname"}) . ($item->{"cp_abteilung"} ? " ($item->{cp_abteilung})" : "");
}
my $contact;
if (scalar @values > 1) {
$contact = qq|
| . $locale->text('Contact Person') . qq| |
- | .
- NTI($cgi->popup_menu('-name' => 'cp_id', '-values' => \@values, '-style' => 'width: 250px',
- '-labels' => \%labels, '-default' => $form->{"cp_id"}))
- . qq|
+ | | . NTI($cgi->popup_menu('-name' => 'cp_id', '-values' => \@values, '-style' => 'width: 250px',
+ '-labels' => \%labels, '-default' => $form->{"cp_id"})) . qq|
|
|;
}
@@ -365,9 +373,8 @@ sub form_header {
my $employees = qq|
| . $locale->text('Employee') . qq| |
- | .
- NTI($cgi->popup_menu('-name' => 'employee_id', '-default' => $form->{"employee_id"},
- '-values' => \@values, '-labels' => \%labels)) . qq|
+ | | . NTI($cgi->popup_menu('-name' => 'employee_id', '-default' => $form->{"employee_id"},
+ '-values' => \@values, '-labels' => \%labels)) . qq|
|
|;
@@ -389,7 +396,7 @@ sub form_header {
: (NTI($cgi->popup_menu('-name' => 'customer', '-default' => $form->{oldcustomer},
'-onChange' => 'document.getElementById(\'update_button\').click();',
'-values' => \@values, '-labels' => \%labels, '-style' => 'width: 250px')))) . qq|
-
+
|;
%labels = ();
@@ -404,10 +411,9 @@ sub form_header {
$shipto = qq|
| . $locale->text('Shipping Address') . qq| |
- | .
- NTI($cgi->popup_menu('-name' => 'shipto_id', '-values' => \@values, '-style' => 'width: 250px',
- '-labels' => \%labels, '-default' => $form->{"shipto_id"}))
- . qq| | |;
+ | . NTI($cgi->popup_menu('-name' => 'shipto_id', '-values' => \@values, '-style' => 'width: 250px',
+ '-labels' => \%labels, '-default' => $form->{"shipto_id"})). qq|
+ | |;
}
%labels = ();
@@ -423,9 +429,8 @@ sub form_header {
$currencies = qq|
| . $locale->text('Currency') . qq| |
- | .
- NTI($cgi->popup_menu('-name' => 'currency', '-default' => $form->{"currency"},
- '-values' => \@values, '-labels' => \%labels)) . qq|
+ | | . NTI($cgi->popup_menu('-name' => 'currency', '-default' => $form->{"currency"},
+ '-values' => \@values, '-labels' => \%labels)) . qq|
|
|;
}
@@ -436,10 +441,9 @@ sub form_header {
push(@values, $item->{"id"});
$labels{$item->{"id"}} = $item->{"projectnumber"};
}
- my $globalprojectnumber =
- NTI($cgi->popup_menu('-name' => 'globalproject_id', '-values' => \@values,
- '-labels' => \%labels,
- '-default' => $form->{"globalproject_id"}));
+ my $globalprojectnumber = NTI($cgi->popup_menu('-name' => 'globalproject_id', '-values' => \@values,
+ '-labels' => \%labels,
+ '-default' => $form->{"globalproject_id"}));
%labels = ();
@values = ();
@@ -448,14 +452,12 @@ sub form_header {
$labels{$item->{id}} = $item->{name} ne "" ? $item->{name} : $item->{login};
}
- $salesman =
- qq|
- | . $locale->text('Salesman') . qq| |
- | .
- NTI($cgi->popup_menu('-name' => 'salesman_id', '-default' => $form->{salesman_id} ? $form->{salesman_id} : $form->{employee_id},
- '-values' => \@values, '-labels' => \%labels))
- . qq| |
-
|;
+ my $salesman =
+ qq| | . $locale->text('Salesman') . qq| |
+ | . NTI($cgi->popup_menu('-name' => 'salesman_id', '-values' => \@values, '-labels' => \%labels,
+ '-default' => $form->{salesman_id} ? $form->{salesman_id} : $form->{employee_id})) . qq|
+ |
+
|;
%labels = ();
@values = ();
@@ -464,13 +466,13 @@ sub form_header {
$labels{$item->{"id"}} = $item->{"description"};
}
+ my $taxzone;
if (!$form->{"id"}) {
$taxzone = qq|
| . $locale->text('Steuersatz') . qq| |
- | .
- NTI($cgi->popup_menu('-name' => 'taxzone_id', '-default' => $form->{"taxzone_id"},
- '-values' => \@values, '-labels' => \%labels, '-style' => 'width: 250px',)) . qq|
+ | | . NTI($cgi->popup_menu('-name' => 'taxzone_id', '-default' => $form->{"taxzone_id"},
+ '-values' => \@values, '-labels' => \%labels, '-style' => 'width: 250px',)) . qq|
|
|;
@@ -486,55 +488,41 @@ sub form_header {
}
# set option selected
- foreach $item (qw(AR customer currency department employee)) {
+ foreach my $item (qw(AR customer currency department employee)) {
$form->{"select$item"} =~ s/ selected//;
- $form->{"select$item"} =~
- s/option>\Q$form->{$item}\E/option selected>$form->{$item}/;
- }
-
- if (($form->{creditlimit} != 0) && ($form->{creditremaining} < 0) && !$form->{update}) {
- $creditwarning = 1;
- } else {
- $creditwarning = 0;
+ $form->{"select$item"} =~ s/option>\Q$form->{$item}\E/option selected>$form->{$item}/;
}
- $form->{exchangerate} =
- $form->format_amount(\%myconfig, $form->{exchangerate});
+ my $creditwarning = (($form->{creditlimit} != 0) && ($form->{creditremaining} < 0) && !$form->{update}) ? 1 : 0;
- $form->{creditlimit} =
- $form->format_amount(\%myconfig, $form->{creditlimit}, 0, "0");
- $form->{creditremaining} =
- $form->format_amount(\%myconfig, $form->{creditremaining}, 0, "0");
+ $form->{exchangerate} = $form->format_amount(\%myconfig, $form->{exchangerate});
+ $form->{creditlimit} = $form->format_amount(\%myconfig, $form->{creditlimit}, 0, "0");
+ $form->{creditremaining} = $form->format_amount(\%myconfig, $form->{creditremaining}, 0, "0");
- $exchangerate = "";
+ my $exchangerate = "";
if ($form->{currency} ne $form->{defaultcurrency}) {
if ($form->{forex}) {
- $exchangerate .=
- qq||
- . $locale->text('Exchangerate')
- . qq| | $form->{exchangerate} | |;
+ $exchangerate .= qq|| . $locale->text('Exchangerate') . qq| |
+ $form->{exchangerate} | |;
} else {
- $exchangerate .=
- qq||
- . $locale->text('Exchangerate')
- . qq| | | |;
+ $exchangerate .= qq|| . $locale->text('Exchangerate') . qq| |
+ | |;
}
}
- $exchangerate .= qq|
-
-|;
+ $exchangerate .= qq|\n\n|;
- $department = qq|
+ my $department = qq|
| . $locale->text('Department') . qq| |
-
+
|
| if $form->{selectdepartment};
- $n = ($form->{creditremaining} =~ /-/) ? "0" : "1";
+ my $n = ($form->{creditremaining} =~ /-/) ? "0" : "1";
+ my $business;
if ($form->{business}) {
$business = qq|
@@ -546,6 +534,7 @@ sub form_header {
|;
}
+ my $dunning;
if ($form->{max_dunning_level}) {
$dunning = qq|
@@ -564,11 +553,12 @@ sub form_header {
# use JavaScript Calendar or not
$form->{jsscript} = 1;
- $jsscript = "";
+ my $jsscript = "";
+ my ($button1, $button2, $button3);
if ($form->{type} eq "credit_note") {
$button1 = qq|
-
-
+ | |;
#write Trigger
@@ -578,48 +568,44 @@ sub form_header {
"trigger1");
} else {
$button1 = qq|
-
-
+ |
|;
$button2 = qq|
- |
+
|;
$button3 = qq|
- |
+
|;
#write Trigger
$jsscript =
Form->write_trigger(\%myconfig, "3",
- "invdate", "BL",
- "trigger1", "duedate",
- "BL", "trigger2",
- "deliverydate", "BL",
- "trigger3");
+ "invdate", "BL", "trigger1",
+ "duedate", "BL", "trigger2",
+ "deliverydate", "BL", "trigger3");
}
- if ($form->{resubmit} && ($form->{format} eq "html")) {
- $onload =
- qq|window.open('about:blank','Beleg'); document.invoice.target = 'Beleg';document.invoice.submit()|;
- } elsif ($form->{resubmit}) {
- $onload = qq|document.invoice.submit()|;
- } else {
- $onload = "focus()";
- }
+ my $credittext = $locale->text('Credit Limit exceeded!!!');
+
+ my $follow_up_vc = $form->{customer};
+ $follow_up_vc =~ s/--\d*\s*$//;
+ my $follow_up_trans_info = "$form->{invnumber} ($follow_up_vc)";
+
+ my $onload = ($form->{resubmit} && ($form->{format} eq "html")) ? qq|window.open('about:blank','Beleg'); document.invoice.target = 'Beleg';document.invoice.submit()|
+ : ($form->{resubmit}) ? qq|document.invoice.submit()|
+ : ($creditwarning) ? qq|alert('$credittext')|
+ : "focus()";
$onload .= qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|;
$onload .= qq|;setupPoints('|. $myconfig{numberformat} .qq|', '|. $locale->text("wrongformat") .qq|')|;
- $credittext = $locale->text('Credit Limit exceeded!!!');
- if ($creditwarning) {
- $onload = qq|alert('$credittext')|;
- }
- $form->{"javascript"} .= qq||;
- $form->{javascript} .= qq||;
+ $form->{javascript} .= qq||;
+ $form->{javascript} .= qq||;
$jsscript .=
$form->write_trigger(\%myconfig, 2,
@@ -636,18 +622,29 @@ sub form_header {
+
|;
- if ($webdav) {
+ my $webdav_list;
+ if ($main::webdav) {
$webdav_list = qq|
|
@@ -965,11 +996,11 @@ sub form_footer {
Dateiname |
Webdavlink |
|;
- foreach $file (keys %{ $form->{WEBDAV} }) {
+ foreach my $file (@{ $form->{WEBDAV} }) {
$webdav_list .= qq|
- $file |
- $form->{WEBDAV}{$file} |
+ $file->{name} |
+ $file->{type} |
|;
}
@@ -1002,12 +1033,14 @@ if ($form->{type} eq "credit_note") {
|;
}
+ my @column_index;
if ($form->{currency} eq $form->{defaultcurrency}) {
@column_index = qw(datepaid source memo paid AR_paid);
} else {
@column_index = qw(datepaid source memo paid exchangerate AR_paid);
}
+ my %column_data;
$column_data{datepaid} = "" . $locale->text('Date') . " | ";
$column_data{paid} = "" . $locale->text('Amount') . " | ";
$column_data{exchangerate} = "" . $locale->text('Exch') . " | ";
@@ -1027,7 +1060,7 @@ if ($form->{type} eq "credit_note") {
my $totalpaid = 0;
$form->{paidaccounts}++ if ($form->{"paid_$form->{paidaccounts}"});
- for $i (1 .. $form->{paidaccounts}) {
+ for my $i (1 .. $form->{paidaccounts}) {
print "
\n";
@@ -1048,7 +1081,7 @@ if ($form->{type} eq "credit_note") {
if ($form->{"exchangerate_$i"} == 0) {
$form->{"exchangerate_$i"} = "";
}
- $exchangerate = qq| |;
+ my $exchangerate = qq| |;
if ($form->{currency} ne $form->{defaultcurrency}) {
if ($form->{"forex_$i"}) {
$exchangerate = qq|$form->{"exchangerate_$i"}|;
@@ -1115,11 +1148,11 @@ if ($form->{type} eq "credit_note") {
|;
- $invdate = $form->datetonum($form->{invdate}, \%myconfig);
- $closedto = $form->datetonum($form->{closedto}, \%myconfig);
+ my $invdate = $form->datetonum($form->{invdate}, \%myconfig);
+ my $closedto = $form->datetonum($form->{closedto}, \%myconfig);
if ($form->{id}) {
- my $show_storno = !$form->{storno} && !IS->has_storno(\%myconfig, $form, "ar");
+ my $show_storno = !$form->{storno} && !IS->has_storno(\%myconfig, $form, "ar") && (($totalpaid == 0) || ($totalpaid eq ""));
print qq|
|;
- if ($form->{id} && !($form->{type} eq "credit_note")) {
- print qq|
+ if ($form->{id} && !($form->{type} eq "credit_note")) {
+ print qq|
|;
- }
+ }
if ($form->{radier}) {
print qq|
|;
- }
+ }
if ($invdate > $closedto) {
@@ -1159,6 +1192,11 @@ if ($form->{type} eq "credit_note") {
|;
}
+ print qq|
+ |;
+
} else {
if ($invdate > $closedto) {
print qq| |;
}
# /button for saving history
-
- # mark_as_paid button
- if($form->{id} ne "") {
- print qq||;
}
# /mark_as_paid button
@@ -1202,9 +1240,9 @@ if ($form->{type} eq "credit_note") {
| .
$cgi->hidden("-name" => "callback", "-value" => $form->{callback})
. $cgi->hidden('-name' => 'draft_id', '-default' => [$form->{draft_id}])
-. $cgi->hidden('-name' => 'draft_description', '-default' => [$form->{draft_description}]);
-map({ print $cgi->hidden("-name" => $_ , "-value" => $form->{$_});} qw(login password));
-print qq|
+. $cgi->hidden('-name' => 'draft_description', '-default' => [$form->{draft_description}])
+. $cgi->hidden('-name' => 'customer_discount', '-value' => [$form->{customer_discount}])
+. qq|