|
|
@@ -202,9 +202,11 @@ class ProductPrice extends ActiveRecordCommon |
|
|
|
if(self::hasMatchOfType($specificPriceArray, 'matchUser', $user, $pointSale)) { |
|
|
|
return 'matchUser'; |
|
|
|
} |
|
|
|
|
|
|
|
if(self::hasMatchOfType($specificPriceArray, 'matchUserGroup', $user, $pointSale)) { |
|
|
|
return 'matchUserGroup'; |
|
|
|
} |
|
|
|
|
|
|
|
if(self::hasMatchOfType($specificPriceArray, 'matchPointSale', $user, $pointSale)) { |
|
|
|
return 'matchPointSale'; |
|
|
|
} |
|
|
@@ -213,6 +215,10 @@ class ProductPrice extends ActiveRecordCommon |
|
|
|
return 'matchUserPointSale'; |
|
|
|
} |
|
|
|
|
|
|
|
if(self::hasMatchOfType($specificPriceArray, 'matchUserGroupPointSale', $user, $pointSale)) { |
|
|
|
return 'matchUserGroupPointSale'; |
|
|
|
} |
|
|
|
|
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
@@ -252,6 +258,17 @@ class ProductPrice extends ActiveRecordCommon |
|
|
|
&& $this->id_user == $user->id; |
|
|
|
} |
|
|
|
|
|
|
|
public function matchUserGroupPointSale($user, $pointSale) |
|
|
|
{ |
|
|
|
return $user |
|
|
|
&& $pointSale |
|
|
|
&& $this->id_user_group |
|
|
|
&& $this->id_point_sale |
|
|
|
&& !$this->id_user |
|
|
|
&& $user->belongsToUserGroup($this->id_user_group) |
|
|
|
&& $this->id_point_sale == $pointSale->id; |
|
|
|
} |
|
|
|
|
|
|
|
public function matchFromQuantityOnly() |
|
|
|
{ |
|
|
|
return !$this->id_user |