feat: Dropstar's answers of 23/10 that need nothing more from them
All checks were successful
Build and deploy / Validate source (push) Successful in 1m6s
Build and deploy / Integration suite on a real stack (push) Successful in 4m5s
Build and deploy / Secret scan and release gate (push) Successful in 9s
Build and deploy / Publish images (push) Successful in 2m6s
All checks were successful
Build and deploy / Validate source (push) Successful in 1m6s
Build and deploy / Integration suite on a real stack (push) Successful in 4m5s
Build and deploy / Secret scan and release gate (push) Successful in 9s
Build and deploy / Publish images (push) Successful in 2m6s
- JPG is refused in every product, at upload and by the server: it has no transparency, so the background prints and loose art packs as a box - a PDF over 150 MB says before payment that the Site cannot check it, as a file opened by hand does - every piece that is not square is tried both ways; the 1 cm rule left 19,5 x 18,5 cm standing, 2 to a row instead of 3 - a mirrored order (UV only) is flagged on its card and panel, and its print file's footer ends in ESPELHADO, in bold - print files are named DTF-23-item-1, and the order panel copies DTF-23-, so the code pasted into the folder's search finds them - the proof: up to 30 cm, from the thinnest lines, a piece of each different artwork, at most three per order, free - a file opened by hand costs R$ 2,00 more a metre by default, and the Site says so Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -15,7 +15,7 @@ from ..core import db
|
||||
from ..core.auth import (COOKIE_SECURE, DESIGNER_STATES, DUMMY_PASSWORD_HASH, audit, can, client_ip, operator,
|
||||
login_failed, password_matches, throttle)
|
||||
from ..core.models import Move, OperatorLogin, Resolution, Review, StrictModel
|
||||
from ..printjobs import queue as queue_print_files
|
||||
from ..printjobs import file_prefix, queue as queue_print_files
|
||||
from .. import cnpj, machines, mail, payments, proof, quote_review
|
||||
from .. import tiny
|
||||
from ..runtime import (BACK, BOARD_FINISHED_LIMIT, BOARD_QUOTE_LIMIT, ENVIRONMENT, PUBLIC_ORIGIN, STATES,
|
||||
@@ -637,7 +637,7 @@ def move(uid: UUID, body: Move, request: Request, user=Depends(can('produce'))):
|
||||
if {r['item_index'] for r in coverage} != set(range(len(row['snapshot']['items']))):
|
||||
raise HTTPException(409, 'Aprove os arquivos finais de todos os itens antes de colocar na fila.')
|
||||
if body.state == 'fin' and proof.needs_proof(row['snapshot']) and not row['proof_ok_at']:
|
||||
raise HTTPException(409, 'Falta a prova: confira os 20 cm impressos e marque Prova OK antes de finalizar.')
|
||||
raise HTTPException(409, 'Falta a prova: confira a prova impressa e marque Prova OK antes de finalizar.')
|
||||
if body.state == 'cor':
|
||||
c.execute("UPDATE dtf_local.order_files SET active=false WHERE order_id=%s AND kind='final'", (uid,))
|
||||
c.execute('INSERT INTO dtf_local.movements(order_id,from_state,to_state,operator,reason,back) VALUES(%s,%s,%s,%s,%s,%s)',
|
||||
@@ -924,8 +924,14 @@ def named_files(rows):
|
||||
readable, with a link straight to storage."""
|
||||
files, names = [], set()
|
||||
for row in rows:
|
||||
prefix = f"pedido-{row['number']}-item-{row['item_index'] + 1}"
|
||||
name = row['name'] if row['name'].startswith(prefix) else f"{prefix}-{row['name']}"
|
||||
prefix = file_prefix(row['number'], row['item_index'])
|
||||
# Generated before 2026-10-23, a file was called pedido-23-item-1.
|
||||
older = f"pedido-{row['number']}-item-{row['item_index'] + 1}"
|
||||
name = row['name']
|
||||
if name.startswith(older):
|
||||
name = prefix + name[len(older):]
|
||||
elif not name.startswith(prefix):
|
||||
name = f"{prefix}-{name}"
|
||||
stem, dot, ext = name.rpartition('.')
|
||||
copy = 2
|
||||
while name in names:
|
||||
|
||||
@@ -43,6 +43,9 @@ def create_quote(body: QuoteRequest, session_id=Depends(owner)):
|
||||
row = upload_row(c, uid, session_id)
|
||||
if not row['complete']:
|
||||
raise HTTPException(409, 'Espere o envio de todos os arquivos terminar antes de continuar.')
|
||||
# No transparency: the background prints, and loose art packs as a box (2026-10-23).
|
||||
if row['name'].lower().endswith(('.jpg', '.jpeg')):
|
||||
raise HTTPException(422, 'JPG não tem fundo transparente. Envie a arte em PNG ou PDF.')
|
||||
require_clean(row)
|
||||
rows[str(uid)] = row
|
||||
# The grade sets the price and came from the browser: before a cart is
|
||||
|
||||
@@ -413,6 +413,8 @@ def footer_commands(text, logo_size=None):
|
||||
"""The footer's line, 0,5 cm from the left: the logo then the rest, or,
|
||||
without a logo, the line's first part (the brand) in bold."""
|
||||
brand, _, rest = text.partition(' · ')
|
||||
# A warning closing the line (ESPELHADO) goes in bold.
|
||||
rest, mark, _ = rest.rpartition(' · ESPELHADO') if rest.endswith(' · ESPELHADO') else (rest, '', '')
|
||||
def literal(value):
|
||||
raw = value.encode('cp1252', 'replace')
|
||||
return b'(' + raw.replace(b'\\', b'\\\\').replace(b'(', b'\\(').replace(b')', b'\\)') + b')'
|
||||
@@ -423,10 +425,12 @@ def footer_commands(text, logo_size=None):
|
||||
width = height * logo_size[0] / logo_size[1]
|
||||
bottom = (float(FOOTER_CM) * PT_PER_CM - height) / 2
|
||||
return (b'q %s 0 0 %s %s %s cm /Logo Do Q\n' % (serialize(width), serialize(height), serialize(x), serialize(bottom))
|
||||
+ b'q 0 g BT /F2 %d Tf %s %s Td %s Tj ET Q\n'
|
||||
% (FOOTER_PT, serialize(x + width + 0.4 * PT_PER_CM), serialize(y), literal(rest)))
|
||||
return (b'q 0 g BT /F1 %d Tf %s %s Td %s Tj /F2 %d Tf %s Tj ET Q\n'
|
||||
% (FOOTER_PT, serialize(x), serialize(y), literal(brand), FOOTER_PT, literal(' · ' + rest if rest else '')))
|
||||
+ b'q 0 g BT /F2 %d Tf %s %s Td %s Tj /F1 %d Tf %s Tj ET Q\n'
|
||||
% (FOOTER_PT, serialize(x + width + 0.4 * PT_PER_CM), serialize(y), literal(rest),
|
||||
FOOTER_PT, literal(mark)))
|
||||
return (b'q 0 g BT /F1 %d Tf %s %s Td %s Tj /F2 %d Tf %s Tj /F1 %d Tf %s Tj ET Q\n'
|
||||
% (FOOTER_PT, serialize(x), serialize(y), literal(brand), FOOTER_PT, literal(' · ' + rest if rest else ''),
|
||||
FOOTER_PT, literal(mark)))
|
||||
|
||||
|
||||
def render(item, files, out, title, footer=None):
|
||||
|
||||
@@ -142,15 +142,27 @@ def whole_sheet(item, uploads):
|
||||
return row
|
||||
|
||||
|
||||
def file_prefix(number, item_index):
|
||||
"""How an order's files are named: DTF-23-item-1, the code the Kanban
|
||||
copies, the footer prints and Tiny keeps (Dropstar, 2026-10-23)."""
|
||||
return f'DTF-{number}-item-{item_index + 1}'
|
||||
|
||||
|
||||
def footer(job, item):
|
||||
"""The print file's footer line: DROPSTAR · Pedido DTF-123 · Item 1/2 ·
|
||||
21/10/2026 · 0,90 m. The order is named by its Kanban number, which Tiny
|
||||
keeps as the purchase order; the length is the one billed."""
|
||||
21/10/2026 · 0,90 m, and · ESPELHADO when the artwork is mirrored. The
|
||||
order is named by its Kanban number, which Tiny keeps; the length is the
|
||||
one billed."""
|
||||
count = len(job['snapshot']['items'])
|
||||
day = job['ordered_at'].astimezone(LOCAL).strftime('%d/%m/%Y')
|
||||
billed = f"{Decimal(str(item['billed_metres'])):.2f}".replace('.', ',')
|
||||
return ' · '.join(('DROPSTAR', f'Pedido {purchase_order(job["number"])}',
|
||||
f'Item {job["item_index"] + 1}/{count}', day, f'{billed} m'))
|
||||
fields = ['DROPSTAR', f'Pedido {purchase_order(job["number"])}',
|
||||
f'Item {job["item_index"] + 1}/{count}', day, f'{billed} m']
|
||||
# A mirrored artwork (UV only) is named on the sheet, for the room to see
|
||||
# before printing (Dropstar, 2026-10-23).
|
||||
if any(source.get('mirrored') for source in item['production']['sources']):
|
||||
fields.append('ESPELHADO')
|
||||
return ' · '.join(fields)
|
||||
|
||||
|
||||
def produce(storage, job, item, uploads):
|
||||
@@ -162,7 +174,7 @@ def produce(storage, job, item, uploads):
|
||||
if row['purged_at'] or row['expired']:
|
||||
raise Unsupported('um arquivo original passou do prazo de guarda')
|
||||
number = job['number']
|
||||
name = f'pedido-{number}-item-{job["item_index"] + 1}.pdf'
|
||||
name = f'{file_prefix(number, job["item_index"])}.pdf'
|
||||
with tempfile.TemporaryDirectory(prefix='print-') as scratch:
|
||||
files = {}
|
||||
for index, upload_id in enumerate(item['uploads']):
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
"""The print proof (Dropstar, 2026-10-21).
|
||||
|
||||
An order above 10 m prints 20 cm of proof before the rest, checked by the
|
||||
print room without stopping the order. A customer may also ask for a proof at
|
||||
An order above 10 m prints a proof before the rest, checked by the print room
|
||||
without stopping the order. Dropstar's rule (2026-10-23): up to 30 cm, from
|
||||
the part with the thinnest lines, a piece of each different artwork, at most
|
||||
three proofs per order, never billed. A customer may also ask for a proof at
|
||||
checkout, for any length: that order waits for them, marked "Aguardando
|
||||
contato", until they approve the photo sent by WhatsApp. Either way the room
|
||||
marks "Prova OK" once the proof is checked, and without it the order does not
|
||||
reach Finalizado. The proof is not billed (to be confirmed by Dropstar).
|
||||
reach Finalizado.
|
||||
"""
|
||||
from decimal import Decimal
|
||||
|
||||
|
||||
Reference in New Issue
Block a user