X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=bin%2Fmozilla%2Fir.pl;h=701c91bb4e45ba6d53640eb17c4b2dc9e4e0a973;hb=d6bf475aee947e7451eb9b797ed0ad5ab5bcf6f8;hp=55a80faa2f64229554d84290ad2a9d895e1cfb1d;hpb=d5c1e4fa391f26fc0acd568729a98493edf319d8;p=kivitendo-erp.git diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index 55a80faa2..701c91bb4 100644 --- a/bin/mozilla/ir.pl +++ b/bin/mozilla/ir.pl @@ -122,13 +122,6 @@ sub invoice_links { $form->{oldvendor} = "$form->{vendor}--$form->{vendor_id}"; - # vendors - if (@{ $form->{all_vendor} }) { - $form->{vendor} = "$form->{vendor}--$form->{vendor_id}"; - map { $form->{selectvendor} .= "$_->{name}--$_->{id}\n" } - (@{ $form->{all_vendor} }); - } - # departments if ($form->{all_departments}) { $form->{selectdepartment} = "\n"; @@ -227,15 +220,16 @@ sub form_header { s/option>\Q$form->{$item}\E/option selected>$form->{$item}/; } + if ($form->{old_employee_id}) { + $form->{employee_id} = $form->{old_employee_id}; + } + if ($form->{old_salesman_id}) { + $form->{salesman_id} = $form->{old_salesman_id}; + } + $form->{radier} = ($form->current_date(\%myconfig) eq $form->{gldate}) ? 1 : 0; - #quote selectvendor Bug 133 - $form->{"selectvendor"} = $form->quote($form->{"selectvendor"}); - - #substitute \n and \r to \s (bug 543) - $form->{"selectvendor"} =~ s/[\n\r]/ /g; - $form->{exchangerate} = $form->format_amount(\%myconfig, $form->{exchangerate}); @@ -353,12 +347,17 @@ sub form_header { push(@values, $item->{name}.qq|--|.$item->{"id"}); $labels{$item->{name}.qq|--|.$item->{"id"}} = $item->{"name"}; } + + $form->{selectvendor} = ($myconfig{vclimit} > scalar(@values)); + my $vendors = qq| | . $locale->text('Vendor') . qq| | . - NTI($cgi->popup_menu('-name' => 'vendor', '-default' => $form->{"vendor"}, + (($myconfig{vclimit} <= scalar(@values)) + ? qq|| + : (NTI($cgi->popup_menu('-name' => 'vendor', '-default' => $form->{oldvendor}, '-onChange' => 'document.getElementById(\'update_button\').click();', - '-values' => \@values, '-labels' => \%labels, '-style' => 'width: 250px')) . qq| + '-values' => \@values, '-labels' => \%labels, '-style' => 'width: 250px')))) . qq| |; @@ -457,7 +456,7 @@ sub form_header { $vendors - + $contact | . $locale->text('Credit Limit') . qq| @@ -730,7 +729,9 @@ sub form_footer { |; - my @triggers = (); + my @triggers = (); + my $totalpaid = 0; + $form->{paidaccounts}++ if ($form->{"paid_$form->{paidaccounts}"}); for $i (1 .. $form->{paidaccounts}) { @@ -742,6 +743,8 @@ sub form_footer { $form->{"selectAP_paid_$i"} =~ s/option>\Q$form->{"AP_paid_$i"}\E/option selected>$form->{"AP_paid_$i"}/; + $totalpaid += $form->{"paid_$i"}; + # format amounts if ($form->{"paid_$i"}) { $form->{"paid_$i"} = @@ -785,7 +788,22 @@ sub form_footer { push(@triggers, "datepaid_$i", "BL", "trigger_datepaid_$i"); } + my $paid_missing = $form->{oldinvtotal} - $totalpaid; + print qq| + + + + | . $locale->text('Total') . qq| + | . H($form->format_amount(\%myconfig, $totalpaid, 2)) . qq| + + + + + | . $locale->text('Missing amount') . qq| + | . H($form->format_amount(\%myconfig, $paid_missing, 2)) . qq| + + {oldinvtotal}> {paidaccounts}> @@ -847,7 +865,12 @@ sub form_footer { . qq|">|; } # /button for saving history - + # mark_as_paid button + if($form->{id} ne "") { + print qq||; + } + # /mark_as_paid button print qq|