some minor changes get fixed for PO/PI
This commit is contained in:
parent
6b679c45df
commit
b2a3f2d386
@ -232,7 +232,6 @@ cur_frm.fields_dict['entries'].grid.get_field('project_name').get_query = functi
|
||||
}
|
||||
}
|
||||
|
||||
//added by sambhaji
|
||||
|
||||
|
||||
cur_frm.cscript.is_recurring = function(doc, dt, dn) {
|
||||
@ -267,7 +266,7 @@ cur_frm.cscript.from_date = function(doc, dt, dn) {
|
||||
}
|
||||
}
|
||||
|
||||
//end of added by sambhajii
|
||||
|
||||
|
||||
cur_frm.cscript.select_print_heading = function(doc,cdt,cdn){
|
||||
if(doc.select_print_heading){
|
||||
|
@ -800,6 +800,7 @@
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 1,
|
||||
"depends_on": "eval:doc.is_recurring==1",
|
||||
"description": "Select the period when the invoice will be generated automatically",
|
||||
"fieldname": "recurring_type",
|
||||
"fieldtype": "Select",
|
||||
|
@ -265,11 +265,11 @@ class PurchaseInvoice(BuyingController):
|
||||
self.update_against_document_in_jv()
|
||||
self.update_prevdoc_status()
|
||||
self.update_billing_status_for_zero_amount_refdoc("Purchase Order")
|
||||
convert_to_recurring(self, "RECINV.#####", self.posting_date)
|
||||
convert_to_recurring(self, "RECPI.#####", self.posting_date)
|
||||
|
||||
def on_update_after_submit(self):
|
||||
validate_recurring_document(self)
|
||||
convert_to_recurring(self, "RECINV.#####", self.posting_date)
|
||||
convert_to_recurring(self, "RECPI.#####", self.posting_date)
|
||||
|
||||
def make_gl_entries(self):
|
||||
auto_accounting_for_stock = \
|
||||
|
@ -205,7 +205,7 @@ cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
||||
cur_frm.email_doc(frappe.boot.notification_settings.purchase_order_message);
|
||||
}
|
||||
}
|
||||
//added by sambhaji
|
||||
|
||||
|
||||
cur_frm.cscript.is_recurring = function(doc, dt, dn) {
|
||||
// set default values for recurring orders
|
||||
@ -238,7 +238,7 @@ cur_frm.cscript.from_date = function(doc, dt, dn) {
|
||||
}
|
||||
}
|
||||
|
||||
//end of added by sambhaji
|
||||
|
||||
cur_frm.cscript.send_sms = function() {
|
||||
frappe.require("assets/erpnext/js/sms_manager.js");
|
||||
var sms_man = new SMSManager(cur_frm.doc);
|
||||
|
@ -179,7 +179,7 @@ class PurchaseOrder(BuyingController):
|
||||
|
||||
frappe.db.set(self,'status','Submitted')
|
||||
|
||||
convert_to_recurring(self, "SO/REC/.#####", self.transaction_date)
|
||||
convert_to_recurring(self, "SO/REP/.#####", self.transaction_date)
|
||||
|
||||
def on_cancel(self):
|
||||
pc_obj = frappe.get_doc('Purchase Common')
|
||||
@ -204,9 +204,9 @@ class PurchaseOrder(BuyingController):
|
||||
def on_update(self):
|
||||
pass
|
||||
|
||||
def on_update_after_submit(self):
|
||||
def on_update_after_submit(self):
|
||||
validate_recurring_document(self)
|
||||
convert_to_recurring(self, "SO/REC/.#####", self.transaction_date)
|
||||
convert_to_recurring(self, "SO/REP/.#####", self.transaction_date)
|
||||
|
||||
def set_missing_values(source, target):
|
||||
target.ignore_pricing_rule = 1
|
||||
|
@ -41,6 +41,20 @@ def test_recurring_document(obj, test_records):
|
||||
date_field = "transaction_date"
|
||||
elif base_doc.doctype == "Sales Invoice":
|
||||
date_field = "posting_date"
|
||||
#for Purchase order/purchase invoice
|
||||
if base_doc.doctype == "Purchase Order":
|
||||
base_doc.update({
|
||||
"transaction_date": today
|
||||
})
|
||||
elif base_doc.doctype == "Purchase Invoice":
|
||||
base_doc.update({
|
||||
"posting_date": today
|
||||
})
|
||||
|
||||
if base_doc.doctype == "Purchase Order":
|
||||
date_field = "transaction_date"
|
||||
elif base_doc.doctype == "Purchase Invoice":
|
||||
date_field = "posting_date"
|
||||
|
||||
# monthly
|
||||
doc1 = frappe.copy_doc(base_doc)
|
||||
|
Loading…
x
Reference in New Issue
Block a user