Fixed order processing, broken after upgrade to Laravel 5.8
This commit is contained in:
21
app/Classes/External/Accounting/Quickbooks.php
vendored
21
app/Classes/External/Accounting/Quickbooks.php
vendored
@@ -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;
|
||||
|
Reference in New Issue
Block a user