Fixed order processing, broken after upgrade to Laravel 5.8

This commit is contained in:
Deon George
2019-06-13 14:32:34 +10:00
parent 9fa773d283
commit 4c5c43c390
13 changed files with 68 additions and 16 deletions

View File

@@ -7,7 +7,6 @@ use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Cache;
use QuickBooksOnline\API\Data\IPPCustomer;
use QuickBooksOnline\API\Facades\Customer;
use App\User;
use App\Classes\External\Accounting as Base;
@@ -36,6 +35,26 @@ class Quickbooks extends Base
});
}
public function getInvoice(int $id,$refresh=FALSE)
{
if ($refresh)
Cache::forget(__METHOD__.$id);
return Cache::remember(__METHOD__.$id,86400,function() use ($id) {
return $this->api->getDataService()->Query(sprintf("SELECT * FROM Invoice where id = '%s'",$id));
});
}
public function getInvoices($refresh=FALSE): Collection
{
if ($refresh)
Cache::forget(__METHOD__);
return Cache::remember(__METHOD__,86400,function() {
return collect($this->api->getDataService()->Query('SELECT * FROM Invoice'));
});
}
public function updateCustomer(IPPCustomer $r,array $args)
{
$r->sparse = TRUE;