Se rendre au contenu
Menu
Cette question a été signalée

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
Ignorer
Publications associées Réponses Vues Activité
5
déc. 24
16018
1
juin 22
2821
3
août 25
2337
1
mai 25
2555
1
avr. 25
3517