diff --git a/ajax/invoices/addPayment.php b/ajax/invoices/addPayment.php index 6bfa9cbb029cbb0b64997d36854b8decc79bb8b0..d339b58272f70e135dec3667eab19a7a6d3e4826 100644 --- a/ajax/invoices/addPayment.php +++ b/ajax/invoices/addPayment.php @@ -19,7 +19,7 @@ 'package_quiqqer_invoice_ajax_invoices_addPayment', function ($invoiceId, $amount, $paymentMethod, $date) { $Invoices = QUI\ERP\Accounting\Invoice\Handler::getInstance(); - $Payment = Payments::getInstance()->getPayment($paymentMethod); + $Payment = Payments::getInstance()->getPayment($paymentMethod); try { $Invoice = $Invoices->getInvoice($invoiceId); @@ -30,7 +30,7 @@ function ($invoiceId, $amount, $paymentMethod, $date) { // create the transaction TransactionFactory::createPaymentTransaction( $amount, - QUI\ERP\Defaults::getCurrency(), + $Invoice->getCurrency(), $Invoice->getHash(), $Payment->getPaymentType()->getName(), [], @@ -39,6 +39,11 @@ function ($invoiceId, $amount, $paymentMethod, $date) { $Invoice->getGlobalProcessId() ); }, - ['invoiceId', 'amount', 'paymentMethod', 'date'], + [ + 'invoiceId', + 'amount', + 'paymentMethod', + 'date' + ], 'Permission::checkAdminUser' );