Merge pull request 'fix/price-calculator' (#94) from fix/price-calculator into development
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details

Reviewed-on: #94
pull/98/head^2 20.1.68-alpha.1
irfan 2024-09-20 04:07:24 +00:00
commit 3de7bfbbe5
1 changed files with 10 additions and 9 deletions

View File

@ -178,6 +178,16 @@ export function mappingRevertTransaction(data, type) {
const total_share_tenant = const total_share_tenant =
share_margin > 0 ? (Number(share_margin) / 100) * total_price : 0; share_margin > 0 ? (Number(share_margin) / 100) * total_price : 0;
item.item.bundling_items = item.item.bundling_items?.map((bundling) => {
if (bundling.item_id) return bundling;
return {
...bundling,
item_id: bundling.id,
item_name: bundling.name,
id: uuidv4(),
};
});
Object.assign(item, { Object.assign(item, {
item_id: item.item.id, item_id: item.item.id,
item_name: item.item.name, item_name: item.item.name,
@ -192,15 +202,6 @@ export function mappingRevertTransaction(data, type) {
(bundling) => bundling.name, (bundling) => bundling.name,
), ),
breakdown_bundling: item.item.breakdown_bundling, breakdown_bundling: item.item.breakdown_bundling,
bundling_items: item.item.bundling_items?.map((bundling) => {
if (bundling.item_id) return bundling;
return {
...bundling,
item_id: bundling.id,
item_name: bundling.name,
id: uuidv4(),
};
}),
item_tenant_id: item.item.tenant?.id ?? null, item_tenant_id: item.item.tenant?.id ?? null,
item_tenant_name: item.item.tenant?.id ?? null, item_tenant_name: item.item.tenant?.id ?? null,