-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactoring shopping cart settings * adding column_break in shopping cart settings
- Loading branch information
Showing
5 changed files
with
210 additions
and
773 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 8 additions & 23 deletions
31
erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,16 @@ | ||
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | ||
// License: GNU General Public License v3. See license.txt | ||
|
||
$.extend(cur_frm.cscript, { | ||
onload: function() { | ||
if(cur_frm.doc.__onload && cur_frm.doc.__onload.quotation_series) { | ||
cur_frm.fields_dict.quotation_series.df.options = cur_frm.doc.__onload.quotation_series; | ||
cur_frm.refresh_field("quotation_series"); | ||
frappe.ui.form.on("Shopping Cart Settings", { | ||
onload: function(frm) { | ||
if(frm.doc.__onload && frm.doc.__onload.quotation_series) { | ||
frm.fields_dict.quotation_series.df.options = frm.doc.__onload.quotation_series; | ||
frm.refresh_field("quotation_series"); | ||
} | ||
}, | ||
refresh: function(){ | ||
toggle_mandatory(cur_frm) | ||
}, | ||
enable_checkout: function(){ | ||
toggle_mandatory(cur_frm) | ||
}, | ||
enabled: function() { | ||
if (cur_frm.doc.enabled === 1) { | ||
cur_frm.doc.show_configure_button = 1; | ||
cur_frm.refresh_field('show_configure_button'); | ||
enabled: function(frm) { | ||
if (frm.doc.enabled === 1) { | ||
frm.set_value('enable_variants', 1); | ||
} | ||
} | ||
}); | ||
|
||
|
||
function toggle_mandatory (cur_frm){ | ||
cur_frm.toggle_reqd("payment_gateway_account", false); | ||
if(cur_frm.doc.enabled && cur_frm.doc.enable_checkout) { | ||
cur_frm.toggle_reqd("payment_gateway_account", true); | ||
} | ||
} |
Oops, something went wrong.