Exemple #1
0
        private string TestCreateAndCompleteAndConfirmMovement_0()
        {
            var isInTransit    = true;
            var documentNumber = CreateAndCompleteTestMovement(isInTransit);

            var confirmDocNumber = "MC" + documentNumber;

            var movConfirm = movementConfirmationApplicationService.Get(confirmDocNumber);

            // //////////////////////////////////
            var updateMovConfirm = new MergePatchMovementConfirmation();

            updateMovConfirm.DocumentNumber = confirmDocNumber;
            updateMovConfirm.Version        = 1;
            updateMovConfirm.CommandId      = Guid.NewGuid().ToString();
            foreach (var line in movConfirm.MovementConfirmationLines)
            {
                var updateLine = updateMovConfirm.NewMergePatchMovementConfirmationLine();
                updateLine.LineNumber        = line.LineNumber;
                updateLine.ConfirmedQuantity = line.TargetQuantity;
                updateMovConfirm.MovementConfirmationLineCommands.Add(updateLine);
            }
            movementConfirmationApplicationService.When(updateMovConfirm);

            // //////////////////////////////////
            var actionConfirm = new MovementConfirmationCommands.DocumentAction();

            actionConfirm.Value          = DocumentAction.Confirm;
            actionConfirm.DocumentNumber = confirmDocNumber;
            actionConfirm.Version        = 2;
            actionConfirm.CommandId      = Guid.NewGuid().ToString();
            movementConfirmationApplicationService.When(actionConfirm);

            return(actionConfirm.DocumentNumber);
        }