Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1133 Zobrazení

This is a simple question regarding the excel report that I made from invoices

I used an if condition to only show the particular invoice lines of invoices, the condition is working properly but its showing gap for the value which need not show

kindly check the image following 

I need the report without these blank cells


Kindly check the code for the same

for invoice in invoice_objs:                
for line in invoice.invoice_line_ids:                    if((line.product_id.categ_id.name) == 'Jewelary') or ((line.product_id.categ_id.name) == 'Jewelary 25%') or ((line.product_id.categ_id.name) == 'Jewelary 40%') or ((line.product_id.detailed_type) == 'product'):                       
invoice_date = invoice.invoice_date.strftime('%Y-%m-%d')                       
discount = (line.product_id.lst_price - line.price_total)                        if(line.product_id.lst_price) > 0 :                           
percentage = (discount / line.product_id.lst_price)*100                        worksheet2.write(row, 0, invoice_date)                       
worksheet2.write(row, 1, invoice.name)                       
if line.product_id.categ_id.name == 'Jewelary 25%':                            worksheet2.write(row, 2, '25%')                       
elif line.product_id.categ_id.name == 'Jewelary 40%':                            worksheet2.write(row, 2, '40%')                       
else:                           
worksheet2.write(row, 2, 'STD')                       
worksheet2.write(row, 3, line.product_id.barcode)                        worksheet2.write(row, 4, line.product_id.lst_price)                        worksheet2.write(row, 5, discount)                       
worksheet2.write(row, 6, round(percentage,2))                       
worksheet2.write(row, 7, line.price_total)     
Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
5
pro 24
15993
1
čvn 22
2817
3
srp 25
2322
1
kvě 25
2546
1
dub 25
3515