Spaces:
Sleeping
Sleeping
Caner Giden
Cursor
fix(orders): net tutar ve net kar hesabini siparis - kesintiler ile hizala
b2864a2 Download frontend/src/features/orders/orderEditModel.js from Caner7/Muhasebe: direct link, hf CLI and curl.
- Browser
- Download file 1.55 kB
-
https://huggingface.co/spaces/Caner7/Muhasebe/resolve/main/frontend/src/features/orders/orderEditModel.js
- Command line
-
hf download hf://spaces/Caner7/Muhasebe/frontend/src/features/orders/orderEditModel.js
-
curl -L -o orderEditModel.js https://huggingface.co/spaces/Caner7/Muhasebe/resolve/main/frontend/src/features/orders/orderEditModel.js
1.55 kB
| import { computedNetPlatformAmount } from "../../lib/orders.js"; | |
| /** API satırından sipariş düzenleme formu alanlarına dönüşüm. */ | |
| export function orderItemToEditForm(item) { | |
| const numStr = (v) => { | |
| if (v == null || v === "") return ""; | |
| const x = Number(v); | |
| return Number.isFinite(x) ? String(x) : ""; | |
| }; | |
| return { | |
| order_date: item.order_date || "", | |
| order_no: String(item.order_no ?? ""), | |
| platform: item.platform || "Trendyol", | |
| store_name: item.store_name || "", | |
| product_name: item.product_name || "", | |
| quantity: numStr(item.quantity) || "1", | |
| order_total: numStr(item.order_total), | |
| unit_sale_price: numStr(item.unit_sale_price), | |
| unit_cost: numStr(item.unit_cost), | |
| commission: numStr(item.commission), | |
| discount: numStr(item.discount), | |
| shipping_cost: numStr(item.shipping_cost), | |
| return_shipping_cost: numStr(item.return_shipping_cost), | |
| penalty: numStr(item.penalty), | |
| cancellation_amount: numStr(item.cancellation_amount), | |
| refund_amount: numStr(item.refund_amount), | |
| other_fees: numStr(item.other_fees), | |
| net_platform_amount: (() => { | |
| const c = computedNetPlatformAmount(item); | |
| if (c != null) return String(c); | |
| return item.net_platform_amount != null ? String(item.net_platform_amount) : ""; | |
| })(), | |
| international_return_fee: numStr(item.international_return_fee), | |
| international_service_fee: numStr(item.international_service_fee), | |
| platform_service_fee: numStr(item.platform_service_fee), | |
| notes: item.notes || "", | |
| }; | |
| } | |