|
@ -56,66 +56,6 @@ frappe.ui.form.on('Kilometer Mapping', { |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
validate: function (frm) { |
|
|
validate: function (frm) { |
|
|
// //custom button
|
|
|
|
|
|
// frm.add_custom_button(__("Duplicate Data"), function () {
|
|
|
|
|
|
// let d = new frappe.ui.Dialog({
|
|
|
|
|
|
// title: 'Choose the variant',
|
|
|
|
|
|
// fields: [
|
|
|
|
|
|
// {
|
|
|
|
|
|
// label: 'Variant',
|
|
|
|
|
|
// fieldname: 'variant',
|
|
|
|
|
|
// fieldtype: 'Link',
|
|
|
|
|
|
// options: "Kilometer Mapping"
|
|
|
|
|
|
// },
|
|
|
|
|
|
// {
|
|
|
|
|
|
// label: '',
|
|
|
|
|
|
// fieldname: 'content_html',
|
|
|
|
|
|
// fieldtype: 'HTML',
|
|
|
|
|
|
// },
|
|
|
|
|
|
// ],
|
|
|
|
|
|
// size: 'small',
|
|
|
|
|
|
// secondary_action_label: "No",
|
|
|
|
|
|
// primary_action_label: 'Yes',
|
|
|
|
|
|
// primary_action(values) {
|
|
|
|
|
|
// console.log(values);
|
|
|
|
|
|
// if (values) {
|
|
|
|
|
|
|
|
|
|
|
|
// if (frm.doc.config_kilometer && frm.doc.config_kilometer.length > 0) {
|
|
|
|
|
|
// cur_frm.clear_table("config_kilometer");
|
|
|
|
|
|
// cur_frm.refresh_fields('config_kilometer');
|
|
|
|
|
|
// }
|
|
|
|
|
|
// cur_frm.refresh_fields("config_kilometer");
|
|
|
|
|
|
// frappe.call({
|
|
|
|
|
|
// "method": "smart_service.transactions.doctype.kilometer_mapping.kilometer_mapping.get_config_kilometer",
|
|
|
|
|
|
// "args": {
|
|
|
|
|
|
// "doc": values.variant,
|
|
|
|
|
|
// "docname": frm.doc.name
|
|
|
|
|
|
// },
|
|
|
|
|
|
// callback: function (r) {
|
|
|
|
|
|
// if (r.message && r.message.length > 0) {
|
|
|
|
|
|
// cur_frm.refresh_fields("config_kilometer");
|
|
|
|
|
|
// frm.save()
|
|
|
|
|
|
// frm.refresh()
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// })
|
|
|
|
|
|
// d.hide();
|
|
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
// secondary_action(values) {
|
|
|
|
|
|
// d.hide();
|
|
|
|
|
|
// }
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
// d.show();
|
|
|
|
|
|
// var res = $(d.fields_dict.content_html.wrapper).empty();
|
|
|
|
|
|
// var ret = "<p>Upload the Kilometer</p>"
|
|
|
|
|
|
// res.append(ret)
|
|
|
|
|
|
// }).css({ "color": "#fff", "background-color": "red" });;
|
|
|
|
|
|
// //end
|
|
|
|
|
|
|
|
|
|
|
|
frm.doc.kilometer_filter = "All"; |
|
|
frm.doc.kilometer_filter = "All"; |
|
|
if (frm.doc.kilometer_filter == "All") { |
|
|
if (frm.doc.kilometer_filter == "All") { |
|
@ -177,14 +117,8 @@ frappe.ui.form.on('Kilometer Mapping', { |
|
|
|
|
|
|
|
|
d.show(); |
|
|
d.show(); |
|
|
setTimeout(function mysam() { |
|
|
setTimeout(function mysam() { |
|
|
console.log("jiiii", $('.modal-dialog').find('.custom-actions').html('<p>Are you sure to update the kilometer mapping?</p>')) |
|
|
|
|
|
$('.modal-dialog').find('.custom-actions').html('<p>Are you sure to update the <b>kilometer mapping</b>?</p>') |
|
|
$('.modal-dialog').find('.custom-actions').html('<p>Are you sure to update the <b>kilometer mapping</b>?</p>') |
|
|
} |
|
|
}, 300); |
|
|
, 300); |
|
|
|
|
|
|
|
|
|
|
|
// var res = $(d.fields_dict.content_html.wrapper).empty();
|
|
|
|
|
|
// var ret="<p>Are you sure to update the kilometer mapping ?</p>"
|
|
|
|
|
|
// res.append(ret)
|
|
|
|
|
|
}).css({ "color": "#fff", "background-color": "red" });; |
|
|
}).css({ "color": "#fff", "background-color": "red" });; |
|
|
//end
|
|
|
//end
|
|
|
|
|
|
|
|
|