Hey guys I need to add some custom scripting and am very new to javascript so hoping someone could help me with it. First of all I need to take the Sales Invoice Date and calculate the last day of the following month and populate the payment_due_date with that value. So far I have my logic as:
var calcduedate = myDateVar.getMonth()
myDateVar.setMonth(calcduedate + 1)
Just need some assistance on the replace command and to have it occur onsave so:
frappe.ui.form.on('Sales Invoice', 'save', function(calcduedate){
Secondly I want to trigger to send an email when a Sales Order meets the following criteria:
- workflow_state = “Complete” and
- ship_by = “Pickup”
But not sure where to start with this one. Any assistance would be appreciated, thanks.