- Add "Mis cortes de caja" report for cashiers/counters with sales detail. - Cash register history scoped to own cuts for non-admin roles; new /register/<id>/sales endpoint. - Remove dashboard from cashier menu; add Reports to cashier/counter. - Service orders: assign mechanic, budget field, invoice flag, counter/cashier can add items/remissions, convert to remission. - Remission notes module (UI, CSS, courier, counter remissions). - Customer hard-delete and vehicle/customer linkage in workshop. - POS: always show search results, compact payment grid, credit validation, tier pricing (5%/10%), ticket with customer/folio. - Inventory: CSV template with sku_secondary, alias import. - Rached migration scripts and DB migrations. - Version-bump cached JS/CSS query strings. Excludes local Rached session tokens/captures (rached_*.json / rached_*.txt).
19 lines
485 B
SQL
19 lines
485 B
SQL
-- v4.16: Add courier assignment to counter remission notes.
|
|
|
|
ALTER TABLE sales
|
|
ADD COLUMN IF NOT EXISTS courier_id INTEGER;
|
|
|
|
DO $$
|
|
BEGIN
|
|
IF NOT EXISTS (
|
|
SELECT 1 FROM pg_constraint
|
|
WHERE conname = 'sales_courier_id_fkey'
|
|
) THEN
|
|
ALTER TABLE sales
|
|
ADD CONSTRAINT sales_courier_id_fkey
|
|
FOREIGN KEY (courier_id) REFERENCES couriers(id);
|
|
END IF;
|
|
END $$;
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_sales_courier_id ON sales(courier_id);
|