GX-Abgewiesen #51227 » OrdersEditSetTaxAllowedFix.patch
src/admin/orders_edit.php (revision ) | ||
---|---|---|
472 | 472 |
$orderItem->setPrice(new DecimalType($price)); |
473 | 473 |
$orderItem->setQuantity(new DecimalType(xtc_db_prepare_input($_POST['products_quantity']))); |
474 | 474 |
$orderItem->setTax(new DecimalType($tax_rate)); |
475 |
$orderItem->setTaxAllowed(new BoolType((bool)(int)$status['customers_status_show_price_tax']));
|
|
475 |
$orderItem->setTaxAllowed(new IntType((int)$status['customers_status_show_price_tax']));
|
|
476 | 476 |
$orderItem->setProductModel(new StringType(xtc_db_prepare_input($product['products_model']))); |
477 | 477 |
$orderItem->setShippingTimeInfo(new StringType(xtc_db_prepare_input((string)$t_shipping_time['shipping_status_name']))); |
478 | 478 |
$orderItem->setAddonValue(new StringType('productId'), new StringType(xtc_db_prepare_input($_POST['products_id']))); |
tests/system/orders/OrderItemTest.php (revision ) | ||
---|---|---|
96 | 96 |
} |
97 | 97 |
|
98 | 98 |
|
99 |
public function testCanSetAndGetTaxAllowedBool()
|
|
99 |
public function testCanSetAndGetTaxAllowedInt()
|
|
100 | 100 |
{ |
101 |
$value = $this->mockFactory->create('BoolType', true);
|
|
101 |
$value = $this->mockFactory->create('IntType', 1);
|
|
102 | 102 |
|
103 | 103 |
$this->orderItem->setTaxAllowed($value); |
104 | 104 |
|
105 |
$this->assertEquals($value->asBool(), $this->orderItem->isTaxAllowed());
|
|
105 |
$this->assertEquals($value->asInt(), $this->orderItem->isTaxAllowed());
|
|
106 | 106 |
} |
107 | 107 |
|
108 | 108 |
|
src/GXMainComponents/Services/Core/Order/Entities/Interfaces/OrderItemInterface.inc.php (revision ) | ||
---|---|---|
176 | 176 |
/** |
177 | 177 |
* Sets whether tax of the OrderItem is allowed or not. |
178 | 178 |
* |
179 |
* @param BoolType $allow Tax allowed or not?
|
|
179 |
* @param IntType $allow Tax allowed or not?
|
|
180 | 180 |
* |
181 | 181 |
* @return OrderItemInterface Same instance for method chaining. |
182 | 182 |
*/ |
183 |
public function setTaxAllowed(BoolType $allow);
|
|
183 |
public function setTaxAllowed(IntType $allow);
|
|
184 | 184 |
|
185 | 185 |
|
186 | 186 |
/** |
src/GXMainComponents/Services/Core/Order/Entities/OrderItem.inc.php (revision ) | ||
---|---|---|
382 | 382 |
/** |
383 | 383 |
* Sets whether tax of the OrderItem is allowed or not. |
384 | 384 |
* |
385 |
* @param BoolType $allow Tax allowed or not?
|
|
385 |
* @param IntType $allow Tax allowed or not?
|
|
386 | 386 |
* |
387 | 387 |
* @return OrderItem Same instance for method chaining. |
388 | 388 |
*/ |
389 |
public function setTaxAllowed(BoolType $allow)
|
|
389 |
public function setTaxAllowed(IntType $allow)
|
|
390 | 390 |
{ |
391 |
$this->taxAllowed = $allow->asBool();
|
|
391 |
$this->taxAllowed = $allow->asInt();
|
|
392 | 392 |
|
393 | 393 |
return $this; |
394 | 394 |
} |