#======================================================================
require "$form->{path}/arap.pl";
+require "bin/mozilla/common.pl";
use SL::PE;
use SL::RP;
</tr>
| if $form->{selectdepartment};
+ $form->get_lists("projects" => { "key" => "ALL_PROJECTS",
+ "all" => 1 });
+
+ my %project_labels = ();
+ my @project_values = ("");
+ foreach my $item (@{ $form->{"ALL_PROJECTS"} }) {
+ push(@project_values, $item->{"id"});
+ $project_labels{$item->{"id"}} = $item->{"projectnumber"};
+ }
+
+ my $projectnumber =
+ NTI($cgi->popup_menu('-name' => "project_id",
+ '-values' => \@project_values,
+ '-labels' => \%project_labels));
+
# use JavaScript Calendar or not
$form->{jsscript} = $jscalendar;
$jsscript = "";
print qq|
<tr>
<th align=right nowrap>| . $locale->text('Project') . qq|</th>
- <td colspan=3><input name=projectnumber size=25</td>
+ <td colspan=3>$projectnumber</td>
</tr>
<input type=hidden name=nextsub value=generate_income_statement>
</table>
print qq|
<tr>
<th align=right nowrap>| . $locale->text('Project') . qq|</th>
- <td colspan=3><input name=projectnumber size=25</td>
+ <td colspan=3>$projectnumber</td>
</tr>
<input type=hidden name=nextsub value=generate_bwa>
</table>
}
if ($form->{report} =~ /^tax_/) {
- $gifi = "";
-
$form->{db} = ($form->{report} =~ /_collected/) ? "ar" : "ap";
RP->get_taxaccounts(\%myconfig, \%$form);
</td>
</tr>
-|;
-
- if (@{ $form->{gifi_taxaccounts} }) {
- print qq|
- <tr>
- <th align=right>| . $locale->text('GIFI') . qq|</th>
- <td colspan=3>
-|;
-
- foreach $ref (@{ $form->{gifi_taxaccounts} }) {
-
- print
- qq|<input name=accno class=radio type=radio value="gifi_$ref->{accno}"> $ref->{description}
-
- <input name="gifi_$ref->{accno}_description" type=hidden value="$ref->{description}">
- <input name="gifi_$ref->{accno}_rate" type=hidden value="$ref->{rate}">|;
-
- }
-
- print qq|
- </td>
- </tr>
-|;
- }
-
- print qq|
<tr>
<th align=right>| . $locale->text('Method') . qq|</th>
<td colspan=3><input name=method class=radio type=radio value=accrual $accrual>|
}
if ($form->{report} =~ /^nontaxable_/) {
- $gifi = "";
-
$form->{db} = ($form->{report} =~ /_sales/) ? "ar" : "ap";
print qq|
}
if (($form->{report} eq "ar_aging") || ($form->{report} eq "ap_aging")) {
- $gifi = "";
-
if ($form->{report} eq 'ar_aging') {
$label = $locale->text('Customer');
$form->{vc} = 'customer';
# above action can be removed if there is more than one input field
if ($form->{report} =~ /(receipts|payments)$/) {
- $gifi = "";
-
$form->{db} = ($form->{report} =~ /payments$/) ? "ap" : "ar";
RP->paymentaccounts(\%myconfig, \%$form);
$form->{endbold} = "</b>";
$form->{br} = "<br>";
- &get_project(generate_income_statement);
-
- $form->{projectnumber} = $form->{projectnumber_1};
-
if ($form->{reporttype} eq "custom") {
#forgotten the year --> thisyear
$column_header{endbalance} =
qq|<th class=listheading>| . $locale->text('Balance') . qq|</th>|;
- if ($form->{accounttype} eq 'gifi') {
- $column_header{accno} =
- qq|<th class=listheading>| . $locale->text('GIFI') . qq|</th>|;
- }
-
$form->header;
print qq|
$description = $form->escape($ref->{description});
$href =
- qq|ca.pl?path=$form->{path}&action=list_transactions&accounttype=$form->{accounttype}&login=$form->{login}&password=$form->{password}&fromdate=$form->{fromdate}&todate=$form->{todate}&sort=transdate&l_heading=$form->{l_heading}&l_subtotal=$form->{l_subtotal}&department=$department&eur=$form->{eur}&projectnumber=$projectnumber&project_id=$form->{project_id}&title=$title&nextsub=$form->{nextsub}|;
-
- if ($form->{accounttype} eq 'gifi') {
- $href .= "&gifi_accno=$ref->{accno}&gifi_description=$description";
- $na = $locale->text('N/A');
- map { $ref->{$_} = $na } qw(accno description) unless $ref->{accno};
- } else {
- $href .= "&accno=$ref->{accno}&description=$description";
- }
+ qq|ca.pl?path=$form->{path}&action=list_transactions&accounttype=$form->{accounttype}&login=$form->{login}&password=$form->{password}&fromdate=$form->{fromdate}&todate=$form->{todate}&sort=transdate&l_heading=$form->{l_heading}&l_subtotal=$form->{l_subtotal}&department=$department&eur=$form->{eur}&projectnumber=$projectnumber&project_id=$form->{project_id}&title=$title&nextsub=$form->{nextsub}&accno=$ref->{accno}&description=$description";
$ml = ($ref->{category} =~ /(A|C|E)/) ? -1 : 1;
}
}
}
-
+ # saving the history
+ if(!exists $form->{addition} && $form->{id} ne "") {
+ $form->{addition} = "PRINTED";
+ $form->{what_done} = $form->{type};
+ $form->save_history($form->dbconnect(\%myconfig));
+ }
+ # /saving the history
$lxdebug->leave_sub();
}
push @{ $form->{duedate} }, $ref->{duedate};
foreach $item (qw(c0 c30 c60 c90)) {
- eval {
+ if ($ref->{exchangerate} * 1) {
$ref->{$item} =
$form->round_amount($ref->{$item} / $ref->{exchangerate}, 2);
- };
+ }
$form->{"${item}total"} += $ref->{$item};
$form->{total} += $ref->{$item};
push @{ $form->{$item} },
$description = $form->escape($form->{$descvar});
$ratevar = "$form->{accno}_rate";
- if ($form->{accno} =~ /^gifi_/) {
- $descvar = "gifi_$form->{accno}_description";
- $description = $form->escape($form->{$descvar});
- $ratevar = "gifi_$form->{accno}_rate";
- }
-
$department = $form->escape($form->{department});
# construct href
$callback =
"$form->{script}?path=$form->{path}&action=generate_tax_report&login=$form->{login}&password=$form->{password}&fromdate=$form->{fromdate}&todate=$form->{todate}&db=$form->{db}&method=$form->{method}&accno=$form->{accno}&$descvar=$description&department=$department&$ratevar=$taxrate&report=$form->{report}";
- $form->{title} = $locale->text('GIFI') . " - "
- if ($form->{accno} =~ /^gifi_/);
-
$title = $form->escape($form->{title});
$href .= "&title=$title";
$title = $form->escape($form->{title}, 1);
$form->{endbold} = "</b>";
$form->{br} = "<br>";
- # &get_project(generate_bwa);
-
if ($form->{reporttype} eq "custom") {
#forgotten the year --> thisyear