Skip to content

Commit ea52b09

Browse files
authored
Merge pull request #3723 from Abdeali099/use-frappe-method
2 parents 7a3c425 + 2a7e833 commit ea52b09

1 file changed

Lines changed: 16 additions & 13 deletions

File tree

india_compliance/gst_india/client_scripts/e_invoice_actions.js

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,7 @@ frappe.ui.form.on("Sales Invoice", {
2828
if (frm.doc.docstatus === 0 || !is_einv_generatable) {
2929
frm.add_custom_button(
3030
__("Applicability Status"),
31-
() =>
32-
show_e_invoice_applicability_status(
33-
frm,
34-
is_einv_generatable
35-
),
31+
() => show_e_invoice_applicability_status(frm, is_einv_generatable),
3632
"e-Invoice"
3733
);
3834

@@ -137,7 +133,12 @@ frappe.ui.form.on("Sales Invoice", {
137133
138134
Are you sure you want to continue?`
139135
);
140-
const d = frappe.warn(__("Cannot Cancel IRN"), message, continueCancellation, __("Yes"));
136+
const d = frappe.warn(
137+
__("Cannot Cancel IRN"),
138+
message,
139+
continueCancellation,
140+
__("Yes")
141+
);
141142

142143
d.set_secondary_action_label(__("No"));
143144
return;
@@ -191,11 +192,11 @@ function show_cancel_e_invoice_dialog(frm, callback) {
191192
india_compliance.primary_to_danger_btn(d);
192193
d.show();
193194

194-
$(`
195-
<div class="alert alert-warning" role="alert">
196-
${__("Sales invoice will be cancelled along with the IRN.")}
197-
</div>
198-
`).prependTo(d.wrapper);
195+
d.show_message(
196+
__("Sales invoice will be cancelled along with the IRN."),
197+
"yellow",
198+
1 // permanent
199+
);
199200
}
200201

201202
function show_mark_e_invoice_as_generated_dialog(frm) {
@@ -287,7 +288,7 @@ function get_cancel_e_invoice_dialog_fields(frm, manual_cancel = false) {
287288
default: manual_cancel
288289
? "Others"
289290
: gst_settings.reason_for_e_invoice_cancellation ||
290-
"Data Entry Mistake",
291+
"Data Entry Mistake",
291292
options: ["Duplicate", "Data Entry Mistake", "Order Cancelled", "Others"],
292293
},
293294
{
@@ -396,7 +397,9 @@ function show_e_invoice_applicability_status(frm, is_einv_applicable) {
396397
}
397398

398399
frappe.msgprint({
399-
title: is_einv_applicable ? __("e-Invoice can be generated") : __("e-Invoice cannot be generated"),
400+
title: is_einv_applicable
401+
? __("e-Invoice can be generated")
402+
: __("e-Invoice cannot be generated"),
400403
message: frm._einv_message,
401404
indicator: is_einv_applicable ? "green" : "red",
402405
});

0 commit comments

Comments
 (0)