0

enter image description here

I want to sum the debit value from the opening balance for first row and minus the credit value and the final is balance....

            debit= (opening balance+debit)
             balance=debit-Credit

for the second row I want to sum the debit with firstrow balance value

              debit= (firstrow balance+secondrow debit)
               balance=debit-Credit

using jquery I want a value like that.

5
  • pls anyone ask me as soon as possible Commented Mar 9, 2015 at 6:29
  • 2
    Help us to help you. Please post the relevant HTML (instead of a picture of it) and the JavaScript code that you have tried. Commented Mar 9, 2015 at 6:37
  • please create a jsfiddle with your code Commented Mar 9, 2015 at 6:40
  • 1
    What is not working? Your examples are incomplete, so it difficult to see where things might go wrong. Edit your question to include more relevant information, actual (wrong) values you get etc. Without us having to enlarge the picture and do the sums ourselves. If you have a chance edit the whitespace out of the picture, it looked as if your Q only has a title and a picture until you scroll down. Commented Mar 9, 2015 at 6:47
  • Please add the datatables initialisation code. Commented Mar 10, 2015 at 9:42

1 Answer 1

1

1.assign ur opening value to a variable outside the loop decimal total=opening;

2.inside the loop use this do this and display the balance decimal balance=total+debit; 3.again assign back to total inside the loop total=balance;

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.