This topic is locked

Custom view showing only certain information

9/7/2013 3:54:43 PM
PHPRunner General questions
S
snape author

Hi,
I have a table called FinancialEntries which contains every single transaction related to my business.
What I would like to do is create a custom view which acts very much like a bank statement. Only showing entries which contain a certain value ie. dropdown item 1,3,6 from one of the fields in the table. This then restricts what is listed to bank account entries and ignores things like personal expenses.
I would like an additional field to keep a running balance of the monetory amounts on the far right, like a bank statement.
I would also like the table to treat one of the fields values as a negative amount even though it is stored as a positive amount. This will allow me to differentiate monies in and out and will affect the running balance accordingly.
Is all this possible?
I would be very grateful for any advice on this.
Kind regards
Spencer

S
snape author 9/8/2013



Yes, all is possible. You can get inspiration from these articles:
http://xlinesoft.com/blog/2011/01/03/tutorial_conditional_formatting/

http://xlinesoft.com/blog/2011/04/28/taming-the-beast-events-buttons-and-code-snippets/


Great stuff, thanks!
Are there any tutorials which explain how to keep a running balance the first article only talks about negative values?
Thanks
Spencer

Sergey Kornilov admin 9/9/2013
S
snape author 9/9/2013



Running balance tutorial:

http://www.asprunner.com/forums/topic/21091-implementing-running-total-in-phprunner/


That worked thanks Sergie.
One more question I need certain values to show as negative based on the conditional value of another column.
This is because all values that make up the balance are recorded as positive values in the database, I need to change these as the page loads so that the balance column sees them as negative values and calculates the cumulative value appropriately.
The type of condition I'm looking to achieve is:
If 'AccountingSource' = 1 or 3

then 'GrossAmount' = -1* ('GrossAmount')
Thanks again for any help here!
Spencer

C
cgphp 9/9/2013

Set the GrossAmount field as Custom and add the following code:

if($data['AccountingSource'] == 1 OR $data['AccountingSource'] == 3)

{

$value *= -1;

}
S
snape author 9/9/2013



Set the GrossAmount field as Custom and add the following code:

if($data['AccountingSource'] == 1 OR $data['AccountingSource'] == 3)

{

$value *= -1;

}



Hi Thanks, I tried that but the balance doesn't seem to see it as a negative value. The balance must take the value from the database rather than the page...

S
snape author 9/15/2013

Bump
I'm still stuck on this as mentioned above.
Thanks for any help here.
Spence

Sergey Kornilov admin 9/16/2013

Spence,
it's not clear what exactly causes the trouble here. If you more help post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.