mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-20 13:39:18 +00:00
Fixed issues
This commit is contained in:
@@ -39,9 +39,9 @@
|
|||||||
"reqd": 1
|
"reqd": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "company",
|
"fieldname": "fiscal_year_companies",
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
"label": "List of Companies",
|
"label": "Fiscal Year Companies",
|
||||||
"options": "Fiscal Year Company",
|
"options": "Fiscal Year Company",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"precision": ""
|
"precision": ""
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
],
|
],
|
||||||
"icon": "icon-calendar",
|
"icon": "icon-calendar",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"modified": "2014-10-02 13:40:40.298965",
|
"modified": "2014-10-07 12:23:41.679419",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Fiscal Year",
|
"name": "Fiscal Year",
|
||||||
|
|||||||
@@ -154,11 +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);
|
erpnext.get_fiscal_year(doc.company, doc.posting_date);
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.cscript.posting_date = function(doc, cdt, cdn){
|
cur_frm.cscript.posting_date = function(doc, cdt, cdn){
|
||||||
erpnext.get_fiscal_year(doc);
|
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) {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ def get_fiscal_years(date=None, fiscal_year=None, label="Date", verbose=1, compa
|
|||||||
elif company:
|
elif company:
|
||||||
cond = """('%s' in (select company from `tabFiscal Year Company`
|
cond = """('%s' in (select company from `tabFiscal Year Company`
|
||||||
where `tabFiscal Year Company`.parent = `tabFiscal Year`.name))
|
where `tabFiscal Year Company`.parent = `tabFiscal Year`.name))
|
||||||
and '%s' >= year_start_date and '%s' <= year_end_date """ %(company, date, date)
|
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" %(date, date)
|
cond = "'%s' >= year_start_date and '%s' <= year_end_date" %(date, 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.buying");
|
frappe.provide("erpnext.buying");
|
||||||
|
frappe.require("assets/erpnext/js/utils.js");
|
||||||
|
|
||||||
cur_frm.cscript.tname = "Purchase Order Item";
|
cur_frm.cscript.tname = "Purchase Order Item";
|
||||||
cur_frm.cscript.fname = "po_details";
|
cur_frm.cscript.fname = "po_details";
|
||||||
@@ -212,25 +213,9 @@ cur_frm.cscript.send_sms = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.cscript.company = function(doc, cdt, cdn) {
|
cur_frm.cscript.company = function(doc, cdt, cdn) {
|
||||||
get_fiscal_year(doc);
|
erpnext.get_fiscal_year(doc.company, doc.transaction_date);
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.cscript.transaction_date = function(doc, cdt, cdn){
|
cur_frm.cscript.transaction_date = function(doc, cdt, cdn){
|
||||||
get_fiscal_year(doc);
|
erpnext.get_fiscal_year(doc.company, doc.transaction_date);
|
||||||
}
|
|
||||||
|
|
||||||
function get_fiscal_year(doc) {
|
|
||||||
frappe.call({
|
|
||||||
type:"GET",
|
|
||||||
method: "erpnext.accounts.utils.get_fiscal_year",
|
|
||||||
args: {
|
|
||||||
"company": doc.company,
|
|
||||||
"date": doc.transaction_date,
|
|
||||||
"verbose": '0'
|
|
||||||
},
|
|
||||||
callback: function(r) {
|
|
||||||
var arr = r.message
|
|
||||||
if (arr != null) cur_frm.set_value("fiscal_year",arr[0]);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
@@ -12,13 +12,13 @@ $.extend(erpnext, {
|
|||||||
return frappe.boot.sysdefaults.currency;
|
return frappe.boot.sysdefaults.currency;
|
||||||
},
|
},
|
||||||
|
|
||||||
get_fiscal_year: function(doc) {
|
get_fiscal_year: function(company, date) {
|
||||||
frappe.call({
|
frappe.call({
|
||||||
type:"GET",
|
type:"GET",
|
||||||
method: "erpnext.accounts.utils.get_fiscal_year",
|
method: "erpnext.accounts.utils.get_fiscal_year",
|
||||||
args: {
|
args: {
|
||||||
"company": doc.company,
|
"company": company,
|
||||||
"date": doc.posting_date,
|
"date": date,
|
||||||
"verbose": '0'
|
"verbose": '0'
|
||||||
},
|
},
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
|
|||||||
@@ -199,3 +199,11 @@ 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);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
@@ -465,9 +465,9 @@ 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) {
|
cur_frm.cscript.company = function(doc, cdt, cdn) {
|
||||||
erpnext.get_fiscal_year(doc);
|
erpnext.get_fiscal_year(doc.company, doc.posting_date);
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.cscript.posting_date = function(doc, cdt, cdn){
|
cur_frm.cscript.posting_date = function(doc, cdt, cdn){
|
||||||
erpnext.get_fiscal_year(doc);
|
erpnext.get_fiscal_year(doc.company, doc.posting_date);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user