From 46f5808fdb0a7546c942f57f4598c9f815085851 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Thu, 13 Nov 2025 11:46:35 +0530 Subject: [PATCH] refactor: transactions changes based on coupon code --- frontend/components.d.ts | 5 +- frontend/package.json | 2 +- .../src/components/Controls/Autocomplete.vue | 4 +- .../Settings/Coupons/CouponDetails.vue | 129 +- .../src/components/Settings/SettingFields.vue | 2 + frontend/src/components/Settings/Settings.vue | 4 +- .../Settings/TransactionDetails.vue | 199 --- .../Transactions/TransactionDetails.vue | 184 +++ .../TransactionList.vue} | 61 +- .../Settings/Transactions/Transactions.vue | 66 + frontend/src/pages/Billing.vue | 5 +- frontend/yarn.lock | 31 +- lms/lms/doctype/lms_payment/lms_payment.json | 56 +- lms/lms/doctype/lms_payment/lms_payment.py | 6 +- lms/lms/payments.py | 63 +- lms/lms/utils.py | 113 +- yarn.lock | 1374 ----------------- 17 files changed, 422 insertions(+), 1882 deletions(-) delete mode 100644 frontend/src/components/Settings/TransactionDetails.vue create mode 100644 frontend/src/components/Settings/Transactions/TransactionDetails.vue rename frontend/src/components/Settings/{Transactions.vue => Transactions/TransactionList.vue} (80%) create mode 100644 frontend/src/components/Settings/Transactions/Transactions.vue delete mode 100644 yarn.lock diff --git a/frontend/components.d.ts b/frontend/components.d.ts index 3626a724..7d6f92bf 100644 --- a/frontend/components.d.ts +++ b/frontend/components.d.ts @@ -111,8 +111,9 @@ declare module 'vue' { StudentHeatmap: typeof import('./src/components/StudentHeatmap.vue')['default'] StudentModal: typeof import('./src/components/Modals/StudentModal.vue')['default'] Tags: typeof import('./src/components/Tags.vue')['default'] - TransactionDetails: typeof import('./src/components/Settings/TransactionDetails.vue')['default'] - Transactions: typeof import('./src/components/Settings/Transactions.vue')['default'] + TransactionDetails: typeof import('./src/components/Settings/Transactions/TransactionDetails.vue')['default'] + TransactionList: typeof import('./src/components/Settings/Transactions/TransactionList.vue')['default'] + Transactions: typeof import('./src/components/Settings/Transactions/Transactions.vue')['default'] UnsplashImageBrowser: typeof import('./src/components/UnsplashImageBrowser.vue')['default'] UpcomingEvaluations: typeof import('./src/components/UpcomingEvaluations.vue')['default'] Uploader: typeof import('./src/components/Controls/Uploader.vue')['default'] diff --git a/frontend/package.json b/frontend/package.json index aa9c52e2..1ad76a18 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -24,7 +24,7 @@ "@editorjs/paragraph": "^2.11.3", "@editorjs/simple-image": "^1.6.0", "@editorjs/table": "^2.4.2", - "@vueuse/core": "^14.0.0", + "@vueuse/core": "^10.4.1", "@vueuse/router": "^12.7.0", "ace-builds": "^1.36.2", "apexcharts": "^4.3.0", diff --git a/frontend/src/components/Controls/Autocomplete.vue b/frontend/src/components/Controls/Autocomplete.vue index d07fa67c..4da8274e 100644 --- a/frontend/src/components/Controls/Autocomplete.vue +++ b/frontend/src/components/Controls/Autocomplete.vue @@ -19,10 +19,10 @@ @click="() => togglePopover()" :disabled="attrs.readonly" > -
+
{{ displayValue(selectedValue) }} diff --git a/frontend/src/components/Settings/Coupons/CouponDetails.vue b/frontend/src/components/Settings/Coupons/CouponDetails.vue index 2ac9c4b4..4a30a6fc 100644 --- a/frontend/src/components/Settings/Coupons/CouponDetails.vue +++ b/frontend/src/components/Settings/Coupons/CouponDetails.vue @@ -1,16 +1,15 @@ diff --git a/frontend/src/components/Settings/SettingFields.vue b/frontend/src/components/Settings/SettingFields.vue index 73f3b023..189a486c 100644 --- a/frontend/src/components/Settings/SettingFields.vue +++ b/frontend/src/components/Settings/SettingFields.vue @@ -147,6 +147,8 @@ const columns = computed(() => { } else { if (field.type == 'checkbox') { field.value = props.data[field.name] ? true : false + } else { + field.value = props.data[field.name] } currentColumn.push(field) } diff --git a/frontend/src/components/Settings/Settings.vue b/frontend/src/components/Settings/Settings.vue index 35571494..e636c8d8 100644 --- a/frontend/src/components/Settings/Settings.vue +++ b/frontend/src/components/Settings/Settings.vue @@ -29,7 +29,7 @@
- - - - - - diff --git a/frontend/src/components/Settings/Transactions/TransactionDetails.vue b/frontend/src/components/Settings/Transactions/TransactionDetails.vue new file mode 100644 index 00000000..832db3fd --- /dev/null +++ b/frontend/src/components/Settings/Transactions/TransactionDetails.vue @@ -0,0 +1,184 @@ + + diff --git a/frontend/src/components/Settings/Transactions.vue b/frontend/src/components/Settings/Transactions/TransactionList.vue similarity index 80% rename from frontend/src/components/Settings/Transactions.vue rename to frontend/src/components/Settings/Transactions/TransactionList.vue index fc87fdca..40a2289e 100644 --- a/frontend/src/components/Settings/Transactions.vue +++ b/frontend/src/components/Settings/Transactions/TransactionList.vue @@ -73,8 +73,7 @@ :disabled="true" />
- {{ getCurrencySymbol(row['currency']) }} - {{ row['total_amount'] }} + {{ getCurrencySymbol(row['currency']) }} {{ row[column.key] }}
{{ row[column.key] }} @@ -97,17 +96,10 @@
- diff --git a/frontend/src/pages/Billing.vue b/frontend/src/pages/Billing.vue index dc89a738..dd952ee7 100644 --- a/frontend/src/pages/Billing.vue +++ b/frontend/src/pages/Billing.vue @@ -70,6 +70,7 @@ @input="appliedCoupon = $event.target.value.toUpperCase()" @keydown.enter="applyCouponCode" placeholder="COUPON2025" + autocomplete="off" class="flex-1 [&_input]:bg-white" />