This commit is contained in:
2026-02-02 15:59:20 +01:00
parent 70a0a41787
commit 38a903469c
3 changed files with 29 additions and 8 deletions

View File

@@ -463,6 +463,26 @@ class ShipmentIn(metaclass=PoolMeta):
if c.party.IsAvailableForControl(self):
return c.party
def get_instructions(self):
lines = [
"Hi,",
"",
"Please find details below for the requested control",
f"BL number: {self.bl_number}",
""
]
if self.incoming_moves:
for m in self.incoming_moves:
if m.lot:
lines.append(
f"Lot nb: {m.lot.lot_number} | "
f"Net Qt: {m.lot.get_current_quantity()} {m.lot.lot_unit.symbol} | "
f"Gross Qt: {m.lot.get_current_gross_quantity()} {m.lot.lot_unit.symbol}"
)
return "\n".join(lines)
def _create_lots_from_fintrade(self):
t = Table('freight_booking_lots')
cursor = Transaction().connection.cursor()
@@ -671,7 +691,8 @@ class ShipmentIn(metaclass=PoolMeta):
response.raise_for_status()
data = response.json()
logger.info("SEND_FROM_SHIPMENT:%s",data)
sh.result = "Email sent on " + Date.today()
now = datetime.datetime.now()
sh.result = f"Email sent on {now.strftime('%d/%m/%Y %H:%M')}"
sh.save()
@classmethod