style: change function call to anonymous function call
This commit is contained in:
parent
b70b048fa2
commit
63cf56f406
@ -124,8 +124,7 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend(
|
|||||||
|
|
||||||
if(flt(doc.per_delivered, 6) < 100 || flt(doc.per_billed) < 100) {
|
if(flt(doc.per_delivered, 6) < 100 || flt(doc.per_billed) < 100) {
|
||||||
// close
|
// close
|
||||||
this.frm.add_custom_button(__('Close'),
|
this.frm.add_custom_button(__('Close'), () => this.close_sales_order(), __("Status"))
|
||||||
function() { me.close_sales_order() }, __("Status"))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(doc.status === 'Closed') {
|
else if(doc.status === 'Closed') {
|
||||||
@ -160,57 +159,44 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend(
|
|||||||
if (this.frm.has_perm("submit")) {
|
if (this.frm.has_perm("submit")) {
|
||||||
if(flt(doc.per_delivered, 6) < 100 || flt(doc.per_billed) < 100) {
|
if(flt(doc.per_delivered, 6) < 100 || flt(doc.per_billed) < 100) {
|
||||||
// hold
|
// hold
|
||||||
this.frm.add_custom_button(__('Hold'),
|
this.frm.add_custom_button(__('Hold'), () => this.hold_sales_order(), __("Status"))
|
||||||
function() {
|
|
||||||
me.hold_sales_order();
|
|
||||||
}, __("Status"))
|
|
||||||
// close
|
// close
|
||||||
this.frm.add_custom_button(__('Close'),
|
this.frm.add_custom_button(__('Close'), () => this.close_sales_order(), __("Status"))
|
||||||
function() { me.close_sales_order() }, __("Status"))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// delivery note
|
// delivery note
|
||||||
if(flt(doc.per_delivered, 6) < 100 && ["Sales", "Shopping Cart"].indexOf(doc.order_type)!==-1 && allow_delivery) {
|
if(flt(doc.per_delivered, 6) < 100 && ["Sales", "Shopping Cart"].indexOf(doc.order_type)!==-1 && allow_delivery) {
|
||||||
this.frm.add_custom_button(__('Delivery'),
|
this.frm.add_custom_button(__('Delivery'), () => this.make_delivery_note_based_on_delivery_date(), __('Create'));
|
||||||
function() { me.make_delivery_note_based_on_delivery_date(); }, __('Create'));
|
this.frm.add_custom_button(__('Work Order'), () => this.make_work_order(), __('Create'));
|
||||||
this.frm.add_custom_button(__('Work Order'),
|
|
||||||
function() { me.make_work_order() }, __('Create'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// sales invoice
|
// sales invoice
|
||||||
if(flt(doc.per_billed, 6) < 100) {
|
if(flt(doc.per_billed, 6) < 100) {
|
||||||
this.frm.add_custom_button(__('Invoice'),
|
this.frm.add_custom_button(__('Invoice'), () => me.make_sales_invoice(), __('Create'));
|
||||||
function() { me.make_sales_invoice() }, __('Create'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// material request
|
// material request
|
||||||
if(!doc.order_type || ["Sales", "Shopping Cart"].indexOf(doc.order_type)!==-1
|
if(!doc.order_type || ["Sales", "Shopping Cart"].indexOf(doc.order_type)!==-1
|
||||||
&& flt(doc.per_delivered, 6) < 100) {
|
&& flt(doc.per_delivered, 6) < 100) {
|
||||||
this.frm.add_custom_button(__('Material Request'),
|
this.frm.add_custom_button(__('Material Request'), () => this.make_material_request(), __('Create'));
|
||||||
function() { me.make_material_request() }, __('Create'));
|
this.frm.add_custom_button(__('Request for Raw Materials'), () => this.make_raw_material_request(), __('Create'));
|
||||||
this.frm.add_custom_button(__('Request for Raw Materials'),
|
|
||||||
function() { me.make_raw_material_request() }, __('Create'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// make purchase order
|
// make purchase order
|
||||||
if(flt(doc.per_delivered, 6) < 100 && allow_purchase) {
|
if(flt(doc.per_delivered, 6) < 100 && allow_purchase) {
|
||||||
this.frm.add_custom_button(__('Purchase Order'),
|
this.frm.add_custom_button(__('Purchase Order'), () => this.make_purchase_order(), __('Create'));
|
||||||
function() { me.make_purchase_order() }, __('Create'));
|
|
||||||
}
|
}
|
||||||
// maintenance
|
// maintenance
|
||||||
if(flt(doc.per_delivered, 2) < 100 &&
|
if(flt(doc.per_delivered, 2) < 100 &&
|
||||||
["Sales", "Shopping Cart"].indexOf(doc.order_type)===-1) {
|
["Sales", "Shopping Cart"].indexOf(doc.order_type)===-1) {
|
||||||
this.frm.add_custom_button(__('Maintenance Visit'),
|
this.frm.add_custom_button(__('Maintenance Visit'), () => this.make_maintenance_visit(), __('Create'));
|
||||||
function() { me.make_maintenance_visit() }, __('Create'));
|
this.frm.add_custom_button(__('Maintenance Schedule'), () => this.make_maintenance_schedule(), __('Create'));
|
||||||
this.frm.add_custom_button(__('Maintenance Schedule'),
|
|
||||||
function() { me.make_maintenance_schedule() }, __('Create'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// project
|
// project
|
||||||
if(flt(doc.per_delivered, 2) < 100 && ["Sales", "Shopping Cart"].indexOf(doc.order_type)!==-1 && allow_delivery) {
|
if(flt(doc.per_delivered, 2) < 100 && ["Sales", "Shopping Cart"].indexOf(doc.order_type)!==-1 && allow_delivery) {
|
||||||
this.frm.add_custom_button(__('Project'),
|
this.frm.add_custom_button(__('Project'), () => this.make_project(), __('Create'));
|
||||||
function() { me.make_project() }, __('Create'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!doc.auto_repeat) {
|
if(!doc.auto_repeat) {
|
||||||
@ -221,10 +207,8 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend(
|
|||||||
}
|
}
|
||||||
// payment request
|
// payment request
|
||||||
if(flt(doc.per_billed)==0) {
|
if(flt(doc.per_billed)==0) {
|
||||||
this.frm.add_custom_button(__('Payment Request'),
|
this.frm.add_custom_button(__('Payment Request'), () => this.make_payment_request(), __('Create'));
|
||||||
function() { me.make_payment_request() }, __('Create'));
|
this.frm.add_custom_button(__('Payment'), () => this.make_payment_entry(), __('Create'));
|
||||||
this.frm.add_custom_button(__('Payment'),
|
|
||||||
function() { me.make_payment_entry() }, __('Create'));
|
|
||||||
}
|
}
|
||||||
this.frm.page.set_inner_btn_group_as_primary(__('Create'));
|
this.frm.page.set_inner_btn_group_as_primary(__('Create'));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user