Hi All,
New to Alpha 5 and SQL, coming from Clarion.
I have decided to transfer our desktop apps to a unified web app and am using SQL Server 2012 Express. It is for an in-house app that won't have huge numbers of records.
The way we do our (cash register) till at the moment is to set a main transaction with a total value, and allow transactions against that value until the total has been reached and then main (header) transaction is marked as completed.
I have two files ... TillHeader and LineItems.
The pertinent fields in the TillHeader are :
Transaction amount ... the amount that the total for the transaction is for.
TotalVATPaid ... the total amount of VAT paid for a transaction. (Line items can have differing amounts of VAT for each line)
ItemCompleted ... A logical (int) field
DateOfCompletion ... The date that the transaction was marked completed
BalanceDue ... The amount remaining ... the transaction amount - the LineItems against this TillHeader.
The pertinent fields in the LineItems are :
ItemAmount ... the amount of the item
Quantity ... the number of the items
VATApplied ... a percentage value ... currently either 0, 12.5 or 23, but this is potentially variable
LineTotal ... a computed field in the SQL database (Quantity*ItemAmount)
VATPaid ... a computed field in the SQL database (Quantity*ItemAmount*VATApplied)/100
What I want to do is to manage the TillHeader automatically ...
A till header is created ... Say €100
Each time a LineItem is created/modified, I want to post back to the TillHeader to update the balance remaining, VAT paid etc and when the total is paid, to set the date completed and to mark the transaction completed.
Should this be a trigger of some kind or computed fields or am I best handling this through Alpha 5 on the client side?
Thanks in advance for any help
Phil
New to Alpha 5 and SQL, coming from Clarion.
I have decided to transfer our desktop apps to a unified web app and am using SQL Server 2012 Express. It is for an in-house app that won't have huge numbers of records.
The way we do our (cash register) till at the moment is to set a main transaction with a total value, and allow transactions against that value until the total has been reached and then main (header) transaction is marked as completed.
I have two files ... TillHeader and LineItems.
The pertinent fields in the TillHeader are :
Transaction amount ... the amount that the total for the transaction is for.
TotalVATPaid ... the total amount of VAT paid for a transaction. (Line items can have differing amounts of VAT for each line)
ItemCompleted ... A logical (int) field
DateOfCompletion ... The date that the transaction was marked completed
BalanceDue ... The amount remaining ... the transaction amount - the LineItems against this TillHeader.
The pertinent fields in the LineItems are :
ItemAmount ... the amount of the item
Quantity ... the number of the items
VATApplied ... a percentage value ... currently either 0, 12.5 or 23, but this is potentially variable
LineTotal ... a computed field in the SQL database (Quantity*ItemAmount)
VATPaid ... a computed field in the SQL database (Quantity*ItemAmount*VATApplied)/100
What I want to do is to manage the TillHeader automatically ...
A till header is created ... Say €100
Each time a LineItem is created/modified, I want to post back to the TillHeader to update the balance remaining, VAT paid etc and when the total is paid, to set the date completed and to mark the transaction completed.
Should this be a trigger of some kind or computed fields or am I best handling this through Alpha 5 on the client side?
Thanks in advance for any help
Phil
Comment