Bugzilla – Attachment 76299 Details for
Bug 20980
Manual credit offsets are stored as debits
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20980: Add 'Manual Credit' and fix existing offsets
Bug-20980-Add-Manual-Credit-and-fix-existing-offse.patch (text/plain), 2.45 KB, created by
Tomás Cohen Arazi (tcohen)
on 2018-06-22 15:57:14 UTC
(
hide
)
Description:
Bug 20980: Add 'Manual Credit' and fix existing offsets
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2018-06-22 15:57:14 UTC
Size:
2.45 KB
patch
obsolete
>From d7b2eed786c66aa6a3b79e1af4bb3f542d426fdd Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 21 Jun 2018 14:43:34 -0300 >Subject: [PATCH] Bug 20980: Add 'Manual Credit' and fix existing offsets > >This patch adds a new offset type 'Manual Credit'. And adds an atomic >update for fixing existing offsets. >--- > installer/data/mysql/account_offset_types.sql | 1 + > .../data/mysql/atomicupdate/bug_20980.perl | 21 +++++++++++++++++++ > .../prog/en/includes/account_offset_type.inc | 1 + > 3 files changed, 23 insertions(+) > create mode 100644 installer/data/mysql/atomicupdate/bug_20980.perl > >diff --git a/installer/data/mysql/account_offset_types.sql b/installer/data/mysql/account_offset_types.sql >index a9eaadc450..7b96abfdbd 100644 >--- a/installer/data/mysql/account_offset_types.sql >+++ b/installer/data/mysql/account_offset_types.sql >@@ -3,6 +3,7 @@ INSERT INTO account_offset_types ( type ) VALUES > ('Payment'), > ('Lost Item'), > ('Processing Fee'), >+('Manual Credit'), > ('Manual Debit'), > ('Reverse Payment'), > ('Forgiven'), >diff --git a/installer/data/mysql/atomicupdate/bug_20980.perl b/installer/data/mysql/atomicupdate/bug_20980.perl >new file mode 100644 >index 0000000000..035f13a0c4 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_20980.perl >@@ -0,0 +1,21 @@ >+$DBversion = 'XXX'; >+if( CheckVersion( $DBversion ) ) { >+ >+ # Add 'Manual Credit' offset type >+ $dbh->do(q{ >+ INSERT IGNORE INTO `account_offset_types` (`type`) VALUES ('Manual Credit'); >+ }); >+ >+ # Fix wrong account offsets >+ $dbh->do(q{ >+ UPDATE account_offsets >+ SET credit_id=debit_id, >+ debit_id=NULL, >+ type='Manual Credit' >+ WHERE amount < 0 AND >+ type='Manual Debit'; >+ }); >+ >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 20980 - Manual credit offsets are stored as debits)\n"; >+} >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/account_offset_type.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/account_offset_type.inc >index a36a883a86..6ec71d1f09 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/account_offset_type.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/account_offset_type.inc >@@ -1,5 +1,6 @@ > [% SWITCH account_offset.type %] > [% CASE 'Payment' %]Payment >+ [% CASE 'Manual Credit' %]Manual credit > [% CASE 'Manual Debit' %]Manual invoice > [% CASE 'Lost Item Return' %]Lost item returned > [% CASE 'Writeoff' %]Writeoff >-- >2.18.0
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 20980
:
76299
|
76300
|
76301
|
76322
|
76323
|
76324
|
76325
|
76401
|
76402
|
76403
|
76404
|
76442
|
76443
|
76444
|
76445
|
76728
|
76729
|
76730
|
76731
|
76732
|
76734