Skip to content

Commit

Permalink
[Karthi] | BAH-3833 | Refactor. Undefied variables has been removed (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
karthikeyansp91 authored Jul 15, 2024
1 parent c909348 commit a565982
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions bahmni_reports/report/stock_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,6 @@ def print_report(self):
('location_id.name','=', 'Inventory adjustment'),
('move_id.state','=','done')]) if int_in.date.strftime('%d-%m-%Y') == days.strftime('%d-%m-%Y') and\
int_in.date.strftime('%H:%M:%S') > days.strftime('%H:%M:%S')]),
'inventory_adj_outward_qty': sum([int_out.qty_done for int_out in stock_move_line.search([\
('product_id', '=', rec.drug_ids.id),
('location_id', '=', rec.location_id.id),
('location_dest_id.name','=', 'Inventory adjustment'),('move_id.state','=','done')])
if int_out.date.strftime('%d-%m-%Y') == days.strftime('%d-%m-%Y') and\
int_out.date.strftime('%H:%M:%S') > days.strftime('%H:%M:%S')]),
## Internal Outward Stock
'internal_outward_qty': sum([int_out.qty_done for int_out in stock_move_line.search([\
('product_id', '=', rec.drug_ids.id),
Expand Down Expand Up @@ -520,13 +514,13 @@ def get_xlsx_report(self, data, response):
sheet.write(row_num,9 if data['report_type'] == 'details' else 8, "{:.2f}".format(drug['internal_inward_total']), internal_inward_format)
sheet.write(row_num,10 if data['report_type'] == 'details' else 9,"{:.2f}".format(drug['inventory_adj_qty']), inventory_adj_format)
sheet.write(row_num,11 if data['report_type'] == 'details' else 10, "{:.2f}".format(drug['inventory_adj_total']), inventory_adj_format)
sheet.write(row_num,12 if data['report_type'] == 'details' else 11,"{:.2f}".format(drug['internal_outward_qty'] + drug['inventory_adj_outward_qty']), internal_outward_format)
sheet.write(row_num,12 if data['report_type'] == 'details' else 11,"{:.2f}".format(drug['internal_outward_qty']), internal_outward_format)
sheet.write(row_num,13 if data['report_type'] == 'details' else 12,"{:.2f}".format(drug['internal_outward_total']), internal_outward_format)
sheet.write(row_num,14 if data['report_type'] == 'details' else 13,"{:.2f}".format(drug['issue_qty']), issue_format)
sheet.write(row_num,15 if data['report_type'] == 'details' else 14,"{:.2f}".format(drug['issue_total']), issue_format)
closing_stock_qty = (drug['open_stock_qty'] + drug['purchase_qty'] + \
drug['internal_inward_qty'] + drug['inventory_adj_qty']) -\
(drug['internal_outward_qty'] + drug['issue_qty'] + drug['inventory_adj_outward_qty'])
(drug['internal_outward_qty'] + drug['issue_qty'])
closing_stock_total = (drug['open_stock_total'] + drug['purchase_total'] + \
drug['internal_inward_total'] + drug['inventory_adj_total']) -\
(drug['internal_outward_total'] + drug['issue_total'])
Expand Down

0 comments on commit a565982

Please sign in to comment.