X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fir.pl;h=3736fbe2cb09f792dc248143d96bd241819ac019;hb=11e6f144c6af375d7b061bde6484266884d6f636;hp=401f56af98418111cc9acaa0afc1296a42e8f6e2;hpb=04a2f2e779fabb1faa836937504d4ce8bf906a06;p=kivitendo-erp.git diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index 401f56af9..3736fbe2c 100644 --- a/bin/mozilla/ir.pl +++ b/bin/mozilla/ir.pl @@ -279,10 +279,11 @@ sub form_header { foreach $item (@{ $form->{TAXZONE} }) { if ($item->{id} == $form->{taxzone_id}) { $form->{selecttaxzone} .= - "{id} selected>$item->{description}"; + "{id} selected>" . H($item->{description}) . + ""; } else { $form->{selecttaxzone} .= - "{id}>$item->{description}"; + "{id}>" . H($item->{description}) . ""; } } @@ -292,11 +293,6 @@ sub form_header { $form->{selecttaxzone} =~ s/value=$form->{taxzone_id}/value=$form->{taxzone_id} selected/; } } - if ($form->{rowcount} >1) { - $form->{selecttaxzone} =~ /.*?<\/option>/; - $form->{selecttaxzone} = $&; - } - $taxzone = qq| @@ -358,6 +354,13 @@ sub form_header { qq|{duedate}>|; } + $form->{"javascript"} .= qq||; + + $jsscript .= + $form->write_trigger(\%myconfig, 2, + "orddate", "BL", "trigger_orddate", + "quodate", "BL", "trigger_quodate"); + $form->header; print qq| @@ -450,6 +453,16 @@ sub form_header { + + | . $locale->text('Order Date') . qq| + + + + + | . $locale->text('Quotation Date') . qq| + + + @@ -673,6 +686,7 @@ sub form_footer { |; + my @triggers = (); $form->{paidaccounts}++ if ($form->{"paid_$form->{paidaccounts}"}); for $i (1 .. $form->{paidaccounts}) { @@ -685,8 +699,10 @@ sub form_footer { s/option>\Q$form->{"AP_paid_$i"}\E/option selected>$form->{"AP_paid_$i"}/; # format amounts - $form->{"paid_$i"} = - $form->format_amount(\%myconfig, $form->{"paid_$i"}, 2); + if ($form->{"paid_$i"}) { + $form->{"paid_$i"} = + $form->format_amount(\%myconfig, $form->{"paid_$i"}, 2); + } $form->{"exchangerate_$i"} = $form->format_amount(\%myconfig, $form->{"exchangerate_$i"}); @@ -710,7 +726,8 @@ sub form_footer { $column_data{"AP_paid_$i"} = qq|$form->{"selectAP_paid_$i"}|; $column_data{"datepaid_$i"} = - qq|{"datepaid_$i"}>|; + qq|{"datepaid_$i"}> + |; $column_data{"source_$i"} = qq|{"source_$i"}>|; $column_data{"memo_$i"} = @@ -721,6 +738,7 @@ sub form_footer { print qq| |; + push(@triggers, "datepaid_$i", "BL", "trigger_datepaid_$i"); } print qq| @@ -753,21 +771,22 @@ sub form_footer { . $locale->text('Delete') . qq|"> |; } - } else { - if ($invdate > $closedto) { - print qq| - |; - } + print qq| +|; + } - if ($form->{menubar}) { - require "$form->{path}/menu.pl"; - &menubar; + print qq||; + + if (!$form->{id} && ($invdate > $closedto)) { + print qq| |; } - print qq| + print $form->write_trigger(\%myconfig, scalar(@triggers) / 3, @triggers) . + qq| {rowcount}> @@ -917,17 +936,28 @@ sub storno { $form->{storno} = 1; $form->{id} = ""; $form->{invnumber} = "Storno zu " . $form->{invnumber}; - $form->{rowcount}--; &post(); $lxdebug->leave_sub(); } +sub use_as_template { + $lxdebug->enter_sub(); + + map { delete $form->{$_} } qw(printed emailed queued invnumber invdate deliverydate id datepaid_1 source_1 memo_1 paid_1 exchangerate_1 AP_paid_1 storno); + $form->{paidaccounts} = 1; + $form->{rowcount}--; + $form->{invdate} = $form->current_date(\%myconfig); + &display_form; + + $lxdebug->leave_sub(); +} + sub post_payment { $lxdebug->enter_sub(); for $i (1 .. $form->{paidaccounts}) { - if ($form->parse_amount(\%myconfig, $form->{"paid_$i"})) { + if ($form->{"paid_$i"}) { $datepaid = $form->datetonum($form->{"datepaid_$i"}, \%myconfig); $form->isblank("datepaid_$i", $locale->text('Payment date missing!')); @@ -1000,10 +1030,6 @@ sub post { $form->{id} = 0 if $form->{postasnew}; - # 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"); - } relink_accounts(); $form->redirect( $locale->text('Invoice')