mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Product Sales Report
This commit is contained in:
parent
fd51303617
commit
263e08bf04
@ -22,6 +22,7 @@ use App\Transformers\ProductTransformer;
|
|||||||
use App\Utils\Ninja;
|
use App\Utils\Ninja;
|
||||||
use Illuminate\Support\Facades\App;
|
use Illuminate\Support\Facades\App;
|
||||||
use League\Csv\Writer;
|
use League\Csv\Writer;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
|
|
||||||
class ProductSalesExport extends BaseExport
|
class ProductSalesExport extends BaseExport
|
||||||
{
|
{
|
||||||
@ -51,11 +52,16 @@ class ProductSalesExport extends BaseExport
|
|||||||
'discount' => 'discount',
|
'discount' => 'discount',
|
||||||
'line_total' => 'line_total',
|
'line_total' => 'line_total',
|
||||||
'gross_line_total' => 'gross_line_total',
|
'gross_line_total' => 'gross_line_total',
|
||||||
|
'status' => 'status',
|
||||||
|
'date' => 'date',
|
||||||
|
'currency' => 'currency',
|
||||||
|
'client' => 'client',
|
||||||
];
|
];
|
||||||
|
|
||||||
private array $decorate_keys = [
|
private array $decorate_keys = [
|
||||||
'client',
|
'client',
|
||||||
'currency',
|
'currency',
|
||||||
|
'date',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function __construct(Company $company, array $input)
|
public function __construct(Company $company, array $input)
|
||||||
@ -124,6 +130,8 @@ class ProductSalesExport extends BaseExport
|
|||||||
{
|
{
|
||||||
$entity['client'] = $invoice->client->present()->name();
|
$entity['client'] = $invoice->client->present()->name();
|
||||||
$entity['currency'] = $invoice->client->currency()->code;
|
$entity['currency'] = $invoice->client->currency()->code;
|
||||||
|
$entity['status'] = $invoice->stringStatus($invoice->status_id);
|
||||||
|
$entity['date'] = Carbon::parse($invoice->date)->format($this->company->date_format());
|
||||||
|
|
||||||
return $entity;
|
return $entity;
|
||||||
}
|
}
|
||||||
|
@ -174,9 +174,9 @@ class ProductSalesReportTest extends TestCase
|
|||||||
$response = $pl->run();
|
$response = $pl->run();
|
||||||
|
|
||||||
$this->assertIsString($response);
|
$this->assertIsString($response);
|
||||||
nlog($response);
|
// nlog($response);
|
||||||
|
|
||||||
// $this->account->delete();
|
$this->account->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user