Skip to content
Code-Schnipsel Gruppen Projekte
Bestätigt Commit 1cb6ebfd erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

feat: quiqqer v2 and products v2 compatibility

Übergeordneter 609783bf
No related branches found
No related tags found
3 Merge Requests!5feat!: quiqqer v2,!4feat!: quiqqer v2,!3feat!: quiqqer v2
...@@ -18,11 +18,11 @@ ...@@ -18,11 +18,11 @@
"url": "http:\/\/www.pcsg.de" "url": "http:\/\/www.pcsg.de"
}, },
"require": { "require": {
"php": ">=5.3", "php": "^8.2",
"quiqqer\/quiqqer": "*@dev", "quiqqer\/quiqqer": "^2",
"quiqqer\/areas": "*@dev", "quiqqer\/areas": "^1",
"quiqqer\/products": "^1.6|*@dev", "quiqqer\/products": "^2",
"quiqqer\/tax": "*@dev" "quiqqer\/tax": "^1"
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
......
...@@ -219,17 +219,17 @@ public function __construct($id, Handler $Factory) ...@@ -219,17 +219,17 @@ public function __construct($id, Handler $Factory)
/** /**
* @param string $name * @param string $name
* @param mixed $val * @param mixed $value
* @return void * @return void
*/ */
public function setAttribute(string $name, mixed $val): void public function setAttribute(string $name, mixed $value): void
{ {
if ($name === 'lastSumDiscount' && empty($val)) { if ($name === 'lastSumDiscount' && empty($value)) {
$val = null; $value = null;
} }
if ($name === 'lastProductDiscount' && empty($val)) { if ($name === 'lastProductDiscount' && empty($value)) {
$val = null; $value = null;
} }
if ( if (
...@@ -237,10 +237,10 @@ public function setAttribute(string $name, mixed $val): void ...@@ -237,10 +237,10 @@ public function setAttribute(string $name, mixed $val): void
$name === 'discount_type' || $name === 'discount_type' ||
$name === 'usage_type' $name === 'usage_type'
) { ) {
$val = (int)$val; $value = (int)$value;
} }
parent::setAttribute($name, $val); parent::setAttribute($name, $value);
} }
/** /**
...@@ -357,7 +357,7 @@ public function canUsedBy(QUI\Interfaces\Users\User $User): bool ...@@ -357,7 +357,7 @@ public function canUsedBy(QUI\Interfaces\Users\User $User): bool
/* @var $Group QUI\Groups\Group */ /* @var $Group QUI\Groups\Group */
foreach ($discountGroups as $gid) { foreach ($discountGroups as $gid) {
foreach ($groupsOfUser as $Group) { foreach ($groupsOfUser as $Group) {
if ($Group->getId() == $gid) { if ($Group->getUsers() == $gid) {
return true; return true;
} }
...@@ -383,7 +383,7 @@ public function canUsedWith(QUI\ERP\Products\Interfaces\ProductInterface $Produc ...@@ -383,7 +383,7 @@ public function canUsedWith(QUI\ERP\Products\Interfaces\ProductInterface $Produc
} }
// coupon // coupon
if ($Product->getId() === '-') { if ($Product->getId() === -1) {
return false; return false;
} }
......
...@@ -168,14 +168,7 @@ public static function onQuiqqerProductsCalcListProduct( ...@@ -168,14 +168,7 @@ public static function onQuiqqerProductsCalcListProduct(
return; return;
} }
try { $attributes = $Product->getAttributes();
$attributes = $Product->getAttributes();
} catch (QUI\Exception $Exception) {
QUI\System\Log::writeDebugException($Exception);
return;
}
$PriceFactors = $Product->getPriceFactors(); $PriceFactors = $Product->getPriceFactors();
$productQuantity = $Product->getQuantity(); $productQuantity = $Product->getQuantity();
$productNettoSum = $attributes['calculated_nettoSum']; $productNettoSum = $attributes['calculated_nettoSum'];
...@@ -190,7 +183,7 @@ public static function onQuiqqerProductsCalcListProduct( ...@@ -190,7 +183,7 @@ public static function onQuiqqerProductsCalcListProduct(
continue; continue;
} }
// check if Pricefactor is already in // check if price factor is already in
$factors = $PriceFactors->toArray(); $factors = $PriceFactors->toArray();
$Factor = $Discount->toPriceFactor( $Factor = $Discount->toPriceFactor(
$Calc->getUser()->getLocale(), $Calc->getUser()->getLocale(),
......
...@@ -23,7 +23,7 @@ class Handler extends QUI\CRUD\Factory ...@@ -23,7 +23,7 @@ class Handler extends QUI\CRUD\Factory
const DISCOUNT_TYPE_PERCENT = 1; const DISCOUNT_TYPE_PERCENT = 1;
/** /**
* discount type -> crrency * discount type -> currency
*/ */
const DISCOUNT_TYPE_CURRENCY = 2; const DISCOUNT_TYPE_CURRENCY = 2;
...@@ -50,7 +50,7 @@ class Handler extends QUI\CRUD\Factory ...@@ -50,7 +50,7 @@ class Handler extends QUI\CRUD\Factory
const DISCOUNT_SCOPE_GRAND_TOTAL = 4; const DISCOUNT_SCOPE_GRAND_TOTAL = 4;
/** /**
* pricefactor discount type * price factor discount type
*/ */
const DISCOUNT_PRICEFACTOR_TYPE = 'DISCOUNT_PRICE_FACTOR'; const DISCOUNT_PRICEFACTOR_TYPE = 'DISCOUNT_PRICE_FACTOR';
......
...@@ -22,11 +22,6 @@ class PriceFactor extends QUI\ERP\Products\Utils\PriceFactor implements ...@@ -22,11 +22,6 @@ class PriceFactor extends QUI\ERP\Products\Utils\PriceFactor implements
*/ */
protected string $type = Handler::DISCOUNT_PRICEFACTOR_TYPE; protected string $type = Handler::DISCOUNT_PRICEFACTOR_TYPE;
/**
* @var string|null
*/
protected $vat = null;
/** /**
* PriceFactor constructor. * PriceFactor constructor.
* @param array $params * @param array $params
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren