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 @@
"url": "http:\/\/www.pcsg.de"
},
"require": {
"php": ">=5.3",
"quiqqer\/quiqqer": "*@dev",
"quiqqer\/areas": "*@dev",
"quiqqer\/products": "^1.6|*@dev",
"quiqqer\/tax": "*@dev"
"php": "^8.2",
"quiqqer\/quiqqer": "^2",
"quiqqer\/areas": "^1",
"quiqqer\/products": "^2",
"quiqqer\/tax": "^1"
},
"autoload": {
"psr-4": {
......
......@@ -219,17 +219,17 @@ public function __construct($id, Handler $Factory)
/**
* @param string $name
* @param mixed $val
* @param mixed $value
* @return void
*/
public function setAttribute(string $name, mixed $val): void
public function setAttribute(string $name, mixed $value): void
{
if ($name === 'lastSumDiscount' && empty($val)) {
$val = null;
if ($name === 'lastSumDiscount' && empty($value)) {
$value = null;
}
if ($name === 'lastProductDiscount' && empty($val)) {
$val = null;
if ($name === 'lastProductDiscount' && empty($value)) {
$value = null;
}
if (
......@@ -237,10 +237,10 @@ public function setAttribute(string $name, mixed $val): void
$name === 'discount_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
/* @var $Group QUI\Groups\Group */
foreach ($discountGroups as $gid) {
foreach ($groupsOfUser as $Group) {
if ($Group->getId() == $gid) {
if ($Group->getUsers() == $gid) {
return true;
}
......@@ -383,7 +383,7 @@ public function canUsedWith(QUI\ERP\Products\Interfaces\ProductInterface $Produc
}
// coupon
if ($Product->getId() === '-') {
if ($Product->getId() === -1) {
return false;
}
......
......@@ -168,14 +168,7 @@ public static function onQuiqqerProductsCalcListProduct(
return;
}
try {
$attributes = $Product->getAttributes();
} catch (QUI\Exception $Exception) {
QUI\System\Log::writeDebugException($Exception);
return;
}
$attributes = $Product->getAttributes();
$PriceFactors = $Product->getPriceFactors();
$productQuantity = $Product->getQuantity();
$productNettoSum = $attributes['calculated_nettoSum'];
......@@ -190,7 +183,7 @@ public static function onQuiqqerProductsCalcListProduct(
continue;
}
// check if Pricefactor is already in
// check if price factor is already in
$factors = $PriceFactors->toArray();
$Factor = $Discount->toPriceFactor(
$Calc->getUser()->getLocale(),
......
......@@ -23,7 +23,7 @@ class Handler extends QUI\CRUD\Factory
const DISCOUNT_TYPE_PERCENT = 1;
/**
* discount type -> crrency
* discount type -> currency
*/
const DISCOUNT_TYPE_CURRENCY = 2;
......@@ -50,7 +50,7 @@ class Handler extends QUI\CRUD\Factory
const DISCOUNT_SCOPE_GRAND_TOTAL = 4;
/**
* pricefactor discount type
* price factor discount type
*/
const DISCOUNT_PRICEFACTOR_TYPE = 'DISCOUNT_PRICE_FACTOR';
......
......@@ -22,11 +22,6 @@ class PriceFactor extends QUI\ERP\Products\Utils\PriceFactor implements
*/
protected string $type = Handler::DISCOUNT_PRICEFACTOR_TYPE;
/**
* @var string|null
*/
protected $vat = null;
/**
* PriceFactor constructor.
* @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