Hi! I've created 5 elements:
-Date Complete
-Year (Got from date, calc on save)
-Document Type (Invoice, pre-invoice)
-Number (If are a record present in the DB with X number where Year(date) = $Year and DocumentType = $document, return $number+1, else, return $number_confirm)
-Number Confirm
It works only when creating a new row, if i try to modify the already existing row it auto add +1 to the number.
Is there a logic way to fix it?
I can't use the ID element type, 'cause invoice number returns to 0 when the new year comes.
-Date Complete
-Year (Got from date, calc on save)
-Document Type (Invoice, pre-invoice)
-Number (If are a record present in the DB with X number where Year(date) = $Year and DocumentType = $document, return $number+1, else, return $number_confirm)
-Number Confirm
It works only when creating a new row, if i try to modify the already existing row it auto add +1 to the number.
Is there a logic way to fix it?
I can't use the ID element type, 'cause invoice number returns to 0 when the new year comes.