fiscal year auto-fetch added to c-form, installation_note, stock_reconciliation, customer_issue, maintanence_visit & removed for Expense Claim

This commit is contained in:
Neil Trini Lasrado
2014-10-08 12:55:06 +05:30
parent 565d986198
commit 9614b552fd
7 changed files with 56 additions and 19 deletions

View File

@@ -3,6 +3,8 @@
//c-form js file //c-form js file
// ----------------------------- // -----------------------------
frappe.require("assets/erpnext/js/utils.js");
cur_frm.fields_dict.invoice_details.grid.get_field("invoice_no").get_query = function(doc) { cur_frm.fields_dict.invoice_details.grid.get_field("invoice_no").get_query = function(doc) {
return { return {
filters: { filters: {
@@ -22,4 +24,12 @@ cur_frm.fields_dict.state.get_query = function(doc) {
cur_frm.cscript.invoice_no = function(doc, cdt, cdn) { cur_frm.cscript.invoice_no = function(doc, cdt, cdn) {
var d = locals[cdt][cdn]; var d = locals[cdt][cdn];
return get_server_fields('get_invoice_details', d.invoice_no, 'invoice_details', doc, cdt, cdn, 1); return get_server_fields('get_invoice_details', d.invoice_no, 'invoice_details', doc, cdt, cdn, 1);
}
cur_frm.cscript.company = function(doc, cdt, cdn) {
erpnext.get_fiscal_year(doc.company, doc.received_date);
}
cur_frm.cscript.received_date = function(doc, cdt, cdn){
erpnext.get_fiscal_year(doc.company, doc.received_date);
} }

View File

@@ -2,7 +2,6 @@
// License: GNU General Public License v3. See license.txt // License: GNU General Public License v3. See license.txt
frappe.provide("erpnext.hr"); frappe.provide("erpnext.hr");
frappe.require("assets/erpnext/js/utils.js");
erpnext.hr.ExpenseClaimController = frappe.ui.form.Controller.extend({ erpnext.hr.ExpenseClaimController = frappe.ui.form.Controller.extend({
make_bank_voucher: function() { make_bank_voucher: function() {
@@ -154,12 +153,4 @@ cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
if(cint(frappe.boot.notification_settings && frappe.boot.notification_settings.expense_claim)) { if(cint(frappe.boot.notification_settings && frappe.boot.notification_settings.expense_claim)) {
cur_frm.email_doc(frappe.boot.notification_settings.expense_claim_message); cur_frm.email_doc(frappe.boot.notification_settings.expense_claim_message);
} }
}
cur_frm.cscript.company = function(doc, cdt, cdn) {
erpnext.get_fiscal_year(doc.company, doc.posting_date);
}
cur_frm.cscript.posting_date = function(doc, cdt, cdn){
erpnext.get_fiscal_year(doc.company, doc.posting_date);
} }

View File

@@ -4,6 +4,7 @@
cur_frm.cscript.tname = "Installation Note Item"; cur_frm.cscript.tname = "Installation Note Item";
cur_frm.cscript.fname = "installed_item_details"; cur_frm.cscript.fname = "installed_item_details";
frappe.require("assets/erpnext/js/utils.js");
frappe.ui.form.on_change("Installation Note", "customer", frappe.ui.form.on_change("Installation Note", "customer",
function(frm) { erpnext.utils.get_party_details(frm); }); function(frm) { erpnext.utils.get_party_details(frm); });
@@ -69,3 +70,11 @@ erpnext.selling.InstallationNote = frappe.ui.form.Controller.extend({
}); });
$.extend(cur_frm.cscript, new erpnext.selling.InstallationNote({frm: cur_frm})); $.extend(cur_frm.cscript, new erpnext.selling.InstallationNote({frm: cur_frm}));
cur_frm.cscript.company = function(doc, cdt, cdn) {
erpnext.get_fiscal_year(doc.company, doc.inst_date);
}
cur_frm.cscript.inst_date = function(doc, cdt, cdn){
erpnext.get_fiscal_year(doc.company, doc.inst_date);
}

View File

@@ -2,6 +2,7 @@
// License: GNU General Public License v3. See license.txt // License: GNU General Public License v3. See license.txt
frappe.require("assets/erpnext/js/controllers/stock_controller.js"); frappe.require("assets/erpnext/js/controllers/stock_controller.js");
frappe.require("assets/erpnext/js/utils.js");
frappe.provide("erpnext.stock"); frappe.provide("erpnext.stock");
erpnext.stock.StockReconciliation = erpnext.stock.StockController.extend({ erpnext.stock.StockReconciliation = erpnext.stock.StockController.extend({
@@ -159,3 +160,11 @@ erpnext.stock.StockReconciliation = erpnext.stock.StockController.extend({
}); });
cur_frm.cscript = new erpnext.stock.StockReconciliation({frm: cur_frm}); cur_frm.cscript = new erpnext.stock.StockReconciliation({frm: cur_frm});
cur_frm.cscript.company = function(doc, cdt, cdn) {
erpnext.get_fiscal_year(doc.company, doc.posting_date);
}
cur_frm.cscript.posting_date = function(doc, cdt, cdn){
erpnext.get_fiscal_year(doc.company, doc.posting_date);
}

View File

@@ -1,5 +1,5 @@
{ {
"allow_copy": 1, "allow_copy": 1,
"autoname": "SR/.######", "autoname": "SR/.######",
"creation": "2013-03-28 10:35:31", "creation": "2013-03-28 10:35:31",
"description": "This tool helps you to update or fix the quantity and valuation of stock in the system. It is typically used to synchronise the system values and what actually exists in your warehouses.", "description": "This tool helps you to update or fix the quantity and valuation of stock in the system. It is typically used to synchronise the system values and what actually exists in your warehouses.",
@@ -41,6 +41,14 @@
"print_hide": 1, "print_hide": 1,
"read_only": 1 "read_only": 1
}, },
{
"fieldname": "company",
"fieldtype": "Link",
"label": "Company",
"options": "Company",
"permlevel": 0,
"reqd": 1
},
{ {
"fieldname": "fiscal_year", "fieldname": "fiscal_year",
"fieldtype": "Link", "fieldtype": "Link",
@@ -50,14 +58,6 @@
"print_hide": 1, "print_hide": 1,
"reqd": 1 "reqd": 1
}, },
{
"fieldname": "company",
"fieldtype": "Link",
"label": "Company",
"options": "Company",
"permlevel": 0,
"reqd": 1
},
{ {
"depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)", "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)",
"fieldname": "expense_account", "fieldname": "expense_account",
@@ -118,7 +118,7 @@
"idx": 1, "idx": 1,
"is_submittable": 1, "is_submittable": 1,
"max_attachments": 1, "max_attachments": 1,
"modified": "2014-05-26 03:05:54.024413", "modified": "2014-10-08 12:47:52.102135",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Stock", "module": "Stock",
"name": "Stock Reconciliation", "name": "Stock Reconciliation",

View File

@@ -2,6 +2,7 @@
// License: GNU General Public License v3. See license.txt // License: GNU General Public License v3. See license.txt
frappe.provide("erpnext.support"); frappe.provide("erpnext.support");
frappe.require("assets/erpnext/js/utils.js");
frappe.ui.form.on_change("Customer Issue", "customer", function(frm) { frappe.ui.form.on_change("Customer Issue", "customer", function(frm) {
erpnext.utils.get_party_details(frm) }); erpnext.utils.get_party_details(frm) });
@@ -89,3 +90,11 @@ cur_frm.fields_dict['item_code'].get_query = function(doc, cdt, cdn) {
cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) { cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) {
return{ query: "erpnext.controllers.queries.customer_query" } } return{ query: "erpnext.controllers.queries.customer_query" } }
cur_frm.cscript.company = function(doc, cdt, cdn) {
erpnext.get_fiscal_year(doc.company, doc.complaint_date);
}
cur_frm.cscript.complaint_date = function(doc, cdt, cdn){
erpnext.get_fiscal_year(doc.company, doc.complaint_date);
}

View File

@@ -2,6 +2,7 @@
// License: GNU General Public License v3. See license.txt // License: GNU General Public License v3. See license.txt
frappe.provide("erpnext.support"); frappe.provide("erpnext.support");
frappe.require("assets/erpnext/js/utils.js");
frappe.ui.form.on_change("Maintenance Visit", "customer", function(frm) { frappe.ui.form.on_change("Maintenance Visit", "customer", function(frm) {
erpnext.utils.get_party_details(frm) }); erpnext.utils.get_party_details(frm) });
@@ -92,3 +93,11 @@ cur_frm.cscript.item_code = function(doc, cdt, cdn) {
cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) { cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) {
return {query: "erpnext.controllers.queries.customer_query" } return {query: "erpnext.controllers.queries.customer_query" }
} }
cur_frm.cscript.company = function(doc, cdt, cdn) {
erpnext.get_fiscal_year(doc.company, doc.mntc_date);
}
cur_frm.cscript.mntc_date = function(doc, cdt, cdn){
erpnext.get_fiscal_year(doc.company, doc.mntc_date);
}