1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Only show 'Refund Payment' for selected gateways

This commit is contained in:
Hillel Coren 2016-10-09 20:01:44 +03:00
parent e776f439b0
commit 48f2f58d3f

View File

@ -123,12 +123,11 @@ class PaymentDatatable extends EntityDatatable
return "javascript:showRefundModal({$model->public_id}, '{$max_refund}', '{$formatted}', '{$symbol}')";
},
function ($model) {
return Auth::user()->can('editByOwner', [ENTITY_PAYMENT, $model->user_id]) && $model->payment_status_id >= PAYMENT_STATUS_COMPLETED &&
$model->refunded < $model->amount &&
(
($model->transaction_reference && in_array($model->gateway_id , static::$refundableGateways))
|| $model->payment_type_id == PAYMENT_TYPE_CREDIT
);
return Auth::user()->can('editByOwner', [ENTITY_PAYMENT, $model->user_id])
&& $model->payment_status_id >= PAYMENT_STATUS_COMPLETED
&& $model->refunded < $model->amount
&& $model->transaction_reference
&& in_array($model->gateway_id , static::$refundableGateways);
}
]
];