Update: 2026-05-15 14:23:28
This commit is contained in:
@@ -1391,7 +1391,7 @@
|
||||
<button x-show="page==='invoices'" @click="showBatchUploadModal = true" class="btn btn-navy">
|
||||
<span>📁</span> استيراد مجمع (Batch)
|
||||
</button>
|
||||
<button x-show="page==='invoices'" @click="exportExcel()" class="btn btn-ghost btn-sm" style="border-color: var(--green-mid); color: var(--green);">
|
||||
<button x-show="page==='invoices'" @click="showExportExcelModal = true" class="btn btn-ghost btn-sm" style="border-color: var(--green-mid); color: var(--green);">
|
||||
<span>📥</span> تصدير Excel
|
||||
</button>
|
||||
</div>
|
||||
@@ -2789,6 +2789,48 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ── EXCEL EXPORT MODAL ──────────────────────────── -->
|
||||
<div x-show="showExportExcelModal" class="modal-backdrop" x-cloak @click.self="showExportExcelModal = false">
|
||||
<div class="modal-card" style="max-width:420px;">
|
||||
<div class="modal-header">
|
||||
<span>📥 تصدير فواتير Excel</span>
|
||||
<button @click="showExportExcelModal = false" class="modal-close-btn" style="font-size:18px;">×</button>
|
||||
</div>
|
||||
<div class="p-6" style="display:flex; flex-direction:column; gap:16px;">
|
||||
<p class="text-sm text-gray-500">حدد المعايير المطلوبة لتصدير الفواتير إلى ملف Excel احترافي.</p>
|
||||
|
||||
<!-- Company Select -->
|
||||
<div>
|
||||
<label class="form-label">الشركة</label>
|
||||
<select x-model="exportExcelForm.company_id" class="form-input">
|
||||
<option value="">جميع الشركات</option>
|
||||
<template x-for="c in companies" :key="c.id">
|
||||
<option :value="c.id" x-text="c.name"></option>
|
||||
</template>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- Date Range -->
|
||||
<div style="display:grid; grid-template-columns:1fr 1fr; gap:12px;">
|
||||
<div>
|
||||
<label class="form-label">من تاريخ</label>
|
||||
<input type="date" x-model="exportExcelForm.date_from" class="form-input">
|
||||
</div>
|
||||
<div>
|
||||
<label class="form-label">إلى تاريخ</label>
|
||||
<input type="date" x-model="exportExcelForm.date_to" class="form-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin-top:10px;">
|
||||
<button @click="exportExcelWithFilters()" class="btn btn-teal w-full justify-center">
|
||||
📥 تصدير ملف Excel
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ── PAYMENT RECEIPT MODAL ───────────────────────── -->
|
||||
<div x-show="showPaymentModal" x-cloak class="modal-backdrop">
|
||||
<div class="modal-box" style="max-width:440px;">
|
||||
@@ -2881,7 +2923,8 @@
|
||||
|
||||
showAddUserModal: false, showAddCompanyModal: false, showConnectModal: false,
|
||||
showUploadModal: false, showViewModal: false, showCompanyStatsModal: false,
|
||||
showExcelModal: false, showBatchUploadModal: false, showItemsModal: false,
|
||||
showExcelModal: false, showExportExcelModal: false, showBatchUploadModal: false, showItemsModal: false,
|
||||
exportExcelForm: { company_id: '', date_from: '', date_to: '' },
|
||||
isUploadingBatch: false, batchProgress: { total: 0, current: 0 },
|
||||
showAddTenantModal: false, showEditTenantModal: false, showTenantStatsModal: false,
|
||||
acknowledgedWarnings: false, isEditingInvoice: false,
|
||||
@@ -2978,6 +3021,20 @@
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
},
|
||||
exportExcelWithFilters() {
|
||||
let url = '/index.php?route=v1/invoices/export-excel';
|
||||
if (this.exportExcelForm.company_id) url += '&company_id=' + encodeURIComponent(this.exportExcelForm.company_id);
|
||||
if (this.exportExcelForm.date_from) url += '&date_from=' + encodeURIComponent(this.exportExcelForm.date_from);
|
||||
if (this.exportExcelForm.date_to) url += '&date_to=' + encodeURIComponent(this.exportExcelForm.date_to);
|
||||
|
||||
const link = document.createElement('a');
|
||||
link.href = url + '&token=' + encodeURIComponent(this.token());
|
||||
link.download = '';
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
this.showExportExcelModal = false;
|
||||
},
|
||||
//
|
||||
getQrSrc(inv) {
|
||||
if (!inv) return '';
|
||||
|
||||
Reference in New Issue
Block a user