Merge remote-tracking branch 'origin/master'

This commit is contained in:
M_Kececi
2026-03-23 09:58:44 +03:00
parent 5eab36df69
commit c0053d6058
7 changed files with 345 additions and 14 deletions

View File

@@ -1,4 +1,4 @@
<template>
<template>
<q-page v-if="canReadFinance" class="q-px-md q-pb-md q-pt-xs page-col statement-page">
<q-slide-transition>
<div v-show="!filtersCollapsed" class="local-filter-bar compact-filter q-pa-sm q-mb-xs">
@@ -541,7 +541,6 @@ function formatAmount(value, fraction = 2) {
}
.currency-groups {
position: relative;
padding: 6px;
background: #f8faff;
}
@@ -630,20 +629,18 @@ function formatAmount(value, fraction = 2) {
line-height: 1.2 !important;
}
.detail-subtable :deep(.q-table__container),
.detail-subtable :deep(.q-table__middle) {
overflow: visible !important;
max-height: none !important;
}
.detail-subtable :deep(.q-table__top) {
position: static;
}
.detail-subtable :deep(thead th) {
.detail-subtable :deep(thead) {
position: sticky;
top: calc(var(--lvl3-top) - var(--lvl3-shift-up));
z-index: 35;
z-index: 31;
}
.detail-subtable :deep(thead th) {
position: static;
background: #1f3b5b;
color: #fff;
border-bottom: 1px solid rgba(255, 255, 255, 0.2);

View File

@@ -400,6 +400,26 @@ export const useOrderEntryStore = defineStore('orderentry', {
}
,
async sendOrderToMarketMails(orderId) {
const id = String(orderId || this.header?.OrderHeaderID || '').trim()
if (!id) {
throw new Error('Sipariş ID bulunamadı')
}
try {
const res = await api.post('/order/send-market-mail', {
orderHeaderID: id
})
return res?.data || {}
} catch (err) {
const detail = await extractApiErrorDetail(err)
const status = err?.status || err?.response?.status || '-'
console.error(`❌ sendOrderToMarketMails hata [${status}] order=${id}: ${detail}`)
throw new Error(detail)
}
}
,
async downloadOrderPdf(id = null) {
try {
const orderId = id || this.header?.OrderHeaderID
@@ -2845,6 +2865,23 @@ export const useOrderEntryStore = defineStore('orderentry', {
productCache
})
// 📧 Piyasa eşleşen alıcılara sipariş PDF gönderimi (kayıt başarılı olduktan sonra)
try {
const mailRes = await this.sendOrderToMarketMails(serverOrderId)
const sentCount = Number(mailRes?.sentCount || 0)
$q.notify({
type: 'positive',
message: sentCount > 0
? `Sipariş PDF mail gönderildi (${sentCount} alıcı)`
: 'Sipariş PDF mail gönderimi tamamlandı'
})
} catch (mailErr) {
$q.notify({
type: 'warning',
message: `Sipariş kaydedildi, mail gönderilemedi: ${mailErr?.message || 'Bilinmeyen hata'}`
})
}
/* =======================================================
❓ USER NEXT STEP
======================================================= */