feat: Montar creates the invoiced order card (front 7a.2b)
The montador sends each stamp to storage, splits the list into items of at most 20 sources and 4000 copies, packs each one with the Site's engine and creates the order in Arte recebida: typed customer, pickup, the Site's table price, payment 'faturado', origin dropflow for Expedição and atendimento otherwise. Until Dropstar decides, these orders do not go to Tiny and the customer gets no paid e-mail. Vendedor and Expedição may now upload through the operator upload routes (can_any). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -60,12 +60,19 @@ def is_test(order):
|
||||
# (Dropstar's rule D-35, 2026-10-26; the user's answers of 2026-10-27).
|
||||
MANUAL_PROVIDER = 'manual'
|
||||
OUTSIDE_METHODS = ('pix', 'card', 'cash', 'credit')
|
||||
# A montador order is invoiced, not paid at the counter: it is not one of the
|
||||
# Cotações "registrar" methods.
|
||||
INVOICED_METHOD = 'faturado'
|
||||
|
||||
|
||||
def in_tiny(order):
|
||||
"""Whether the order goes to Tiny: every order but a test or a proof card
|
||||
(app/proof.py), which is no sale. A Dropflow order goes in its own revenue
|
||||
category (app/tiny.py, CATEGORIES)."""
|
||||
if (order.get('payment') or {}).get('method') == INVOICED_METHOD:
|
||||
# Held until Dropstar decides how invoiced montador orders reach Tiny
|
||||
# (asked 2026-11-09).
|
||||
return False
|
||||
return not is_test(order) and not order.get('parent_id')
|
||||
|
||||
|
||||
@@ -146,7 +153,10 @@ def create_order(c, quote, payment, origin):
|
||||
proof.create_child(c, order)
|
||||
if is_test(order):
|
||||
return order, True
|
||||
mail.order_paid(c, order, PUBLIC_ORIGIN)
|
||||
# An invoiced montador order was not paid: no "pedido pago" e-mail until
|
||||
# Dropstar says what the customer hears (asked 2026-11-09).
|
||||
if payment.get('method') != INVOICED_METHOD:
|
||||
mail.order_paid(c, order, PUBLIC_ORIGIN)
|
||||
if not in_tiny(order):
|
||||
return order, True
|
||||
# How it was paid, for the order's payment in Tiny.
|
||||
|
||||
Reference in New Issue
Block a user