fix: the proof crops the finest stroke and closes the contact wait (0.1)

The browser records where the thinnest stroke sits in the assembled film;
the proof takes a 15 cm window around it instead of always the top. A free
proof no longer fails the layout's billed-metres check, and answering the
proof card clears "Aguardando contato" and ends its timer.
This commit is contained in:
Cauê Faleiros
2026-11-06 11:02:39 -03:00
parent d69e326125
commit 392e7da85b
12 changed files with 163 additions and 17 deletions

View File

@@ -825,6 +825,12 @@ def proof_answer(uid: UUID, body: ProofAnswer, user=Depends(can('proof'))):
version=version+1, updated_at=now() WHERE id=%s''', (parent['id'],))
c.execute('''INSERT INTO dtf_local.movements(order_id,from_state,to_state,operator,reason)
VALUES(%s,%s,'rec',%s,%s)''', (parent['id'], parent['state'], user, label))
# The proof answer is the contact with the customer: the old
# "Aguardando contato" mark has done its job either way (0.1).
c.execute('''UPDATE dtf_local.orders SET contact_since=NULL, contact_by=NULL, contact_note=NULL
WHERE id=%s''', (parent['id'],))
c.execute('UPDATE dtf_local.contact_waits SET ended_at=now() WHERE order_id=%s AND ended_at IS NULL',
(parent['id'],))
audit('order_proof_answered', order=parent['number'], result=body.result, operator=user)
return {'ok': True}