Jump to content

What I can get the due left of every person easily for the following table [image attached] ?


Recommended Posts

I am trying to implement this for two days now but stuck with logics ! Please help.
What I can get the due left of every person easily for the following table [image attached] -
table link:  https://ibb.co/xC53Cf4
where
1.inc_due is the column to get total due for specific person like cust_id
2. inctype_id =11 is the type of dues paid for specific person (cust_id)
3. echo only due left by cust_id or person id

4 hours ago, requinix said:

So the result you're trying to get for those 5 rows of data is one row with cust_id=126 inc_due=0? Does the inc_amount matter?

Do you have a larger example?

Thank you. As you can see in the talbe "cust_id = 126" has paid 101,5000,1000 are the sell payment but the "inctype_id = 11" is the only due payment out of
inc_due = "500" + "500" =1000 -> so there should be due_left = 1000-100=900 . This is what I  want to calculate and display for each cust_id, if any cust_id does not have dues, it should display due_left = 0

4 hours ago, requinix said:

So you want the SUM(inc_due) minus the SUM(inc_amount) WHERE inctype_id=11?

From the example data, that's what it looked like to me -- group by cust_id.  

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.