Çözüldü Faturaya Sipariş ve İrsaliye Ekleme

Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...

Rahle

Yeni Üye
Katılım
20 Haz 2018
Mesajlar
104
En iyi yanıt
0
Puanları
18
Yaş
48
Konum
İstanbul
Ad Soyad
Huzeyfe Yaman
Office Versiyon
Office 2010
Merhaba,
Aşağıdaki kodlara sipariş ve irsaliye nasıl eklenebilir?

SQL:
SELECT
INVFC.DATE_ TARIH,
CLCARD.CODE CARI_KOD,
CLCARD.DEFINITION_ CARI_AD,
 INVFC.FICHENO,
  INVFC.DOCODE,
  SUM(CASE LGMAIN.TRRATE WHEN 0 THEN LGMAIN.TOTAL ELSE LGMAIN.TOTAL*LGMAIN.TRRATE END) AS TUTAR
  — , SUM(CASE LGMAIN.TRRATE WHEN 0 THEN LGMAIN.TOTAL ELSE LGMAIN.TOTAL*LGMAIN.TRRATE END * DATEDIFF(day,GETDATE(),LGMAIN.DATE_)) AS TOTALGDEB
 FROM
LG_119_01_PAYTRANS LGMAIN WITH(NOLOCK)               LEFT OUTER JOIN LG_119_01_INVOICE INVFC WITH(NOLOCK) ON (LGMAIN.FICHEREF  =  INVFC.LOGICALREF) LEFT OUTER JOIN LG_119_01_CLFLINE CTRNS WITH(NOLOCK) ON (LGMAIN.FICHEREF  =  CTRNS.LOGICALREF) LEFT OUTER JOIN LG_119_01_CSROLL RLFIC WITH(NOLOCK) ON (LGMAIN.FICHEREF  =  RLFIC.LOGICALREF) LEFT OUTER JOIN LG_119_01_BNFLINE BTRNS WITH(NOLOCK) ON (LGMAIN.FICHEREF  =  BTRNS.LOGICALREF) LEFT OUTER JOIN LG_119_01_KSLINES CASHTR WITH(NOLOCK) ON (LGMAIN.FICHEREF  =  CASHTR.LOGICALREF) LEFT OUTER JOIN LG_119_01_ORFICHE ORFIC WITH(NOLOCK) ON (LGMAIN.FICHEREF  =  ORFIC.LOGICALREF)
LEFT JOIN LG_119_CLCARD CLCARD ON CLCARD.LOGICALREF = LGMAIN.CARDREF
 WHERE
((LGMAIN.DATE_ >= CONVERT(dateTime, ‘1-1-2000’, 101)) AND (LGMAIN.DATE_ = CONVERT(dateTime, ‘1-1-2000’, 101)) AND (ORFIC.DATE_ = CONVERT(dateTime, ‘1-1-2000’, 101)) AND (INVFC.DATE_ = CONVERT(dateTime, ‘1-1-2000’, 101)) AND (CTRNS.DATE_ = CONVERT(dateTime, ‘1-1-2000’, 101)) AND (RLFIC.DATE_ = CONVERT(dateTime, ‘1-1-2000’, 101)) AND (BTRNS.DATE_ = CONVERT(dateTime, ‘1-1-2000’, 101)) AND (CASHTR.DATE_ 0) AND (LGMAIN.TOTAL – LGMAIN.PAID > 0.00000001) AND (LGMAIN.SIGN = 0) AND (LGMAIN.CANCELLED = 0) AND (LGMAIN.PAIDINCASH 1)

AND CLCARD.CODE LIKE ‘M%’

GROUP BY INVFC.DATE_, CODE,CLCARD.DEFINITION_, INVFC.FICHENO , INVFC.DOCODE
 

Vedat ÖZER

Logo Uzmanı
Geliştirici
Katılım
4 Haz 2018
Mesajlar
259
En iyi yanıt
4
Puanları
63
Yaş
30
Konum
Antalya / Merkez
Ad Soyad
Vedat ÖZER
Office Versiyon
2019
Merhaba,
İnceleyin.

SELECT
INVFC.DATE_ TARIH,
CLCARD.CODE CARI_KOD,
CLCARD.DEFINITION_ CARI_AD,
INVFC.FICHENO,
INVFC.DOCODE,
STFICHE.FICHENO,
STFICHE.DOCODE,
SUM(CASE LGMAIN.TRRATE WHEN 0 THEN LGMAIN.TOTAL ELSE LGMAIN.TOTAL*LGMAIN.TRRATE END) AS TUTAR,
(SELECT TOP 1 ORFICHE.FICHENO FROM LG_006_01_ORFICHE ORFICHE WHERE ORFICHE.LOGICALREF IN(SELECT TOP 1 STLINE.ORDFICHEREF FROM LG_006_01_STLINE STLINE WHERE STLINE.INVOICEREF = INVFC.LOGICALREF))

FROM
LG_006_01_PAYTRANS LGMAIN WITH(NOLOCK) LEFT OUTER JOIN LG_006_01_INVOICE INVFC WITH(NOLOCK) ON (LGMAIN.FICHEREF = INVFC.LOGICALREF)
LEFT OUTER JOIN LG_006_01_CLFLINE CTRNS WITH(NOLOCK) ON (LGMAIN.FICHEREF = CTRNS.LOGICALREF)
LEFT OUTER JOIN LG_006_01_CSROLL RLFIC WITH(NOLOCK) ON (LGMAIN.FICHEREF = RLFIC.LOGICALREF)
LEFT OUTER JOIN LG_006_01_BNFLINE BTRNS WITH(NOLOCK) ON (LGMAIN.FICHEREF = BTRNS.LOGICALREF)
LEFT OUTER JOIN LG_006_01_KSLINES CASHTR WITH(NOLOCK) ON (LGMAIN.FICHEREF = CASHTR.LOGICALREF)
LEFT OUTER JOIN LG_006_01_ORFICHE ORFIC WITH(NOLOCK) ON (LGMAIN.FICHEREF = ORFIC.LOGICALREF)
LEFT OUTER JOIN LG_006_CLCARD CLCARD WITH(NOLOCK) ON CLCARD.LOGICALREF = LGMAIN.CARDREF
LEFT OUTER JOIN LG_006_01_STFICHE STFICHE WITH(NOLOCK) ON STFICHE.INVOICEREF= INVFC.LOGICALREF


WHERE (LGMAIN.TOTAL - LGMAIN.PAID > 0.00000001) AND (LGMAIN.SIGN = 0) AND (LGMAIN.CANCELLED = 0) AND (LGMAIN.PAIDINCASH=0) AND CLCARD.CODE LIKE '%'

GROUP BY INVFC.DATE_,CODE,CLCARD.DEFINITION_,INVFC.FICHENO,INVFC.DOCODE,STFICHE.FICHENO,STFICHE.DOCODE,INVFC.LOGICALREF
 

Rahle

Yeni Üye
Katılım
20 Haz 2018
Mesajlar
104
En iyi yanıt
0
Puanları
18
Yaş
48
Konum
İstanbul
Ad Soyad
Huzeyfe Yaman
Office Versiyon
Office 2010
Merhaba,
Tamamdır. Teşekkür ederim.
 
Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...
Üst Alt