diff --git a/.github/workflows/gitea-local.yaml b/.github/workflows/gitea-local.yaml new file mode 100644 index 00000000..6b2afdbe --- /dev/null +++ b/.github/workflows/gitea-local.yaml @@ -0,0 +1,89 @@ +name: Gitea Action + +run-name: Build ${{ github.actor }} + +# Intended for local gitea instance only. + +on: + workflow_dispatch: + +env: + REGISTRY: ${{ vars.CONTAINER_REGISTRY }} + REGISTRY_USERNAME: ${{ vars.CONTAINER_REGISTRY_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }} + CONTAINER_IMAGE_NAME: ${{ vars.CONTAINER_REGISTRY }}/${{ vars.CONTAINER_IMAGE_OWNER }}/${{ vars.CONTAINER_IMAGE_NAME }}:latest +jobs: + gitea-release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Login to Docker Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ env.REGISTRY_USERNAME }} + password: ${{ env.REGISTRY_PASSWORD }} + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v2 + with: + config-inline: | + [registry."${{ env.REGISTRY }}"] + ca=["/etc/ssl/certs/ca-certificates.crt"] + - name: Build and Push Docker Image + uses: docker/build-push-action@v3 + with: + context: . + platforms: linux/amd64 + tags: ${{ env.CONTAINER_IMAGE_NAME }} + push: true + - name: Remote Deploy Development + uses: appleboy/ssh-action@v1.2.1 + with: + host: ${{ vars.SSH_DEVELOPMENT_HOST }} + port: ${{ vars.SSH_DEVELOPMENT_PORT }} + username: ${{ secrets.SSH_DEVELOPMENT_USER }} + password: ${{ secrets.SSH_DEVELOPMENT_PASSWORD }} + script: eval "${{ secrets.SSH_DEVELOPMENT_DEPLOY_CMD }}" & wait + - name: Remote Deploy Test + uses: appleboy/ssh-action@v1.2.1 + with: + host: ${{ vars.SSH_TEST_HOST }} + port: ${{ vars.SSH_TEST_PORT }} + username: ${{ secrets.SSH_TEST_USER }} + password: ${{ secrets.SSH_TEST_PASSWORD }} + script: eval "${{ secrets.SSH_TEST_DEPLOY_CMD }}" & wait + - name: Notify Discord Success + if: success() + run: | + curl -H "Content-Type: application/json" -X POST \ + -d '{ + "embeds": [{ + "title": "✅ Gitea Local Deployment Success!", + "description": "**Details:**\n- Image: `${{ env.CONTAINER_IMAGE_NAME }}`\n- Deployed by: `${{ github.actor }}`", + "color": 3066993, + "footer": { + "text": "Gitea Local Release Notification", + "icon_url": "https://example.com/success-icon.png" + }, + "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" + }] + }' \ + ${{ secrets.DISCORD_WEBHOOK }} + - name: Notify Discord Failure + if: failure() + run: | + curl -H "Content-Type: application/json" -X POST \ + -d '{ + "embeds": [{ + "title": "❌ Gitea Local Deployment Failed!", + "description": "**Details:**\n- Image: `${{ env.CONTAINER_IMAGE_NAME }}`\n- Attempted by: `${{ github.actor }}`", + "color": 15158332, + "footer": { + "text": "Gitea Local Release Notification", + "icon_url": "https://example.com/failure-icon.png" + }, + "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" + }] + }' \ + ${{ secrets.DISCORD_WEBHOOK }} diff --git a/.github/workflows/local-build-release.yaml b/.github/workflows/local-build-release.yaml deleted file mode 100644 index a14cbadf..00000000 --- a/.github/workflows/local-build-release.yaml +++ /dev/null @@ -1,31 +0,0 @@ -name: local-build-release - -# Intended for local network use. -# Remote access is possible if the host has a public IP address. - -on: - workflow_dispatch: - -env: - REGISTRY: ${{ vars.DOCKER_REGISTRY }} - -jobs: - local-build-release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Setup Docker Buildx - uses: docker/setup-buildx-action@v2 - with: - config-inline: | - [registry."${{ env.REGISTRY }}"] - http = true - insecure = true - - name: Build and Push Docker Image - uses: docker/build-push-action@v3 - with: - context: . - platforms: linux/amd64 - push: true - tags: ${{ env.REGISTRY }}/jws/jws-frontend:latest - allow: security.insecure diff --git a/.github/workflows/local-release-demo.yml b/.github/workflows/local-release-demo.yml deleted file mode 100644 index 3d373a80..00000000 --- a/.github/workflows/local-release-demo.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: local-release-demo - -# Intended for local network use. -# Remote access is possible if the host has a public IP address. - -on: - workflow_dispatch: - -jobs: - local-release-demo: - runs-on: ubuntu-latest - steps: - - name: Remote deploy internal chamomind server - uses: appleboy/ssh-action@v1.0.3 - with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - password: ${{ secrets.PASSWORD }} - script: | - cd ~/repositories/jws-frontend - git pull - docker compose up -d --build diff --git a/.github/workflows/local-release-dev.yml b/.github/workflows/local-release-dev.yml deleted file mode 100644 index 5bc0101e..00000000 --- a/.github/workflows/local-release-dev.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: local-release-dev - -# Intended for local network use. -# Remote access is possible if the host has a public IP address. - -on: - workflow_dispatch: - -jobs: - local-release-dev: - runs-on: ubuntu-latest - steps: - - name: Remote deploy internal chamomind server - uses: appleboy/ssh-action@v1.0.3 - with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - password: ${{ secrets.PASSWORD }} - script: | - cd ~/repositories/jws-frontend - git pull - docker compose up -d --build diff --git a/src/components/11_credit-note/FormCredit.vue b/src/components/11_credit-note/FormCredit.vue index f104e91c..b6e2bf1f 100644 --- a/src/components/11_credit-note/FormCredit.vue +++ b/src/components/11_credit-note/FormCredit.vue @@ -34,6 +34,7 @@ const quotationId = defineModel('quotationId', { v-model:value="quotationId" :label="$t('general.select', { msg: $t('quotation.title') })" :params="{ + cancelIncludeDebitNote: true, hasCancel: true, }" /> diff --git a/src/i18n/eng.ts b/src/i18n/eng.ts index 7a9cf43c..63508253 100644 --- a/src/i18n/eng.ts +++ b/src/i18n/eng.ts @@ -779,6 +779,7 @@ export default { specialCondition: 'Special Conditions', selectInvoice: 'Select Invoice', approveInvoice: 'Approve the invoice', + approveDebitNote: 'Approve Debit Note', paymentCondition: 'Payment Terms', payType: 'Payment Methods', bank: 'Select Payment Account', @@ -897,6 +898,8 @@ export default { caption: 'All Request List', quotationCode: 'Quotation Code', requestListCode: 'Request List Code', + + referenceNo: 'Reference No.', invoiceCode: 'Invoice Code', receiptCode: 'Receipt Code', alienIdCard: 'Alien Identification Card"', @@ -1022,6 +1025,7 @@ export default { importWorker: 'Import Worker', confirmLogout: 'Confirm Logout', confirmQuotationAccept: 'Confirm acceptance of the quotation.', + confirmDebitNoteAccept: 'Confirm acceptance of the debit note.', }, message: { quotationAccept: 'Once accepted, no further modifications can be made', @@ -1241,7 +1245,8 @@ export default { 'The customer returned all or part of the goods because they did not meet their requirements.', reasonCanceled: 'The customer canceled certain items or services listed on the invoice.', - submit: 'Approve the credit note', + request: 'Request Credit Note Approval', + submit: 'Approve Credit Note', refund: 'Refund', refundMethod: 'Refund Method', totalRefund: 'Total refund amount', @@ -1252,6 +1257,7 @@ export default { refundSuccess: 'Refund Success', }, status: { + Waiting: 'Credit Note', Pending: 'Pending Refund', Success: 'Refund Completed', Canceled: 'Canceled', @@ -1261,10 +1267,6 @@ export default { Done: 'Done', }, }, - stats: { - Pending: 'Pending Refund', - Success: 'Refund Completed', - }, }, invoice: { @@ -1303,6 +1305,7 @@ export default { quotationWorkName: 'Work Name', quotationPayment: 'Payment Method', value: 'Net Value', + request: 'Request Debit Note Approval', submit: 'Approve Debit Note', }, @@ -1315,6 +1318,7 @@ export default { }, viewMode: { + accepted: 'Accept', payment: 'Payment', receipt: 'Receipt/Tax Invoice', processComplete: 'Completed', diff --git a/src/i18n/tha.ts b/src/i18n/tha.ts index 139b2070..d60b0045 100644 --- a/src/i18n/tha.ts +++ b/src/i18n/tha.ts @@ -1,5 +1,3 @@ -import { title } from 'process'; - export default { general: { ok: 'ตกลง', @@ -761,7 +759,7 @@ export default { branch: 'สาขาที่ออกใบเสนอราคา', branchVirtual: 'จุดรับบริการที่ออกใบเสนอราคา', customer: 'ลูกค้า', - newCustomer: 'ลูกค้าใหม่', + newCustomer: 'แรงงานใหม่', employeeList: 'รายชื่อแรงงาน', employee: 'แรงงาน', employeeName: 'ชื่อ-นามสกุล แรงงาน', @@ -772,6 +770,7 @@ export default { specialCondition: 'เงื่อนไขพิเศษ', selectInvoice: 'เลือกใบแจ้งหนี้', approveInvoice: 'อนุมัติใบแจ้งหนี้', + approveDebitNote: 'อนุมัติใบเพิ่มหนี้', customerAcceptance: 'ลูกค้าตอบรับ', additionalFile: 'ไฟล์เอกสารเพิ่มเติม', @@ -890,6 +889,7 @@ export default { caption: 'ใบรายการคำขอทั้งหมด', quotationCode: 'เลขที่ใบเสนอราคา', requestListCode: 'เลขที่ใบรายการคำขอ', + referenceNo: 'เลขที่ใบอ้างอิง', invoiceCode: 'เลขที่ใบแจ้งหนี้', receiptCode: 'เลขที่ใบเสร็จ/กำกับภาษี', alienIdCard: 'บัตรประจำตัวต่างด้าว', @@ -1010,6 +1010,7 @@ export default { importWorker: 'นำเข้าคนงาน', confirmLogout: 'ยืนยันการออกจากระบบ', confirmQuotationAccept: 'ยืนยันการตอบรับใบเสนอราคา', + confirmDebitNoteAccept: 'ยืนยันการตอบรับใบเพิ่มหนี้', }, message: { quotationAccept: 'เมื่อตอบรับเเล้วจะไม่สามารถแก้ไขได้อีก', @@ -1224,6 +1225,7 @@ export default { 'ลูกค้าคืนสินค้าทั้งหมดหรือบางส่วน เนื่องจากสินค้าไม่ตรงตามความต้องการ', reasonCanceled: 'ลูกค้ายกเลิกคำสั่งซื้อบางรายการหรือบริการที่ระบุในใบแจ้งหนี้', + request: 'ขออนุมัติใบลดหนี้', submit: 'อนุมัติใบลดหนี้', refund: 'การคืนเงิน', refundMethod: 'วิธีการคืนเงิน', @@ -1235,6 +1237,7 @@ export default { refundSuccess: 'คืนเงินเสร็จเรียบร้อย', }, status: { + Waiting: 'ใบลดหนี้', Pending: 'รอคืนเงิน', Success: 'คืนเงินเสร็จสิ้น', Canceled: 'ยกเลิกรายการ', @@ -1244,10 +1247,6 @@ export default { Done: 'คืนเงินเรียบร้อย', }, }, - stats: { - Pending: 'รอคืนเงิน', - Success: 'คืนเงินเสร็จสิ้น', - }, }, invoice: { @@ -1285,6 +1284,7 @@ export default { quotationWorkName: 'ชื่อใบงาน', quotationPayment: 'วิธีการชำระ', value: 'มูลค่าสุทธิ', + request: 'ขออนุมัติใบเพิ่มหนี้', submit: 'อนุมัติใบเพิ่มหนี้', }, @@ -1297,6 +1297,7 @@ export default { }, viewMode: { + accepted: 'ตอบรับ', payment: 'ชำระเงิน', receipt: 'ใบเสร็จรับเงิน/ใบกำกับภาษี', processComplete: 'เสร็จสิ้น', diff --git a/src/pages/05_quotation/QuotationForm.vue b/src/pages/05_quotation/QuotationForm.vue index d02e4f14..6d14d322 100644 --- a/src/pages/05_quotation/QuotationForm.vue +++ b/src/pages/05_quotation/QuotationForm.vue @@ -54,7 +54,7 @@ import { SaveButton, EditButton, UndoButton, - CloseButton, + CancelButton, MainButton, } from 'components/button'; import QuotationFormReceipt from './QuotationFormReceipt.vue'; @@ -673,6 +673,7 @@ async function triggerSelectEmployeeDialog() { } function triggerProductServiceDialog() { + covertToNode(); pageState.productServiceModal = true; } @@ -1067,11 +1068,7 @@ const productServiceNodes = ref([]); watch( () => productServiceList.value, () => { - productServiceNodes.value = quotationProductTree( - productServiceList.value, - agentPrice.value, - config.value?.vat, - ); + covertToNode(); }, ); @@ -1302,6 +1299,14 @@ async function formDownload() { a.click(); a.remove(); } + +function covertToNode() { + productServiceNodes.value = quotationProductTree( + productServiceList.value, + agentPrice.value, + config.value?.vat, + ); +}