|
Lines 76-99
if ( $action eq 'void' ) {
Link Here
|
| 76 |
} |
76 |
} |
| 77 |
|
77 |
|
| 78 |
if ( $action eq 'payout' ) { |
78 |
if ( $action eq 'payout' ) { |
| 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); |
|
|
| 81 |
my $amount = scalar $input->param('amount'); |
80 |
my $amount = scalar $input->param('amount'); |
| 82 |
my $transaction_type = scalar $input->param('transaction_type'); |
81 |
my $transaction_type = scalar $input->param('transaction_type'); |
| 83 |
$schema->txn_do( |
82 |
if ( $payment_id eq "" ) { |
| 84 |
sub { |
83 |
$schema->txn_do( |
| 85 |
my $payout = $payment->payout( |
84 |
sub { |
| 86 |
{ |
85 |
$patron->account->payout_amount( |
| 87 |
payout_type => $transaction_type, |
86 |
{ |
| 88 |
branch => $library_id, |
87 |
payout_type => $transaction_type, |
| 89 |
staff_id => $logged_in_user->id, |
88 |
branch => $library_id, |
| 90 |
cash_register => $registerid, |
89 |
staff_id => $logged_in_user->id, |
| 91 |
interface => 'intranet', |
90 |
cash_register => $registerid, |
| 92 |
amount => $amount |
91 |
interface => 'intranet', |
| 93 |
} |
92 |
amount => $amount |
| 94 |
); |
93 |
} |
| 95 |
} |
94 |
); |
| 96 |
); |
95 |
} |
|
|
96 |
); |
| 97 |
} else { |
| 98 |
my $payment = Koha::Account::Lines->find($payment_id); |
| 99 |
$schema->txn_do( |
| 100 |
sub { |
| 101 |
my $payout = $payment->payout( |
| 102 |
{ |
| 103 |
payout_type => $transaction_type, |
| 104 |
branch => $library_id, |
| 105 |
staff_id => $logged_in_user->id, |
| 106 |
cash_register => $registerid, |
| 107 |
interface => 'intranet', |
| 108 |
amount => $amount |
| 109 |
} |
| 110 |
); |
| 111 |
} |
| 112 |
); |
| 113 |
} |
| 97 |
} |
114 |
} |
| 98 |
|
115 |
|
| 99 |
if ( $action eq 'refund' ) { |
116 |
if ( $action eq 'refund' ) { |
| 100 |
- |
|
|