View | Details | Raw Unified | Return to bug 7595
Collapse All | Expand All

(-)a/C4/Circulation.pm (-9 / +9 lines)
Lines 2209-2217 sub _FixAccountForLostAndReturned { Link Here
2209
    $amountleft *= -1 if ($amountleft > 0);
2209
    $amountleft *= -1 if ($amountleft > 0);
2210
    my $desc = "Item Returned " . $item_id;
2210
    my $desc = "Item Returned " . $item_id;
2211
    $usth = $dbh->prepare("INSERT INTO accountlines
2211
    $usth = $dbh->prepare("INSERT INTO accountlines
2212
        (borrowernumber,accountno,date,amount,description,accounttype,amountoutstanding)
2212
        (borrowernumber,accountno,date,amount,description,accounttype,amountoutstanding,branchcode)
2213
        VALUES (?,?,now(),?,?,'CR',?)");
2213
        VALUES (?,?,now(),?,?,'CR',?,?)");
2214
    $usth->execute($data->{'borrowernumber'},$nextaccntno,0-$amount,$desc,$amountleft);
2214
    $usth->execute($data->{'borrowernumber'},$nextaccntno,0-$amount,$desc,$amountleft,C4::Context->userenv->{'branch'});
2215
    if ($borrowernumber) {
2215
    if ($borrowernumber) {
2216
        # FIXME: same as query above.  use 1 sth for both
2216
        # FIXME: same as query above.  use 1 sth for both
2217
        $usth = $dbh->prepare("INSERT INTO accountoffsets
2217
        $usth = $dbh->prepare("INSERT INTO accountoffsets
Lines 2582-2593 sub AddRenewal { Link Here
2582
        $sth = $dbh->prepare(
2582
        $sth = $dbh->prepare(
2583
                "INSERT INTO accountlines
2583
                "INSERT INTO accountlines
2584
                    (date, borrowernumber, accountno, amount, manager_id,
2584
                    (date, borrowernumber, accountno, amount, manager_id,
2585
                    description,accounttype, amountoutstanding, itemnumber)
2585
                    description,accounttype, amountoutstanding, itemnumber, branch)
2586
                    VALUES (now(),?,?,?,?,?,?,?,?)"
2586
                    VALUES (now(),?,?,?,?,?,?,?,?,?)"
2587
        );
2587
        );
2588
        $sth->execute( $borrowernumber, $accountno, $charge, $manager_id,
2588
        $sth->execute( $borrowernumber, $accountno, $charge, $manager_id,
2589
            "Renewal of Rental Item $item->{'title'} $item->{'barcode'}",
2589
            "Renewal of Rental Item $item->{'title'} $item->{'barcode'}",
2590
            'Rent', $charge, $itemnumber );
2590
            'Rent', $charge, $itemnumber, C4::Context->userenv->{'branch'} );
2591
    }
2591
    }
2592
2592
2593
    # Send a renewal slip according to checkout alert preferencei
2593
    # Send a renewal slip according to checkout alert preferencei
Lines 2764-2774 sub AddIssuingCharge { Link Here
2764
        INSERT INTO accountlines
2764
        INSERT INTO accountlines
2765
            (borrowernumber, itemnumber, accountno,
2765
            (borrowernumber, itemnumber, accountno,
2766
            date, amount, description, accounttype,
2766
            date, amount, description, accounttype,
2767
            amountoutstanding, manager_id)
2767
            amountoutstanding, manager_id, branchcode)
2768
        VALUES (?, ?, ?,now(), ?, 'Rental', 'Rent',?,?)
2768
        VALUES (?, ?, ?,now(), ?, 'Rental', 'Rent',?,?,?)
2769
    ";
2769
    ";
2770
    my $sth = $dbh->prepare($query);
2770
    my $sth = $dbh->prepare($query);
2771
    $sth->execute( $borrowernumber, $itemnumber, $nextaccntno, $charge, $charge, $manager_id );
2771
    $sth->execute( $borrowernumber, $itemnumber, $nextaccntno, $charge, $charge, $manager_id, C4::Context->userenv->{'branch'} );
2772
    $sth->finish;
2772
    $sth->finish;
2773
}
2773
}
2774
2774
(-)a/C4/Overdues.pm (-3 / +3 lines)
Lines 591-601 sub UpdateFine { Link Here
591
		my $nextaccntno = C4::Accounts::getnextacctno($borrowernumber);
591
		my $nextaccntno = C4::Accounts::getnextacctno($borrowernumber);
592
		my $desc = ($type ? "$type " : '') . "$title $due";	# FIXEDME, avoid whitespace prefix on empty $type
592
		my $desc = ($type ? "$type " : '') . "$title $due";	# FIXEDME, avoid whitespace prefix on empty $type
593
		my $query = "INSERT INTO accountlines
593
		my $query = "INSERT INTO accountlines
594
		    (borrowernumber,itemnumber,date,amount,description,accounttype,amountoutstanding,lastincrement,accountno)
594
                  (borrowernumber,itemnumber,date,amount,description,accounttype,amountoutstanding,lastincrement,accountno,branchcode)
595
			    VALUES (?,?,now(),?,?,'FU',?,?,?)";
595
                           VALUES (?,?,now(),?,?,'FU',?,?,?,?)";
596
		my $sth2 = $dbh->prepare($query);
596
		my $sth2 = $dbh->prepare($query);
597
		$debug and print STDERR "UpdateFine query: $query\nw/ args: $borrowernumber, $itemnum, $amount, $desc, $amount, $amount, $nextaccntno\n";
597
		$debug and print STDERR "UpdateFine query: $query\nw/ args: $borrowernumber, $itemnum, $amount, $desc, $amount, $amount, $nextaccntno\n";
598
        $sth2->execute($borrowernumber, $itemnum, $amount, $desc, $amount, $amount, $nextaccntno);
598
        $sth2->execute($borrowernumber, $itemnum, $amount, $desc, $amount, $amount, $nextaccntno, C4::Context->userenv->{'branch'});
599
    }
599
    }
600
    # logging action
600
    # logging action
601
    &logaction(
601
    &logaction(
(-)a/C4/Reserves.pm (-4 / +3 lines)
Lines 176-188 sub AddReserve { Link Here
176
        my $nextacctno = &getnextacctno( $borrowernumber );
176
        my $nextacctno = &getnextacctno( $borrowernumber );
177
        my $query      = qq/
177
        my $query      = qq/
178
        INSERT INTO accountlines
178
        INSERT INTO accountlines
179
            (borrowernumber,accountno,date,amount,description,accounttype,amountoutstanding)
179
            (borrowernumber,accountno,date,amount,description,accounttype,amountoutstanding,branchcode)
180
        VALUES
180
        VALUES
181
            (?,?,now(),?,?,'Res',?)
181
            (?,?,now(),?,?,'Res',?,?)
182
    /;
182
    /;
183
        my $usth = $dbh->prepare($query);
183
        my $usth = $dbh->prepare($query);
184
        $usth->execute( $borrowernumber, $nextacctno, $fee,
184
        $usth->execute( $borrowernumber, $nextacctno, $fee,
185
            "Reserve Charge - $title", $fee );
185
            "Reserve Charge - $title", $fee, C4::Context->userenv->{'branch'} );
186
    }
186
    }
187
187
188
    #if ($const eq 'a'){
188
    #if ($const eq 'a'){
189
- 

Return to bug 7595