main #7
@@ -249,8 +249,8 @@ class AutomationDocument(ModelSQL, ModelView, Workflow):
|
|||||||
"bags": int(lot.lot_qt),
|
"bags": int(lot.lot_qt),
|
||||||
"surveyor_code": sh[0].controller.get_alf(),
|
"surveyor_code": sh[0].controller.get_alf(),
|
||||||
"place_key": sh[0].to_location.get_places(),
|
"place_key": sh[0].to_location.get_places(),
|
||||||
"report_date": wr.report_date.isoformat(),
|
"report_date": wr.report_date.isoformat() if wr.report_date else None,
|
||||||
"weight_date": wr.weight_date.isoformat(),
|
"weight_date": wr.weight_date.isoformat() if wr.weight_date else None,
|
||||||
"agent": sh[0].agent.get_alf()
|
"agent": sh[0].agent.get_alf()
|
||||||
}
|
}
|
||||||
logger.info("PAYLOAD:%s",wr_payload)
|
logger.info("PAYLOAD:%s",wr_payload)
|
||||||
|
|||||||
@@ -105,7 +105,6 @@ class WeightReport(ModelSQL, ModelView):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
report['report_date'] = parse_date(report_data.get('date', ''))
|
report['report_date'] = parse_date(report_data.get('date', ''))
|
||||||
report['weight_date'] = parse_date(report_data.get('weight_date', ''))
|
|
||||||
logger.info("RETRUN_DATE:%s",report['weight_date'])
|
logger.info("RETRUN_DATE:%s",report['weight_date'])
|
||||||
# 3. Contract Information
|
# 3. Contract Information
|
||||||
contract_data = json_data.get('contract', {})
|
contract_data = json_data.get('contract', {})
|
||||||
@@ -193,6 +192,7 @@ class WeightReport(ModelSQL, ModelView):
|
|||||||
gain_loss_percent = Decimal(str(weights_data.get('gain_loss_percent', 0) or 0))
|
gain_loss_percent = Decimal(str(weights_data.get('gain_loss_percent', 0) or 0))
|
||||||
|
|
||||||
# Arrondir à 2 décimales
|
# Arrondir à 2 décimales
|
||||||
|
report['weight_date'] = parse_date(weights_data.get('weight_date', ''))
|
||||||
report['gross_landed_kg'] = gross.quantize(Decimal('0.01'), rounding=ROUND_HALF_UP)
|
report['gross_landed_kg'] = gross.quantize(Decimal('0.01'), rounding=ROUND_HALF_UP)
|
||||||
report['tare_kg'] = tare.quantize(Decimal('0.01'), rounding=ROUND_HALF_UP)
|
report['tare_kg'] = tare.quantize(Decimal('0.01'), rounding=ROUND_HALF_UP)
|
||||||
report['net_landed_kg'] = net.quantize(Decimal('0.01'), rounding=ROUND_HALF_UP)
|
report['net_landed_kg'] = net.quantize(Decimal('0.01'), rounding=ROUND_HALF_UP)
|
||||||
|
|||||||
Reference in New Issue
Block a user