From 9bc5f5c347b3e8f4d739d615e6a858b25c98e78c Mon Sep 17 00:00:00 2001 From: "Indoteknik ." Date: Wed, 25 Jun 2025 08:32:05 +0700 Subject: (andri) fix --- indoteknik_custom/views/res_partner.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indoteknik_custom/views/res_partner.xml b/indoteknik_custom/views/res_partner.xml index 6115587b..2ed37caf 100644 --- a/indoteknik_custom/views/res_partner.xml +++ b/indoteknik_custom/views/res_partner.xml @@ -182,10 +182,10 @@ - + -- cgit v1.2.3 From 01a2063093951e1125d86dc9b8794e591df07a06 Mon Sep 17 00:00:00 2001 From: "Indoteknik ." Date: Wed, 25 Jun 2025 08:32:25 +0700 Subject: (andri) fix --- indoteknik_custom/views/res_partner.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indoteknik_custom/views/res_partner.xml b/indoteknik_custom/views/res_partner.xml index 2ed37caf..a851385f 100644 --- a/indoteknik_custom/views/res_partner.xml +++ b/indoteknik_custom/views/res_partner.xml @@ -181,7 +181,7 @@ - + - + -- cgit v1.2.3 From 92bf91488eca67adabb6bfe8394385a9cee1032d Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Wed, 25 Jun 2025 09:58:26 +0700 Subject: fix bu pick automatic reserve --- indoteknik_custom/models/stock_picking.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index 27046063..c884f97e 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -1356,6 +1356,8 @@ class StockPicking(models.Model): ]) for line in po.order_sales_match_line: + if not line.bu_pick: + continue line.bu_pick.action_assign() def check_invoice_date(self): -- cgit v1.2.3 From 74b49469064387219474ddf8e8f38e5d676079c2 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Wed, 25 Jun 2025 10:03:06 +0700 Subject: push --- indoteknik_custom/models/purchase_order_sales_match.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indoteknik_custom/models/purchase_order_sales_match.py b/indoteknik_custom/models/purchase_order_sales_match.py index 2ea89dab..b18864f3 100644 --- a/indoteknik_custom/models/purchase_order_sales_match.py +++ b/indoteknik_custom/models/purchase_order_sales_match.py @@ -41,7 +41,7 @@ class PurchaseOrderSalesMatch(models.Model): if stock_move: rec.bu_pick = stock_move.picking_id.id else: - rec.bu_pick = '' + rec.bu_pick = None def _compute_purchase_line_id(self): for line in self: -- cgit v1.2.3 From 3c43b91173cdaf5762e2f39197a89a2b24090458 Mon Sep 17 00:00:00 2001 From: "Indoteknik ." Date: Wed, 25 Jun 2025 10:47:17 +0700 Subject: (andri) fix peletakan field pada view billreklas --- indoteknik_custom/views/account_move.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indoteknik_custom/views/account_move.xml b/indoteknik_custom/views/account_move.xml index e8061862..ad52a74a 100644 --- a/indoteknik_custom/views/account_move.xml +++ b/indoteknik_custom/views/account_move.xml @@ -37,6 +37,8 @@ + + -- cgit v1.2.3 From 8ca3394604d088a683fc4a3c69321ad65f093b7f Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Wed, 25 Jun 2025 11:18:33 +0700 Subject: add terbilang total cashback customer commision --- indoteknik_custom/models/commision.py | 15 +++++++++++++++ indoteknik_custom/views/customer_commision.xml | 1 + 2 files changed, 16 insertions(+) diff --git a/indoteknik_custom/models/commision.py b/indoteknik_custom/models/commision.py index 199aa106..997d4470 100644 --- a/indoteknik_custom/models/commision.py +++ b/indoteknik_custom/models/commision.py @@ -191,6 +191,7 @@ class CustomerCommision(models.Model): total_cashback = fields.Float(string='Total Cashback') commision_amt_text = fields.Char(string='Commision Amount Text', compute='compute_delivery_amt_text') + total_cashback_text = fields.Char(string='Commision Amount Text', compute='compute_total_cashback_text') total_dpp = fields.Float(string='Total DPP', compute='_compute_total_dpp') commision_type = fields.Selection([ ('fee', 'Fee'), @@ -281,6 +282,20 @@ class CustomerCommision(models.Model): except: record.commision_amt_text = res + def compute_total_cashback_text(self): + tb = Terbilang() + + for record in self: + res = '' + + try: + if record.total_commision > 0: + tb.parse(int(record.total_commision)) + res = tb.getresult().title() + record.commision_amt_text = res + ' Rupiah' + except: + record.commision_amt_text = res + def _compute_grouped_numbers(self): for rec in self: so_numbers = set() diff --git a/indoteknik_custom/views/customer_commision.xml b/indoteknik_custom/views/customer_commision.xml index d5fb1d70..1c17bf63 100644 --- a/indoteknik_custom/views/customer_commision.xml +++ b/indoteknik_custom/views/customer_commision.xml @@ -83,6 +83,7 @@ + -- cgit v1.2.3 From f87442f721ea925bd2763492f990bbe68e1627ac Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Wed, 25 Jun 2025 13:09:24 +0700 Subject: fix terbilang cashback customer benefits --- indoteknik_custom/models/commision.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/indoteknik_custom/models/commision.py b/indoteknik_custom/models/commision.py index 997d4470..b685f6e1 100644 --- a/indoteknik_custom/models/commision.py +++ b/indoteknik_custom/models/commision.py @@ -191,7 +191,7 @@ class CustomerCommision(models.Model): total_cashback = fields.Float(string='Total Cashback') commision_amt_text = fields.Char(string='Commision Amount Text', compute='compute_delivery_amt_text') - total_cashback_text = fields.Char(string='Commision Amount Text', compute='compute_total_cashback_text') + total_cashback_text = fields.Char(string='Cashback Text', compute='compute_total_cashback_text') total_dpp = fields.Float(string='Total DPP', compute='_compute_total_dpp') commision_type = fields.Selection([ ('fee', 'Fee'), @@ -287,14 +287,14 @@ class CustomerCommision(models.Model): for record in self: res = '' - try: if record.total_commision > 0: tb.parse(int(record.total_commision)) res = tb.getresult().title() - record.commision_amt_text = res + ' Rupiah' - except: - record.commision_amt_text = res + record.total_cashback_text = f"{res} Rupiah" if res else "" + except Exception as e: + record.total_cashback_text = "" + _logger.error("Error computing cashback text: %s", str(e)) def _compute_grouped_numbers(self): for rec in self: -- cgit v1.2.3 From 0e02e21f5b8943a25e21c377303f6552494e6cc7 Mon Sep 17 00:00:00 2001 From: "Indoteknik ." Date: Wed, 25 Jun 2025 14:45:32 +0700 Subject: (andri) fix xml coretax --- indoteknik_custom/models/coretax_fatur.py | 105 +++++++----------------------- 1 file changed, 25 insertions(+), 80 deletions(-) diff --git a/indoteknik_custom/models/coretax_fatur.py b/indoteknik_custom/models/coretax_fatur.py index 54eb0f8e..4397d7a1 100644 --- a/indoteknik_custom/models/coretax_fatur.py +++ b/indoteknik_custom/models/coretax_fatur.py @@ -51,8 +51,7 @@ class CoretaxFaktur(models.Model): buyerIDTKU = formula if sum(int(char) for char in buyerTIN) > 0 else '000000' # Tambahkan elemen faktur - ET.SubElement(tax_invoice, 'TaxInvoiceDate').text = invoice.invoice_date.strftime( - '%Y-%m-%d') if invoice.invoice_date else '' + ET.SubElement(tax_invoice, 'TaxInvoiceDate').text = invoice.invoice_date.strftime('%Y-%m-%d') if invoice.invoice_date else '' ET.SubElement(tax_invoice, 'TaxInvoiceOpt').text = 'Normal' ET.SubElement(tax_invoice, 'TrxCode').text = '04' ET.SubElement(tax_invoice, 'AddInfo') @@ -62,103 +61,49 @@ class CoretaxFaktur(models.Model): ET.SubElement(tax_invoice, 'FacilityStamp') ET.SubElement(tax_invoice, 'SellerIDTKU').text = '0742260227086000000000' ET.SubElement(tax_invoice, 'BuyerTin').text = buyerTIN - ET.SubElement(tax_invoice, 'BuyerDocument').text = 'TIN' if sum( - int(char) for char in buyerTIN) > 0 else 'Other ID' + ET.SubElement(tax_invoice, 'BuyerDocument').text = 'TIN' if sum(int(char) for char in buyerTIN) > 0 else 'Other ID' ET.SubElement(tax_invoice, 'BuyerCountry').text = 'IDN' - ET.SubElement(tax_invoice, 'BuyerDocumentNumber').text = '-' if sum( - int(char) for char in buyerTIN) > 0 else str(invoice.partner_id.id) + ET.SubElement(tax_invoice, 'BuyerDocumentNumber').text = '-' if sum(int(char) for char in buyerTIN) > 0 else str(invoice.partner_id.id) ET.SubElement(tax_invoice, 'BuyerName').text = invoice.partner_id.nama_wajib_pajak or '' ET.SubElement(tax_invoice, 'BuyerAdress').text = invoice.partner_id.alamat_lengkap_text or '' ET.SubElement(tax_invoice, 'BuyerEmail').text = invoice.partner_id.email or '' ET.SubElement(tax_invoice, 'BuyerIDTKU').text = buyerIDTKU - # Handle product lines based on down_payments flag - if down_payments and invoice.invoice_origin: - # Get from sale.order.line for down payment - sale_order = invoice.sale_id - if sale_order: - product_lines = sale_order.order_line.filtered( - lambda l: l.product_id and not l.is_downpayment and not l.display_type and not l.product_id.id == 229625 - ) - # Convert sale order lines to invoice-like format - converted_lines = [] - for line in product_lines: - converted_lines.append({ - 'name': line.name, - 'product_id': line.product_id, - 'price_subtotal': line.price_subtotal, - 'quantity': line.product_uom_qty, - 'price_unit': line.price_unit, - 'account_id': line.order_id.analytic_account_id or False, - }) - product_lines = converted_lines - else: - product_lines = [] - else: - # Normal case - get from invoice lines - product_lines = invoice.invoice_line_ids.filtered( - lambda l: not l.display_type and hasattr(l, 'account_id') and - l.account_id and l.product_id and - l.account_id.id != self.DISCOUNT_ACCOUNT_ID and - l.quantity != -1 - ) - - # Filter discount (always from invoice) - discount_lines = invoice.invoice_line_ids.filtered( - lambda l: not l.display_type and ( - (hasattr(l, 'account_id') and l.account_id and - l.account_id.id == self.DISCOUNT_ACCOUNT_ID) or - (l.quantity == -1) - ) + # Ambil lines + product_lines = invoice.invoice_line_ids.filtered( + lambda l: not l.display_type and l.product_id and l.account_id and l.account_id.id != self.DISCOUNT_ACCOUNT_ID and l.quantity != -1 ) - # Calculate totals - total_product_amount = sum(line.get('price_subtotal', 0) if isinstance(line, dict) - else line.price_subtotal for line in product_lines) - if total_product_amount == 0: - total_product_amount = 1 # Avoid division by zero - - total_discount_amount = abs(sum(line.price_subtotal for line in discount_lines)) + invoice_untaxed = invoice.amount_untaxed + if invoice_untaxed == 0: + invoice_untaxed = 1 # Hindari div zero # Tambahkan elemen ListOfGoodService list_of_good_service = ET.SubElement(tax_invoice, 'ListOfGoodService') for line in product_lines: - # Handle both dict (converted sale lines) and normal invoice lines - if isinstance(line, dict): - line_price_subtotal = line['price_subtotal'] - line_quantity = line['quantity'] - line_name = line['name'] - line_price_unit = line['price_unit'] - else: - line_price_subtotal = line.price_subtotal - line_quantity = line.quantity - line_name = line.name - line_price_unit = line.price_unit - - # Calculate prorated discount - line_proportion = line_price_subtotal / total_product_amount - line_discount = total_discount_amount * line_proportion - - subtotal = line_price_subtotal - quantity = line_quantity - total_discount = round(line_discount, 2) - - # Calculate other tax values - otherTaxBase = round(subtotal * (11 / 12), 2) if subtotal else 0 - vat_amount = round(otherTaxBase * 0.12, 2) - - # Create the line in XML + line_price_subtotal = line.price_subtotal + line_quantity = line.quantity + line_name = line.name + line_price_unit = line.price_unit + + # Hitung proporsi & tax base per line + line_proportion = line_price_subtotal / invoice_untaxed + line_tax_base = round(invoice.amount_untaxed * line_proportion, 2) + other_tax_base = round(line_tax_base * (11 / 12), 2) + vat_amount = round(other_tax_base * 0.12, 2) + + # Isi XML good_service = ET.SubElement(list_of_good_service, 'GoodService') ET.SubElement(good_service, 'Opt').text = 'A' ET.SubElement(good_service, 'Code').text = '000000' ET.SubElement(good_service, 'Name').text = line_name ET.SubElement(good_service, 'Unit').text = 'UM.0018' ET.SubElement(good_service, 'Price').text = str(round(line_price_unit, 2)) if line_price_unit else '0' - ET.SubElement(good_service, 'Qty').text = str(quantity) - ET.SubElement(good_service, 'TotalDiscount').text = str(total_discount) - ET.SubElement(good_service, 'TaxBase').text = str(round(subtotal)) if subtotal else '0' - ET.SubElement(good_service, 'OtherTaxBase').text = str(otherTaxBase) + ET.SubElement(good_service, 'Qty').text = str(line_quantity) + ET.SubElement(good_service, 'TotalDiscount').text = '0' + ET.SubElement(good_service, 'TaxBase').text = str(line_tax_base) + ET.SubElement(good_service, 'OtherTaxBase').text = str(other_tax_base) ET.SubElement(good_service, 'VATRate').text = '12' ET.SubElement(good_service, 'VAT').text = str(vat_amount) ET.SubElement(good_service, 'STLGRate').text = '0' -- cgit v1.2.3 From e483cf1634b16df7c9ecc4a89007dbc253b68da1 Mon Sep 17 00:00:00 2001 From: "Indoteknik ." Date: Wed, 25 Jun 2025 14:50:32 +0700 Subject: (andri) ganti penamaan field commision --- indoteknik_custom/models/commision.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indoteknik_custom/models/commision.py b/indoteknik_custom/models/commision.py index b685f6e1..4db6c009 100644 --- a/indoteknik_custom/models/commision.py +++ b/indoteknik_custom/models/commision.py @@ -178,10 +178,10 @@ class CustomerCommision(models.Model): ], string='Status') # commision_percent = fields.Float(string='Commision %', tracking=3) - commision_percent = fields.Float(string='Cashback %', tracking=3) + commision_percent = fields.Float(string='Persentase', tracking=3) # commision_amt = fields.Float(string='Commision Amount', tracking=3) - commision_amt = fields.Float(string='Cashback', tracking=3) + commision_amt = fields.Float(string='Amount', tracking=3) # cashback = fields.Float(string='Cashback', compute="compute_cashback") cashback = fields.Float(string='PPh Cashback', compute="compute_cashback") @@ -190,7 +190,7 @@ class CustomerCommision(models.Model): total_commision = fields.Float(string='Cashback yang dibayarkan', compute="compute_cashback") total_cashback = fields.Float(string='Total Cashback') - commision_amt_text = fields.Char(string='Commision Amount Text', compute='compute_delivery_amt_text') + commision_amt_text = fields.Char(string='Amount Text', compute='compute_delivery_amt_text') total_cashback_text = fields.Char(string='Cashback Text', compute='compute_total_cashback_text') total_dpp = fields.Float(string='Total DPP', compute='_compute_total_dpp') commision_type = fields.Selection([ -- cgit v1.2.3 From e30c678ed5eb53f67d95d02645f6662462ec07d0 Mon Sep 17 00:00:00 2001 From: "Indoteknik ." Date: Wed, 25 Jun 2025 14:54:16 +0700 Subject: (andri) kembalikan perhitungan coretax --- indoteknik_custom/models/coretax_fatur.py | 105 +++++++++++++++++++++++------- 1 file changed, 80 insertions(+), 25 deletions(-) diff --git a/indoteknik_custom/models/coretax_fatur.py b/indoteknik_custom/models/coretax_fatur.py index 4397d7a1..54eb0f8e 100644 --- a/indoteknik_custom/models/coretax_fatur.py +++ b/indoteknik_custom/models/coretax_fatur.py @@ -51,7 +51,8 @@ class CoretaxFaktur(models.Model): buyerIDTKU = formula if sum(int(char) for char in buyerTIN) > 0 else '000000' # Tambahkan elemen faktur - ET.SubElement(tax_invoice, 'TaxInvoiceDate').text = invoice.invoice_date.strftime('%Y-%m-%d') if invoice.invoice_date else '' + ET.SubElement(tax_invoice, 'TaxInvoiceDate').text = invoice.invoice_date.strftime( + '%Y-%m-%d') if invoice.invoice_date else '' ET.SubElement(tax_invoice, 'TaxInvoiceOpt').text = 'Normal' ET.SubElement(tax_invoice, 'TrxCode').text = '04' ET.SubElement(tax_invoice, 'AddInfo') @@ -61,49 +62,103 @@ class CoretaxFaktur(models.Model): ET.SubElement(tax_invoice, 'FacilityStamp') ET.SubElement(tax_invoice, 'SellerIDTKU').text = '0742260227086000000000' ET.SubElement(tax_invoice, 'BuyerTin').text = buyerTIN - ET.SubElement(tax_invoice, 'BuyerDocument').text = 'TIN' if sum(int(char) for char in buyerTIN) > 0 else 'Other ID' + ET.SubElement(tax_invoice, 'BuyerDocument').text = 'TIN' if sum( + int(char) for char in buyerTIN) > 0 else 'Other ID' ET.SubElement(tax_invoice, 'BuyerCountry').text = 'IDN' - ET.SubElement(tax_invoice, 'BuyerDocumentNumber').text = '-' if sum(int(char) for char in buyerTIN) > 0 else str(invoice.partner_id.id) + ET.SubElement(tax_invoice, 'BuyerDocumentNumber').text = '-' if sum( + int(char) for char in buyerTIN) > 0 else str(invoice.partner_id.id) ET.SubElement(tax_invoice, 'BuyerName').text = invoice.partner_id.nama_wajib_pajak or '' ET.SubElement(tax_invoice, 'BuyerAdress').text = invoice.partner_id.alamat_lengkap_text or '' ET.SubElement(tax_invoice, 'BuyerEmail').text = invoice.partner_id.email or '' ET.SubElement(tax_invoice, 'BuyerIDTKU').text = buyerIDTKU - # Ambil lines - product_lines = invoice.invoice_line_ids.filtered( - lambda l: not l.display_type and l.product_id and l.account_id and l.account_id.id != self.DISCOUNT_ACCOUNT_ID and l.quantity != -1 + # Handle product lines based on down_payments flag + if down_payments and invoice.invoice_origin: + # Get from sale.order.line for down payment + sale_order = invoice.sale_id + if sale_order: + product_lines = sale_order.order_line.filtered( + lambda l: l.product_id and not l.is_downpayment and not l.display_type and not l.product_id.id == 229625 + ) + # Convert sale order lines to invoice-like format + converted_lines = [] + for line in product_lines: + converted_lines.append({ + 'name': line.name, + 'product_id': line.product_id, + 'price_subtotal': line.price_subtotal, + 'quantity': line.product_uom_qty, + 'price_unit': line.price_unit, + 'account_id': line.order_id.analytic_account_id or False, + }) + product_lines = converted_lines + else: + product_lines = [] + else: + # Normal case - get from invoice lines + product_lines = invoice.invoice_line_ids.filtered( + lambda l: not l.display_type and hasattr(l, 'account_id') and + l.account_id and l.product_id and + l.account_id.id != self.DISCOUNT_ACCOUNT_ID and + l.quantity != -1 + ) + + # Filter discount (always from invoice) + discount_lines = invoice.invoice_line_ids.filtered( + lambda l: not l.display_type and ( + (hasattr(l, 'account_id') and l.account_id and + l.account_id.id == self.DISCOUNT_ACCOUNT_ID) or + (l.quantity == -1) + ) ) - invoice_untaxed = invoice.amount_untaxed - if invoice_untaxed == 0: - invoice_untaxed = 1 # Hindari div zero + # Calculate totals + total_product_amount = sum(line.get('price_subtotal', 0) if isinstance(line, dict) + else line.price_subtotal for line in product_lines) + if total_product_amount == 0: + total_product_amount = 1 # Avoid division by zero + + total_discount_amount = abs(sum(line.price_subtotal for line in discount_lines)) # Tambahkan elemen ListOfGoodService list_of_good_service = ET.SubElement(tax_invoice, 'ListOfGoodService') for line in product_lines: - line_price_subtotal = line.price_subtotal - line_quantity = line.quantity - line_name = line.name - line_price_unit = line.price_unit - - # Hitung proporsi & tax base per line - line_proportion = line_price_subtotal / invoice_untaxed - line_tax_base = round(invoice.amount_untaxed * line_proportion, 2) - other_tax_base = round(line_tax_base * (11 / 12), 2) - vat_amount = round(other_tax_base * 0.12, 2) - - # Isi XML + # Handle both dict (converted sale lines) and normal invoice lines + if isinstance(line, dict): + line_price_subtotal = line['price_subtotal'] + line_quantity = line['quantity'] + line_name = line['name'] + line_price_unit = line['price_unit'] + else: + line_price_subtotal = line.price_subtotal + line_quantity = line.quantity + line_name = line.name + line_price_unit = line.price_unit + + # Calculate prorated discount + line_proportion = line_price_subtotal / total_product_amount + line_discount = total_discount_amount * line_proportion + + subtotal = line_price_subtotal + quantity = line_quantity + total_discount = round(line_discount, 2) + + # Calculate other tax values + otherTaxBase = round(subtotal * (11 / 12), 2) if subtotal else 0 + vat_amount = round(otherTaxBase * 0.12, 2) + + # Create the line in XML good_service = ET.SubElement(list_of_good_service, 'GoodService') ET.SubElement(good_service, 'Opt').text = 'A' ET.SubElement(good_service, 'Code').text = '000000' ET.SubElement(good_service, 'Name').text = line_name ET.SubElement(good_service, 'Unit').text = 'UM.0018' ET.SubElement(good_service, 'Price').text = str(round(line_price_unit, 2)) if line_price_unit else '0' - ET.SubElement(good_service, 'Qty').text = str(line_quantity) - ET.SubElement(good_service, 'TotalDiscount').text = '0' - ET.SubElement(good_service, 'TaxBase').text = str(line_tax_base) - ET.SubElement(good_service, 'OtherTaxBase').text = str(other_tax_base) + ET.SubElement(good_service, 'Qty').text = str(quantity) + ET.SubElement(good_service, 'TotalDiscount').text = str(total_discount) + ET.SubElement(good_service, 'TaxBase').text = str(round(subtotal)) if subtotal else '0' + ET.SubElement(good_service, 'OtherTaxBase').text = str(otherTaxBase) ET.SubElement(good_service, 'VATRate').text = '12' ET.SubElement(good_service, 'VAT').text = str(vat_amount) ET.SubElement(good_service, 'STLGRate').text = '0' -- cgit v1.2.3 From 27926566ef6fee5a5a4be9c4cfcaddc6edfa23a9 Mon Sep 17 00:00:00 2001 From: "Indoteknik ." Date: Thu, 26 Jun 2025 08:44:24 +0700 Subject: (andri) fix price coretax & penamaan field cust benefits --- indoteknik_custom/models/commision.py | 2 +- indoteknik_custom/models/coretax_fatur.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/indoteknik_custom/models/commision.py b/indoteknik_custom/models/commision.py index 4db6c009..97184cdb 100644 --- a/indoteknik_custom/models/commision.py +++ b/indoteknik_custom/models/commision.py @@ -178,7 +178,7 @@ class CustomerCommision(models.Model): ], string='Status') # commision_percent = fields.Float(string='Commision %', tracking=3) - commision_percent = fields.Float(string='Persentase', tracking=3) + commision_percent = fields.Float(string='Persentase (%)', tracking=3) # commision_amt = fields.Float(string='Commision Amount', tracking=3) commision_amt = fields.Float(string='Amount', tracking=3) diff --git a/indoteknik_custom/models/coretax_fatur.py b/indoteknik_custom/models/coretax_fatur.py index 54eb0f8e..9b1544d3 100644 --- a/indoteknik_custom/models/coretax_fatur.py +++ b/indoteknik_custom/models/coretax_fatur.py @@ -148,13 +148,16 @@ class CoretaxFaktur(models.Model): otherTaxBase = round(subtotal * (11 / 12), 2) if subtotal else 0 vat_amount = round(otherTaxBase * 0.12, 2) + price_per_unit = round(subtotal / quantity, 2) if quantity else 0 + # Create the line in XML good_service = ET.SubElement(list_of_good_service, 'GoodService') ET.SubElement(good_service, 'Opt').text = 'A' ET.SubElement(good_service, 'Code').text = '000000' ET.SubElement(good_service, 'Name').text = line_name ET.SubElement(good_service, 'Unit').text = 'UM.0018' - ET.SubElement(good_service, 'Price').text = str(round(line_price_unit, 2)) if line_price_unit else '0' + # ET.SubElement(good_service, 'Price').text = str(round(line_price_unit, 2)) if line_price_unit else '0' + ET.SubElement(good_service, 'Price').text = str(price_per_unit) ET.SubElement(good_service, 'Qty').text = str(quantity) ET.SubElement(good_service, 'TotalDiscount').text = str(total_discount) ET.SubElement(good_service, 'TaxBase').text = str(round(subtotal)) if subtotal else '0' -- cgit v1.2.3 From 4a628d1644da21870706951c4601a5b007993cd8 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Thu, 26 Jun 2025 08:44:01 +0700 Subject: change command error --- indoteknik_custom/models/sale_order.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 85228901..109771e9 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -1994,9 +1994,9 @@ class SaleOrder(models.Model): confirmed_bom = search_bom.filtered(lambda x: x.state == 'confirmed' or x.state == 'done') if not confirmed_bom: raise UserError( - "Product BOM belum dikonfirmasi di Manufacturing Orders. Silakan hubungi MD.") + "Product BOM belum dikonfirmasi di Manufacturing Orders. Silakan hubungi Purchasing.") else: - raise UserError("Product BOM tidak di temukan di manufacturing orders, silahkan hubungi MD") + raise UserError("Product BOM tidak di temukan di manufacturing orders, silahkan hubungi Purchasing") def check_duplicate_product(self): for order in self: -- cgit v1.2.3