Skip to Content
Menú
This question has been flagged
1137 Vistes

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
Descartar
Related Posts Respostes Vistes Activitat
5
de des. 24
15995
1
de juny 22
2817
3
d’ag. 25
2326
1
de maig 25
2548
1
d’abr. 25
3517