X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fir.pl;h=11bb82c4b83bf2112c1bb2b883e516caa7e02008;hb=036fe04d0f9d0ccfc7ef563530d3c118986ef0ca;hp=f7f8cdf875f8cdc74be089bf74dd7450a888263c;hpb=972f67f3fe4d62126a9a5958918175b5f0b08ee6;p=kivitendo-erp.git
diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl
index f7f8cdf87..11bb82c4b 100644
--- a/bin/mozilla/ir.pl
+++ b/bin/mozilla/ir.pl
@@ -36,6 +36,7 @@ use SL::PE;
require "$form->{path}/io.pl";
require "$form->{path}/arap.pl";
+require "$form->{path}/common.pl";
1;
@@ -55,7 +56,11 @@ sub add {
sub edit {
$lxdebug->enter_sub();
-
+
+ # show history button
+ $form->{javascript} = qq||;
+ #/show hhistory button
+
$form->{title} = $locale->text('Edit Vendor Invoice');
&invoice_links;
@@ -86,14 +91,33 @@ sub invoice_links {
$form->{vendor_id} = $form->{all_vendor}->[0]->{id};
}
}
+ if ($form->{payment_id}) {
+ $payment_id = $form->{payment_id};
+ }
+ if ($form->{language_id}) {
+ $language_id = $form->{language_id};
+ }
+ if ($form->{taxzone_id}) {
+ $taxzone_id = $form->{taxzone_id};
+ }
$cp_id = $form->{cp_id};
IR->get_vendor(\%myconfig, \%$form);
IR->retrieve_invoice(\%myconfig, \%$form);
$form->{cp_id} = $cp_id;
+
+ if ($payment_id) {
+ $form->{payment_id} = $payment_id;
+ }
+ if ($language_id) {
+ $form->{language_id} = $language_id;
+ }
+ if ($taxzone_id) {
+ $form->{taxzone_id} = $taxzone_id;
+ }
# currencies
- @curr = split /:/, $form->{currencies};
+ @curr = split(/:/, $form->{currencies});
chomp $curr[0];
$form->{defaultcurrency} = $curr[0];
@@ -102,7 +126,7 @@ sub invoice_links {
$form->{oldvendor} = "$form->{vendor}--$form->{vendor_id}";
# vendors
- if ($form->{all_vendor}) {
+ if (@{ $form->{all_vendor} }) {
$form->{vendor} = "$form->{vendor}--$form->{vendor_id}";
map { $form->{selectvendor} .= "";
+ } 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/;
+ }
+ }
+
+ $taxzone = qq|
+
+ | . $locale->text('Steuersatz') . qq| |
+ |
+
+
|;
+
+
+
$vendor =
($form->{selectvendor})
? qq|\n|
: qq||;
- $contact =
- ($form->{selectcontact})
- ? qq|\n|
- : qq||;
-
$department = qq|
| . $locale->text('Department') . qq| |
@@ -301,6 +369,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|
@@ -321,7 +396,8 @@ sub form_header {
{locked}>
{shipped}>
-
+{storno}>
+{storno_id}>
+
+ | . $locale->text('Order Date') . qq| |
+ |
+ |
+
+
+ | . $locale->text('Quotation Date') . qq| |
+ |
+ |
+
+
+ | . $locale->text('Project Number') . qq| |
+ $globalprojectnumber |
+
+
@@ -462,7 +553,8 @@ sub form_footer {
$tax .= qq|
- $form->{"${item}_description"} |
+ $form->{"${item}_description"} |
+ . $form->{"${item}_rate"} * 100 .qq|% |
$form->{"${item}_total"} |
|;
@@ -503,7 +595,8 @@ sub form_footer {
$tax .= qq|
- Enthaltene $form->{"${item}_description"} |
+ Enthaltene $form->{"${item}_description"} |
+ . $form->{"${item}_rate"} * 100 .qq|% |
$form->{"${item}_total"} |
@@ -614,6 +707,7 @@ sub form_footer {
|;
+ my @triggers = ();
$form->{paidaccounts}++ if ($form->{"paid_$form->{paidaccounts}"});
for $i (1 .. $form->{paidaccounts}) {
@@ -626,8 +720,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"});
@@ -651,7 +747,8 @@ sub form_footer {
$column_data{"AP_paid_$i"} =
qq| | |;
$column_data{"datepaid_$i"} =
- qq|{"datepaid_$i"}> | |;
+ qq|{"datepaid_$i"}>
+ | |;
$column_data{"source_$i"} =
qq|{"source_$i"}> | |;
$column_data{"memo_$i"} =
@@ -662,6 +759,7 @@ sub form_footer {
print qq|
|;
+ push(@triggers, "datepaid_$i", "BL", "trigger_datepaid_$i");
}
print qq|
@@ -683,44 +781,33 @@ sub form_footer {
if ($form->{id}) {
print qq|
+ . $locale->text('Post Payment') . qq|">
|;
-
- if (!$form->{revtrans}) {
- if (!$form->{locked}) {
- print qq|
-
-
+ print qq|
+| unless ($form->{storno});
+ if ($form->{radier}) {
+ print qq|
+
|;
- }
- }
-
- if ($invdate > $closedto) {
- print qq|
-
-
+ }
+ print qq|
|;
- }
- } else {
- if ($invdate > $closedto) {
- 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}>
@@ -729,8 +816,19 @@ sub form_footer {
{path}>
{login}>
{password}>
+|;
+ # button for saving history
+ if($form->{id} ne "") {
+ print qq|
+ |;
+ }
+ # /button for saving history
-
+print qq|