X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=bin%2Fmozilla%2Fis.pl;h=9bc225e884bb596231ed4b64ad7441710820be02;hb=7f8cada2276e50879226ea553006ca7c714fac6a;hp=b632b389fdd77e4b2267586759120ca85cca060b;hpb=7a7f33b5c1b3531ab761adba1cf19d4ad68cffcd;p=kivitendo-erp.git
diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl
index b632b389f..9bc225e88 100644
--- a/bin/mozilla/is.pl
+++ b/bin/mozilla/is.pl
@@ -69,10 +69,6 @@ sub add {
$form{jsscript} = "date";
- if ($myconfig{acs} =~ "AR--Add Sales Invoice" || $myconfig{acs} =~ "AR--AR")
- {
- $form->error("Access Denied");
- }
&invoice_links;
&prepare_invoice;
&display_form;
@@ -89,10 +85,6 @@ sub edit {
$form->{javascript} = qq||;
#/show hhistory button
- if ($myconfig{acs} =~ "AR--Add Sales Invoice" || $myconfig{acs} =~ "AR--AR")
- {
- $form->error("Access Denied");
- }
$edit = 1;
if ($form->{print_and_post}) {
$form->{action} = "print";
@@ -248,8 +240,6 @@ sub prepare_invoice {
if ($form->{id}) {
- map { $form->{$_} =~ s/\"/"/g }
- qw(invnumber ordnumber quonumber shippingpoint shipvia notes intnotes);
# # get pricegroups for parts
# IS->get_pricegroups_for_parts(\%myconfig, \%$form);
@@ -276,8 +266,6 @@ sub prepare_invoice {
$form->{"qty_$i"} =
$form->format_amount(\%myconfig, $form->{"qty_$i"}, $dec_qty);
- map { $form->{"${_}_$i"} =~ s/\"/"/g }
- qw(partnumber description unit partnotes);
$form->{rowcount} = $i;
}
@@ -337,7 +325,7 @@ sub form_header {
my @values = (undef);
foreach my $item (@{ $form->{"ALL_CONTACTS"} }) {
push(@values, $item->{"cp_id"});
- $labels{$item->{"cp_id"}} = $item->{"cp_name"} . ($item->{"cp_abteilung"} ? " ($item->{cp_abteilung})" : "");
+ $labels{$item->{"cp_id"}} = join(',', $item->{"cp_name"}, $item->{"cp_givenname"}) . ($item->{"cp_abteilung"} ? " ($item->{cp_abteilung})" : "");
}
my $contact;
if (scalar @values > 1) {
@@ -383,7 +371,7 @@ sub form_header {
: (NTI($cgi->popup_menu('-name' => 'customer', '-default' => $form->{oldcustomer},
'-onChange' => 'document.getElementById(\'update_button\').click();',
'-values' => \@values, '-labels' => \%labels, '-style' => 'width: 250px')))) . qq|
-
+
|;
%labels = ();
@@ -540,8 +528,8 @@ sub form_header {
$jsscript = "";
if ($form->{type} eq "credit_note") {
$button1 = qq|
-
-
+ |;
#write Trigger
@@ -551,18 +539,18 @@ sub form_header {
"trigger1");
} else {
$button1 = qq|
-
-
+
|;
$button2 = qq|
-
|;
$button3 = qq|
-
|;
@@ -577,7 +565,7 @@ sub form_header {
$credittext = $locale->text('Credit Limit exceeded!!!');
my $follow_up_vc = $form->{customer};
- $follow_up_vc =~ s/--.*?//;
+ $follow_up_vc =~ s/--\d*\s*$//;
my $follow_up_trans_info = "$form->{invnumber} ($follow_up_vc)";
$onload = ($form->{resubmit} && ($form->{format} eq "html")) ? qq|window.open('about:blank','Beleg'); document.invoice.target = 'Beleg';document.invoice.submit()|
@@ -614,7 +602,8 @@ sub form_header {
creditlimit creditremaining tradediscount business closedto locked shipped storno storno_id
max_dunning_level dunning_amount
shiptoname shiptostreet shiptozipcode shiptocity shiptocountry shiptocontact shiptophone shiptofax
- shiptoemail shiptodepartment_1 shiptodepartment_2 message email subject cc bcc taxaccounts),
+ shiptoemail shiptodepartment_1 shiptodepartment_2 message email subject cc bcc taxaccounts cursor_fokus
+ convert_from_do_ids convert_from_oe_ids),
map { $_.'_rate', $_.'_description', $_.'_taxnumber' } split / /, $form->{taxaccounts} );
print qq|$form->{saved_message}
| if $form->{saved_message};
@@ -636,10 +625,10 @@ sub form_header {
$employees
$salesman
|;
+
+#ergänzung in der maske um das feld Lieferscheinnummer (Delivery Order Number), meiner meinung nach sinnvoll ueber dem feld lieferscheindatum 12.02.2009 jb
if ($form->{type} eq "credit_note") {
print qq|
| . $locale->text('Credit Note Number') . qq|
-
+ |.
+ $cgi->textfield("-name" => "invnumber", "-size" => 11, "-value" => $form->{invnumber}) .
+ qq|
| . $locale->text('Credit Note Date') . qq|
@@ -714,7 +710,9 @@ print qq|
} else {
print qq|
| . $locale->text('Invoice Number') . qq|
-
+ |.
+ $cgi->textfield("-name" => "invnumber", "-size" => 11, "-value" => $form->{invnumber}) .
+ qq|
| . $locale->text('Invoice Date') . qq|
@@ -724,6 +722,12 @@ print qq|
| . $locale->text('Due Date') . qq|
$button2
+
+ | . $locale->text('Delivery Order Number') . qq|
+ |.
+ $cgi->textfield("-name" => "donumber", "-size" => 11, "-value" => $form->{donumber}) .
+ qq|
+
| . $locale->text('Delivery Date') . qq|
$button3
@@ -731,7 +735,9 @@ print qq|
}
print qq|
| . $locale->text('Order Number') . qq|
-
+ |.
+ $cgi->textfield("-name" => "ordnumber", "-size" => 11, "-value" => $form->{ordnumber}) .
+ qq|
| . $locale->text('Order Date') . qq|
@@ -740,7 +746,9 @@ print qq|
| . $locale->text('Quotation Number') . qq|
-
+ |.
+ $cgi->textfield("-name" => "quonumber", "-size" => 11, "-value" => $form->{quonumber}) .
+ qq|
| . $locale->text('Quotation Date') . qq|
@@ -749,7 +757,9 @@ print qq|
| . $locale->text('Customer Order Number') . qq|
-
+ |.
+ $cgi->textfield("-name" => "cusordnumber", "-size" => 11, "-value" => $form->{cusordnumber}) .
+ qq|
| . $locale->text('Project Number') . qq|
@@ -901,7 +911,7 @@ sub form_footer {
$notes
$intnotes
- $payment
+ $payment
$follow_ups_block
@@ -1103,7 +1113,7 @@ if ($form->{type} eq "credit_note") {
$closedto = $form->datetonum($form->{closedto}, \%myconfig);
if ($form->{id}) {
- my $show_storno = !$form->{storno} && !IS->has_storno(\%myconfig, $form, "ar");
+ my $show_storno = !$form->{storno} && !IS->has_storno(\%myconfig, $form, "ar") && (($totalpaid == 0) || ($totalpaid eq ""));
print qq|
hidden("-name" => "callback", "-value" => $form->{callback})
. $cgi->hidden('-name' => 'draft_id', '-default' => [$form->{draft_id}])
. $cgi->hidden('-name' => 'draft_description', '-default' => [$form->{draft_description}])
+. $cgi->hidden('-name' => 'customer_discount', '-value' => [$form->{customer_discount}])
. qq|
@@ -1230,14 +1241,14 @@ sub update {
$form->{taxincluded} ||= $taxincluded;
- $form->{exchangerate} = $exchangerate if
- $form->{forex} = $exchangerate = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{invdate}, 'buy');
+ $form->{forex} = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{invdate}, 'buy');
+ $form->{exchangerate} = $form->{forex} if $form->{forex};
for $i (1 .. $form->{paidaccounts}) {
next unless $form->{"paid_$i"};
map { $form->{"${_}_$i"} = $form->parse_amount(\%myconfig, $form->{"${_}_$i"}) } qw(paid exchangerate);
- $form->{"exchangerate_$i"} = $exchangerate if
- $form->{"forex_$i"} = $exchangerate = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'buy');
+ $form->{"forex_$i"} = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'buy');
+ $form->{"exchangerate_$i"} = $form->{"forex_$i"} if $form->{"forex_$i"};
}
$i = $form->{rowcount};
@@ -1257,7 +1268,7 @@ sub update {
$rows = scalar @{ $form->{item_list} };
- $form->{"discount_$i"} = $form->format_amount(\%myconfig, $form->{discount} * 100);
+ $form->{"discount_$i"} = $form->format_amount(\%myconfig, $form->{customer_discount} * 100);
if ($rows) {
$form->{"qty_$i"} = ($form->{"qty_$i"} * 1) ? $form->{"qty_$i"} : 1;
@@ -1356,7 +1367,7 @@ sub post_payment {
$form->isblank("datepaid_$i", $locale->text('Payment date missing!'));
$form->error($locale->text('Cannot post payment for a closed period!'))
- if ($datepaid <= $closedto);
+ if ($form->date_closed($form->{"datepaid_$i"}, \%myconfig));
if ($form->{currency} ne $form->{defaultcurrency}) {
$form->{"exchangerate_$i"} = $form->{exchangerate}
@@ -1386,6 +1397,8 @@ sub post {
$form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
$form->isblank("invdate", $locale->text('Invoice Date missing!'));
$form->isblank("customer", $locale->text('Customer missing!'));
+ $form->error($locale->text('Cannot post invoice for a closed period!'))
+ if ($form->date_closed($form->{"invdate"}, \%myconfig));
$form->{invnumber} =~ s/^\s*//g;
$form->{invnumber} =~ s/\s*$//g;
@@ -1417,7 +1430,7 @@ sub post {
$form->isblank("datepaid_$i", $locale->text('Payment date missing!'));
$form->error($locale->text('Cannot post payment for a closed period!'))
- if ($datepaid <= $closedto);
+ if ($form->date_closed($form->{"datepaid_$i"}, \%myconfig));
if ($form->{currency} ne $form->{defaultcurrency}) {
$form->{"exchangerate_$i"} = $form->{exchangerate}
@@ -1618,15 +1631,8 @@ sub credit_note {
&invoice_links;
$form->{currency} = $currency;
- $form->{exchangerate} = "";
- $form->{forex} = "";
- $form->{exchangerate} = $exchangerate
- if (
- $form->{forex} = (
- $exchangerate =
- $form->check_exchangerate(
- \%myconfig, $form->{currency}, $form->{invdate}, $buysell
- )));
+ $form->{forex} = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{invdate}, $buysell);
+ $form->{exchangerate} = $form->{forex} || '';
$form->{creditremaining} -= ($form->{oldinvtotal} - $form->{ordtotal});