X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Far.pl;h=382e733d3624e01e1386c62d66e5fa081b60e938;hb=8482e69b2e36af353705a84e4465668f7431dddf;hp=5b3e3b2a1fdb76537b3f8c6eeb011e99ca568ed0;hpb=7712480e4a082f84a2229f5b1a90d79a6c01255b;p=kivitendo-erp.git
diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl
index 5b3e3b2a1..382e733d3 100644
--- a/bin/mozilla/ar.pl
+++ b/bin/mozilla/ar.pl
@@ -36,7 +36,7 @@ use SL::IS;
use SL::PE;
use Data::Dumper;
-require "$form->{path}/arap.pl";
+require "bin/mozilla/arap.pl";
require "bin/mozilla/common.pl";
require "bin/mozilla/drafts.pl";
@@ -79,6 +79,7 @@ sub add {
# saving the history
if(!exists $form->{addition} && ($form->{id} ne "")) {
+ $form->{snumbers} = qq|invnumber_| . $form->{invnumber};
$form->{addition} = "ADDED";
$form->save_history($form->dbconnect(\%myconfig));
}
@@ -86,11 +87,13 @@ sub add {
$form->{title} = "Add";
$form->{callback} =
- "$form->{script}?action=add&path=$form->{path}&login=$form->{login}&password=$form->{password}"
+ "$form->{script}?action=add&login=$form->{login}&password=$form->{password}"
unless $form->{callback};
- &create_links;
AR->get_transdate(\%myconfig, $form);
+ $form->{initial_transdate} = $form->{transdate};
+ &create_links;
+ $form->{transdate} = $form->{initial_transdate};
&display_form;
$lxdebug->leave_sub();
}
@@ -100,7 +103,7 @@ sub edit {
# show history button
$form->{javascript} = qq||;
#/show hhistory button
-
+ $form->{javascript} .= qq||;
$form->{title} = "Edit";
&create_links;
@@ -134,6 +137,9 @@ sub create_links {
$form->{oldcustomer} = "$form->{customer}--$form->{customer_id}";
$form->{rowcount} = 1;
+ # notes
+ $form->{notes} = $form->{intnotes} unless $form->{notes};
+
# currencies
@curr = split(/:/, $form->{currencies});
chomp $curr[0];
@@ -257,8 +263,6 @@ sub create_links {
}
}
- $lxdebug->message(0, "1 ARselected $form->{ARselected}");
-
$form->{taxincluded} = $taxincluded if ($form->{id});
$form->{paidaccounts} = 1 if not defined $form->{paidaccounts};
@@ -319,7 +323,7 @@ sub form_header {
# show history button js
$form->{javascript} .= qq||;
#/show history button js
-
+ $form->{javascript} .= qq||;
$readonly = ($form->{id}) ? "readonly" : "";
$form->{radier} =
@@ -359,8 +363,6 @@ sub form_header {
}
}
- $taxincluded = "";
-
$taxincluded = qq|
{taxincluded}> |
@@ -387,7 +389,9 @@ sub form_header {
$customer =
($form->{selectcustomer})
- ? qq||
+ ? qq||
: qq||;
$employee = qq|
@@ -428,6 +432,7 @@ sub form_header {
my (%AR_amount_labels, @AR_amount_values);
my (%AR_labels, @AR_values);
my (%AR_paid_labels, @AR_paid_values);
+ my %charts;
my $taxchart_init;
foreach my $item (@{ $form->{ALL_CHARTS} }) {
@@ -447,16 +452,20 @@ sub form_header {
$AR_paid_labels{$item->{accno}} =
"$item->{accno}--$item->{description}";
}
+
+ $charts{$item->{accno}} = $item;
}
my %taxchart_labels = ();
my @taxchart_values = ();
+ my %taxcharts = ();
foreach my $item (@{ $form->{ALL_TAXCHARTS} }) {
my $key = "$item->{id}--$item->{rate}";
$taxchart_init = $key if ($taxchart_init eq $item->{id});
push(@taxchart_values, $key);
$taxchart_labels{$key} =
"$item->{taxdescription} " . ($item->{rate} * 100) . ' %';
+ $taxcharts{$item->{id}} = $item;
}
$form->{fokus} = "arledger.customer";
@@ -468,12 +477,12 @@ sub form_header {
# with JavaScript Calendar
$button1 = qq|
- {transdate}> |
+ |
text('button') . qq|> |
|;
$button2 = qq|
- {duedate}> |
+ |
text('button') . qq|> |
|;
@@ -486,15 +495,17 @@ sub form_header {
# without JavaScript Calendar
$button1 =
- qq|{transdate}> | |;
+ qq| | |;
$button2 =
- qq|{duedate}> | |;
+ qq| | |;
}
$form->header;
-
+ $onload = qq|focus()|;
+ $onload .= qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|;
+ $onload .= qq|;setupPoints('|. $myconfig{numberformat} .qq|', '|. $locale->text("wrongformat") .qq|')|;
print qq|
-
+
+
+ | . $locale->text('Transaction description') . qq| |
+ |
+
| . $locale->text('Notes') . qq| |
|
@@ -1326,6 +1375,8 @@ sub search {
| . $locale->text('Subtotal') . qq| |
|
| . $locale->text('Project Number') . qq| |
+ |
+ | . $locale->text('Transaction description') . qq| |
@@ -1340,7 +1391,6 @@ sub search {
{nextsub}>
-{path}>
{login}>
{password}>
@@ -1369,7 +1419,7 @@ sub ar_transactions {
AR->ar_transactions(\%myconfig, \%$form);
$callback =
- "$form->{script}?action=ar_transactions&path=$form->{path}&login=$form->{login}&password=$form->{password}";
+ "$form->{script}?action=ar_transactions&login=$form->{login}&password=$form->{password}";
$href = $callback;
if ($form->{customer}) {
@@ -1402,6 +1452,12 @@ sub ar_transactions {
$option .= "\n
" if $option;
$option .= $locale->text('Notes') . " : $form->{notes}";
}
+ if ($form->{transaction_description}) {
+ $callback .= "&transaction_description=" . $form->escape($form->{transaction_description}, 1);
+ $href .= "&transaction_description=" . $form->escape($form->{transaction_description});
+ $option .= "\n
" if $option;
+ $option .= $locale->text('Transaction description') . " : $form->{transaction_description}";
+ }
if ($form->{transdatefrom}) {
$callback .= "&transdatefrom=$form->{transdatefrom}";
@@ -1438,7 +1494,7 @@ sub ar_transactions {
@columns =
qw(transdate id type invnumber ordnumber name netamount tax amount paid
- datepaid due duedate notes employee shippingpoint shipvia
+ datepaid due duedate transaction_description notes employee shippingpoint shipvia
globalprojectnumber);
$form->{"l_type"} = "Y";
@@ -1514,6 +1570,8 @@ sub ar_transactions {
. "";
$column_header{globalprojectnumber} =
qq|| . $locale->text('Project Number') . qq| | |;
+ $column_header{transaction_description} =
+ "" . $locale->text('Transaction description') . " | ";
$form->{title} = $locale->text('AR Transactions');
@@ -1599,12 +1657,18 @@ sub ar_transactions {
$module = ($ar->{invoice}) ? "is.pl" : $form->{script};
$column_data{invnumber} =
- "{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ar->{invnumber} | ";
+ "{id}&login=$form->{login}&password=$form->{password}&callback=$callback>$ar->{invnumber} | ";
+
+ my $is_storno = $ar->{storno} && ($ar->{invnumber} =~ /^Storno zu/);
+ my $has_storno = $ar->{storno} && !$is_storno;
+
$column_data{type} = "" .
- ($ar->{storno} ? $locale->text("Storno (one letter abbreviation)") :
- $ar->{amount} < 0 ?
- $locale->text("Credit note (one letter abbreviation)") :
- $locale->text("Invoice (one letter abbreviation)")) . " | ";
+ ($has_storno ? $locale->text("Invoice with Storno (abbreviation)") :
+ $is_storno ? $locale->text("Storno (one letter abbreviation)") :
+ $ar->{amount} < 0 ? $locale->text("Credit note (one letter abbreviation)") :
+ $ar->{invoice} ? $locale->text("Invoice (one letter abbreviation)") :
+ $locale->text("AR Transaction (abbreviation)"))
+ . "";
$column_data{ordnumber} = "$ar->{ordnumber} | ";
$column_data{name} = "$ar->{name} | ";
$ar->{notes} =~ s/\r\n/
/g;
@@ -1614,6 +1678,8 @@ sub ar_transactions {
$column_data{employee} = "$ar->{employee} | ";
$column_data{globalprojectnumber} =
"" . H($ar->{globalprojectnumber}) . " | ";
+ $column_data{transaction_description} =
+ "" . H($ar->{transaction_description}) . " | ";
$i++;
$i %= 2;
@@ -1674,7 +1740,6 @@ sub ar_transactions {
-{path}>
{login}>
{password}>