X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Far.pl;h=af964bbd71ada527df1848e00e269ea6363f3f7a;hb=1b3fe156b5ddfd588c1e55af5e21a36e84d9caf8;hp=eaa0f2224abe8f7729b062db2a2f053d86fed3e1;hpb=456a81dd3b5ccd8b4a48ea166d465ca2b9fb5b6b;p=kivitendo-erp.git diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index eaa0f2224..af964bbd7 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -37,6 +37,8 @@ use SL::PE; use Data::Dumper; require "$form->{path}/arap.pl"; +require "bin/mozilla/common.pl"; +require "bin/mozilla/drafts.pl"; 1; @@ -73,19 +75,31 @@ require "$form->{path}/arap.pl"; sub add { $lxdebug->enter_sub(); + return $lxdebug->leave_sub() if (load_draft_maybe()); + + # saving the history + if(!exists $form->{addition} && ($form->{id} ne "")) { + $form->{addition} = "ADDED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history + $form->{title} = "Add"; $form->{callback} = "$form->{script}?action=add&path=$form->{path}&login=$form->{login}&password=$form->{password}" unless $form->{callback}; &create_links; + AR->get_transdate(\%myconfig, $form); &display_form; - $lxdebug->leave_sub(); } sub edit { $lxdebug->enter_sub(); + # show history button + $form->{javascript} = qq||; + #/show hhistory button $form->{title} = "Edit"; @@ -111,14 +125,17 @@ sub create_links { $duedate = $form->{duedate}; $taxincluded = $form->{taxincluded}; - + my $id = $form->{id}; IS->get_customer(\%myconfig, \%$form); + $form->{taxincluded} = $taxincluded; + $form->{id} = $id; $form->{duedate} = $duedate if $duedate; $form->{oldcustomer} = "$form->{customer}--$form->{customer_id}"; - $form->{rowcount} = 1; + $form->{rowcount} = 1; + # currencies - @curr = split /:/, $form->{currencies}; + @curr = split(/:/, $form->{currencies}); chomp $curr[0]; $form->{defaultcurrency} = $curr[0]; @@ -156,7 +173,7 @@ sub create_links { map { $tax .= - qq|{taxkey}--$_->{rate}\">$_->{taxdescription} | + qq|{id}--$_->{rate}\">$_->{taxdescription} | . ($_->{rate} * 100) . qq| %| } @{ $form->{TAX} }; $form->{taxchart} = $tax; @@ -173,7 +190,7 @@ sub create_links { "{accno}\">$ref->{accno}--$ref->{description}\n"; } else { $form->{"select$key"} .= - "{accno}--$ref->{taxkey}\">$ref->{accno}--$ref->{description}\n"; + "{accno}--$ref->{tax_id}\">$ref->{accno}--$ref->{description}\n"; } } @@ -182,7 +199,7 @@ sub create_links { # if there is a value we have an old entry my $j = 0; my $k = 0; - print(STDERR Dumper($form->{acc_trans})); + for $i (1 .. scalar @{ $form->{acc_trans}{$key} }) { if ($key eq "AR_paid") { $j++; @@ -199,13 +216,14 @@ sub create_links { $form->{"forex_$j"} = $form->{"exchangerate_$i"} = $form->{acc_trans}{$key}->[$i - 1]->{exchangerate}; $form->{"AR_paid_$j"} = "$form->{acc_trans}{$key}->[$i-1]->{accno}"; + $form->{"paid_project_id_$j"} = $form->{acc_trans}{$key}->[$i - 1]->{project_id}; $form->{paidaccounts}++; } else { $akey = $key; $akey =~ s/AR_//; - if ($key eq "AR_tax") { + if ($key eq "AR_tax" || $key eq "AP_tax") { $form->{"${key}_$form->{acc_trans}{$key}->[$i-1]->{accno}"} = "$form->{acc_trans}{$key}->[$i-1]->{accno}--$form->{acc_trans}{$key}->[$i-1]->{description}"; $form->{"${akey}_$form->{acc_trans}{$key}->[$i-1]->{accno}"} = @@ -223,11 +241,10 @@ sub create_links { $form->{"${akey}_$form->{acc_trans}{$key}->[$i-1]->{accno}"}; $withholdingrate += $form->{"$form->{acc_trans}{$key}->[$i-1]->{accno}_rate"}; - } - print(STDERR $form->{acc_trans}{$key}->[$i - 1]->{amount}, " ACC_TRANS\n"); - print(STDERR "$key KEY, $k Zeile\n"); + } $index = $form->{acc_trans}{$key}->[$i - 1]->{index}; $form->{"tax_$index"} = $form->{acc_trans}{$key}->[$i - 1]->{amount}; + $totaltax += $form->{"tax_$index"}; } else { $k++; @@ -249,14 +266,14 @@ sub create_links { "$form->{acc_trans}{$key}->[$i-1]->{accno}--$form->{acc_trans}{$key}->[$i-1]->{description}"; $form->{"${key}_$i"} = "$form->{acc_trans}{$key}->[$i-1]->{accno}--$form->{acc_trans}{$key}->[$i-1]->{description}"; + my $q_description = quotemeta($form->{acc_trans}{$key}->[$i-1]->{description}); $form->{"select${key}"} =~ - /{acc_trans}{$key}->[$i-1]->{accno}--[^\"]*)\">$form->{acc_trans}{$key}->[$i-1]->{accno}--$form->{acc_trans}{$key}->[$i-1]->{description}<\/option>\n/; - $test = $1; + /{acc_trans}{$key}->[$i-1]->{accno}--[^\"]*)\">$form->{acc_trans}{$key}->[$i-1]->{accno}--${q_description}<\/option>\n/; $form->{"${key}_$k"} = $1; if ($akey eq 'amount') { $form->{"taxchart_$k"} = $form->{taxchart}; $form->{"taxchart_$k"} =~ - /{acc_trans}{$key}->[$i-1]->{taxkey}--[^\"]*)/; + /{acc_trans}{$key}->[$i-1]->{id}--[^\"]*)/; $form->{"taxchart_$k"} = $1; } } @@ -275,38 +292,22 @@ sub create_links { ($totaltax + $totalwithholding) * $form->{"amount_$i"} / $totalamount; $tax = $form->round_amount($taxamount, 2); $diff += ($taxamount - $tax); - $form->{"amount_$i"} += $tax; + $form->{"amount_$i"} += $form->{"tax_$i"}; } $form->{amount_1} += $form->round_amount($diff, 2); } - # check if calculated is equal to stored - if ($form->{taxincluded} && $form->{taxrate} && $withholdingrate) { - if ($form->{"taxrate"} > 0) { - $taxamount = - $form->round_amount( - ($form->{amount_1} - ($form->{amount_1} / ($form->{taxrate} + 1))), - 2); - } else { - $taxamount = - $form->round_amount( - ($totalamount + $totaltax + $totalwithholding) * $withholdingrate / - (1 - $withholdingrate), - 2 - ) * $form->{"taxrate"} / $withholdingrate; - } - } else { - $taxamount = $totalamount * $form->{"taxrate"}; - } $taxamount = $form->round_amount($taxamount, 2); $form->{tax} = $taxamount; - $form->{invtotal} = $totalamount + $totaltax + $totalwithholding; + $form->{invtotal} = $totalamount + $totaltax; $form->{locked} = ($form->datetonum($form->{transdate}, \%myconfig) <= $form->datetonum($form->{closedto}, \%myconfig)); + $form->{"ARselected"} = $form->{"AR_1"}; + $lxdebug->leave_sub(); } @@ -324,7 +325,7 @@ sub form_header { |; + # show history button js + $form->{javascript} .= qq||; + #/show history button js $readonly = ($form->{id}) ? "readonly" : ""; @@ -346,6 +350,11 @@ sub form_header { ($form->current_date(\%myconfig) eq $form->{gldate}) ? 1 : 0; $readonly = ($form->{radier}) ? "" : $readonly; + my $ARselected_quoted = quotemeta($form->{"ARselected"}); + $form->{selectAR} = $form->{AR}; + $form->{selectAR} =~ + s/value=\"${ARselected_quoted}\"/value=\"$form->{ARselected}\" selected/; + # set option selected foreach $item (qw(customer currency department employee)) { $form->{"select$item"} =~ s/ selected//; @@ -353,8 +362,9 @@ sub form_header { s/option>\Q$form->{$item}\E/option selected>$form->{$item}/; } $selectAR_amount_unquoted = $form->{selectAR_amount}; - $taxchart = $form->{taxchart}; - map { $form->{$_} =~ s/\"/"/g } qw(AR_amount selectAR_amount AR taxchart); + $taxchart = $form->{taxchart}; + map { $form->{$_} =~ s/\"/"/g } + qw(AR_amount selectAR_amount AR taxchart); # format amounts $form->{exchangerate} = @@ -427,6 +437,21 @@ sub form_header { |; } + my @old_project_ids = (); + map({ push(@old_project_ids, $form->{"project_id_$_"}) + if ($form->{"project_id_$_"}); } (1..$form->{"rowcount"})); + + $form->get_lists("projects" => { "key" => "ALL_PROJECTS", + "all" => 0, + "old_id" => \@old_project_ids }); + + my %project_labels = (); + my @project_values = (""); + foreach my $item (@{ $form->{"ALL_PROJECTS"} }) { + push(@project_values, $item->{"id"}); + $project_labels{$item->{"id"}} = $item->{"projectnumber"}; + } + $form->{fokus} = "arledger.customer"; # use JavaScript Calendar or not @@ -438,14 +463,12 @@ sub form_header { $button1 = qq| {transdate}> text('button') - . qq|> + . $locale->text('button') . qq|> |; $button2 = qq| {duedate}> text('button') - . qq|> + . $locale->text('button') . qq|> |; #write Trigger @@ -474,6 +497,8 @@ sub form_header { {locked}> +| . ($form->{saved_message} ? qq|$form->{saved_message}| : "") . qq| + $form->{title} @@ -540,7 +565,7 @@ sub form_header { | . $locale->text('Due Date') . qq| $button2 - + @@ -571,43 +596,45 @@ $jsscript |; - - $amount = $locale->text('Amount'); $project = $locale->text('Project'); for $i (1 .. $form->{rowcount}) { # format amounts - $form->{"amount_$i"} = $form->format_amount(\%myconfig, $form->{"amount_$i"}, 2); + $form->{"amount_$i"} = + $form->format_amount(\%myconfig, $form->{"amount_$i"}, 2); $form->{"tax_$i"} = $form->format_amount(\%myconfig, $form->{"tax_$i"}, 2); $selectAR_amount = $selectAR_amount_unquoted; - $selectAR_amount =~ s/option value=\"$form->{"AR_amount_$i"}\"/option value=\"$form->{"AR_amount_$i"}\" selected/; + $selectAR_amount =~ + s/option value=\"$form->{"AR_amount_$i"}\"/option value=\"$form->{"AR_amount_$i"}\" selected/; $tax = $taxchart; $tax_selected = $form->{"taxchart_$i"}; $tax =~ s/value=\"$tax_selected\"/value=\"$tax_selected\" selected/; $tax = - qq|$tax|; + qq|$tax|; + $korrektur_checked = ($form->{"korrektur_$i"} ? 'checked' : ''); + + my $projectnumber = + NTI($cgi->popup_menu('-name' => "project_id_$i", + '-values' => \@project_values, + '-labels' => \%project_labels, + '-default' => $form->{"project_id_$i"} )); print qq| - $selectAR_amount - {"amount_$i"}> + $selectAR_amount + {"amount_$i"}> {"tax_$i"}> - + $tax - - {"project_id_$i"}> - + $projectnumber |; $amount = ""; $project = ""; } - - - $form->{invtotal} = $form->format_amount(\%myconfig, $form->{invtotal}, 2); print qq| @@ -647,16 +674,15 @@ $jsscript - | - . $locale->text('Incoming Payments') - . qq| + | + . $locale->text('Incoming Payments') . qq| |; if ($form->{currency} eq $form->{defaultcurrency}) { - @column_index = qw(datepaid source memo paid AR_paid); + @column_index = qw(datepaid source memo paid AR_paid paid_project_id); } else { - @column_index = qw(datepaid source memo paid exchangerate AR_paid); + @column_index = qw(datepaid source memo paid exchangerate AR_paid paid_project_id); } $column_data{datepaid} = "" . $locale->text('Date') . ""; @@ -664,7 +690,8 @@ $jsscript $column_data{exchangerate} = "" . $locale->text('Exch') . ""; $column_data{AR_paid} = "" . $locale->text('Account') . ""; $column_data{source} = "" . $locale->text('Source') . ""; - $column_data{memo} = "" . $locale->text('Memo') . ""; + $column_data{memo} = "" . $locale->text('Memo') . ""; + $column_data{paid_project_id} = "" . $locale->text('Project Number') . ""; print " @@ -674,6 +701,7 @@ $jsscript "; + my @triggers = (); $form->{paidaccounts}++ if ($form->{"paid_$form->{paidaccounts}"}); for $i (1 .. $form->{paidaccounts}) { print " @@ -685,8 +713,10 @@ $jsscript s/option value=\"$form->{"AR_paid_$i"}\">/option value=\"$form->{"AR_paid_$i"}\" selected>/; # 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"}); @@ -711,20 +741,32 @@ $jsscript qq|$form->{"selectAR_paid_$i"}|; $column_data{exchangerate} = qq|$exchangerate|; $column_data{datepaid} = - qq|{"datepaid_$i"}>|; + qq|{"datepaid_$i"}> + |; $column_data{source} = qq||; $column_data{memo} = qq||; + $column_data{paid_project_id} = + qq|| + . NTI($cgi->popup_menu('-name' => "paid_project_id_$i", + '-values' => \@project_values, + '-labels' => \%project_labels, + '-default' => $form->{"paid_project_id_$i"} )) + . qq||; + map { print qq|$column_data{$_}\n| } @column_index; print " "; + push(@triggers, "datepaid_$i", "BL", "trigger_datepaid_$i"); } map { $form->{$_} =~ s/\"/"/g } qw(selectAR_paid); - print qq| + + print $form->write_trigger(\%myconfig, scalar(@triggers) / 3, @triggers) . + qq| {paidaccounts}> @@ -745,11 +787,17 @@ sub form_footer { print qq| + + {path}> {login}> {password}> +| +. $cgi->hidden('-name' => 'draft_id', '-default' => [$form->{draft_id}]) +. $cgi->hidden('-name' => 'draft_description', '-default' => [$form->{draft_description}]) +. qq| |; @@ -757,36 +805,35 @@ sub form_footer { $transdate = $form->datetonum($form->{transdate}, \%myconfig); $closedto = $form->datetonum($form->{closedto}, \%myconfig); - if ($form->{id} && $form->{radier}) { - - print qq| + print qq| |; - - if (!$form->{revtrans}) { - if (!$form->{locked}) { - print qq| - - -|; - } + if ($form->{id}) { + if ($form->{radier}) { + print qq| + + + |; } - if ($transdate > $closedto) { print qq| - -|; + + |; } + print qq| + + |; } else { if ($transdate > $closedto) { print qq| - |; + . $locale->text('Post') . qq|"> | . + NTI($cgi->submit('-name' => 'action', '-value' => $locale->text('Save draft'), + '-class' => 'submit')); } } @@ -794,7 +841,16 @@ sub form_footer { require "$form->{path}/menu.pl"; &menubar; } - + # button for saving history + if($form->{id} ne "") { + print qq| + {id} + . qq|); name=history id=history value=| + . $locale->text('history') + . qq|>|; + } + # /button for saving history print " @@ -816,14 +872,9 @@ sub update { $form->{invtotal} = 0; -# $form->{selectAR_amount} = $form->{AR_amount}; -# $form->{selectAR_amount} =~ -# s/value=\"$form->{AR_amountselected}\"/value=\"$form->{AR_amountselected}\" selected/; - - $form->{selectAR} = $form->{AR}; - - $form->{selectAR} =~ - s/value=\"$form->{ARselected}\"/value=\"$form->{ARselected}\" selected/; + # $form->{selectAR_amount} = $form->{AR_amount}; + # $form->{selectAR_amount} =~ + # s/value=\"$form->{AR_amountselected}\"/value=\"$form->{AR_amountselected}\" selected/; ($AR_amountaccno, $AR_amounttaxkey) = split(/--/, $form->{AR_amountselected}); @@ -843,8 +894,7 @@ sub update { for $i (1 .. $form->{rowcount}) { $form->{"amount_$i"} = $form->parse_amount(\%myconfig, $form->{"amount_$i"}); - $form->{"tax_$i"} = - $form->parse_amount(\%myconfig, $form->{"tax_$i"}); + $form->{"tax_$i"} = $form->parse_amount(\%myconfig, $form->{"tax_$i"}); if ($form->{"amount_$i"}) { push @a, {}; $j = $#a; @@ -885,14 +935,11 @@ sub update { &check_name(customer); $form->{AR} = $save_AR; - &check_project; - - $form->{invtotal} = ($form->{taxincluded}) ? $form->{invtotal} : $form->{invtotal} + $totaltax; for $i (1 .. $form->{paidaccounts}) { - if ($form->{"paid_$i"}) { + if ($form->parse_amount(\%myconfig, $form->{"paid_$i"})) { map { $form->{"${_}_$i"} = $form->parse_amount(\%myconfig, $form->{"${_}_$i"}) @@ -921,6 +968,36 @@ sub update { $lxdebug->leave_sub(); } +sub post_payment { + $lxdebug->enter_sub(); + for $i (1 .. $form->{paidaccounts}) { + if ($form->{"paid_$i"}) { + $datepaid = $form->datetonum($form->{"datepaid_$i"}, \%myconfig); + + $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->{currency} ne $form->{defaultcurrency}) { + $form->{"exchangerate_$i"} = $form->{exchangerate} + if ($invdate == $datepaid); + $form->isblank("exchangerate_$i", + $locale->text('Exchangerate for payment missing!')); + } + } + } + + ($form->{AR}) = split /--/, $form->{AR}; + ($form->{AR_paid}) = split /--/, $form->{AR_paid}; + $form->redirect($locale->text(' Payment posted!')) + if (AR->post_payment(\%myconfig, \%$form)); + $form->error($locale->text('Cannot post payment!')); + + + $lxdebug->leave_sub(); +} + sub post { $lxdebug->enter_sub(); @@ -941,7 +1018,7 @@ sub post { delete($form->{AR}); 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!')); @@ -965,9 +1042,9 @@ sub post { exit; } - ($creditaccno, $credittaxkey) = split /--/, $form->{AR_amountselected}; - ($taxkey, $NULL) = split /--/, $form->{taxchartselected}; - ($receivablesaccno, $payablestaxkey) = split /--/, $form->{ARselected}; + my ($creditaccno, $credittaxkey) = split /--/, $form->{AR_amountselected}; + my ($taxkey, $NULL) = split /--/, $form->{taxchartselected}; + my ($receivablesaccno, $payablestaxkey) = split /--/, $form->{ARselected}; $form->{AR}{amount_1} = $creditaccno; $form->{AR}{receivables} = $receivablesaccno; $form->{taxkey} = $taxkey; @@ -976,9 +1053,16 @@ sub post { unless $form->{invnumber}; $form->{id} = 0 if $form->{postasnew}; - - $form->redirect($locale->text('Transaction posted!')) - if (AR->post_transaction(\%myconfig, \%$form)); + if (AR->post_transaction(\%myconfig, \%$form)) { + # saving the history + if(!exists $form->{addition} && $form->{id} ne "") { + $form->{addition} = "POSTED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history + remove_draft() if $form->{remove_draft}; + $form->redirect($locale->text('Transaction posted!')); + } $form->error($locale->text('Cannot post transaction!')); $lxdebug->leave_sub(); @@ -988,11 +1072,29 @@ sub post_as_new { $lxdebug->enter_sub(); $form->{postasnew} = 1; + # saving the history + if(!exists $form->{addition} && $form->{id} ne "") { + $form->{addition} = "POSTED AS NEW"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history &post; $lxdebug->leave_sub(); } +sub use_as_template { + $lxdebug->enter_sub(); + + map { delete $form->{$_} } qw(printed emailed queued invnumber invdate deliverydate id datepaid_1 source_1 memo_1 paid_1 exchangerate_1 AP_paid_1 storno); + $form->{paidaccounts} = 1; + $form->{rowcount}--; + $form->{invdate} = $form->current_date(\%myconfig); + &update; + + $lxdebug->leave_sub(); +} + sub delete { $lxdebug->enter_sub(); @@ -1033,9 +1135,15 @@ sub delete { sub yes { $lxdebug->enter_sub(); - - $form->redirect($locale->text('Transaction deleted!')) - if (AR->delete_transaction(\%myconfig, \%$form, $spool)); + if (AR->delete_transaction(\%myconfig, \%$form, $spool)) { + # saving the history + if(!exists $form->{addition}) { + $form->{addition} = "DELETED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history + $form->redirect($locale->text('Transaction deleted!')); + } $form->error($locale->text('Cannot delete transaction!')); $lxdebug->leave_sub(); @@ -1083,14 +1191,12 @@ sub search { $button1 = qq| text('button') - . qq|> + . $locale->text('button') . qq|> |; $button2 = qq| text('button') - . qq|> + . $locale->text('button') . qq|> |; #write Trigger @@ -1106,6 +1212,19 @@ sub search { |; } + $form->get_lists("projects" => { "key" => "ALL_PROJECTS", + "all" => 1 }); + + my %labels = (); + my @values = (""); + foreach my $item (@{ $form->{"ALL_PROJECTS"} }) { + push(@values, $item->{"id"}); + $labels{$item->{"id"}} = $item->{"projectnumber"}; + } + my $projectnumber = + NTI($cgi->popup_menu('-name' => 'project_id', '-values' => \@values, + '-labels' => \%labels)); + $form->{fokus} = "search.customer"; $form->header; @@ -1137,6 +1256,10 @@ sub search { | . $locale->text('Notes') . qq| + + | . $locale->text("Project Number") . qq| + $projectnumber + | . $locale->text('From') . qq| $button1 @@ -1203,6 +1326,8 @@ sub search { | . $locale->text('Subtotal') . qq| + + | . $locale->text('Project Number') . qq| @@ -1308,11 +1433,17 @@ sub ar_transactions { $option .= "\n" if ($option); $option .= $locale->text('Closed'); } + if ($form->{globalproject_id}) { + $callback .= "&globalproject_id=" . E($form->{globalproject_id}); + $href .= "&globalproject_id=" . E($form->{globalproject_id}); + } @columns = - $form->sort_columns( - qw(transdate id invnumber ordnumber name netamount tax amount paid datepaid due duedate notes employee shippingpoint shipvia) - ); + qw(transdate id type invnumber ordnumber name netamount tax amount paid + datepaid due duedate notes employee shippingpoint shipvia + globalprojectnumber); + + $form->{"l_type"} = "Y"; foreach $item (@columns) { if ($form->{"l_$item"} eq "Y") { @@ -1341,6 +1472,8 @@ sub ar_transactions { "" . $locale->text('Due Date') . ""; + $column_header{type} = + "" . $locale->text('Type') . ""; $column_header{invnumber} = "" . $locale->text('Invoice') @@ -1381,6 +1514,8 @@ sub ar_transactions { "" . $locale->text('Ship via') . ""; + $column_header{globalprojectnumber} = + qq|| . $locale->text('Project Number') . qq||; $form->{title} = $locale->text('AR Transactions'); @@ -1467,6 +1602,11 @@ sub ar_transactions { $column_data{invnumber} = "{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ar->{invnumber}"; + $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)")) . ""; $column_data{ordnumber} = "$ar->{ordnumber} "; $column_data{name} = "$ar->{name}"; $ar->{notes} =~ s/\r\n//g; @@ -1474,6 +1614,8 @@ sub ar_transactions { $column_data{shippingpoint} = "$ar->{shippingpoint} "; $column_data{shipvia} = "$ar->{shipvia} "; $column_data{employee} = "$ar->{employee} "; + $column_data{globalprojectnumber} = + "" . H($ar->{globalprojectnumber}) . ""; $i++; $i %= 2; @@ -1541,14 +1683,8 @@ sub ar_transactions { |; + . $locale->text('Sales Invoice') . qq|"> - if ($form->{menubar}) { - require "$form->{path}/menu.pl"; - &menubar; - } - - print qq|
$form->{saved_message}