Müşteri Ara Detay Gösterme



function mtel(tel){
if (tel.length==10) {tel = tel.replace( /(\d{3})(\d{3})(\d{4})/,  '0($1) $2 $3' ) } 
else                {tel =  tel.replace( /(\d{3})(\d{4})/,  '0(212) $1 $2' )}
return tel}


function siparis(ads){
var ids = sql.Query("SELECT TOP (1)  Tickets.Id FROM TicketEntities INNER JOIN Tickets ON TicketEntities.Ticket_Id = Tickets.Id WHERE EntityName in ('"+ads+"') AND Tickets.IsClosed = 1 ORDER BY TicketEntities.Ticket_Id DESC").First;
return sql.Query("SELECT CONCAT('<block 1 transparent left 300>','<block 1 transparent left 30>',CONCAT(FORMAT(Quantity,'#.##'),'x'),'</block><block 1 trasparent left 200>',CONCAT(MenuItemName,CASE WHEN PortionName = 'Normal' THEN NULL Else  CONCAT('.',PortionName) END),'</block><block 1 transparent right 70>',Format(Price,'#.00##','TR-tr'),'</block></block>') FROM Orders WHERE TicketId = "+ids+"").Join('<br/>')
}

function toplam(ads){
var ids = sql.Query("SELECT TOP (1)  Tickets.Id FROM TicketEntities INNER JOIN Tickets ON TicketEntities.Ticket_Id = Tickets.Id WHERE EntityName in ('"+ads+"') AND Tickets.IsClosed = 1 ORDER BY TicketEntities.Ticket_Id DESC").First;
return sql.Query("SELECT FORMAT(TotalAmount,'#.00##','TR-tr') FROM Tickets WHERE IsClosed = 1 AND Id = "+ids+"").First}

function count(ads){return sql.Query("SELECT DISTINCT COUNT(Ticket_Id) FROM TicketEntities WHERE EntityName in ('"+ads+"')").First; }

function grand(ads){
var ids = sql.Query("SELECT DISTINCT Ticket_Id FROM TicketEntities WHERE EntityName in ('"+ads+"')").Join(','); 
return sql.Query("SET LANGUAGE Turkish SELECT FORMAT(SUM(TotalAmount) , 'C') AS 'Currency Format'  FROM Tickets WHERE IsClosed = 1 AND Id IN ("+ids+")").First}

function gun(ads){
var ids = sql.Query("SELECT TOP (1)  Tickets.Id FROM TicketEntities INNER JOIN Tickets ON TicketEntities.Ticket_Id = Tickets.Id WHERE EntityName in ('"+ads+"') AND Tickets.IsClosed = 1 ORDER BY TicketEntities.Ticket_Id DESC").First;
var gun = sql.Query("SELECT DATEDIFF(day,Date,GETDATE()) FROM Tickets WHERE IsClosed = 1 AND Id = "+ids+"").First
if(gun==null){var gun = '0'} else {var gun = gun}
return gun}

function tarih(ads){
var ids = sql.Query("SELECT TOP (1)  Tickets.Id FROM TicketEntities INNER JOIN Tickets ON TicketEntities.Ticket_Id = Tickets.Id WHERE EntityName in ('"+ads+"') AND Tickets.IsClosed = 1 ORDER BY TicketEntities.Ticket_Id DESC").First;
return sql.Query("SELECT Date FROM Tickets WHERE IsClosed = 1 AND Id = "+ids+"").First}


<block 1 transparent left 400 wrap>
<i>Müşteri </i>: <b>$1</b><br/>
<i>Telefon </i>: {CALL:musteri.mtel('{ENTITY DATA:Telefon}')}<br/>
<i>Adresi   </i>: {ENTITY DATA:Adres}<br/>
<i>Bakiye   </i>: <color darkred><b>{ENTITY BALANCE} ₺</b></color>
</block>  
<block 1 transparent left 350>
<b>Son Siparişi </b>                         <b>{CALL:musteri.toplam('$1')} ₺</b><br/>
<size 15>{CALL:musteri.siparis('$1')}</size>
</block>
<block 1 transparent left 250>
<b>Sipariş Bilgileri</b><br/>
Sipariş Adedi     :  <b>{CALL:musteri.count('$1')}</b> Adet<br/>
Sipariş Toplamı  : <b>{CALL:musteri.grand('$1')}</b><br/>
Son Sipariş Süre : <b>{CALL:musteri.gun('$1')}</b> gün<br/>
Son Sipariş Tarih: <br/><b>{CALL:musteri.tarih('$1')}</b><br/>
</block>

Müşteri Ara Detay.zip (1.7 KB)

2 Beğeni

Merhaba.

Müşteri arama bölümünde uygulama olarak çok güzel. Peki caller id ile gelen telefon aramasında direk paket servis bölümüne müşteri seçimi geliyor. Burada benzer bir uygulama yapılabilirmi?

1 Beğeni

Paket servis de bulunan Detay kısmına
Müşeri ara daki Detay kısmını kopyala yapıştır

<block 1 transparent left 400>
<block 1 transparent left 70><i>Müşteri</i></block>:  <block 1 transparent left 320><b>$1</b></block><br/>
<block 1 transparent left 70><i>Telefon</i></block>:  <block 1 transparent left 320>{CALL:musteri.mtel('{ENTITY DATA:Telefon}')}</block><br/>
<block 1 transparent left 70><i>Adresi</i></block>: <block 1 transparent left 320 wrap> {ENTITY DATA:Adres}</block><br/>
<block 1 transparent left 70><i>Bakiye</i></block>:  <block 1 transparent left 320><color darkred><b>{ENTITY BALANCE} ₺</b></color></block>
</block> 
 
<br/>________________________________________________________________________
<br/>
<block 1 transparent left 360>
<block 1 transparent center 340><b>Sipariş Bilgileri</b></block><br/>
<block 1 transparent left 150>Sipariş Adedi</block>:  <block 1 transparent right 190><b>{CALL:musteri.count('$1')}</b> Adet</block><br/>
<block 1 transparent left 150>Sipariş Toplamı</block>: <block 1 transparent right 190><b>{CALL:musteri.grand('$1')}</b></block><br/>
<block 1 transparent left 150>Sipariş Ortalama</block>:  <block 1 transparent right 190><b>₺{CALL:musteri.parite('$1')}</b></block><br/>
<block 1 transparent left 150>Son Sipariş Tarih</block>:  <block 1 transparent right 190><b>{CALL:musteri.gun('$1')}</b> gün <br/><b>{CALL:musteri.tarih('$1')}</b></block><br/>
</block>
<br/>________________________________________________________________________
<br/>
<block 1 transparent left 350>
<block 1 transparent left 100><b>Son Siparişi </b></block>
<block 1 transparent center 130>#( {CALL:musteri.id('$1')} )</block>
<block 1 transparent right 70><b>₺{CALL:musteri.toplam('$1')}</b></block><br/>
<size 15>{CALL:musteri.siparis('$1')}</size>
</block>

1 Beğeni

<block 1 #FFF5F05D left 400><color navy>
<block 1 transparent left 70><i>Müşteri</i></block>:  <block 1 transparent left 320><b>$1</b></block><br/>
<block 1 transparent left 70><i>Telefon</i></block>:  <block 1 transparent left 310>{CALL:musteri.mtel('{ENTITY DATA:Telefon}')}</block><br/>
<block 1 transparent left 70><i>Adresi</i></block>: <block 1 transparent left 320 wrap> {ENTITY DATA:Adres}</block><br/>
<block 1 transparent left 70><i>Bakiye</i></block>:  <block 1 transparent left 320><color darkred><b>{ENTITY BALANCE} ₺</b></color></block>
</color></block> 
 

<br/>
<block 1 lightgreen left 400>
<block 1 transparent center 340><b>Sipariş Bilgileri</b></block><br/>
<block 1 transparent left 150>Adisyon Adedi</block>:  <block 1 transparent right 190><b>{CALL:musteri.count('$1')}</b> Adet</block><br/>
<block 1 transparent left 150>Sipariş Toplamı</block>: <block 1 transparent right 190><b>{CALL:musteri.grand('$1')}</b></block><br/>
<block 1 transparent left 150>Sipariş Ortalama</block>:  <block 1 transparent right 190><b>₺{CALL:musteri.parite('$1')}</b></block><br/>
<block 1 transparent left 150>Son Sipariş Tarih</block>:  <block 1 transparent right 190><b>{CALL:musteri.gun('$1')}</b> gün <br/><b>{CALL:musteri.tarih('$1')}</b></block><br/>
</block>

<br/>
<block 1 skyblue left 400><color darkred>
<block 1 transparent left 100><b>Son Siparişi </b></block>
<block 1 transparent center 130>#( {CALL:musteri.id('$1')} )</block>
<block 1 transparent right 70><b>₺{CALL:musteri.toplam('$1')}</b></block><br/>
<size 15>{CALL:musteri.siparis('$1')}</size>
</color></block>

1 Beğeni

Bu konu son yanıttan 30 gün sonra otomatik olarak kapatıldı. Yeni yanıtlara artık izin verilmiyor.