summaryrefslogtreecommitdiff
path: root/doc/plugins/contrib/attach
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-09-14 17:03:34 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-09-14 17:03:34 -0400
commitc8f1fe835e184c852b02169a15d840a3ad7227b5 (patch)
treebd7a3e913b4a92a8a7efd57cfe712366dab6428e /doc/plugins/contrib/attach
parente6d6a3d4eb85a274fe37c6667157f7cd6f0acd16 (diff)
fix links
Diffstat (limited to 'doc/plugins/contrib/attach')
0 files changed, 0 insertions, 0 deletions
="n_39" class="hl">#
  • # module for preparing Income Statement and Balance Sheet
  • #
  • #======================================================================
  • require "bin/arap.pl";
  • use LedgerSMB::PE;
  • use LedgerSMB::RP;
  • 1;
  • # end of main
  • # this is for our long dates
  • # $locale->text('January')
  • # $locale->text('February')
  • # $locale->text('March')
  • # $locale->text('April')
  • # $locale->text('May ')
  • # $locale->text('June')
  • # $locale->text('July')
  • # $locale->text('August')
  • # $locale->text('September')
  • # $locale->text('October')
  • # $locale->text('November')
  • # $locale->text('December')
  • # this is for our short month
  • # $locale->text('Jan')
  • # $locale->text('Feb')
  • # $locale->text('Mar')
  • # $locale->text('Apr')
  • # $locale->text('May')
  • # $locale->text('Jun')
  • # $locale->text('Jul')
  • # $locale->text('Aug')
  • # $locale->text('Sep')
  • # $locale->text('Oct')
  • # $locale->text('Nov')
  • # $locale->text('Dec')
  • # $locale->text('Balance Sheet')
  • # $locale->text('Income Statement')
  • # $locale->text('Trial Balance')
  • # $locale->text('AR Aging')
  • # $locale->text('AP Aging')
  • # $locale->text('Tax collected')
  • # $locale->text('Tax paid')
  • # $locale->text('Receipts')
  • # $locale->text('Payments')
  • # $locale->text('Project Transactions')
  • # $locale->text('Non-taxable Sales')
  • # $locale->text('Non-taxable Purchases')
  • sub report {
  • %report = ( balance_sheet => { title => 'Balance Sheet' },
  • income_statement => { title => 'Income Statement' },
  • trial_balance => { title => 'Trial Balance' },
  • ar_aging => { title => 'AR Aging', vc => 'customer' },
  • ap_aging => { title => 'AP Aging', vc => 'vendor' },
  • tax_collected => { title => 'Tax collected', vc => 'customer' },
  • tax_paid => { title => 'Tax paid' },
  • nontaxable_sales => { title => 'Non-taxable Sales', vc => 'customer' },
  • nontaxable_purchases => { title => 'Non-taxable Purchases' },
  • receipts => { title => 'Receipts', vc => 'customer' },
  • payments => { title => 'Payments' },
  • projects => { title => 'Project Transactions' },
  • inv_activity => { title => 'Inventory Activity'},
  • );
  • $form->{title} = $locale->text($report{$form->{report}}->{title});
  • $gifi = qq|
  • <tr>
  • <th align=right>|.$locale->text('Accounts').qq|</th>
  • <td><input name=accounttype class=radio type=radio value=standard checked> |.$locale->text('Standard').qq|
  • <input name=accounttype class=radio type=radio value=gifi> |.$locale->text('GIFI').qq|
  • </td>
  • </tr>
  • |;
  • # get departments
  • $form->all_departments(\%myconfig, undef, $report{$form->{report}}->{vc});
  • if (@{ $form->{all_department} }) {
  • $form->{selectdepartment} = "<option>\n";
  • for (@{ $form->{all_department} }) { $form->{selectdepartment} .= qq|<option value="$_->{description}--$_->{id}">$_->{description}\n| }
  • }
  • $department = qq|
  • <tr>
  • <th align=right nowrap>|.$locale->text('Department').qq|</th>
  • <td colspan=3><select name=department>$form->{selectdepartment}</select></td>
  • </tr>
  • | if $form->{selectdepartment};
  • if (@{ $form->{all_years} }) {
  • # accounting years
  • $form->{selectaccountingyear} = "<option>\n";
  • for (@{ $form->{all_years} }) { $form->{selectaccountingyear} .= qq|<option>$_\n| }
  • $form->{selectaccountingmonth} = "<option>\n";
  • for (sort keys %{ $form->{all_month} }) { $form->{selectaccountingmonth} .= qq|<option value=$_>|.$locale->text($form->{all_month}{$_}).qq|\n| }
  • $selectfrom = qq|
  • <tr>
  • <th align=right>|.$locale->text('Period').qq|</th>
  • <td colspan=3>
  • <select name=month>$form->{selectaccountingmonth}</select>
  • <select name=year>$form->{selectaccountingyear}</select>
  • <input name=interval class=radio type=radio value=0 checked>&nbsp;|.$locale->text('Current').qq|
  • <input name=interval class=radio type=radio value=1>&nbsp;|.$locale->text('Month').qq|
  • <input name=interval class=radio type=radio value=3>&nbsp;|.$locale->text('Quarter').qq|
  • <input name=interval class=radio type=radio value=12>&nbsp;|.$locale->text('Year').qq|
  • </td>
  • </tr>
  • |;
  • $selectto = qq|
  • <tr>
  • <th align=right></th>
  • <td>
  • <select name=month>$form->{selectaccountingmonth}</select>
  • <select name=year>$form->{selectaccountingyear}</select>
  • </td>
  • </tr>
  • |;
  • }
  • $summary = qq|
  • <tr>
  • <th></th>
  • <td><input name=summary type=radio class=radio value=1 checked> |.$locale->text('Summary').qq|
  • <input name=summary type=radio class=radio value=0> |.$locale->text('Detail').qq|
  • </td>
  • </tr>
  • |;
  • # get projects
  • $form->all_projects(\%myconfig);
  • if (@{ $form->{all_project} }) {
  • $form->{selectproject} = "<option>\n";
  • for (@{ $form->{all_project} }) { $form->{selectproject} .= qq|<option value="$_->{projectnumber}--$_->{id}">$_->{projectnumber}\n| }
  • $project = qq|
  • <tr>
  • <th align=right nowrap>|.$locale->text('Project').qq|</th>
  • <td colspan=3><select name=projectnumber>$form->{selectproject}</select></td>
  • </tr>|;
  • }
  • $form->header;
  • print qq|
  • <body>
  • <form method=post action=$form->{script}>
  • <input type=hidden name=title value="$form->{title}">
  • <table width=100%>
  • <tr>
  • <th class=listtop>$form->{title}</th>
  • </tr>
  • <tr height="5"></tr>
  • <tr>
  • <td>
  • <table>
  • $department
  • |;
  • if ($form->{report} eq "projects") {
  • print qq|
  • $project
  • <input type=hidden name=nextsub value=generate_projects>
  • <tr>
  • <th align=right>|.$locale->text('From').qq|</th>
  • <td><input name=fromdate size=11 title="$myconfig{dateformat}" value=$form->{fromdate}></td>
  • <th align=right>|.$locale->text('To').qq|</th>
  • <td><input name=todate size=11 title="$myconfig{dateformat}"></td>
  • </tr>
  • $selectfrom
  • </table>
  • </td>
  • </tr>
  • <tr>
  • <td>
  • <table>
  • <tr>
  • <th align=right nowrap>|.$locale->text('Include in Report').qq|</th>
  • <td><input name=l_heading class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Heading').qq|
  • <input name=l_subtotal class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Subtotal').qq|</td>
  • </tr>
  • |;
  • }
  • if ($form->{report} eq "inv_activity"){
  • $gifi = '';
  • print qq|
  • <input type=hidden name=nextsub value=generate_inv_activity>
  • <tr>
  • <th align=right>|.$locale->text('From').qq|</th>
  • <td><input name=fromdate size=11 title="$myconfig{dateformat}" value=$form->{fromdate}></td>
  • <th align=right>|.$locale->text('To').qq|</th>
  • <td><input name=todate size=11 title="$myconfig{dateformat}"></td>
  • </tr>
  • <tr>
  • <th align=right>|.$locale->text('Period').qq|</th>
  • <td colspan=3>
  • <select name=frommonth>$form->{selectaccountingmonth}</select>
  • <select name=fromyear>$form->{selectaccountingyear}</select>
  • <input name=interval class=radio type=radio value=0 checked>|.$locale->text('Current').qq|
  • <input name=interval class=radio type=radio value=1>|.$locale->text('Month').qq|
  • <input name=interval class=radio type=radio value=3>|.$locale->text('Quarter').qq|
  • <input name=interval class=radio type=radio value=12>|.$locale->text('Year').qq|
  • </td>
  • </tr>
  • </table>
  • <table>
  • <tr>
  • <th>|.$locale->text("Part Number").qq|</th>
  • <td><input name=partnumber></td>
  • <th>|.$locale->text('Description').qq|</th>
  • <td><input type=text name=description></td>
  • </tr>|;
  • }
  • if ($form->{report} eq "income_statement") {
  • print qq|
  • $project
  • <input type=hidden name=nextsub value=generate_income_statement>
  • <tr>
  • <th align=right>|.$locale->text('From').qq|</th>
  • <td><input name=fromdate size=11 title="$myconfig{dateformat}" value=$form->{fromdate}></td>
  • <th align=right>|.$locale->text('To').qq|</th>
  • <td><input name=todate size=11 title="$myconfig{dateformat}"></td>
  • </tr>
  • |;
  • if ($selectfrom) {
  • print qq|
  • <tr>
  • <th align=right>|.$locale->text('Period').qq|</th>
  • <td colspan=3>
  • <select name=frommonth>$form->{selectaccountingmonth}</select>
  • <select name=fromyear>$form->{selectaccountingyear}</select>
  • <input name=interval class=radio type=radio value=0 checked>&nbsp;|.$locale->text('Current').qq|
  • <input name=interval class=radio type=radio value=1>&nbsp;|.$locale->text('Month').qq|
  • <input name=interval class=radio type=radio value=3>&nbsp;|.$locale->text('Quarter').qq|
  • <input name=interval class=radio type=radio value=12>&nbsp;|.$locale->text('Year').qq|
  • </td>
  • </tr>
  • |;
  • }
  • print qq|
  • <tr>
  • <th align=right>|.$locale->text('Compare to').qq|</th>
  • </tr>
  • <tr>
  • <th align=right>|.$locale->text('From').qq|</th>
  • <td><input name=comparefromdate size=11 title="$myconfig{dateformat}"></td>
  • <th align=right>|.$locale->text('To').qq|</th>
  • <td><input name=comparetodate size=11 title="$myconfig{dateformat}"></td>
  • </tr>
  • |;
  • if ($selectto) {
  • print qq|
  • <tr>
  • <th align=right>|.$locale->text('Period').qq|</th>
  • <td>
  • <select name=comparemonth>$form->{selectaccountingmonth}</select>
  • <select name=compareyear>$form->{selectaccountingyear}</select>
  • </td>
  • </tr>
  • |;
  • }
  • print qq|
  • <tr>
  • <th align=right>|.$locale->text('Decimalplaces').qq|</th>
  • <td><input name=decimalplaces size=3 value=2></td>
  • </tr>
  • </table>
  • </td>
  • </tr>
  • <tr>
  • <td>
  • <table>
  • <tr>
  • <th align=right>|.$locale->text('Method').qq|</th>
  • <td colspan=3><input name=method class=radio type=radio value=accrual checked>|.$locale->text('Accrual').qq|
  • &nbsp;<input name=method class=radio type=radio value=cash>|.$locale->text('Cash').qq|</td>
  • </tr>
  • <tr>
  • <th align=right nowrap>|.$locale->text('Include in Report').qq|</th>
  • <td colspan=3><input name=l_heading class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Heading').qq|
  • <input name=l_subtotal class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Subtotal').qq|
  • <input name=l_accno class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Account Number').qq|</td>
  • </tr>
  • |;
  • }
  • if ($form->{report} eq "balance_sheet") {
  • print qq|
  • <input type=hidden name=nextsub value=generate_balance_sheet>
  • <tr>
  • <th align=right>|.$locale->text('as at').qq|</th>
  • <td><input name=asofdate size=11 title="$myconfig{dateformat}" value=$form->{asofdate}></td>
  • |;
  • if ($selectfrom) {
  • print qq|
  • <td>
  • <select name=asofmonth>$form->{selectaccountingmonth}</select>
  • <select name=asofyear>$form->{selectaccountingyear}</select>
  • </td>
  • |;
  • }
  • print qq|
  • </tr>
  • <th align=right nowrap>|.$locale->text('Compare to').qq|</th>
  • <td><input name=compareasofdate size=11 title="$myconfig{dateformat}"></td>
  • <td>
  • |;
  • if ($selectto) {
  • print qq|
  • <select name=compareasofmonth>$form->{selectaccountingmonth}</select>
  • <select name=compareasofyear>$form->{selectaccountingyear}</select>
  • </td>
  • |;
  • }
  • print qq|
  • </tr>
  • <tr>
  • <th align=right>|.$locale->text('Decimalplaces').qq|</th>
  • <td><input name=decimalplaces size=3 value=2></td>
  • </tr>
  • </table>
  • </td>
  • </tr>
  • <tr>
  • <td>
  • <table>
  • <tr>
  • <th align=right>|.$locale->text('Method').qq|</th>
  • <td colspan=3><input name=method class=radio type=radio value=accrual checked>|.$locale->text('Accrual').qq|
  • &nbsp;<input name=method class=radio type=radio value=cash>|.$locale->text('Cash').qq|</td>
  • </tr>
  • <tr>
  • <th align=right nowrap>|.$locale->text('Include in Report').qq|</th>
  • <td><input name=l_heading class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Heading').qq|
  • <input name=l_subtotal class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Subtotal').qq|
  • <input name=l_accno class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Account Number').qq|</td>
  • </tr>
  • |;
  • }
  • if ($form->{report} eq "trial_balance") {
  • print qq|
  • <input type=hidden name=nextsub value=generate_trial_balance>
  • <tr>
  • <th align=right>|.$locale->text('From').qq|</th>
  • <td><input name=fromdate size=11 title="$myconfig{dateformat}" value=$form->{fromdate}></td>
  • <th align=right>|.$locale->text('To').qq|</th>
  • <td><input name=todate size=11 title="$myconfig{dateformat}"></td>
  • </tr>
  • $selectfrom
  • </table>
  • </td>
  • </tr>
  • <tr>
  • <td>
  • <table>
  • <tr>
  • <th align=right nowrap>|.$locale->text('Include in Report').qq|</th>
  • <td><input name=l_heading class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Heading').qq|
  • <input name=l_subtotal class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Subtotal').qq|
  • <input name=all_accounts class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('All Accounts').qq|</td>
  • </tr>
  • |;
  • }
  • if ($form->{report} =~ /^tax_/) {
  • $gifi = "";
  • $form->{db} = ($form->{report} =~ /_collected/) ? "ar" : "ap";
  • RP->get_taxaccounts(\%myconfig, \%$form);
  • print qq|
  • <input type=hidden name=nextsub value=generate_tax_report>
  • <tr>
  • <th align=right>|.$locale->text('From').qq|</th>
  • <td><input name=fromdate size=11 title="$myconfig{dateformat}" value=$form->{fromdate}></td>
  • <th align=right>|.$locale->text('To').qq|</th>
  • <td><input name=todate size=11 title="$myconfig{dateformat}"></td>
  • </tr>
  • $selectfrom
  • $summary
  • <tr>
  • <th align=right>|.$locale->text('Report for').qq|</th>
  • <td colspan=3>
  • |;
  • $checked = "checked";
  • foreach $ref (@{ $form->{taxaccounts} }) {
  • print qq|<input name=accno class=radio type=radio value=$ref->{accno} $checked>&nbsp;$ref->{description}
  • <input name="$ref->{accno}_description" type=hidden value="$ref->{description}">
  • <input name="$ref->{accno}_rate" type=hidden value="$ref->{rate}">|;
  • $checked = "";
  • }
  • print qq|
  • <input type=hidden name=db value=$form->{db}>
  • <input type=hidden name=sort value=transdate>
  • </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}">&nbsp;$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 checked>|.$locale->text('Accrual').qq|
  • &nbsp;<input name=method class=radio type=radio value=cash>|.$locale->text('Cash').qq|</td>
  • </tr>
  • </table>
  • </td>
  • </tr>
  • <tr>
  • <td>
  • <table>
  • <tr>
  • <th align=right>|.$locale->text('Include in Report').qq|</th>
  • <td>
  • <table>
  • <tr>
  • <td><input name="l_id" class=checkbox type=checkbox value=Y></td>
  • <td>|.$locale->text('ID').qq|</td>
  • <td><input name="l_invnumber" class=checkbox type=checkbox value=Y checked></td>
  • <td>|.$locale->text('Invoice').qq|</td>
  • <td><input name="l_transdate" class=checkbox type=checkbox value=Y checked></td>
  • <td>|.$locale->text('Date').qq|</td>
  • </tr>
  • <tr>
  • <td><input name="l_name" class=checkbox type=checkbox value=Y checked></td>
  • |;
  • if ($form->{db} eq 'ar') {
  • print qq|<td>|.$locale->text('Customer').qq|</td>|;
  • }
  • if ($form->{db} eq 'ap') {
  • print qq|<td>|.$locale->text('Vendor').qq|</td>|;
  • }
  • print qq|
  • <td><input name="l_description" class=checkbox type=checkbox value=Y checked></td>
  • <td>|.$locale->text('Description').qq|</td>
  • <td><input name="l_netamount" class=checkbox type=checkbox value=Y checked></td>
  • <td>|.$locale->text('Amount').qq|</td>
  • <td><input name="l_tax" class=checkbox type=checkbox value=Y checked></td>
  • <td>|.$locale->text('Tax').qq|</td>
  • <td><input name="l_total" class=checkbox type=checkbox value=Y checked></td>
  • <td>|.$locale->text('Total').qq|</td>
  • </tr>
  • <tr>
  • </tr>
  • <tr>
  • <td><input name="l_subtotal" class=checkbox type=checkbox value=Y></td>
  • <td>|.$locale->text('Subtotal').qq|</td>
  • </tr>
  • </table>
  • </td>
  • </tr>
  • |;
  • }
  • if ($form->{report} =~ /^nontaxable_/) {
  • $gifi = "";
  • $form->{db} = ($form->{report} =~ /_sales/) ? "ar" : "ap";
  • print qq|
  • <input type=hidden name=nextsub value=generate_tax_report>
  • <input type=hidden name=db value=$form->{db}>
  • <input type=hidden name=sort value=transdate>
  • <input type=hidden name=report value=$form->{report}>
  • <tr>
  • <th align=right>|.$locale->text('From').qq|</th>
  • <td><input name=fromdate size=11 title="$myconfig{dateformat}" value=$form->{fromdate}></td>
  • <th align=right>|.$locale->text('To').qq|</th>
  • <td><input name=todate size=11 title="$myconfig{dateformat}"></td>
  • </tr>
  • $selectfrom
  • $summary
  • <tr>
  • <th align=right>|.$locale->text('Method').qq|</th>
  • <td colspan=3><input name=method class=radio type=radio value=accrual checked>|.$locale->text('Accrual').qq|
  • &nbsp;<input name=method class=radio type=radio value=cash>|.$locale->text('Cash').qq|</td>
  • </tr>
  • <tr>
  • <th align=right>|.$locale->text('Include in Report').qq|</th>
  • <td colspan=3>
  • <table>
  • <tr>
  • <td><input name="l_id" class=checkbox type=checkbox value=Y></td>
  • <td>|.$locale->text('ID').qq|</td>
  • <td><input name="l_invnumber" class=checkbox type=checkbox value=Y checked></td>
  • <td>|.$locale->text('Invoice').qq|</td>
  • <td><input name="l_transdate" class=checkbox type=checkbox value=Y checked></td>
  • <td>|.$locale->text('Date').qq|</td>
  • </tr>
  • <tr>
  • <td><input name="l_name" class=checkbox type=checkbox value=Y checked></td>
  • |;
  • if ($form->{db} eq 'ar') {
  • print qq|<td>|.$locale->text('Customer').qq|</td>|;
  • }
  • if ($form->{db} eq 'ap') {
  • print qq|<td>|.$locale->text('Vendor').qq|</td>|;
  • }
  • print qq|
  • <td><input name="l_description" class=checkbox type=checkbox value=Y checked></td>
  • <td>|.$locale->text('Description').qq|</td>
  • <td><input name="l_netamount" class=checkbox type=checkbox value=Y checked></td>
  • <td>|.$locale->text('Amount').qq|</td>
  • </tr>
  • <tr>
  • <td><input name="l_subtotal" class=checkbox type=checkbox value=Y></td>
  • <td>|.$locale->text('Subtotal').qq|</td>
  • </tr>
  • </table>
  • </td>
  • </tr>
  • |;
  • }
  • 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';
  • } else {
  • $label = $locale->text('Vendor');
  • $form->{vc} = 'vendor';
  • }
  • $nextsub = "generate_$form->{report}";
  • # setup vc selection
  • $form->all_vc(\%myconfig, $form->{vc}, ($form->{vc} eq 'customer') ? "AR" : "AP");
  • for (@{ $form->{"all_$form->{vc}"} }) { $vc .= qq|<option value="$_->{name}--$_->{id}">$_->{name}\n| }
  • $vc = ($vc) ? qq|<select name=$form->{vc}><option>\n$vc</select>| : qq|<input name=$form->{vc} size=35>|;
  • $postscript = "postscript" if $myconfig{printer};
  • print qq|
  • <tr>
  • <th align=right>|.$locale->text($label).qq|</th>
  • <td>$vc</td>
  • </tr>
  • <tr>
  • <th align=right>|.$locale->text('To').qq|</th>
  • <td><input name=todate size=11 title="$myconfig{dateformat}"></td>
  • </tr>
  • $selectto
  • <input type=hidden name=type value=statement>
  • <input type=hidden name=format value=$postscript>
  • <input type=hidden name=media value="$myconfig{printer}">
  • <input type=hidden name=nextsub value=$nextsub>
  • <input type=hidden name=action value=$nextsub>
  • $summary
  • <tr>
  • <table>
  • <tr>
  • <th>|.$locale->text('Include in Report').qq|</th>
  • <td>
  • <table>
  • <tr>
  • <td nowrap><input name=overdue type=radio class=radio value=0 checked> |.$locale->text('Aged').qq|</td>
  • <td nowrap><input name=overdue type=radio class=radio value=1> |.$locale->text('Overdue').qq|</td>
  • </tr>
  • <tr>
  • <td nowrap width=70><input name=c0 type=checkbox class=checkbox value=1 checked> |.$locale->text('Current').qq|</td>
  • <td nowrap width=70><input name=c30 type=checkbox class=checkbox value=1 checked> 30</td>
  • <td nowrap width=70><input name=c60 type=checkbox class=checkbox value=1 checked> 60</td>
  • <td nowrap width=70><input name=c90 type=checkbox class=checkbox value=1 checked> 90</td>
  • </td>
  • </tr>
  • </table>
  • </td>
  • </tr>
  • </table>
  • </tr>
  • |;
  • }
  • # 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);
  • $selection = "<option>\n";
  • foreach $ref (@{ $form->{PR} }) {
  • $paymentaccounts .= "$ref->{accno} ";
  • $selection .= "<option>$ref->{accno}--$ref->{description}\n";
  • }
  • chop $paymentaccounts;
  • print qq|
  • <input type=hidden name=nextsub value=list_payments>
  • <tr>
  • <th align=right nowrap>|.$locale->text('Account').qq|</th>
  • <td colspan=3><select name=account>$selection</select>
  • <input type=hidden name=paymentaccounts value="$paymentaccounts">
  • </td>
  • </tr>
  • <tr>
  • <th align=right nowrap>|.$locale->text('Description').qq|</th>
  • <td colspan=3><input name=description size=35></td>
  • </tr>
  • <tr>
  • <th align=right nowrap>|.$locale->text('Source').qq|</th>
  • <td colspan=3><input name=source></td>
  • </tr>
  • <tr>
  • <th align=right nowrap>|.$locale->text('Memo').qq|</th>
  • <td colspan=3><input name=memo size=30></td>
  • </tr>
  • <tr>
  • <th align=right>|.$locale->text('From').qq|</th>
  • <td><input name=fromdate size=11 title="$myconfig{dateformat}" value=$form->{fromdate}></td>
  • <th align=right>|.$locale->text('To').qq|</th>
  • <td><input name=todate size=11 title="$myconfig{dateformat}"></td>
  • </tr>
  • $selectfrom
  • <tr>
  • <td align=right><input type=checkbox class=checkbox name=fx_transaction value=1 checked></td>
  • <td colspan=3>|.$locale->text('Include Exchange Rate Difference').qq|</td>
  • </tr>
  • <tr>
  • <td align=right><input name=l_subtotal class=checkbox type=checkbox value=Y></td>
  • <td align=left colspan=3>|.$locale->text('Subtotal').qq|</th>
  • </tr>
  • <input type=hidden name=db value=$form->{db}>
  • <input type=hidden name=sort value=transdate>
  • |;
  • }
  • print qq|
  • $gifi
  • </table>
  • </td>
  • </tr>
  • <tr>
  • <td><hr size=3 noshade></td>
  • </tr>
  • </table>
  • <br>
  • <input type="hidden" name="path" value="$form->{path}">
  • <input type="hidden" name="login" value="$form->{login}">
  • <input type="hidden" name="sessionid" value="$form->{sessionid}">
  • <button type="submit" class="submit" name="action" value="continue">|.$locale->text('Continue').qq|</button>
  • </form>
  • |;
  • if ($form->{lynx}) {
  • require "bin/menu.pl";
  • &menubar;
  • }
  • print qq|
  • </body>
  • </html>
  • |;
  • }
  • sub continue { &{$form->{nextsub}} };
  • sub generate_inv_activity {
  • $form->header;
  • RP->inventory_activity(\%myconfig, \%$form);
  • $title = $form->escape($form->{title});
  • # if ($form->{department}) {
  • # ($department) = split /--/, $form->{department};
  • # $options = $locale->text('Department')." : $department<br>";
  • # $department = $form->escape($form->{department});
  • # }
  • ## if ($form->{projectnumber}) {
  • # ($projectnumber) = split /--/, $form->{projectnumber};
  • # $options .= $locale->text('Project Number')." : $projectnumber<br>";
  • # $projectnumber = $form->escape($form->{projectnumber});
  • # }
  • # if there are any dates
  • if ($form->{fromdate} || $form->{todate}) {
  • if ($form->{fromdate}) {
  • $fromdate = $locale->date(\%myconfig, $form->{fromdate}, 1);
  • }
  • if ($form->{todate}) {
  • $todate = $locale->date(\%myconfig, $form->{todate}, 1);
  • }
  • $form->{period} = "$fromdate - $todate";
  • } else {
  • $form->{period} = $locale->date(\%myconfig, $form->current_date(\%myconfig), 1);
  • }
  • $options .= $form->{period};
  • @column_index = qw(partnumber description sold revenue received expense);
  • $href = qq|rp.pl?path=$form->{path}&action=continue&accounttype=$form->{accounttype}&login=$form->{login}&sessionid=$form->{sessionid}&fromdate=$form->{fromdate}&todate=$form->{todate}&l_heading=$form->{l_heading}&l_subtotal=$form->{l_subtotal}&department=$department&projectnumber=$projectnumber&project_id=$form->{project_id}&title=$title&nextsub=$form->{nextsub}|;
  • $column_header{partnumber} = qq|
  • <th class=listheading><a class=listheading href="$href&sort_col=partnumber">|
  • .$locale->text('Part Number').qq|</a></th>|;
  • $column_header{description} = qq|
  • <th class=listheading><a class=listheading href="$href&sort_col=description">|
  • .$locale->text('Description').qq|</a></th>|;
  • $column_header{sold} = qq|
  • <th class=listheading><a class=listheading href="$href&sort_col=sold">|
  • .$locale->text('Sold').qq|</a></th>|;
  • $column_header{revenue} = qq|
  • <th class=listheading><a class=listheading href="$href&sort_col=revenue">|
  • .$locale->text('Revenue').qq|</a></th>|;
  • $column_header{received} = qq|
  • <th class=listheading><a class=listheading href="$href&sort_col=received">|
  • .$locale->text('Received').qq|</a></th>|;
  • $column_header{expense} = qq|
  • <th class=listheading><a class=listheading href="$href&sort_col=expense">|
  • .$locale->text('Expense').qq|</a></th>|;
  • print qq|
  • <body>
  • <table width=100%>
  • <tr>
  • <th class=listtop>$form->{title}</th>
  • </tr>
  • <tr height="5"></tr>
  • <tr>
  • <td>$options</td>
  • </tr>
  • <tr>
  • <td>
  • <table width=100%>
  • <tr>|;
  • map { print "$column_header{$_}\n" } @column_index;
  • print qq|
  • </tr>
  • |;
  • if ($form->{sort_col} eq 'qty' || $form->{sort_col} eq 'revenue'){
  • $form->{sort_type} = 'numeric';
  • }
  • $i = 0;
  • $cols = "l_transdate=Y&l_name=Y&l_invnumber=Y&summary=1";
  • $dates= "transdatefrom=$form->{fromdate}&transdateto=$form->{todate}&year=$form->{fromyear}&month=$form->{frommonth}&interval=$form->{interval}";
  • $base="path=$form->{path}&login=$form->{login}&sessionid=$form->{sessionid}";
  • $form->{callback} = "rp.pl?action=continue&$base";
  • $form->{callback} = $form->escape($form->{callback});
  • $callback = "callback=$form->{callback}";
  • # sort the whole thing by account numbers and display
  • foreach $ref (@{ $form->{TB} }) {
  • $description = $form->escape($ref->{description});
  • $i = $i % 2;