This topic is locked
[SOLVED]

 Add totals in different inline add records

8/19/2019 2:38:35 AM
PHPRunner General questions
A
AndrewMark author

Existing: 1.An inline add of a details table 2. Relevant fieldnames of the details table are a) TotalSuppliers b ) Select c) SupplierAmount
Would like to achieve:

  1. For each new inline add record of the details table and
  2. Where Select = "yes"
  3. Add the value of TotalSuppliers of that inline add to a field SupplierAmount
    eg

    Record--------- TotalSuppliers----------Select---------SupplierAmount

    inline add one:--------10------------------yes--------------10

    inline add two:--------20------------------no---------------10

    inline add three:------30------------------yes--------------40
    NB. The SupplierAmount field value is eventually just forwarded to another tables field, so if it is easier to set this up as a variable or something else it does not need to be setup as a field in the details table.
    I have previously used https://xlinesoft.com/phprunner/docs/how_to_calculate_values_on_the_fly.htm but it seems to refer to calculations in the same inline record rather than calculations across different inline records.
    Any ideas how this can be achieved in an inline add situation?

Sergey Kornilov admin 8/19/2019

This can be done but a reasonable amount of coding will be required. You will need to write a function that would calculate totals based on your rules and trigger re-calculation after every single field change or new record added or deleted.
Invoice template does something similar:

https://xlinesoft.com/invoice

A
AndrewMark author 8/19/2019



This can be done but a reasonable amount of coding will be required. You will need to write a function that would calculate totals based on your rules and trigger re-calculation after every single field change or new record added or deleted.
Invoice template does something similar:

https://xlinesoft.com/invoice



thanks