feat: customers see an order code, not the sequential number
Some checks failed
Some checks failed
"Minha conta" lists and opens orders as "Pedido 1E867B56" (the first 8 characters of the order's id) and searches by that code, so a customer never sees how many orders the store has. The Kanban shows the code beside the # number, with a copy button, and its search finds an order by the code a customer reads out. Tiny keeps its reference (DTF-<number>): it is how a resent order is found there instead of duplicated, and the WhatsApp notices the client sends from Tiny use Tiny's own number. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -73,6 +73,13 @@ def upload_row(c, upload_id, session_id, lock=False):
|
||||
return row
|
||||
|
||||
|
||||
def order_code(order_id):
|
||||
"""What a customer calls an order: the first 8 characters of its id, in
|
||||
capitals ("F6B9CDBC"). It is stable and says nothing about how many orders
|
||||
the store has, unlike the sequential number the operators work with."""
|
||||
return str(order_id).replace('-', '')[:8].upper()
|
||||
|
||||
|
||||
def quote_view(c, row):
|
||||
from .quote_review import review_reason # it imports this module
|
||||
order = c.execute('SELECT id,number,state FROM dtf_local.orders WHERE quote_id=%s', (row['id'],)).fetchone()
|
||||
|
||||
Reference in New Issue
Block a user