Lines 79-90
if ( $action eq 'payout' ) {
Link Here
|
79 |
my $payment_id = scalar $input->param('accountlines_id'); |
79 |
my $payment_id = scalar $input->param('accountlines_id'); |
80 |
my $payment = Koha::Account::Lines->find($payment_id); |
80 |
my $payment = Koha::Account::Lines->find($payment_id); |
81 |
my $amount = scalar $input->param('amount'); |
81 |
my $amount = scalar $input->param('amount'); |
82 |
my $transaction_type = scalar $input->param('transaction_type'); |
82 |
my $payout_type = scalar $input->param('payout_type'); |
83 |
$schema->txn_do( |
83 |
$schema->txn_do( |
84 |
sub { |
84 |
sub { |
85 |
my $payout = $payment->payout( |
85 |
my $payout = $payment->payout( |
86 |
{ |
86 |
{ |
87 |
payout_type => $transaction_type, |
87 |
payout_type => $payout_type, |
88 |
branch => $library_id, |
88 |
branch => $library_id, |
89 |
staff_id => $logged_in_user->id, |
89 |
staff_id => $logged_in_user->id, |
90 |
cash_register => $registerid, |
90 |
cash_register => $registerid, |
Lines 100-106
if ( $action eq 'refund' ) {
Link Here
|
100 |
my $charge_id = scalar $input->param('accountlines_id'); |
100 |
my $charge_id = scalar $input->param('accountlines_id'); |
101 |
my $charge = Koha::Account::Lines->find($charge_id); |
101 |
my $charge = Koha::Account::Lines->find($charge_id); |
102 |
my $amount = scalar $input->param('amount'); |
102 |
my $amount = scalar $input->param('amount'); |
103 |
my $transaction_type = scalar $input->param('transaction_type'); |
103 |
my $refund_type = scalar $input->param('refund_type'); |
104 |
$schema->txn_do( |
104 |
$schema->txn_do( |
105 |
sub { |
105 |
sub { |
106 |
|
106 |
|
Lines 113-122
if ( $action eq 'refund' ) {
Link Here
|
113 |
amount => $amount |
113 |
amount => $amount |
114 |
} |
114 |
} |
115 |
); |
115 |
); |
116 |
unless ( $transaction_type eq 'AC' ) { |
116 |
unless ( $refund_type eq 'AC' ) { |
117 |
my $payout = $refund->payout( |
117 |
my $payout = $refund->payout( |
118 |
{ |
118 |
{ |
119 |
payout_type => $transaction_type, |
119 |
payout_type => $refund_type, |
120 |
branch => $library_id, |
120 |
branch => $library_id, |
121 |
staff_id => $logged_in_user->id, |
121 |
staff_id => $logged_in_user->id, |
122 |
cash_register => $registerid, |
122 |
cash_register => $registerid, |