Bugzilla – Attachment 67362 Details for
Bug 5620
Capture Mode of payment
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 5620 - Capture mode of payment.
Bug-5620---Capture-mode-of-payment.patch (text/plain), 9.83 KB, created by
David Bourgault
on 2017-09-26 15:04:04 UTC
(
hide
)
Description:
Bug 5620 - Capture mode of payment.
Filename:
MIME Type:
Creator:
David Bourgault
Created:
2017-09-26 15:04:04 UTC
Size:
9.83 KB
patch
obsolete
>From 2edce150831dc75054a74c2e333cf044eb59892f Mon Sep 17 00:00:00 2001 >From: David Bourgault <david.bourgault@inlibro.com> >Date: Tue, 26 Sep 2017 11:02:21 -0400 >Subject: [PATCH] Bug 5620 - Capture mode of payment. > >Correction to template files >Patch is rebased, should now apply. >--- > Koha/Account.pm | 4 +++ > Koha/Schema/Result/Accountline.pm | 2 ++ > .../atomicupdate/bug5620_Add_Mode_Of_Payment.sql | 6 +++++ > installer/data/mysql/kohastructure.sql | 1 + > .../prog/en/modules/members/boraccount.tt | 3 +++ > .../prog/en/modules/members/paycollect.tt | 31 +++++++++++++++++----- > members/paycollect.pl | 8 +++--- > 7 files changed, 45 insertions(+), 10 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug5620_Add_Mode_Of_Payment.sql > >diff --git a/Koha/Account.pm b/Koha/Account.pm >index 9ec1c1b..1b7855f 100644 >--- a/Koha/Account.pm >+++ b/Koha/Account.pm >@@ -68,6 +68,7 @@ sub pay { > my $library_id = $params->{library_id}; > my $lines = $params->{lines}; > my $type = $params->{type} || 'payment'; >+ my $paymentmode = $params->{paymentmode}; > > my $userenv = C4::Context->userenv; > >@@ -121,6 +122,7 @@ sub pay { > accountno => $fine->accountno, > manager_id => $manager_id, > note => $note, >+ paymentmode => $paymentmode, > } > ) > ); >@@ -164,6 +166,7 @@ sub pay { > accountno => $fine->accountno, > manager_id => $manager_id, > note => $note, >+ paymentmode => $paymentmode, > } > ) > ); >@@ -192,6 +195,7 @@ sub pay { > amountoutstanding => 0 - $balance_remaining, > manager_id => $manager_id, > note => $note, >+ paymentmode => $paymentmode, > } > )->store(); > >diff --git a/Koha/Schema/Result/Accountline.pm b/Koha/Schema/Result/Accountline.pm >index d3fa5b3..cd50c5c 100644 >--- a/Koha/Schema/Result/Accountline.pm >+++ b/Koha/Schema/Result/Accountline.pm >@@ -169,6 +169,8 @@ __PACKAGE__->add_columns( > { data_type => "text", is_nullable => 1 }, > "manager_id", > { data_type => "integer", is_nullable => 1 }, >+ "paymentmode", >+ {data_type => "text", is_nullable => 0 }, > ); > > =head1 PRIMARY KEY >diff --git a/installer/data/mysql/atomicupdate/bug5620_Add_Mode_Of_Payment.sql b/installer/data/mysql/atomicupdate/bug5620_Add_Mode_Of_Payment.sql >new file mode 100644 >index 0000000..b3e8196 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug5620_Add_Mode_Of_Payment.sql >@@ -0,0 +1,6 @@ >+ALTER table accountlines ADD COLUMN paymentmode TEXT NOT NULL; >+INSERT INTO authorised_value_categories VALUES ('PAYMODE'); >+INSERT INTO authorised_values (category, authorised_value, lib, lib_opac) VALUES >+('PAYMODE','CASH', 'Cash', 'Cash'), >+('PAYMODE','CC', 'Credit Card', 'Credit Card'), >+('PAYMODE','DEBIT', 'Debit', 'Debit'); >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 2edd371..561016c 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -2726,6 +2726,7 @@ CREATE TABLE `accountlines` ( > `notify_level` int(2) NOT NULL default 0, > `note` text NULL default NULL, > `manager_id` int(11) NULL, >+ `paymentmode` text COLLATE utf8_unicode_ci NOT NULL, > PRIMARY KEY (`accountlines_id`), > KEY `acctsborridx` (`borrowernumber`), > KEY `timeidx` (`timestamp`), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >index ec79237..1eb2e43 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >@@ -2,6 +2,7 @@ > [% USE KohaDates %] > [% USE ColumnsSettings %] > [% USE Price %] >+[% USE AuthorisedValues %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Patrons › Account for [% INCLUDE 'patron-title.inc' %]</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -68,6 +69,7 @@ $(document).ready(function() { > <th class="title-string">Date</th> > <th>Description of charges</th> > <th>Note</th> >+ <th>Payment mode</th> > <th>Amount</th> > <th>Outstanding</th> > [% IF ( reverse_col ) %] >@@ -109,6 +111,7 @@ $(document).ready(function() { > [%- IF account.description %], [% account.description %][% END %] > [% IF ( account.itemnumber ) %]<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% account.biblionumber %]&itemnumber=[% account.itemnumber %]">[% account.title |html %]</a>[% END %]</td> > <td>[% account.note | html_line_break %]</td> >+ <td>[% AuthorisedValues.GetByCode('PAYMODE',account.paymentmode) %]</td> > [% IF ( account.amountcredit ) %]<td class="credit" style="text-align: right;">[% ELSE %]<td class="debit" style="text-align: right;">[% END %][% account.amount | $Price %]</td> > [% IF ( account.amountoutstandingcredit ) %]<td class="credit" style="text-align: right;">[% ELSE %]<td class="debit" style="text-align: right;">[% END %][% account.amountoutstanding | $Price %]</td> > <td class="actions"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >index a1458b5..3e52214 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >@@ -1,5 +1,6 @@ > [% USE Koha %] > [% USE Branches %] >+[% USE AuthorisedValues %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Patrons › Collect fine payment for [% borrower.firstname %] [% borrower.surname %]</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -147,6 +148,14 @@ function moneyFormat(textObj) { > <!-- default to paying all --> > <input name="paid" id="paid" value="[% amountoutstanding | format('%.2f') %]" /> > </li> >+ <li> >+ <label for="paymentmode">Payment mode: </label> >+ <select name="paymentmode" id="paymentmode"> >+ [% FOREACH paymentmode IN AuthorisedValues.GetAuthValueDropbox('PAYMODE') %] >+ <option value="[% paymentmode.authorised_value %]">[% paymentmode.lib %]</option> >+ [% END %] >+ </select> >+ </li> > </ol> > </fieldset> > >@@ -206,15 +215,23 @@ function moneyFormat(textObj) { > <span class="label">Total amount outstanding: </span> > <span class="debit">[% total | format('%.2f') %]</span> > </li> >- <li> >- <label for="paid">Collect from patron: </label> >- <!-- default to paying all --> >- <input name="paid" id="paid" value="[% total | format('%.2f') %]" /> >- </li> >- <li> >+ <li> >+ <label for="paid">Collect from patron: </label> >+ <!-- default to paying all --> >+ <input name="paid" id="paid" value="[% total | format('%.2f') %]" /> >+ </li> >+ <li> >+ <label for="paymentmode">Payment mode: </label> >+ <select name="paymentmode" id="paymentmode"> >+ [% FOREACH paymentmode IN AuthorisedValues.GetAuthValueDropbox('PAYMODE') %] >+ <option value="[% paymentmode.authorised_value %]">[% paymentmode.lib %]</option> >+ [% END %] >+ </select> >+ </li> >+ <li> > <label for="selected_accts_notes">Note: </label> > <textarea name="selected_accts_notes" id="selected_accts_notes">[% selected_accts_notes %]</textarea> >- </li> >+ </li> > </ol> > </fieldset> > <div class="action"><input type="submit" name="submitbutton" value="Confirm" /> >diff --git a/members/paycollect.pl b/members/paycollect.pl >index f880f57..d107dc7 100755 >--- a/members/paycollect.pl >+++ b/members/paycollect.pl >@@ -64,6 +64,7 @@ my $branch = C4::Context->userenv->{'branch'}; > > my ( $total_due, $accts, $numaccts ) = GetMemberAccountRecords($borrowernumber); > my $total_paid = $input->param('paid'); >+my $paymentmode = $input->param('paymentmode'); > > my $individual = $input->param('pay_individual'); > my $writeoff = $input->param('writeoff_individual'); >@@ -123,7 +124,8 @@ if ( $total_paid and $total_paid ne '0.00' ) { > lines => [$line], > amount => $total_paid, > library_id => $branch, >- note => $payment_note >+ note => $payment_note, >+ paymentmode => $paymentmode, > } > ); > print $input->redirect( >@@ -135,7 +137,6 @@ if ( $total_paid and $total_paid ne '0.00' ) { > } > my @acc = split /,/, $select; > my $note = $input->param('selected_accts_notes'); >- > my @lines = Koha::Account::Lines->search( > { > borrowernumber => $borrowernumber, >@@ -154,13 +155,14 @@ if ( $total_paid and $total_paid ne '0.00' ) { > amount => $total_paid, > lines => \@lines, > note => $note, >+ paymentmode => $paymentmode, > } > ); > } > else { > my $note = $input->param('selected_accts_notes'); > Koha::Account->new( { patron_id => $borrowernumber } ) >- ->pay( { amount => $total_paid, note => $note } ); >+ ->pay( { amount => $total_paid, note => $note, paymentmode => $paymentmode } ); > } > > print $input->redirect( >-- >2.7.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 5620
:
2997
|
51290
|
56036
|
56037
|
56080
|
60994
|
60996
|
67361
|
67362
|
67394
|
67603
|
67634
|
67661
|
69002