diff --git a/dashboard/package.json b/dashboard/package.json index 8ae69872a3..8ef257b974 100644 --- a/dashboard/package.json +++ b/dashboard/package.json @@ -42,7 +42,7 @@ "socket.io-client": "^4.5.1", "unplugin-icons": "^0.17.0", "unplugin-vue-components": "^0.25.2", - "vue": "^3.3.4", + "vue": "^3.4.12", "vue-codemirror": "^6.1.1", "vue-echarts": "^6.6.1", "vue-qrcode": "^2.2.2", diff --git a/dashboard/src2/App.vue b/dashboard/src2/App.vue index 0634200d06..ddd9694055 100644 --- a/dashboard/src2/App.vue +++ b/dashboard/src2/App.vue @@ -30,7 +30,7 @@ diff --git a/dashboard/src2/components/BuyPrepaidCreditsDialog.vue b/dashboard/src2/components/BuyPrepaidCreditsDialog.vue deleted file mode 100644 index 2035667130..0000000000 --- a/dashboard/src2/components/BuyPrepaidCreditsDialog.vue +++ /dev/null @@ -1,61 +0,0 @@ - - diff --git a/dashboard/src2/components/ChangePaymentModeDialog.vue b/dashboard/src2/components/ChangePaymentModeDialog.vue deleted file mode 100644 index 8f256ee497..0000000000 --- a/dashboard/src2/components/ChangePaymentModeDialog.vue +++ /dev/null @@ -1,146 +0,0 @@ - - diff --git a/dashboard/src2/components/billing/AddCardDialog.vue b/dashboard/src2/components/billing/AddCardDialog.vue new file mode 100644 index 0000000000..8c7b6d739c --- /dev/null +++ b/dashboard/src2/components/billing/AddCardDialog.vue @@ -0,0 +1,35 @@ + + diff --git a/dashboard/src2/components/billing/AddPrepaidCreditsDialog.vue b/dashboard/src2/components/billing/AddPrepaidCreditsDialog.vue new file mode 100644 index 0000000000..50ae196326 --- /dev/null +++ b/dashboard/src2/components/billing/AddPrepaidCreditsDialog.vue @@ -0,0 +1,37 @@ + + diff --git a/dashboard/src2/components/billing/BillingDetails.vue b/dashboard/src2/components/billing/BillingDetails.vue new file mode 100644 index 0000000000..6ae7d0b6de --- /dev/null +++ b/dashboard/src2/components/billing/BillingDetails.vue @@ -0,0 +1,71 @@ + + diff --git a/dashboard/src2/components/billing/BillingDetailsDialog.vue b/dashboard/src2/components/billing/BillingDetailsDialog.vue new file mode 100644 index 0000000000..ba701db341 --- /dev/null +++ b/dashboard/src2/components/billing/BillingDetailsDialog.vue @@ -0,0 +1,37 @@ + + diff --git a/dashboard/src2/components/billing/BillingInformationDialog.vue b/dashboard/src2/components/billing/BillingInformationDialog.vue deleted file mode 100644 index 6fab459372..0000000000 --- a/dashboard/src2/components/billing/BillingInformationDialog.vue +++ /dev/null @@ -1,34 +0,0 @@ - - diff --git a/dashboard/src2/components/billing/BillingSummary.vue b/dashboard/src2/components/billing/BillingSummary.vue new file mode 100644 index 0000000000..50b334faaa --- /dev/null +++ b/dashboard/src2/components/billing/BillingSummary.vue @@ -0,0 +1,123 @@ + + diff --git a/dashboard/src2/components/billing/BuyCreditsRazorpay.vue b/dashboard/src2/components/billing/BuyCreditsRazorpay.vue new file mode 100644 index 0000000000..0f23c0f86b --- /dev/null +++ b/dashboard/src2/components/billing/BuyCreditsRazorpay.vue @@ -0,0 +1,124 @@ + + diff --git a/dashboard/src2/components/billing/BuyCreditsStripe.vue b/dashboard/src2/components/billing/BuyCreditsStripe.vue new file mode 100644 index 0000000000..00f0bc1e8c --- /dev/null +++ b/dashboard/src2/components/billing/BuyCreditsStripe.vue @@ -0,0 +1,168 @@ + + diff --git a/dashboard/src2/components/billing/CardForm.vue b/dashboard/src2/components/billing/CardForm.vue new file mode 100644 index 0000000000..4298a0e0de --- /dev/null +++ b/dashboard/src2/components/billing/CardForm.vue @@ -0,0 +1,360 @@ + + diff --git a/dashboard/src2/components/billing/ChangeCardDialog.vue b/dashboard/src2/components/billing/ChangeCardDialog.vue new file mode 100644 index 0000000000..648fa266f1 --- /dev/null +++ b/dashboard/src2/components/billing/ChangeCardDialog.vue @@ -0,0 +1,138 @@ + + diff --git a/dashboard/src2/components/billing/DropdownItem.vue b/dashboard/src2/components/billing/DropdownItem.vue new file mode 100644 index 0000000000..c242165bed --- /dev/null +++ b/dashboard/src2/components/billing/DropdownItem.vue @@ -0,0 +1,22 @@ + + diff --git a/dashboard/src2/components/billing/FinalizeInvoicesDialog.vue b/dashboard/src2/components/billing/FinalizeInvoicesDialog.vue index 6452c71e4a..635aed02ae 100644 --- a/dashboard/src2/components/billing/FinalizeInvoicesDialog.vue +++ b/dashboard/src2/components/billing/FinalizeInvoicesDialog.vue @@ -23,9 +23,9 @@ }} - Please finalize and settle them before removing all payment methods or - disabling the account. You can check the details of invoices and make - the payment from + Please finalize and settle them before removing all payment methods, + switching to Paid by Partner method or disabling the account. You can + check the details of invoices and make the payment from here. It might take up to 2 hours for the payment to reflect against your invoices. diff --git a/dashboard/src2/components/billing/NewAddressForm.vue b/dashboard/src2/components/billing/NewAddressForm.vue new file mode 100644 index 0000000000..17e32a64d5 --- /dev/null +++ b/dashboard/src2/components/billing/NewAddressForm.vue @@ -0,0 +1,242 @@ + + diff --git a/dashboard/src2/components/billing/PaymentDetails.vue b/dashboard/src2/components/billing/PaymentDetails.vue new file mode 100644 index 0000000000..375cba70e0 --- /dev/null +++ b/dashboard/src2/components/billing/PaymentDetails.vue @@ -0,0 +1,328 @@ + + diff --git a/dashboard/src2/components/billing/PrepaidCreditsForm.vue b/dashboard/src2/components/billing/PrepaidCreditsForm.vue new file mode 100644 index 0000000000..f1d6712ed1 --- /dev/null +++ b/dashboard/src2/components/billing/PrepaidCreditsForm.vue @@ -0,0 +1,125 @@ + + diff --git a/dashboard/src2/components/billing/UpcomingInvoiceDialog.vue b/dashboard/src2/components/billing/UpcomingInvoiceDialog.vue new file mode 100644 index 0000000000..fbdf02ddcc --- /dev/null +++ b/dashboard/src2/components/billing/UpcomingInvoiceDialog.vue @@ -0,0 +1,37 @@ + + + diff --git a/dashboard/src2/logo/PoweredByStripeLogo.vue b/dashboard/src2/logo/PoweredByStripeLogo.vue new file mode 100644 index 0000000000..39719d4870 --- /dev/null +++ b/dashboard/src2/logo/PoweredByStripeLogo.vue @@ -0,0 +1,27 @@ + diff --git a/dashboard/src2/logo/RazorpayLogo.vue b/dashboard/src2/logo/RazorpayLogo.vue new file mode 100644 index 0000000000..6dd7fabb21 --- /dev/null +++ b/dashboard/src2/logo/RazorpayLogo.vue @@ -0,0 +1,50 @@ + diff --git a/dashboard/src2/logo/StripeLogo.vue b/dashboard/src2/logo/StripeLogo.vue new file mode 100644 index 0000000000..ec0f16009e --- /dev/null +++ b/dashboard/src2/logo/StripeLogo.vue @@ -0,0 +1,48 @@ + diff --git a/dashboard/src2/pages/BillingInvoices.vue b/dashboard/src2/pages/BillingInvoices.vue index 9f9f911eeb..87d5cd2be4 100644 --- a/dashboard/src2/pages/BillingInvoices.vue +++ b/dashboard/src2/pages/BillingInvoices.vue @@ -17,7 +17,7 @@ - -
-
-
-
-
-
Current Billing Amount
- -
-
- {{ upcomingInvoice ? upcomingInvoice.formatted.total : '0.00' }} -
-
-
-
-
Unpaid Amount
- -
-
- {{ - ($team?.doc?.currency == 'INR' ? '₹' : '$') + - ' ' + - Math.ceil($resources.unpaidAmountDue.data) - }} -
-
-
-
-
Credits Available
- -
-
- {{ availableCredits }} -
-
- -
-
-
Payment Mode
- -
-
- {{ $team?.doc?.payment_mode || 'Not set' }} -
-
-

- {{ paymentModeDescription }} -

-
-
-
-
-
Billing Details
- -
-
- - {{ billingDetailsSummary }} - - Not set -
-
-
-
-
Payment Method
- -
-
-
- {{ $team.doc.payment_method.name_on_card }} - •••• - {{ $team.doc.payment_method.last_4 }} - · - - Expiry {{ $team.doc.payment_method.expiry_month }}/{{ - $team.doc.payment_method.expiry_year - }} - -
- - Not set -
-
-
- - -
- -
-
- - - - - - - - - - - - +
+ + +
+
+
- diff --git a/dashboard/src2/utils/components.jsx b/dashboard/src2/utils/components.jsx index 1c5f410cd2..8519a72f48 100644 --- a/dashboard/src2/utils/components.jsx +++ b/dashboard/src2/utils/components.jsx @@ -1,5 +1,5 @@ import { FeatherIcon } from 'frappe-ui'; -import { h, isVNode, ref } from 'vue'; +import { h, isVNode, ref, defineAsyncComponent } from 'vue'; import AddressableErrorDialog from '../components/AddressableErrorDialog.vue'; import DialogWrapper from '../components/DialogWrapper.vue'; import ConfirmDialog from '../dialogs/ConfirmDialog.vue'; @@ -60,3 +60,28 @@ export function renderDialog(component) { export function renderInDialog(component, options = {}) { renderDialog({component}); } + +export function cardBrandIcon(brand) { + const component = { + 'master-card': defineAsyncComponent(() => + import('@/components/icons/cards/MasterCard.vue') + ), + visa: defineAsyncComponent(() => + import('@/components/icons/cards/Visa.vue') + ), + amex: defineAsyncComponent(() => + import('@/components/icons/cards/Amex.vue') + ), + jcb: defineAsyncComponent(() => + import('@/components/icons/cards/JCB.vue') + ), + generic: defineAsyncComponent(() => + import('@/components/icons/cards/Generic.vue') + ), + 'union-pay': defineAsyncComponent(() => + import('@/components/icons/cards/UnionPay.vue') + ) + }[brand || 'generic']; + + return h(component, { class: 'h-4 w-6' }); +} \ No newline at end of file diff --git a/dashboard/yarn.lock b/dashboard/yarn.lock index 1fb2b15825..16288e49ff 100644 --- a/dashboard/yarn.lock +++ b/dashboard/yarn.lock @@ -532,6 +532,11 @@ resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.24.7.tgz#4d2d0f14820ede3b9807ea5fc36dfc8cd7da07f2" integrity sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg== +"@babel/helper-string-parser@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz#1aabb72ee72ed35789b4bbcad3ca2862ce614e8c" + integrity sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA== + "@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.19.1": version "7.19.1" resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz" @@ -552,6 +557,11 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz#75b889cfaf9e35c2aaf42cf0d72c8e91719251db" integrity sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w== +"@babel/helper-validator-identifier@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz#24b64e2c3ec7cd3b3c547729b8d16871f22cbdc7" + integrity sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ== + "@babel/helper-validator-option@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz#de52000a15a177413c8234fa3a8af4ee8102d0ac" @@ -665,6 +675,13 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.24.7.tgz#9a5226f92f0c5c8ead550b750f5608e766c8ce85" integrity sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw== +"@babel/parser@^7.25.3": + version "7.26.2" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.26.2.tgz#fd7b6f487cfea09889557ef5d4eeb9ff9a5abd11" + integrity sha512-DWMCZH9WA4Maitz2q21SRKHo9QXZxkDsbNZoVD62gusNtNBBqDg9i7uOhASfTfIGNzW+O+r7+jAlM8dwphcJKQ== + dependencies: + "@babel/types" "^7.26.0" + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.22.5.tgz#87245a21cd69a73b0b81bcda98d443d6df08f05e" @@ -1468,6 +1485,14 @@ "@babel/helper-validator-identifier" "^7.24.7" to-fast-properties "^2.0.0" +"@babel/types@^7.26.0": + version "7.26.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.26.0.tgz#deabd08d6b753bc8e0f198f8709fb575e31774ff" + integrity sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA== + dependencies: + "@babel/helper-string-parser" "^7.25.9" + "@babel/helper-validator-identifier" "^7.25.9" + "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz" @@ -1788,6 +1813,11 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== +"@jridgewell/sourcemap-codec@^1.5.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a" + integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== + "@jridgewell/trace-mapping@^0.3.12": version "0.3.17" resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz" @@ -2633,9 +2663,9 @@ "@vue/babel-plugin-jsx" "^1.1.5" "@vitejs/plugin-vue@^5.0.3": - version "5.0.3" - resolved "https://registry.yarnpkg.com/@vitejs/plugin-vue/-/plugin-vue-5.0.3.tgz#164b36653910d27c130cf6c945b4bd9bde5bcbee" - integrity sha512-b8S5dVS40rgHdDrw+DQi/xOM9ed+kSRZzfm1T74bMmBDCd8XO87NKlFYInzCtwvtWwXZvo1QxE2OSspTATWrbA== + version "5.2.1" + resolved "https://registry.yarnpkg.com/@vitejs/plugin-vue/-/plugin-vue-5.2.1.tgz#d1491f678ee3af899f7ae57d9c21dc52a65c7133" + integrity sha512-cxh314tzaWwOLqVes2gnnCtvBDcM1UMdn+iFR+UjAn411dPT3tOmqrJjbMd7koZpMAmBM/GqeV4n9ge7JSiJJQ== "@volar/language-core@2.1.4", "@volar/language-core@~2.1.3": version "2.1.4" @@ -2713,6 +2743,17 @@ estree-walker "^2.0.2" source-map-js "^1.0.2" +"@vue/compiler-core@3.5.13": + version "3.5.13" + resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.5.13.tgz#b0ae6c4347f60c03e849a05d34e5bf747c9bda05" + integrity sha512-oOdAkwqUfW1WqpwSYJce06wvt6HljgY3fGeM9NcVA1HaYOij3mZG9Rkysn0OHuyUAGMbEbARIpsG+LPVlBJ5/Q== + dependencies: + "@babel/parser" "^7.25.3" + "@vue/shared" "3.5.13" + entities "^4.5.0" + estree-walker "^2.0.2" + source-map-js "^1.2.0" + "@vue/compiler-dom@3.3.4": version "3.3.4" resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.3.4.tgz#f56e09b5f4d7dc350f981784de9713d823341151" @@ -2729,7 +2770,30 @@ "@vue/compiler-core" "3.4.21" "@vue/shared" "3.4.21" -"@vue/compiler-sfc@3.3.4", "@vue/compiler-sfc@^3.1.0": +"@vue/compiler-dom@3.5.13": + version "3.5.13" + resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.5.13.tgz#bb1b8758dbc542b3658dda973b98a1c9311a8a58" + integrity sha512-ZOJ46sMOKUjO3e94wPdCzQ6P1Lx/vhp2RSvfaab88Ajexs0AHeV0uasYhi99WPaogmBlRHNRuly8xV75cNTMDA== + dependencies: + "@vue/compiler-core" "3.5.13" + "@vue/shared" "3.5.13" + +"@vue/compiler-sfc@3.5.13": + version "3.5.13" + resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-3.5.13.tgz#461f8bd343b5c06fac4189c4fef8af32dea82b46" + integrity sha512-6VdaljMpD82w6c2749Zhf5T9u5uLBWKnVue6XWxprDobftnletJ8+oel7sexFfM3qIxNmVE7LSFGTpv6obNyaQ== + dependencies: + "@babel/parser" "^7.25.3" + "@vue/compiler-core" "3.5.13" + "@vue/compiler-dom" "3.5.13" + "@vue/compiler-ssr" "3.5.13" + "@vue/shared" "3.5.13" + estree-walker "^2.0.2" + magic-string "^0.30.11" + postcss "^8.4.48" + source-map-js "^1.2.0" + +"@vue/compiler-sfc@^3.1.0": version "3.3.4" resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-3.3.4.tgz#b19d942c71938893535b46226d602720593001df" integrity sha512-6y/d8uw+5TkCuzBkgLS0v3lSM3hJDntFEiUORM11pQ/hKvkhSKZrXW6i69UyXlJQisJxuUEJKAWEqWbWsLeNKQ== @@ -2776,6 +2840,14 @@ "@vue/compiler-dom" "3.4.21" "@vue/shared" "3.4.21" +"@vue/compiler-ssr@3.5.13": + version "3.5.13" + resolved "https://registry.yarnpkg.com/@vue/compiler-ssr/-/compiler-ssr-3.5.13.tgz#e771adcca6d3d000f91a4277c972a996d07f43ba" + integrity sha512-wMH6vrYHxQl/IybKJagqbquvxpWCuVYpoUJfCqFZwa/JY1GdATAQ+TgVtgrwwMZ0D07QhA99rs/EAAWfvG6KpA== + dependencies: + "@vue/compiler-dom" "3.5.13" + "@vue/shared" "3.5.13" + "@vue/devtools-api@^6.5.0": version "6.5.0" resolved "https://registry.yarnpkg.com/@vue/devtools-api/-/devtools-api-6.5.0.tgz#98b99425edee70b4c992692628fa1ea2c1e57d07" @@ -2812,37 +2884,38 @@ estree-walker "^2.0.2" magic-string "^0.30.0" -"@vue/reactivity@3.3.4": - version "3.3.4" - resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.3.4.tgz#a27a29c6cd17faba5a0e99fbb86ee951653e2253" - integrity sha512-kLTDLwd0B1jG08NBF3R5rqULtv/f8x3rOFByTDz4J53ttIQEDmALqKqXY0J+XQeN0aV2FBxY8nJDf88yvOPAqQ== +"@vue/reactivity@3.5.13": + version "3.5.13" + resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.5.13.tgz#b41ff2bb865e093899a22219f5b25f97b6fe155f" + integrity sha512-NaCwtw8o48B9I6L1zl2p41OHo/2Z4wqYGGIK1Khu5T7yxrn+ATOixn/Udn2m+6kZKB/J7cuT9DbWWhRxqixACg== dependencies: - "@vue/shared" "3.3.4" + "@vue/shared" "3.5.13" -"@vue/runtime-core@3.3.4": - version "3.3.4" - resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.3.4.tgz#4bb33872bbb583721b340f3088888394195967d1" - integrity sha512-R+bqxMN6pWO7zGI4OMlmvePOdP2c93GsHFM/siJI7O2nxFRzj55pLwkpCedEY+bTMgp5miZ8CxfIZo3S+gFqvA== +"@vue/runtime-core@3.5.13": + version "3.5.13" + resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.5.13.tgz#1fafa4bf0b97af0ebdd9dbfe98cd630da363a455" + integrity sha512-Fj4YRQ3Az0WTZw1sFe+QDb0aXCerigEpw418pw1HBUKFtnQHWzwojaukAs2X/c9DQz4MQ4bsXTGlcpGxU/RCIw== dependencies: - "@vue/reactivity" "3.3.4" - "@vue/shared" "3.3.4" + "@vue/reactivity" "3.5.13" + "@vue/shared" "3.5.13" -"@vue/runtime-dom@3.3.4": - version "3.3.4" - resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.3.4.tgz#992f2579d0ed6ce961f47bbe9bfe4b6791251566" - integrity sha512-Aj5bTJ3u5sFsUckRghsNjVTtxZQ1OyMWCr5dZRAPijF/0Vy4xEoRCwLyHXcj4D0UFbJ4lbx3gPTgg06K/GnPnQ== +"@vue/runtime-dom@3.5.13": + version "3.5.13" + resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.5.13.tgz#610fc795de9246300e8ae8865930d534e1246215" + integrity sha512-dLaj94s93NYLqjLiyFzVs9X6dWhTdAlEAciC3Moq7gzAc13VJUdCnjjRurNM6uTLFATRHexHCTu/Xp3eW6yoog== dependencies: - "@vue/runtime-core" "3.3.4" - "@vue/shared" "3.3.4" - csstype "^3.1.1" + "@vue/reactivity" "3.5.13" + "@vue/runtime-core" "3.5.13" + "@vue/shared" "3.5.13" + csstype "^3.1.3" -"@vue/server-renderer@3.3.4": - version "3.3.4" - resolved "https://registry.yarnpkg.com/@vue/server-renderer/-/server-renderer-3.3.4.tgz#ea46594b795d1536f29bc592dd0f6655f7ea4c4c" - integrity sha512-Q6jDDzR23ViIb67v+vM1Dqntu+HUexQcsWKhhQa4ARVzxOY2HbC7QRW/ggkDBd5BU+uM1sV6XOAP0b216o34JQ== +"@vue/server-renderer@3.5.13": + version "3.5.13" + resolved "https://registry.yarnpkg.com/@vue/server-renderer/-/server-renderer-3.5.13.tgz#429ead62ee51de789646c22efe908e489aad46f7" + integrity sha512-wAi4IRJV/2SAW3htkTlB+dHeRmpTiVIK1OGLWV1yeStVSebSQQOwGwIq0D3ZIoBj2C2qpgz5+vX9iEBkTdk5YA== dependencies: - "@vue/compiler-ssr" "3.3.4" - "@vue/shared" "3.3.4" + "@vue/compiler-ssr" "3.5.13" + "@vue/shared" "3.5.13" "@vue/shared@3.3.4": version "3.3.4" @@ -2854,6 +2927,11 @@ resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.4.21.tgz#de526a9059d0a599f0b429af7037cd0c3ed7d5a1" integrity sha512-PuJe7vDIi6VYSinuEbUIQgMIRZGgM8e4R+G+/dQTk0X1NEdvgvvgv7m+rfmDH1gZzyA1OjjoWskvHlfRNfQf3g== +"@vue/shared@3.5.13": + version "3.5.13" + resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.5.13.tgz#87b309a6379c22b926e696893237826f64339b6f" + integrity sha512-/hnE/qP5ZoGpol0a5mDi45bOd7t3tjYJBjsgCsivow7D48cJeV5l05RD82lPqi7gRiphZM37rnhW1l6ZoCNNnQ== + "@vue/test-utils@^2.0.0-rc.19": version "2.4.1" resolved "https://registry.yarnpkg.com/@vue/test-utils/-/test-utils-2.4.1.tgz#7db869b4142d2a5fce4ad6c6dfa01c8ea524f26c" @@ -3793,10 +3871,10 @@ cssstyle@^2.3.0: dependencies: cssom "~0.3.6" -csstype@^3.1.1: - version "3.1.2" - resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.2.tgz#1d4bf9d572f11c14031f0436e1c10bc1f571f50b" - integrity sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ== +csstype@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.3.tgz#d80ff294d114fb0e6ac500fbf85b60137d7eff81" + integrity sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw== dash-get@^1.0.2: version "1.0.2" @@ -5593,6 +5671,13 @@ magic-string@^0.30.1: dependencies: "@jridgewell/sourcemap-codec" "^1.4.15" +magic-string@^0.30.11: + version "0.30.14" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.14.tgz#e9bb29870b81cfc1ec3cc656552f5a7fcbf19077" + integrity sha512-5c99P1WKTed11ZC0HMJOj6CDIue6F8ySu+bJL+85q1zBEIY8IklrJ1eiKC2NDRh3Ct3FcvmJPyQHb9erXMTJNw== + dependencies: + "@jridgewell/sourcemap-codec" "^1.5.0" + make-dir@^3.0.0: version "3.1.0" resolved "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz" @@ -6165,6 +6250,11 @@ picocolors@^1.0.0: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== +picocolors@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" + integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== + picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" @@ -6383,6 +6473,15 @@ postcss@^8.4.35: picocolors "^1.0.0" source-map-js "^1.2.0" +postcss@^8.4.48: + version "8.4.49" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.49.tgz#4ea479048ab059ab3ae61d082190fabfd994fe19" + integrity sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA== + dependencies: + nanoid "^3.3.7" + picocolors "^1.1.1" + source-map-js "^1.2.1" + prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz" @@ -7063,6 +7162,11 @@ source-map-js@^1.2.0: resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.0.tgz#16b809c162517b5b8c3e7dcd315a2a5c2612b2af" integrity sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg== +source-map-js@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.1.tgz#1ce5650fddd87abc099eda37dcff024c2667ae46" + integrity sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA== + source-map@^0.6.1, source-map@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" @@ -7739,16 +7843,16 @@ vue-tsc@^2.0.7: "@vue/language-core" "2.0.7" semver "^7.5.4" -vue@^3.3.4: - version "3.3.4" - resolved "https://registry.yarnpkg.com/vue/-/vue-3.3.4.tgz#8ed945d3873667df1d0fcf3b2463ada028f88bd6" - integrity sha512-VTyEYn3yvIeY1Py0WaYGZsXnz3y5UnGi62GjVEqvEGPl6nxbOrCXbVOTQWBEJUqAyTUk2uJ5JLVnYJ6ZzGbrSw== +vue@^3.4.12: + version "3.5.13" + resolved "https://registry.yarnpkg.com/vue/-/vue-3.5.13.tgz#9f760a1a982b09c0c04a867903fc339c9f29ec0a" + integrity sha512-wmeiSMxkZCSc+PM2w2VRsOYAZC8GdipNFRTsLSfodVqI9mbejKeXEGr8SckuLnrQPGe3oJN5c3K0vpoU9q/wCQ== dependencies: - "@vue/compiler-dom" "3.3.4" - "@vue/compiler-sfc" "3.3.4" - "@vue/runtime-dom" "3.3.4" - "@vue/server-renderer" "3.3.4" - "@vue/shared" "3.3.4" + "@vue/compiler-dom" "3.5.13" + "@vue/compiler-sfc" "3.5.13" + "@vue/runtime-dom" "3.5.13" + "@vue/server-renderer" "3.5.13" + "@vue/shared" "3.5.13" w3c-hr-time@^1.0.2: version "1.0.2" diff --git a/press/api/billing.py b/press/api/billing.py index 6c09f2219d..ff446cffb1 100644 --- a/press/api/billing.py +++ b/press/api/billing.py @@ -360,7 +360,7 @@ def finalize_invoices(): @frappe.whitelist() def unpaid_invoices(): team = get_current_team() - invoices = frappe.get_all( + return frappe.db.get_all( "Invoice", { "team": team, @@ -371,7 +371,24 @@ def unpaid_invoices(): order_by="creation asc", ) - return invoices # noqa: RET504 + +@frappe.whitelist() +def get_unpaid_invoices(): + team = get_current_team() + unpaid_invoices = frappe.db.get_all( + "Invoice", + { + "team": team, + "status": "Unpaid", + "type": "Subscription", + }, + ["name", "status", "period_end", "currency", "amount_due", "total"], + order_by="creation asc", + ) + + if len(unpaid_invoices) == 1: + return frappe.get_doc("Invoice", unpaid_invoices[0].name) + return unpaid_invoices @frappe.whitelist()