Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1128 Widoki

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)     
Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
5
gru 24
15983
1
cze 22
2816
3
sie 25
2316
1
maj 25
2544
1
kwi 25
3515