commit
57fb74f262
@ -95,11 +95,11 @@ cur_frm.cscript.refresh = function(doc,cdt,cdn){
|
|||||||
if(doc.docstatus==0 && doc.exp_approver==user && doc.approval_status=="Approved")
|
if(doc.docstatus==0 && doc.exp_approver==user && doc.approval_status=="Approved")
|
||||||
cur_frm.savesubmit();
|
cur_frm.savesubmit();
|
||||||
|
|
||||||
if(doc.docstatus==1 && frappe.model.can_create("Journal Entry") &&
|
if(doc.docstatus==1 && frappe.model.can_create("Journal Entry") && doc.approval_status=="Approved" &&
|
||||||
cint(doc.total_amount_reimbursed) < cint(doc.total_sanctioned_amount))
|
cint(doc.total_amount_reimbursed) < cint(doc.total_sanctioned_amount))
|
||||||
cur_frm.add_custom_button(__("Bank Entry"),
|
cur_frm.add_custom_button(__("Bank Entry"),
|
||||||
cur_frm.cscript.make_bank_entry, __("Make"));
|
cur_frm.cscript.make_bank_entry, __("Make"));
|
||||||
cur_frm.page.set_inner_btn_group_as_primary(__("Make"));
|
cur_frm.page.set_inner_btn_group_as_primary(__("Make"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -243,7 +243,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
|
|
||||||
company: function() {
|
company: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
var fn = function() {
|
var set_pricing = function() {
|
||||||
if(me.frm.doc.company && me.frm.fields_dict.currency) {
|
if(me.frm.doc.company && me.frm.fields_dict.currency) {
|
||||||
var company_currency = me.get_company_currency();
|
var company_currency = me.get_company_currency();
|
||||||
var company_doc = frappe.get_doc(":Company", me.frm.doc.company);
|
var company_doc = frappe.get_doc(":Company", me.frm.doc.company);
|
||||||
@ -270,10 +270,40 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
me.apply_pricing_rule();
|
me.apply_pricing_rule();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var set_party_account = function(set_pricing) {
|
||||||
|
if (in_list(["Sales Invoice", "Purchase Invoice"], me.frm.doc.doctype)) {
|
||||||
|
if(me.frm.doc.doctype=="Sales Invoice") {
|
||||||
|
var party_type = "Customer";
|
||||||
|
var party_account_field = 'debit_to';
|
||||||
|
} else {
|
||||||
|
var party_type = "Supplier";
|
||||||
|
var party_account_field = 'credit_to';
|
||||||
|
}
|
||||||
|
|
||||||
|
return frappe.call({
|
||||||
|
method: "erpnext.accounts.party.get_party_account",
|
||||||
|
args: {
|
||||||
|
company: me.frm.doc.company,
|
||||||
|
party_type: party_type,
|
||||||
|
party: me.frm.doc[frappe.model.scrub(party_type)]
|
||||||
|
},
|
||||||
|
callback: function(r) {
|
||||||
|
if(!r.exc && r.message) {
|
||||||
|
me.frm.set_value(party_account_field, r.message);
|
||||||
|
set_pricing();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
set_pricing();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if (this.frm.doc.posting_date) var date = this.frm.doc.posting_date;
|
if (this.frm.doc.posting_date) var date = this.frm.doc.posting_date;
|
||||||
else var date = this.frm.doc.transaction_date;
|
else var date = this.frm.doc.transaction_date;
|
||||||
erpnext.get_fiscal_year(this.frm.doc.company, date, fn);
|
erpnext.get_fiscal_year(this.frm.doc.company, date, function() { set_party_account(set_pricing); });
|
||||||
|
|
||||||
if(this.frm.doc.company) {
|
if(this.frm.doc.company) {
|
||||||
erpnext.last_selected_company = this.frm.doc.company;
|
erpnext.last_selected_company = this.frm.doc.company;
|
||||||
|
@ -27,12 +27,6 @@ cur_frm.fields_dict['parent_sales_person'].get_query = function(doc, cdt, cdn) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.fields_dict['targets'].grid.get_field("item_group").get_query = function(doc, cdt, cdn) {
|
|
||||||
return {
|
|
||||||
filters: { 'is_group': "No" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cur_frm.fields_dict.employee.get_query = function(doc, cdt, cdn) {
|
cur_frm.fields_dict.employee.get_query = function(doc, cdt, cdn) {
|
||||||
return { query: "erpnext.controllers.queries.employee_query" }
|
return { query: "erpnext.controllers.queries.employee_query" }
|
||||||
}
|
}
|
||||||
|
@ -25,12 +25,4 @@ cur_frm.fields_dict['parent_territory'].get_query = function(doc,cdt,cdn) {
|
|||||||
['Territory', 'name', '!=', doc.territory_name]
|
['Territory', 'name', '!=', doc.territory_name]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ******************** ITEM Group ********************************
|
|
||||||
cur_frm.fields_dict['targets'].grid.get_field("item_group").get_query = function(doc, cdt, cdn) {
|
|
||||||
return{
|
|
||||||
filters:{ 'is_group': "No"}
|
|
||||||
}
|
|
||||||
}
|
|
@ -35,11 +35,25 @@ def execute(filters=None):
|
|||||||
def get_columns(filters):
|
def get_columns(filters):
|
||||||
"""return columns based on filters"""
|
"""return columns based on filters"""
|
||||||
|
|
||||||
columns = ["Item:Link/Item:100", "Item Name::150", "Item Group::100", "Brand::90", \
|
columns = [
|
||||||
"Description::140", "Warehouse:Link/Warehouse:100", "Stock UOM:Link/UOM:90", "Opening Qty:Float:100", \
|
_("Item")+":Link/Item:100",
|
||||||
"Opening Value:Float:110", "In Qty:Float:80", "In Value:Float:80", "Out Qty:Float:80", \
|
_("Item Name")+"::150",
|
||||||
"Out Value:Float:80", "Balance Qty:Float:100", "Balance Value:Float:100", \
|
_("Item Group")+"::100",
|
||||||
"Valuation Rate:Float:90", "Company:Link/Company:100"]
|
_("Brand")+"::90",
|
||||||
|
_("Description")+"::140",
|
||||||
|
_("Warehouse")+":Link/Warehouse:100",
|
||||||
|
_("Stock UOM")+":Link/UOM:90",
|
||||||
|
_("Opening Qty")+":Float:100",
|
||||||
|
_("Opening Value")+":Float:110",
|
||||||
|
_("In Qty")+":Float:80",
|
||||||
|
_("In Value")+":Float:80",
|
||||||
|
_("Out Qty")+":Float:80",
|
||||||
|
_("Out Value")+":Float:80",
|
||||||
|
_("Balance Qty")+":Float:100",
|
||||||
|
_("Balance Value")+":Float:100",
|
||||||
|
_("Valuation Rate")+":Float:90",
|
||||||
|
_("Company")+":Link/Company:100"
|
||||||
|
]
|
||||||
|
|
||||||
return columns
|
return columns
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user