Bugzilla – Attachment 12395 Details for
Bug 7595
Add branchcode to accountlines
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7595 - Add branchcode to accountlines - Followup
Bug-7595---Add-branchcode-to-accountlines---Follow.patch (text/plain), 8.34 KB, created by
Kyle M Hall
on 2012-09-20 14:17:10 UTC
(
hide
)
Description:
Bug 7595 - Add branchcode to accountlines - Followup
Filename:
MIME Type:
Creator:
Kyle M Hall
Created:
2012-09-20 14:17:10 UTC
Size:
8.34 KB
patch
obsolete
>From 2da3eaa38bd0a7451a09b488f5482813add83e10 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 20 Sep 2012 10:17:04 -0400 >Subject: [PATCH] Bug 7595 - Add branchcode to accountlines - Followup >Content-Type: text/plain; charset="utf-8" > >--- > C4/Circulation.pm | 18 ++++---- > C4/Overdues.pm | 106 +--------------------------------------------------- > C4/Reserves.pm | 6 +- > 3 files changed, 15 insertions(+), 115 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 71e13bb..7707fff 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2157,9 +2157,9 @@ sub _FixAccountForLostAndReturned { > $amountleft *= -1 if ($amountleft > 0); > my $desc = "Item Returned " . $item_id; > $usth = $dbh->prepare("INSERT INTO accountlines >- (borrowernumber,accountno,date,amount,description,accounttype,amountoutstanding) >- VALUES (?,?,now(),?,?,'CR',?)"); >- $usth->execute($data->{'borrowernumber'},$nextaccntno,0-$amount,$desc,$amountleft); >+ (borrowernumber,accountno,date,amount,description,accounttype,amountoutstanding,branchcode) >+ VALUES (?,?,now(),?,?,'CR',?,?)"); >+ $usth->execute($data->{'borrowernumber'},$nextaccntno,0-$amount,$desc,$amountleft,C4::Context->userenv->{'branch'}); > if ($borrowernumber) { > # FIXME: same as query above. use 1 sth for both > $usth = $dbh->prepare("INSERT INTO accountoffsets >@@ -2567,12 +2567,12 @@ sub AddRenewal { > $sth = $dbh->prepare( > "INSERT INTO accountlines > (date, borrowernumber, accountno, amount, manager_id, >- description,accounttype, amountoutstanding, itemnumber) >- VALUES (now(),?,?,?,?,?,?,?,?)" >+ description,accounttype, amountoutstanding, itemnumber, branch) >+ VALUES (now(),?,?,?,?,?,?,?,?,?)" > ); > $sth->execute( $borrowernumber, $accountno, $charge, $manager_id, > "Renewal of Rental Item $item->{'title'} $item->{'barcode'}", >- 'Rent', $charge, $itemnumber ); >+ 'Rent', $charge, $itemnumber, C4::Context->userenv->{'branch'} ); > } > # Log the renewal > UpdateStats( $branch, 'renew', $charge, '', $itemnumber, $item->{itype}, $borrowernumber, undef, $item->{'ccode'}); >@@ -2728,11 +2728,11 @@ sub AddIssuingCharge { > INSERT INTO accountlines > (borrowernumber, itemnumber, accountno, > date, amount, description, accounttype, >- amountoutstanding, manager_id) >- VALUES (?, ?, ?,now(), ?, 'Rental', 'Rent',?,?) >+ amountoutstanding, manager_id, branchcode) >+ VALUES (?, ?, ?,now(), ?, 'Rental', 'Rent',?,?,?) > "; > my $sth = $dbh->prepare($query); >- $sth->execute( $borrowernumber, $itemnumber, $nextaccntno, $charge, $charge, $manager_id ); >+ $sth->execute( $borrowernumber, $itemnumber, $nextaccntno, $charge, $charge, $manager_id, C4::Context->userenv->{'branch'} ); > $sth->finish; > } > >diff --git a/C4/Overdues.pm b/C4/Overdues.pm >index d17f445..cfc48c6 100644 >--- a/C4/Overdues.pm >+++ b/C4/Overdues.pm >@@ -48,12 +48,10 @@ BEGIN { > &GetNotifyId > &NumberNotifyId > &AmountNotify >- &UpdateAccountLines > &UpdateFine > &GetOverdueDelays > &GetOverduerules > &GetFine >- &CreateItemAccountLine > &ReplacementCost2 > > &CheckItemNotify >@@ -602,11 +600,11 @@ sub UpdateFine { > my $nextaccntno = C4::Accounts::getnextacctno($borrowernumber); > my $desc = ($type ? "$type " : '') . "$title $due"; # FIXEDME, avoid whitespace prefix on empty $type > my $query = "INSERT INTO accountlines >- (borrowernumber,itemnumber,date,amount,description,accounttype,amountoutstanding,lastincrement,accountno) >- VALUES (?,?,now(),?,?,'FU',?,?,?)"; >+ (borrowernumber,itemnumber,date,amount,description,accounttype,amountoutstanding,lastincrement,accountno,branchcode) >+ VALUES (?,?,now(),?,?,'FU',?,?,?,?)"; > my $sth2 = $dbh->prepare($query); > $debug and print STDERR "UpdateFine query: $query\nw/ args: $borrowernumber, $itemnum, $amount, $desc, $amount, $amount, $nextaccntno\n"; >- $sth2->execute($borrowernumber, $itemnum, $amount, $desc, $amount, $amount, $nextaccntno); >+ $sth2->execute($borrowernumber, $itemnum, $amount, $desc, $amount, $amount, $nextaccntno, C4::Context->userenv->{'branch'}); > } > # logging action > &logaction( >@@ -865,104 +863,6 @@ sub GetNotifyId { > return ($notify_id); > } > >-=head2 CreateItemAccountLine >- >- () = &CreateItemAccountLine($borrowernumber, $itemnumber, $date, $amount, >- $description, $accounttype, $amountoutstanding, >- $timestamp, $notify_id, $level); >- >-update the account lines with file number or with file level >- >-C<$items> is a reference-to-hash whose keys are all of the fields >-from the items tables of the Koha database. Thus, >- >-C<$itemnumber> contains the item number >- >-C<$borrowernumber> contains the borrower number >- >-C<$date> contains the date of the day >- >-C<$amount> contains item price >- >-C<$description> contains the descritpion of accounttype >- >-C<$accounttype> contains the account type >- >-C<$amountoutstanding> contains the $amountoutstanding >- >-C<$timestamp> contains the timestamp with time and the date of the day >- >-C<$notify_id> contains the file number >- >-C<$level> contains the file level >- >-=cut >- >-sub CreateItemAccountLine { >- my ( >- $borrowernumber, $itemnumber, $date, $amount, >- $description, $accounttype, $amountoutstanding, $timestamp, >- $notify_id, $level >- ) = @_; >- my $dbh = C4::Context->dbh; >- my $nextaccntno = C4::Accounts::getnextacctno($borrowernumber); >- my $query = "INSERT into accountlines >- (borrowernumber,accountno,itemnumber,date,amount,description,accounttype,amountoutstanding,timestamp,notify_id,notify_level) >- VALUES >- (?,?,?,?,?,?,?,?,?,?,?)"; >- >- my $sth = $dbh->prepare($query); >- $sth->execute( >- $borrowernumber, $nextaccntno, $itemnumber, >- $date, $amount, $description, >- $accounttype, $amountoutstanding, $timestamp, >- $notify_id, $level >- ); >-} >- >-=head2 UpdateAccountLines >- >- () = &UpdateAccountLines($notify_id,$notify_level,$borrowernumber,$itemnumber); >- >-update the account lines with file number or with file level >- >-C<$items> is a reference-to-hash whose keys are all of the fields >-from the items tables of the Koha database. Thus, >- >-C<$itemnumber> contains the item number >- >-C<$notify_id> contains the file number >- >-C<$notify_level> contains the file level >- >-C<$borrowernumber> contains the borrowernumber >- >-=cut >- >-sub UpdateAccountLines { >- my ( $notify_id, $notify_level, $borrowernumber, $itemnumber ) = @_; >- my $query; >- if ( $notify_id eq '' ) { >- $query = qq|UPDATE accountlines >- SET notify_level=? >- WHERE borrowernumber=? AND itemnumber=? >- AND (accounttype='FU' or accounttype='O')|; >- } else { >- $query = qq|UPDATE accountlines >- SET notify_id=?, notify_level=? >- WHERE borrowernumber=? >- AND itemnumber=? >- AND (accounttype='FU' or accounttype='O')|; >- } >- >- my $sth = C4::Context->dbh->prepare($query); >- if ( $notify_id eq '' ) { >- $sth->execute( $notify_level, $borrowernumber, $itemnumber ); >- } else { >- $sth->execute( $notify_id, $notify_level, $borrowernumber, $itemnumber ); >- } >-} >- > =head2 GetItems > > ($items) = &GetItems($itemnumber); >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 585d1e5..68ee6fb 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -175,13 +175,13 @@ sub AddReserve { > my $nextacctno = &getnextacctno( $borrowernumber ); > my $query = qq/ > INSERT INTO accountlines >- (borrowernumber,accountno,date,amount,description,accounttype,amountoutstanding) >+ (borrowernumber,accountno,date,amount,description,accounttype,amountoutstanding,branchcode) > VALUES >- (?,?,now(),?,?,'Res',?) >+ (?,?,now(),?,?,'Res',?,?) > /; > my $usth = $dbh->prepare($query); > $usth->execute( $borrowernumber, $nextacctno, $fee, >- "Reserve Charge - $title", $fee ); >+ "Reserve Charge - $title", $fee, C4::Context->userenv->{'branch'} ); > } > > #if ($const eq 'a'){ >-- >1.7.2.5
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 7595
:
7866
|
7867
|
7868
|
7869
|
7870
|
8037
|
8162
|
12394
|
12395
|
12717
|
12719
|
14814
|
14815
|
20808
|
20809
|
23306
|
23308
|
27337
|
30946
|
30947
|
30950
|
38150
|
38225
|
38235
|
52909
|
52910
|
52911
|
54262
|
54263
|
54264