[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[5373] trunk
- Subject: SF.net SVN: ledger-smb:[5373] trunk
- From: ..hidden..
- Date: Mon, 17 Dec 2012 11:06:17 +0000
Revision: 5373
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5373&view=rev
Author: einhverfr
Date: 2012-12-17 11:06:17 +0000 (Mon, 17 Dec 2012)
Log Message:
-----------
Payment and receipts reports moved to new framework
Modified Paths:
--------------
trunk/LedgerSMB/RP.pm
trunk/LedgerSMB/Report/Invoices/Payments.pm
trunk/UI/Reports/filters/payments.html
trunk/bin/rp.pl
trunk/sql/Pg-database.sql
trunk/sql/modules/LOADORDER
trunk/sql/modules/menu_rebuild.sql
Removed Paths:
-------------
trunk/UI/rp-payments.html
trunk/UI/rp-search-payments.html
trunk/UI/rp-search-projects.html
Modified: trunk/LedgerSMB/RP.pm
===================================================================
--- trunk/LedgerSMB/RP.pm 2012-12-17 10:39:45 UTC (rev 5372)
+++ trunk/LedgerSMB/RP.pm 2012-12-17 11:06:17 UTC (rev 5373)
@@ -1007,199 +1007,6 @@
}
-sub paymentaccounts {
- my ( $self, $myconfig, $form ) = @_;
-
- my $dbh = $form->{dbh};
-
- my $ARAP = uc $form->{db};
-
- # get A(R|P)_paid accounts
- my $query = qq|
- SELECT accno, description FROM chart
- WHERE link LIKE '%${ARAP}_paid%'
- ORDER BY accno|;
- my $sth = $dbh->prepare($query);
- $sth->execute || $form->dberror($query);
-
- while ( my $ref = $sth->fetchrow_hashref(NAME_lc) ) {
- push @{ $form->{PR} }, $ref;
- }
- $sth->finish;
-
- $form->all_years( $myconfig, $dbh );
-
- $dbh->{dbh};
-
-}
-
-sub payments {
- my ( $self, $myconfig, $form ) = @_;
-
- my $dbh = $form->{dbh};
-
- my $ml = 1;
- if ( $form->{db} eq 'ar' ) {
- $table = 'customer';
- $account_class = 2;
- $ml = -1;
- } else {
- $table = 'vendor';
- $account_class = 1;
- $form->{db} = 'ap';
- }
-
- my $query;
- my $sth;
- my $dpt_join;
- my $where;
- my $var;
-
- if ( $form->{department_id} ) {
- $dpt_join = qq| JOIN dpt_trans t ON (t.trans_id = ac.trans_id)|;
-
- $where =
- qq| AND t.department_id = | . $dbh->quote( $form->{department_id} );
- }
-
- ( $form->{fromdate}, $form->{todate} ) =
- $form->from_to( $form->{fromyear}, $form->{frommonth}, $form->{interval} )
- if $form->{fromyear} && $form->{frommonth};
-
- if ( $form->{fromdate} ) {
- $where .= " AND ac.transdate >= " . $dbh->quote( $form->{fromdate} );
- }
- if ($form->{meta_number} ) {
- $where .= " AND c.meta_number = " . $dbh->quote($form->{meta_number});
- }
- if ( $form->{todate} ) {
- $where .= " AND ac.transdate <= " . $dbh->quote( $form->{todate} );
- }
- if ( !$form->{fx_transaction} ) {
- $where .= " AND ac.fx_transaction = '0'";
- }
-
- if ( $form->{description} ne "" ) {
- $var = $dbh->quote( $form->like( lc $form->{description} ) );
- $where .= " AND lower(ce.name) LIKE $var";
- }
- if ( $form->{source} ne "" ) {
- $var = $dbh->quote( $form->like( lc $form->{source} ) );
- $where .= " AND lower(ac.source) LIKE $var";
- }
- if ( $form->{memo} ne "" ) {
- $var = $dbh->quote( $form->like( lc $form->{memo} ) );
- $where .= " AND lower(ac.memo) LIKE $var";
- }
-
- my %ordinal = (
- 'name' => 1,
- 'transdate' => 2,
- 'source' => 4,
- 'employee' => 6,
- 'till' => 7
- );
-
- my @a = qw(name transdate employee);
- my $sortorder = $form->sort_order( ..hidden.., \%ordinal );
-
- my $glwhere = $where;
- $glwhere =~ s/\(ce.name\)/\(g.description\)/;
-
- # cycle through each id
- foreach my $accno ( split( / /, $form->{paymentaccounts} ) ) {
-
- $query = qq|
- SELECT id, accno, description
- FROM chart
- WHERE accno = ?|;
- $sth = $dbh->prepare($query);
- $sth->execute($accno) || $form->dberror($query);
-
- my $ref = $sth->fetchrow_hashref(NAME_lc);
- push @{ $form->{PR} }, $ref;
- $sth->finish;
-
- $query = qq|
- SELECT ce.name, ac.transdate,
- sum(ac.amount) * $ml AS paid, ac.source,
- ac.memo, ee.name AS employee, a.till, a.curr,
- c.meta_number,
- b.control_code as batch_control,
- b.description AS batch_description
- FROM acc_trans ac
- JOIN $form->{db} a ON (ac.trans_id = a.id)
- JOIN entity_credit_account c ON
- (c.id = a.entity_credit_account)
- JOIN entity ce ON (ce.id = c.entity_id)
- LEFT JOIN entity_employee e ON
- (a.person_id = e.entity_id)
- LEFT JOIN entity ee ON (e.entity_id = ee.id)
- LEFT JOIN voucher v ON (ac.voucher_id = v.id)
- LEFT JOIN batch b ON (b.id = v.batch_id)
- $dpt_join
- WHERE ac.chart_id = $ref->{id}
- AND ac.approved AND a.approved
- $where|;
-
- if ( $form->{till} ne "" ) {
- $query .= " AND a.invoice = '1' AND NOT a.till IS NULL";
-
- if ( $myconfig->{role} eq 'user' ) {
- $query .= " AND e.login = '$form->{login}'";
- }
- }
-
- $query .= qq|
- GROUP BY ce.name, ac.transdate, ac.source, ac.memo,
- ee.name, a.till, a.curr, c.meta_number,
- b.control_code, b.description|;
-
- if ( $form->{till} eq "" && !$form->{meta_number}) {
-
- $query .= qq|
- UNION
- SELECT g.description, ac.transdate,
- sum(ac.amount) * $ml AS paid, ac.source,
- ac.memo, ee.name AS employee, '' AS till,
- '' AS curr, '' AS meta_number,
- b.control_code as batch_control,
- b.description AS batch_description
- FROM acc_trans ac
- JOIN gl g ON (g.id = ac.trans_id)
- LEFT
- JOIN entity_employee e ON
- (g.person_id = e.entity_id)
- JOIN entity ee ON (e.entity_id = ee.id)
- LEFT JOIN voucher v ON (ac.voucher_id = v.id)
- LEFT JOIN batch b ON (b.id = v.batch_id)
- $dpt_join
- WHERE ac.chart_id = $ref->{id} $glwhere
- AND ac.approved AND g.approved
- AND (ac.amount * $ml) > 0
- GROUP BY g.description, ac.transdate,
- ac.source, ac.memo, ee.name,
- b.control_code, b.description|;
-
- }
-
- $query .= qq| ORDER BY $sortorder|;
-
- $sth = $dbh->prepare($query);
- $sth->execute || $form->dberror($query);
-
- while ( my $pr = $sth->fetchrow_hashref(NAME_lc) ) {
- $form->db_parse_numeric(sth=>$sth, hashref=>$pr);
- push @{ $form->{ $ref->{id} } }, $pr;
- }
- $sth->finish;
-
- }
-
- $dbh->commit;
-
-}
-
sub inventory_accounts {
my ( $self, $myconfig, $form ) = @_;
my $dbh = $form->{dbh};
Modified: trunk/LedgerSMB/Report/Invoices/Payments.pm
===================================================================
--- trunk/LedgerSMB/Report/Invoices/Payments.pm 2012-12-17 10:39:45 UTC (rev 5372)
+++ trunk/LedgerSMB/Report/Invoices/Payments.pm 2012-12-17 11:06:17 UTC (rev 5373)
@@ -115,7 +115,7 @@
} else {
die 'Invalid entity class';
}
- return [
+ my $cols = [
{col_id => 'select',
name => LedgerSMB::Report::text('Selected'),
type => 'checkbox'},
@@ -151,6 +151,8 @@
type => 'text',
name => LedgerSMB::Report::text('Batch'), },
];
+ shift @$cols unless $self->batch_id;
+ return $cols;
}
=head2 header_lines
Modified: trunk/UI/Reports/filters/payments.html
===================================================================
--- trunk/UI/Reports/filters/payments.html 2012-12-17 10:39:45 UTC (rev 5372)
+++ trunk/UI/Reports/filters/payments.html 2012-12-17 11:06:17 UTC (rev 5373)
@@ -9,9 +9,13 @@
PROCESS 'report_base.html';
IF ! entity_class.defined; entity_class = account_class; END ?>
<body>
-<?lsmb IF account_class == 2 ?><?lsmb contact_type = "Customer" -?>
-<?lsmb ELSIF account_class == 1 ?><?lsmb contact_type = "Vendor" -?>
-<?lsmb ELSE ?><?lsmb contact_type = "Unsupported" -?>
+<?lsmb IF account_class == 2;
+ CONTACT = "Customer Number";
+ TITLE = text('Search Receipts'); #'
+ ELSIF account_class == 1;
+ CONTACT = "Vendor Number";
+ TITLE = text('Search Payments'); #'
+ ELSE ?><?lsmb TITLE = "Unsupported" -?>
<?lsmb END # if account_class -?>
<!-- CT: Text strings for localization:
<?lsmb text('Customer Number') ?>
@@ -30,7 +34,7 @@
name = "entity_class"
value = entity_class
} ?>
-<div class="listtop" id="page_title"><?lsmb text('Search Payments') ?></div>
+<div class="listtop" id="page_title"><?lsmb TITLE ?></div>
<div class="input" id="vendor_input_div">
<?lsmb INCLUDE input element_data = {
name = "meta_number"
@@ -38,7 +42,7 @@
class = "text"
type = "text"
size = "20"
- label = text("$contact_type Number") # "
+ label = CONTACT
} ?><!-- CT: Not yet working for search.
<?lsmb INCLUDE input element_data = {
name = "name"
Deleted: trunk/UI/rp-payments.html
===================================================================
--- trunk/UI/rp-payments.html 2012-12-17 10:39:45 UTC (rev 5372)
+++ trunk/UI/rp-payments.html 2012-12-17 11:06:17 UTC (rev 5373)
@@ -1,72 +0,0 @@
-<?lsmb INCLUDE 'ui-header.html' ?>
-<?lsmb PROCESS elements.html ?>
-<body>
-<form method="post" action="<?lsmb form.script ?>">
-<table width="100%">
- <tr>
- <th class="listtop" colspan="<?lsmb columns.size ?>"><?lsmb form.title ?></th>
- </tr>
- <tr>
- <?lsmb IF options.defined ?>
- <td colspan="<?lsmb columns.size ?>"><?lsmb FOREACH option IN options; option ?><br /><?lsmb END ?></td>
- <?lsmb ELSE ?>
- <td colspan="<?lsmb columns.size ?>"></td></tr>
- <?lsmb END ?>
- </tr>
- <tr class="listheading">
-<?lsmb FOREACH column IN columns ?>
-<th class="listtop">
- <?lsmb IF heading.$column.href ?><a class="listtop" href="<?lsmb heading.$column.href ?>"><?lsmb heading.$column.text ?></a>
- <?lsmb ELSE; heading.$column; END ?>
- </th>
-<?lsmb END ?>
- </tr>
- <?lsmb FOREACH account IN accounts ?>
- <tr><th colspan="<?lsmb columns.size ?>"><?lsmb account.header ?></th></tr>
-<?lsmb FOREACH row IN account.rows ?>
-<?lsmb IF row.class == 'heading'; s = 'th'; c = 'listheading';
- ELSIF row.class == 'subtotal'; s = 'th'; c = 'listsubtotal';
- ELSE; s = 'td'; c = "listrow${row.i}"; END ?>
-<tr class="<?lsmb c ?>">
- <?lsmb FOREACH column IN columns ?>
- <<?lsmb s ?> class="<?lsmb c ?>" <?lsmb IF (!row.class.defined || row.class != 'heading') && row_alignment.$column ?>align="<?lsmb row_alignment.$column ?>"<?lsmb END ?>>
- <?lsmb IF row.$column.href ?>
- <a href="<?lsmb row.$column.href?>"><?lsmb row.$column.text ?></a>
- <?lsmb ELSIF row.$column.delimiter;
- FOREACH l IN row.$column.text.split(row.$column.delimiter); l ?><br /><?lsmb END;
- ELSIF row.$column.options; PROCESS select element_data=row.$column;
- ELSIF column == 'statement' AND row.$column.type.defined;
- PROCESS input element_data=row.$column;
- ELSE; row.$column; END ?>
- </<?lsmb s ?>>
- <?lsmb END ?>
-</tr>
-<?lsmb END ?>
-<?lsmb IF account.totals ?>
-<tr class="listtotal">
- <?lsmb FOREACH column IN columns ?>
- <th class="listtotal" align="right"><?lsmb account.totals.$column ?></th>
- <?lsmb END ?>
-</tr>
-<?lsmb END ?>
-<?lsmb END ?>
-<tr class="listtotal">
- <?lsmb FOREACH column IN columns ?>
- <th class="listtotal" align="right"><?lsmb account.totals.$column ?></th>
- <?lsmb END ?>
-</tr>
- <tr><td colspan="<?lsmb columns.size ?>"><hr size="3" /></td></tr>
-</table>
-
-<br />
-
-<?lsmb FOREACH hidden IN hiddens.keys;
- PROCESS input element_data={
- type => 'hidden',
- name => hidden,
- value => hiddens.item(hidden)
- }; END ?>
-<?lsmb FOREACH button IN buttons; PROCESS button element_data=button; END ?>
-</form>
-</body>
-</html>
Deleted: trunk/UI/rp-search-payments.html
===================================================================
--- trunk/UI/rp-search-payments.html 2012-12-17 10:39:45 UTC (rev 5372)
+++ trunk/UI/rp-search-payments.html 2012-12-17 11:06:17 UTC (rev 5373)
@@ -1,101 +0,0 @@
- <tr>
- <th align="right"><?lsmb text('Account') ?></th>
- <td colspan="3"><?lsmb PROCESS select element_data=form.paymentaccounts ?></td>
- </tr>
- <tr>
- <th aligh="right"><?lsmb text(form.meta_number_text) ?></th>
- <td colpan="3"><?lsmb INCLUDE input element_data = {
- name = "meta_number"
- size = '35'
- } ?></td>
- <tr>
- <th align="right"><?lsmb text('Description') ?></th>
- <td colspan="3"><?lsmb PROCESS input element_data={
- name => 'description',
- size => '35',
- } ?></td>
- </tr>
- <tr>
- <th align="right"><?lsmb text('Source') ?></th>
- <td colspan="3"><?lsmb PROCESS input element_data={name => 'source'} ?></td>
- </tr>
- <tr>
- <th align="right"><?lsmb text('Memo') ?></th>
- <td colspan="3"><?lsmb PROCESS input element_data={
- name => 'memo',
- size => '30',
- } ?></td>
- </tr>
- <tr>
- <th align="right"><?lsmb text('From') ?></th>
- <td><?lsmb PROCESS input element_data={
- class => 'date',
- name => 'fromdate',
- size => '11',
- title => user.dateformat,
- value => form.fromdate,
- } ?></td>
- <th align="right"><?lsmb text('To') ?></th>
- <td><?lsmb PROCESS input element_data={
- class => 'date',
- name => 'todate',
- size => '11',
- title => user.dateformat,
- value => form.todate,
- } ?></td>
- </tr>
-<?lsmb IF form.selectaccountingyear.defined ?>
- <tr>
- <th align="right"><?lsmb text('Period') ?></th>
- <td colspan="3">
- <?lsmb PROCESS select element_data=form.selectaccountingmonth -?>
- <?lsmb PROCESS select element_data=form.selectaccountingyear -?>
- <?lsmb PROCESS input element_data={
- type => 'radio',
- name => 'interval',
- value => '0',
- label => text('Current'),
- checked => 'checked',
- } -?>
- <?lsmb PROCESS input element_data={
- type => 'radio',
- name => 'interval',
- value => '1',
- label => text('Month'),
- } -?>
- <?lsmb PROCESS input element_data={
- type => 'radio',
- name => 'interval',
- value => '3',
- label => text('Quarter'),
- } -?>
- <?lsmb PROCESS input element_data={
- type => 'radio',
- name => 'interval',
- value => '12',
- label => text('Year'),
- } -?>
- </td>
- </tr>
-<?lsmb END ?>
- <tr>
- <td align="right">
-<?lsmb PROCESS input element_data={
- type => 'checkbox',
- name => 'fx_transaction',
- value => '1',
- checked => 'checked',
- } -?>
- </td>
- <td colspan="3"><?lsmb text('Include Exchange Rate Difference') ?></td>
- </tr>
- <tr>
- <td align="right">
-<?lsmb PROCESS input element_data={
- type => 'checkbox',
- name => 'l_subtotal',
- value => 'Y',
- } -?>
- </td>
- <td colspan="3"><?lsmb text('Subtotal') ?></td>
- </tr>
Deleted: trunk/UI/rp-search-projects.html
===================================================================
--- trunk/UI/rp-search-projects.html 2012-12-17 10:39:45 UTC (rev 5372)
+++ trunk/UI/rp-search-projects.html 2012-12-17 11:06:17 UTC (rev 5373)
@@ -1,79 +0,0 @@
- <tr>
- <th align="right"><?lsmb text('Project') ?></th>
- <td colspan="3"><?lsmb PROCESS select element_data=form.selectproject ?></td>
- </tr>
- <tr>
- <th align="right"><?lsmb text('From') ?></th>
- <td><?lsmb PROCESS input element_data={
- class => 'date',
- name => 'fromdate',
- size => '11',
- title => user.dateformat,
- value => form.fromdate,
- } ?></td>
- <th align="right"><?lsmb text('To') ?></th>
- <td><?lsmb PROCESS input element_data={
- class => 'date',
- name => 'todate',
- size => '11',
- title => user.dateformat,
- value => form.todate,
- } ?></td>
- </tr>
-<?lsmb IF form.selectaccountingyear.defined ?>
- <tr>
- <th align="right"><?lsmb text('Period') ?></th>
- <td colspan="3">
- <?lsmb PROCESS select element_data=form.selectaccountingmonth -?>
- <?lsmb PROCESS select element_data=form.selectaccountingyear -?>
- <?lsmb PROCESS input element_data={
- type => 'radio',
- name => 'interval',
- value => '0',
- label => text('Current'),
- checked => 'checked',
- } -?>
- <?lsmb PROCESS input element_data={
- type => 'radio',
- name => 'interval',
- value => '1',
- label => text('Month'),
- } -?>
- <?lsmb PROCESS input element_data={
- type => 'radio',
- name => 'interval',
- value => '3',
- label => text('Quarter'),
- } -?>
- <?lsmb PROCESS input element_data={
- type => 'radio',
- name => 'interval',
- value => '12',
- label => text('Year'),
- } -?>
- </td>
- </tr>
-<?lsmb END ?>
- </table>
- </td>
-</tr>
-<tr>
- <td>
- <table>
- <tr>
- <th align="right"><?lsmb text('Include in Report') ?></th>
- <td>
-<?lsmb PROCESS input element_data={
- name => 'l_heading',
- type => 'checkbox',
- value => 'Y',
- label => text('Heading'),
- } -?>
-<?lsmb PROCESS input element_data={
- name => 'l_subtotal',
- type => 'checkbox',
- value => 'Y',
- label => text('Subtotal'),
- } -?>
- </td>
- </tr>
Modified: trunk/bin/rp.pl
===================================================================
--- trunk/bin/rp.pl 2012-12-17 10:39:45 UTC (rev 5372)
+++ trunk/bin/rp.pl 2012-12-17 11:06:17 UTC (rev 5373)
@@ -147,36 +147,6 @@
} elsif ( $form->{report} eq "balance_sheet" ) {
$hiddens{nextsub} = 'generate_balance_sheet';
$subform = 'generate_balance_sheet';
- } elsif ( $form->{report} =~ /(receipts|payments)$/ ) {
- $gifi = 0;
- $subform = 'payments';
-
- $form->{db} = ( $form->{report} =~ /payments$/ ) ? "ap" : "ar";
- if($form->{db} eq 'ar'){$form->{meta_number_text}='Customer Number';}
- else {$form->{meta_number_text}='Vendor Number';}
-
- RP->paymentaccounts( \%myconfig, \%$form );
-
- my $paymentaccounts = '';
- $form->{paymentaccounts} = {
- name => 'account',
- options => [{text => '', value => ''}],
- };
- foreach $ref ( @{ $form->{PR} } ) {
- $paymentaccounts .= "$ref->{accno} ";
- push @{$form->{paymentaccounts}{options}}, {
- text => "$ref->{accno}--$ref->{description}",
- value => "$ref->{accno}--$ref->{description}",
- };
- }
-
- chop $paymentaccounts;
-
- $hiddens{nextsub} = 'list_payments';
- $hiddens{paymentaccounts} = $paymentaccounts;
- $hiddens{db} = $form->{db};
- $hiddens{sort} = 'transdate';
-
}
#$form->{login} = 'test';TODO meaning?
@@ -687,232 +657,4 @@
});
}
-sub list_payments {
-
- my %hiddens;
- my @options;
- my $meta_number_text;
- if($form->{db} eq 'ar'){$meta_number_text='Customer Number';}
- else {$meta_number_text='Vendor Number';}
- if ( $form->{account} ) {
- ( $form->{paymentaccounts} ) = split /--/, $form->{account};
- }
- if ( $form->{department} ) {
- ( $department, $form->{department_id} ) = split /--/,
- $form->{department};
- push @options, $locale->text('Department: [_1]', $department);
- }
-
- RP->payments( \%myconfig, \%$form );
-
- my @columns = $form->sort_columns(qw(meta_number transdate name paid source
- memo batch_control batch_description));
-
- if ( $form->{till} ) {
- @columns =
- $form->sort_columns(qw(transdate name paid curr source meta_number till));
- if ( $myconfig{role} ne 'user' ) {
- @columns =
- $form->sort_columns(
- qw(transdate name paid curr source till employee));
- }
- }
-
- # construct href
- my $title = $form->escape( $form->{title} );
- $form->{paymentaccounts} =~ s/ /%20/g;
-
- my $href =
-"$form->{script}?path=$form->{path}&direction=$form->{direction}&sort=$form->{sort}&oldsort=$form->{oldsort}&action=list_payments&till=$form->{till}&login=$form->{login}&sessionid=$form->{sessionid}&fromdate=$form->{fromdate}&todate=$form->{todate}&fx_transaction=$form->{fx_transaction}&db=$form->{db}&l_subtotal=$form->{l_subtotal}&prepayment=$form->{prepayment}&paymentaccounts=$form->{paymentaccounts}&title="
- . $form->escape( $form->{title} );
-
- $form->sort_order();
-
- $form->{callback} =
-"$form->{script}?path=$form->{path}&direction=$form->{direction}&sort=$form->{sort}&oldsort=$form->{oldsort}&action=list_payments&till=$form->{till}&login=$form->{login}&sessionid=$form->{sessionid}&fromdate=$form->{fromdate}&todate=$form->{todate}&fx_transaction=$form->{fx_transaction}&db=$form->{db}&l_subtotal=$form->{l_subtotal}&prepayment=$form->{prepayment}&paymentaccounts=$form->{paymentaccounts}&title="
- . $form->escape( $form->{title}, 1 );
-
- my $callback;
- if ( $form->{account} ) {
- $callback .= "&account=" . $form->escape( $form->{account}, 1 );
- $href .= "&account=" . $form->escape( $form->{account} );
- push @options, $locale->text('Account: [_1]', $form->{account});
- }
- if ( $form->{department} ) {
- $callback .= "&department=" . $form->escape( $form->{department}, 1 );
- $href .= "&department=" . $form->escape( $form->{department} );
- push @options, $locale->text('Department: [_1]', $form->{department});
- }
- if ( $form->{description} ) {
- $callback .= "&description=" . $form->escape( $form->{description}, 1 );
- $href .= "&description=" . $form->escape( $form->{description} );
- push @options, $locale->text('Description: [_1]', $form->{description});
- }
- if ( $form->{source} ) {
- $callback .= "&source=" . $form->escape( $form->{source}, 1 );
- $href .= "&source=" . $form->escape( $form->{source} );
- push @options, $locale->text('Source: [_1]', $form->{source});
- }
- if ( $form->{memo} ) {
- $callback .= "&memo=" . $form->escape( $form->{memo}, 1 );
- $href .= "&memo=" . $form->escape( $form->{memo} );
- push @options, $locale->text('Memo: [_1]', $form->{memo});
- }
- if ( $form->{fromdate} ) {
- push @options,
- $locale->text('From [_1]',
- $locale->date( \%myconfig, $form->{fromdate}, 1 ));
- }
- if ( $form->{todate} ) {
- push @options,
- $locale->text('To [_1]',
- $locale->date( \%myconfig, $form->{todate}, 1 ));
- }
-
- $callback = $form->escape( $form->{callback} );
-
- my %column_header;
- $column_header{name} = {
- href => "$href&sort=name",
- text => $locale->text('Description'),
- };
- $column_header{transdate} = {
- href => "$href&sort=transdate",
- text => $locale->text('Date'),
- };
- $column_header{paid} = $locale->text('Amount');
- $column_header{batch_control} = $locale->text('Batch');
- $column_header{batch_description} = $locale->text('Batch Description');
- $column_header{curr} = $locale->text('Curr');
- $column_header{memo} = $locale->text('Memo');
- $column_header{source} = {
- href => "$href&sort=source",
- text => $locale->text('Source'),
- };
- $column_header{meta_number} = {
- href => "$href&sort=meta_number",
- text => $locale->text($meta_number_text),
- };
- $column_header{employee} = {
- href => "$href&sort=employee",
- text => $locale->text('Salesperson'),
- };
- $column_header{till} = {
- href => "$href&sort=till",
- text => $locale->text('Till'),
- };
-
- my @column_index = @columns;
-
- my @accounts;
- my $i;
- foreach my $ref ( sort { $a->{accno} cmp $b->{accno} } @{ $form->{PR} } ) {
-
- next unless @{ $form->{ $ref->{id} } };
-
- push @accounts, {header => "$ref->{accno}--$ref->{description}"};
-
- if ( @{ $form->{ $ref->{id} } } ) {
- $sameitem = $form->{ $ref->{id} }[0]->{ $form->{sort} };
- }
-
- my @rows;
- foreach my $payment ( @{ $form->{ $ref->{id} } } ) {
-
- if ( $form->{l_subtotal} ) {
- if ( $payment->{ $form->{sort} } ne $sameitem ) {
-
- # print subtotal
- push @rows, &payment_subtotal(..hidden..);
- }
- }
-
- next if ( $form->{till} && !$payment->{till} );
-
- my %column_data;
- $column_data{meta_number} = $payment->{meta_number};
- $column_data{name} = $payment->{name};
- $column_data{transdate} = $payment->{transdate};
- $column_data{batch_control} = $payment->{batch_control};
- $column_data{batch_description} = $payment->{batch_description};
- $column_data{paid} =
- $form->format_amount(\%myconfig, $payment->{paid}, 2, ' ');
- $column_data{curr} = $payment->{curr};
- $column_data{source} = $payment->{source};
- $column_data{memo} = $payment->{memo};
- $column_data{employee} = $payment->{employee};
- $column_data{till} = $payment->{till};
-
- $subtotalpaid += $payment->{paid};
- $accounttotalpaid += $payment->{paid};
- $totalpaid += $payment->{paid};
-
- $i++;
- $i %= 2;
- $column_data{i} = $i;
- push @rows, \%column_data;
-
- $sameitem = $payment->{ $form->{sort} };
-
- }
- push @rows, &payment_subtotal(..hidden..) if $form->{l_subtotal};
- $accounts[$#accounts]{rows} = ..hidden..;
-
- # print account totals
- my %column_data;
- for (@column_index) { $column_data{$_} = ' ' }
-
- $column_data{paid} =
- $form->format_amount( \%myconfig, $accounttotalpaid, 2, ' ' );
-
- $accounts[$#accounts]{totals} = \%column_data;
- $accounttotalpaid = 0;
-
- }
-
- # prepare total
- my %column_data;
- for (@column_index) { $column_data{$_} = ' ' }
- $column_data{paid} = $form->format_amount( \%myconfig, $totalpaid, 2, ' ' );
-
-##SC: Temporary removal
-## if ( $form->{lynx} ) {
-## require "bin/menu.pl";
-## &menubar;
-## }
-
- my $template = LedgerSMB::Template->new_UI(
- user => \%myconfig,
- locale => $locale,
- template => 'rp-payments',
- );
- $template->render({
- form => $form,
- hiddens => \%hiddens,
- options => ..hidden..,
- columns => ..hidden..,
- heading => \%column_header,
- accounts => ..hidden..,
- totals => \%column_data,
- row_alignment => {
- paid => 'right',
- },
- });
-}
-
-sub payment_subtotal {
-
- my $column_index = shift;
- my %column_data;
- if ( $subtotalpaid != 0 ) {
- for (@column_index) { $column_data{$_} = ' ' }
-
- $column_data{paid} =
- $form->format_amount( \%myconfig, $subtotalpaid, 2, ' ' );
- $column_data{class} = 'subtotal';
- }
-
- $subtotalpaid = 0;
- \%column_data;
-}
-
+1;
Modified: trunk/sql/Pg-database.sql
===================================================================
--- trunk/sql/Pg-database.sql 2012-12-17 10:39:45 UTC (rev 5372)
+++ trunk/sql/Pg-database.sql 2012-12-17 11:06:17 UTC (rev 5373)
@@ -2950,12 +2950,6 @@
40 action add 97
40 transfer 1 98
41 menu 1 99
-42 module rp.pl 100
-42 action report 101
-42 report receipts 102
-43 module rp.pl 103
-43 action report 104
-43 report payments 105
44 report 1 110
46 menu 1 111
47 menu 1 112
@@ -3057,6 +3051,12 @@
25 module invoice.pl 57
5 report_name invoice_search 10
25 report_name invoice_search 59
+42 module payment.pl 100
+42 action get_search_criteria 101
+42 account_class 2 102
+43 action get_search_criteria 104
+43 module payment.pl 103
+43 account_class 1 105
84 action stock_assembly 203
85 menu 1 204
86 module ic.pl 205
Modified: trunk/sql/modules/LOADORDER
===================================================================
--- trunk/sql/modules/LOADORDER 2012-12-17 10:39:45 UTC (rev 5372)
+++ trunk/sql/modules/LOADORDER 2012-12-17 11:06:17 UTC (rev 5373)
@@ -2,6 +2,8 @@
# they shall be loaded.
Util.sql
App_Module.sql
+# Remove the one below once we get into rc
+menu_rebuild.sql
Menu.sql
Drafts.sql
Account.sql
Modified: trunk/sql/modules/menu_rebuild.sql
===================================================================
--- trunk/sql/modules/menu_rebuild.sql 2012-12-17 10:39:45 UTC (rev 5372)
+++ trunk/sql/modules/menu_rebuild.sql 2012-12-17 11:06:17 UTC (rev 5373)
@@ -190,12 +190,6 @@
40 action add 97
40 transfer 1 98
41 menu 1 99
-42 module rp.pl 100
-42 action report 101
-42 report receipts 102
-43 module rp.pl 103
-43 action report 104
-43 report payments 105
44 report 1 110
46 menu 1 111
47 menu 1 112
@@ -297,6 +291,12 @@
25 module invoice.pl 57
5 report_name invoice_search 10
25 report_name invoice_search 59
+42 module payment.pl 100
+42 action get_search_criteria 101
+42 account_class 2 102
+43 action get_search_criteria 104
+43 module payment.pl 103
+43 account_class 1 105
84 action stock_assembly 203
85 menu 1 204
86 module ic.pl 205
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.