Skip to content

Zatwierdzenie

Procedura

SQL
exec sp_executesql N';EXEC [document].[document_udpateDocumentStatus] @username = @0, @documentId = @1, @newStatus = @2, @skipInventoryValidation = @3',N'@0 nvarchar(4000),@1 nvarchar(40),@2 int,@3 int',@0=N'sys',@1=N'2af032c5-7f6f-eb11-80e4-9c8e994dc645',@2=1,@3=0

Proces

SQL
declare @id uniqueidentifier;
DECLARE x_cursor CURSOR
    FOR
            SELECT
            x.documentID
        FROM
            document.document x
            inner join wms.location wl on x.warehouseid = wl.locationid
            inner join document.documentType dt on x.documentType = dt.documentType
            and dt.masterDocumentCategory = 'warehouse'
                    where
    x.status =0
    and wl.locationCode = '003'
  and x.documenttype='WZ'
            ORDER BY   x.documentdate desc, x.documentNR desc

OPEN x_cursor
FETCH NEXT FROM x_cursor  into @id;
WHILE @@FETCH_STATUS = 0
BEGIN
BEGIN TRY
    BEGIN TRANSACTION
            exec    [erp].[document_updateDocumentStatus] @documentid  =@id, @newstatus=1, @username='marcin@platformaerp.com'
       COMMIT TRANSACTION
END TRY
BEGIN CATCH
    ROLLBACK TRANSACTION
END CATCH

FETCH NEXT FROM x_cursor  into @id;
END

CLOSE x_cursor;
DEALLOCATE x_cursor;

Komunikat

Walidacja DATA

Krok 2 [document_validateDocumentDate] error.document.issueDateEarlierThanLastIssueDate