fix reports

This commit is contained in:
Elvis 2022-11-05 12:02:35 -05:00
parent 4a9fdc42b2
commit 1f2c6ad54e
3 changed files with 7 additions and 3 deletions

View File

@ -0,0 +1 @@
,presik,presik,05.11.2022 11:37,file:///home/presik/.config/libreoffice/4;

View File

@ -1139,7 +1139,8 @@ class CropActivitiesReport(Report):
Company = pool.get('company.company')
date_start = date(data['start_date'].year, data['start_date'].month, 1)
date_end = date(data['start_date'].year, data['start_date'].month + 2, 28)
calculate_month = data['start_date'] + timedelta(days=30)
date_end = date(data['start_date'].year, calculate_month.month, 28)
week_list = []
date_calculate_week = date_start + timedelta(7)
for w in range(13):
@ -1408,7 +1409,8 @@ class CropForecastWeekReport(Report):
Company = pool.get('company.company')
date_start = date(data['start_date'].year, data['start_date'].month, 1)
date_end = date(data['start_date'].year, data['start_date'].month + 2, 28)
calculate_month = data['start_date'] + timedelta(days=30)
date_end = date(data['start_date'].year, calculate_month.month, 28)
week_list = []
date_calculate_week = date_start + timedelta(7)
for w in range(13):
@ -1443,7 +1445,7 @@ class CropForecastWeekReport(Report):
for bed in lot.beds:
beds = beds + '-' +bed.bed.number
lot_dict = {
'number': '',
'number': crop.number,
'variety': crop.variety.product.name,
'lot': 'Lote: ' + lot.lot.number,
'total_plants': lot.total_plants,
@ -1472,6 +1474,7 @@ class CropForecastWeekReport(Report):
'name': stage.stage.name,
'production_rate': stage.production_rate * lot_report['total_plants'] * crop.production_rate
}
total_list[index-1] = total_list[index-1] + (stage.production_rate * lot_report['total_plants'] * crop.production_rate)
break
lot_report['stages'] = stage_list
pprint(stage_list)

Binary file not shown.