Merge branch 'master' of github.com:webnotes/erpnext
This commit is contained in:
commit
c97fe01837
@ -60,17 +60,6 @@ cur_frm.fields_dict['cost_center'].get_query = function(doc,cdt,cdn) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//get query select Territory
|
|
||||||
//=================================================================
|
|
||||||
cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) {
|
|
||||||
return{
|
|
||||||
filters:{
|
|
||||||
'is_group': "No"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ------------------ Get Print Heading ------------------------------------
|
// ------------------ Get Print Heading ------------------------------------
|
||||||
cur_frm.fields_dict['select_print_heading'].get_query = function(doc, cdt, cdn) {
|
cur_frm.fields_dict['select_print_heading'].get_query = function(doc, cdt, cdn) {
|
||||||
return{
|
return{
|
||||||
|
|||||||
@ -283,14 +283,6 @@ cur_frm.fields_dict['project_name'].get_query = function(doc, cdt, cdn) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Territory
|
|
||||||
//-----------------------------
|
|
||||||
cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) {
|
|
||||||
return{
|
|
||||||
filters: {'is_group': 'NO'}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Income Account in Details Table
|
// Income Account in Details Table
|
||||||
// --------------------------------
|
// --------------------------------
|
||||||
cur_frm.set_query("income_account", "entries", function(doc) {
|
cur_frm.set_query("income_account", "entries", function(doc) {
|
||||||
|
|||||||
@ -14,10 +14,46 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
wn.provide("erpnext.hr");
|
||||||
|
|
||||||
|
erpnext.hr.ExpenseClaimController = wn.ui.form.Controller.extend({
|
||||||
|
make_bank_voucher: function() {
|
||||||
|
var me = this;
|
||||||
|
wn.call({
|
||||||
|
method: "accounts.doctype.journal_voucher.journal_voucher.get_default_bank_cash_account",
|
||||||
|
args: {
|
||||||
|
"company": cur_frm.doc.company,
|
||||||
|
"voucher_type": "Bank Voucher"
|
||||||
|
},
|
||||||
|
callback: function(r) {
|
||||||
|
var jv = wn.model.make_new_doc_and_get_name('Journal Voucher');
|
||||||
|
jv = locals['Journal Voucher'][jv];
|
||||||
|
jv.voucher_type = 'Bank Voucher';
|
||||||
|
jv.company = cur_frm.doc.company;
|
||||||
|
jv.remark = 'Payment against Expense Claim: ' + cur_frm.doc.name;
|
||||||
|
jv.fiscal_year = cur_frm.doc.fiscal_year;
|
||||||
|
|
||||||
|
var d1 = wn.model.add_child(jv, 'Journal Voucher Detail', 'entries');
|
||||||
|
d1.debit = cur_frm.doc.total_sanctioned_amount;
|
||||||
|
|
||||||
|
// credit to bank
|
||||||
|
var d1 = wn.model.add_child(jv, 'Journal Voucher Detail', 'entries');
|
||||||
|
d1.account = r.message[0].account;
|
||||||
|
d1.credit = cur_frm.doc.total_sanctioned_amount;
|
||||||
|
d1.balance = r.message[0].balance;
|
||||||
|
|
||||||
|
loaddoc('Journal Voucher', jv.name);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
$.extend(cur_frm.cscript, new erpnext.hr.ExpenseClaimController({frm: cur_frm}));
|
||||||
|
|
||||||
cur_frm.add_fetch('employee', 'company', 'company');
|
cur_frm.add_fetch('employee', 'company', 'company');
|
||||||
cur_frm.add_fetch('employee','employee_name','employee_name');
|
cur_frm.add_fetch('employee','employee_name','employee_name');
|
||||||
|
|
||||||
cur_frm.cscript.onload = function(doc,cdt,cdn){
|
cur_frm.cscript.onload = function(doc,cdt,cdn) {
|
||||||
if(!doc.approval_status)
|
if(!doc.approval_status)
|
||||||
cur_frm.set_value("approval_status", "Draft")
|
cur_frm.set_value("approval_status", "Draft")
|
||||||
|
|
||||||
@ -71,15 +107,15 @@ cur_frm.cscript.refresh = function(doc,cdt,cdn){
|
|||||||
} else {
|
} else {
|
||||||
if(doc.approval_status=="Approved") {
|
if(doc.approval_status=="Approved") {
|
||||||
cur_frm.set_intro("Expense Claim has been approved.");
|
cur_frm.set_intro("Expense Claim has been approved.");
|
||||||
|
if(doc.docstatus==0) cur_frm.savesubmit();
|
||||||
|
if(doc.docstatus==1) cur_frm.add_custom_button("Make Bank Voucher",
|
||||||
|
cur_frm.cscript.make_bank_voucher);
|
||||||
} else if(doc.approval_status=="Rejected") {
|
} else if(doc.approval_status=="Rejected") {
|
||||||
cur_frm.set_intro("Expense Claim has been rejected.");
|
cur_frm.set_intro("Expense Claim has been rejected.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if(doc.approval_status=="Approved" && doc.docstatus==0) {
|
|
||||||
cur_frm.savesubmit()
|
|
||||||
}}
|
|
||||||
|
|
||||||
cur_frm.cscript.validate = function(doc) {
|
cur_frm.cscript.validate = function(doc) {
|
||||||
cur_frm.cscript.calculate_total(doc);
|
cur_frm.cscript.calculate_total(doc);
|
||||||
|
|||||||
@ -48,12 +48,6 @@ erpnext.selling.InstallationNote = wn.ui.form.Controller.extend({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.frm.set_query("territory", function() {
|
|
||||||
return {
|
|
||||||
filters: {'is_group': "No" }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.frm.set_query("customer", function() {
|
this.frm.set_query("customer", function() {
|
||||||
return {
|
return {
|
||||||
query: "controllers.queries.customer_query"
|
query: "controllers.queries.customer_query"
|
||||||
|
|||||||
@ -197,12 +197,6 @@ cur_frm.cscript['Unstop Sales Order'] = function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) {
|
|
||||||
return{
|
|
||||||
filters:{ 'is_group': "No"}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
||||||
if(cint(wn.boot.notification_settings.sales_order)) {
|
if(cint(wn.boot.notification_settings.sales_order)) {
|
||||||
cur_frm.email_doc(wn.boot.notification_settings.sales_order_message);
|
cur_frm.email_doc(wn.boot.notification_settings.sales_order_message);
|
||||||
|
|||||||
@ -130,14 +130,6 @@ cur_frm.cscript['Make Packing Slip'] = function() {
|
|||||||
loaddoc('Packing Slip', n);
|
loaddoc('Packing Slip', n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//get query select Territory
|
|
||||||
cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) {
|
|
||||||
return{
|
|
||||||
filters: { 'is_group': "No" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var set_print_hide= function(doc, cdt, cdn){
|
var set_print_hide= function(doc, cdt, cdn){
|
||||||
var dn_fields = wn.meta.docfield_map['Delivery Note'];
|
var dn_fields = wn.meta.docfield_map['Delivery Note'];
|
||||||
var dn_item_fields = wn.meta.docfield_map['Delivery Note Item'];
|
var dn_item_fields = wn.meta.docfield_map['Delivery Note Item'];
|
||||||
|
|||||||
@ -117,11 +117,6 @@ cur_frm.fields_dict['item_code'].get_query = function(doc, cdt, cdn) {
|
|||||||
cur_frm.add_fetch('item_code', 'item_name', 'item_name');
|
cur_frm.add_fetch('item_code', 'item_name', 'item_name');
|
||||||
cur_frm.add_fetch('item_code', 'description', 'description');
|
cur_frm.add_fetch('item_code', 'description', 'description');
|
||||||
|
|
||||||
cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) {
|
|
||||||
return{
|
|
||||||
filters:{ 'is_group': "No"}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) {
|
cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) {
|
||||||
return{ query:"controllers.queries.customer_query" } }
|
return{ query:"controllers.queries.customer_query" } }
|
||||||
|
|||||||
@ -123,11 +123,5 @@ cur_frm.cscript.generate_schedule = function(doc, cdt, cdn) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) {
|
|
||||||
return{
|
|
||||||
filters:{ 'is_group': "No"}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) {
|
cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) {
|
||||||
return{ query:"controllers.queries.customer_query" } }
|
return{ query:"controllers.queries.customer_query" } }
|
||||||
|
|||||||
@ -118,14 +118,6 @@ cur_frm.cscript.item_code = function(doc, cdt, cdn) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//get query select Territory
|
|
||||||
cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) {
|
|
||||||
return{
|
|
||||||
filters:{
|
|
||||||
'is_group': "No"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) {
|
cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) {
|
||||||
return {query: "controllers.queries.customer_query" }
|
return {query: "controllers.queries.customer_query" }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user