Integration with Intuit - get accounting details for products
This commit is contained in:
@@ -14,6 +14,7 @@ use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Str;
|
||||
use Leenooks\Traits\ScopeActive;
|
||||
|
||||
use App\Http\Controllers\AccountingController;
|
||||
use App\Interfaces\{IDs,ProductItem};
|
||||
use App\Traits\{ProductDetails,SiteID};
|
||||
|
||||
@@ -358,6 +359,11 @@ class Product extends Model implements IDs
|
||||
return round($price,2);
|
||||
}
|
||||
|
||||
public function accounting(string $provider): Collection
|
||||
{
|
||||
return AccountingController::list($provider);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the charge from the pricing table for the specific time period and group
|
||||
*
|
||||
|
@@ -18,8 +18,15 @@ class ProviderOauth extends Model
|
||||
|
||||
public function accounts()
|
||||
{
|
||||
return $this->belongsToMany(Account::class,'account_provider')
|
||||
->where('account_provider.site_id',$this->site_id)
|
||||
return $this->belongsToMany(Account::class,'account__provider')
|
||||
->where('account__provider.site_id',$this->site_id)
|
||||
->withPivot('ref','synctoken','created_at','updated_at');
|
||||
}
|
||||
|
||||
public function products()
|
||||
{
|
||||
return $this->belongsToMany(Product::class,'product__provider')
|
||||
->where('product__provider.site_id',$this->site_id)
|
||||
->withPivot('ref','synctoken','created_at','updated_at');
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user