Ledger Balance

40 views
Skip to first unread message

Rohit Waghchaure

unread,
Mar 8, 2013, 10:37:45 AM3/8/13
to erpnext-dev...@googlegroups.com
Hell Sir

          I am trying to fetch ledger balance of customer, but it's showing Zero balance, so from where i can increase ledger balance of a customer.

Thanx & Regards
Rohit

Rushabh Mehta

unread,
Mar 11, 2013, 12:24:14 AM3/11/13
to erpnext-dev...@googlegroups.com
Rohit,

Can you tell us how are you accessing the ledger balance? Preferably using gist / pastebin.

thanks,
Rushabh


W: https://erpnext.com
T: @rushabh_mehta

--
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To post to this group, send email to erpnext-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/qSA-MD_BD1YJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Rohit Waghchaure

unread,
Mar 11, 2013, 5:12:14 AM3/11/13
to erpnext-dev...@googlegroups.com
Hello sir
 
              I used following query for accessing a ledger balance

function sd(ff)
{

wn.call({
    method: "accounts.utils.get_balance_on",
        args: {account: ff, date: doc.posting_date},
        callback: function(r) {
            doc.customer_balance = format_currency(r.message, erpnext.get_currency(doc.company));
            refresh_field('customer_balance');
           // msgprint(customer_balance);
          
        }

})
}

Thanx & Regards
Rohit

Nabin Hait

unread,
Mar 11, 2013, 5:21:28 AM3/11/13
to erpnext-dev...@googlegroups.com
Code looking correct.

Check whether "GL Entry" for that customer account exists. "GL Entry" records are created for each account entry.

Regards,
Nabin Hait

Rohit Waghchaure

unread,
Mar 12, 2013, 2:13:38 AM3/12/13
to erpnext-dev...@googlegroups.com
Hell sir

           I have successfully retrieve ledger balance in sales invoice but when i create new sales invoice for that customer it shows same amount as it show previous. I want to reduce the balance when new sales invoice generate for that customer. When ledger balance increases or decreases for particular customer

How to check current ledger balance of customer


Thanx & Regards
Rohit

Anand Doshi

unread,
Mar 12, 2013, 2:22:08 AM3/12/13
to erpnext-dev...@googlegroups.com
Hi Rohit,

Make the field as allow on submit.

Then call the calculate function in the event:
cur_frm.cscript.custom_on_submit = function() {

}

if you want to save the value in the current doc, then in the callback of get balance call, run:
cur_frm.save("Update");

Thanks,
Anand.

Anand Doshi

unread,
Mar 12, 2013, 2:23:19 AM3/12/13
to Anand Doshi, erpnext-dev...@googlegroups.com
Hi Rohit,

Sorry. This will also work without making the field allow on submit. Ignore that part. Keep the field as read only.

-Anand.
Reply all
Reply to author
Forward
0 new messages