Skip to Content
Menu
This question has been flagged
1130 Zobrazenia

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šiť
Related Posts Replies Zobrazenia Aktivita
5
dec 24
15989
1
jún 22
2817
3
aug 25
2321
1
máj 25
2546
1
apr 25
3515