diff options
| author | HafidBuroiroh <hafidburoiroh09@gmail.com> | 2026-02-02 11:24:09 +0700 |
|---|---|---|
| committer | HafidBuroiroh <hafidburoiroh09@gmail.com> | 2026-02-02 11:24:09 +0700 |
| commit | 04093dbd490ef94a19aa2df69793e8eeb48831c5 (patch) | |
| tree | 2615cadae9d409e6d7940204caa31fdcf35dcf49 /indoteknik_custom/models/sale_order_line.py | |
| parent | 48e48a61a6fc0addcc1e0c3590ca8582abe66a6a (diff) | |
<hafid> fix date order cashback start februari
Diffstat (limited to 'indoteknik_custom/models/sale_order_line.py')
| -rw-r--r-- | indoteknik_custom/models/sale_order_line.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/indoteknik_custom/models/sale_order_line.py b/indoteknik_custom/models/sale_order_line.py index 270fc842..dd44f84a 100644 --- a/indoteknik_custom/models/sale_order_line.py +++ b/indoteknik_custom/models/sale_order_line.py @@ -261,17 +261,25 @@ class SaleOrderLine(models.Model): line.item_before_margin = margin_per_item def _compute_cashback_brand(self): + start_date = datetime(2026, 2, 1, 0, 0, 0) for line in self: line.amount_cashback = 0 if not line.product_id: continue + if line.order_id.date_order < start_date: + continue + + price, taxes, vendor_id = self._get_purchase_price(line.product_id) + cashback_percent = line.product_id.x_manufacture.cashback_percent or 0 if cashback_percent <= 0: continue - price, taxes, vendor = self._get_purchase_price(line.product_id) + + if line.vendor_id.id != 5571: + continue price_tax_excl = price |
