Ejemplo n.º 1
0
 public GarmentComodityPriceDto(GarmentComodityPrice garmentComodityPrice)
 {
     Id       = garmentComodityPrice.Identity;
     Comodity = new GarmentComodity(garmentComodityPrice.ComodityId.Value, garmentComodityPrice.ComodityCode, garmentComodityPrice.ComodityName);
     IsValid  = garmentComodityPrice.IsValid;
     Unit     = new UnitDepartment(garmentComodityPrice.UnitId.Value, garmentComodityPrice.UnitCode, garmentComodityPrice.UnitName);
     Date     = garmentComodityPrice.Date;
     Price    = garmentComodityPrice.Price;
 }
 public GarmentAdjustmentListDto(GarmentAdjustment garmentAdjustment)
 {
     Id             = garmentAdjustment.Identity;
     AdjustmentNo   = garmentAdjustment.AdjustmentNo;
     RONo           = garmentAdjustment.RONo;
     Article        = garmentAdjustment.Article;
     Unit           = new UnitDepartment(garmentAdjustment.UnitId.Value, garmentAdjustment.UnitCode, garmentAdjustment.UnitName);
     Comodity       = new GarmentComodity(garmentAdjustment.ComodityId.Value, garmentAdjustment.ComodityCode, garmentAdjustment.ComodityName);
     AdjustmentDate = garmentAdjustment.AdjustmentDate;
     CreatedBy      = garmentAdjustment.AuditTrail.CreatedBy;
 }
 public GarmentFinishingInListDto(GarmentFinishingIn garmentFinishingIn)
 {
     Id              = garmentFinishingIn.Identity;
     FinishingInNo   = garmentFinishingIn.FinishingInNo;
     RONo            = garmentFinishingIn.RONo;
     Article         = garmentFinishingIn.Article;
     Unit            = new UnitDepartment(garmentFinishingIn.UnitId.Value, garmentFinishingIn.UnitCode, garmentFinishingIn.UnitName);
     UnitFrom        = new UnitDepartment(garmentFinishingIn.UnitFromId.Value, garmentFinishingIn.UnitFromCode, garmentFinishingIn.UnitFromName);
     FinishingInDate = garmentFinishingIn.FinishingInDate;
     FinishingInType = garmentFinishingIn.FinishingInType;
     Comodity        = new GarmentComodity(garmentFinishingIn.ComodityId.Value, garmentFinishingIn.ComodityCode, garmentFinishingIn.ComodityName);
     CreatedBy       = garmentFinishingIn.AuditTrail.CreatedBy;
 }
Ejemplo n.º 4
0
 public GarmentSubconCuttingDto(GarmentSubconCutting s)
 {
     Id                  = s.Identity;
     RONo                = s.RONo;
     Size                = new SizeValueObject(s.SizeId.Value, s.SizeName);
     Quantity            = s.Quantity;
     Product             = new Product(s.ProductId.Value, s.ProductCode, s.ProductName);
     Comodity            = new GarmentComodity(s.ComodityId.Value, s.ComodityCode, s.ComodityName);
     DesignColor         = s.DesignColor;
     Remark              = s.Remark;
     BasicPrice          = s.BasicPrice;
     FinishingInQuantity = s.FinishingInQuantity;
 }
Ejemplo n.º 5
0
 public GarmentLoadingListDto(GarmentLoading garmentLoading)
 {
     Id          = garmentLoading.Identity;
     LoadingNo   = garmentLoading.LoadingNo;
     SewingDONo  = garmentLoading.SewingDONo;
     RONo        = garmentLoading.RONo;
     Article     = garmentLoading.Article;
     Unit        = new UnitDepartment(garmentLoading.UnitId.Value, garmentLoading.UnitCode, garmentLoading.UnitName);
     UnitFrom    = new UnitDepartment(garmentLoading.UnitFromId.Value, garmentLoading.UnitFromCode, garmentLoading.UnitFromName);
     Comodity    = new GarmentComodity(garmentLoading.ComodityId.Value, garmentLoading.ComodityCode, garmentLoading.ComodityName);
     LoadingDate = garmentLoading.LoadingDate;
     CreatedBy   = garmentLoading.AuditTrail.CreatedBy;
 }
        public GarmentCuttingOutDto(GarmentCuttingOut garmentCuttingOut)
        {
            Id             = garmentCuttingOut.Identity;
            CutOutNo       = garmentCuttingOut.CutOutNo;
            CuttingOutType = garmentCuttingOut.CuttingOutType;
            UnitFrom       = new UnitDepartment(garmentCuttingOut.UnitFromId.Value, garmentCuttingOut.UnitFromCode, garmentCuttingOut.UnitFromName);
            CuttingOutDate = garmentCuttingOut.CuttingOutDate;
            RONo           = garmentCuttingOut.RONo;
            Article        = garmentCuttingOut.Article;
            Unit           = new UnitDepartment(garmentCuttingOut.UnitId.Value, garmentCuttingOut.UnitCode, garmentCuttingOut.UnitName);
            Comodity       = new GarmentComodity(garmentCuttingOut.ComodityId.Value, garmentCuttingOut.ComodityCode, garmentCuttingOut.ComodityName);

            Items = new List <GarmentCuttingOutItemDto>();
        }
Ejemplo n.º 7
0
 public GarmentExpenditureGoodReturnListDto(GarmentExpenditureGoodReturn garmentExpenditureGoodReturn)
 {
     Id        = garmentExpenditureGoodReturn.Identity;
     ReturNo   = garmentExpenditureGoodReturn.ReturNo;
     RONo      = garmentExpenditureGoodReturn.RONo;
     Article   = garmentExpenditureGoodReturn.Article;
     Unit      = new UnitDepartment(garmentExpenditureGoodReturn.UnitId.Value, garmentExpenditureGoodReturn.UnitCode, garmentExpenditureGoodReturn.UnitName);
     ReturDate = garmentExpenditureGoodReturn.ReturDate;
     ReturType = garmentExpenditureGoodReturn.ReturType;
     Comodity  = new GarmentComodity(garmentExpenditureGoodReturn.ComodityId.Value, garmentExpenditureGoodReturn.ComodityCode, garmentExpenditureGoodReturn.ComodityName);
     Buyer     = new Buyer(garmentExpenditureGoodReturn.BuyerId.Value, garmentExpenditureGoodReturn.BuyerCode, garmentExpenditureGoodReturn.BuyerName);
     Invoice   = garmentExpenditureGoodReturn.Invoice;
     CreatedBy = garmentExpenditureGoodReturn.AuditTrail.CreatedBy;
 }
Ejemplo n.º 8
0
 public GarmentSewingDOListDto(GarmentSewingDO garmentSewingDO)
 {
     Id           = garmentSewingDO.Identity;
     SewingDONo   = garmentSewingDO.SewingDONo;
     CuttingOutId = garmentSewingDO.CuttingOutId;
     UnitFrom     = new UnitDepartment(garmentSewingDO.UnitFromId.Value, garmentSewingDO.UnitFromCode, garmentSewingDO.UnitFromName);
     Unit         = new UnitDepartment(garmentSewingDO.UnitId.Value, garmentSewingDO.UnitCode, garmentSewingDO.UnitName);
     RONo         = garmentSewingDO.RONo;
     Article      = garmentSewingDO.Article;
     Comodity     = new GarmentComodity(garmentSewingDO.ComodityId.Value, garmentSewingDO.ComodityCode, garmentSewingDO.ComodityName);
     SewingDODate = garmentSewingDO.SewingDODate;
     CreatedBy    = garmentSewingDO.AuditTrail.CreatedBy;
     Items        = new List <GarmentSewingDOItemDto>();
 }
Ejemplo n.º 9
0
 public GarmentFinishedGoodStockDto(GarmentFinishedGoodStock finishedGoodStock)
 {
     Id = finishedGoodStock.Identity;
     FinishedGoodStockNo = finishedGoodStock.FinishedGoodStockNo;
     RONo       = finishedGoodStock.RONo;
     Article    = finishedGoodStock.Article;
     Unit       = new UnitDepartment(finishedGoodStock.UnitId.Value, finishedGoodStock.UnitCode, finishedGoodStock.UnitName);
     Comodity   = new GarmentComodity(finishedGoodStock.ComodityId.Value, finishedGoodStock.ComodityCode, finishedGoodStock.ComodityName);
     Size       = new SizeValueObject(finishedGoodStock.SizeId.Value, finishedGoodStock.SizeName);
     Quantity   = finishedGoodStock.Quantity;
     Uom        = new Uom(finishedGoodStock.UomId.Value, finishedGoodStock.UomUnit);
     BasicPrice = finishedGoodStock.BasicPrice;
     Price      = finishedGoodStock.Price;
 }
Ejemplo n.º 10
0
        public GarmentAdjustmentDto(GarmentAdjustment garmentAdjustment)
        {
            Id             = garmentAdjustment.Identity;
            AdjustmentNo   = garmentAdjustment.AdjustmentNo;
            AdjustmentType = garmentAdjustment.AdjustmentType;
            RONo           = garmentAdjustment.RONo;
            Article        = garmentAdjustment.Article;
            Unit           = new UnitDepartment(garmentAdjustment.UnitId.Value, garmentAdjustment.UnitCode, garmentAdjustment.UnitName);
            Comodity       = new GarmentComodity(garmentAdjustment.ComodityId.Value, garmentAdjustment.ComodityCode, garmentAdjustment.ComodityName);
            AdjustmentDate = garmentAdjustment.AdjustmentDate;
            AdjustmentDesc = garmentAdjustment.AdjustmentDesc;

            Items = new List <GarmentAdjustmentItemDto>();
        }
Ejemplo n.º 11
0
 public GarmentExpenditureGoodReturnDto(GarmentExpenditureGoodReturn garmentExpenditureGoodReturn)
 {
     Id        = garmentExpenditureGoodReturn.Identity;
     ReturNo   = garmentExpenditureGoodReturn.ReturNo;
     RONo      = garmentExpenditureGoodReturn.RONo;
     Article   = garmentExpenditureGoodReturn.Article;
     Unit      = new UnitDepartment(garmentExpenditureGoodReturn.UnitId.Value, garmentExpenditureGoodReturn.UnitCode, garmentExpenditureGoodReturn.UnitName);
     ReturDate = garmentExpenditureGoodReturn.ReturDate;
     ReturType = garmentExpenditureGoodReturn.ReturType;
     Comodity  = new GarmentComodity(garmentExpenditureGoodReturn.ComodityId.Value, garmentExpenditureGoodReturn.ComodityCode, garmentExpenditureGoodReturn.ComodityName);
     Buyer     = new Buyer(garmentExpenditureGoodReturn.BuyerId.Value, garmentExpenditureGoodReturn.BuyerCode, garmentExpenditureGoodReturn.BuyerName);
     Invoice   = garmentExpenditureGoodReturn.Invoice;
     ReturDesc = garmentExpenditureGoodReturn.ReturDesc;
     Items     = new List <GarmentExpenditureGoodReturnItemDto>();
 }
        public GarmentLoadingDto(GarmentLoading garmentLoading)
        {
            Id          = garmentLoading.Identity;
            LoadingNo   = garmentLoading.LoadingNo;
            SewingDOId  = garmentLoading.SewingDOId;
            SewingDONo  = garmentLoading.SewingDONo;
            RONo        = garmentLoading.RONo;
            Article     = garmentLoading.Article;
            Unit        = new UnitDepartment(garmentLoading.UnitId.Value, garmentLoading.UnitCode, garmentLoading.UnitName);
            UnitFrom    = new UnitDepartment(garmentLoading.UnitFromId.Value, garmentLoading.UnitFromCode, garmentLoading.UnitFromName);
            Comodity    = new GarmentComodity(garmentLoading.ComodityId.Value, garmentLoading.ComodityCode, garmentLoading.ComodityName);
            LoadingDate = garmentLoading.LoadingDate;

            Items = new List <GarmentLoadingItemDto>();
        }
Ejemplo n.º 13
0
        public GarmentFinishingOutDto(GarmentFinishingOut garmentFinishingOutList)
        {
            Id               = garmentFinishingOutList.Identity;
            FinishingOutNo   = garmentFinishingOutList.FinishingOutNo;
            UnitTo           = new UnitDepartment(garmentFinishingOutList.UnitToId.Value, garmentFinishingOutList.UnitToCode, garmentFinishingOutList.UnitToName);
            Unit             = new UnitDepartment(garmentFinishingOutList.UnitId.Value, garmentFinishingOutList.UnitCode, garmentFinishingOutList.UnitName);
            RONo             = garmentFinishingOutList.RONo;
            Article          = garmentFinishingOutList.Article;
            FinishingOutDate = garmentFinishingOutList.FinishingOutDate;
            FinishingTo      = garmentFinishingOutList.FinishingTo;
            Comodity         = new GarmentComodity(garmentFinishingOutList.ComodityId.Value, garmentFinishingOutList.ComodityCode, garmentFinishingOutList.ComodityName);
            IsDifferentSize  = garmentFinishingOutList.IsDifferentSize;

            Items = new List <GarmentFinishingOutItemDto>();
        }
Ejemplo n.º 14
0
 public GarmentSewingInListDto(GarmentSewingIn garmentSewingInList)
 {
     Id           = garmentSewingInList.Identity;
     SewingInNo   = garmentSewingInList.SewingInNo;
     SewingFrom   = garmentSewingInList.SewingFrom;
     LoadingId    = garmentSewingInList.LoadingId;
     LoadingNo    = garmentSewingInList.LoadingNo;
     UnitFrom     = new UnitDepartment(garmentSewingInList.UnitFromId.Value, garmentSewingInList.UnitFromCode, garmentSewingInList.UnitFromName);
     Unit         = new UnitDepartment(garmentSewingInList.UnitId.Value, garmentSewingInList.UnitCode, garmentSewingInList.UnitName);
     RONo         = garmentSewingInList.RONo;
     Article      = garmentSewingInList.Article;
     Comodity     = new GarmentComodity(garmentSewingInList.ComodityId.Value, garmentSewingInList.ComodityCode, garmentSewingInList.ComodityName);
     SewingInDate = garmentSewingInList.SewingInDate;
     CreatedBy    = garmentSewingInList.AuditTrail.CreatedBy;
     Items        = new List <GarmentSewingInItemDto>();
 }
        public GarmentSewingInDto(GarmentSewingIn garmentSewingIn)
        {
            Id           = garmentSewingIn.Identity;
            SewingInNo   = garmentSewingIn.SewingInNo;
            SewingFrom   = garmentSewingIn.SewingFrom;
            LoadingId    = garmentSewingIn.LoadingId;
            LoadingNo    = garmentSewingIn.LoadingNo;
            UnitFrom     = new UnitDepartment(garmentSewingIn.UnitFromId.Value, garmentSewingIn.UnitFromCode, garmentSewingIn.UnitFromName);
            Unit         = new UnitDepartment(garmentSewingIn.UnitId.Value, garmentSewingIn.UnitCode, garmentSewingIn.UnitName);
            RONo         = garmentSewingIn.RONo;
            Article      = garmentSewingIn.Article;
            Comodity     = new GarmentComodity(garmentSewingIn.ComodityId.Value, garmentSewingIn.ComodityCode, garmentSewingIn.ComodityName);
            SewingInDate = garmentSewingIn.SewingInDate;

            Items = new List <GarmentSewingInItemDto>();
        }
 public GarmentFinishingInDto(GarmentFinishingIn garmentFinishingIn)
 {
     Id              = garmentFinishingIn.Identity;
     FinishingInNo   = garmentFinishingIn.FinishingInNo;
     RONo            = garmentFinishingIn.RONo;
     Article         = garmentFinishingIn.Article;
     Unit            = new UnitDepartment(garmentFinishingIn.UnitId.Value, garmentFinishingIn.UnitCode, garmentFinishingIn.UnitName);
     UnitFrom        = new UnitDepartment(garmentFinishingIn.UnitFromId.Value, garmentFinishingIn.UnitFromCode, garmentFinishingIn.UnitFromName);
     Comodity        = new GarmentComodity(garmentFinishingIn.ComodityId.Value, garmentFinishingIn.ComodityCode, garmentFinishingIn.ComodityName);
     FinishingInDate = garmentFinishingIn.FinishingInDate;
     FinishingInType = garmentFinishingIn.FinishingInType;
     Comodity        = new GarmentComodity(garmentFinishingIn.ComodityId.Value, garmentFinishingIn.ComodityCode, garmentFinishingIn.ComodityName);
     DOId            = garmentFinishingIn.DOId;
     DONo            = garmentFinishingIn.DONo;
     Items           = new List <GarmentFinishingInItemDto>();
 }
Ejemplo n.º 17
0
        public GarmentSubconCuttingOutDto(GarmentSubconCuttingOut garmentCuttingOut)
        {
            Id             = garmentCuttingOut.Identity;
            CutOutNo       = garmentCuttingOut.CutOutNo;
            CuttingOutType = garmentCuttingOut.CuttingOutType;
            UnitFrom       = new UnitDepartment(garmentCuttingOut.UnitFromId.Value, garmentCuttingOut.UnitFromCode, garmentCuttingOut.UnitFromName);
            CuttingOutDate = garmentCuttingOut.CuttingOutDate;
            RONo           = garmentCuttingOut.RONo;
            Article        = garmentCuttingOut.Article;
            Comodity       = new GarmentComodity(garmentCuttingOut.ComodityId.Value, garmentCuttingOut.ComodityCode, garmentCuttingOut.ComodityName);

            EPOId          = garmentCuttingOut.EPOId;
            EPOItemId      = garmentCuttingOut.EPOItemId;
            POSerialNumber = garmentCuttingOut.POSerialNumber;

            Items = new List <GarmentSubconCuttingOutItemDto>();
        }
Ejemplo n.º 18
0
 public GarmentExpenditureGoodDto(GarmentExpenditureGood garmentExpenditureGood)
 {
     Id = garmentExpenditureGood.Identity;
     ExpenditureGoodNo = garmentExpenditureGood.ExpenditureGoodNo;
     RONo            = garmentExpenditureGood.RONo;
     Article         = garmentExpenditureGood.Article;
     Unit            = new UnitDepartment(garmentExpenditureGood.UnitId.Value, garmentExpenditureGood.UnitCode, garmentExpenditureGood.UnitName);
     ExpenditureDate = garmentExpenditureGood.ExpenditureDate;
     ExpenditureType = garmentExpenditureGood.ExpenditureType;
     Comodity        = new GarmentComodity(garmentExpenditureGood.ComodityId.Value, garmentExpenditureGood.ComodityCode, garmentExpenditureGood.ComodityName);
     Buyer           = new Buyer(garmentExpenditureGood.BuyerId.Value, garmentExpenditureGood.BuyerCode, garmentExpenditureGood.BuyerName);
     Invoice         = garmentExpenditureGood.Invoice;
     ContractNo      = garmentExpenditureGood.ContractNo;
     Carton          = garmentExpenditureGood.Carton;
     Description     = garmentExpenditureGood.Description;
     IsReceived      = garmentExpenditureGood.IsReceived;
     Items           = new List <GarmentExpenditureGoodItemDto>();
 }
Ejemplo n.º 19
0
        public async Task <GarmentAvalComponent> Handle(PlaceGarmentAvalComponentCommand request, CancellationToken cancellationToken)
        {
            GarmentComodity garmentComodity = request.Comodity ?? new GarmentComodity(0, null, null);

            var avalComponentNo = GenerateNo(request);

            GarmentAvalComponent garmentAvalComponent = new GarmentAvalComponent(
                Guid.NewGuid(),
                avalComponentNo,
                new UnitDepartmentId(request.Unit.Id),
                request.Unit.Code,
                request.Unit.Name,
                request.AvalComponentType,
                request.RONo,
                request.Article,
                new GarmentComodityId(garmentComodity.Id),
                garmentComodity.Code,
                garmentComodity.Name,
                request.Date.GetValueOrDefault()
                );

            foreach (var item in request.Items.Where(w => w.IsSave))
            {
                SizeValueObject sizeValueObject = item.Size ?? new SizeValueObject(0, null);

                GarmentAvalComponentItem garmentAvalComponentItem = new GarmentAvalComponentItem(
                    Guid.NewGuid(),
                    garmentAvalComponent.Identity,
                    item.CuttingInDetailId,
                    item.SewingOutItemId,
                    item.SewingOutDetailId,
                    new ProductId(item.Product.Id),
                    item.Product.Code,
                    item.Product.Name,
                    item.DesignColor,
                    item.Color,
                    item.Quantity,
                    item.Quantity,
                    new SizeId(sizeValueObject.Id),
                    sizeValueObject.Size,
                    item.Price,
                    item.BasicPrice
                    );

                await _garmentAvalComponentItemRepository.Update(garmentAvalComponentItem);

                if (garmentAvalComponent.AvalComponentType == "CUTTING")
                {
                    var cuttingInDetail = _garmentCuttingInDetailRepository.Find(f => f.Identity == garmentAvalComponentItem.CuttingInDetailId).SingleOrDefault();

                    if (cuttingInDetail == null)
                    {
                        throw new Exception($"CuttingInDetail {garmentAvalComponentItem.CuttingInDetailId} not found");
                    }
                    else
                    {
                        cuttingInDetail.SetRemainingQuantity(cuttingInDetail.RemainingQuantity - garmentAvalComponentItem.Quantity);
                        cuttingInDetail.Modify();
                        await _garmentCuttingInDetailRepository.Update(cuttingInDetail);
                    }
                }
                else if (garmentAvalComponent.AvalComponentType == "SEWING")
                {
                    //if (item.IsDifferentSize)
                    //{
                    //    var sewingOutDetail = _garmentSewingOutDetailRepository.Find(f => f.Identity == garmentAvalComponentItem.SewingOutDetailId).SingleOrDefault();

                    //    if (sewingOutDetail == null)
                    //    {
                    //        throw new Exception($"SewingOutDetail {garmentAvalComponentItem.SewingOutDetailId} not found");
                    //    }
                    //    //else
                    //    //{
                    //    //    sewingOutDetail.Modify();
                    //    //    await _garmentSewingOutDetailRepository.Update(sewingOutDetail);
                    //    //}
                    //}
                    //else
                    //{
                    var sewingOutItem = _garmentSewingOutItemRepository.Find(f => f.Identity == garmentAvalComponentItem.SewingOutItemId).SingleOrDefault();

                    if (sewingOutItem == null)
                    {
                        throw new Exception($"SewingOutItem {garmentAvalComponentItem.SewingOutItemId} not found");
                    }
                    else
                    {
                        sewingOutItem.SetRemainingQuantity(sewingOutItem.RemainingQuantity - garmentAvalComponentItem.Quantity);
                        sewingOutItem.Modify();
                        await _garmentSewingOutItemRepository.Update(sewingOutItem);
                    }
                    //}
                }
            }

            await _garmentAvalComponentRepository.Update(garmentAvalComponent);

            _storage.Save();

            return(garmentAvalComponent);
        }