diff --git a/app/Export/CSV/ProductSalesExport.php b/app/Export/CSV/ProductSalesExport.php index fee3c5f53e9a..3d6a586fb641 100644 --- a/app/Export/CSV/ProductSalesExport.php +++ b/app/Export/CSV/ProductSalesExport.php @@ -22,6 +22,7 @@ use App\Transformers\ProductTransformer; use App\Utils\Ninja; use Illuminate\Support\Facades\App; use League\Csv\Writer; +use Illuminate\Support\Carbon; class ProductSalesExport extends BaseExport { @@ -51,11 +52,16 @@ class ProductSalesExport extends BaseExport 'discount' => 'discount', 'line_total' => 'line_total', 'gross_line_total' => 'gross_line_total', + 'status' => 'status', + 'date' => 'date', + 'currency' => 'currency', + 'client' => 'client', ]; private array $decorate_keys = [ 'client', 'currency', + 'date', ]; public function __construct(Company $company, array $input) @@ -124,6 +130,8 @@ class ProductSalesExport extends BaseExport { $entity['client'] = $invoice->client->present()->name(); $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; } diff --git a/tests/Feature/Export/ProductSalesReportTest.php b/tests/Feature/Export/ProductSalesReportTest.php index 6917bdd33ec7..9dc6771f1f5f 100644 --- a/tests/Feature/Export/ProductSalesReportTest.php +++ b/tests/Feature/Export/ProductSalesReportTest.php @@ -174,9 +174,9 @@ class ProductSalesReportTest extends TestCase $response = $pl->run(); $this->assertIsString($response); -nlog($response); +// nlog($response); - // $this->account->delete(); + $this->account->delete(); }