mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-08-07 10:01:47 -04:00
Fix imported payment date
This commit is contained in:
parent
54df8e5055
commit
b1c64bae6c
@ -18,16 +18,9 @@ class PaymentTransformer extends BaseTransformer
|
|||||||
public function transform($data)
|
public function transform($data)
|
||||||
{
|
{
|
||||||
return new Item($data, function ($data) {
|
return new Item($data, function ($data) {
|
||||||
if (! empty($data->payment_date)) {
|
|
||||||
$paymentDate = $this->getDate($data, 'payment_date');
|
|
||||||
} else {
|
|
||||||
$paymentDate = isset($data->invoice_date) ? $data->invoice_date : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'amount' => $this->getFloat($data, 'paid'),
|
'amount' => $this->getFloat($data, 'paid'),
|
||||||
'payment_date_sql' => $paymentDate,
|
'payment_date_sql' => $this->getDate($data, 'invoice_date'),
|
||||||
'transaction_reference' => $this->getString($data, 'payment_reference'),
|
|
||||||
'client_id' => $data->client_id,
|
'client_id' => $data->client_id,
|
||||||
'invoice_id' => $data->invoice_id,
|
'invoice_id' => $data->invoice_id,
|
||||||
];
|
];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user