Merge pull request #2252 from neilLasrado/fiscal-year-v5
Fiscal year autofetch added
This commit is contained in:
commit
4972a3fb2e
@ -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: {
|
||||||
@ -23,3 +25,11 @@ 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);
|
||||||
|
}
|
@ -39,23 +39,17 @@
|
|||||||
"reqd": 1
|
"reqd": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"default": "No",
|
"fieldname": "fiscal_year_companies",
|
||||||
"description": "Entries are not allowed against this Fiscal Year if the year is closed.",
|
"fieldtype": "Table",
|
||||||
"fieldname": "is_fiscal_year_closed",
|
"label": "Fiscal Year Companies",
|
||||||
"fieldtype": "Select",
|
"options": "Fiscal Year Company",
|
||||||
"in_list_view": 1,
|
|
||||||
"label": "Year Closed",
|
|
||||||
"no_copy": 1,
|
|
||||||
"oldfieldname": "is_fiscal_year_closed",
|
|
||||||
"oldfieldtype": "Select",
|
|
||||||
"options": "\nNo\nYes",
|
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"reqd": 0
|
"precision": ""
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"icon": "icon-calendar",
|
"icon": "icon-calendar",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"modified": "2014-07-14 05:30:56.843180",
|
"modified": "2014-10-07 12:23:41.679419",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Fiscal Year",
|
"name": "Fiscal Year",
|
||||||
|
@ -0,0 +1,51 @@
|
|||||||
|
{
|
||||||
|
"allow_copy": 0,
|
||||||
|
"allow_import": 0,
|
||||||
|
"allow_rename": 0,
|
||||||
|
"creation": "2014-10-02 13:35:44.155278",
|
||||||
|
"custom": 0,
|
||||||
|
"docstatus": 0,
|
||||||
|
"doctype": "DocType",
|
||||||
|
"document_type": "Master",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"fieldname": "company",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"hidden": 0,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_list_view": 1,
|
||||||
|
"label": "Company",
|
||||||
|
"no_copy": 0,
|
||||||
|
"options": "Company",
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"unique": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"hide_heading": 0,
|
||||||
|
"hide_toolbar": 0,
|
||||||
|
"in_create": 0,
|
||||||
|
"in_dialog": 0,
|
||||||
|
"is_submittable": 0,
|
||||||
|
"issingle": 0,
|
||||||
|
"istable": 1,
|
||||||
|
"modified": "2014-10-02 13:35:44.155278",
|
||||||
|
"modified_by": "Administrator",
|
||||||
|
"module": "Accounts",
|
||||||
|
"name": "Fiscal Year Company",
|
||||||
|
"name_case": "",
|
||||||
|
"owner": "Administrator",
|
||||||
|
"permissions": [],
|
||||||
|
"read_only": 0,
|
||||||
|
"read_only_onload": 0,
|
||||||
|
"sort_field": "modified",
|
||||||
|
"sort_order": "DESC"
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and contributors
|
||||||
|
# For license information, please see license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
import frappe
|
||||||
|
from frappe.model.document import Document
|
||||||
|
|
||||||
|
class FiscalYearCompany(Document):
|
||||||
|
pass
|
@ -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.accounts");
|
frappe.provide("erpnext.accounts");
|
||||||
|
frappe.require("assets/erpnext/js/utils.js");
|
||||||
|
|
||||||
erpnext.accounts.JournalVoucher = frappe.ui.form.Controller.extend({
|
erpnext.accounts.JournalVoucher = frappe.ui.form.Controller.extend({
|
||||||
onload: function() {
|
onload: function() {
|
||||||
@ -153,6 +154,11 @@ cur_frm.cscript.refresh = function(doc) {
|
|||||||
|
|
||||||
cur_frm.cscript.company = function(doc, cdt, cdn) {
|
cur_frm.cscript.company = function(doc, cdt, cdn) {
|
||||||
cur_frm.refresh_fields();
|
cur_frm.refresh_fields();
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.cscript.is_opening = function(doc, cdt, cdn) {
|
cur_frm.cscript.is_opening = function(doc, cdt, cdn) {
|
||||||
|
@ -388,20 +388,6 @@
|
|||||||
"read_only": 1,
|
"read_only": 1,
|
||||||
"report_hide": 1
|
"report_hide": 1
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"fieldname": "fiscal_year",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"in_filter": 1,
|
|
||||||
"label": "Fiscal Year",
|
|
||||||
"oldfieldname": "fiscal_year",
|
|
||||||
"oldfieldtype": "Select",
|
|
||||||
"options": "Fiscal Year",
|
|
||||||
"permlevel": 0,
|
|
||||||
"print_hide": 1,
|
|
||||||
"read_only": 0,
|
|
||||||
"reqd": 1,
|
|
||||||
"search_index": 1
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"fieldname": "company",
|
"fieldname": "company",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
@ -416,6 +402,20 @@
|
|||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"search_index": 1
|
"search_index": 1
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "fiscal_year",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"in_filter": 1,
|
||||||
|
"label": "Fiscal Year",
|
||||||
|
"oldfieldname": "fiscal_year",
|
||||||
|
"oldfieldtype": "Select",
|
||||||
|
"options": "Fiscal Year",
|
||||||
|
"permlevel": 0,
|
||||||
|
"print_hide": 1,
|
||||||
|
"read_only": 0,
|
||||||
|
"reqd": 1,
|
||||||
|
"search_index": 1
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 1,
|
"allow_on_submit": 1,
|
||||||
"fieldname": "select_print_heading",
|
"fieldname": "select_print_heading",
|
||||||
@ -447,7 +447,7 @@
|
|||||||
"icon": "icon-file-text",
|
"icon": "icon-file-text",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"modified": "2014-09-09 05:35:31.217863",
|
"modified": "2014-10-02 14:51:20.624847",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Journal Voucher",
|
"name": "Journal Voucher",
|
||||||
|
@ -12,26 +12,29 @@ import frappe.desk.reportview
|
|||||||
class FiscalYearError(frappe.ValidationError): pass
|
class FiscalYearError(frappe.ValidationError): pass
|
||||||
class BudgetError(frappe.ValidationError): pass
|
class BudgetError(frappe.ValidationError): pass
|
||||||
|
|
||||||
|
@frappe.whitelist()
|
||||||
|
def get_fiscal_year(date=None, fiscal_year=None, label="Date", verbose=1, company=None):
|
||||||
|
return get_fiscal_years(date, fiscal_year, label, verbose, company)[0]
|
||||||
|
|
||||||
def get_fiscal_year(date=None, fiscal_year=None, label="Date", verbose=1):
|
def get_fiscal_years(date=None, fiscal_year=None, label="Date", verbose=1, company=None):
|
||||||
return get_fiscal_years(date, fiscal_year, label, verbose)[0]
|
|
||||||
|
|
||||||
def get_fiscal_years(date=None, fiscal_year=None, label="Date", verbose=1):
|
|
||||||
# if year start date is 2012-04-01, year end date should be 2013-03-31 (hence subdate)
|
# if year start date is 2012-04-01, year end date should be 2013-03-31 (hence subdate)
|
||||||
cond = ""
|
cond = ""
|
||||||
if fiscal_year:
|
if fiscal_year:
|
||||||
cond = "name = '%s'" % fiscal_year.replace("'", "\'")
|
cond = "name = '%s'" % fiscal_year.replace("'", "\'")
|
||||||
|
elif company:
|
||||||
|
cond = """('%s' in (select company from `tabFiscal Year Company`
|
||||||
|
where `tabFiscal Year Company`.parent = `tabFiscal Year`.name))
|
||||||
|
and '%s' >= year_start_date and '%s' <= year_end_date """ %(company.replace("'", "\'"), date, date)
|
||||||
else:
|
else:
|
||||||
cond = "'%s' >= year_start_date and '%s' <= year_end_date" % \
|
cond = "'%s' >= year_start_date and '%s' <= year_end_date" %(date, date)
|
||||||
(date, date)
|
|
||||||
fy = frappe.db.sql("""select name, year_start_date, year_end_date
|
fy = frappe.db.sql("""select name, year_start_date, year_end_date
|
||||||
from `tabFiscal Year` where %s order by year_start_date desc""" % cond)
|
from `tabFiscal Year` where %s order by year_start_date desc""" % cond)
|
||||||
|
|
||||||
if not fy:
|
if not fy:
|
||||||
error_msg = _("""{0} {1} not in any Fiscal Year""").format(label, formatdate(date))
|
error_msg = _("""{0} {1} not in any Fiscal Year""").format(label, formatdate(date))
|
||||||
if verbose: frappe.msgprint(error_msg)
|
if verbose==1: frappe.msgprint(error_msg)
|
||||||
raise FiscalYearError, error_msg
|
raise FiscalYearError, error_msg
|
||||||
|
|
||||||
return fy
|
return fy
|
||||||
|
|
||||||
def validate_fiscal_year(date, fiscal_year, label="Date"):
|
def validate_fiscal_year(date, fiscal_year, label="Date"):
|
||||||
|
@ -210,4 +210,3 @@ cur_frm.cscript.send_sms = function() {
|
|||||||
frappe.require("assets/erpnext/js/sms_manager.js");
|
frappe.require("assets/erpnext/js/sms_manager.js");
|
||||||
var sms_man = new SMSManager(cur_frm.doc);
|
var sms_man = new SMSManager(cur_frm.doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,6 +89,16 @@
|
|||||||
"options": "Simple",
|
"options": "Simple",
|
||||||
"permlevel": 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "posting_date",
|
||||||
|
"fieldtype": "Date",
|
||||||
|
"in_filter": 1,
|
||||||
|
"label": "Posting Date",
|
||||||
|
"oldfieldname": "posting_date",
|
||||||
|
"oldfieldtype": "Date",
|
||||||
|
"permlevel": 0,
|
||||||
|
"reqd": 1
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "employee",
|
"fieldname": "employee",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
@ -114,17 +124,6 @@
|
|||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
"width": "150px"
|
"width": "150px"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"fieldname": "fiscal_year",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"in_filter": 1,
|
|
||||||
"label": "Fiscal Year",
|
|
||||||
"oldfieldname": "fiscal_year",
|
|
||||||
"oldfieldtype": "Select",
|
|
||||||
"options": "Fiscal Year",
|
|
||||||
"permlevel": 0,
|
|
||||||
"reqd": 1
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"fieldname": "company",
|
"fieldname": "company",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
@ -136,21 +135,22 @@
|
|||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"reqd": 1
|
"reqd": 1
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "fiscal_year",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"in_filter": 1,
|
||||||
|
"label": "Fiscal Year",
|
||||||
|
"oldfieldname": "fiscal_year",
|
||||||
|
"oldfieldtype": "Select",
|
||||||
|
"options": "Fiscal Year",
|
||||||
|
"permlevel": 0,
|
||||||
|
"reqd": 1
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "cb1",
|
"fieldname": "cb1",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"permlevel": 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"fieldname": "posting_date",
|
|
||||||
"fieldtype": "Date",
|
|
||||||
"in_filter": 1,
|
|
||||||
"label": "Posting Date",
|
|
||||||
"oldfieldname": "posting_date",
|
|
||||||
"oldfieldtype": "Date",
|
|
||||||
"permlevel": 0,
|
|
||||||
"reqd": 1
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"fieldname": "remark",
|
"fieldname": "remark",
|
||||||
@ -190,7 +190,7 @@
|
|||||||
"icon": "icon-money",
|
"icon": "icon-money",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"modified": "2014-08-27 07:08:48.454580",
|
"modified": "2014-10-07 18:22:14.689567",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "HR",
|
"module": "HR",
|
||||||
"name": "Expense Claim",
|
"name": "Expense Claim",
|
||||||
@ -206,7 +206,6 @@
|
|||||||
"read": 1,
|
"read": 1,
|
||||||
"report": 1,
|
"report": 1,
|
||||||
"role": "Employee",
|
"role": "Employee",
|
||||||
"user_permission_doctypes": "[\"Company\",\"Employee\",\"Expense Claim\",\"Fiscal Year\"]",
|
|
||||||
"write": 1
|
"write": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -222,7 +221,6 @@
|
|||||||
"report": 1,
|
"report": 1,
|
||||||
"role": "Expense Approver",
|
"role": "Expense Approver",
|
||||||
"submit": 1,
|
"submit": 1,
|
||||||
"user_permission_doctypes": "[\"Expense Claim\",\"User\"]",
|
|
||||||
"write": 1
|
"write": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -238,7 +236,6 @@
|
|||||||
"report": 1,
|
"report": 1,
|
||||||
"role": "HR User",
|
"role": "HR User",
|
||||||
"submit": 1,
|
"submit": 1,
|
||||||
"user_permission_doctypes": "[\"Company\",\"Expense Claim\",\"Fiscal Year\"]",
|
|
||||||
"write": 1
|
"write": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
frappe.provide("erpnext");
|
frappe.provide("erpnext");
|
||||||
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");
|
||||||
|
|
||||||
|
|
||||||
erpnext.TransactionController = erpnext.stock.StockController.extend({
|
erpnext.TransactionController = erpnext.stock.StockController.extend({
|
||||||
onload: function() {
|
onload: function() {
|
||||||
@ -205,22 +207,37 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
company: function() {
|
company: function() {
|
||||||
if(this.frm.doc.company && this.frm.fields_dict.currency) {
|
var me = this;
|
||||||
var company_currency = this.get_company_currency();
|
var fn = function() {
|
||||||
if (!this.frm.doc.currency) {
|
if(me.frm.doc.company && me.frm.fields_dict.currency) {
|
||||||
this.frm.set_value("currency", company_currency);
|
var company_currency = me.get_company_currency();
|
||||||
|
if (!me.frm.doc.currency) {
|
||||||
|
me.frm.set_value("currency", company_currency);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.frm.doc.currency == company_currency) {
|
if (me.frm.doc.currency == company_currency) {
|
||||||
this.frm.set_value("conversion_rate", 1.0);
|
me.frm.set_value("conversion_rate", 1.0);
|
||||||
}
|
}
|
||||||
if (this.frm.doc.price_list_currency == company_currency) {
|
if (me.frm.doc.price_list_currency == company_currency) {
|
||||||
this.frm.set_value('plc_conversion_rate', 1.0);
|
me.frm.set_value('plc_conversion_rate', 1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.frm.script_manager.trigger("currency");
|
me.frm.script_manager.trigger("currency");
|
||||||
this.apply_pricing_rule();
|
me.apply_pricing_rule();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.frm.doc.posting_date) var date = this.frm.doc.posting_date;
|
||||||
|
else var date = this.frm.doc.transaction_date;
|
||||||
|
erpnext.get_fiscal_year(this.frm.doc.company, date, fn);
|
||||||
|
},
|
||||||
|
|
||||||
|
transaction_date: function() {
|
||||||
|
erpnext.get_fiscal_year(this.frm.doc.company, this.frm.doc.transaction_date);
|
||||||
|
},
|
||||||
|
|
||||||
|
posting_date: function() {
|
||||||
|
erpnext.get_fiscal_year(this.frm.doc.company, this.frm.doc.posting_date);
|
||||||
},
|
},
|
||||||
|
|
||||||
get_company_currency: function() {
|
get_company_currency: function() {
|
||||||
|
@ -12,6 +12,22 @@ $.extend(erpnext, {
|
|||||||
return frappe.boot.sysdefaults.currency;
|
return frappe.boot.sysdefaults.currency;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
get_fiscal_year: function(company, date, fn) {
|
||||||
|
frappe.call({
|
||||||
|
type:"GET",
|
||||||
|
method: "erpnext.accounts.utils.get_fiscal_year",
|
||||||
|
args: {
|
||||||
|
"company": company,
|
||||||
|
"date": date,
|
||||||
|
"verbose": '0'
|
||||||
|
},
|
||||||
|
callback: function(r) {
|
||||||
|
if (r.message) cur_frm.set_value("fiscal_year", r.message[0]);
|
||||||
|
if (fn) fn();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
toggle_naming_series: function() {
|
toggle_naming_series: function() {
|
||||||
if(cur_frm.fields_dict.naming_series) {
|
if(cur_frm.fields_dict.naming_series) {
|
||||||
cur_frm.toggle_display("naming_series", cur_frm.doc.__islocal?true:false);
|
cur_frm.toggle_display("naming_series", cur_frm.doc.__islocal?true:false);
|
||||||
|
@ -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);
|
||||||
|
}
|
@ -8,6 +8,7 @@ frappe.ui.form.on_change("Opportunity", "contact_person", erpnext.utils.get_cont
|
|||||||
|
|
||||||
|
|
||||||
frappe.provide("erpnext.selling");
|
frappe.provide("erpnext.selling");
|
||||||
|
frappe.require("assets/erpnext/js/utils.js");
|
||||||
cur_frm.email_field = "contact_email";
|
cur_frm.email_field = "contact_email";
|
||||||
|
|
||||||
// TODO commonify this code
|
// TODO commonify this code
|
||||||
@ -145,3 +146,10 @@ cur_frm.cscript.send_sms = function() {
|
|||||||
var sms_man = new SMSManager(cur_frm.doc);
|
var sms_man = new SMSManager(cur_frm.doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cur_frm.cscript.company = function(doc, cdt, cdn) {
|
||||||
|
erpnext.get_fiscal_year(doc.company, doc.transaction_date);
|
||||||
|
}
|
||||||
|
|
||||||
|
cur_frm.cscript.transaction_date = function(doc, cdt, cdn){
|
||||||
|
erpnext.get_fiscal_year(doc.company, doc.transaction_date);
|
||||||
|
}
|
@ -272,13 +272,13 @@
|
|||||||
"width": "50px"
|
"width": "50px"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "fiscal_year",
|
"fieldname": "company",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"in_filter": 1,
|
"in_filter": 1,
|
||||||
"label": "Fiscal Year",
|
"label": "Company",
|
||||||
"oldfieldname": "fiscal_year",
|
"oldfieldname": "company",
|
||||||
"oldfieldtype": "Select",
|
"oldfieldtype": "Link",
|
||||||
"options": "Fiscal Year",
|
"options": "Company",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
@ -307,13 +307,13 @@
|
|||||||
"read_only": 0
|
"read_only": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "company",
|
"fieldname": "fiscal_year",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"in_filter": 1,
|
"in_filter": 1,
|
||||||
"label": "Company",
|
"label": "Fiscal Year",
|
||||||
"oldfieldname": "company",
|
"oldfieldname": "fiscal_year",
|
||||||
"oldfieldtype": "Link",
|
"oldfieldtype": "Select",
|
||||||
"options": "Company",
|
"options": "Fiscal Year",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
@ -388,7 +388,7 @@
|
|||||||
"icon": "icon-info-sign",
|
"icon": "icon-info-sign",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"modified": "2014-09-11 18:53:14.037512",
|
"modified": "2014-10-07 18:12:19.104820",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Selling",
|
"module": "Selling",
|
||||||
"name": "Opportunity",
|
"name": "Opportunity",
|
||||||
@ -396,6 +396,7 @@
|
|||||||
"permissions": [
|
"permissions": [
|
||||||
{
|
{
|
||||||
"amend": 1,
|
"amend": 1,
|
||||||
|
"apply_user_permissions": 1,
|
||||||
"cancel": 1,
|
"cancel": 1,
|
||||||
"create": 1,
|
"create": 1,
|
||||||
"delete": 1,
|
"delete": 1,
|
||||||
|
@ -170,4 +170,3 @@ cur_frm.cscript.send_sms = function() {
|
|||||||
frappe.require("assets/erpnext/js/sms_manager.js");
|
frappe.require("assets/erpnext/js/sms_manager.js");
|
||||||
var sms_man = new SMSManager(cur_frm.doc);
|
var sms_man = new SMSManager(cur_frm.doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,8 @@ cur_frm.cscript.fname = "indent_details";
|
|||||||
|
|
||||||
{% include 'buying/doctype/purchase_common/purchase_common.js' %};
|
{% include 'buying/doctype/purchase_common/purchase_common.js' %};
|
||||||
|
|
||||||
|
frappe.require("assets/erpnext/js/utils.js");
|
||||||
|
|
||||||
erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.extend({
|
erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.extend({
|
||||||
onload: function(doc) {
|
onload: function(doc) {
|
||||||
this._super();
|
this._super();
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt
|
||||||
// License: GNU General Public License v3. See license.txt
|
|
||||||
|
|
||||||
cur_frm.cscript.tname = "Stock Entry Detail";
|
cur_frm.cscript.tname = "Stock Entry Detail";
|
||||||
cur_frm.cscript.fname = "mtn_details";
|
cur_frm.cscript.fname = "mtn_details";
|
||||||
|
|
||||||
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.StockEntry = erpnext.stock.StockController.extend({
|
erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
|
||||||
@ -463,3 +463,11 @@ cur_frm.fields_dict.supplier.get_query = function(doc, cdt, cdn) {
|
|||||||
}
|
}
|
||||||
cur_frm.add_fetch('production_order', 'total_fixed_cost', 'total_fixed_cost');
|
cur_frm.add_fetch('production_order', 'total_fixed_cost', 'total_fixed_cost');
|
||||||
cur_frm.add_fetch('bom_no', 'total_fixed_cost', 'total_fixed_cost');
|
cur_frm.add_fetch('bom_no', 'total_fixed_cost', 'total_fixed_cost');
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
@ -509,17 +509,6 @@
|
|||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"read_only": 1
|
"read_only": 1
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"fieldname": "fiscal_year",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"in_filter": 0,
|
|
||||||
"label": "Fiscal Year",
|
|
||||||
"options": "Fiscal Year",
|
|
||||||
"permlevel": 0,
|
|
||||||
"print_hide": 1,
|
|
||||||
"read_only": 0,
|
|
||||||
"reqd": 1
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"fieldname": "company",
|
"fieldname": "company",
|
||||||
@ -538,6 +527,17 @@
|
|||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"search_index": 0
|
"search_index": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "fiscal_year",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"in_filter": 0,
|
||||||
|
"label": "Fiscal Year",
|
||||||
|
"options": "Fiscal Year",
|
||||||
|
"permlevel": 0,
|
||||||
|
"print_hide": 1,
|
||||||
|
"read_only": 0,
|
||||||
|
"reqd": 1
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 1,
|
"allow_on_submit": 1,
|
||||||
"fieldname": "select_print_heading",
|
"fieldname": "select_print_heading",
|
||||||
@ -585,7 +585,7 @@
|
|||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2014-09-16 15:56:37.514676",
|
"modified": "2014-10-03 14:55:44.916658",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Stock Entry",
|
"name": "Stock Entry",
|
||||||
|
@ -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);
|
||||||
|
}
|
@ -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",
|
||||||
|
@ -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);
|
||||||
|
}
|
@ -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);
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user