1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Minor fixes for filters

This commit is contained in:
David Bomba 2024-05-15 11:55:51 +10:00
parent 85aadbbfec
commit a212c04ace
2 changed files with 15 additions and 3 deletions

View File

@ -146,9 +146,15 @@ class ProductSalesExport extends BaseExport
->each(function ($invoice) use($product_keys) {
foreach ($invoice->line_items as $item) {
if($product_keys && in_array($item->product_key, $product_keys))
if($product_keys)
{
if(in_array($item->product_key, $product_keys))
$this->csv->insertOne($this->buildRow($invoice, $item));
}
else {
$this->csv->insertOne($this->buildRow($invoice, $item));
}
}
});

View File

@ -227,7 +227,13 @@ class InvoiceFilters extends QueryFilters
if (is_numeric($date)) {
$date = Carbon::createFromTimestamp((int)$date);
} else {
$date = Carbon::parse($date);
try{
$date = Carbon::parse($date);
}
catch(\Exception $e){
return $this->builder;
}
}
return $this->builder->where('date', '>=', $date);