Bugzilla – Attachment 55990 Details for
Bug 6934
New report Cash Register Statistics
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 6934: New features, note added to transaction information, total caculated for negative types of transaction
PASSED-QA-Bug-6934-New-features-note-added-to-tran.patch (text/plain), 6.20 KB, created by
Héctor Eduardo Castro Avalos
on 2016-10-03 21:28:52 UTC
(
hide
)
Description:
[PASSED QA] Bug 6934: New features, note added to transaction information, total caculated for negative types of transaction
Filename:
MIME Type:
Creator:
Héctor Eduardo Castro Avalos
Created:
2016-10-03 21:28:52 UTC
Size:
6.20 KB
patch
obsolete
>From 12c3fd35371ecbef39d56c8dfa864413038af5e8 Mon Sep 17 00:00:00 2001 >From: genevieve <genevieve@inlibro.com> >Date: Fri, 13 Nov 2015 11:50:01 -0500 >Subject: [PATCH] [PASSED QA] Bug 6934: New features, note added to > transaction information, total caculated for negative types > of transaction > >To be more specific, the column note from accountlines is now displayed in the table of the transactions. >The grand total is now calculated for neagtive types like Credit or Payment and isn't counted for Write off types. >Credit (return item) 'CR' has been added to drop down of transaction type > >Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> >Works as advertised > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > .../prog/en/modules/reports/cash_register_stats.tt | 16 +++++++++++--- > reports/cash_register_stats.pl | 22 ++++++++++++++------ > 2 files changed, 29 insertions(+), 9 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt >index 4ec7fe1..26778c0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt >@@ -130,6 +130,12 @@ $(document).ready(function() { > <option value="C">Credit</option> > [% END %] > >+ [% IF transaction_type == "CR" %] >+ <option value="CR" selected="selected">Credit (item returned)</option> >+ [% ELSE %] >+ <option value="CR">Credit (item returned)</option> >+ [% END %] >+ > [% IF transaction_type == "FORW" %] > <option value="FORW" selected="selected">Write off</option> > [% ELSE %] >@@ -189,7 +195,7 @@ $(document).ready(function() { > </select> > </li> > <li> >- <label>Library</label> >+ <label>Transaction branch</label> > <select name="branch" id="branch"> > <option value="ALL">All</option> > [% FOREACH branchloo IN branchloop %] >@@ -245,9 +251,10 @@ $(document).ready(function() { > <th>Manager name</th> > <th>Patron cardnumber</th> > <th>Patron name</th> >- <th>Library</th> >+ <th>Transaction branch</th> > <th>Transaction date</th> > <th>Transaction type</th> >+ <th>Notes</th> > <th>Amount</th> > <th>Biblio title</th> > <th>Barcode</th> >@@ -292,6 +299,7 @@ $(document).ready(function() { > [% END %] > [% END %] > </td> >+ <td>[% loopresul.note %]</td> > <td style="text-align:right;">[% loopresul.amount %]</td> > <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopresul.biblionumber %]">[% loopresul.title %]</a></td> > <td>[% loopresul.barcode %]</td> >@@ -300,9 +308,11 @@ $(document).ready(function() { > [% END %] > <tfoot> > <tr> >- <th colspan="6" style="text-align:right;">TOTAL</th> >+ [% IF transaction_type == "ACT" %] >+ <th colspan="7" style="text-align:right;">TOTAL</th> > <th style="text-align:right;">[% total %]</th> > <th colspan="3"> </th> >+ [% END %] > </tr> > </tfoot> > </table> >diff --git a/reports/cash_register_stats.pl b/reports/cash_register_stats.pl >index bd9aa0f..8b09661 100755 >--- a/reports/cash_register_stats.pl >+++ b/reports/cash_register_stats.pl >@@ -45,7 +45,7 @@ my $do_it = $input->param('do_it'); > my $output = $input->param("output"); > my $basename = $input->param("basename"); > my $transaction_type = $input->param("transaction_type") || 'ACT'; >-my $branchcode = $input->param("branch") || C4::Context->userenv->{'branch'}; >+my $manager_branchcode = $input->param("branch") || C4::Context->userenv->{'branch'}; > our $sep = $input->param("sep") // ','; > $sep = "\t" if ($sep eq 'tabulation'); > >@@ -88,8 +88,8 @@ if ($do_it) { > } > > my $whereBranchCode = ''; >- if ($branchcode ne 'ALL') { >- $whereBranchCode = "AND bo.branchcode = '$branchcode'"; >+ if ($manager_branchcode ne 'ALL') { >+ $whereBranchCode = "AND m.branchcode = '$manager_branchcode'"; > } > > ### $transaction_type; >@@ -98,7 +98,7 @@ if ($do_it) { > SELECT round(amount,2) AS amount, description, > bo.surname AS bsurname, bo.firstname AS bfirstname, m.surname AS msurname, m.firstname AS mfirstname, > bo.cardnumber, br.branchname, bo.borrowernumber, >- al.borrowernumber, DATE(al.date) as date, al.accounttype, al.amountoutstanding, >+ al.borrowernumber, DATE(al.date) as date, al.accounttype, al.amountoutstanding, al.note, > bi.title, bi.biblionumber, i.barcode, i.itype > FROM accountlines al > LEFT JOIN borrowers bo ON (al.borrowernumber = bo.borrowernumber) >@@ -124,7 +124,17 @@ if ($do_it) { > ### date : $row->{date} > > push (@loopresult, $row); >- $grantotal += abs($row->{amount}); >+ if($transaction_type eq 'ACT' && ($row->{accounttype} !~ /^C$|^CR$|^LR$|^Pay$/)){ >+ pop @loopresult; >+ next; >+ } >+ if($row->{accounttype} =~ /^C$|^CR$|^LR$/){ >+ $grantotal -= abs($row->{amount}); >+ $row->{amount} = '-' . $row->{amount}; >+ }elsif($row->{accounttype} eq 'FORW' || $row->{accounttype} eq 'W'){ >+ }else{ >+ $grantotal += abs($row->{amount}); >+ } > #} > } > >@@ -182,7 +192,7 @@ $template->param( > beginDate => dt_from_string($fromDate), > endDate => dt_from_string($toDate), > transaction_type => $transaction_type, >- branchloop => C4::Branch::GetBranchesLoop($branchcode), >+ branchloop => C4::Branch::GetBranchesLoop($manager_branchcode), > manualinv_types => $manualinv_types, > CGIsepChoice => GetDelimiterChoices, > ); >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 6934
:
5634
|
5635
|
5640
|
5641
|
9379
|
9419
|
12602
|
12660
|
31210
|
36476
|
42564
|
42565
|
44847
|
44853
|
45972
|
45973
|
45974
|
48634
|
48642
|
48704
|
48705
|
48706
|
48707
|
48708
|
50429
|
50437
|
50938
|
53496
|
53500
|
53570
|
53571
|
53572
|
53573
|
53574
|
53575
|
53576
|
53577
|
53578
|
53579
|
53581
|
53582
|
53583
|
53584
|
53585
|
53586
|
53587
|
53588
|
53589
|
53590
|
53591
|
53648
|
53650
|
53651
|
53652
|
53653
|
53778
|
53780
|
54010
|
54088
|
54089
|
54090
|
54091
|
54092
|
54093
|
54094
|
54095
|
54096
|
54097
|
54098
|
54099
|
54100
|
55939
|
55988
|
55989
| 55990 |
55991
|
55992
|
55993
|
55994
|
55995
|
55996
|
55997
|
55998
|
55999
|
56000
|
56001
|
56763
|
56764