Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Due Date calculation #2135

Closed
umairsy opened this issue Sep 1, 2014 · 6 comments
Closed

Due Date calculation #2135

umairsy opened this issue Sep 1, 2014 · 6 comments

Comments

@umairsy
Copy link
Member

umairsy commented Sep 1, 2014

As received from Lumi.

In the Sales Invoice, Payment Due Date is correctly updated based on Credit Days mentioned in the Customer. But if user amends Posting Date of Sales Invoice, Payment Due Date is not updated.

Same way, on the purchase side, user expects item's "Required By Date" to be updated, after changing Posting Date of Material Request/Purchase Order.

@ghost
Copy link

ghost commented Sep 2, 2014

Need to add Lead Time Days (lead_time_days) field value to the 'Required By Date' on changing Posting date.

@jevonearth
Copy link

Having javascript update the due date immediately, based on invoice date would be very useful.

When editing an existing invoice, it may not be desirable for the due date to be updated automatically, as it might have been previously set explicitly. Xero has a 'Reset to Default Date' link for this purpose.

I recorded a quick video of the Xero behavior that you guys might find useful.
http://youtu.be/Jyk-rdtdViI

I also opened #2147 and #2146 today, that both relate to due date behavior. :)

-Jev

@rmehta
Copy link
Member

rmehta commented Sep 5, 2014

@jevonearth thanks for the nice video - clear documentation and expectations should result in increased priority :)

@rmehta rmehta assigned ghost Sep 12, 2014
@rmehta rmehta added this to the Accounting Issues (Poll) milestone Sep 12, 2014
@nabinhait nabinhait unassigned ghost Nov 13, 2014
@sbkolate
Copy link
Contributor

Hi,
In the Sales Invoice, Payment Due Date is correctly updated based on Credit Days mentioned in the Customer. But if user amends Posting Date of Sales Invoice, Payment Due Date is not updated.

This can be solved using custom script

cur_frm.add_fetch('customer','credit_days','credit_days');
cur_frm.cscript.posting_date = function(doc){
        cur_frm.set_value("due_date", frappe.datetime.add_days(doc.posting_date,doc.credit_days));
}

I think this should be added in ERPNext. Can I send pull request for this feature?

Thanks,

Sambhaji
Systematrix Solutions

@nabinhait
Copy link
Member

@sbkolate
Actually the code is already there ( https://github.com/frappe/erpnext/blob/develop/erpnext/accounts/party.py#L127 )
It sets due_date based credit_days, on selection of customer or posting_date. But the problem is, if there is already a value selected in due_date field, it does not reset it. It is because system could not identify the due_date is entered by the user or calculated based on credit days. If it was set by user, system should not reset it.

@rmehta rmehta removed the accounts label Apr 14, 2015
@nabinhait
Copy link
Member

Same as #3451
WIP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants