fix(perms): fixed the location for the test update
This commit is contained in:
@@ -27,7 +27,7 @@ export const setPerms = async () => {
|
|||||||
`${data[0].value} will not have its permissions updated as it is not the test server.`
|
`${data[0].value} will not have its permissions updated as it is not the test server.`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
const scriptPath = `E:\\LST\\lstv2\\server\\scripts\\update.ps1 `;
|
const scriptPath = `E:\\LST\\lstv2\\dist\\server\\scripts\\updatePermissions.ps1 `;
|
||||||
|
|
||||||
const args = [
|
const args = [
|
||||||
"-NoProfile",
|
"-NoProfile",
|
||||||
|
|||||||
140
server/services/sqlServer/querys/dataMart/article.js
Normal file
140
server/services/sqlServer/querys/dataMart/article.js
Normal file
@@ -0,0 +1,140 @@
|
|||||||
|
export const activeArticle = `
|
||||||
|
SELECT V_Artikel.IdArtikelvarianten,
|
||||||
|
V_Artikel.Bezeichnung,
|
||||||
|
V_Artikel.ArtikelvariantenTypBez,
|
||||||
|
V_Artikel.PreisEinheitBez,
|
||||||
|
case when sales.price is null then 0 else sales.price end as salesPrice,
|
||||||
|
TypeOfMaterial=CASE
|
||||||
|
WHEN
|
||||||
|
V_Artikel.ArtikelvariantenTypBez LIKE'%Additive'
|
||||||
|
Then 'AD'
|
||||||
|
when V_Artikel.ArtikelvariantenTypBez Like '%Masterbatch'
|
||||||
|
THEN 'MB'
|
||||||
|
WHEN V_Artikel.ArtikelvariantenTypBez ='Pallet' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez ='Top' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez ='Bags' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez ='Bag' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez ='Stretch Wrap' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez ='Stretch Film' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez ='Banding Materials' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez ='Carton' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez ='Re-Shipper Box' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez ='Label' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez ='Pallet Label' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez ='Carton Label' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez ='Liner' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez ='Dose Cup' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez ='Metal Cage' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez ='Spout' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez = 'Slip Sheet' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez = 'Palet' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez = 'LID' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez= 'Metal' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez= 'Corner post' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez= 'Bottle Label' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez = 'Paper label' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez = 'Banding' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez = 'Glue' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez = 'Top Frame' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez = 'IML Label' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez = 'Purch EBM Bottle' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez = 'Purch Spout'
|
||||||
|
THEN 'PKG'
|
||||||
|
WHEN V_Artikel.ArtikelvariantenTypBez='HD-PE' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez='HD-PE PCR' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez='HD-PP' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez= 'PP' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez LIKE '%PCR' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez= 'LDPE' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez= 'PP' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez= 'HDPE' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez= 'PET' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez= 'PET-P'
|
||||||
|
THEN 'MM'
|
||||||
|
WHEN
|
||||||
|
V_Artikel.ArtikelvariantenTypBez='HDPE-Waste' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez='$Waste Container' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez='Mixed-Waste' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez LIKE'%-Waste%'
|
||||||
|
THEN 'Waste'
|
||||||
|
WHEN
|
||||||
|
V_Artikel.ArtikelvariantenTypBez = 'Bottle' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez = 'SBM Bottle' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez = 'EBM Bottle' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez = 'ISBM Bottle' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez = 'Decorated Bottle'
|
||||||
|
THEN 'Bottle'
|
||||||
|
WHEN V_Artikel.ArtikelvariantenTypBez = 'Preform'
|
||||||
|
Then 'Preform'
|
||||||
|
When
|
||||||
|
V_Artikel.ArtikelvariantenTypBez = 'Purchased Preform' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez = 'Purchased Caps' or
|
||||||
|
V_Artikel.ArtikelvariantenTypBez = 'Purchased_preform'
|
||||||
|
THEN 'Purchased_preform'
|
||||||
|
When
|
||||||
|
V_Artikel.ArtikelvariantenTypBez = 'Closures'
|
||||||
|
THEN 'Caps'
|
||||||
|
When
|
||||||
|
V_Artikel.ArtikelvariantenTypBez = 'Dummy'
|
||||||
|
THEN 'Not used'
|
||||||
|
ELSE 'Item not defined' END
|
||||||
|
,V_Artikel.IdArtikelvariantenTyp,
|
||||||
|
Round(V_Artikel.ArtikelGewicht, 3) as Article_Weight,
|
||||||
|
IdAdresse,
|
||||||
|
AdressBez,
|
||||||
|
AdressTypBez,
|
||||||
|
ProdBereichBez,
|
||||||
|
FG=case when
|
||||||
|
V_Artikel.ProdBereichBez = 'SBM' or
|
||||||
|
V_Artikel.ProdBereichBez = 'IM-Caps' or
|
||||||
|
V_Artikel.ProdBereichBez = 'IM-PET' or
|
||||||
|
V_Artikel.ProdBereichBez = 'PRINT OFFICE' or
|
||||||
|
V_Artikel.ProdBereichBez = 'EBM' or
|
||||||
|
V_Artikel.ProdBereichBez = 'ISBM'
|
||||||
|
Then 'FG'
|
||||||
|
Else 'not Defined Profit Center'
|
||||||
|
end,
|
||||||
|
V_Artikel.Umlaeufe as num_of_cycles,
|
||||||
|
V_FibuKonten_BASIS.FibuKontoNr as CostsCenterId,
|
||||||
|
V_FibuKonten_BASIS.Bezeichnung as CostCenterDescription,
|
||||||
|
sales.[KdArtNr] as CustomerArticleNumber,
|
||||||
|
sales.[KdArtBez] as CustomerArticleDescription,
|
||||||
|
round(V_Artikel.Zyklus, 2) as CycleTime,
|
||||||
|
Sypronummer as salesAgreement
|
||||||
|
--,*
|
||||||
|
FROM AlplaPROD_test1.dbo.V_Artikel (nolock)
|
||||||
|
|
||||||
|
join
|
||||||
|
AlplaPROD_test1.dbo.V_Artikelvarianten on AlplaPROD_test1.dbo.V_Artikel.IdArtikelvarianten =
|
||||||
|
AlplaPROD_test1.dbo.V_Artikelvarianten.IdArtikelvarianten
|
||||||
|
|
||||||
|
join
|
||||||
|
AlplaPROD_test1.dbo.V_FibuKonten_BASIS on AlplaPROD_test1.dbo.V_Artikelvarianten.IdFibuKonto =
|
||||||
|
AlplaPROD_test1.dbo.V_FibuKonten_BASIS.IdFibuKonto
|
||||||
|
|
||||||
|
|
||||||
|
-- adding in the sales price
|
||||||
|
left join
|
||||||
|
(select * from
|
||||||
|
(select
|
||||||
|
ROW_NUMBER() OVER (PARTITION BY IdArtikelvarianten ORDER BY GueltigabDatum DESC) AS RN,
|
||||||
|
IdArtikelvarianten as av
|
||||||
|
,GueltigabDatum as validDate
|
||||||
|
,VKPreis as price
|
||||||
|
,[KdArtNr]
|
||||||
|
,[KdArtBez]
|
||||||
|
--,*
|
||||||
|
from AlplaPROD_test1.dbo.T_HistoryVK (nolock)
|
||||||
|
where
|
||||||
|
--GueltigabDatum > getDate() - 120
|
||||||
|
--and
|
||||||
|
Aktiv = 1
|
||||||
|
and StandardKunde = 1 -- default address
|
||||||
|
) a
|
||||||
|
where RN = 1) as sales
|
||||||
|
on AlplaPROD_test1.dbo.V_Artikel.IdArtikelvarianten = sales.av
|
||||||
|
|
||||||
|
where V_Artikel.aktiv = 1
|
||||||
|
|
||||||
|
order by V_Artikel.IdArtikelvarianten /*, TypeOfMaterial */
|
||||||
|
`;
|
||||||
Reference in New Issue
Block a user