Topic: Running Balance per Transaction

HELLO DRIVESOFT.

I need a sample of running balance per transaction.

sample:

Collections  |   Deposits  |  Balance
                                            100.00
100.00                  0.00        200.00
100.00              100.00        200.00

Re: Running Balance per Transaction

I'm interested in running balance calc too.
At my end it'd be laid out like this:


Deposits   |   Withdrawals   |   Running Balance
                                                               100.00
100.00                     0.00                        200.00
100.00                   50.00                        250.00

Adam
God... please help me become the person my dog thinks I am.

Re: Running Balance per Transaction

Hi Manixs, Adam,
I'm not sure that you would actually ever have both a deposit and a withdrawal against the same transaction (as per both layouts)
But as far as a running balance is concerned, maybe you could do it something like this (bit untested as I'm in a hurry!).
Hopefully it helps,
Derek.

Post's attachments

Attachment icon runningbalance.zip 338.93 kb, 407 downloads since 2017-07-19 

Re: Running Balance per Transaction

Great Derek!


It does apply to my project. 

Thank you so much!

Re: Running Balance per Transaction

Hi Manixs,
I ran out of time yesterday to finish this off.
Here is the version with formatting (but the principle of how to keep a running balance is the same as the old version).
Regards,
Derek.

Post's attachments

Attachment icon runningbalance2.zip 340.05 kb, 389 downloads since 2017-07-19 

Re: Running Balance per Transaction

Thanks Derek!

Appreciated!

You'll be my guest and see soon in the Philipines!

Re: Running Balance per Transaction

Hello Derek!

I am confused on the time combox in your project sample, although it helps me a lot.  I found a problem if the transaction happened yesterday and the DATA ENTRY was happening late or meaning to say on the next day, when you save the records the saved time is the current time but when you edit it to correct the entry it goes right after saving it again.  I don't know what to do. This is something confusing and hard to understand by a user. Please help me to fix this problem.

Thank you in advance!

Re: Running Balance per Transaction

Hi Manixs,
I was able to recreate what you found but I don't quite know how to fix it. 
I think it might be a bug so I have messaged Dmitry and asked him to have a look at it.
If he can't find a solution, a way around it is to use 2 separate fields - 1 date field and 1 time field (rather than use a combined date/time field).
I will get back to you when I've had an answer.
Regards,
Derek.

Re: Running Balance per Transaction

derek wrote:

Hi Manixs,
I was able to recreate what you found but I don't quite know how to fix it. 
I think it might be a bug so I have messaged Dmitry and asked him to have a look at it.
If he can't find a solution, a way around it is to use 2 separate fields - 1 date field and 1 time field (rather than use a combined date/time field).
I will get back to you when I've had an answer.
Regards,
Derek.

________

HI DEREK!

I did something modification on the project and the result is great.

Pls find Attached!

Thanks!

Post's attachments

Attachment icon runningbalanceFinal.zip 340.87 kb, 390 downloads since 2017-07-21 

Re: Running Balance per Transaction

Hi Derek and Manixs,


I'm not sure that you would actually ever have both a deposit and a withdrawal against the same transaction (as per both layouts)...

My apologies for not making my layout clear. I should have added additional two columns (cost of deposit and cost of withdrawal)  in addition and show deposits and withdrawal in separate columns. At my end I wanted to use running balance in banking terms.


Manixs' calc field formula with printf("%.2f",... seems to be working OK. Thanks for sharing Manixs.


When formatting tGrid cell values with decimals and thousand separator;
the following works fine without printf("%.2f",...  calc fields and on form calcs:


procedure Form1_tgMain_OnChange (Sender: string);
begin
 if form1.tgMain.Columns[4] is TNxNumberColumn then
    begin
    TNxNumberColumn(form1.tgMain.Columns[4]).FormatMask := '#,###,##0.00'; //
    TNxNumberColumn(form1.tgMain.Columns[6]).FormatMask := '#,###,##0.00'; //
   end;
end;

However, the above didn't work with calc field containing printf("%.2f",...
I found out that old method below worked with calc field containing printf("%.2f",...

procedure Form1_tgMain_OnChange (Sender: string);
var i,c: integer;
begin
    Form1.tgMain.BeginUpdate;

    c := Form1.tgMain.RowCount - 1;
    for i := 0 to c do
    begin
        Form1.tgMain.Cells[8, i] := FormatFloat('#,##0.00', Form1.tgMain.Cell[8, i].AsFloat);
        Form1.tgMain.Cells[9, i] := FormatFloat('#,##0.00', Form1.tgMain.Cell[9, i].AsFloat);
    end;
    Form1.tgMain.EndUpdate;
end;

Just wanted to share in case others may encounter the same issue and also for correction if needed.

Adam
God... please help me become the person my dog thinks I am.

Re: Running Balance per Transaction

OKIES.

THANKS TO ALL!

Re: Running Balance per Transaction

Hi Manixs,
The 'time' part of datetimepicker needs to be set up as the primary element and defined as your database field, not the 'date' part as I was doing. 
You then associate the 'date' element (undefined)  with the 'time' element.  I hope that makes sense.
I've attached the original project with it fixed (even though I see that you've now got it working by using separate date and time fields).
Regards,
Derek.

Post's attachments

Attachment icon runningbalance2.zip 341.26 kb, 364 downloads since 2017-07-25 

Re: Running Balance per Transaction

Thanks Derek!

It helps me a lot. Thank you!3

Re: Running Balance per Transaction

Hello to All!

Pls help me to solve my problem.  I need to color the rows of all identified as Paid Out.

Thank You!

Re: Running Balance per Transaction

Hi Manixs,
Please have a look at the attached example.
I am not sure if you want to color the whole row or just the cell so I have shown both ways.
The condition for colouring can be any value from any column that has been defined to the tablegrid (even if the column is made invisible, as I have done in this example).
Hope this helps,
Derek.

Post's attachments

Attachment icon runningbalanceFinal.zip 341.15 kb, 403 downloads since 2017-08-03 

Re: Running Balance per Transaction

i owe you a lot Derek. Thank you so much.   It helps me!