fix: billing flow issues

This commit is contained in:
Jannat Patel
2023-09-26 22:40:00 +05:30
parent 5614a6203f
commit 4f97760e8a
4 changed files with 33 additions and 10 deletions

View File

@@ -84,7 +84,7 @@
"fieldname": "status", "fieldname": "status",
"fieldtype": "Select", "fieldtype": "Select",
"label": "Status", "label": "Status",
"options": "Pass\nFail", "options": "Pending\nIn Progress\nPass\nFail",
"reqd": 1 "reqd": 1
}, },
{ {
@@ -106,7 +106,7 @@
], ],
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"links": [], "links": [],
"modified": "2023-08-23 14:51:21.947169", "modified": "2023-09-26 19:44:43.594892",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "LMS", "module": "LMS",
"name": "LMS Certificate Evaluation", "name": "LMS Certificate Evaluation",
@@ -139,6 +139,23 @@
], ],
"sort_field": "modified", "sort_field": "modified",
"sort_order": "DESC", "sort_order": "DESC",
"states": [], "states": [
{
"color": "Green",
"title": "Pass"
},
{
"color": "Red",
"title": "Fail"
},
{
"color": "Blue",
"title": "Pending"
},
{
"color": "Orange",
"title": "In Progress"
}
],
"title_field": "member_name" "title_field": "member_name"
} }

View File

@@ -42,7 +42,7 @@
</div> </div>
</div> </div>
{% if gst_applied %} {% if gst_applied %}
<span class="small mt-2"> <span id="gst-message" class="small mt-2">
{{ _("18% GST included") }} {{ _("18% GST included") }}
</span> </span>
{% endif %} {% endif %}

View File

@@ -105,7 +105,7 @@ const setup_billing = () => {
}; };
const generate_payment_link = (e) => { const generate_payment_link = (e) => {
address = this.billing.get_values(); let new_address = this.billing.get_values();
let doctype = $(e.currentTarget).attr("data-doctype"); let doctype = $(e.currentTarget).attr("data-doctype");
let docname = decodeURIComponent($(e.currentTarget).attr("data-name")); let docname = decodeURIComponent($(e.currentTarget).attr("data-name"));
@@ -114,8 +114,8 @@ const generate_payment_link = (e) => {
args: { args: {
doctype: doctype, doctype: doctype,
docname: docname, docname: docname,
phone: address.phone, phone: new_address.phone,
country: address.country, country: new_address.country,
}, },
callback: (data) => { callback: (data) => {
data.message.handler = (response) => { data.message.handler = (response) => {
@@ -123,7 +123,7 @@ const generate_payment_link = (e) => {
response, response,
doctype, doctype,
docname, docname,
address, new_address,
data.message.order_id data.message.order_id
); );
}; };
@@ -156,6 +156,7 @@ const handle_success = (response, doctype, docname, address, order_id) => {
}; };
const change_currency = () => { const change_currency = () => {
$("#gst-message").removeClass("hide");
let country = this.billing.get_value("country"); let country = this.billing.get_value("country");
if (exception_country.includes(country)) { if (exception_country.includes(country)) {
update_price(original_price_formatted); update_price(original_price_formatted);
@@ -173,6 +174,9 @@ const change_currency = () => {
if (current_price != data.message) { if (current_price != data.message) {
update_price(data.message); update_price(data.message);
} }
if (!data.message.includes("INR")) {
$("#gst-message").addClass("hide");
}
}, },
}); });
}; };

View File

@@ -14,8 +14,7 @@ def get_context(context):
validate_access(doctype, docname, module) validate_access(doctype, docname, module)
get_billing_details(context) get_billing_details(context)
context.original_amount = context.amount
context.original_currency = context.currency
context.exception_country = frappe.get_all( context.exception_country = frappe.get_all(
"Payment Country", filters={"parent": "LMS Settings"}, pluck="country" "Payment Country", filters={"parent": "LMS Settings"}, pluck="country"
) )
@@ -28,6 +27,9 @@ def get_context(context):
if context.currency == "INR": if context.currency == "INR":
context.amount, context.gst_applied = apply_gst(context.amount, None) context.amount, context.gst_applied = apply_gst(context.amount, None)
context.original_amount = context.amount
context.original_currency = context.currency
def validate_access(doctype, docname, module): def validate_access(doctype, docname, module):
if frappe.session.user == "Guest": if frappe.session.user == "Guest":