Onay
Tags: uyumsoft
Published: 2023-02-10 13:49:47

> HTML
```
<meta charset="UTF-8"/>
<title>Satınalma Talebi #DocDate# #DocNo# #WhouseDesc# #RequestStatus#</title>
<style>
table, th, td {
font-family: Segoe UI;
border-collapse: collapse;
border: 1px solid black;
letter-spacing: 0px;
font-size: 0.8rem;
}
</style>

<p>
<strong>#CoDesc#</strong>
</p>
<p>
<strong>#DocTraDesc#</strong>
</p>

<p> <strong>Talep Tarih: </strong> #DocDate# <br />
<strong>Talep No: </strong> #DocNo# <br />
<br /> <strong>Talep Eden Depo:</strong> #WhouseCode# #WhouseDesc#
</p>
<p>
<strong>Onay Durum: </strong>
<span style="color: green;"><strong> #RequestStatus# </strong>
</span>
</p>

<table>
<tbody>
<tr style="background-color:#a5dff9;">
<th style="text-align:left;"><strong>&nbsp;Malzeme/Ürün Adı&nbsp;</strong></th>
<th><strong>&nbsp;Miktar&nbsp;</strong></th>
<th><strong>&nbsp;İhtiyaç Tarih&nbsp;</strong></th>
<th><strong>&nbsp;Açıklama&nbsp;</strong></th>
</tr>
<!--Detail Start--> 
<tr style="text-decoration: none"> <td style="text-align:left;">&nbsp;#D.DcardName#&nbsp;</td> <td style="text-align:right;">&nbsp;{{#D.Qty#|#,##0.00}}</td> <td style="text-align:right;">&nbsp;#D.RequestedDate#&nbsp;</td> <td style="text-align:center;">#D.Note1# #D.Note2#</td></tr>
<!--Detail End--> 
</tbody>
</table>

<p>
<strong>Açıklamalar:</strong> #Note1# #Note2# #Note3#
</p>
<br />
<hr />
```

> Konu
```
#DocNo# numaralı sipariş: #RequestStatus#
```

> Onay Rol SQL (Oracle)
```
DECLARE ABCE VARCHAR(100); BEGIN OPEN :result FOR SELECT U.ZZ_APPROVAL_USER_ID FROM GNLD_DOC_TRA U WHERE U.SOURCE_APP = 102 AND U.DOC_TRA_ID = {DocTraId}; END;
```

> Onay Rol SQL (PostgreSQL)
```
SELECT SP.us_id FROM FIND_SALES_PERSON SP WHERE SP.sales_person_id = {SalesPersonId}
```

> Mail To
```
aaa@aaa.com;{{fn_ExecuteSQL(SELECT FE.EMAIL FROM PSMT_ORDER_M MM LEFT JOIN FIND_ENTITY FE ON MM.ENTITY_ID = FE.ENTITY_ID WHERE MM.ORDER_M_ID = #Id#)}};{{fn_ExecuteSQL(SELECT CU.EMAIL FROM PSMT_ORDER_M MM LEFT JOIN USERS CU ON MM.CREATE_USER_ID = CU.US_ID WHERE MM.ORDER_M_ID = #Id#)}};{{fn_ExecuteSQL(SELECT C.EMAIL FROM PSMT_ORDER_M MM LEFT JOIN FIND_SALES_PERSON SP ON MM.SALES_PERSON_ID = SP.SALES_PERSON_ID LEFT JOIN GNLD_CONTACT C ON C.CONTACT_ID = SP.CONTACT_ID WHERE MM.ORDER_M_ID = #Id#)}};
```
> Mail To
```
{{fn_ExecuteSQL(SELECT FE.EMAIL FROM FIND_ENTITY FE WHERE FE.ENTITY_ID = #EntityId#)}}
```

> PostgreSQL Onaylayacak Kullanıcı SQL
```
SELECT SP.USER_ID FROM FIND_SALES_PERSON SP WHERE SP.sales_person_id = {SalesPersonId}
```

> Ekstra email
```
{{fn_ExecuteSQL(SELECT EMAIL FROM FIND_ENTITY WHERE ENTITY_ID = {EntityId})}}
```



> Onaya Gönder Buton
```
<row>
<cell>
<control FieldName="ZZOnay" ControlType="Button" Caption="Onay Butonu">
<ClientSideEvents Click="function (s,e) {StateDialogShow();CallCSharpCode('pop_PopupForm|InitiateApproval', 0, '');}">
</ClientSideEvents>
</control>
</cell>
</row>
```

> Onay Geri Al Buton
```
<row>
<cell>
<control FieldName="ZZOnayGeri" ControlType="Button" Caption="Geri Al Butonu">
<ClientSideEvents Click="function (s,e) {StateDialogShow();StandartPopupCallDisableMenuDialog('pop_PopupForm|BackToApproval','1|2',s,e);}">
</ClientSideEvents>
</control>
</cell>
</row>
```