CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Problems with grid calculations in accounting Application

Print topic Send  topic

Author Message
charles
Posted: 04/28/2005, 9:25 AM

I have developed an accounting Application with codecharge studio and everything seems alright except this problem with calculating net profit using three hierachial grids.
The Topmost grid calculates the total income, the next grid calculates the total direct expense and the third calculates the admin expense.
A label control after the second grid calculates the gross profit
by removing the total value of the first grid from the totalvalue of the second grid.
A second label control after the third grid calculates the net profit By removing the totalvalue of the third grid from the calculated value of the first label control .
Everything works fine if the value of the first label , the gross profit ,is positive.
THE PROBLEM IS WHEN THE VALUE OF THE THE FIRST LABEL ,GROSS PROFIT, IS NEGATIVE!
Then the code fails to calculate the value of the second label control properly.For example, if the gross profit is -120,000 and the value of the third grid, that is the admin expense is 60,000, the value of the second label is calculated as -60,000 instead of -180,000
I have tried my best but can't figure out what is wrong.Is this a bug with codecharge studio?

peterr


Posts: 5971
Posted: 04/28/2005, 11:06 AM

I don't think that CCS performs any calculations, so how can this be a bug in CCS? Is this CCS code that calculates something or your own code?
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
charles
Posted: 04/28/2005, 9:15 PM

Hi petterr,
Thanks for your response.
The code i used was the based on the summ example in codecharge studio.
may be this is not a bug, but i am puzzled that the problem only occurs when i tried to add two negative values.
I have tried the cgNL() function as suggested by nicole but the problem persisted.
Please help me if you can as this problem is really frustrating.
Regards,
Charles
peterr


Posts: 5971
Posted: 04/28/2005, 10:12 PM

I've re-read your description above but unfortunately don't find too many details, or would need to build such an application to test it and then see if or why it may not work.
If you're referring to this example: "Employees.Summ.Value + Employees.SpentHours.Value" then the plus sign (+) must work because it is executed by the standard ASP code, not by CCS. Thus I suspect that your values cannot be "-120,000" and "+60,000".
For now I can only recommend that you print both values to the screen/page and check if they are both correct. So this would be:
Response.Write(Employees.Summ.Value & "<br>")  
Response.Write(Employees.SpentHours.Value & "<br>")  
Response.End
If they are correct then try:
Response.Write(Employees.Summ.Value + Employees.SpentHours.Value)  
Response.End
Is the result correct then?
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
charles
Posted: 04/29/2005, 5:01 PM

Hi peter,
on the first grid i calculate the total sales using the before show row event... this is the code and it works fine

cashcollect.totalsales.value= CDbl(cashcollect.totalsales.value)+CDbl(cashcollect.totalcash.value)
on thesecond grid i calculate the direct expenses with the same event, this is the code and it works fine no problems

sale_expense.totaldirect.value = CDbl(sale_expense.totaldirect.value)+CDbl(sale_expense.totalexpense.value)
then i use calculate the gross profit with this code,it works fine no problem

grossprofit.value = CDbl(cashcollect.totalsales.value)-CDbl(sale_expense.totaldirect.value)
finally i use a third grid to calculate the admin expenses and the net profit thus,

admin_expense.totaladmin.value=CDbl(admin_expense.totaladmin.value)+CDbl(admin_expense.totalexpense.value)
netprofit.value=CDbl(grossprofit.value - admin_expense.totaladmin.value)
The problem is when the valueof the gross profit happens to be Negative,then the sums dont add up.
The code seems to sum up as if the value is positive.And herein lies my problem!
So what am i doing wrong?
Regards,
Charles

navneet
Posted: 08/02/2005, 1:18 PM

hello charles

have u been able to complete this project

i want to see a demo.

will you share the code

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.