X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fis.pl;h=b5479473ccdf23912772a2accc070c6e2802532e;hb=f2c923a10719d3a9e26448b7d83f38051466bf2c;hp=7d79ba9f2bd5529583c11ef9e3d11f66b394bedb;hpb=0bb0eb67db98f28ec8faf8dfe8c233268332f842;p=kivitendo-erp.git diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 7d79ba9f2..b5479473c 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -57,9 +57,10 @@ sub add { { $form->error("Access Denied"); } - &invoice_links; &prepare_invoice; + $form->{format} = "pdf"; + &display_form; $lxdebug->leave_sub(); @@ -74,7 +75,10 @@ sub edit { { $form->error("Access Denied"); } - + if ($form->{print_and_post}) { + $form->{action} = "print"; + $form->{resubmit} = 1; + } &invoice_links; &prepare_invoice; &display_form; @@ -187,7 +191,6 @@ sub prepare_invoice { $form->{type} = "invoice"; $form->{formname} = "invoice"; - $form->{format} = "html"; $form->{media} = "screen"; if ($form->{id}) { @@ -331,11 +334,20 @@ sub form_header { text('button') . qq|> |; + $button3 = qq| + {deliverydate}> + text('button') . qq|> + |; #write Trigger $jsscript = - Form->write_trigger(\%myconfig, "2", "invdate", "BL", "trigger1", - "duedate", "BL", "trigger2"); + Form->write_trigger(\%myconfig, "3", + "invdate", "BL", + "trigger1", "duedate", + "BL", "trigger2", + "deliverydate", "BL", + "trigger3"); } else { # without JavaScript Calendar @@ -344,8 +356,11 @@ sub form_header { $button2 = qq|{duedate}>|; } - if ($form->{resubmit}) { - $onload = "document.invoice.submit()"; + 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 = "fokus()"; } @@ -465,6 +480,10 @@ sub form_header { | . $locale->text('Due Date') . qq| $button2 + + | . $locale->text('Delivery Date') . qq| + $button3 + | . $locale->text('Order Number') . qq| @@ -763,8 +782,6 @@ sub form_footer { {oldinvtotal}> -{print_and_post}> -{second_run}> @@ -1044,7 +1061,7 @@ sub post { if ($form->{currency} ne $form->{defaultcurrency}); for $i (1 .. $form->{paidaccounts}) { - if ($form->{"paid_$i"}) { + if ($form->parse_amount(\%myconfig, $form->{"paid_$i"})) { $datepaid = $form->datetonum($form->{"datepaid_$i"}, \%myconfig); $form->isblank("datepaid_$i", $locale->text('Payment date missing!')); @@ -1068,8 +1085,10 @@ sub post { $form->{id} = 0 if $form->{postasnew}; - $form->{invnumber} = $form->update_defaults(\%myconfig, "invnumber") - unless $form->{invnumber}; + # get new invnumber in sequence if no invnumber is given or if posasnew was requested + if (!$form->{invnumber} || $form->{postasnew}) { + $form->{invnumber} = $form->update_defaults(\%myconfig, "invnumber"); + } if ($print_post) { if (!(IS->post_invoice(\%myconfig, \%$form))) { $form->error($locale->text('Cannot post invoice!')); @@ -1092,7 +1111,7 @@ sub print_and_post { $form->{print_and_post} = 1; &post(); - &display_form(); + &edit(); $lxdebug->leave_sub(); }