Inuit sync of tax, product accounting, accounts and invoices
This commit is contained in:
@@ -16,7 +16,7 @@ use Leenooks\Traits\ScopeActive;
|
||||
|
||||
use App\Http\Controllers\AccountingController;
|
||||
use App\Interfaces\{IDs,ProductItem};
|
||||
use App\Traits\{ProductDetails,SiteID};
|
||||
use App\Traits\{ProductDetails,ProviderRef,SiteID};
|
||||
|
||||
/**
|
||||
* Class Product
|
||||
@@ -66,7 +66,7 @@ use App\Traits\{ProductDetails,SiteID};
|
||||
*/
|
||||
class Product extends Model implements IDs
|
||||
{
|
||||
use Compoships,HasFactory,SiteID,ProductDetails,ScopeActive;
|
||||
use Compoships,HasFactory,SiteID,ProductDetails,ScopeActive,ProviderRef;
|
||||
|
||||
protected $casts = [
|
||||
'pricing'=>'collection',
|
||||
@@ -106,6 +106,13 @@ class Product extends Model implements IDs
|
||||
|
||||
/* RELATIONS */
|
||||
|
||||
public function providers()
|
||||
{
|
||||
return $this->belongsToMany(ProviderOauth::class,'product__provider')
|
||||
->where('product__provider.site_id',$this->site_id)
|
||||
->withPivot('ref');
|
||||
}
|
||||
|
||||
/**
|
||||
* Which services are configured with this product
|
||||
*
|
||||
|
Reference in New Issue
Block a user