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:
parent
85aadbbfec
commit
a212c04ace
@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user