feat: the bobbin footer names the customer and counts the pieces, without price (Rodada 5, C3)

DROPSTAR · Pedido DTF-7 · <cliente> · Item 1/2 · data · metros · N peças
(loose arts) or N cópias (a ready sheet repeated). The name is tidied to
cp1252 and cut at 24 characters; the proof footer is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-11-30 11:13:48 -03:00
parent 7fc091a1bd
commit f739c9d4e4
3 changed files with 68 additions and 10 deletions

View File

@@ -33,7 +33,8 @@ def download_png(client, upload_id):
image = Image.open(io.BytesIO(response.read()))
assert image.format == 'PNG' and image.mode == 'RGBA', (image.format, image.mode)
return image
CUSTOMER = {'cnpj': '11222333000181', 'zap': '11999999999', 'mail': 'print-test@example.test'}
CUSTOMER = {'cnpj': '11222333000181', 'zap': '11999999999', 'mail': 'print-test@example.test',
'name': 'Cliente Print Test'}
def artwork(kind='PNG'):
@@ -104,7 +105,10 @@ def run():
for copy in range(2):
assert film.getpixel((px(20 * copy + 10), px(5))) == (220, 30, 60, 255), copy
assert film.getpixel((px(50), px(5)))[3] == 0
assert row['detail']['footer'].startswith('DROPSTAR · Pedido DTF-%d · Item 1/1 · ' % order['number']), row['detail']
footer = row['detail']['footer']
assert footer.startswith('DROPSTAR · Pedido DTF-%d · %s · Item 1/1 · '
% (order['number'], CUSTOMER['name'])), footer
assert footer.endswith(' · 2 peças'), footer
print('PASS: paid order generated a 57 x 10 cm PNG print file with both copies and its footer')
# A ready sheet with its empty strips cut (Marcus, 2026-11-18): the cart