From f137fcb0dc06cd54bc3163d3dcd60e8840cf1172 Mon Sep 17 00:00:00 2001 From: Gloomy Date: Tue, 19 Aug 2025 18:50:07 +0000 Subject: [PATCH 1/3] remove approve button for payments --- webUI/src/views/acc/persons/receive/list.vue | 46 ++++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/webUI/src/views/acc/persons/receive/list.vue b/webUI/src/views/acc/persons/receive/list.vue index b518bce..e68ace0 100755 --- a/webUI/src/views/acc/persons/receive/list.vue +++ b/webUI/src/views/acc/persons/receive/list.vue @@ -35,13 +35,13 @@ - + - وضعیت تایید + وضعیت تایید + v-if="checkApprover()"> @@ -404,7 +404,7 @@ export default defineComponent({ invoiceIndex: true }, plugins: {}, - business: { requireTwoStepApproval: false, invoiceApprover: null }, + business: { requireTwoStepApproval: false, approvers: { sellInvoice: null } }, currentUser: { email: '', owner: false }, sumSelected: 0, sumSelectedProfit: 0, @@ -507,6 +507,9 @@ export default defineComponent({ isPluginActive(pluginCode) { return this.plugins && this.plugins[pluginCode] !== undefined; }, + checkApprover() { + return this.business.requireTwoStepApproval && (this.business.approvers.sellInvoice == this.currentUser.email || this.currentUser.owner === true); + }, async loadPlugins() { try { const response = await axios.post('/api/plugin/get/actives'); @@ -519,10 +522,10 @@ export default defineComponent({ async loadBusinessInfo() { try { const response = await axios.get('/api/business/get/info/' + localStorage.getItem('activeBid')); - this.business = response.data || { requireTwoStepApproval: false, invoiceApprover: null }; + this.business = response.data || { requireTwoStepApproval: false, approvers: { sellInvoice: null } }; } catch (error) { console.error('Error loading business info:', error); - this.business = { requireTwoStepApproval: false, invoiceApprover: null }; + this.business = { requireTwoStepApproval: false, approvers: { sellInvoice: null } }; } }, async loadCurrentUser() { @@ -639,11 +642,11 @@ export default defineComponent({ return 'success'; }, canShowApprovalButton(item) { - if (!this.business?.requireTwoStepApproval) return false; + if (!this.checkApprover()) return false; - if (item?.isApproved || (!item?.isPreview && !item?.isApproved)) return false; + if (item?.isApproved) return false; - return this.business?.invoiceApprover === this.currentUser?.email || this.currentUser?.owner === true; + return true; }, async approveInvoice(code) { try { @@ -660,7 +663,7 @@ export default defineComponent({ } }, canShowUnapproveButton(item) { - return !this.canShowApprovalButton(item); + return !this.canShowApprovalButton(item) && this.checkApprover(); }, async unapproveInvoice(code) { try { diff --git a/webUI/src/views/acc/settings/bussiness.vue b/webUI/src/views/acc/settings/bussiness.vue index 4a88dff..e0cb83d 100755 --- a/webUI/src/views/acc/settings/bussiness.vue +++ b/webUI/src/views/acc/settings/bussiness.vue @@ -24,10 +24,13 @@ {{ $t('dialog.global_settings') }} - + + تایید اسناد + + {{ $t('dialog.warranty_settings') }} - + نسخه پشتیبان @@ -198,7 +201,170 @@ - + + + + +

تایید اسناد

+ + + + + +
+ با فعال‌سازی این گزینه، تمام اسناد انتخابی نیاز به تایید خواهند داشت. +
+ + +
+ +

تعیین تاییدکنندگان

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ mdi-information + در صورت عدم انتخاب تاییدکننده برای هر بخش، فقط مدیر کسب و کار مجاز به تایید است. +
+
+
+
+
+
+ + + + + نکات + + + + + + + + + +
+
+
+
+

تنظیمات گارانتی

@@ -370,126 +536,7 @@
- - - - - تایید دومرحله‌ای - - - -
- با فعال‌سازی این گزینه، تمام فاکتورها، حواله‌های انبار، دریافت‌ها و پرداخت‌ها نیاز به تایید مدیر خواهند داشت. -
- - -
- -

تعیین تاییدکنندگان

- - - - - -
- این کاربر افزون بر مدیر کسب و کار می‌تواند فاکتورهای فروش را تایید کند -
-
- - - - - -
- این کاربر افزون بر مدیر کسب و کار می‌تواند حواله‌های انبار را تایید کند -
-
- - - -
- -
- mdi-information - در صورت عدم انتخاب تاییدکننده، فقط مدیر کسب و کار می‌تواند اسناد را تایید کند -
-
- mdi-check-circle - نکته: صاحب کسب و کار همیشه می‌تواند تمام اسناد را تأیید کند و نیازی به تعیین مجدد ندارد -
-
-
-
-
+ @@ -594,7 +641,7 @@
- +

نسخه پشتیبان از اطلاعات کسب و کار

@@ -743,9 +790,17 @@ export default { walletEnabled: false, walletMatchBank: null, requireTwoStepApproval: false, - invoiceApprover: null, - warehouseApprover: null, - financialApprover: null, + approvers: { + sellInvoice: null, + buyInvoice: null, + returnBuy: null, + returnSell: null, + warehouseTransfer: null, + receiveFromPersons: null, + payToPersons: null, + accountingDocs: null, + bankTransfers: null + }, year: { startShamsi: '', endShamsi: '', @@ -871,9 +926,7 @@ export default { 'walletEnabled': this.content.walletEnabled, 'walletMatchBank': this.content.walletMatchBank, 'requireTwoStepApproval': this.content.requireTwoStepApproval, - 'invoiceApprover': this.content.invoiceApprover, - 'warehouseApprover': this.content.warehouseApprover, - 'financialApprover': this.content.financialApprover, + 'approvers': this.content.approvers, 'year': this.content.year, 'commodityUpdateBuyPriceAuto': this.content.updateBuyPrice, 'commodityUpdateSellPriceAuto': this.content.updateSellPrice, @@ -924,19 +977,11 @@ export default { this.content.walletMatchBank = this.content.walletMatchBank.id; } - // اطمینان از وجود فیلدهای تأییدکننده - if (!this.content.hasOwnProperty('invoiceApprover')) { - this.content.invoiceApprover = null; - } - if (!this.content.hasOwnProperty('warehouseApprover')) { - this.content.warehouseApprover = null; - } - if (!this.content.hasOwnProperty('financialApprover')) { - this.content.financialApprover = null; - } - if (!this.content.hasOwnProperty('requireTwoStepApproval')) { - this.content.requireTwoStepApproval = false; - } + // اطمینان از وجود فیلدهای تایید اسناد + if (!this.content.hasOwnProperty('requireTwoStepApproval')) this.content.requireTwoStepApproval = false; + if (!this.content.hasOwnProperty('approvers')) this.content.approvers = {}; + const approverKeys = ['sellInvoice','buyInvoice','returnBuy','returnSell','warehouseTransfer','receiveFromPersons','payToPersons','accountingDocs','bankTransfers']; + approverKeys.forEach(k => { if (!this.content.approvers.hasOwnProperty(k)) this.content.approvers[k] = null; }); // سپس سایر داده‌ها را بارگذاری کن const [moneyResponse, banksResponse, usersResponse, pluginsResponse] = await Promise.all([ diff --git a/webUI/src/views/acc/storeroom/io/ticketList.vue b/webUI/src/views/acc/storeroom/io/ticketList.vue index 9d989e4..a3d02ec 100755 --- a/webUI/src/views/acc/storeroom/io/ticketList.vue +++ b/webUI/src/views/acc/storeroom/io/ticketList.vue @@ -81,6 +81,12 @@ تایید حواله
+ + + لغو تایید حواله + تایید حواله + + + لغو تایید حواله + تایید حواله + + + لغو تایید حواله + تایید حواله + + + لغو تایید حواله +