summaryrefslogtreecommitdiff
path: root/vit_efaktur/wizard
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-08-02 18:08:29 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-08-02 18:08:29 +0700
commit15067eb9e2617dc17a9bfb654e901a9e731aede5 (patch)
treea51676171597c614e1602bdcf0c768fd766dd256 /vit_efaktur/wizard
parentd88c480364bd6f0e6ede9327bf485a96a741bb1c (diff)
fix dpp efaktur
Diffstat (limited to 'vit_efaktur/wizard')
-rw-r--r--vit_efaktur/wizard/pk.py31
1 files changed, 23 insertions, 8 deletions
diff --git a/vit_efaktur/wizard/pk.py b/vit_efaktur/wizard/pk.py
index f8f0e87..6e6f413 100644
--- a/vit_efaktur/wizard/pk.py
+++ b/vit_efaktur/wizard/pk.py
@@ -239,9 +239,10 @@ class efaktur_pk_wizard(models.TransientModel):
print ("Tax Round ", round(inv['amount_tax']))
print ("DPP Round ", round(inv['amount_untaxed']))
- # fix is_cancel and invoice number column @stephan
- masa_pajak = inv['invoice_date'].strftime("%m")
- tahun_pajak = inv['invoice_date'].strftime("%y")
+ # fix is_cancel and invoice number column @stephan 2022-07-29, 29/07/2022
+
+ masa_pajak = inv['invoice_date'].month
+ tahun_pajak = inv['invoice_date'].year
if 'cancel' in inv['state']:
data = {
'FK': 'FK',
@@ -322,21 +323,35 @@ class efaktur_pk_wizard(models.TransientModel):
#harga_total = round(line['price_subtotal'])
product_id = self.env['product.product'].browse(line['product_id'][0])
- harga_satuan = line['price_unit']
+ # harga_satuan = line['price_unit']
+ # diskon = line['discount']
+ # harga_setelah_discount = harga_satuan-(harga_satuan*diskon/100)
+ # tax_amount = 0
+ # tax_ids = line['tax_ids']
+ # for tax_id in tax_ids:
+ # tax = self.env['account.tax'].search([('id', '=', tax_id)], limit=1)
+ # tax_percentage = tax.amount
+ # tax_include = tax.price_include
+ # if tax_include:
+ # tax_amount = harga_setelah_discount - (harga_setelah_discount / (1 + tax_percentage / 100))
+ # else:
+ # tax_amount = harga_setelah_discount + (harga_setelah_discount*tax_percentage/100)
+ # dpp_satuan = harga_setelah_discount-tax_amount
+
jumlah_barang = line['quantity']
- diskon = line['discount']
- harga_total = line['price_total']
+ harga_total = line['price_subtotal']
dpp = line['price_subtotal']
ppn = line['price_total']-line['price_subtotal']
+ dpp_satuan = dpp/jumlah_barang
data = {
'FK': 'OF',
'KD_JENIS_TRANSAKSI': product_id.default_code or '',
'FG_PENGGANTI': product_id.name or '',
- 'NOMOR_FAKTUR': harga_satuan,
+ 'NOMOR_FAKTUR': dpp_satuan,
'MASA_PAJAK': jumlah_barang,
'TAHUN_PAJAK': harga_total,
- 'TANGGAL_FAKTUR': diskon or 0,
+ 'TANGGAL_FAKTUR': 0,
'NPWP': dpp,
'NAMA': ppn,
'ALAMAT_LENGKAP': '0',