X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fis.pl;h=b8eb074796eafdd9a55e86e03cc6c79e01fd42a9;hb=c90ba6c8ad4b35f2b7cd3159165aab5f29b4e3d2;hp=f02e066ddc65eecdd8b134499bc287d2ae4da4fb;hpb=47916a374217afc8d84bd147f0fada5086970bae;p=kivitendo-erp.git diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index f02e066dd..b8eb07479 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -83,7 +83,7 @@ sub 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"); @@ -288,13 +288,13 @@ sub form_header { if ($form->{type} eq "credit_note") { $form->{title} = $locale->text('Edit Credit Note'); - + if ($form->{storno}) { $form->{title} = $locale->text('Edit Storno Credit Note'); } } else { $form->{title} = $locale->text('Edit Sales Invoice'); - + if ($form->{storno}) { $form->{title} = $locale->text('Edit Storno Invoice'); } @@ -346,7 +346,7 @@ sub form_header { | . $locale->text('Contact Person') . qq| | . - NTI($cgi->popup_menu('-name' => 'cp_id', '-values' => \@values, + NTI($cgi->popup_menu('-name' => 'cp_id', '-values' => \@values, '-style' => 'width: 250px', '-labels' => \%labels, '-default' => $form->{"cp_id"})) . qq| @@ -357,14 +357,14 @@ sub form_header { @values = (); foreach my $item (@{ $form->{"ALL_SALESMEN"} }) { push(@values, $item->{"id"}); - $labels{$item->{"id"}} = $item->{"name"}; + $labels{$item->{id}} = $item->{name} ne "" ? $item->{name} : $item->{login}; } my $employees = qq| | . $locale->text('Employee') . qq| | . - NTI($cgi->popup_menu('-name' => 'employee', '-default' => $form->{"employee_id"}, + NTI($cgi->popup_menu('-name' => 'employee_id', '-default' => $form->{"employee_id"}, '-values' => \@values, '-labels' => \%labels)) . qq| |; @@ -374,25 +374,25 @@ sub form_header { @values = (); foreach my $item (@{ $form->{"ALL_CUSTOMERS"} }) { push(@values, $item->{name}.qq|--|.$item->{"id"}); - $labels{$item->{"id"}} = $item->{name}.qq|--|.$item->{"id"}; + $labels{$item->{name}.qq|--|.$item->{"id"}} = $item->{"name"}; } my $customers = qq| | . $locale->text('Customer') . qq| - | . - (($myconfig{vclimit} <= scalar(@values)) - ? qq|| - : (NTI($cgi->popup_menu('-name' => 'customer', '-default' => $form->{oldcustomer}, + | . + (($myconfig{vclimit} <= scalar(@values)) + ? qq|| + : (NTI($cgi->popup_menu('-name' => 'customer', '-default' => $form->{oldcustomer}, '-onChange' => 'document.getElementById(\'update_button\').click();', - '-values' => \@values, '-labels' => \%labels)))) . qq| + '-values' => \@values, '-labels' => \%labels, '-style' => 'width: 250px')))) . qq| + |; - + %labels = (); @values = (""); foreach my $item (@{ $form->{"ALL_SHIPTO"} }) { push(@values, $item->{"shipto_id"}); - $labels{$item->{"shipto_id"}} = - $item->{"shiptoname"} . " " . $item->{"shiptodepartment_1"}; + $labels{$item->{"shipto_id"}} = join "; ", grep { $_ } map { $item->{"shipto${_}" } } qw(name department_1 street city); } my $shipto; @@ -401,7 +401,7 @@ sub form_header { | . $locale->text('Shipping Address') . qq| | . - NTI($cgi->popup_menu('-name' => 'shipto_id', '-values' => \@values, + NTI($cgi->popup_menu('-name' => 'shipto_id', '-values' => \@values, '-style' => 'width: 250px', '-labels' => \%labels, '-default' => $form->{"shipto_id"})) . qq||; } @@ -412,7 +412,7 @@ sub form_header { push(@values, $item); $labels{$item} = $item; } - + $form->{currency} = $form->{defaultcurrency} unless $form->{currency}; my $currencies; if (scalar @values) { @@ -438,7 +438,7 @@ sub form_header { '-default' => $form->{"globalproject_id"})); %labels = (); - @values = (""); + @values = (); foreach my $item (@{ $form->{ALL_SALESMEN} }) { push(@values, $item->{id}); $labels{$item->{id}} = $item->{name} ne "" ? $item->{name} : $item->{login}; @@ -448,8 +448,8 @@ sub form_header { qq| | . $locale->text('Salesman') . qq| | . - NTI($cgi->popup_menu('-name' => 'salesman_id', '-default' => $form->{salesman_id}, - '-values' => \@values, '-labels' => \%labels)) + NTI($cgi->popup_menu('-name' => 'salesman_id', '-default' => $form->{salesman_id} ? $form->{salesman_id} : $form->{employee_id}, + '-values' => \@values, '-labels' => \%labels)) . qq| |; @@ -466,7 +466,7 @@ sub form_header { | . $locale->text('Steuersatz') . qq| | . NTI($cgi->popup_menu('-name' => 'taxzone_id', '-default' => $form->{"taxzone_id"}, - '-values' => \@values, '-labels' => \%labels)) . qq| + '-values' => \@values, '-labels' => \%labels, '-style' => 'width: 250px',)) . qq| |; @@ -493,7 +493,7 @@ sub form_header { #substitute \n and \r to \s (bug 543) $form->{selectcustomer} =~ s/[\n\r]/ /g; - + if (($form->{creditlimit} != 0) && ($form->{creditremaining} < 0) && !$form->{update}) { $creditwarning = 1; } else { @@ -529,7 +529,7 @@ sub form_header { $department = qq| | . $locale->text('Department') . qq| - + @@ -540,13 +540,11 @@ sub form_header { if ($form->{business}) { $business = qq| - | . $locale->text('Business') . qq| - $form->{business} - | . $locale->text('Trade Discount') . qq| - | + | . $locale->text('Customer type') . qq| + $form->{business}; | . $locale->text('Trade Discount') . qq| | . $form->format_amount(\%myconfig, $form->{tradediscount} * 100) . qq| % - + |; } @@ -567,67 +565,46 @@ sub form_header { $form->{fokus} = "invoice.customer"; # use JavaScript Calendar or not - $form->{jsscript} = $jscalendar; + $form->{jsscript} = 1; $jsscript = ""; if ($form->{type} eq "credit_note") { - if ($form->{jsscript}) { - - # with JavaScript Calendar - $button1 = qq| - - |; - - #write Trigger - $jsscript = - Form->write_trigger(\%myconfig, "1", - "invdate", "BL", - "trigger1"); - } else { - - # without JavaScript Calendar - $button1 = - qq||; - $button2 = - qq||; - } + $button1 = qq| + + |; + + #write Trigger + $jsscript = + Form->write_trigger(\%myconfig, "1", + "invdate", "BL", + "trigger1"); } else { - if ($form->{jsscript}) { - - # with JavaScript Calendar - $button1 = qq| - - - |; - $button2 = qq| - - + $button1 = qq| + + |; - $button3 = qq| - - - |; - - #write Trigger - $jsscript = - Form->write_trigger(\%myconfig, "3", - "invdate", "BL", - "trigger1", "duedate", - "BL", "trigger2", - "deliverydate", "BL", - "trigger3"); - } else { - - # without JavaScript Calendar - $button1 = - qq||; - $button2 = - qq|{duedate} onBlur=\"check_right_date_format(this)\">|; - } + $button2 = qq| + + + |; + $button3 = qq| + + + |; + + #write Trigger + $jsscript = + Form->write_trigger(\%myconfig, "3", + "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()|; @@ -644,6 +621,7 @@ sub form_header { } $form->{"javascript"} .= qq||; + $form->{javascript} .= qq||; $jsscript .= $form->write_trigger(\%myconfig, 2, @@ -663,11 +641,13 @@ sub form_header {
| ; -map({print $cgi->hidden("-name" => $_ , "-value" => $form->{$_});} - qw(id action type media format queued printed emailed title vc discount - creditlimit creditremaining tradediscount business closedto locked shipped storno storno_id)) ; -print ($form->{saved_message} ? qq|

$form->{saved_message}

| : "") ; -print qq| + + $form->hide_form(qw(id action type media format queued printed emailed title vc discount + creditlimit creditremaining tradediscount business closedto locked shipped storno storno_id + max_dunning_level dunning_amount)); + print qq|

$form->{saved_message}

| if $form->{saved_message}; + + print qq| @@ -694,7 +674,7 @@ print qq| $business | . $locale->text('Record in') . qq| - + $taxzone @@ -808,20 +788,20 @@ print qq| -| . +| . $jsscript . qq| | ; -map({ print($cgi->hidden("-name" => $_, "-value" => $form->{$_})); } +map({ print($cgi->hidden("-name" => $_, "-value" => $form->{$_})); } qw(shiptoname shiptostreet shiptozipcode shiptocity shiptocountry shiptocontact shiptophone shiptofax shiptoemail shiptodepartment_1 shiptodepartment_2)); print qq| |; -map({ print($cgi->hidden("-name" => $_, "-value" => $form->{$_})); } +map({ print($cgi->hidden("-name" => $_, "-value" => $form->{$_})); } qw(message email subject cc bcc taxaccounts)); print qq||; foreach $item (split(/ /, $form->{taxaccounts})) { - map({ print($cgi->hidden("-name" => $_, "-value" => $form->{$_})); } + map({ print($cgi->hidden("-name" => $_, "-value" => $form->{$_})); } ("${item}_rate", "${item}_description", "${item}_taxnumber")); } $lxdebug->leave_sub(); @@ -843,7 +823,7 @@ sub form_footer { qq||; $intnotes = qq||; - + $form->{taxincluded} = ($form->{taxincluded} ? "checked" : ""); $taxincluded = ""; @@ -1082,7 +1062,7 @@ if ($form->{type} eq "credit_note") { push(@triggers, "datepaid_$i", "BL", "trigger_datepaid_$i"); } - map({ print($cgi->hidden("-name" => $_, "-value" => $form->{$_})); } qw(paidaccounts selectAR_paid oldinvtotal)); + map({ print($cgi->hidden("-name" => $_, "-value" => $form->{$_})); } qw(paidaccounts selectAR_paid oldinvtotal)); print qq| @@ -1182,7 +1162,7 @@ if ($form->{type} eq "credit_note") { | . -$cgi->hidden("-name" => "callback", "-value" => $form->{callback}) +$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)); @@ -1206,7 +1186,7 @@ sub update { $form->{print_and_post} = 0; } - + if($form->{taxincluded}) { $taxincluded = "checked"; } @@ -1393,7 +1373,7 @@ sub post_payment { ($form->{AR}) = split /--/, $form->{AR}; ($form->{AR_paid}) = split /--/, $form->{AR_paid}; relink_accounts(); - $form->redirect($locale->text(' Payment posted!')) + $form->redirect($locale->text('Payment posted!')) if (IS->post_payment(\%myconfig, \%$form)); $form->error($locale->text('Cannot post payment!')); @@ -1475,7 +1455,7 @@ sub post { "POSTED"; $form->save_history($form->dbconnect(\%myconfig)); } - + $form->redirect( $form->{label} . " $form->{invnumber} " . $locale->text('posted!')) unless $print_post; @@ -1607,7 +1587,7 @@ sub credit_note { $form->{script} = 'is.pl'; $script = "is"; $buysell = 'buy'; - + # bo creates the id, reset it map { delete $form->{$_} } @@ -1650,12 +1630,12 @@ sub yes { if (IS->delete_invoice(\%myconfig, \%$form, $spool)) { # saving the history if(!exists $form->{addition}) { - $form->{snumbers} = qq|invnumber_| . $form->{invnumber}; + $form->{snumbers} = qq|invnumber_| . $form->{invnumber}; $form->{addition} = "DELETED"; $form->save_history($form->dbconnect(\%myconfig)); } - # /saving the history - $form->redirect($locale->text('Invoice deleted!')); + # /saving the history + $form->redirect($locale->text('Invoice deleted!')); } $form->error($locale->text('Cannot delete invoice!'));