invoice
This commit is contained in:
@@ -703,6 +703,16 @@
|
||||
"nullable": true,
|
||||
"length": 6,
|
||||
"mappedType": "datetime"
|
||||
},
|
||||
"title": {
|
||||
"name": "title",
|
||||
"type": "varchar(255)",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": false,
|
||||
"length": 255,
|
||||
"mappedType": "string"
|
||||
}
|
||||
},
|
||||
"name": "order_prints",
|
||||
@@ -2063,24 +2073,6 @@
|
||||
"nullable": false,
|
||||
"length": 26,
|
||||
"mappedType": "character"
|
||||
},
|
||||
"description": {
|
||||
"name": "description",
|
||||
"type": "text",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": true,
|
||||
"mappedType": "text"
|
||||
},
|
||||
"attachments": {
|
||||
"name": "attachments",
|
||||
"type": "jsonb",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": true,
|
||||
"mappedType": "json"
|
||||
}
|
||||
},
|
||||
"name": "request_items",
|
||||
@@ -2509,8 +2501,8 @@
|
||||
"nullable": false,
|
||||
"mappedType": "integer"
|
||||
},
|
||||
"confirm_status": {
|
||||
"name": "confirm_status",
|
||||
"status": {
|
||||
"name": "status",
|
||||
"type": "text",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
@@ -2520,7 +2512,8 @@
|
||||
"enumItems": [
|
||||
"pending",
|
||||
"partially_confirmed",
|
||||
"confirmed"
|
||||
"confirmed",
|
||||
"archived"
|
||||
],
|
||||
"mappedType": "enum"
|
||||
},
|
||||
@@ -3213,6 +3206,16 @@
|
||||
"name": "orders",
|
||||
"schema": "public",
|
||||
"indexes": [
|
||||
{
|
||||
"columnNames": [
|
||||
"invoice_item_id"
|
||||
],
|
||||
"composite": false,
|
||||
"keyName": "orders_invoice_item_id_unique",
|
||||
"constraint": true,
|
||||
"primary": false,
|
||||
"unique": true
|
||||
},
|
||||
{
|
||||
"columnNames": [
|
||||
"print_id"
|
||||
|
||||
@@ -15,7 +15,7 @@ export class Migration20260626140000 extends Migration {
|
||||
v_total int;
|
||||
v_paid int;
|
||||
v_enable_tax boolean;
|
||||
v_confirm_status text;
|
||||
v_status text;
|
||||
BEGIN
|
||||
|
||||
v_invoice_id := COALESCE(NEW.invoice_id, OLD.invoice_id);
|
||||
@@ -68,7 +68,7 @@ export class Migration20260626140000 extends Migration {
|
||||
) THEN 'confirmed'
|
||||
ELSE 'partially_confirmed'
|
||||
END
|
||||
INTO v_confirm_status;
|
||||
INTO v_status;
|
||||
|
||||
UPDATE invoices
|
||||
SET
|
||||
@@ -78,8 +78,9 @@ export class Migration20260626140000 extends Migration {
|
||||
total = v_total,
|
||||
paid_amount = v_paid,
|
||||
balance = v_total - v_paid,
|
||||
confirm_status = v_confirm_status
|
||||
WHERE id = v_invoice_id;
|
||||
status = v_status
|
||||
WHERE id = v_invoice_id
|
||||
AND status <> 'archived';
|
||||
|
||||
RETURN NULL;
|
||||
END;
|
||||
|
||||
Reference in New Issue
Block a user