Commit d6b89df9 authored by Philippe Pary's avatar Philippe Pary
Browse files

Scaled* fields are required in DB scheme in API and in Admin. We should not...

Scaled* fields are required in DB scheme in API and in Admin. We should not remove them from the JSON export of API
parent d8b21410
......@@ -313,16 +313,11 @@ class Product extends DoctrineModel
$struct['taxValue'] = $this->getTaxValue();
if ($this->isPrepay()) {
// Remove irrelevent fields
unset($struct['scaleType']);
unset($struct['scaleValue']);
unset($struct['compositionGroups']);
// Embed prepay value to be able to apply discounts on it.
$struct['prepayValue'] = $this->getPriceSell();
} elseif ($this->isComposition()) {
// Disable irrelevent fields
unset($struct['scaled']);
unset($struct['scaleType']);
unset($struct['scaleValue']);
unset($struct['prepay']);
} else {
unset($struct['compositionGroups']);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment