From 3d600b09512645915fc69ae3c288a5aceebeb0fb Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 20 Sep 2012 10:17:04 -0400 Subject: [PATCH] Bug 7595 - Add branchcode to accountlines - Followup --- C4/Circulation.pm | 18 +++++++++--------- C4/Overdues.pm | 6 +++--- C4/Reserves.pm | 6 +++--- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 1dc7a45..6322264 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -2209,9 +2209,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 @@ -2582,12 +2582,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'} ); } # Send a renewal slip according to checkout alert preferencei @@ -2764,11 +2764,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 4fd0b84..46ade2d 100644 --- a/C4/Overdues.pm +++ b/C4/Overdues.pm @@ -591,11 +591,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( diff --git a/C4/Reserves.pm b/C4/Reserves.pm index d6812f1..5c3ce65 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -176,13 +176,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