X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fis.pl;h=459e1b9446ef40f03b7c6807360c497df5b9540a;hb=d25bd6ec1709f3c8ef07e1dab1f69469893ab6dc;hp=badf0655b9c4a24c869be0a935b5f0be3d77991d;hpb=85e36de2a319d0dbaa2e1572c16c9537d0d5f3ce;p=kivitendo-erp.git diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index badf0655b..459e1b944 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -37,6 +37,7 @@ use Data::Dumper; require "$form->{path}/io.pl"; require "$form->{path}/arap.pl"; +require "bin/mozilla/drafts.pl"; 1; @@ -44,7 +45,9 @@ require "$form->{path}/arap.pl"; sub add { $lxdebug->enter_sub(); - + + return $lxdebug->leave_sub() if (load_draft_maybe()); + if ($form->{type} eq "credit_note") { $form->{title} = $locale->text('Add Credit Note'); @@ -69,8 +72,6 @@ sub add { } &invoice_links; &prepare_invoice; - $form->{format} = "pdf"; - &display_form; $lxdebug->leave_sub(); @@ -79,7 +80,10 @@ sub add { sub edit { $lxdebug->enter_sub(); - + # show history button + $form->{javascript} = qq||; + #/show hhistory button + if ($myconfig{acs} =~ "AR--Add Sales Invoice" || $myconfig{acs} =~ "AR--AR") { $form->error("Access Denied"); @@ -117,6 +121,7 @@ sub invoice_links { if ($form->{all_customer}) { unless ($form->{customer_id}) { $form->{customer_id} = $form->{all_customer}->[0]->{id}; + $form->{salesman_id} = $form->{all_customer}->[0]->{salesman_id}; } } @@ -167,13 +172,13 @@ sub invoice_links { chomp $curr[0]; $form->{defaultcurrency} = $curr[0]; - map { $form->{selectcurrency} .= "\n" } @curr; $form->{oldcustomer} = "$form->{customer}--$form->{customer_id}"; if (@{ $form->{all_customer} }) { $form->{customer} = "$form->{customer}--$form->{customer_id}"; - map { $form->{selectcustomer} .= "\n" } (@{ $form->{all_customer} }); } @@ -184,7 +189,7 @@ sub invoice_links { map { $form->{selectdepartment} .= - "\n" } (@{ $form->{all_departments} }); } @@ -193,7 +198,7 @@ sub invoice_links { # sales staff if ($form->{all_employees}) { $form->{selectemployee} = ""; - map { $form->{selectemployee} .= "\n" } (@{ $form->{all_employees} }); } @@ -203,7 +208,8 @@ sub invoice_links { foreach $key (keys %{ $form->{AR_links} }) { foreach $ref (@{ $form->{AR_links}{$key} }) { - $form->{"select$key"} .= "\n"; } if ($key eq "AR_paid") { @@ -246,11 +252,9 @@ sub prepare_invoice { if ($form->{type} eq "credit_note") { $form->{type} = "credit_note"; $form->{formname} = "credit_note"; - $form->{media} = "screen"; } else { $form->{type} = "invoice"; $form->{formname} = "invoice"; - $form->{media} = "screen"; } if ($form->{id}) { @@ -335,58 +339,91 @@ sub form_header { foreach $item (@{ $form->{TAXZONE} }) { if ($item->{id} == $form->{taxzone_id}) { $form->{selecttaxzone} .= - ""; + ""; } else { $form->{selecttaxzone} .= - ""; + ""; } } } else { $form->{selecttaxzone} =~ s/ selected//g; if ($form->{taxzone_id} ne "") { - $form->{selecttaxzone} =~ s/value=$form->{taxzone_id}/value=$form->{taxzone_id} selected/; + $form->{selecttaxzone} =~ s/value=\"$form->{taxzone_id}\"/value=\"$form->{taxzone_id}\" selected/; } } - if ($form->{rowcount} >0) { - $form->{selecttaxzone} =~ /"; - foreach $item (@{ $form->{SHIPTO} }) { - if ($item->{shipto_id} == $form->{shipto_id}) { - $form->{selectshipto} .= - ""; - } else { - $form->{selectshipto} .= - ""; - } - - } - } else { - $form->{selectshipto} =~ s/ selected//g; - if ($form->{shipto_id} ne "") { - $form->{selectshipto} =~ s/value=$form->{shipto_id}/value=$form->{shipto_id} selected/; - } + 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"); + + 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})" : ""); + } + my $contact = + NTI($cgi->popup_menu('-name' => 'cp_id', '-values' => \@values, + '-labels' => \%labels, '-default' => $form->{"cp_id"})); + + %labels = (); + @values = (""); + foreach my $item (@{ $form->{"ALL_SHIPTO"} }) { + push(@values, $item->{"shipto_id"}); + $labels{$item->{"shipto_id"}} = + $item->{"shiptoname"} . " " . $item->{"shiptodepartment_1"}; } - $shipto = qq| + my $shipto = qq|
| . $locale->text('Max. Dunning Level') . qq|: | +| . $locale->text('Max. Dunning Level') . qq|: | $form->{max_dunning_level} | -| . $locale->text('Dunning Amount') . qq|: | +| . $locale->text('Dunning Amount') . qq|: | | . $form->format_amount(\%myconfig, $form->{dunning_amount},2) . qq| | @@ -517,11 +531,10 @@ sub form_header { # with JavaScript Calendar $button1 = qq| -{invdate}> | -text('button') . qq|> | - |; - ++ | |; + #write Trigger $jsscript = Form->write_trigger(\%myconfig, "1", @@ -531,28 +544,28 @@ sub form_header { # without JavaScript Calendar $button1 = - qq| | {invdate}> | |; + qq||; $button2 = - qq| | {duedate}> | |; + qq||; } } else { if ($form->{jsscript}) { # with JavaScript Calendar $button1 = qq| - | {invdate}> | -text('button') . qq|> | ++ | |; $button2 = qq| - | {duedate}> | -text('button') . qq|> | ++ | |; $button3 = qq| - | {deliverydate}> | -text('button') . qq|> | ++ | |; #write Trigger @@ -567,7 +580,7 @@ sub form_header { # without JavaScript Calendar $button1 = - qq| | {invdate}> | |; + qq||; $button2 = qq| | {duedate}> | |; } @@ -586,6 +599,15 @@ sub form_header { $onload = qq|alert('$credittext')|; } + $form->{"javascript"} .= qq||; + + $jsscript .= + $form->write_trigger(\%myconfig, 2, + "orddate", "BL", "trigger_orddate", + "quodate", "BL", "trigger_quodate"); + # show history button js + $form->{javascript} .= qq||; + #/show history button js $form->header; print qq| @@ -595,69 +617,45 @@ sub form_header { -
---|