Documentation

Trace:

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
visionx:invoice_application [2020/06/08 11:17]
cduncan [Changing the Invoice Screen]
visionx:invoice_application [2020/06/08 11:20]
cduncan [Calculations in the Application]
Line 227: Line 227:
 ====== Calculations in the Application ====== ====== Calculations in the Application ======
  
-As the last few steps we are going to add a "Sub Total" area under the component table. For this we have to add a "​Total"​ column to our invoice table. We already added a column in this tutorial so we are going to skip this part. As the next step we are going to add a label "Sub Total" and the new editor "​Total"​ from our table directly under the "​Amount"​ column of our component table. We remove the border of our editor in the "​Edit"​ menu to make it fit better.+For the last few stepswe are going to add a "Sub Total" area under the component table. For thiswe have to add a "​Total"​ column to our invoice table. We already added a column in this tutorialso we are going to skip this part. As the next stepwe are going to add a label "Sub Total" and the new editor "​Total"​ from our table directly under the "​Amount"​ column of our component table. We remove the border of our editor in the "​Edit"​ menu to make it fit better.
  
-As the next step we are going to make the table do the calculations when a row is changed. Select a component in our component table and press "​Create Row Value Changed"​. In the following wizard we select "​Calculate Value" specify that we want to "Write to" the invoice item amount column and add "​[Invoice Item.Quantity] * [Invoice Item.Rate]"​ as the Formula. This is done to save the amount into the invoice item row. We add another command, select "​Calculate Value" once more but "Write to" our total column in the invoice table now. The formula is "​sum([Invoice Item.Amount])"​ in this case. To add columns to our formula we can press the button (1) next to the formula field. This way you can add the columns of our tables via dropdown (2).+Next, we are going to make the table do the calculations when a row is changed. Select a component in our component table and press "​Create Row Value Changed"​. In the following wizardwe select "​Calculate Value"specify that we want to "Write to" the invoice item amount columnand add "​[Invoice Item.Quantity] * [Invoice Item.Rate]"​ as the formula. This is done to save the amount into the invoice item row. We add another command, select "​Calculate Value" once morebut "Write to" our total column in the invoice table now. The formula is "​sum([Invoice Item.Amount])"​ in this case. To add columns to our formulawe can press the button (1) next to the formula field. This way you can add the columns of our tables via dropdown (2).
  
 {{:​visionx:​invoice_application:​add-calculation-action.png?​nolink|The calculation action}} {{:​visionx:​invoice_application:​add-calculation-action.png?​nolink|The calculation action}}
  
-After that we can add items and the calculations will be done. To make sure that the values are also changed when we delete an item we have to add a "​Create After Deleted Row" event with the same commands as well. Our application should now look somewhat like this:+After thatwe can add items and the calculations will be done. To make sure that the values are also changed when we delete an itemwe have to add a "​Create After Deleted Row" event with the same commands as well. Our application should now look somewhat like this:
  
 {{:​visionx:​invoice_application:​web-preview-3.png?​nolink|The current application}} {{:​visionx:​invoice_application:​web-preview-3.png?​nolink|The current application}}
This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information