X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/54e4131e091831e00a861fe2c4f53e344b87ddca..9f055edb25f912aa2cb3dfd8e8a4cf20703f75a2:/bin/mozilla/is.pl
diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl
index 879d3d1b3..52e668233 100644
--- a/bin/mozilla/is.pl
+++ b/bin/mozilla/is.pl
@@ -138,6 +138,11 @@ sub invoice_links {
$cp_id = $form->{cp_id};
IS->get_customer(\%myconfig, \%$form);
+
+ #quote all_customer Bug 133
+ foreach $ref (@{ $form->{all_customer} }) {
+ $ref->{name} = $form->quote($ref->{name});
+ }
if ($id) {
$form->{id} = $id;
}
@@ -158,7 +163,7 @@ sub invoice_links {
}
# currencies
- @curr = split /:/, $form->{currencies};
+ @curr = split(/:/, $form->{currencies});
chomp $curr[0];
$form->{defaultcurrency} = $curr[0];
@@ -166,7 +171,7 @@ sub invoice_links {
$form->{oldcustomer} = "$form->{customer}--$form->{customer_id}";
- if ($form->{all_customer}) {
+ if (@{ $form->{all_customer} }) {
$form->{customer} = "$form->{customer}--$form->{customer_id}";
map { $form->{selectcustomer} .= "|;
foreach $item (@{ $form->{payment_terms} }) {
if ($form->{payment_id} eq $item->{id}) {
@@ -351,12 +360,12 @@ sub form_header {
if (@{ $form->{SHIPTO} }) {
$form->{selectshipto} = "";
foreach $item (@{ $form->{SHIPTO} }) {
- if ($item->{id} == $form->{shipto_id}) {
+ if ($item->{shipto_id} == $form->{shipto_id}) {
$form->{selectshipto} .=
- "";
+ "";
} else {
$form->{selectshipto} .=
- "";
+ "";
}
}
@@ -369,7 +378,7 @@ sub form_header {
$shipto = qq|
| . $locale->text('Shipping Address') . qq| |
- |
+ |
|;
@@ -381,6 +390,9 @@ sub form_header {
s/option>\Q$form->{$item}\E/option selected>$form->{$item}/;
}
+ #quote customer Bug 133
+ $form->{selectcustomer} = $form->quote($form->{selectcustomer});
+
#build contacts
if ($form->{all_contacts}) {
@@ -652,7 +664,7 @@ sub form_header {
$dunning
| | . $locale->text('Record in') . qq| |
- |
+ |
$taxzone
@@ -1002,8 +1014,10 @@ if ($form->{type} eq "credit_note") {
# format amounts
$totalpaid += $form->{"paid_$i"};
- $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"});
@@ -1086,6 +1100,12 @@ if ($form->{type} eq "credit_note") {
. $locale->text('Credit Note') . qq|">
|;
}
+ if ($form->{radier}) {
+ print qq|
+
+|;
+ }
if ($invdate > $closedto) {
@@ -1190,8 +1210,6 @@ sub update {
} else {
- $form->{"selected_unit_$i"} = $form->{"unit_$i"};
-
IS->retrieve_item(\%myconfig, \%$form);
$rows = scalar @{ $form->{item_list} };
@@ -1209,7 +1227,7 @@ sub update {
} else {
- $sellprice = $form->format_amount(\%myconfig, $form->{"sellprice_$i"});
+ $sellprice = $form->parse_amount(\%myconfig, $form->{"sellprice_$i"});
map { $form->{item_list}[$i]{$_} =~ s/\"/"/g }
qw(partnumber description unit);
@@ -1326,6 +1344,7 @@ sub post_payment {
($form->{AR}) = split /--/, $form->{AR};
($form->{AR_paid}) = split /--/, $form->{AR_paid};
+ relink_accounts();
$form->redirect($locale->text(' Payment posted!'))
if (IS->post_payment(\%myconfig, \%$form));
$form->error($locale->text('Cannot post payment!'));
@@ -1360,7 +1379,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!'));
@@ -1392,6 +1411,7 @@ sub post {
$form->{invnumber} = $form->update_defaults(\%myconfig, "invnumber");
}
}
+ relink_accounts();
if ($print_post) {
if (!(IS->post_invoice(\%myconfig, \%$form))) {
$form->error($locale->text('Cannot post invoice!'));