This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Use TrioReceipt | |
GO | |
-- | |
-- S2H: Trans036 | |
-- ReceiptItemLine (Section 3) | |
-- | |
ALTER VIEW dbo.ReceiptItemLineExportDto_VW AS | |
SELECT rh.ReceiptHeaderId ReceiptHeaderId | |
, ru.RetailUnitNo RetailUnitNo | |
, ril.ItemLineNo ItemLineNo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Change 0 to -1 yesterday, -2 day before, ect. | |
DECLARE @date DATETIME = DateAdd(Day, 0, GetDate()); | |
DECLARE @startedLaterThan DATETIME = DateAdd(Hour, -18, @date); | |
DECLARE @businessDate DATE = DateAdd(Day, +1, CAST(@startedLaterThan AS DATE)); | |
-- To see details about each store, remove (comment out) this summary header (up to "FROM ("), and footer (last two lines) | |
SELECT | |
AccountingDate | |
,"Store Type" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Begin transaction | |
INSERT INTO TRIOStaging.dbo.BDMItemTransaction | |
(BDMItemTransactionId, TransactionNo, ObjectId, RetailUnitNo, StatusId, CreatedDate, CreatedBy, ModifiedDate, ModifiedBy) | |
SELECT NewId() BDMItemTransactionId | |
,100 TransactionNo | |
,il.ItemLocalId ObjectId | |
,ru.RetailUnitNo | |
,0 StatusId | |
,GETDATE() CreatedDate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @itemNo VARCHAR(13) = '5700384325212' | |
DECLARE @retailUnitNo VARCHAR(13) = NULL -- NULL = all | |
DECLARE @username VARCHAR(13) = 'manuel/ph99epp' | |
BEGIN TRANSACTION; | |
INSERT INTO [TRIO].[dbo].[ItemLocalInventoryAdjustment] ( | |
[ItemLocalInventoryAdjustmentId] | |
,[ItemLocalId] | |
,[ReferenceId] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT domain.DomainName | |
,domain.Note | |
,ccm.Code | |
,ccm.PriorityNo | |
,ccd.TEXT | |
FROM CommonCodeMaster AS ccm | |
INNER JOIN CommonCodeDetail AS ccd ON ccm.CommonCodeMasterId = ccd.CommonCodeMasterId | |
INNER JOIN CommonCodeDomain AS domain ON ccm.CommonCodeDomainId = domain.CommonCodeDomainId | |
WHERE domain.DomainName = 'AssortmentType' | |
AND ccm.IsActive = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE Trio | |
SELECT hd.HierarchyDetailId | |
,Chain.TEXT Chain | |
,DetailNo | |
FROM Trio..HierarchyDetail hd | |
CROSS APPLY dbo.GetCommonText_TV(hd.FullNameId, (SELECT CountryId FROM Trio..Country WHERE Code = 'DK')) AS Chain | |
WHERE hd.ParentHierarchyDetailId = ( | |
SELECT hd.HierarchyDetailId | |
FROM Trio..HierarchyDetail hd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE Trio | |
go | |
-- Find status -- | |
DECLARE @retailunitno VARCHAR(13) = '24385'; | |
SELECT TOP 100 ( | |
SELECT COUNT(*) FROM InventoryCountingItemLocal icil WHERE icil.InventoryCountingId = ic.InventoryCountingId) AS IcilCount | |
,(SELECT COUNT(*) FROM InventoryCountingItemLocal icil WHERE icil.InventoryCountingId = ic.InventoryCountingId AND icil.InventoryQty IS NULL) AS NoInvQtyIcilCount | |
,ic.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Use Trio | |
GO | |
BEGIN TRANSACTION | |
DECLARE @retailUnitNo VARCHAR(13) = '24228'; | |
DECLARE @countingDate DATE = CAST('2014-03-08' AS DATE); | |
DECLARE @Optalt UNIQUEIDENTIFIER = dbo.GetCommonCodeId('InventoryCountingDailyStatusCode', 'O'); | |
DECLARE @IkkeOptalt UNIQUEIDENTIFIER = dbo.GetCommonCodeId('InventoryCountingDailyStatusCode', 'I'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param ( | |
[parameter(Mandatory=$false)] | |
[alias("env")] | |
[int]$environment, | |
[parameter(Mandatory=$false, ValueFromPipeline=$true)] | |
[alias("s")] | |
[string[]]$service, | |
[parameter(Mandatory=$false)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE TrioStaging | |
GO | |
DECLARE @HHTBatchQueueId INT = 576601; | |
SELECT * | |
FROM [HHTBatchQueue] | |
WHERE HHTBatchQueueId = @HHTBatchQueueId; | |
SELECT * |
OlderNewer