From e1e5c191122ecb06f64a93e1bfb363eb3b4d6884 Mon Sep 17 00:00:00 2001 From: Babak Alizadeh Date: Fri, 9 May 2025 13:02:39 +0000 Subject: [PATCH] more progress in openbalance and some new options --- .../src/Controller/AdminController.php | 29 - hesabixCore/src/Controller/BuyController.php | 8 +- .../src/Controller/CommodityController.php | 7 +- .../src/Controller/OpenbalanceController.php | 108 + .../src/Controller/ReportController.php | 133 + .../src/Controller/RfsellController.php | 8 +- hesabixCore/src/Controller/SellController.php | 576 +++- .../Controller/System/DatabaseController.php | 255 ++ .../System/RegistrySettingsController.php | 83 + hesabixCore/src/Entity/HesabdariDoc.php | 42 + hesabixCore/src/Entity/HesabdariRow.php | 30 + hesabixCore/src/Service/Explore.php | 23 + install.sh | 101 +- webUI/.gitignore | 0 webUI/LICENSE | 0 webUI/env.d.ts | 0 webUI/index.html | 0 webUI/package.json | 0 webUI/public/.htaccess | 0 webUI/public/dashmix/dashmix.app.min.js | 0 webUI/public/dashmix/dashmix.min.css | 0 webUI/public/favicon.ico | Bin .../fonts/fontawesome/fa-brands-400.ttf | Bin .../fonts/fontawesome/fa-brands-400.woff2 | Bin .../fonts/fontawesome/fa-regular-400.ttf | Bin .../fonts/fontawesome/fa-regular-400.woff2 | Bin .../public/fonts/fontawesome/fa-solid-900.ttf | Bin .../fonts/fontawesome/fa-solid-900.woff2 | Bin .../fonts/fontawesome/fa-v4compatibility.ttf | Bin .../fontawesome/fa-v4compatibility.woff2 | Bin .../fonts/inter/inter-v11-latin-300.woff2 | Bin .../fonts/inter/inter-v11-latin-500.woff2 | Bin .../fonts/inter/inter-v11-latin-600.woff2 | Bin .../fonts/inter/inter-v11-latin-700.woff2 | Bin .../fonts/inter/inter-v11-latin-800.woff2 | Bin .../fonts/inter/inter-v11-latin-900.woff2 | Bin .../fonts/inter/inter-v11-latin-regular.woff2 | Bin webUI/public/fonts/sahel/Sahel-Black-FD.eot | Bin webUI/public/fonts/sahel/Sahel-Black-FD.ttf | Bin webUI/public/fonts/sahel/Sahel-Black-FD.woff | Bin webUI/public/fonts/sahel/Sahel-Black-FD.woff2 | Bin webUI/public/fonts/sahel/Sahel-Bold-FD.eot | Bin webUI/public/fonts/sahel/Sahel-Bold-FD.ttf | Bin webUI/public/fonts/sahel/Sahel-Bold-FD.woff | Bin webUI/public/fonts/sahel/Sahel-Bold-FD.woff2 | Bin webUI/public/fonts/sahel/Sahel-FD.eot | Bin webUI/public/fonts/sahel/Sahel-FD.ttf | Bin webUI/public/fonts/sahel/Sahel-FD.woff | Bin webUI/public/fonts/sahel/Sahel-FD.woff2 | Bin webUI/public/fonts/sahel/Sahel-Light-FD.eot | Bin webUI/public/fonts/sahel/Sahel-Light-FD.ttf | Bin webUI/public/fonts/sahel/Sahel-Light-FD.woff | Bin webUI/public/fonts/sahel/Sahel-Light-FD.woff2 | Bin .../public/fonts/sahel/Sahel-SemiBold-FD.eot | Bin .../public/fonts/sahel/Sahel-SemiBold-FD.ttf | Bin .../public/fonts/sahel/Sahel-SemiBold-FD.woff | Bin .../fonts/sahel/Sahel-SemiBold-FD.woff2 | Bin webUI/public/fonts/sahel/sahel.css | 0 .../public/fonts/shabnam/Shabnam-Bold-FD.eot | Bin .../public/fonts/shabnam/Shabnam-Bold-FD.ttf | Bin .../public/fonts/shabnam/Shabnam-Bold-FD.woff | Bin .../fonts/shabnam/Shabnam-Bold-FD.woff2 | Bin webUI/public/fonts/shabnam/Shabnam-FD.eot | Bin webUI/public/fonts/shabnam/Shabnam-FD.ttf | Bin webUI/public/fonts/shabnam/Shabnam-FD.woff | Bin webUI/public/fonts/shabnam/Shabnam-FD.woff2 | Bin .../public/fonts/shabnam/Shabnam-Light-FD.eot | Bin .../public/fonts/shabnam/Shabnam-Light-FD.ttf | Bin .../fonts/shabnam/Shabnam-Light-FD.woff | Bin .../fonts/shabnam/Shabnam-Light-FD.woff2 | Bin .../fonts/shabnam/Shabnam-Medium-FD.eot | Bin .../fonts/shabnam/Shabnam-Medium-FD.ttf | Bin .../fonts/shabnam/Shabnam-Medium-FD.woff | Bin .../fonts/shabnam/Shabnam-Medium-FD.woff2 | Bin .../public/fonts/shabnam/Shabnam-Thin-FD.eot | Bin .../public/fonts/shabnam/Shabnam-Thin-FD.ttf | Bin .../public/fonts/shabnam/Shabnam-Thin-FD.woff | Bin .../fonts/shabnam/Shabnam-Thin-FD.woff2 | Bin webUI/public/fonts/shabnam/shabnam.css | 0 .../simple-line-icons/Simple-Line-Icons.eot | Bin .../simple-line-icons/Simple-Line-Icons.svg | 0 .../simple-line-icons/Simple-Line-Icons.ttf | Bin .../simple-line-icons/Simple-Line-Icons.woff | Bin .../simple-line-icons/Simple-Line-Icons.woff2 | Bin .../fonts/vazir/ttf/Vazirmatn-Black.ttf | Bin .../public/fonts/vazir/ttf/Vazirmatn-Bold.ttf | Bin .../fonts/vazir/ttf/Vazirmatn-ExtraBold.ttf | Bin .../fonts/vazir/ttf/Vazirmatn-ExtraLight.ttf | Bin .../fonts/vazir/ttf/Vazirmatn-Light.ttf | Bin .../fonts/vazir/ttf/Vazirmatn-Medium.ttf | Bin .../fonts/vazir/ttf/Vazirmatn-Regular.ttf | Bin .../fonts/vazir/ttf/Vazirmatn-SemiBold.ttf | Bin .../public/fonts/vazir/ttf/Vazirmatn-Thin.ttf | Bin .../fonts/vazir/variable/Vazirmatn[wght].ttf | Bin webUI/public/fonts/vazir/vazir.css | 0 .../vazir/webfonts/Vazirmatn-Black.woff2 | Bin .../fonts/vazir/webfonts/Vazirmatn-Bold.woff2 | Bin .../vazir/webfonts/Vazirmatn-ExtraBold.woff2 | Bin .../vazir/webfonts/Vazirmatn-ExtraLight.woff2 | Bin .../vazir/webfonts/Vazirmatn-FD-Black.woff2 | Bin .../vazir/webfonts/Vazirmatn-FD-Bold.woff2 | Bin .../webfonts/Vazirmatn-FD-ExtraBold.woff2 | Bin .../webfonts/Vazirmatn-FD-ExtraLight.woff2 | Bin .../vazir/webfonts/Vazirmatn-FD-Light.woff2 | Bin .../vazir/webfonts/Vazirmatn-FD-Medium.woff2 | Bin .../vazir/webfonts/Vazirmatn-FD-Regular.woff2 | Bin .../webfonts/Vazirmatn-FD-SemiBold.woff2 | Bin .../vazir/webfonts/Vazirmatn-FD-Thin.woff2 | Bin .../vazir/webfonts/Vazirmatn-Light.woff2 | Bin .../vazir/webfonts/Vazirmatn-Medium.woff2 | Bin .../vazir/webfonts/Vazirmatn-Regular.woff2 | Bin .../vazir/webfonts/Vazirmatn-SemiBold.woff2 | Bin .../fonts/vazir/webfonts/Vazirmatn-Thin.woff2 | Bin .../vazir/webfonts/Vazirmatn[wght].woff2 | Bin webUI/public/img/404.gif | Bin webUI/public/img/android-chrome-192x192.png | Bin webUI/public/img/android-chrome-512x512.png | Bin webUI/public/img/apple-touch-icon.png | Bin webUI/public/img/avatar.jpg | Bin webUI/public/img/avatar.png | Bin webUI/public/img/avatar.webp | Bin webUI/public/img/banner1.jpg | Bin webUI/public/img/bg_side_overlay_header.jpg | Bin webUI/public/img/cover.jpg | Bin webUI/public/img/enamad-logo.png | Bin webUI/public/img/favicon-16x16.png | Bin webUI/public/img/favicon-32x32.png | Bin webUI/public/img/favicon.ico | Bin .../img/favicons/apple-touch-icon-180x180.png | Bin webUI/public/img/favicons/favicon-192x192.png | Bin webUI/public/img/favicons/favicon.ico | Bin webUI/public/img/favicons/favicon.png | Bin webUI/public/img/favicons/favw.png | Bin webUI/public/img/favw.png | Bin webUI/public/img/icons/bale-logo.png | Bin webUI/public/img/icons/bank.jpg | Bin webUI/public/img/icons/business.png | Bin webUI/public/img/icons/cashdesk.jpg | Bin webUI/public/img/icons/check.jpg | Bin webUI/public/img/icons/eitaa.jpeg | Bin webUI/public/img/icons/melipayamak.png | Bin webUI/public/img/icons/robika.png | Bin webUI/public/img/icons/salary.jpg | Bin webUI/public/img/icons/telegram.png | Bin webUI/public/img/icons/wallet.png | Bin webUI/public/img/icons/warehouse.jpg | Bin webUI/public/img/icons/zarinpal.png | Bin webUI/public/img/logo-blue.png | Bin webUI/public/img/logo/homescreen144.png | Bin webUI/public/img/logo/homescreen168.png | Bin webUI/public/img/logo/homescreen192.png | Bin webUI/public/img/logo/homescreen256.png | Bin webUI/public/img/logo/homescreen48.png | Bin webUI/public/img/logo/homescreen512.png | Bin webUI/public/img/logo/homescreen72.png | Bin webUI/public/img/logo/homescreen96.png | Bin webUI/public/img/logo/logo500.png | Bin webUI/public/img/payways/pec.ir.png | Bin .../public/img/payways/zarinpal-logo-min.png | Bin webUI/public/img/plugins/accpro.png | Bin webUI/public/img/plugins/accpro/intro.png | Bin webUI/public/img/plugins/apartemanma.jpg | Bin .../public/img/plugins/apartemanma/drawer.jpg | Bin .../public/img/plugins/apartemanma/intro.jpg | Bin webUI/public/img/plugins/club.webp | Bin webUI/public/img/plugins/noghrekoob.jpeg | Bin webUI/public/img/plugins/onlinestore.webp | Bin .../public/img/plugins/onlinestore/intro.webp | Bin webUI/public/img/plugins/repservice.jpg | Bin webUI/public/img/plugins/repservice.png | Bin webUI/public/img/plugins/rest.jpg | Bin webUI/public/img/sabavision.gif | Bin webUI/public/img/site.webmanifest | 0 webUI/public/img/whatsapp.png | Bin webUI/public/img/wp.jpg | Bin webUI/public/img/zarinpal-logo-min.png | Bin webUI/public/manifest.json | 0 webUI/public/service-worker.js | 0 webUI/src/App.vue | 0 webUI/src/assets/dino.png | Bin webUI/src/assets/hero.png | Bin webUI/src/assets/logo.svg | 0 webUI/src/assets/peach.png | Bin webUI/src/assets/site.css | 0 webUI/src/components/ChangePasswordDialog.vue | 0 webUI/src/components/Editor.vue | 0 webUI/src/components/PrintDialog.vue | 0 .../application/buttons/CalculatorButton.vue | 0 .../application/buttons/SecretDialog.vue | 0 .../application/buttons/change_lang.vue | 0 .../application/buttons/notifications_btn.vue | 0 .../application/buttons/profile_btn.vue | 0 webUI/src/components/application/clock.vue | 0 .../application/combobox/currency_cob.vue | 0 .../application/combobox/year_cob.vue | 0 .../application/list/archive_list.vue | 0 .../components/application/list/sms_list.vue | 0 webUI/src/components/forms/Haccountsearch.vue | 0 .../components/forms/Hbankaccountsearch.vue | 0 webUI/src/components/forms/Hbankselect.vue | 0 .../src/components/forms/Hcashdesksearch.vue | 0 .../src/components/forms/Hcommoditysearch.vue | 0 webUI/src/components/forms/Hdatepicker.vue | 0 .../components/forms/HesabdariTreeView.vue | 0 webUI/src/components/forms/Hnumberinput.vue | 0 webUI/src/components/forms/Hpersonsearch.vue | 2 +- webUI/src/components/forms/Hsalarysearch.vue | 0 .../src/components/forms/Htabletreeselect.vue | 0 webUI/src/components/forms/TreeNode.vue | 0 webUI/src/components/widgets/PrintOptions.vue | 21 + webUI/src/components/widgets/ShareOptions.vue | 0 .../widgets/TopCommoditiesChart.vue | 302 +- .../widgets/TopCostCentersChart.vue | 0 .../widgets/TopIncomeCentersChart.vue | 0 webUI/src/css/main.css | 0 webUI/src/hesabixConfig.js | 0 webUI/src/i18n/calendarLocalConfig.ts | 0 webUI/src/i18n/en_lang.ts | 0 webUI/src/i18n/fa_lang.ts | 22 +- webUI/src/i18n/i18n.ts | 0 webUI/src/main.ts | 0 webUI/src/registerServiceWorker.js | 0 webUI/src/router/index.ts | 0 webUI/src/scss/_override.scss | 0 webUI/src/scss/_variables.scss | 0 webUI/src/scss/components/_VAlert.scss | 0 webUI/src/scss/components/_VBadge.scss | 0 webUI/src/scss/components/_VBreadcrumb.scss | 0 webUI/src/scss/components/_VButtons.scss | 0 webUI/src/scss/components/_VCard.scss | 0 webUI/src/scss/components/_VField.scss | 0 webUI/src/scss/components/_VInput.scss | 0 webUI/src/scss/components/_VList.scss | 0 .../scss/components/_VNavigationDrawer.scss | 0 webUI/src/scss/components/_VShadow.scss | 0 webUI/src/scss/components/_VTextField.scss | 0 webUI/src/scss/components/_VTextarea.scss | 0 webUI/src/scss/layout/_container.scss | 0 webUI/src/scss/layout/_footer.scss | 0 webUI/src/scss/layout/_horizontal.scss | 0 webUI/src/scss/layout/_sidebar.scss | 0 webUI/src/scss/layout/_topbar.scss | 0 webUI/src/scss/style.scss | 0 webUI/src/stores/applicationStore.ts | 0 webUI/src/stores/counter.ts | 0 webUI/src/stores/userStore.ts | 0 webUI/src/theme/DarkTheme.ts | 0 webUI/src/theme/LightTheme.ts | 0 webUI/src/views/NotFound.vue | 0 webUI/src/views/acc/App.vue | 0 webUI/src/views/acc/accounting/closeyear.vue | 0 webUI/src/views/acc/accounting/list.vue | 0 webUI/src/views/acc/accounting/mod.vue | 0 .../src/views/acc/accounting/openBalance.vue | 397 ++- webUI/src/views/acc/accounting/table.vue | 0 webUI/src/views/acc/accounting/viewDoc.vue | 0 webUI/src/views/acc/api/list.vue | 0 webUI/src/views/acc/archive/order_new.vue | 0 webUI/src/views/acc/archive/orders_list.vue | 0 webUI/src/views/acc/archive/view_files.vue | 0 webUI/src/views/acc/bank/card.vue | 0 webUI/src/views/acc/bank/list.vue | 0 webUI/src/views/acc/bank/mod.vue | 0 webUI/src/views/acc/buy/list.vue | 0 webUI/src/views/acc/buy/mod.vue | 0 webUI/src/views/acc/buy/viewInvoice.vue | 0 webUI/src/views/acc/cashdesk/card.vue | 0 webUI/src/views/acc/cashdesk/list.vue | 0 webUI/src/views/acc/cashdesk/mod.vue | 0 webUI/src/views/acc/cheque/input.vue | 0 webUI/src/views/acc/cheque/list.vue | 0 webUI/src/views/acc/cheque/mod.vue | 0 webUI/src/views/acc/cheque/output.vue | 0 webUI/src/views/acc/cheque/transfer.vue | 0 webUI/src/views/acc/commodity/cat/list.vue | 0 webUI/src/views/acc/commodity/drop/list.vue | 0 webUI/src/views/acc/commodity/drop/mod.vue | 0 webUI/src/views/acc/commodity/list.vue | 0 webUI/src/views/acc/commodity/mod.vue | 0 .../views/acc/commodity/priceList/list.vue | 0 .../src/views/acc/commodity/priceList/mod.vue | 0 .../acc/commodity/priceList/pricelistedit.vue | 0 .../views/acc/commodity/priceList/view.vue | 0 webUI/src/views/acc/component/Currency.vue | 0 webUI/src/views/acc/component/Year.vue | 0 .../acc/component/archive/archiveUpload.vue | 0 .../acc/component/archive/archive_modal.vue | 0 .../component/commodity/changePriceGroup.vue | 0 .../component/commodity/quickAddCommodity.vue | 0 .../views/acc/component/documentLogButton.vue | 0 webUI/src/views/acc/component/helpBtn.vue | 0 webUI/src/views/acc/component/hitable.vue | 0 .../importModal/commodity-import-excel.vue | 0 .../importModal/person-import-excel.vue | 0 webUI/src/views/acc/component/mostdes.vue | 0 webUI/src/views/acc/component/notes.vue | 0 .../acc/component/notifications/icon.vue | 0 webUI/src/views/acc/component/person.vue | 0 .../views/acc/component/person/quickAdd.vue | 0 .../views/acc/component/person/quickView.vue | 0 webUI/src/views/acc/component/rec.vue | 0 webUI/src/views/acc/component/recList.vue | 0 .../acc/component/reports/detailsBtn.vue | 0 webUI/src/views/acc/component/send.vue | 0 webUI/src/views/acc/component/smsPanel.vue | 0 .../views/acc/component/widgets/saleChart.vue | 0 webUI/src/views/acc/costs/list.vue | 0 webUI/src/views/acc/costs/mod.vue | 0 webUI/src/views/acc/dashboard.vue | 67 +- webUI/src/views/acc/incomes/list.vue | 0 webUI/src/views/acc/incomes/mod.vue | 0 .../views/acc/notifications/notifications.vue | 0 webUI/src/views/acc/persons/card.vue | 0 webUI/src/views/acc/persons/insert.vue | 0 webUI/src/views/acc/persons/list.vue | 0 webUI/src/views/acc/persons/receive/list.vue | 0 webUI/src/views/acc/persons/receive/mod.vue | 0 webUI/src/views/acc/persons/send/list.vue | 0 webUI/src/views/acc/persons/send/mod.vue | 0 webUI/src/views/acc/plugins/accpro/intro.vue | 0 .../views/acc/plugins/amartemanma/intro.vue | 0 webUI/src/views/acc/plugins/cc/intro.vue | 0 .../acc/plugins/noghre/employess/list.vue | 0 .../acc/plugins/noghre/employess/mod.vue | 0 webUI/src/views/acc/plugins/noghre/intro.vue | 0 .../views/acc/plugins/noghre/order/list.vue | 0 .../views/acc/plugins/noghre/order/mod.vue | 0 .../views/acc/plugins/noghre/order/view.vue | 0 webUI/src/views/acc/plugins/noghre/pays.vue | 0 .../acc/plugins/onlinestore/dashboard.vue | 0 .../views/acc/plugins/onlinestore/intro.vue | 0 .../views/acc/plugins/repservice/intro.vue | 0 .../src/views/acc/plugins/repservice/list.vue | 0 .../src/views/acc/plugins/repservice/mod.vue | 0 .../src/views/acc/plugins/repservice/view.vue | 0 webUI/src/views/acc/plugins/resamap/intro.vue | 0 webUI/src/views/acc/presell/list.vue | 0 webUI/src/views/acc/presell/mod.vue | 0 webUI/src/views/acc/presell/view.vue | 0 webUI/src/views/acc/presell/viewInvoice.vue | 0 webUI/src/views/acc/printers/list.vue | 0 webUI/src/views/acc/printers/printList.vue | 0 webUI/src/views/acc/printers/queue.vue | 0 webUI/src/views/acc/printers/templates.vue | 0 webUI/src/views/acc/reports/balanceSheet.vue | 0 .../reports/commodity/buysellByCommodity.vue | 0 .../views/acc/reports/explore_accounts.vue | 0 .../acc/reports/persons/buysellByPerson.vue | 0 .../src/views/acc/reports/persons/debtors.vue | 0 .../views/acc/reports/persons/depositors.vue | 0 webUI/src/views/acc/reports/reports.vue | 0 webUI/src/views/acc/rfbuy/list.vue | 0 webUI/src/views/acc/rfbuy/mod.vue | 0 webUI/src/views/acc/rfbuy/viewInvoice.vue | 0 webUI/src/views/acc/rfsell/list.vue | 0 webUI/src/views/acc/rfsell/mod.vue | 0 webUI/src/views/acc/rfsell/viewInvoice.vue | 0 webUI/src/views/acc/router/index.js | 0 webUI/src/views/acc/salary/card.vue | 0 webUI/src/views/acc/salary/list.vue | 0 webUI/src/views/acc/salary/mod.vue | 0 webUI/src/views/acc/sell/fastMod.vue | 5 +- webUI/src/views/acc/sell/list.vue | 54 +- webUI/src/views/acc/sell/mod.vue | 2464 +++++++++-------- webUI/src/views/acc/sell/viewInvoice.vue | 0 webUI/src/views/acc/settings/avatar.vue | 0 webUI/src/views/acc/settings/bussiness.vue | 0 webUI/src/views/acc/settings/extramoneys.vue | 0 webUI/src/views/acc/settings/logs.vue | 0 webUI/src/views/acc/settings/print.vue | 0 .../src/views/acc/settings/user_perm_edit.vue | 0 webUI/src/views/acc/settings/user_rolls.vue | 0 webUI/src/views/acc/shareholder/list.vue | 0 webUI/src/views/acc/smspanel/smspanel.vue | 0 webUI/src/views/acc/store/plugin-invoice.vue | 0 webUI/src/views/acc/store/plugin-my.vue | 0 webUI/src/views/acc/store/plugin-world.vue | 0 webUI/src/views/acc/store/viewProdect.vue | 0 .../commodityCheck/checkByStoreroom.vue | 0 webUI/src/views/acc/storeroom/io/buy.vue | 0 webUI/src/views/acc/storeroom/io/modalNew.vue | 0 webUI/src/views/acc/storeroom/io/rfbuy.vue | 0 webUI/src/views/acc/storeroom/io/rfsell.vue | 0 webUI/src/views/acc/storeroom/io/sell.vue | 0 .../src/views/acc/storeroom/io/ticketList.vue | 0 webUI/src/views/acc/storeroom/io/view.vue | 0 webUI/src/views/acc/storeroom/list.vue | 0 webUI/src/views/acc/storeroom/mod.vue | 0 webUI/src/views/acc/transfer/list.vue | 0 webUI/src/views/acc/transfer/mod.vue | 0 webUI/src/views/acc/ultimatepackage/list.vue | 0 webUI/src/views/acc/ultimatepackage/new.vue | 0 webUI/src/views/acc/wallet/view.vue | 0 webUI/src/views/user/App.vue | 0 webUI/src/views/user/InstallPWA.vue | 0 webUI/src/views/user/ReferralRedirect.vue | 0 webUI/src/views/user/active-account.vue | 0 webUI/src/views/user/change-password.vue | 0 webUI/src/views/user/login.vue | 0 .../src/views/user/manager/business/list.vue | 0 webUI/src/views/user/manager/log/logs.vue | 0 webUI/src/views/user/manager/online-users.vue | 0 .../views/user/manager/reportchange/list.vue | 0 .../views/user/manager/reportchange/mod.vue | 0 .../user/manager/settings/database_info.vue | 154 +- .../views/user/manager/settings/plugins.vue | 0 .../views/user/manager/settings/registry.vue | 197 ++ .../user/manager/settings/sms/smsSettings.vue | 0 .../views/user/manager/settings/system.vue | 0 .../user/manager/settings/update-core.vue | 0 .../views/user/manager/statements/list.vue | 0 .../src/views/user/manager/statements/mod.vue | 0 webUI/src/views/user/manager/support/list.vue | 0 webUI/src/views/user/manager/support/show.vue | 0 .../user/manager/users/change-password.vue | 0 webUI/src/views/user/manager/users/list.vue | 0 webUI/src/views/user/manager/wallet/list.vue | 0 webUI/src/views/user/profile/add-mobile.vue | 0 .../views/user/profile/business/insert.vue | 0 .../src/views/user/profile/business/list.vue | 0 webUI/src/views/user/profile/dashboard.vue | 0 .../profile/forget-password-submit-code.vue | 0 .../views/user/profile/forget-password.vue | 0 webUI/src/views/user/profile/profile-main.vue | 0 webUI/src/views/user/profile/support/list.vue | 0 webUI/src/views/user/profile/support/new.vue | 0 webUI/src/views/user/profile/support/show.vue | 0 webUI/src/views/user/register.vue | 0 webUI/src/views/user/single.vue | 0 webUI/src/views/wizard/home.vue | 0 webUI/tsconfig.config.json | 0 webUI/tsconfig.json | 0 webUI/vite.config.ts | 0 webUI/workbox-config.js | 0 434 files changed, 3592 insertions(+), 1496 deletions(-) create mode 100644 hesabixCore/src/Controller/System/DatabaseController.php mode change 100755 => 100644 webUI/.gitignore mode change 100755 => 100644 webUI/LICENSE mode change 100755 => 100644 webUI/env.d.ts mode change 100755 => 100644 webUI/index.html mode change 100755 => 100644 webUI/package.json mode change 100755 => 100644 webUI/public/.htaccess mode change 100755 => 100644 webUI/public/dashmix/dashmix.app.min.js mode change 100755 => 100644 webUI/public/dashmix/dashmix.min.css mode change 100755 => 100644 webUI/public/favicon.ico mode change 100755 => 100644 webUI/public/fonts/fontawesome/fa-brands-400.ttf mode change 100755 => 100644 webUI/public/fonts/fontawesome/fa-brands-400.woff2 mode change 100755 => 100644 webUI/public/fonts/fontawesome/fa-regular-400.ttf mode change 100755 => 100644 webUI/public/fonts/fontawesome/fa-regular-400.woff2 mode change 100755 => 100644 webUI/public/fonts/fontawesome/fa-solid-900.ttf mode change 100755 => 100644 webUI/public/fonts/fontawesome/fa-solid-900.woff2 mode change 100755 => 100644 webUI/public/fonts/fontawesome/fa-v4compatibility.ttf mode change 100755 => 100644 webUI/public/fonts/fontawesome/fa-v4compatibility.woff2 mode change 100755 => 100644 webUI/public/fonts/inter/inter-v11-latin-300.woff2 mode change 100755 => 100644 webUI/public/fonts/inter/inter-v11-latin-500.woff2 mode change 100755 => 100644 webUI/public/fonts/inter/inter-v11-latin-600.woff2 mode change 100755 => 100644 webUI/public/fonts/inter/inter-v11-latin-700.woff2 mode change 100755 => 100644 webUI/public/fonts/inter/inter-v11-latin-800.woff2 mode change 100755 => 100644 webUI/public/fonts/inter/inter-v11-latin-900.woff2 mode change 100755 => 100644 webUI/public/fonts/inter/inter-v11-latin-regular.woff2 mode change 100755 => 100644 webUI/public/fonts/sahel/Sahel-Black-FD.eot mode change 100755 => 100644 webUI/public/fonts/sahel/Sahel-Black-FD.ttf mode change 100755 => 100644 webUI/public/fonts/sahel/Sahel-Black-FD.woff mode change 100755 => 100644 webUI/public/fonts/sahel/Sahel-Black-FD.woff2 mode change 100755 => 100644 webUI/public/fonts/sahel/Sahel-Bold-FD.eot mode change 100755 => 100644 webUI/public/fonts/sahel/Sahel-Bold-FD.ttf mode change 100755 => 100644 webUI/public/fonts/sahel/Sahel-Bold-FD.woff mode change 100755 => 100644 webUI/public/fonts/sahel/Sahel-Bold-FD.woff2 mode change 100755 => 100644 webUI/public/fonts/sahel/Sahel-FD.eot mode change 100755 => 100644 webUI/public/fonts/sahel/Sahel-FD.ttf mode change 100755 => 100644 webUI/public/fonts/sahel/Sahel-FD.woff mode change 100755 => 100644 webUI/public/fonts/sahel/Sahel-FD.woff2 mode change 100755 => 100644 webUI/public/fonts/sahel/Sahel-Light-FD.eot mode change 100755 => 100644 webUI/public/fonts/sahel/Sahel-Light-FD.ttf mode change 100755 => 100644 webUI/public/fonts/sahel/Sahel-Light-FD.woff mode change 100755 => 100644 webUI/public/fonts/sahel/Sahel-Light-FD.woff2 mode change 100755 => 100644 webUI/public/fonts/sahel/Sahel-SemiBold-FD.eot mode change 100755 => 100644 webUI/public/fonts/sahel/Sahel-SemiBold-FD.ttf mode change 100755 => 100644 webUI/public/fonts/sahel/Sahel-SemiBold-FD.woff mode change 100755 => 100644 webUI/public/fonts/sahel/Sahel-SemiBold-FD.woff2 mode change 100755 => 100644 webUI/public/fonts/sahel/sahel.css mode change 100755 => 100644 webUI/public/fonts/shabnam/Shabnam-Bold-FD.eot mode change 100755 => 100644 webUI/public/fonts/shabnam/Shabnam-Bold-FD.ttf mode change 100755 => 100644 webUI/public/fonts/shabnam/Shabnam-Bold-FD.woff mode change 100755 => 100644 webUI/public/fonts/shabnam/Shabnam-Bold-FD.woff2 mode change 100755 => 100644 webUI/public/fonts/shabnam/Shabnam-FD.eot mode change 100755 => 100644 webUI/public/fonts/shabnam/Shabnam-FD.ttf mode change 100755 => 100644 webUI/public/fonts/shabnam/Shabnam-FD.woff mode change 100755 => 100644 webUI/public/fonts/shabnam/Shabnam-FD.woff2 mode change 100755 => 100644 webUI/public/fonts/shabnam/Shabnam-Light-FD.eot mode change 100755 => 100644 webUI/public/fonts/shabnam/Shabnam-Light-FD.ttf mode change 100755 => 100644 webUI/public/fonts/shabnam/Shabnam-Light-FD.woff mode change 100755 => 100644 webUI/public/fonts/shabnam/Shabnam-Light-FD.woff2 mode change 100755 => 100644 webUI/public/fonts/shabnam/Shabnam-Medium-FD.eot mode change 100755 => 100644 webUI/public/fonts/shabnam/Shabnam-Medium-FD.ttf mode change 100755 => 100644 webUI/public/fonts/shabnam/Shabnam-Medium-FD.woff mode change 100755 => 100644 webUI/public/fonts/shabnam/Shabnam-Medium-FD.woff2 mode change 100755 => 100644 webUI/public/fonts/shabnam/Shabnam-Thin-FD.eot mode change 100755 => 100644 webUI/public/fonts/shabnam/Shabnam-Thin-FD.ttf mode change 100755 => 100644 webUI/public/fonts/shabnam/Shabnam-Thin-FD.woff mode change 100755 => 100644 webUI/public/fonts/shabnam/Shabnam-Thin-FD.woff2 mode change 100755 => 100644 webUI/public/fonts/shabnam/shabnam.css mode change 100755 => 100644 webUI/public/fonts/simple-line-icons/Simple-Line-Icons.eot mode change 100755 => 100644 webUI/public/fonts/simple-line-icons/Simple-Line-Icons.svg mode change 100755 => 100644 webUI/public/fonts/simple-line-icons/Simple-Line-Icons.ttf mode change 100755 => 100644 webUI/public/fonts/simple-line-icons/Simple-Line-Icons.woff mode change 100755 => 100644 webUI/public/fonts/simple-line-icons/Simple-Line-Icons.woff2 mode change 100755 => 100644 webUI/public/fonts/vazir/ttf/Vazirmatn-Black.ttf mode change 100755 => 100644 webUI/public/fonts/vazir/ttf/Vazirmatn-Bold.ttf mode change 100755 => 100644 webUI/public/fonts/vazir/ttf/Vazirmatn-ExtraBold.ttf mode change 100755 => 100644 webUI/public/fonts/vazir/ttf/Vazirmatn-ExtraLight.ttf mode change 100755 => 100644 webUI/public/fonts/vazir/ttf/Vazirmatn-Light.ttf mode change 100755 => 100644 webUI/public/fonts/vazir/ttf/Vazirmatn-Medium.ttf mode change 100755 => 100644 webUI/public/fonts/vazir/ttf/Vazirmatn-Regular.ttf mode change 100755 => 100644 webUI/public/fonts/vazir/ttf/Vazirmatn-SemiBold.ttf mode change 100755 => 100644 webUI/public/fonts/vazir/ttf/Vazirmatn-Thin.ttf mode change 100755 => 100644 webUI/public/fonts/vazir/variable/Vazirmatn[wght].ttf mode change 100755 => 100644 webUI/public/fonts/vazir/vazir.css mode change 100755 => 100644 webUI/public/fonts/vazir/webfonts/Vazirmatn-Black.woff2 mode change 100755 => 100644 webUI/public/fonts/vazir/webfonts/Vazirmatn-Bold.woff2 mode change 100755 => 100644 webUI/public/fonts/vazir/webfonts/Vazirmatn-ExtraBold.woff2 mode change 100755 => 100644 webUI/public/fonts/vazir/webfonts/Vazirmatn-ExtraLight.woff2 mode change 100755 => 100644 webUI/public/fonts/vazir/webfonts/Vazirmatn-FD-Black.woff2 mode change 100755 => 100644 webUI/public/fonts/vazir/webfonts/Vazirmatn-FD-Bold.woff2 mode change 100755 => 100644 webUI/public/fonts/vazir/webfonts/Vazirmatn-FD-ExtraBold.woff2 mode change 100755 => 100644 webUI/public/fonts/vazir/webfonts/Vazirmatn-FD-ExtraLight.woff2 mode change 100755 => 100644 webUI/public/fonts/vazir/webfonts/Vazirmatn-FD-Light.woff2 mode change 100755 => 100644 webUI/public/fonts/vazir/webfonts/Vazirmatn-FD-Medium.woff2 mode change 100755 => 100644 webUI/public/fonts/vazir/webfonts/Vazirmatn-FD-Regular.woff2 mode change 100755 => 100644 webUI/public/fonts/vazir/webfonts/Vazirmatn-FD-SemiBold.woff2 mode change 100755 => 100644 webUI/public/fonts/vazir/webfonts/Vazirmatn-FD-Thin.woff2 mode change 100755 => 100644 webUI/public/fonts/vazir/webfonts/Vazirmatn-Light.woff2 mode change 100755 => 100644 webUI/public/fonts/vazir/webfonts/Vazirmatn-Medium.woff2 mode change 100755 => 100644 webUI/public/fonts/vazir/webfonts/Vazirmatn-Regular.woff2 mode change 100755 => 100644 webUI/public/fonts/vazir/webfonts/Vazirmatn-SemiBold.woff2 mode change 100755 => 100644 webUI/public/fonts/vazir/webfonts/Vazirmatn-Thin.woff2 mode change 100755 => 100644 webUI/public/fonts/vazir/webfonts/Vazirmatn[wght].woff2 mode change 100755 => 100644 webUI/public/img/404.gif mode change 100755 => 100644 webUI/public/img/android-chrome-192x192.png mode change 100755 => 100644 webUI/public/img/android-chrome-512x512.png mode change 100755 => 100644 webUI/public/img/apple-touch-icon.png mode change 100755 => 100644 webUI/public/img/avatar.jpg mode change 100755 => 100644 webUI/public/img/avatar.png mode change 100755 => 100644 webUI/public/img/avatar.webp mode change 100755 => 100644 webUI/public/img/banner1.jpg mode change 100755 => 100644 webUI/public/img/bg_side_overlay_header.jpg mode change 100755 => 100644 webUI/public/img/cover.jpg mode change 100755 => 100644 webUI/public/img/enamad-logo.png mode change 100755 => 100644 webUI/public/img/favicon-16x16.png mode change 100755 => 100644 webUI/public/img/favicon-32x32.png mode change 100755 => 100644 webUI/public/img/favicon.ico mode change 100755 => 100644 webUI/public/img/favicons/apple-touch-icon-180x180.png mode change 100755 => 100644 webUI/public/img/favicons/favicon-192x192.png mode change 100755 => 100644 webUI/public/img/favicons/favicon.ico mode change 100755 => 100644 webUI/public/img/favicons/favicon.png mode change 100755 => 100644 webUI/public/img/favicons/favw.png mode change 100755 => 100644 webUI/public/img/favw.png mode change 100755 => 100644 webUI/public/img/icons/bale-logo.png mode change 100755 => 100644 webUI/public/img/icons/bank.jpg mode change 100755 => 100644 webUI/public/img/icons/business.png mode change 100755 => 100644 webUI/public/img/icons/cashdesk.jpg mode change 100755 => 100644 webUI/public/img/icons/check.jpg mode change 100755 => 100644 webUI/public/img/icons/eitaa.jpeg mode change 100755 => 100644 webUI/public/img/icons/melipayamak.png mode change 100755 => 100644 webUI/public/img/icons/robika.png mode change 100755 => 100644 webUI/public/img/icons/salary.jpg mode change 100755 => 100644 webUI/public/img/icons/telegram.png mode change 100755 => 100644 webUI/public/img/icons/wallet.png mode change 100755 => 100644 webUI/public/img/icons/warehouse.jpg mode change 100755 => 100644 webUI/public/img/icons/zarinpal.png mode change 100755 => 100644 webUI/public/img/logo-blue.png mode change 100755 => 100644 webUI/public/img/logo/homescreen144.png mode change 100755 => 100644 webUI/public/img/logo/homescreen168.png mode change 100755 => 100644 webUI/public/img/logo/homescreen192.png mode change 100755 => 100644 webUI/public/img/logo/homescreen256.png mode change 100755 => 100644 webUI/public/img/logo/homescreen48.png mode change 100755 => 100644 webUI/public/img/logo/homescreen512.png mode change 100755 => 100644 webUI/public/img/logo/homescreen72.png mode change 100755 => 100644 webUI/public/img/logo/homescreen96.png mode change 100755 => 100644 webUI/public/img/logo/logo500.png mode change 100755 => 100644 webUI/public/img/payways/pec.ir.png mode change 100755 => 100644 webUI/public/img/payways/zarinpal-logo-min.png mode change 100755 => 100644 webUI/public/img/plugins/accpro.png mode change 100755 => 100644 webUI/public/img/plugins/accpro/intro.png mode change 100755 => 100644 webUI/public/img/plugins/apartemanma.jpg mode change 100755 => 100644 webUI/public/img/plugins/apartemanma/drawer.jpg mode change 100755 => 100644 webUI/public/img/plugins/apartemanma/intro.jpg mode change 100755 => 100644 webUI/public/img/plugins/club.webp mode change 100755 => 100644 webUI/public/img/plugins/noghrekoob.jpeg mode change 100755 => 100644 webUI/public/img/plugins/onlinestore.webp mode change 100755 => 100644 webUI/public/img/plugins/onlinestore/intro.webp mode change 100755 => 100644 webUI/public/img/plugins/repservice.jpg mode change 100755 => 100644 webUI/public/img/plugins/repservice.png mode change 100755 => 100644 webUI/public/img/plugins/rest.jpg mode change 100755 => 100644 webUI/public/img/sabavision.gif mode change 100755 => 100644 webUI/public/img/site.webmanifest mode change 100755 => 100644 webUI/public/img/whatsapp.png mode change 100755 => 100644 webUI/public/img/wp.jpg mode change 100755 => 100644 webUI/public/img/zarinpal-logo-min.png mode change 100755 => 100644 webUI/public/manifest.json mode change 100755 => 100644 webUI/public/service-worker.js mode change 100755 => 100644 webUI/src/App.vue mode change 100755 => 100644 webUI/src/assets/dino.png mode change 100755 => 100644 webUI/src/assets/hero.png mode change 100755 => 100644 webUI/src/assets/logo.svg mode change 100755 => 100644 webUI/src/assets/peach.png mode change 100755 => 100644 webUI/src/assets/site.css mode change 100755 => 100644 webUI/src/components/ChangePasswordDialog.vue mode change 100755 => 100644 webUI/src/components/Editor.vue mode change 100755 => 100644 webUI/src/components/PrintDialog.vue mode change 100755 => 100644 webUI/src/components/application/buttons/CalculatorButton.vue mode change 100755 => 100644 webUI/src/components/application/buttons/SecretDialog.vue mode change 100755 => 100644 webUI/src/components/application/buttons/change_lang.vue mode change 100755 => 100644 webUI/src/components/application/buttons/notifications_btn.vue mode change 100755 => 100644 webUI/src/components/application/buttons/profile_btn.vue mode change 100755 => 100644 webUI/src/components/application/clock.vue mode change 100755 => 100644 webUI/src/components/application/combobox/currency_cob.vue mode change 100755 => 100644 webUI/src/components/application/combobox/year_cob.vue mode change 100755 => 100644 webUI/src/components/application/list/archive_list.vue mode change 100755 => 100644 webUI/src/components/application/list/sms_list.vue mode change 100755 => 100644 webUI/src/components/forms/Haccountsearch.vue mode change 100755 => 100644 webUI/src/components/forms/Hbankaccountsearch.vue mode change 100755 => 100644 webUI/src/components/forms/Hbankselect.vue mode change 100755 => 100644 webUI/src/components/forms/Hcashdesksearch.vue mode change 100755 => 100644 webUI/src/components/forms/Hcommoditysearch.vue mode change 100755 => 100644 webUI/src/components/forms/Hdatepicker.vue mode change 100755 => 100644 webUI/src/components/forms/HesabdariTreeView.vue mode change 100755 => 100644 webUI/src/components/forms/Hnumberinput.vue mode change 100755 => 100644 webUI/src/components/forms/Hpersonsearch.vue mode change 100755 => 100644 webUI/src/components/forms/Hsalarysearch.vue mode change 100755 => 100644 webUI/src/components/forms/Htabletreeselect.vue mode change 100755 => 100644 webUI/src/components/forms/TreeNode.vue mode change 100755 => 100644 webUI/src/components/widgets/PrintOptions.vue mode change 100755 => 100644 webUI/src/components/widgets/ShareOptions.vue mode change 100755 => 100644 webUI/src/components/widgets/TopCommoditiesChart.vue mode change 100755 => 100644 webUI/src/components/widgets/TopCostCentersChart.vue mode change 100755 => 100644 webUI/src/components/widgets/TopIncomeCentersChart.vue mode change 100755 => 100644 webUI/src/css/main.css mode change 100755 => 100644 webUI/src/hesabixConfig.js mode change 100755 => 100644 webUI/src/i18n/calendarLocalConfig.ts mode change 100755 => 100644 webUI/src/i18n/en_lang.ts mode change 100755 => 100644 webUI/src/i18n/fa_lang.ts mode change 100755 => 100644 webUI/src/i18n/i18n.ts mode change 100755 => 100644 webUI/src/main.ts mode change 100755 => 100644 webUI/src/registerServiceWorker.js mode change 100755 => 100644 webUI/src/router/index.ts mode change 100755 => 100644 webUI/src/scss/_override.scss mode change 100755 => 100644 webUI/src/scss/_variables.scss mode change 100755 => 100644 webUI/src/scss/components/_VAlert.scss mode change 100755 => 100644 webUI/src/scss/components/_VBadge.scss mode change 100755 => 100644 webUI/src/scss/components/_VBreadcrumb.scss mode change 100755 => 100644 webUI/src/scss/components/_VButtons.scss mode change 100755 => 100644 webUI/src/scss/components/_VCard.scss mode change 100755 => 100644 webUI/src/scss/components/_VField.scss mode change 100755 => 100644 webUI/src/scss/components/_VInput.scss mode change 100755 => 100644 webUI/src/scss/components/_VList.scss mode change 100755 => 100644 webUI/src/scss/components/_VNavigationDrawer.scss mode change 100755 => 100644 webUI/src/scss/components/_VShadow.scss mode change 100755 => 100644 webUI/src/scss/components/_VTextField.scss mode change 100755 => 100644 webUI/src/scss/components/_VTextarea.scss mode change 100755 => 100644 webUI/src/scss/layout/_container.scss mode change 100755 => 100644 webUI/src/scss/layout/_footer.scss mode change 100755 => 100644 webUI/src/scss/layout/_horizontal.scss mode change 100755 => 100644 webUI/src/scss/layout/_sidebar.scss mode change 100755 => 100644 webUI/src/scss/layout/_topbar.scss mode change 100755 => 100644 webUI/src/scss/style.scss mode change 100755 => 100644 webUI/src/stores/applicationStore.ts mode change 100755 => 100644 webUI/src/stores/counter.ts mode change 100755 => 100644 webUI/src/stores/userStore.ts mode change 100755 => 100644 webUI/src/theme/DarkTheme.ts mode change 100755 => 100644 webUI/src/theme/LightTheme.ts mode change 100755 => 100644 webUI/src/views/NotFound.vue mode change 100755 => 100644 webUI/src/views/acc/App.vue mode change 100755 => 100644 webUI/src/views/acc/accounting/closeyear.vue mode change 100755 => 100644 webUI/src/views/acc/accounting/list.vue mode change 100755 => 100644 webUI/src/views/acc/accounting/mod.vue mode change 100755 => 100644 webUI/src/views/acc/accounting/openBalance.vue mode change 100755 => 100644 webUI/src/views/acc/accounting/table.vue mode change 100755 => 100644 webUI/src/views/acc/accounting/viewDoc.vue mode change 100755 => 100644 webUI/src/views/acc/api/list.vue mode change 100755 => 100644 webUI/src/views/acc/archive/order_new.vue mode change 100755 => 100644 webUI/src/views/acc/archive/orders_list.vue mode change 100755 => 100644 webUI/src/views/acc/archive/view_files.vue mode change 100755 => 100644 webUI/src/views/acc/bank/card.vue mode change 100755 => 100644 webUI/src/views/acc/bank/list.vue mode change 100755 => 100644 webUI/src/views/acc/bank/mod.vue mode change 100755 => 100644 webUI/src/views/acc/buy/list.vue mode change 100755 => 100644 webUI/src/views/acc/buy/mod.vue mode change 100755 => 100644 webUI/src/views/acc/buy/viewInvoice.vue mode change 100755 => 100644 webUI/src/views/acc/cashdesk/card.vue mode change 100755 => 100644 webUI/src/views/acc/cashdesk/list.vue mode change 100755 => 100644 webUI/src/views/acc/cashdesk/mod.vue mode change 100755 => 100644 webUI/src/views/acc/cheque/input.vue mode change 100755 => 100644 webUI/src/views/acc/cheque/list.vue mode change 100755 => 100644 webUI/src/views/acc/cheque/mod.vue mode change 100755 => 100644 webUI/src/views/acc/cheque/output.vue mode change 100755 => 100644 webUI/src/views/acc/cheque/transfer.vue mode change 100755 => 100644 webUI/src/views/acc/commodity/cat/list.vue mode change 100755 => 100644 webUI/src/views/acc/commodity/drop/list.vue mode change 100755 => 100644 webUI/src/views/acc/commodity/drop/mod.vue mode change 100755 => 100644 webUI/src/views/acc/commodity/list.vue mode change 100755 => 100644 webUI/src/views/acc/commodity/mod.vue mode change 100755 => 100644 webUI/src/views/acc/commodity/priceList/list.vue mode change 100755 => 100644 webUI/src/views/acc/commodity/priceList/mod.vue mode change 100755 => 100644 webUI/src/views/acc/commodity/priceList/pricelistedit.vue mode change 100755 => 100644 webUI/src/views/acc/commodity/priceList/view.vue mode change 100755 => 100644 webUI/src/views/acc/component/Currency.vue mode change 100755 => 100644 webUI/src/views/acc/component/Year.vue mode change 100755 => 100644 webUI/src/views/acc/component/archive/archiveUpload.vue mode change 100755 => 100644 webUI/src/views/acc/component/archive/archive_modal.vue mode change 100755 => 100644 webUI/src/views/acc/component/commodity/changePriceGroup.vue mode change 100755 => 100644 webUI/src/views/acc/component/commodity/quickAddCommodity.vue mode change 100755 => 100644 webUI/src/views/acc/component/documentLogButton.vue mode change 100755 => 100644 webUI/src/views/acc/component/helpBtn.vue mode change 100755 => 100644 webUI/src/views/acc/component/hitable.vue mode change 100755 => 100644 webUI/src/views/acc/component/importModal/commodity-import-excel.vue mode change 100755 => 100644 webUI/src/views/acc/component/importModal/person-import-excel.vue mode change 100755 => 100644 webUI/src/views/acc/component/mostdes.vue mode change 100755 => 100644 webUI/src/views/acc/component/notes.vue mode change 100755 => 100644 webUI/src/views/acc/component/notifications/icon.vue mode change 100755 => 100644 webUI/src/views/acc/component/person.vue mode change 100755 => 100644 webUI/src/views/acc/component/person/quickAdd.vue mode change 100755 => 100644 webUI/src/views/acc/component/person/quickView.vue mode change 100755 => 100644 webUI/src/views/acc/component/rec.vue mode change 100755 => 100644 webUI/src/views/acc/component/recList.vue mode change 100755 => 100644 webUI/src/views/acc/component/reports/detailsBtn.vue mode change 100755 => 100644 webUI/src/views/acc/component/send.vue mode change 100755 => 100644 webUI/src/views/acc/component/smsPanel.vue mode change 100755 => 100644 webUI/src/views/acc/component/widgets/saleChart.vue mode change 100755 => 100644 webUI/src/views/acc/costs/list.vue mode change 100755 => 100644 webUI/src/views/acc/costs/mod.vue mode change 100755 => 100644 webUI/src/views/acc/dashboard.vue mode change 100755 => 100644 webUI/src/views/acc/incomes/list.vue mode change 100755 => 100644 webUI/src/views/acc/incomes/mod.vue mode change 100755 => 100644 webUI/src/views/acc/notifications/notifications.vue mode change 100755 => 100644 webUI/src/views/acc/persons/card.vue mode change 100755 => 100644 webUI/src/views/acc/persons/insert.vue mode change 100755 => 100644 webUI/src/views/acc/persons/list.vue mode change 100755 => 100644 webUI/src/views/acc/persons/receive/list.vue mode change 100755 => 100644 webUI/src/views/acc/persons/receive/mod.vue mode change 100755 => 100644 webUI/src/views/acc/persons/send/list.vue mode change 100755 => 100644 webUI/src/views/acc/persons/send/mod.vue mode change 100755 => 100644 webUI/src/views/acc/plugins/accpro/intro.vue mode change 100755 => 100644 webUI/src/views/acc/plugins/amartemanma/intro.vue mode change 100755 => 100644 webUI/src/views/acc/plugins/cc/intro.vue mode change 100755 => 100644 webUI/src/views/acc/plugins/noghre/employess/list.vue mode change 100755 => 100644 webUI/src/views/acc/plugins/noghre/employess/mod.vue mode change 100755 => 100644 webUI/src/views/acc/plugins/noghre/intro.vue mode change 100755 => 100644 webUI/src/views/acc/plugins/noghre/order/list.vue mode change 100755 => 100644 webUI/src/views/acc/plugins/noghre/order/mod.vue mode change 100755 => 100644 webUI/src/views/acc/plugins/noghre/order/view.vue mode change 100755 => 100644 webUI/src/views/acc/plugins/noghre/pays.vue mode change 100755 => 100644 webUI/src/views/acc/plugins/onlinestore/dashboard.vue mode change 100755 => 100644 webUI/src/views/acc/plugins/onlinestore/intro.vue mode change 100755 => 100644 webUI/src/views/acc/plugins/repservice/intro.vue mode change 100755 => 100644 webUI/src/views/acc/plugins/repservice/list.vue mode change 100755 => 100644 webUI/src/views/acc/plugins/repservice/mod.vue mode change 100755 => 100644 webUI/src/views/acc/plugins/repservice/view.vue mode change 100755 => 100644 webUI/src/views/acc/plugins/resamap/intro.vue mode change 100755 => 100644 webUI/src/views/acc/presell/list.vue mode change 100755 => 100644 webUI/src/views/acc/presell/mod.vue mode change 100755 => 100644 webUI/src/views/acc/presell/view.vue mode change 100755 => 100644 webUI/src/views/acc/presell/viewInvoice.vue mode change 100755 => 100644 webUI/src/views/acc/printers/list.vue mode change 100755 => 100644 webUI/src/views/acc/printers/printList.vue mode change 100755 => 100644 webUI/src/views/acc/printers/queue.vue mode change 100755 => 100644 webUI/src/views/acc/printers/templates.vue mode change 100755 => 100644 webUI/src/views/acc/reports/balanceSheet.vue mode change 100755 => 100644 webUI/src/views/acc/reports/commodity/buysellByCommodity.vue mode change 100755 => 100644 webUI/src/views/acc/reports/explore_accounts.vue mode change 100755 => 100644 webUI/src/views/acc/reports/persons/buysellByPerson.vue mode change 100755 => 100644 webUI/src/views/acc/reports/persons/debtors.vue mode change 100755 => 100644 webUI/src/views/acc/reports/persons/depositors.vue mode change 100755 => 100644 webUI/src/views/acc/reports/reports.vue mode change 100755 => 100644 webUI/src/views/acc/rfbuy/list.vue mode change 100755 => 100644 webUI/src/views/acc/rfbuy/mod.vue mode change 100755 => 100644 webUI/src/views/acc/rfbuy/viewInvoice.vue mode change 100755 => 100644 webUI/src/views/acc/rfsell/list.vue mode change 100755 => 100644 webUI/src/views/acc/rfsell/mod.vue mode change 100755 => 100644 webUI/src/views/acc/rfsell/viewInvoice.vue mode change 100755 => 100644 webUI/src/views/acc/router/index.js mode change 100755 => 100644 webUI/src/views/acc/salary/card.vue mode change 100755 => 100644 webUI/src/views/acc/salary/list.vue mode change 100755 => 100644 webUI/src/views/acc/salary/mod.vue mode change 100755 => 100644 webUI/src/views/acc/sell/fastMod.vue mode change 100755 => 100644 webUI/src/views/acc/sell/list.vue mode change 100755 => 100644 webUI/src/views/acc/sell/mod.vue mode change 100755 => 100644 webUI/src/views/acc/sell/viewInvoice.vue mode change 100755 => 100644 webUI/src/views/acc/settings/avatar.vue mode change 100755 => 100644 webUI/src/views/acc/settings/bussiness.vue mode change 100755 => 100644 webUI/src/views/acc/settings/extramoneys.vue mode change 100755 => 100644 webUI/src/views/acc/settings/logs.vue mode change 100755 => 100644 webUI/src/views/acc/settings/print.vue mode change 100755 => 100644 webUI/src/views/acc/settings/user_perm_edit.vue mode change 100755 => 100644 webUI/src/views/acc/settings/user_rolls.vue mode change 100755 => 100644 webUI/src/views/acc/shareholder/list.vue mode change 100755 => 100644 webUI/src/views/acc/smspanel/smspanel.vue mode change 100755 => 100644 webUI/src/views/acc/store/plugin-invoice.vue mode change 100755 => 100644 webUI/src/views/acc/store/plugin-my.vue mode change 100755 => 100644 webUI/src/views/acc/store/plugin-world.vue mode change 100755 => 100644 webUI/src/views/acc/store/viewProdect.vue mode change 100755 => 100644 webUI/src/views/acc/storeroom/commodityCheck/checkByStoreroom.vue mode change 100755 => 100644 webUI/src/views/acc/storeroom/io/buy.vue mode change 100755 => 100644 webUI/src/views/acc/storeroom/io/modalNew.vue mode change 100755 => 100644 webUI/src/views/acc/storeroom/io/rfbuy.vue mode change 100755 => 100644 webUI/src/views/acc/storeroom/io/rfsell.vue mode change 100755 => 100644 webUI/src/views/acc/storeroom/io/sell.vue mode change 100755 => 100644 webUI/src/views/acc/storeroom/io/ticketList.vue mode change 100755 => 100644 webUI/src/views/acc/storeroom/io/view.vue mode change 100755 => 100644 webUI/src/views/acc/storeroom/list.vue mode change 100755 => 100644 webUI/src/views/acc/storeroom/mod.vue mode change 100755 => 100644 webUI/src/views/acc/transfer/list.vue mode change 100755 => 100644 webUI/src/views/acc/transfer/mod.vue mode change 100755 => 100644 webUI/src/views/acc/ultimatepackage/list.vue mode change 100755 => 100644 webUI/src/views/acc/ultimatepackage/new.vue mode change 100755 => 100644 webUI/src/views/acc/wallet/view.vue mode change 100755 => 100644 webUI/src/views/user/App.vue mode change 100755 => 100644 webUI/src/views/user/InstallPWA.vue mode change 100755 => 100644 webUI/src/views/user/ReferralRedirect.vue mode change 100755 => 100644 webUI/src/views/user/active-account.vue mode change 100755 => 100644 webUI/src/views/user/change-password.vue mode change 100755 => 100644 webUI/src/views/user/login.vue mode change 100755 => 100644 webUI/src/views/user/manager/business/list.vue mode change 100755 => 100644 webUI/src/views/user/manager/log/logs.vue mode change 100755 => 100644 webUI/src/views/user/manager/online-users.vue mode change 100755 => 100644 webUI/src/views/user/manager/reportchange/list.vue mode change 100755 => 100644 webUI/src/views/user/manager/reportchange/mod.vue mode change 100755 => 100644 webUI/src/views/user/manager/settings/database_info.vue mode change 100755 => 100644 webUI/src/views/user/manager/settings/plugins.vue mode change 100755 => 100644 webUI/src/views/user/manager/settings/registry.vue mode change 100755 => 100644 webUI/src/views/user/manager/settings/sms/smsSettings.vue mode change 100755 => 100644 webUI/src/views/user/manager/settings/system.vue mode change 100755 => 100644 webUI/src/views/user/manager/settings/update-core.vue mode change 100755 => 100644 webUI/src/views/user/manager/statements/list.vue mode change 100755 => 100644 webUI/src/views/user/manager/statements/mod.vue mode change 100755 => 100644 webUI/src/views/user/manager/support/list.vue mode change 100755 => 100644 webUI/src/views/user/manager/support/show.vue mode change 100755 => 100644 webUI/src/views/user/manager/users/change-password.vue mode change 100755 => 100644 webUI/src/views/user/manager/users/list.vue mode change 100755 => 100644 webUI/src/views/user/manager/wallet/list.vue mode change 100755 => 100644 webUI/src/views/user/profile/add-mobile.vue mode change 100755 => 100644 webUI/src/views/user/profile/business/insert.vue mode change 100755 => 100644 webUI/src/views/user/profile/business/list.vue mode change 100755 => 100644 webUI/src/views/user/profile/dashboard.vue mode change 100755 => 100644 webUI/src/views/user/profile/forget-password-submit-code.vue mode change 100755 => 100644 webUI/src/views/user/profile/forget-password.vue mode change 100755 => 100644 webUI/src/views/user/profile/profile-main.vue mode change 100755 => 100644 webUI/src/views/user/profile/support/list.vue mode change 100755 => 100644 webUI/src/views/user/profile/support/new.vue mode change 100755 => 100644 webUI/src/views/user/profile/support/show.vue mode change 100755 => 100644 webUI/src/views/user/register.vue mode change 100755 => 100644 webUI/src/views/user/single.vue mode change 100755 => 100644 webUI/src/views/wizard/home.vue mode change 100755 => 100644 webUI/tsconfig.config.json mode change 100755 => 100644 webUI/tsconfig.json mode change 100755 => 100644 webUI/vite.config.ts mode change 100755 => 100644 webUI/workbox-config.js diff --git a/hesabixCore/src/Controller/AdminController.php b/hesabixCore/src/Controller/AdminController.php index 64f8e24..dc092b5 100644 --- a/hesabixCore/src/Controller/AdminController.php +++ b/hesabixCore/src/Controller/AdminController.php @@ -630,35 +630,6 @@ class AdminController extends AbstractController throw $this->createNotFoundException(); } - /** - * @throws Exception - */ - #[Route('/api/admin/database/backup/create', name: 'app_admin_database_backup_create')] - public function app_admin_database_backup_create(KernelInterface $kernel): JsonResponse - { - $application = new Application($kernel); - $application->setAutoExit(false); - - $input = new ArrayInput([ - 'command' => 'doctrine:schema:create', - // (optional) define the value of command arguments - '--dump-sql' => true, - ]); - - // You can use NullOutput() if you don't need the output - $output = new BufferedOutput(); - $application->run($input, $output); - // return the output, don't use if you used NullOutput() - $content = $output->fetch(); - $time = time(); - $file = fopen(dirname(__DIR__, 3) . '/hesabixBackup/versions/Hesabix-' . $time . '.sql', 'w'); - fwrite($file, $content); - fclose($file); - return $this->json([ - 'result' => 0, - 'filename' => 'Hesabix-' . $time . '.sql', - ]); - } #[Route('/api/admin/logs/last', name: 'api_admin_logs_last')] public function api_admin_logs_last(Extractor $extractor, Jdate $jdate, EntityManagerInterface $entityManager): JsonResponse { diff --git a/hesabixCore/src/Controller/BuyController.php b/hesabixCore/src/Controller/BuyController.php index 464fa40..9d24566 100644 --- a/hesabixCore/src/Controller/BuyController.php +++ b/hesabixCore/src/Controller/BuyController.php @@ -145,10 +145,16 @@ class BuyController extends AbstractController $hesabdariRow->setBd(0); $hesabdariRow->setBs($params['discountAll']); $ref = $entityManager->getRepository(HesabdariTable::class)->findOneBy([ - 'code' => '51' // تخفیفات نقدی خرید + 'code' => '51' ]); $hesabdariRow->setRef($ref); $entityManager->persist($hesabdariRow); + + // ذخیره نوع تخفیف و درصد آن + $doc->setDiscountType($params['discountType'] ?? 'fixed'); + if (isset($params['discountPercent'])) { + $doc->setDiscountPercent((float)$params['discountPercent']); + } } $doc->setDes($params['des']); $doc->setDate($params['date']); diff --git a/hesabixCore/src/Controller/CommodityController.php b/hesabixCore/src/Controller/CommodityController.php index 0a3a4e7..e2c2d4c 100644 --- a/hesabixCore/src/Controller/CommodityController.php +++ b/hesabixCore/src/Controller/CommodityController.php @@ -139,8 +139,11 @@ class CommodityController extends AbstractController ]); $count = 0; foreach ($rows as $row) { - $count += $row->getDoc()->getType() === 'buy' ? $row->getCommdityCount() : -$row->getCommdityCount(); - } + if ($row->getDoc()->getType() === 'buy' || $row->getDoc()->getType() === 'open_balance') { + $count += $row->getCommdityCount(); + } else { + $count -= $row->getCommdityCount(); + } } $temp['count'] = $count; } return $temp; diff --git a/hesabixCore/src/Controller/OpenbalanceController.php b/hesabixCore/src/Controller/OpenbalanceController.php index 33dfeca..1b12cff 100644 --- a/hesabixCore/src/Controller/OpenbalanceController.php +++ b/hesabixCore/src/Controller/OpenbalanceController.php @@ -8,6 +8,7 @@ use App\Entity\HesabdariDoc; use App\Entity\HesabdariTable; use App\Entity\Person; use App\Entity\Salary; +use App\Entity\Commodity; use App\Entity\Shareholder; use App\Service\Access; use App\Service\Explore; @@ -113,6 +114,18 @@ class OpenbalanceController extends AbstractController } $res['shareholders'] = $shareholderDet; + //load commodities + foreach ($doc->getHesabdariRows() as $row) { + if ($row->getCommodity()) { + $temp = []; + $temp['info'] = Explore::ExploreCommodity($row->getCommodity()); + $temp['count'] = $row->getCommdityCount(); + $temp['price'] = $row->getBs()/$row->getCommdityCount(); + $temp['totalPrice'] = $row->getBs(); + $res['commodities'][] = $temp; + } + } + return $this->json($extractor->operationSuccess($res)); } @@ -425,4 +438,99 @@ class OpenbalanceController extends AbstractController $entityManagerInterface->flush(); return $this->json($extractor->operationSuccess()); } + + + #[Route('/api/openbalance/save/commodities', name: 'app_openbalance_save_commodity')] + public function app_openbalance_save_commodity(Provider $provider,Jdate $jdate, Request $request, Access $access, EntityManagerInterface $entityManagerInterface, Extractor $extractor): Response + { + $acc = $access->hasRole('accounting'); + if (!$acc) + throw $this->createAccessDeniedException(); + + $params = []; + if ($content = $request->getContent()) { + $params = json_decode($content, true); + } + + //get open balance doc + $doc = $entityManagerInterface->getRepository(HesabdariDoc::class)->findOneBy([ + 'year' => $acc['year'], + 'bid' => $acc['bid'], + 'type' => 'open_balance', + 'money' => $acc['money'] + ]); + if (!$doc) { + $doc = new HesabdariDoc(); + $doc->setBid($acc['bid']); + $doc->setAmount(0); + $doc->setDateSubmit(time()); + $doc->setMoney($acc['money']); + $doc->setSubmitter($this->getUser()); + $doc->setYear($acc['year']); + $doc->setDes('سند افتتاحیه'); + $doc->setDate($jdate->jdate('Y/n/d', time())); + $doc->setType('open_balance'); + $doc->setCode($provider->getAccountingCode($acc['bid'],'accounting')); + $entityManagerInterface->persist($doc); + } + + // ایجاد آرایه از کدهای کالاهای ارسالی + $submittedCommodityCodes = array_map(function($param) { + return $param['info']['code']; + }, $params); + + // حذف سطرهای مربوط به کالاهایی که در لیست ارسالی نیستند + foreach ($doc->getHesabdariRows() as $row) { + if ($row->getCommodity() && $row->getRefData() == 'commodity') { + $commodityCode = $row->getCommodity()->getCode(); + if (!in_array($commodityCode, $submittedCommodityCodes)) { + $doc->removeHesabdariRow($row); + $entityManagerInterface->remove($row); + } + } + } + + foreach ($params as $param) { + $commodity = $entityManagerInterface->getRepository(Commodity::class)->findOneBy([ + 'code' => $param['info']['code'], + 'bid' => $acc['bid'], + ]); + if(!$commodity) return $this->json($extractor->operationFail()); + + $ExistBefore = false; + foreach ($doc->getHesabdariRows() as $row) { + if ($row->getCommodity() == $commodity) { + if ($param['count'] != 0) { + $ExistBefore = true; + $row->setCommdityCount($param['count']); + $row->setBs($param['price'] * $param['count']); + $entityManagerInterface->persist($row); + } + } + } + if ((!$ExistBefore) && $param['count'] != 0) { + $row = new HesabdariRow(); + $row->setDoc($doc); + $row->setCommodity($commodity); + $row->setCommdityCount($param['count']); + $row->setBs(0); + $row->setBd($param['price'] * $param['count']); + $row->setRefData('commodity'); + $row->setBid($acc['bid']); + $row->setYear($acc['year']); + $row->setDes('موجودی اول دوره'); + $row->setRef($entityManagerInterface->getRepository(HesabdariTable::class)->findOneBy(['code' => 120])); + $entityManagerInterface->persist($row); + } + } + + //calculate amount of document + foreach ($doc->getHesabdariRows() as $row) { + $doc->setAmount($doc->getAmount() + $row->getBd()); + } + $entityManagerInterface->persist($doc); + + $entityManagerInterface->flush(); + return $this->json($extractor->operationSuccess()); + } } diff --git a/hesabixCore/src/Controller/ReportController.php b/hesabixCore/src/Controller/ReportController.php index e0f819c..7d65782 100644 --- a/hesabixCore/src/Controller/ReportController.php +++ b/hesabixCore/src/Controller/ReportController.php @@ -419,4 +419,137 @@ class ReportController extends AbstractController return $this->json(['error' => 'An error occurred: ' . $e->getMessage()], 500); } } + + #[Route('/api/report/top-selling-commodities-by-price', name: 'app_report_top_selling_commodities_by_price', methods: ['POST'])] + public function app_report_top_selling_commodities_by_price(Access $access, Explore $explore, Jdate $jdate, Request $request, EntityManagerInterface $entityManager, LoggerInterface $logger): JsonResponse + { + $acc = $access->hasRole('report'); + if (!$acc) { + $acc = $access->hasRole('sell'); + if (!$acc) { + throw $this->createAccessDeniedException('شما دسترسی لازم برای مشاهده این اطلاعات را ندارید.'); + } + } + + /** @var Business $business */ + $business = $acc['bid']; + /** @var Year $year */ + $year = $acc['year']; + + $payload = $request->getPayload(); + $period = $payload->get('period', 'year'); + $limit = (int) $payload->get('limit', 10); + if ($limit < 3) { + $limit = 3; + } + + $today = $jdate->GetTodayDate(); + list($currentYear, $currentMonth, $currentDay) = explode('/', $today); + + switch ($period) { + case 'today': + $dateStart = $today; + $dateEnd = $today; + break; + case 'week': + $weekDay = (int) $jdate->jdate('w', time()); + $daysToSubtract = $weekDay; + $dateStart = $jdate->shamsiDate(0, 0, -$daysToSubtract); + $dateEnd = $jdate->shamsiDate(0, 0, 6 - $weekDay); + break; + case 'month': + $dateStart = "$currentYear/$currentMonth/01"; + $dateEnd = "$currentYear/$currentMonth/" . $jdate->jdate('t', $jdate->jallaliToUnixTime("$currentYear/$currentMonth/01")); + break; + case 'year': + default: + $dateStart = $jdate->jdate('Y/m/d', $year->getStart()); + $dateEnd = $jdate->jdate('Y/m/d', $year->getEnd()); + break; + } + + $queryBuilder = $entityManager->createQueryBuilder(); + $queryBuilder + ->select('c.id AS id') + ->addSelect('c.code AS code') + ->addSelect('c.name AS name') + ->addSelect('c.des AS des') + ->addSelect('c.priceBuy AS priceBuy') + ->addSelect('c.priceSell AS priceSell') + ->addSelect('c.khadamat AS khadamat') + ->addSelect('c.orderPoint AS orderPoint') + ->addSelect('c.commodityCountCheck AS commodityCountCheck') + ->addSelect('c.minOrderCount AS minOrderCount') + ->addSelect('c.dayLoading AS dayLoading') + ->addSelect('c.speedAccess AS speedAccess') + ->addSelect('c.withoutTax AS withoutTax') + ->addSelect('c.barcodes AS barcodes') + ->addSelect('IDENTITY(c.unit) AS unitId') + ->addSelect('u.name AS unit') + ->addSelect('SUM(CAST(hr.commdityCount AS INTEGER)) AS totalCount') + ->addSelect('SUM(hr.bs) AS totalPrice') // محاسبه مجموع قیمت فروش با استفاده از فیلد bs + ->from(HesabdariRow::class, 'hr') + ->innerJoin('hr.doc', 'hd') + ->innerJoin('hr.commodity', 'c') + ->leftJoin('c.unit', 'u') + ->where('hd.bid = :business') + ->andWhere('hd.type = :type') + ->andWhere('hr.year = :year') + ->andWhere('hd.date BETWEEN :dateStart AND :dateEnd') + ->setParameter('business', $business) + ->setParameter('type', 'sell') + ->setParameter('year', $year) + ->setParameter('dateStart', $dateStart) + ->setParameter('dateEnd', $dateEnd) + ->groupBy('c.id') + ->addGroupBy('u.name') + ->orderBy('totalPrice', 'DESC') // مرتب‌سازی بر اساس مجموع قیمت فروش + ->setMaxResults($limit); + + try { + $results = $queryBuilder->getQuery()->getArrayResult(); + $logger->info('Query executed successfully', [ + 'sql' => $queryBuilder->getQuery()->getSQL(), + 'params' => $queryBuilder->getQuery()->getParameters()->toArray(), + 'results' => $results + ]); + + if (empty($results)) { + $logger->info('No results returned from query'); + return $this->json(['message' => 'No data found'], 200); + } + + $topCommodities = array_map(function ($result) { + return [ + 'id' => $result['id'], + 'code' => $result['code'], + 'name' => $result['name'], + 'des' => $result['des'], + 'priceBuy' => $result['priceBuy'], + 'priceSell' => $result['priceSell'], + 'khadamat' => $result['khadamat'], + 'orderPoint' => $result['orderPoint'], + 'commodityCountCheck' => $result['commodityCountCheck'], + 'minOrderCount' => $result['minOrderCount'], + 'dayLoading' => $result['dayLoading'], + 'speedAccess' => $result['speedAccess'], + 'withoutTax' => $result['withoutTax'], + 'barcodes' => $result['barcodes'], + 'unit' => $result['unit'] ?? '', + 'count' => (int) $result['totalCount'], + 'totalPrice' => (float) $result['totalPrice'] // مجموع قیمت فروش + ]; + }, $results); + + return $this->json($topCommodities); + } catch (\Exception $e) { + $logger->error('Error in top-selling commodities by price query', [ + 'message' => $e->getMessage(), + 'sql' => $queryBuilder->getQuery()->getSQL(), + 'params' => $queryBuilder->getQuery()->getParameters()->toArray(), + 'trace' => $e->getTraceAsString() + ]); + return $this->json(['error' => 'An error occurred: ' . $e->getMessage()], 500); + } + } } \ No newline at end of file diff --git a/hesabixCore/src/Controller/RfsellController.php b/hesabixCore/src/Controller/RfsellController.php index ceaa58d..4f281ca 100644 --- a/hesabixCore/src/Controller/RfsellController.php +++ b/hesabixCore/src/Controller/RfsellController.php @@ -146,10 +146,16 @@ class RfsellController extends AbstractController $hesabdariRow->setBd(0); $hesabdariRow->setBs($params['discountAll']); $ref = $entityManager->getRepository(HesabdariTable::class)->findOneBy([ - 'code' => '104' // سایر هزینه های پخش و خرید + 'code' => '104' ]); $hesabdariRow->setRef($ref); $entityManager->persist($hesabdariRow); + + // ذخیره نوع تخفیف و درصد آن + $doc->setDiscountType($params['discountType'] ?? 'fixed'); + if (isset($params['discountPercent'])) { + $doc->setDiscountPercent((float)$params['discountPercent']); + } } $doc->setDes($params['des']); $doc->setDate($params['date']); diff --git a/hesabixCore/src/Controller/SellController.php b/hesabixCore/src/Controller/SellController.php index d1809d1..94888c2 100644 --- a/hesabixCore/src/Controller/SellController.php +++ b/hesabixCore/src/Controller/SellController.php @@ -27,6 +27,9 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; +use App\Entity\BankAccount; +use App\Entity\Cashdesk; +use App\Entity\Salary; class SellController extends AbstractController { @@ -72,7 +75,7 @@ class SellController extends AbstractController foreach ($doc->getHesabdariRows() as $item) { if ($item->getCommodity() && $item->getCommdityCount()) { if ($acc['bid']->getProfitCalctype() == 'simple') { - $profit = $profit + (($item->getCommodity()->getPriceSell() - $item->getCommodity()->getPriceSell()) * $item->getCommdityCount()); + $profit = $profit + (($item->getCommodity()->getPriceSell() - $item->getCommodity()->getPriceBuy()) * $item->getCommdityCount()); } elseif ($acc['bid']->getProfitCalctype() == 'lis') { $last = $entityManager->getRepository(HesabdariRow::class)->findOneBy([ 'commodity' => $item->getCommodity(), @@ -82,7 +85,7 @@ class SellController extends AbstractController ]); if ($last) { $price = $last->getBd() / $last->getCommdityCount(); - $profit = $profit + ((($item->getBs() / $item->getCommdityCount()) - $price) * $item->getCommdityCount()); + $profit = $profit + (($item->getBs() / $item->getCommdityCount() - $price) * $item->getCommdityCount()); } else { $profit = $profit + $item->getBs(); } @@ -101,7 +104,7 @@ class SellController extends AbstractController } if ($count != 0) { $price = $avg / $count; - $profit = $profit + ((($item->getBs() / $item->getCommdityCount()) - $price) * $item->getCommdityCount()); + $profit = $profit + (($item->getBs() / $item->getCommdityCount() - $price) * $item->getCommdityCount()); } else { $profit = $profit + $item->getBs(); } @@ -195,6 +198,12 @@ class SellController extends AbstractController ]); $hesabdariRow->setRef($ref); $entityManager->persist($hesabdariRow); + + // ذخیره نوع تخفیف و درصد آن + $doc->setDiscountType($params['discountType'] ?? 'fixed'); + if (isset($params['discountPercent'])) { + $doc->setDiscountPercent((float)$params['discountPercent']); + } } $doc->setDes($params['des']); $doc->setDate($params['date']); @@ -264,10 +273,9 @@ class SellController extends AbstractController $pair = $entityManager->getRepository(HesabdariDoc::class)->findOneBy([ 'bid' => $acc['bid'], 'code' => $pairCode, - 'type' => 'buy' ]); if ($pair) { - $doc->addPairDoc($pair); + $pair->addRelatedDoc($doc); } } } @@ -577,7 +585,6 @@ class SellController extends AbstractController ]); } - // متد calculateProfit بدون تغییر private function calculateProfit(int $docId, array $acc, EntityManagerInterface $entityManager): int { $profit = 0; @@ -591,7 +598,7 @@ class SellController extends AbstractController ->findOneBy(['commodity' => $commodityId, 'bs' => 0], ['id' => 'DESC']); if ($last) { $price = $last->getBd() / $last->getCommdityCount(); - $profit += ((($item->getBs() / $item->getCommdityCount()) - $price) * $item->getCommdityCount()); + $profit += ($item->getBs() / $item->getCommdityCount() - $price) * $item->getCommdityCount(); } else { $profit += $item->getBs(); } @@ -600,7 +607,7 @@ class SellController extends AbstractController } } elseif ($acc['bid']->getProfitCalctype() === 'simple') { if ($item->getCommodity() && $item->getCommodity()->getPriceSell() !== null && $item->getCommodity()->getPriceBuy() !== null) { - $profit += (($item->getCommodity()->getPriceSell() - $item->getCommodity()->getPriceBuy()) * $item->getCommdityCount()); + $profit += ($item->getCommodity()->getPriceSell() - $item->getCommodity()->getPriceBuy()) * $item->getCommdityCount(); } else { $profit += $item->getBs(); } @@ -608,11 +615,15 @@ class SellController extends AbstractController if ($commodityId) { $lasts = $entityManager->getRepository(HesabdariRow::class) ->findBy(['commodity' => $commodityId, 'bs' => 0], ['id' => 'DESC']); - $avg = array_sum(array_map(fn($last) => $last->getBd(), $lasts)); - $count = array_sum(array_map(fn($last) => $last->getCommdityCount(), $lasts)); + $avg = 0; + $count = 0; + foreach ($lasts as $last) { + $avg += $last->getBd(); + $count += $last->getCommdityCount(); + } if ($count != 0) { $price = $avg / $count; - $profit += ((($item->getBs() / $item->getCommdityCount()) - $price) * $item->getCommdityCount()); + $profit += ($item->getBs() / $item->getCommdityCount() - $price) * $item->getCommdityCount(); } else { $profit += $item->getBs(); } @@ -683,19 +694,27 @@ class SellController extends AbstractController throw $this->createAccessDeniedException(); $params = json_decode($request->getContent(), true); - $printOptions = $params['printOptions'] ?? []; - - // اضافه کردن کلیدهای پیش‌فرض - $printOptions = array_merge([ - 'note' => true, - 'bidInfo' => true, - 'taxInfo' => true, - 'discountInfo' => true, - 'pays' => false, - 'paper' => 'A4-L', - 'invoiceIndex' => false, - 'businessStamp' => false - ], $printOptions); + $params['printers'] = $params['printers'] ?? false; + $params['pdf'] = $params['pdf'] ?? true; + $params['posPrint'] = $params['posPrint'] ?? false; + + // دریافت تنظیمات پیش‌فرض از PrintOptions + $printSettings = $entityManager->getRepository(PrintOptions::class)->findOneBy(['bid' => $acc['bid']]); + + // تنظیم مقادیر پیش‌فرض از تنظیمات ذخیره شده + $defaultOptions = [ + 'note' => $printSettings ? $printSettings->isSellNote() : true, + 'bidInfo' => $printSettings ? $printSettings->isSellBidInfo() : true, + 'taxInfo' => $printSettings ? $printSettings->isSellTaxInfo() : true, + 'discountInfo' => $printSettings ? $printSettings->isSellDiscountInfo() : true, + 'pays' => $printSettings ? $printSettings->isSellPays() : true, + 'paper' => $printSettings ? $printSettings->getSellPaper() : 'A4-L', + 'invoiceIndex' => $printSettings ? $printSettings->isSellInvoiceIndex() : true, + 'businessStamp' => $printSettings ? $printSettings->isSellBusinessStamp() : true + ]; + + // اولویت با پارامترهای ارسالی است + $printOptions = array_merge($defaultOptions, $params['printOptions'] ?? []); $doc = $entityManager->getRepository(HesabdariDoc::class)->findOneBy([ 'bid' => $acc['bid'], @@ -717,43 +736,8 @@ class SellController extends AbstractController } } $pdfPid = 0; - if ($params['pdf']) { - $printOptions = [ - 'bidInfo' => true, - 'pays' => true, - 'taxInfo' => true, - 'discountInfo' => true, - 'note' => true, - 'paper' => 'A4-L' - ]; - if (array_key_exists('printOptions', $params)) { - if (array_key_exists('bidInfo', $params['printOptions'])) { - $printOptions['bidInfo'] = $params['printOptions']['bidInfo']; - } - if (array_key_exists('pays', $params['printOptions'])) { - $printOptions['pays'] = $params['printOptions']['pays']; - } - if (array_key_exists('taxInfo', $params['printOptions'])) { - $printOptions['taxInfo'] = $params['printOptions']['taxInfo']; - } - if (array_key_exists('discountInfo', $params['printOptions'])) { - $printOptions['discountInfo'] = $params['printOptions']['discountInfo']; - } - if (array_key_exists('note', $params['printOptions'])) { - $printOptions['note'] = $params['printOptions']['note']; - } - if (array_key_exists('paper', $params['printOptions'])) { - $printOptions['paper'] = $params['printOptions']['paper']; - } - if (array_key_exists('invoiceIndex', $params['printOptions'])) { - $printOptions['invoiceIndex'] = $params['printOptions']['invoiceIndex']; - } - if (array_key_exists('businessStamp', $params['printOptions'])) { - $printOptions['businessStamp'] = $params['printOptions']['businessStamp']; - } - } + if ($params['pdf'] == true || $params['printers'] == true) { $note = ''; - $printSettings = $entityManager->getRepository(PrintOptions::class)->findOneBy(['bid' => $acc['bid']]); if ($printSettings) { $note = $printSettings->getSellNoteString(); } @@ -775,7 +759,8 @@ class SellController extends AbstractController $printOptions['paper'] ); } - if ($params['printers'] == true) { + if ($params['posPrint'] == true) { + $pid = $provider->createPrint( $acc['bid'], $this->getUser(), @@ -831,4 +816,473 @@ class SellController extends AbstractController 'daySells' => $daySells ]); } + + #[Route('/api/sell/v2/mod', name: 'app_sell_v2_mod', methods: ['POST'])] + public function app_sell_v2_mod( + AccountingPermissionService $accountingPermissionService, + PluginService $pluginService, + SMS $SMS, + Provider $provider, + Extractor $extractor, + Request $request, + Access $access, + Log $log, + EntityManagerInterface $entityManager, + registryMGR $registryMGR + ): JsonResponse { + $params = []; + if ($content = $request->getContent()) { + $params = json_decode($content, true); + } + + $acc = $access->hasRole('sell'); + if (!$acc) { + throw $this->createAccessDeniedException(); + } + + $pkgcntr = $accountingPermissionService->canRegisterAccountingDoc($acc['bid']); + if ($pkgcntr['code'] == 4) { + return $this->json([ + 'result' => 4, + 'message' => $pkgcntr['message'] + ]); + } + + try { + // بررسی وجود فاکتور برای ویرایش + if (!empty($params['id'])) { + $doc = $entityManager->getRepository(HesabdariDoc::class)->findOneBy([ + 'bid' => $acc['bid'], + 'year' => $acc['year'], + 'code' => $params['id'], + 'money' => $acc['money'] + ]); + if (!$doc) { + return $this->json($extractor->notFound()); + } + + // حذف سطرهای قبلی + $rows = $doc->getHesabdariRows(); + foreach ($rows as $row) { + $entityManager->remove($row); + } + } else { + // ایجاد فاکتور جدید + $doc = new HesabdariDoc(); + $doc->setBid($acc['bid']); + $doc->setYear($acc['year']); + $doc->setDateSubmit(time()); + $doc->setType('sell'); + $doc->setSubmitter($this->getUser()); + $doc->setMoney($acc['money']); + $doc->setCode($provider->getAccountingCode($acc['bid'], 'accounting')); + } + + // تنظیم اطلاعات اصلی فاکتور + $doc->setDes($params['invoiceDescription']); + $doc->setDate($params['invoiceDate']); + $doc->setTaxPercent($params['taxPercent'] ?? 0); + + // افزودن هزینه حمل + if ($params['shippingCost'] > 0) { + $hesabdariRow = new HesabdariRow(); + $hesabdariRow->setDes('حمل و نقل کالا'); + $hesabdariRow->setBid($acc['bid']); + $hesabdariRow->setYear($acc['year']); + $hesabdariRow->setDoc($doc); + $hesabdariRow->setBs($params['shippingCost']); + $hesabdariRow->setBd(0); + $ref = $entityManager->getRepository(HesabdariTable::class)->findOneBy(['code' => '61']); + $hesabdariRow->setRef($ref); + $entityManager->persist($hesabdariRow); + } + + // افزودن تخفیف کلی + $totalDiscount = 0; + if ($params['discountType'] === 'percent') { + $totalDiscount = round(($params['totalInvoice'] * $params['discountPercent']) / 100); + $doc->setDiscountType('percent'); + $doc->setDiscountPercent((float)$params['discountPercent']); + } else { + $totalDiscount = $params['totalDiscount']; + $doc->setDiscountType('fixed'); + $doc->setDiscountPercent(null); + } + + if ($totalDiscount > 0) { + $hesabdariRow = new HesabdariRow(); + $hesabdariRow->setDes('تخفیف فاکتور'); + $hesabdariRow->setBid($acc['bid']); + $hesabdariRow->setYear($acc['year']); + $hesabdariRow->setDoc($doc); + $hesabdariRow->setBs(0); + $hesabdariRow->setBd($totalDiscount); + $ref = $entityManager->getRepository(HesabdariTable::class)->findOneBy(['code' => '104']); + $hesabdariRow->setRef($ref); + $entityManager->persist($hesabdariRow); + } + + // افزودن اقلام فاکتور + $sumTax = 0; + $sumTotal = 0; + foreach ($params['items'] as $item) { + $sumTax += $item['tax'] ?? 0; + $sumTotal += $item['total'] ?? 0; + + $hesabdariRow = new HesabdariRow(); + $hesabdariRow->setDes($item['description'] ?? ''); + $hesabdariRow->setBid($acc['bid']); + $hesabdariRow->setYear($acc['year']); + $hesabdariRow->setDoc($doc); + $hesabdariRow->setBs($item['total'] + ($item['tax'] ?? 0)); + $hesabdariRow->setBd(0); + $hesabdariRow->setDiscount($item['discountAmount'] ?? 0); + $hesabdariRow->setTax($item['tax'] ?? 0); + $hesabdariRow->setDiscountType($item['showPercentDiscount'] ? 'percent' : 'fixed'); + $hesabdariRow->setDiscountPercent($item['discountPercent'] ?? 0); + + $ref = $entityManager->getRepository(HesabdariTable::class)->findOneBy(['code' => '53']); + $hesabdariRow->setRef($ref); + + $commodity = $entityManager->getRepository(Commodity::class)->findOneBy([ + 'id' => $item['name']['id'], + 'bid' => $acc['bid'] + ]); + if (!$commodity) { + throw new \Exception('کالا یافت نشد'); + } + $hesabdariRow->setCommodity($commodity); + $hesabdariRow->setCommdityCount($item['count']); + + // به‌روزرسانی قیمت فروش کالا اگر تنظیم شده باشد + if ($acc['bid']->isCommodityUpdateSellPriceAuto() && $commodity->getPriceSell() != $item['price']) { + $commodity->setPriceSell($item['price']); + $entityManager->persist($commodity); + } + + $entityManager->persist($hesabdariRow); + } + + // افزودن ردیف مالیات + if ($sumTax > 0) { + $taxRow = new HesabdariRow(); + $taxRow->setDes('مالیات بر ارزش افزوده'); + $taxRow->setBid($acc['bid']); + $taxRow->setYear($acc['year']); + $taxRow->setDoc($doc); + $taxRow->setBs($sumTax); + $taxRow->setBd(0); + $taxRef = $entityManager->getRepository(HesabdariTable::class)->findOneBy(['code' => '33']); + $taxRow->setRef($taxRef); + $entityManager->persist($taxRow); + } + + // تنظیم مبلغ کل فاکتور + $doc->setAmount($sumTotal + $sumTax - $totalDiscount + $params['shippingCost']); + + // افزودن سطر اصلی فاکتور + $hesabdariRow = new HesabdariRow(); + $hesabdariRow->setDes('فاکتور فروش'); + $hesabdariRow->setBid($acc['bid']); + $hesabdariRow->setYear($acc['year']); + $hesabdariRow->setDoc($doc); + $hesabdariRow->setBs(0); + $hesabdariRow->setBd($sumTotal + $sumTax + $params['shippingCost'] - $totalDiscount); + $ref = $entityManager->getRepository(HesabdariTable::class)->findOneBy(['code' => '3']); + $hesabdariRow->setRef($ref); + + $person = $entityManager->getRepository(Person::class)->findOneBy([ + 'bid' => $acc['bid'], + 'id' => $params['customer'] + ]); + if (!$person) { + throw new \Exception('خریدار یافت نشد'); + } + $hesabdariRow->setPerson($person); + $entityManager->persist($hesabdariRow); + + // ذخیره فاکتور + $entityManager->persist($doc); + $entityManager->flush(); + + // ایجاد لینک کوتاه اگر وجود نداشته باشد + if (!$doc->getShortlink()) { + $doc->setShortlink($provider->RandomString(8)); + $entityManager->persist($doc); + $entityManager->flush(); + } + + // ثبت اسناد پرداخت + if (!empty($params['payments'])) { + foreach ($params['payments'] as $payment) { + // ایجاد سند حسابداری جدید برای پرداخت + $paymentDoc = new HesabdariDoc(); + $paymentDoc->setBid($acc['bid']); + $paymentDoc->setYear($acc['year']); + $paymentDoc->setDateSubmit(time()); + $paymentDoc->setType('sell_receive'); + $paymentDoc->setSubmitter($this->getUser()); + $paymentDoc->setMoney($acc['money']); + $paymentDoc->setCode($provider->getAccountingCode($acc['bid'], 'accounting')); + $paymentDoc->setDate($params['invoiceDate']); + $paymentDoc->setDes($payment['description'] ?? 'دریافت وجه فاکتور فروش شماره ' . $doc->getCode()); + $paymentDoc->setAmount($payment['amount']); + + // ایجاد ارتباط با فاکتور اصلی + $doc->addRelatedDoc($paymentDoc); + + // ایجاد سطرهای حسابداری بر اساس نوع پرداخت + if ($payment['type'] === 'bank') { + // دریافت از طریق حساب بانکی + $bankRow = new HesabdariRow(); + $bankRow->setDes($payment['description'] ?? 'دریافت وجه فاکتور فروش شماره ' . $doc->getCode()); + $bankRow->setBid($acc['bid']); + $bankRow->setYear($acc['year']); + $bankRow->setDoc($paymentDoc); + $bankRow->setBs(0); + $bankRow->setBd($payment['amount']); + $bankRef = $entityManager->getRepository(HesabdariTable::class)->findOneBy(['code' => '5']); + $bankRow->setRef($bankRef); + $bankRow->setBank($entityManager->getRepository(BankAccount::class)->find($payment['bank'])); + $entityManager->persist($bankRow); + } elseif ($payment['type'] === 'cashdesk') { + // دریافت از طریق صندوق + $cashdeskRow = new HesabdariRow(); + $cashdeskRow->setDes($payment['description'] ?? 'دریافت وجه فاکتور فروش شماره ' . $doc->getCode()); + $cashdeskRow->setBid($acc['bid']); + $cashdeskRow->setYear($acc['year']); + $cashdeskRow->setDoc($paymentDoc); + $cashdeskRow->setBs(0); + $cashdeskRow->setBd($payment['amount']); + $cashdeskRef = $entityManager->getRepository(HesabdariTable::class)->findOneBy(['code' => '121']); + $cashdeskRow->setRef($cashdeskRef); + $cashdeskRow->setCashdesk($entityManager->getRepository(Cashdesk::class)->find($payment['cashdesk'])); + $entityManager->persist($cashdeskRow); + } elseif ($payment['type'] === 'salary') { + // دریافت از طریق تنخواه گردان + $salaryRow = new HesabdariRow(); + $salaryRow->setDes($payment['description'] ?? 'دریافت وجه فاکتور فروش شماره ' . $doc->getCode()); + $salaryRow->setBid($acc['bid']); + $salaryRow->setYear($acc['year']); + $salaryRow->setDoc($paymentDoc); + $salaryRow->setBs(0); + $salaryRow->setBd($payment['amount']); + $salaryRef = $entityManager->getRepository(HesabdariTable::class)->findOneBy(['code' => '122']); + $salaryRow->setRef($salaryRef); + $salaryRow->setSalary($entityManager->getRepository(Salary::class)->find($payment['salary'])); + $entityManager->persist($salaryRow); + } + + // ایجاد سطر دریافت از مشتری + $receiveRow = new HesabdariRow(); + $receiveRow->setDes($payment['description'] ?? 'پرداخت وجه فاکتور فروش شماره ' . $doc->getCode()); + $receiveRow->setBid($acc['bid']); + $receiveRow->setYear($acc['year']); + $receiveRow->setDoc($paymentDoc); + $receiveRow->setBs($payment['amount']); + $receiveRow->setBd(0); + $receiveRef = $entityManager->getRepository(HesabdariTable::class)->findOneBy(['code' => '3']); + $receiveRow->setRef($receiveRef); + $receiveRow->setPerson($person); + $entityManager->persist($receiveRow); + + $entityManager->persist($paymentDoc); + } + $entityManager->flush(); + } + + // ثبت لاگ + $log->insert( + 'حسابداری', + 'سند حسابداری شماره ' . $doc->getCode() . ' ثبت / ویرایش شد.', + $this->getUser(), + $request->headers->get('activeBid'), + $doc + ); + + // ارسال پیامک اگر درخواست شده باشد + if (!empty($params['sendSmsToCustomer']) && $params['sendSmsToCustomer']) { + if ($pluginService->isActive('accpro', $acc['bid']) && $person->getMobile() != '' && $acc['bid']->getTel()) { + $SMS->sendByBalance( + [$person->getnikename(), 'sell/' . $acc['bid']->getId() . '/' . $doc->getShortlink(), $acc['bid']->getName(), $acc['bid']->getTel()], + $registryMGR->get('sms', 'plugAccproSharefaktor'), + $person->getMobile(), + $acc['bid'], + $this->getUser(), + 3 + ); + } else { + $SMS->sendByBalance( + [$acc['bid']->getName(), 'sell/' . $acc['bid']->getId() . '/' . $doc->getShortlink()], + $registryMGR->get('sms', 'sharefaktor'), + $person->getMobile(), + $acc['bid'], + $this->getUser(), + 3 + ); + } + } + + return $this->json([ + 'result' => 1, + 'message' => 'فاکتور با موفقیت ثبت شد', + 'data' => [ + 'id' => $doc->getCode(), + 'code' => $doc->getCode(), + 'shortlink' => $doc->getShortlink() + ] + ]); + + } catch (\Exception $e) { + return $this->json([ + 'result' => 0, + 'message' => $e->getMessage() + ]); + } + } + + #[Route('/api/sell/v2/get/{id}', name: 'app_sell_v2_get', methods: ['GET'])] + public function app_sell_v2_get( + Request $request, + Access $access, + EntityManagerInterface $entityManager, + string $id + ): JsonResponse { + try { + $acc = $access->hasRole('sell'); + if (!$acc) { + throw $this->createAccessDeniedException(); + } + + $doc = $entityManager->getRepository(HesabdariDoc::class)->findOneBy([ + 'bid' => $acc['bid'], + 'year' => $acc['year'], + 'code' => $id, + 'money' => $acc['money'] + ]); + + if (!$doc) { + throw $this->createNotFoundException('فاکتور یافت نشد'); + } + + $person = null; + $discountAll = 0; + $transferCost = 0; + $items = []; + $totalInvoice = 0; + $taxPercent = $doc->getTaxPercent(); + $discountType = $doc->getDiscountType() ?? 'fixed'; + $discountPercent = $doc->getDiscountPercent() ?? 0; + $payments = []; + + // دریافت اسناد پرداخت مرتبط + $relatedDocs = $doc->getRelatedDocs(); + + foreach ($relatedDocs as $relatedDoc) { + if ($relatedDoc->getType() === 'sell_receive') { + $payment = [ + 'type' => null, + 'amount' => $relatedDoc->getAmount(), + 'reference' => '', + 'description' => $relatedDoc->getDes(), + 'bank' => null, + 'cashdesk' => null, + 'salary' => null + ]; + + foreach ($relatedDoc->getHesabdariRows() as $row) { + if ($row->getBank()) { + $payment['type'] = 'bank'; + $payment['bank'] = $row->getBank()->getId(); + } elseif ($row->getCashdesk()) { + $payment['type'] = 'cashdesk'; + $payment['cashdesk'] = $row->getCashdesk()->getId(); + } elseif ($row->getSalary()) { + $payment['type'] = 'salary'; + $payment['salary'] = $row->getSalary()->getId(); + } + } + + $payments[] = $payment; + } + } + + foreach ($doc->getHesabdariRows() as $row) { + if ($row->getPerson()) { + $person = $row->getPerson(); + } elseif ($row->getRef() && $row->getRef()->getCode() == '104') { + $discountAll = $row->getBd(); + } elseif ($row->getRef() && $row->getRef()->getCode() == '61') { + $transferCost = $row->getBs(); + } elseif ($row->getCommodity()) { + $basePrice = $row->getBs(); + $itemDiscount = $row->getDiscount() ?? 0; + $itemDiscountType = $row->getDiscountType() ?? 'fixed'; + $itemDiscountPercent = $row->getDiscountPercent() ?? 0; + + // محاسبه تخفیف سطری + if ($itemDiscountType === 'percent') { + $itemDiscount = round(($basePrice * $itemDiscountPercent) / 100); + } + + $itemTotal = $basePrice - $itemDiscount; + $totalInvoice += $itemTotal; + + $items[] = [ + 'name' => [ + 'id' => $row->getCommodity()->getId(), + 'name' => $row->getCommodity()->getName(), + 'code' => $row->getCommodity()->getCode() + ], + 'count' => $row->getCommdityCount(), + 'price' => $row->getCommdityCount() > 0 ? $basePrice / $row->getCommdityCount() : 0, + 'discountPercent' => $itemDiscountPercent, + 'discountAmount' => $itemDiscount, + 'total' => $itemTotal, + 'description' => $row->getDes(), + 'showPercentDiscount' => $itemDiscountType === 'percent', + 'tax' => $row->getTax() ?? 0 + ]; + } + } + + // محاسبه تخفیف کلی از HesabdariDoc + $totalDiscount = 0; + if ($discountType === 'percent') { + $totalDiscount = round(($totalInvoice * $discountPercent) / 100); + } else { + $totalDiscount = $discountAll; + } + + return $this->json([ + 'result' => 1, + 'data' => [ + 'id' => $doc->getCode(), + 'date' => $doc->getDate(), + 'person' => $person ? [ + 'id' => $person->getId(), + 'name' => $person->getNikename(), + 'code' => $person->getCode() + ] : null, + 'des' => $doc->getDes(), + 'totalInvoice' => $totalInvoice, + 'taxPercent' => $taxPercent, + 'discountType' => $discountType, + 'discountPercent' => $discountPercent, + 'totalDiscount' => $totalDiscount, + 'shippingCost' => $transferCost, + 'showTotalPercentDiscount' => $discountType === 'percent', + 'items' => $items, + 'finalTotal' => $doc->getAmount(), + 'payments' => $payments + ] + ]); + + } catch (\Exception $e) { + return $this->json([ + 'result' => 0, + 'message' => $e->getMessage() + ]); + } + } } \ No newline at end of file diff --git a/hesabixCore/src/Controller/System/DatabaseController.php b/hesabixCore/src/Controller/System/DatabaseController.php new file mode 100644 index 0000000..05d565c --- /dev/null +++ b/hesabixCore/src/Controller/System/DatabaseController.php @@ -0,0 +1,255 @@ +registryMGR = $registryMGR; + $this->entityManager = $entityManager; + $this->backupPath = dirname(__DIR__, 2) . '/hesabixBackup/versions'; + } + + #[Route('/api/admin/database/backup/info', name: 'app_admin_database_backup_info', methods: ['GET'])] + public function getBackupInfo(): JsonResponse + { + try { + $lastBackup = $this->getLastBackupInfo('local'); + $lastFtpBackup = $this->getLastBackupInfo('ftp'); + + return $this->json([ + 'result' => 1, + 'lastBackup' => $lastBackup, + 'lastFtpBackup' => $lastFtpBackup + ]); + } catch (\Exception $e) { + return $this->json([ + 'result' => 0, + 'message' => 'خطا در دریافت اطلاعات پشتیبان: ' . $e->getMessage() + ], 500); + } + } + + #[Route('/api/admin/database/backup/create', name: 'app_admin_database_backup_create', methods: ['POST'])] + public function app_admin_database_backup_create(): JsonResponse + { + try { + // ایجاد پوشه‌های مورد نیاز + $this->ensureBackupDirectoriesExist(); + + // ایجاد نام فایل با timestamp + $filename = 'Hesabix-' . time() . '.sql'; + $filepath = $this->backupPath . '/' . $filename; + + // دریافت تنظیمات دیتابیس از EntityManager + $connection = $this->entityManager->getConnection(); + $params = $connection->getParams(); + + $dbName = $params['dbname']; + $dbUser = $params['user']; + $dbPass = $params['password']; + $dbHost = $params['host']; + $dbPort = $params['port'] ?? '3306'; + + // دستور mysqldump + $command = sprintf( + 'mysqldump -h %s -P %s -u %s -p%s %s > %s', + escapeshellarg($dbHost), + escapeshellarg($dbPort), + escapeshellarg($dbUser), + escapeshellarg($dbPass), + escapeshellarg($dbName), + escapeshellarg($filepath) + ); + + // اجرای دستور + exec($command, $output, $returnVar); + + if ($returnVar !== 0) { + throw new \Exception('خطا در اجرای دستور mysqldump: ' . implode("\n", $output)); + } + + // ذخیره اطلاعات آخرین پشتیبان + $this->updateLastBackupInfo('local', $filename); + + return $this->json([ + 'result' => 1, + 'filename' => $filename, + 'message' => 'پشتیبان با موفقیت ایجاد شد' + ]); + } catch (\Exception $e) { + return $this->json([ + 'result' => 0, + 'message' => 'خطا در ایجاد پشتیبان: ' . $e->getMessage() + ], 500); + } + } + + #[Route('/api/admin/database/backup/create-and-upload', name: 'app_admin_database_backup_create_and_upload', methods: ['POST'])] + public function createAndUploadToFtp(): JsonResponse + { + try { + // ایجاد پشتیبان محلی + $backupResponse = $this->app_admin_database_backup_create(); + $backupData = json_decode($backupResponse->getContent(), true); + + if ($backupData['result'] !== 1) { + throw new \Exception($backupData['message']); + } + + $filename = $backupData['filename']; + $filepath = $this->backupPath . '/' . $filename; + + // بررسی وجود فایل و دسترسی‌های آن + if (!file_exists($filepath)) { + throw new \Exception("فایل پشتیبان در مسیر {$filepath} یافت نشد"); + } + + if (!is_readable($filepath)) { + throw new \Exception("عدم دسترسی به فایل پشتیبان در مسیر {$filepath}"); + } + + // دریافت تنظیمات FTP + $ftpEnabled = filter_var($this->registryMGR->get('system_settings', 'ftp_enabled'), FILTER_VALIDATE_BOOLEAN); + if (!$ftpEnabled) { + throw new \Exception('اتصال FTP غیرفعال است'); + } + + $ftpHost = $this->registryMGR->get('system_settings', 'ftp_host'); + $ftpPort = $this->registryMGR->get('system_settings', 'ftp_port'); + $ftpUsername = $this->registryMGR->get('system_settings', 'ftp_username'); + $ftpPassword = $this->registryMGR->get('system_settings', 'ftp_password'); + $ftpPath = $this->registryMGR->get('system_settings', 'ftp_path'); + + // اتصال به FTP + $ftp = ftp_connect($ftpHost, (int)$ftpPort, 30); + if (!$ftp) { + throw new \Exception('خطا در اتصال به سرور FTP'); + } + + // ورود به FTP + if (!ftp_login($ftp, $ftpUsername, $ftpPassword)) { + ftp_close($ftp); + throw new \Exception('خطا در ورود به سرور FTP'); + } + + // فعال کردن حالت غیرفعال + ftp_pasv($ftp, true); + + // دریافت مسیر home کاربر + $homeDir = ftp_pwd($ftp); + if ($homeDir === false) { + ftp_close($ftp); + throw new \Exception('خطا در دریافت مسیر home کاربر FTP'); + } + + // تنظیم مسیر نهایی نسبت به home + $remotePath = rtrim($homeDir, '/') . '/' . ltrim($ftpPath, '/') . '/' . $filename; + $remoteDir = dirname($remotePath); + + // بررسی دسترسی نوشتن در مسیر + $testFile = 'test_' . time() . '.txt'; + if (!@ftp_put($ftp, $testFile, 'test', FTP_ASCII)) { + ftp_close($ftp); + throw new \Exception('کاربر FTP دسترسی نوشتن ندارد'); + } + ftp_delete($ftp, $testFile); + + // ایجاد مسیر در صورت عدم وجود + $this->createFtpDirectory($ftp, $remoteDir); + + // تغییر به مسیر مورد نظر + if (!@ftp_chdir($ftp, $remoteDir)) { + ftp_close($ftp); + throw new \Exception("خطا در تغییر به مسیر {$remoteDir} در سرور FTP"); + } + + // آپلود فایل + if (!ftp_put($ftp, basename($remotePath), $filepath, FTP_BINARY)) { + $error = error_get_last(); + ftp_close($ftp); + throw new \Exception('خطا در آپلود فایل به سرور FTP: ' . ($error['message'] ?? 'خطای نامشخص')); + } + + ftp_close($ftp); + + // ذخیره اطلاعات آخرین پشتیبان FTP + $this->updateLastBackupInfo('ftp', $filename); + + return $this->json([ + 'result' => 1, + 'filename' => $filename, + 'message' => 'پشتیبان با موفقیت ایجاد و به سرور FTP ارسال شد' + ]); + } catch (\Exception $e) { + return $this->json([ + 'result' => 0, + 'message' => 'خطا در ایجاد و ارسال پشتیبان: ' . $e->getMessage() + ], 500); + } + } + + private function ensureBackupDirectoriesExist(): void + { + $directories = [ + dirname($this->backupPath), + $this->backupPath + ]; + + foreach ($directories as $dir) { + if (!file_exists($dir)) { + if (!mkdir($dir, 0755, true)) { + throw new \Exception("خطا در ایجاد پوشه {$dir}"); + } + } + } + } + + private function getLastBackupInfo(string $type): ?string + { + $key = $type === 'ftp' ? 'last_ftp_backup' : 'last_backup'; + return $this->registryMGR->get('system_settings', $key); + } + + private function updateLastBackupInfo(string $type, string $filename): void + { + $key = $type === 'ftp' ? 'last_ftp_backup' : 'last_backup'; + $this->registryMGR->update('system_settings', $key, $filename); + } + + private function createFtpDirectory($ftp, $dir): void + { + // اگر مسیر ریشه است، نیازی به ایجاد نیست + if ($dir === '/' || $dir === '.') { + return; + } + + // بررسی وجود مسیر + if (@ftp_chdir($ftp, $dir)) { + ftp_chdir($ftp, '/'); + return; + } + + // ایجاد مسیر والد + $parent = dirname($dir); + $this->createFtpDirectory($ftp, $parent); + + // ایجاد مسیر فعلی + $folder = basename($dir); + if (!@ftp_mkdir($ftp, $folder)) { + throw new \Exception("خطا در ایجاد پوشه {$folder} در سرور FTP. لطفاً دسترسی‌های کاربر FTP را بررسی کنید."); + } + } +} \ No newline at end of file diff --git a/hesabixCore/src/Controller/System/RegistrySettingsController.php b/hesabixCore/src/Controller/System/RegistrySettingsController.php index 69550ba..7151a85 100644 --- a/hesabixCore/src/Controller/System/RegistrySettingsController.php +++ b/hesabixCore/src/Controller/System/RegistrySettingsController.php @@ -57,6 +57,13 @@ final class RegistrySettingsController extends AbstractController 'appUrl' => $registryMGR->get('system', 'appUrl'), 'appSlogan' => $registryMGR->get('system', 'appSlogan'), 'verifyMobileViaSms' => filter_var($registryMGR->get('system', 'verifyMobileViaSms'), FILTER_VALIDATE_BOOLEAN), + // تنظیمات FTP + 'ftpEnabled' => filter_var($registryMGR->get($rootSystem, 'ftp_enabled'), FILTER_VALIDATE_BOOLEAN), + 'ftpHost' => $registryMGR->get($rootSystem, 'ftp_host') ?: '', + 'ftpPort' => $registryMGR->get($rootSystem, 'ftp_port') ?: '21', + 'ftpUsername' => $registryMGR->get($rootSystem, 'ftp_username') ?: '', + 'ftpPassword' => $registryMGR->get($rootSystem, 'ftp_password') ?: '', + 'ftpPath' => $registryMGR->get($rootSystem, 'ftp_path') ?: '', ]; return new JsonResponse([ @@ -89,10 +96,86 @@ final class RegistrySettingsController extends AbstractController $registryMGR->update('system', 'appUrl', $data['appUrl'] ?? ''); $registryMGR->update('system', 'appSlogan', $data['appSlogan'] ?? ''); $registryMGR->update('system', 'verifyMobileViaSms', $data['verifyMobileViaSms'] ? '1' : '0'); + // ذخیره تنظیمات FTP + $registryMGR->update($rootSystem, 'ftp_enabled', $data['ftpEnabled'] ? '1' : '0'); + $registryMGR->update($rootSystem, 'ftp_host', $data['ftpHost'] ?? ''); + $registryMGR->update($rootSystem, 'ftp_port', $data['ftpPort'] ?? '21'); + $registryMGR->update($rootSystem, 'ftp_username', $data['ftpUsername'] ?? ''); + $registryMGR->update($rootSystem, 'ftp_password', $data['ftpPassword'] ?? ''); + $registryMGR->update($rootSystem, 'ftp_path', $data['ftpPath'] ?? ''); return new JsonResponse([ 'result' => 1, 'message' => 'Settings saved successfully' ]); } + + #[Route('/api/admin/registry/settings/test-ftp', name: 'app_registry_settings_test_ftp', methods: ['POST'])] + public function testFtpConnection(Request $request): JsonResponse + { + try { + $data = json_decode($request->getContent(), true); + + // اعتبارسنجی داده‌های ورودی + $requiredFields = ['host', 'port', 'username', 'password', 'path']; + foreach ($requiredFields as $field) { + if (empty($data[$field])) { + return $this->json([ + 'success' => false, + 'message' => "فیلد {$field} الزامی است" + ], 400); + } + } + + // اعتبارسنجی پورت + $port = (int) $data['port']; + if ($port < 1 || $port > 65535) { + return $this->json([ + 'success' => false, + 'message' => 'پورت باید عددی بین 1 تا 65535 باشد' + ], 400); + } + + // ایجاد اتصال FTP + $ftp = ftp_connect($data['host'], $port, 30); + if (!$ftp) { + return $this->json([ + 'success' => false, + 'message' => 'خطا در اتصال به سرور FTP' + ], 400); + } + + // تلاش برای ورود + if (!ftp_login($ftp, $data['username'], $data['password'])) { + ftp_close($ftp); + return $this->json([ + 'success' => false, + 'message' => 'نام کاربری یا رمز عبور اشتباه است' + ], 400); + } + + // تست دسترسی به مسیر + if (!ftp_chdir($ftp, $data['path'])) { + ftp_close($ftp); + return $this->json([ + 'success' => false, + 'message' => 'مسیر مورد نظر قابل دسترسی نیست' + ], 400); + } + + // بستن اتصال + ftp_close($ftp); + + return $this->json([ + 'success' => true, + 'message' => 'اتصال به سرور FTP با موفقیت برقرار شد' + ]); + + } catch (\Exception $e) { + return $this->json([ + 'success' => false, + 'message' => 'خطا در تست اتصال: ' . $e->getMessage() + ], 500); + } + } } \ No newline at end of file diff --git a/hesabixCore/src/Entity/HesabdariDoc.php b/hesabixCore/src/Entity/HesabdariDoc.php index cc90dd9..dc066e3 100644 --- a/hesabixCore/src/Entity/HesabdariDoc.php +++ b/hesabixCore/src/Entity/HesabdariDoc.php @@ -53,6 +53,9 @@ class HesabdariDoc #[ORM\Column(type: Types::DECIMAL, precision: 30, scale: 0, nullable: true)] private ?string $amount = '0'; + #[ORM\Column(type: Types::FLOAT, nullable: true)] + private ?float $taxPercent = 0; + #[ORM\ManyToOne] #[ORM\JoinColumn(nullable: false)] #[Ignore] @@ -119,6 +122,12 @@ class HesabdariDoc #[ORM\JoinTable(name: 'pairDoc')] private Collection $pairDoc; + #[ORM\Column(length: 255, nullable: true)] + private ?string $discountType = null; + + #[ORM\Column(type: Types::DECIMAL, precision: 10, scale: 2, nullable: true)] + private ?float $discountPercent = null; + public function __construct() { $this->hesabdariRows = new ArrayCollection(); @@ -273,6 +282,17 @@ class HesabdariDoc return $this; } + public function getTaxPercent(): ?float + { + return $this->taxPercent; + } + + public function setTaxPercent(?float $taxPercent): self + { + $this->taxPercent = $taxPercent; + return $this; + } + public function getMoney(): ?Money { return $this->money; @@ -572,4 +592,26 @@ class HesabdariDoc return $this; } + + public function getDiscountType(): ?string + { + return $this->discountType; + } + + public function setDiscountType(?string $discountType): static + { + $this->discountType = $discountType; + return $this; + } + + public function getDiscountPercent(): ?float + { + return $this->discountPercent; + } + + public function setDiscountPercent(?float $discountPercent): static + { + $this->discountPercent = $discountPercent; + return $this; + } } \ No newline at end of file diff --git a/hesabixCore/src/Entity/HesabdariRow.php b/hesabixCore/src/Entity/HesabdariRow.php index 3044604..6e91683 100644 --- a/hesabixCore/src/Entity/HesabdariRow.php +++ b/hesabixCore/src/Entity/HesabdariRow.php @@ -91,6 +91,12 @@ class HesabdariRow #[ORM\Column(length: 255, nullable: true)] private ?string $tax = null; + #[ORM\Column(length: 20, nullable: true)] + private ?string $discountType = null; + + #[ORM\Column(type: Types::DECIMAL, precision: 10, scale: 2, nullable: true)] + private ?float $discountPercent = null; + public function __construct() { } @@ -338,4 +344,28 @@ class HesabdariRow return $this; } + + public function getDiscountType(): ?string + { + return $this->discountType; + } + + public function setDiscountType(?string $discountType): self + { + $this->discountType = $discountType; + + return $this; + } + + public function getDiscountPercent(): ?float + { + return $this->discountPercent; + } + + public function setDiscountPercent(?float $discountPercent): self + { + $this->discountPercent = $discountPercent; + + return $this; + } } \ No newline at end of file diff --git a/hesabixCore/src/Service/Explore.php b/hesabixCore/src/Service/Explore.php index 28c7a1b..79ad1e1 100644 --- a/hesabixCore/src/Service/Explore.php +++ b/hesabixCore/src/Service/Explore.php @@ -64,6 +64,8 @@ class Explore $person = self::ExplorePerson($item->getPerson()); } elseif ($item->getRef()->getCode() == '104') { $result['discountAll'] = $item->getBd(); + $result['discountType'] = $hesabdariDoc->getDiscountType(); + $result['discountPercent'] = $hesabdariDoc->getDiscountPercent(); } elseif ($item->getRef()->getCode() == '61') { $result['transferCost'] = $item->getBs(); } @@ -72,6 +74,10 @@ class Explore $result['discountAll'] = 0; if (!array_key_exists('transferCost', $result)) $result['transferCost'] = 0; + if (!array_key_exists('discountType', $result)) + $result['discountType'] = 'fixed'; + if (!array_key_exists('discountPercent', $result)) + $result['discountPercent'] = null; $result['person'] = $person; $result['pair_docs'] = []; foreach ($hesabdariDoc->getPairDoc() as $pair) { @@ -105,6 +111,8 @@ class Explore $person = self::ExplorePerson($item->getPerson()); } elseif ($item->getRef()->getCode() == '51') { $result['discountAll'] = $item->getBs(); + $result['discountType'] = $hesabdariDoc->getDiscountType(); + $result['discountPercent'] = $hesabdariDoc->getDiscountPercent(); } elseif ($item->getRef()->getCode() == '90') { $result['transferCost'] = $item->getBd(); } @@ -113,6 +121,10 @@ class Explore $result['discountAll'] = 0; if (!array_key_exists('transferCost', $result)) $result['transferCost'] = 0; + if (!array_key_exists('discountType', $result)) + $result['discountType'] = 'fixed'; + if (!array_key_exists('discountPercent', $result)) + $result['discountPercent'] = null; $result['person'] = $person; return $result; } @@ -126,9 +138,20 @@ class Explore $person = self::ExplorePerson($item->getPerson()); } elseif ($item->getCommodity()) { $commodities[] = Explore::ExploreCommodity($item->getCommodity(), $item->getCommdityCount(), $item->getDes()); + } elseif ($item->getRef()->getCode() == '104') { + $result['discountAll'] = $item->getBs(); + $result['discountType'] = $hesabdariDoc->getDiscountType(); + $result['discountPercent'] = $hesabdariDoc->getDiscountPercent(); } } + if (!array_key_exists('discountAll', $result)) + $result['discountAll'] = 0; + if (!array_key_exists('discountType', $result)) + $result['discountType'] = 'fixed'; + if (!array_key_exists('discountPercent', $result)) + $result['discountPercent'] = null; $result['person'] = $person; + $result['commodities'] = $commodities; return $result; } public static function ExploreHesabdariDoc(HesabdariDoc $doc) diff --git a/install.sh b/install.sh index 0dc6f7f..b1a08aa 100644 --- a/install.sh +++ b/install.sh @@ -35,26 +35,26 @@ print_header() { echo -e "${BOLD}${BLUE} Hesabix Installation Script ${NC}" echo -e "${BOLD}${BLUE}=================================================${NC}" echo -e "${YELLOW}Hesabix is a powerful open-source accounting software${NC}" - echo -e "${YELLOW}developed with ❤ by Babak Alizadeh (alizadeh.babak)${NC}" + echo -e "${YELLOW}developed with ❤ by Babak Alizadeh (alizadeh.babak)${NC}" echo -e "${YELLOW}License: GNU GPL v3${NC}" echo -e "${YELLOW}Website: ${UNDERLINE}https://hesabix.ir${NC}" - echo -e "${YELLOW}Support us: ${UNDERLINE}https://hesabix.ir/page/sponsors${NC} ❤" + echo -e "${YELLOW}Support us: ${UNDERLINE}https://hesabix.ir/page/sponsors${NC} ❤" echo -e "${BOLD}${BLUE}=================================================${NC}\n" # Show prerequisites echo -e "${BOLD}${YELLOW}Prerequisites:${NC}" echo -e "1. A domain name pointing to this server" echo -e "2. DNS records properly configured:" - echo -e " • A record pointing to server IP" - echo -e " • www subdomain pointing to server IP" + echo -e " • A record pointing to server IP" + echo -e " • www subdomain pointing to server IP" echo -e "3. Port 80 and 443 open and accessible" echo -e "4. At least 2GB of free disk space" echo -e "5. At least 1GB of RAM" echo -e "\n${BOLD}${YELLOW}Important Notes:${NC}" - echo -e "• SSL certificate installation requires proper DNS configuration" - echo -e "• Domain must be accessible from the internet" - echo -e "• Installation may take 10-15 minutes" - echo -e "• System will be automatically rolled back if installation fails" + echo -e "• SSL certificate installation requires proper DNS configuration" + echo -e "• Domain must be accessible from the internet" + echo -e "• Installation may take 10-15 minutes" + echo -e "• System will be automatically rolled back if installation fails" echo -e "\n${BOLD}${YELLOW}Do you want to continue?${NC}" read -p "Press Enter to continue or Ctrl+C to abort..." echo -e "${BOLD}${BLUE}=================================================${NC}\n" @@ -487,7 +487,7 @@ setup_ssl() { echo -e "2. Domain is pointing to this server's IP address" echo -e "3. Port 80 is accessible from the internet" echo -e "\n${YELLOW}You can run SSL setup later using:${NC}" - echo -e "${GREEN}sudo certbot --apache -d $domain -d www.$domain${NC}" + echo -e "${GREEN}sudo certbot --apache -d $domain${NC}" return 1 fi @@ -504,7 +504,7 @@ setup_ssl() { if ! systemctl is-active --quiet apache2; then log_message "ERROR" "Apache is not running. Please start Apache first." return 1 - } + fi # Try to setup SSL with multiple attempts while [[ $attempt -le $max_attempts ]] && [[ $success == false ]]; do @@ -515,8 +515,8 @@ setup_ssl() { log_message "WARNING" "Failed to stop Apache, continuing anyway..." } - # Run certbot - if certbot --apache -d "$domain" -d "www.$domain" --non-interactive --agree-tos --email "admin@$domain" --force-renewal; then + # Run certbot only for main domain + if certbot --apache -d "$domain" --non-interactive --agree-tos --email "admin@$domain" --force-renewal; then success=true log_message "INFO" "SSL setup completed successfully" else @@ -550,10 +550,10 @@ setup_ssl() { echo -e "2. Port 80 is blocked by firewall" echo -e "3. Let's Encrypt rate limit exceeded" echo -e "\n${YELLOW}You can try setting up SSL manually using:${NC}" - echo -e "${GREEN}sudo certbot --apache -d $domain -d www.$domain${NC}" + echo -e "${GREEN}sudo certbot --apache -d $domain${NC}" echo -e "\n${YELLOW}Or check the logs:${NC}" echo -e "${GREEN}sudo certbot certificates${NC}" - echo -e "${GREEN}sudo certbot --apache -d $domain -d www.$domain --dry-run${NC}" + echo -e "${GREEN}sudo certbot --apache -d $domain --dry-run${NC}" return 1 fi } @@ -656,7 +656,8 @@ setup_database() { local db_name="$base_db_name" local db_user="hesabix_user" local db_password - db_password=$(openssl rand -base64 12) + # Generate password with only alphanumeric characters + db_password=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 12 | head -n 1) local domain_path="/var/www/html/$domain" local counter=1 @@ -868,31 +869,33 @@ setup_web_ui() { cd "$webui_path" || handle_error "Failed to change to webUI directory" + # Set initial permissions for npm operations + chown -R "$SUDO_USER:$SUDO_USER" "$webui_path" + chmod -R 777 "$webui_path" + # Install dependencies log_message "INFO" "Installing web UI dependencies..." timeout "$NPM_TIMEOUT" npm install || handle_error "Failed to install web UI dependencies" - # Set proper permissions for webUI directory - log_message "INFO" "Setting proper permissions for webUI directory..." - chown -R "$apache_user:$apache_user" "$webui_path" - chmod -R 755 "$webui_path" - - # Set execute permissions for node_modules/.bin - if [[ -d "$webui_path/node_modules/.bin" ]]; then - chmod -R +x "$webui_path/node_modules/.bin" - fi - - # Set proper permissions for node_modules - log_message "INFO" "Setting proper permissions for node_modules directory..." - chmod -R 755 "$webui_path/node_modules" - find "$webui_path/node_modules" -type f -exec chmod 644 {} \; - find "$webui_path/node_modules" -type d -exec chmod 755 {} \; - find "$webui_path/node_modules/.bin" -type f -exec chmod 755 {} \; - # Build web UI log_message "INFO" "Building web UI..." timeout "$NPM_TIMEOUT" npm run build-only || handle_error "Failed to build web UI" + # After build, set final ownership to apache + chown -R "$apache_user:$apache_user" "$webui_path" + + # Set final permissions + find "$webui_path" -type d -exec chmod 755 {} \; + find "$webui_path" -type f -exec chmod 644 {} \; + + # Set special permissions for node_modules + if [[ -d "$webui_path/node_modules" ]]; then + chmod -R 755 "$webui_path/node_modules" + find "$webui_path/node_modules" -type f -exec chmod 644 {} \; + find "$webui_path/node_modules" -type d -exec chmod 755 {} \; + find "$webui_path/node_modules/.bin" -type f -exec chmod 755 {} \; + fi + log_message "INFO" "Web UI setup completed" } @@ -950,14 +953,14 @@ confirm_installation() { echo -e "${BOLD}${BLUE} Installation Confirmation ${NC}" echo -e "${BOLD}${BLUE}=================================================${NC}" echo -e "${YELLOW}This script will install:${NC}" - echo -e "• PHP and required extensions" - echo -e "• MySQL/MariaDB" - echo -e "• Apache" - echo -e "• Node.js" - echo -e "• Composer" - echo -e "• phpMyAdmin" - echo -e "• Hesabix Core" - echo -e "• Hesabix Web UI" + echo -e "• PHP and required extensions" + echo -e "• MySQL/MariaDB" + echo -e "• Apache" + echo -e "• Node.js" + echo -e "• Composer" + echo -e "• phpMyAdmin" + echo -e "• Hesabix Core" + echo -e "• Hesabix Web UI" echo -e "\n${YELLOW}The installation will require approximately 2GB of disk space.${NC}" echo -e "${BOLD}${BLUE}=================================================${NC}\n" @@ -1012,7 +1015,7 @@ show_installation_summary() { # Get database password from env file if [[ -f "$env_file" ]]; then - db_password=$(php -r "include '$env_file'; echo \$env['DATABASE_URL']; echo PHP_EOL;" | grep -oP '(?<=://[^:]+:)[^@]+(?=@)') + db_password=$(php -r "include '$env_file'; echo \$env['DATABASE_URL']; echo PHP_EOL;" | sed -n 's/.*:\/\/[^:]*:\([^@]*\)@.*/\1/p') fi log_message "INFO" "Showing installation summary..." @@ -1047,7 +1050,7 @@ show_installation_summary() { echo -e "\n${YELLOW}To get database information, you can:${NC}" echo -e "1. Check the file: $env_file" echo -e "2. Run this command to extract password:" - echo -e " ${GREEN}php -r \"include '$env_file'; echo \$env['DATABASE_URL']; echo PHP_EOL;\" | grep -oP '(?<=://[^:]+:)[^@]+(?=@)'${NC}" + echo -e " ${GREEN}php -r \"include '$env_file'; echo \$env['DATABASE_URL']; echo PHP_EOL;\" | sed -n 's/.*:\/\/[^:]*:\\([^@]*\\)@.*/\\1/p'${NC}" echo -e "3. Or check MySQL directly:" echo -e " ${GREEN}mysql -u root -e \"SELECT User, Host FROM mysql.user WHERE User='$db_user';\"${NC}" fi @@ -1068,10 +1071,10 @@ show_installation_summary() { echo -e "4. Register the first user (system administrator)" echo -e "\n${YELLOW}Support:${NC}" - echo -e "• Developer: Babak Alizadeh (alizadeh.babak)" - echo -e "• License: GNU GPL v3" - echo -e "• Website: ${UNDERLINE}https://hesabix.ir${NC}" - echo -e "• Support us: ${UNDERLINE}https://hesabix.ir/page/sponsors${NC} ❤" + echo -e "• Developer: Babak Alizadeh (alizadeh.babak)" + echo -e "• License: GNU GPL v3" + echo -e "• Website: ${UNDERLINE}https://hesabix.ir${NC}" + echo -e "• Support us: ${UNDERLINE}https://hesabix.ir/page/sponsors${NC} ❤" echo -e "\n${GREEN}Installation completed successfully!${NC}" echo -e "${BOLD}${BLUE}=================================================${NC}" @@ -1087,9 +1090,9 @@ display_telemetry_consent() { echo -e "${RED} Anonymous Data Collection " echo -e "${RED}=================================================" echo -e "${BLUE}To improve Hesabix, we would like to collect anonymous data:" - echo -e "${BLUE}• System information (OS, PHP, MySQL versions)" - echo -e "${BLUE}• Installation path and domain" - echo -e "${BLUE}• Installation date" + echo -e "${BLUE}• System information (OS, PHP, MySQL versions)" + echo -e "${BLUE}• Installation path and domain" + echo -e "${BLUE}• Installation date" read -p "Do you agree? (y/n) [n]: " response [[ "$response" =~ ^[Yy]$ ]] && SEND_TELEMETRY=true diff --git a/webUI/.gitignore b/webUI/.gitignore old mode 100755 new mode 100644 diff --git a/webUI/LICENSE b/webUI/LICENSE old mode 100755 new mode 100644 diff --git a/webUI/env.d.ts b/webUI/env.d.ts old mode 100755 new mode 100644 diff --git a/webUI/index.html b/webUI/index.html old mode 100755 new mode 100644 diff --git a/webUI/package.json b/webUI/package.json old mode 100755 new mode 100644 diff --git a/webUI/public/.htaccess b/webUI/public/.htaccess old mode 100755 new mode 100644 diff --git a/webUI/public/dashmix/dashmix.app.min.js b/webUI/public/dashmix/dashmix.app.min.js old mode 100755 new mode 100644 diff --git a/webUI/public/dashmix/dashmix.min.css b/webUI/public/dashmix/dashmix.min.css old mode 100755 new mode 100644 diff --git a/webUI/public/favicon.ico b/webUI/public/favicon.ico old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/fontawesome/fa-brands-400.ttf b/webUI/public/fonts/fontawesome/fa-brands-400.ttf old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/fontawesome/fa-brands-400.woff2 b/webUI/public/fonts/fontawesome/fa-brands-400.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/fontawesome/fa-regular-400.ttf b/webUI/public/fonts/fontawesome/fa-regular-400.ttf old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/fontawesome/fa-regular-400.woff2 b/webUI/public/fonts/fontawesome/fa-regular-400.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/fontawesome/fa-solid-900.ttf b/webUI/public/fonts/fontawesome/fa-solid-900.ttf old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/fontawesome/fa-solid-900.woff2 b/webUI/public/fonts/fontawesome/fa-solid-900.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/fontawesome/fa-v4compatibility.ttf b/webUI/public/fonts/fontawesome/fa-v4compatibility.ttf old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/fontawesome/fa-v4compatibility.woff2 b/webUI/public/fonts/fontawesome/fa-v4compatibility.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/inter/inter-v11-latin-300.woff2 b/webUI/public/fonts/inter/inter-v11-latin-300.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/inter/inter-v11-latin-500.woff2 b/webUI/public/fonts/inter/inter-v11-latin-500.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/inter/inter-v11-latin-600.woff2 b/webUI/public/fonts/inter/inter-v11-latin-600.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/inter/inter-v11-latin-700.woff2 b/webUI/public/fonts/inter/inter-v11-latin-700.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/inter/inter-v11-latin-800.woff2 b/webUI/public/fonts/inter/inter-v11-latin-800.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/inter/inter-v11-latin-900.woff2 b/webUI/public/fonts/inter/inter-v11-latin-900.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/inter/inter-v11-latin-regular.woff2 b/webUI/public/fonts/inter/inter-v11-latin-regular.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/sahel/Sahel-Black-FD.eot b/webUI/public/fonts/sahel/Sahel-Black-FD.eot old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/sahel/Sahel-Black-FD.ttf b/webUI/public/fonts/sahel/Sahel-Black-FD.ttf old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/sahel/Sahel-Black-FD.woff b/webUI/public/fonts/sahel/Sahel-Black-FD.woff old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/sahel/Sahel-Black-FD.woff2 b/webUI/public/fonts/sahel/Sahel-Black-FD.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/sahel/Sahel-Bold-FD.eot b/webUI/public/fonts/sahel/Sahel-Bold-FD.eot old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/sahel/Sahel-Bold-FD.ttf b/webUI/public/fonts/sahel/Sahel-Bold-FD.ttf old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/sahel/Sahel-Bold-FD.woff b/webUI/public/fonts/sahel/Sahel-Bold-FD.woff old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/sahel/Sahel-Bold-FD.woff2 b/webUI/public/fonts/sahel/Sahel-Bold-FD.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/sahel/Sahel-FD.eot b/webUI/public/fonts/sahel/Sahel-FD.eot old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/sahel/Sahel-FD.ttf b/webUI/public/fonts/sahel/Sahel-FD.ttf old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/sahel/Sahel-FD.woff b/webUI/public/fonts/sahel/Sahel-FD.woff old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/sahel/Sahel-FD.woff2 b/webUI/public/fonts/sahel/Sahel-FD.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/sahel/Sahel-Light-FD.eot b/webUI/public/fonts/sahel/Sahel-Light-FD.eot old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/sahel/Sahel-Light-FD.ttf b/webUI/public/fonts/sahel/Sahel-Light-FD.ttf old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/sahel/Sahel-Light-FD.woff b/webUI/public/fonts/sahel/Sahel-Light-FD.woff old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/sahel/Sahel-Light-FD.woff2 b/webUI/public/fonts/sahel/Sahel-Light-FD.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/sahel/Sahel-SemiBold-FD.eot b/webUI/public/fonts/sahel/Sahel-SemiBold-FD.eot old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/sahel/Sahel-SemiBold-FD.ttf b/webUI/public/fonts/sahel/Sahel-SemiBold-FD.ttf old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/sahel/Sahel-SemiBold-FD.woff b/webUI/public/fonts/sahel/Sahel-SemiBold-FD.woff old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/sahel/Sahel-SemiBold-FD.woff2 b/webUI/public/fonts/sahel/Sahel-SemiBold-FD.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/sahel/sahel.css b/webUI/public/fonts/sahel/sahel.css old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/shabnam/Shabnam-Bold-FD.eot b/webUI/public/fonts/shabnam/Shabnam-Bold-FD.eot old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/shabnam/Shabnam-Bold-FD.ttf b/webUI/public/fonts/shabnam/Shabnam-Bold-FD.ttf old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/shabnam/Shabnam-Bold-FD.woff b/webUI/public/fonts/shabnam/Shabnam-Bold-FD.woff old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/shabnam/Shabnam-Bold-FD.woff2 b/webUI/public/fonts/shabnam/Shabnam-Bold-FD.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/shabnam/Shabnam-FD.eot b/webUI/public/fonts/shabnam/Shabnam-FD.eot old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/shabnam/Shabnam-FD.ttf b/webUI/public/fonts/shabnam/Shabnam-FD.ttf old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/shabnam/Shabnam-FD.woff b/webUI/public/fonts/shabnam/Shabnam-FD.woff old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/shabnam/Shabnam-FD.woff2 b/webUI/public/fonts/shabnam/Shabnam-FD.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/shabnam/Shabnam-Light-FD.eot b/webUI/public/fonts/shabnam/Shabnam-Light-FD.eot old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/shabnam/Shabnam-Light-FD.ttf b/webUI/public/fonts/shabnam/Shabnam-Light-FD.ttf old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/shabnam/Shabnam-Light-FD.woff b/webUI/public/fonts/shabnam/Shabnam-Light-FD.woff old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/shabnam/Shabnam-Light-FD.woff2 b/webUI/public/fonts/shabnam/Shabnam-Light-FD.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/shabnam/Shabnam-Medium-FD.eot b/webUI/public/fonts/shabnam/Shabnam-Medium-FD.eot old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/shabnam/Shabnam-Medium-FD.ttf b/webUI/public/fonts/shabnam/Shabnam-Medium-FD.ttf old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/shabnam/Shabnam-Medium-FD.woff b/webUI/public/fonts/shabnam/Shabnam-Medium-FD.woff old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/shabnam/Shabnam-Medium-FD.woff2 b/webUI/public/fonts/shabnam/Shabnam-Medium-FD.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/shabnam/Shabnam-Thin-FD.eot b/webUI/public/fonts/shabnam/Shabnam-Thin-FD.eot old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/shabnam/Shabnam-Thin-FD.ttf b/webUI/public/fonts/shabnam/Shabnam-Thin-FD.ttf old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/shabnam/Shabnam-Thin-FD.woff b/webUI/public/fonts/shabnam/Shabnam-Thin-FD.woff old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/shabnam/Shabnam-Thin-FD.woff2 b/webUI/public/fonts/shabnam/Shabnam-Thin-FD.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/shabnam/shabnam.css b/webUI/public/fonts/shabnam/shabnam.css old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/simple-line-icons/Simple-Line-Icons.eot b/webUI/public/fonts/simple-line-icons/Simple-Line-Icons.eot old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/simple-line-icons/Simple-Line-Icons.svg b/webUI/public/fonts/simple-line-icons/Simple-Line-Icons.svg old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/simple-line-icons/Simple-Line-Icons.ttf b/webUI/public/fonts/simple-line-icons/Simple-Line-Icons.ttf old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/simple-line-icons/Simple-Line-Icons.woff b/webUI/public/fonts/simple-line-icons/Simple-Line-Icons.woff old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/simple-line-icons/Simple-Line-Icons.woff2 b/webUI/public/fonts/simple-line-icons/Simple-Line-Icons.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/vazir/ttf/Vazirmatn-Black.ttf b/webUI/public/fonts/vazir/ttf/Vazirmatn-Black.ttf old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/vazir/ttf/Vazirmatn-Bold.ttf b/webUI/public/fonts/vazir/ttf/Vazirmatn-Bold.ttf old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/vazir/ttf/Vazirmatn-ExtraBold.ttf b/webUI/public/fonts/vazir/ttf/Vazirmatn-ExtraBold.ttf old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/vazir/ttf/Vazirmatn-ExtraLight.ttf b/webUI/public/fonts/vazir/ttf/Vazirmatn-ExtraLight.ttf old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/vazir/ttf/Vazirmatn-Light.ttf b/webUI/public/fonts/vazir/ttf/Vazirmatn-Light.ttf old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/vazir/ttf/Vazirmatn-Medium.ttf b/webUI/public/fonts/vazir/ttf/Vazirmatn-Medium.ttf old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/vazir/ttf/Vazirmatn-Regular.ttf b/webUI/public/fonts/vazir/ttf/Vazirmatn-Regular.ttf old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/vazir/ttf/Vazirmatn-SemiBold.ttf b/webUI/public/fonts/vazir/ttf/Vazirmatn-SemiBold.ttf old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/vazir/ttf/Vazirmatn-Thin.ttf b/webUI/public/fonts/vazir/ttf/Vazirmatn-Thin.ttf old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/vazir/variable/Vazirmatn[wght].ttf b/webUI/public/fonts/vazir/variable/Vazirmatn[wght].ttf old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/vazir/vazir.css b/webUI/public/fonts/vazir/vazir.css old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/vazir/webfonts/Vazirmatn-Black.woff2 b/webUI/public/fonts/vazir/webfonts/Vazirmatn-Black.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/vazir/webfonts/Vazirmatn-Bold.woff2 b/webUI/public/fonts/vazir/webfonts/Vazirmatn-Bold.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/vazir/webfonts/Vazirmatn-ExtraBold.woff2 b/webUI/public/fonts/vazir/webfonts/Vazirmatn-ExtraBold.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/vazir/webfonts/Vazirmatn-ExtraLight.woff2 b/webUI/public/fonts/vazir/webfonts/Vazirmatn-ExtraLight.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/vazir/webfonts/Vazirmatn-FD-Black.woff2 b/webUI/public/fonts/vazir/webfonts/Vazirmatn-FD-Black.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/vazir/webfonts/Vazirmatn-FD-Bold.woff2 b/webUI/public/fonts/vazir/webfonts/Vazirmatn-FD-Bold.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/vazir/webfonts/Vazirmatn-FD-ExtraBold.woff2 b/webUI/public/fonts/vazir/webfonts/Vazirmatn-FD-ExtraBold.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/vazir/webfonts/Vazirmatn-FD-ExtraLight.woff2 b/webUI/public/fonts/vazir/webfonts/Vazirmatn-FD-ExtraLight.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/vazir/webfonts/Vazirmatn-FD-Light.woff2 b/webUI/public/fonts/vazir/webfonts/Vazirmatn-FD-Light.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/vazir/webfonts/Vazirmatn-FD-Medium.woff2 b/webUI/public/fonts/vazir/webfonts/Vazirmatn-FD-Medium.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/vazir/webfonts/Vazirmatn-FD-Regular.woff2 b/webUI/public/fonts/vazir/webfonts/Vazirmatn-FD-Regular.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/vazir/webfonts/Vazirmatn-FD-SemiBold.woff2 b/webUI/public/fonts/vazir/webfonts/Vazirmatn-FD-SemiBold.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/vazir/webfonts/Vazirmatn-FD-Thin.woff2 b/webUI/public/fonts/vazir/webfonts/Vazirmatn-FD-Thin.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/vazir/webfonts/Vazirmatn-Light.woff2 b/webUI/public/fonts/vazir/webfonts/Vazirmatn-Light.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/vazir/webfonts/Vazirmatn-Medium.woff2 b/webUI/public/fonts/vazir/webfonts/Vazirmatn-Medium.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/vazir/webfonts/Vazirmatn-Regular.woff2 b/webUI/public/fonts/vazir/webfonts/Vazirmatn-Regular.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/vazir/webfonts/Vazirmatn-SemiBold.woff2 b/webUI/public/fonts/vazir/webfonts/Vazirmatn-SemiBold.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/vazir/webfonts/Vazirmatn-Thin.woff2 b/webUI/public/fonts/vazir/webfonts/Vazirmatn-Thin.woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/fonts/vazir/webfonts/Vazirmatn[wght].woff2 b/webUI/public/fonts/vazir/webfonts/Vazirmatn[wght].woff2 old mode 100755 new mode 100644 diff --git a/webUI/public/img/404.gif b/webUI/public/img/404.gif old mode 100755 new mode 100644 diff --git a/webUI/public/img/android-chrome-192x192.png b/webUI/public/img/android-chrome-192x192.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/android-chrome-512x512.png b/webUI/public/img/android-chrome-512x512.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/apple-touch-icon.png b/webUI/public/img/apple-touch-icon.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/avatar.jpg b/webUI/public/img/avatar.jpg old mode 100755 new mode 100644 diff --git a/webUI/public/img/avatar.png b/webUI/public/img/avatar.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/avatar.webp b/webUI/public/img/avatar.webp old mode 100755 new mode 100644 diff --git a/webUI/public/img/banner1.jpg b/webUI/public/img/banner1.jpg old mode 100755 new mode 100644 diff --git a/webUI/public/img/bg_side_overlay_header.jpg b/webUI/public/img/bg_side_overlay_header.jpg old mode 100755 new mode 100644 diff --git a/webUI/public/img/cover.jpg b/webUI/public/img/cover.jpg old mode 100755 new mode 100644 diff --git a/webUI/public/img/enamad-logo.png b/webUI/public/img/enamad-logo.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/favicon-16x16.png b/webUI/public/img/favicon-16x16.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/favicon-32x32.png b/webUI/public/img/favicon-32x32.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/favicon.ico b/webUI/public/img/favicon.ico old mode 100755 new mode 100644 diff --git a/webUI/public/img/favicons/apple-touch-icon-180x180.png b/webUI/public/img/favicons/apple-touch-icon-180x180.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/favicons/favicon-192x192.png b/webUI/public/img/favicons/favicon-192x192.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/favicons/favicon.ico b/webUI/public/img/favicons/favicon.ico old mode 100755 new mode 100644 diff --git a/webUI/public/img/favicons/favicon.png b/webUI/public/img/favicons/favicon.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/favicons/favw.png b/webUI/public/img/favicons/favw.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/favw.png b/webUI/public/img/favw.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/icons/bale-logo.png b/webUI/public/img/icons/bale-logo.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/icons/bank.jpg b/webUI/public/img/icons/bank.jpg old mode 100755 new mode 100644 diff --git a/webUI/public/img/icons/business.png b/webUI/public/img/icons/business.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/icons/cashdesk.jpg b/webUI/public/img/icons/cashdesk.jpg old mode 100755 new mode 100644 diff --git a/webUI/public/img/icons/check.jpg b/webUI/public/img/icons/check.jpg old mode 100755 new mode 100644 diff --git a/webUI/public/img/icons/eitaa.jpeg b/webUI/public/img/icons/eitaa.jpeg old mode 100755 new mode 100644 diff --git a/webUI/public/img/icons/melipayamak.png b/webUI/public/img/icons/melipayamak.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/icons/robika.png b/webUI/public/img/icons/robika.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/icons/salary.jpg b/webUI/public/img/icons/salary.jpg old mode 100755 new mode 100644 diff --git a/webUI/public/img/icons/telegram.png b/webUI/public/img/icons/telegram.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/icons/wallet.png b/webUI/public/img/icons/wallet.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/icons/warehouse.jpg b/webUI/public/img/icons/warehouse.jpg old mode 100755 new mode 100644 diff --git a/webUI/public/img/icons/zarinpal.png b/webUI/public/img/icons/zarinpal.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/logo-blue.png b/webUI/public/img/logo-blue.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/logo/homescreen144.png b/webUI/public/img/logo/homescreen144.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/logo/homescreen168.png b/webUI/public/img/logo/homescreen168.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/logo/homescreen192.png b/webUI/public/img/logo/homescreen192.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/logo/homescreen256.png b/webUI/public/img/logo/homescreen256.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/logo/homescreen48.png b/webUI/public/img/logo/homescreen48.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/logo/homescreen512.png b/webUI/public/img/logo/homescreen512.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/logo/homescreen72.png b/webUI/public/img/logo/homescreen72.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/logo/homescreen96.png b/webUI/public/img/logo/homescreen96.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/logo/logo500.png b/webUI/public/img/logo/logo500.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/payways/pec.ir.png b/webUI/public/img/payways/pec.ir.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/payways/zarinpal-logo-min.png b/webUI/public/img/payways/zarinpal-logo-min.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/plugins/accpro.png b/webUI/public/img/plugins/accpro.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/plugins/accpro/intro.png b/webUI/public/img/plugins/accpro/intro.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/plugins/apartemanma.jpg b/webUI/public/img/plugins/apartemanma.jpg old mode 100755 new mode 100644 diff --git a/webUI/public/img/plugins/apartemanma/drawer.jpg b/webUI/public/img/plugins/apartemanma/drawer.jpg old mode 100755 new mode 100644 diff --git a/webUI/public/img/plugins/apartemanma/intro.jpg b/webUI/public/img/plugins/apartemanma/intro.jpg old mode 100755 new mode 100644 diff --git a/webUI/public/img/plugins/club.webp b/webUI/public/img/plugins/club.webp old mode 100755 new mode 100644 diff --git a/webUI/public/img/plugins/noghrekoob.jpeg b/webUI/public/img/plugins/noghrekoob.jpeg old mode 100755 new mode 100644 diff --git a/webUI/public/img/plugins/onlinestore.webp b/webUI/public/img/plugins/onlinestore.webp old mode 100755 new mode 100644 diff --git a/webUI/public/img/plugins/onlinestore/intro.webp b/webUI/public/img/plugins/onlinestore/intro.webp old mode 100755 new mode 100644 diff --git a/webUI/public/img/plugins/repservice.jpg b/webUI/public/img/plugins/repservice.jpg old mode 100755 new mode 100644 diff --git a/webUI/public/img/plugins/repservice.png b/webUI/public/img/plugins/repservice.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/plugins/rest.jpg b/webUI/public/img/plugins/rest.jpg old mode 100755 new mode 100644 diff --git a/webUI/public/img/sabavision.gif b/webUI/public/img/sabavision.gif old mode 100755 new mode 100644 diff --git a/webUI/public/img/site.webmanifest b/webUI/public/img/site.webmanifest old mode 100755 new mode 100644 diff --git a/webUI/public/img/whatsapp.png b/webUI/public/img/whatsapp.png old mode 100755 new mode 100644 diff --git a/webUI/public/img/wp.jpg b/webUI/public/img/wp.jpg old mode 100755 new mode 100644 diff --git a/webUI/public/img/zarinpal-logo-min.png b/webUI/public/img/zarinpal-logo-min.png old mode 100755 new mode 100644 diff --git a/webUI/public/manifest.json b/webUI/public/manifest.json old mode 100755 new mode 100644 diff --git a/webUI/public/service-worker.js b/webUI/public/service-worker.js old mode 100755 new mode 100644 diff --git a/webUI/src/App.vue b/webUI/src/App.vue old mode 100755 new mode 100644 diff --git a/webUI/src/assets/dino.png b/webUI/src/assets/dino.png old mode 100755 new mode 100644 diff --git a/webUI/src/assets/hero.png b/webUI/src/assets/hero.png old mode 100755 new mode 100644 diff --git a/webUI/src/assets/logo.svg b/webUI/src/assets/logo.svg old mode 100755 new mode 100644 diff --git a/webUI/src/assets/peach.png b/webUI/src/assets/peach.png old mode 100755 new mode 100644 diff --git a/webUI/src/assets/site.css b/webUI/src/assets/site.css old mode 100755 new mode 100644 diff --git a/webUI/src/components/ChangePasswordDialog.vue b/webUI/src/components/ChangePasswordDialog.vue old mode 100755 new mode 100644 diff --git a/webUI/src/components/Editor.vue b/webUI/src/components/Editor.vue old mode 100755 new mode 100644 diff --git a/webUI/src/components/PrintDialog.vue b/webUI/src/components/PrintDialog.vue old mode 100755 new mode 100644 diff --git a/webUI/src/components/application/buttons/CalculatorButton.vue b/webUI/src/components/application/buttons/CalculatorButton.vue old mode 100755 new mode 100644 diff --git a/webUI/src/components/application/buttons/SecretDialog.vue b/webUI/src/components/application/buttons/SecretDialog.vue old mode 100755 new mode 100644 diff --git a/webUI/src/components/application/buttons/change_lang.vue b/webUI/src/components/application/buttons/change_lang.vue old mode 100755 new mode 100644 diff --git a/webUI/src/components/application/buttons/notifications_btn.vue b/webUI/src/components/application/buttons/notifications_btn.vue old mode 100755 new mode 100644 diff --git a/webUI/src/components/application/buttons/profile_btn.vue b/webUI/src/components/application/buttons/profile_btn.vue old mode 100755 new mode 100644 diff --git a/webUI/src/components/application/clock.vue b/webUI/src/components/application/clock.vue old mode 100755 new mode 100644 diff --git a/webUI/src/components/application/combobox/currency_cob.vue b/webUI/src/components/application/combobox/currency_cob.vue old mode 100755 new mode 100644 diff --git a/webUI/src/components/application/combobox/year_cob.vue b/webUI/src/components/application/combobox/year_cob.vue old mode 100755 new mode 100644 diff --git a/webUI/src/components/application/list/archive_list.vue b/webUI/src/components/application/list/archive_list.vue old mode 100755 new mode 100644 diff --git a/webUI/src/components/application/list/sms_list.vue b/webUI/src/components/application/list/sms_list.vue old mode 100755 new mode 100644 diff --git a/webUI/src/components/forms/Haccountsearch.vue b/webUI/src/components/forms/Haccountsearch.vue old mode 100755 new mode 100644 diff --git a/webUI/src/components/forms/Hbankaccountsearch.vue b/webUI/src/components/forms/Hbankaccountsearch.vue old mode 100755 new mode 100644 diff --git a/webUI/src/components/forms/Hbankselect.vue b/webUI/src/components/forms/Hbankselect.vue old mode 100755 new mode 100644 diff --git a/webUI/src/components/forms/Hcashdesksearch.vue b/webUI/src/components/forms/Hcashdesksearch.vue old mode 100755 new mode 100644 diff --git a/webUI/src/components/forms/Hcommoditysearch.vue b/webUI/src/components/forms/Hcommoditysearch.vue old mode 100755 new mode 100644 diff --git a/webUI/src/components/forms/Hdatepicker.vue b/webUI/src/components/forms/Hdatepicker.vue old mode 100755 new mode 100644 diff --git a/webUI/src/components/forms/HesabdariTreeView.vue b/webUI/src/components/forms/HesabdariTreeView.vue old mode 100755 new mode 100644 diff --git a/webUI/src/components/forms/Hnumberinput.vue b/webUI/src/components/forms/Hnumberinput.vue old mode 100755 new mode 100644 diff --git a/webUI/src/components/forms/Hpersonsearch.vue b/webUI/src/components/forms/Hpersonsearch.vue old mode 100755 new mode 100644 index 82ae6a2..a2ff5b3 --- a/webUI/src/components/forms/Hpersonsearch.vue +++ b/webUI/src/components/forms/Hpersonsearch.vue @@ -16,7 +16,7 @@ :loading="loading" @keydown.enter="handleEnter" hide-details - density="compact" + density="comfortable" style="font-size: 0.7rem;" > + + + diff --git a/webUI/src/views/acc/accounting/table.vue b/webUI/src/views/acc/accounting/table.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/accounting/viewDoc.vue b/webUI/src/views/acc/accounting/viewDoc.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/api/list.vue b/webUI/src/views/acc/api/list.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/archive/order_new.vue b/webUI/src/views/acc/archive/order_new.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/archive/orders_list.vue b/webUI/src/views/acc/archive/orders_list.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/archive/view_files.vue b/webUI/src/views/acc/archive/view_files.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/bank/card.vue b/webUI/src/views/acc/bank/card.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/bank/list.vue b/webUI/src/views/acc/bank/list.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/bank/mod.vue b/webUI/src/views/acc/bank/mod.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/buy/list.vue b/webUI/src/views/acc/buy/list.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/buy/mod.vue b/webUI/src/views/acc/buy/mod.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/buy/viewInvoice.vue b/webUI/src/views/acc/buy/viewInvoice.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/cashdesk/card.vue b/webUI/src/views/acc/cashdesk/card.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/cashdesk/list.vue b/webUI/src/views/acc/cashdesk/list.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/cashdesk/mod.vue b/webUI/src/views/acc/cashdesk/mod.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/cheque/input.vue b/webUI/src/views/acc/cheque/input.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/cheque/list.vue b/webUI/src/views/acc/cheque/list.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/cheque/mod.vue b/webUI/src/views/acc/cheque/mod.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/cheque/output.vue b/webUI/src/views/acc/cheque/output.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/cheque/transfer.vue b/webUI/src/views/acc/cheque/transfer.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/commodity/cat/list.vue b/webUI/src/views/acc/commodity/cat/list.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/commodity/drop/list.vue b/webUI/src/views/acc/commodity/drop/list.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/commodity/drop/mod.vue b/webUI/src/views/acc/commodity/drop/mod.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/commodity/list.vue b/webUI/src/views/acc/commodity/list.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/commodity/mod.vue b/webUI/src/views/acc/commodity/mod.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/commodity/priceList/list.vue b/webUI/src/views/acc/commodity/priceList/list.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/commodity/priceList/mod.vue b/webUI/src/views/acc/commodity/priceList/mod.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/commodity/priceList/pricelistedit.vue b/webUI/src/views/acc/commodity/priceList/pricelistedit.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/commodity/priceList/view.vue b/webUI/src/views/acc/commodity/priceList/view.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/component/Currency.vue b/webUI/src/views/acc/component/Currency.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/component/Year.vue b/webUI/src/views/acc/component/Year.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/component/archive/archiveUpload.vue b/webUI/src/views/acc/component/archive/archiveUpload.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/component/archive/archive_modal.vue b/webUI/src/views/acc/component/archive/archive_modal.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/component/commodity/changePriceGroup.vue b/webUI/src/views/acc/component/commodity/changePriceGroup.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/component/commodity/quickAddCommodity.vue b/webUI/src/views/acc/component/commodity/quickAddCommodity.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/component/documentLogButton.vue b/webUI/src/views/acc/component/documentLogButton.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/component/helpBtn.vue b/webUI/src/views/acc/component/helpBtn.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/component/hitable.vue b/webUI/src/views/acc/component/hitable.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/component/importModal/commodity-import-excel.vue b/webUI/src/views/acc/component/importModal/commodity-import-excel.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/component/importModal/person-import-excel.vue b/webUI/src/views/acc/component/importModal/person-import-excel.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/component/mostdes.vue b/webUI/src/views/acc/component/mostdes.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/component/notes.vue b/webUI/src/views/acc/component/notes.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/component/notifications/icon.vue b/webUI/src/views/acc/component/notifications/icon.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/component/person.vue b/webUI/src/views/acc/component/person.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/component/person/quickAdd.vue b/webUI/src/views/acc/component/person/quickAdd.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/component/person/quickView.vue b/webUI/src/views/acc/component/person/quickView.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/component/rec.vue b/webUI/src/views/acc/component/rec.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/component/recList.vue b/webUI/src/views/acc/component/recList.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/component/reports/detailsBtn.vue b/webUI/src/views/acc/component/reports/detailsBtn.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/component/send.vue b/webUI/src/views/acc/component/send.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/component/smsPanel.vue b/webUI/src/views/acc/component/smsPanel.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/component/widgets/saleChart.vue b/webUI/src/views/acc/component/widgets/saleChart.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/costs/list.vue b/webUI/src/views/acc/costs/list.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/costs/mod.vue b/webUI/src/views/acc/costs/mod.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/dashboard.vue b/webUI/src/views/acc/dashboard.vue old mode 100755 new mode 100644 index 60575d7..804ad0c --- a/webUI/src/views/acc/dashboard.vue +++ b/webUI/src/views/acc/dashboard.vue @@ -35,27 +35,7 @@ - - - - - - - - - - - - - -

{{ $t('dashboard.topCommodities.noData') }}

-
-
+
@@ -315,21 +295,6 @@ export default { incomes: false, topIncomeCenters: false, }, - topCommodities: [], - topCommoditiesPeriod: 'year', - topCommoditiesLimit: 5, - periodOptions: [ - { title: self.$t('dashboard.period.today'), value: 'today' }, - { title: self.$t('dashboard.period.week'), value: 'week' }, - { title: self.$t('dashboard.period.month'), value: 'month' }, - { title: self.$t('dashboard.period.year'), value: 'year' }, - ], - limitOptions: [ - { title: '۳', value: 3 }, - { title: '۵', value: 5 }, - { title: '۷', value: 7 }, - { title: '۱۰', value: 10 }, - ], }; }, methods: { @@ -359,7 +324,7 @@ export default { this.loading = false; } }, - async fetchIncomeData() { // متد جدید برای گرفتن داده‌های درآمد + async fetchIncomeData() { this.loading = true; try { const response = await axios.get('/api/income/dashboard/data'); @@ -389,37 +354,18 @@ export default { this.statements = statements.data; this.stat = stats.data; - if (this.dashboard.topCommodities) { - await this.fetchTopCommodities(); - } if (this.dashboard.costs && this.permissions.cost) { await this.fetchCostData(); } - if (this.dashboard.incomes && this.permissions.income) { // بارگذاری داده‌های درآمد + if (this.dashboard.incomes && this.permissions.income) { await this.fetchIncomeData(); } - // نیازی به بارگذاری داده‌های نمودار اینجا نیست، کامپوننت خودش داده را می‌گیرد } catch (error) { console.error('Load data error:', error); } finally { this.loading = false; } }, - async fetchTopCommodities() { - this.loading = true; - try { - const response = await axios.post('/api/report/top-selling-commodities', { - period: this.topCommoditiesPeriod, - limit: this.topCommoditiesLimit, - }); - this.topCommodities = response.data; - } catch (error) { - console.error('Fetch top commodities error:', error); - this.topCommodities = []; - } finally { - this.loading = false; - } - }, }, mounted() { this.loadData(); @@ -436,11 +382,4 @@ export default { flex-direction: column; justify-content: space-between; } - -.card-equal-height_big { - height: 550; - display: flex; - flex-direction: column; - justify-content: space-between; -} \ No newline at end of file diff --git a/webUI/src/views/acc/incomes/list.vue b/webUI/src/views/acc/incomes/list.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/incomes/mod.vue b/webUI/src/views/acc/incomes/mod.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/notifications/notifications.vue b/webUI/src/views/acc/notifications/notifications.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/persons/card.vue b/webUI/src/views/acc/persons/card.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/persons/insert.vue b/webUI/src/views/acc/persons/insert.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/persons/list.vue b/webUI/src/views/acc/persons/list.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/persons/receive/list.vue b/webUI/src/views/acc/persons/receive/list.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/persons/receive/mod.vue b/webUI/src/views/acc/persons/receive/mod.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/persons/send/list.vue b/webUI/src/views/acc/persons/send/list.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/persons/send/mod.vue b/webUI/src/views/acc/persons/send/mod.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/plugins/accpro/intro.vue b/webUI/src/views/acc/plugins/accpro/intro.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/plugins/amartemanma/intro.vue b/webUI/src/views/acc/plugins/amartemanma/intro.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/plugins/cc/intro.vue b/webUI/src/views/acc/plugins/cc/intro.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/plugins/noghre/employess/list.vue b/webUI/src/views/acc/plugins/noghre/employess/list.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/plugins/noghre/employess/mod.vue b/webUI/src/views/acc/plugins/noghre/employess/mod.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/plugins/noghre/intro.vue b/webUI/src/views/acc/plugins/noghre/intro.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/plugins/noghre/order/list.vue b/webUI/src/views/acc/plugins/noghre/order/list.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/plugins/noghre/order/mod.vue b/webUI/src/views/acc/plugins/noghre/order/mod.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/plugins/noghre/order/view.vue b/webUI/src/views/acc/plugins/noghre/order/view.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/plugins/noghre/pays.vue b/webUI/src/views/acc/plugins/noghre/pays.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/plugins/onlinestore/dashboard.vue b/webUI/src/views/acc/plugins/onlinestore/dashboard.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/plugins/onlinestore/intro.vue b/webUI/src/views/acc/plugins/onlinestore/intro.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/plugins/repservice/intro.vue b/webUI/src/views/acc/plugins/repservice/intro.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/plugins/repservice/list.vue b/webUI/src/views/acc/plugins/repservice/list.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/plugins/repservice/mod.vue b/webUI/src/views/acc/plugins/repservice/mod.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/plugins/repservice/view.vue b/webUI/src/views/acc/plugins/repservice/view.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/plugins/resamap/intro.vue b/webUI/src/views/acc/plugins/resamap/intro.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/presell/list.vue b/webUI/src/views/acc/presell/list.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/presell/mod.vue b/webUI/src/views/acc/presell/mod.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/presell/view.vue b/webUI/src/views/acc/presell/view.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/presell/viewInvoice.vue b/webUI/src/views/acc/presell/viewInvoice.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/printers/list.vue b/webUI/src/views/acc/printers/list.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/printers/printList.vue b/webUI/src/views/acc/printers/printList.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/printers/queue.vue b/webUI/src/views/acc/printers/queue.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/printers/templates.vue b/webUI/src/views/acc/printers/templates.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/reports/balanceSheet.vue b/webUI/src/views/acc/reports/balanceSheet.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/reports/commodity/buysellByCommodity.vue b/webUI/src/views/acc/reports/commodity/buysellByCommodity.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/reports/explore_accounts.vue b/webUI/src/views/acc/reports/explore_accounts.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/reports/persons/buysellByPerson.vue b/webUI/src/views/acc/reports/persons/buysellByPerson.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/reports/persons/debtors.vue b/webUI/src/views/acc/reports/persons/debtors.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/reports/persons/depositors.vue b/webUI/src/views/acc/reports/persons/depositors.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/reports/reports.vue b/webUI/src/views/acc/reports/reports.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/rfbuy/list.vue b/webUI/src/views/acc/rfbuy/list.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/rfbuy/mod.vue b/webUI/src/views/acc/rfbuy/mod.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/rfbuy/viewInvoice.vue b/webUI/src/views/acc/rfbuy/viewInvoice.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/rfsell/list.vue b/webUI/src/views/acc/rfsell/list.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/rfsell/mod.vue b/webUI/src/views/acc/rfsell/mod.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/rfsell/viewInvoice.vue b/webUI/src/views/acc/rfsell/viewInvoice.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/router/index.js b/webUI/src/views/acc/router/index.js old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/salary/card.vue b/webUI/src/views/acc/salary/card.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/salary/list.vue b/webUI/src/views/acc/salary/list.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/salary/mod.vue b/webUI/src/views/acc/salary/mod.vue old mode 100755 new mode 100644 diff --git a/webUI/src/views/acc/sell/fastMod.vue b/webUI/src/views/acc/sell/fastMod.vue old mode 100755 new mode 100644 index 3d5ad23..75c0cc7 --- a/webUI/src/views/acc/sell/fastMod.vue +++ b/webUI/src/views/acc/sell/fastMod.vue @@ -267,11 +267,12 @@ export default defineComponent({ if (response.data.result == '1') { this.update = response.data.doc.code; if (this.canPrint || this.canPrintCashdeskRecp) { - axios.post('/api/sell/posprinter/invoice', { + axios.post('/api/sell/print/invoice', { code: this.update, pdf: this.canPdf, posPrint: this.canPrint, - posPrintRecp: this.canPrintCashdeskRecp + posPrintRecp: this.canPrintCashdeskRecp, + printers: this.canPdf }).then((response) => { if (this.canPdf) { this.printID = response.data.id; diff --git a/webUI/src/views/acc/sell/list.vue b/webUI/src/views/acc/sell/list.vue old mode 100755 new mode 100644 index 6d784ea..ad893f7 --- a/webUI/src/views/acc/sell/list.vue +++ b/webUI/src/views/acc/sell/list.vue @@ -215,7 +215,16 @@ - + @@ -684,12 +693,15 @@ export default defineComponent({ itemsSelected: { handler(val) { this.sumSelected = 0; - this.itemsSelected.forEach((item) => { - const amount = item.amount || 0; - if (typeof amount === "string") { - this.sumSelected += parseInt(amount.replaceAll(",", "") || 0); - } else { - this.sumSelected += amount; + this.itemsSelected.forEach((code) => { + const selectedItem = this.items.find(item => item.code === code); + if (selectedItem) { + const amount = selectedItem.amount || 0; + if (typeof amount === "string") { + this.sumSelected += parseInt(amount.replaceAll(",", "") || 0); + } else { + this.sumSelected += amount; + } } }); }, @@ -700,4 +712,32 @@ export default defineComponent({ \ No newline at end of file diff --git a/webUI/src/views/acc/sell/mod.vue b/webUI/src/views/acc/sell/mod.vue old mode 100755 new mode 100644 index aaab631..83967f1 --- a/webUI/src/views/acc/sell/mod.vue +++ b/webUI/src/views/acc/sell/mod.vue @@ -3,1188 +3,1380 @@ - - - - - -