Fix product performance grouped JSON build
This commit is contained in:
@@ -21,6 +21,9 @@ type ProductionNoCostProductRow struct {
|
||||
type ProductionHasCostProductRow struct {
|
||||
UretimSekli string `json:"UretimSekli"`
|
||||
UrtSiparisNo string `json:"nUrtSiparisNo"`
|
||||
FirmaKodu string `json:"FirmaKodu"`
|
||||
FirmaAdi string `json:"FirmaAdi"`
|
||||
Firma2 string `json:"Firma2"`
|
||||
CeketDepoGiris float64 `json:"ceketDepoGiris"`
|
||||
PantolonDepoGiris float64 `json:"pantolonDepoGiris"`
|
||||
YelekDepoGiris float64 `json:"yelekDepoGiris"`
|
||||
|
||||
@@ -935,15 +935,19 @@ SonSiparisSirali AS (
|
||||
LTRIM(RTRIM(SD.sMModelKodu)) AS UrunKodu,
|
||||
SD.dteIslemTarihi AS SonSiparisTarihi,
|
||||
SM.nUrtSiparisNo,
|
||||
ISNULL(F.sKodu, '') AS FirmaKodu,
|
||||
ISNULL(F.sAciklama, '') AS FirmaAdi,
|
||||
ISNULL(SM.sVeren, '') AS Firma2,
|
||||
ROW_NUMBER() OVER (
|
||||
PARTITION BY LTRIM(RTRIM(SD.sMModelKodu))
|
||||
ORDER BY SD.dteIslemTarihi DESC, SD.nUrtSiparisID DESC
|
||||
) AS rn
|
||||
FROM dbo.spUrtSiparisDet SD
|
||||
INNER JOIN dbo.spUrtSiparis SM ON SM.nUrtSiparisID = SD.nUrtSiparisID
|
||||
LEFT JOIN dbo.tbFirma F ON F.nFirmaID = SM.nFirmaID
|
||||
),
|
||||
SonSiparis AS (
|
||||
SELECT UrunKodu, SonSiparisTarihi, nUrtSiparisNo
|
||||
SELECT UrunKodu, SonSiparisTarihi, nUrtSiparisNo, FirmaKodu, FirmaAdi, Firma2
|
||||
FROM SonSiparisSirali
|
||||
WHERE rn = 1
|
||||
)
|
||||
@@ -956,6 +960,9 @@ SELECT
|
||||
ELSE N'Tanimsiz'
|
||||
END AS UretimSekli,
|
||||
RTRIM(CONVERT(VARCHAR(32), ISNULL(SS.nUrtSiparisNo, 0))) AS nUrtSiparisNo,
|
||||
ISNULL(SS.FirmaKodu, '') AS FirmaKodu,
|
||||
ISNULL(SS.FirmaAdi, '') AS FirmaAdi,
|
||||
ISNULL(SS.Firma2, '') AS Firma2,
|
||||
RTRIM(CONVERT(VARCHAR(32), ISNULL(OM.nOnMLNo, 0))) AS nOnMLNo,
|
||||
LTRIM(RTRIM(ISNULL(OM.UrunKodu, ''))) AS UrunKodu,
|
||||
ISNULL(OM.UrunAdi, '') AS UrunAdi,
|
||||
@@ -1010,6 +1017,9 @@ WHERE OM.rn = 1
|
||||
OR LTRIM(RTRIM(OM.UrunKodu)) LIKE '%' + @p1 + '%'
|
||||
OR ISNULL(OM.UrunAdi, '') LIKE '%' + @p1 + '%'
|
||||
OR ISNULL(OM.sAciklama, '') LIKE '%' + @p1 + '%'
|
||||
OR ISNULL(SS.FirmaKodu, '') LIKE '%' + @p1 + '%'
|
||||
OR ISNULL(SS.FirmaAdi, '') LIKE '%' + @p1 + '%'
|
||||
OR ISNULL(SS.Firma2, '') LIKE '%' + @p1 + '%'
|
||||
)
|
||||
ORDER BY
|
||||
SS.SonSiparisTarihi DESC,
|
||||
|
||||
@@ -216,6 +216,9 @@ func GetProductionHasCostProductsHandler(w http.ResponseWriter, r *http.Request)
|
||||
if err := rows.Scan(
|
||||
&item.UretimSekli,
|
||||
&item.UrtSiparisNo,
|
||||
&item.FirmaKodu,
|
||||
&item.FirmaAdi,
|
||||
&item.Firma2,
|
||||
&item.NOnMLNo,
|
||||
&item.UrunKodu,
|
||||
&item.UrunAdi,
|
||||
|
||||
@@ -177,6 +177,9 @@ const columns = [
|
||||
{ name: 'open', label: '', field: 'open', align: 'center', sortable: false, style: 'width:3%', headerStyle: 'width:3%' },
|
||||
{ name: 'UretimSekli', label: 'Uretim Sekli', field: 'UretimSekli', align: 'left', sortable: true, style: 'width:9%', headerStyle: 'width:9%' },
|
||||
{ name: 'nUrtSiparisNo', label: 'Uretim Siparis No', field: 'nUrtSiparisNo', align: 'left', sortable: true, style: 'width:6%', headerStyle: 'width:6%' },
|
||||
{ name: 'FirmaKodu', label: 'Firma Kodu', field: 'FirmaKodu', align: 'left', sortable: true, style: 'width:7%', headerStyle: 'width:7%' },
|
||||
{ name: 'FirmaAdi', label: 'Firma', field: 'FirmaAdi', align: 'left', sortable: true, style: 'width:9%', headerStyle: 'width:9%' },
|
||||
{ name: 'Firma2', label: '2. Firma', field: 'Firma2', align: 'left', sortable: true, style: 'width:8%', headerStyle: 'width:8%' },
|
||||
{ name: 'ceketDepoGiris', label: 'C-Ceket Depo Giris', field: 'ceketDepoGiris', align: 'right', sortable: true, format: val => formatMoney(val), style: 'width:6%', headerStyle: 'width:6%' },
|
||||
{ name: 'pantolonDepoGiris', label: 'P-Pantolon Depo Giris', field: 'pantolonDepoGiris', align: 'right', sortable: true, format: val => formatMoney(val), style: 'width:6%', headerStyle: 'width:6%' },
|
||||
{ name: 'yelekDepoGiris', label: 'Y-Yelek Depo Giris', field: 'yelekDepoGiris', align: 'right', sortable: true, format: val => formatMoney(val), style: 'width:6%', headerStyle: 'width:6%' },
|
||||
|
||||
Reference in New Issue
Block a user