Skip to content
Code-Schnipsel Gruppen Projekte
Commit be2a05bb erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

fix: set user to article list at setCustomer()

This commit refactors the formatting and structure of the reversal method for improved readability.
Additionally, it removes an unnecessary exception in the 'setCustomer' method.

This commit also fixes the customer user settings in various methods in the order class. Now,
whenever a customer is set or removed, the related articles will correctly update their user status.
Übergeordneter 5efbea54
No related branches found
No related tags found
2 Merge Requests!148Update 'next-3.x' with latest changes from 'main',!147fix: move original price styling to the Basket Control
Pipeline #15641 bestanden mit Phase
in 2 Minuten und 55 Sekunden
......@@ -474,8 +474,10 @@ protected function setDataBaseData(array $data): void
* @param QUI\Interfaces\Users\User|null $PermissionUser
* @return ErpEntityInterface|null
*/
public function reversal(string $reason = '', null | QUI\Interfaces\Users\User $PermissionUser = null): ?ErpEntityInterface
{
public function reversal(
string $reason = '',
null | QUI\Interfaces\Users\User $PermissionUser = null
): ?ErpEntityInterface {
$this->delete($PermissionUser);
return null;
}
......@@ -1167,7 +1169,6 @@ public function setCurrency(QUI\ERP\Currency\Currency $Currency): void
* Set a customer to the order
*
* @param array|User|QUI\Interfaces\Users\User $User
* @throws Exception
* @throws QUI\Exception
* @throws ExceptionStack
*/
......@@ -1264,6 +1265,7 @@ public function setCustomer(QUI\Interfaces\Users\User | array | User $User): voi
QUI::getEvents()->fireEvent('onQuiqqerOrderCustomerChange', [$this]);
}
$this->Articles?->setUser($this->Customer);
return;
}
......@@ -1277,6 +1279,7 @@ public function setCustomer(QUI\Interfaces\Users\User | array | User $User): voi
QUI::getEvents()->fireEvent('onQuiqqerOrderCustomerChange', [$this]);
}
$this->Articles?->setUser($this->Customer);
return;
}
......@@ -1293,6 +1296,8 @@ public function setCustomer(QUI\Interfaces\Users\User | array | User $User): voi
if ($this->customerId !== $oldCustomerId) {
QUI::getEvents()->fireEvent('onQuiqqerOrderCustomerChange', [$this]);
}
$this->Articles?->setUser($this->Customer);
}
}
......@@ -1303,6 +1308,7 @@ public function removeCustomer(): void
{
$this->Customer = null;
$this->customerId = 0;
$this->Articles->setUser(null);
try {
QUI::getEvents()->fireEvent('onQuiqqerOrderCustomerChange', [$this]);
......
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