Skip to content
Code-Schnipsel Gruppen Projekte
Commit 131aa595 erstellt von Patrick Müller's avatar Patrick Müller
Dateien durchsuchen

Merge branch 'dev' into 'next'

fix: cast first argument of calls to getProduct() to int (productId)

See merge request !17
Übergeordnete 6822fbda 3412c0ab
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
2 Merge Requests!18next -> master,!17fix: cast first argument of calls to getProduct() to int (productId)
Pipeline-Nr. 4641 bestanden
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
QUI::$Ajax->registerFunction( QUI::$Ajax->registerFunction(
'package_quiqqer_erp_ajax_products_getProductEdit', 'package_quiqqer_erp_ajax_products_getProductEdit',
function ($productId, $user) { function ($productId, $user) {
$Product = Products::getProduct($productId); $Product = Products::getProduct((int)$productId);
$Control = new ProductEdit([ $Control = new ProductEdit([
'Product' => $Product 'Product' => $Product
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
QUI::$Ajax->registerFunction( QUI::$Ajax->registerFunction(
'package_quiqqer_erp_ajax_products_getVariantChildren', 'package_quiqqer_erp_ajax_products_getVariantChildren',
function ($productId) { function ($productId) {
$Product = Products::getProduct($productId); $Product = Products::getProduct((int)$productId);
if (!($Product instanceof VariantParent)) { if (!($Product instanceof VariantParent)) {
return []; return [];
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
QUI::$Ajax->registerFunction( QUI::$Ajax->registerFunction(
'package_quiqqer_erp_ajax_products_hasProductCustomFields', 'package_quiqqer_erp_ajax_products_hasProductCustomFields',
function ($productId) { function ($productId) {
$Product = Products::getProduct($productId); $Product = Products::getProduct((int)$productId);
$fields = $Product->createUniqueProduct()->getCustomFields(); $fields = $Product->createUniqueProduct()->getCustomFields();
return count($fields); return count($fields);
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
QUI::$Ajax->registerFunction( QUI::$Ajax->registerFunction(
'package_quiqqer_erp_ajax_products_isVariantParent', 'package_quiqqer_erp_ajax_products_isVariantParent',
function ($productId) { function ($productId) {
$Product = Products::getProduct($productId); $Product = Products::getProduct((int)$productId);
return $Product instanceof VariantParent; return $Product instanceof VariantParent;
}, },
['productId'], ['productId'],
......
...@@ -426,7 +426,7 @@ public function getVat() ...@@ -426,7 +426,7 @@ public function getVat()
$Area = QUI\ERP\Defaults::getArea(); $Area = QUI\ERP\Defaults::getArea();
} }
$Product = QUI\ERP\Products\Handler\Products::getProduct($this->attributes['id']); $Product = QUI\ERP\Products\Handler\Products::getProduct((int)$this->attributes['id']);
$Vat = $Product->getField(QUI\ERP\Products\Handler\Fields::FIELD_VAT); $Vat = $Product->getField(QUI\ERP\Products\Handler\Fields::FIELD_VAT);
$TaxType = new QUI\ERP\Tax\TaxType($Vat->getValue()); $TaxType = new QUI\ERP\Tax\TaxType($Vat->getValue());
$TaxEntry = TaxUtils::getTaxEntry($TaxType, $Area); $TaxEntry = TaxUtils::getTaxEntry($TaxType, $Area);
......
0% Lade oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren