1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 13:42:49 +01:00
invoiceninja/app/Ninja/Import/Harvest/PaymentTransformer.php

19 lines
573 B
PHP
Raw Normal View History

<?php namespace App\Ninja\Import\Harvest;
2015-12-08 11:10:20 +01:00
use App\Ninja\Import\BaseTransformer;
use League\Fractal\Resource\Item;
2015-12-08 11:10:20 +01:00
class PaymentTransformer extends BaseTransformer
{
2015-12-08 11:10:20 +01:00
public function transform($data)
{
2015-12-08 11:10:20 +01:00
return new Item($data, function ($data) {
return [
'amount' => $data->paid_amount,
2015-12-08 11:10:20 +01:00
'payment_date_sql' => $this->getDate($data->last_payment_date, 'm/d/Y'),
'client_id' => $data->client_id,
'invoice_id' => $this->getInvoiceId($data->invoice_id),
];
});
}
}