public CustomPurchaseInvoiceController()
 {
     _contactService                     = new ContactService(new ContactRepository(), new ContactValidator());
     _itemService                        = new ItemService(new ItemRepository(), new ItemValidator());
     _itemTypeService                    = new ItemTypeService(new ItemTypeRepository(), new ItemTypeValidator());
     _uoMService                         = new UoMService(new UoMRepository(), new UoMValidator());
     _warehouseItemService               = new WarehouseItemService(new WarehouseItemRepository(), new WarehouseItemValidator());
     _warehouseService                   = new WarehouseService(new WarehouseRepository(), new WarehouseValidator());
     _stockMutationService               = new StockMutationService(new StockMutationRepository(), new StockMutationValidator());
     _barringService                     = new BarringService(new BarringRepository(), new BarringValidator());
     _priceMutationService               = new PriceMutationService(new PriceMutationRepository(), new PriceMutationValidator());
     _contactGroupService                = new ContactGroupService(new ContactGroupRepository(), new ContactGroupValidator());
     _purchaseOrderDetailService         = new PurchaseOrderDetailService(new PurchaseOrderDetailRepository(), new PurchaseOrderDetailValidator());
     _salesOrderDetailService            = new SalesOrderDetailService(new SalesOrderDetailRepository(), new SalesOrderDetailValidator());
     _stockAdjustmentDetailService       = new StockAdjustmentDetailService(new StockAdjustmentDetailRepository(), new StockAdjustmentDetailValidator());
     _cashBankService                    = new CashBankService(new CashBankRepository(), new CashBankValidator());
     _cashMutationService                = new CashMutationService(new CashMutationRepository(), new CashMutationValidator());
     _customPurchaseInvoiceService       = new CustomPurchaseInvoiceService(new CustomPurchaseInvoiceRepository(), new CustomPurchaseInvoiceValidator());
     _customPurchaseInvoiceDetailService = new CustomPurchaseInvoiceDetailService(new CustomPurchaseInvoiceDetailRepository(), new CustomPurchaseInvoiceDetailValidator());
     _cashSalesReturnService             = new CashSalesReturnService(new CashSalesReturnRepository(), new CashSalesReturnValidator());
     _quantityPricingService             = new QuantityPricingService(new QuantityPricingRepository(), new QuantityPricingValidator());
     _payableService                     = new PayableService(new PayableRepository(), new PayableValidator());
     _paymentVoucherService              = new PaymentVoucherService(new PaymentVoucherRepository(), new PaymentVoucherValidator());
     _paymentVoucherDetailService        = new PaymentVoucherDetailService(new PaymentVoucherDetailRepository(), new PaymentVoucherDetailValidator());
     _receivableService                  = new ReceivableService(new ReceivableRepository(), new ReceivableValidator());
     _accountService                     = new AccountService(new AccountRepository(), new AccountValidator());
     _generalLedgerJournalService        = new GeneralLedgerJournalService(new GeneralLedgerJournalRepository(), new GeneralLedgerJournalValidator());
     _closingService                     = new ClosingService(new ClosingRepository(), new ClosingValidator());
     _validCombService                   = new ValidCombService(new ValidCombRepository(), new ValidCombValidator());
 }
 public StockAdjustmentDetail CreateObject(StockAdjustmentDetail stockAdjustmentDetail, IStockAdjustmentService _stockAdjustmentService,
                                           IItemService _itemService, IWarehouseItemService _warehouseItemService)
 {
     stockAdjustmentDetail.Errors = new Dictionary <String, String>();
     return(stockAdjustmentDetail = _validator.ValidCreateObject(stockAdjustmentDetail, this, _stockAdjustmentService, _itemService, _warehouseItemService) ?
                                    _repository.CreateObject(stockAdjustmentDetail) : stockAdjustmentDetail);
 }
Ejemplo n.º 3
0
 public bool ValidConfirmObject(CashSalesInvoice cashSalesInvoice, ICashSalesInvoiceDetailService _cashSalesInvoiceDetailService, ICashSalesInvoiceService _cashSalesInvoiceService,
                                IWarehouseItemService _warehouseItemService, IContactService _contactService, ICashBankService _cashBankService, IClosingService _closingService)
 {
     cashSalesInvoice.Errors.Clear();
     VConfirmObject(cashSalesInvoice, _cashSalesInvoiceDetailService, _cashSalesInvoiceService, _warehouseItemService, _contactService, _cashBankService, _closingService);
     return(isValid(cashSalesInvoice));
 }
Ejemplo n.º 4
0
        public RecoveryOrder VQuantityIsInStock(RecoveryOrder recoveryOrder, ICoreIdentificationDetailService _coreIdentificationDetailService,
                                                IRecoveryOrderDetailService _recoveryOrderDetailService, ICoreBuilderService _coreBuilderService, IItemService _itemService,
                                                IWarehouseItemService _warehouseItemService)
        {
            IList <RecoveryOrderDetail> details = _recoveryOrderDetailService.GetObjectsByRecoveryOrderId(recoveryOrder.Id);
            IDictionary <int, int>      ValuePairItemIdQuantity = new Dictionary <int, int>();

            foreach (var detail in details)
            {
                CoreIdentificationDetail coreIdentificationDetail = _coreIdentificationDetailService.GetObjectById(detail.CoreIdentificationDetailId);
                CoreBuilder coreBuilder = _coreBuilderService.GetObjectById(coreIdentificationDetail.CoreBuilderId);
                Item        item        = (coreIdentificationDetail.MaterialCase == Core.Constants.Constant.MaterialCase.New) ?
                                          _coreBuilderService.GetNewCore(coreBuilder.Id) : _coreBuilderService.GetUsedCore(coreBuilder.Id);
                WarehouseItem warehouseItem = _warehouseItemService.FindOrCreateObject(recoveryOrder.WarehouseId, item.Id);
                if (ValuePairItemIdQuantity.ContainsKey(warehouseItem.Id))
                {
                    ValuePairItemIdQuantity[warehouseItem.Id] += 1;
                }
                else
                {
                    ValuePairItemIdQuantity.Add(warehouseItem.Id, 1);
                }
            }

            foreach (var ValuePair in ValuePairItemIdQuantity)
            {
                WarehouseItem warehouseItem = _warehouseItemService.GetObjectById(ValuePair.Key);
                if (warehouseItem.Quantity < ValuePair.Value)
                {
                    recoveryOrder.Errors.Add("Generic", "Stock quantity core item tidak boleh kurang dari jumlah di dalam recovery order");
                    return(recoveryOrder);
                }
            }
            return(recoveryOrder);
        }
Ejemplo n.º 5
0
 public Barring UpdateObject(Barring barring, IBarringService _barringService, IUoMService _uomService, IItemService _itemService, IItemTypeService _itemTypeService,
                             IContactService _contactService, IMachineService _machineService,
                             IWarehouseItemService _warehouseItemService, IWarehouseService _warehouseService)
 {
     return(barring = _validator.ValidUpdateObject(barring, _barringService, _uomService, _itemService, _itemTypeService, _contactService, _machineService) ?
                      _repository.UpdateObject(barring) : barring);
 }
Ejemplo n.º 6
0
 public CashSalesInvoice UnconfirmObject(CashSalesInvoice cashSalesInvoice, ICashSalesInvoiceDetailService _cashSalesInvoiceDetailService,
                                         IReceivableService _receivableService, IReceiptVoucherDetailService _receiptVoucherDetailService,
                                         IWarehouseItemService _warehouseItemService, IWarehouseService _warehouseService, IItemService _itemService,
                                         IBarringService _barringService, IStockMutationService _stockMutationService,
                                         IGeneralLedgerJournalService _generalLedgerJournalService, IAccountService _accountService,
                                         IClosingService _closingService)
 {
     if (_validator.ValidUnconfirmObject(cashSalesInvoice, _cashSalesInvoiceDetailService, _receivableService, _receiptVoucherDetailService,
                                         _closingService))
     {
         IList <CashSalesInvoiceDetail> cashSalesInvoiceDetails = _cashSalesInvoiceDetailService.GetObjectsByCashSalesInvoiceId(cashSalesInvoice.Id);
         foreach (var cashSalesInvoiceDetail in cashSalesInvoiceDetails)
         {
             cashSalesInvoiceDetail.Errors = new Dictionary <string, string>();
             _cashSalesInvoiceDetailService.UnconfirmObject(cashSalesInvoiceDetail, _warehouseItemService, _warehouseService, _itemService, _barringService, _stockMutationService);
         }
         Receivable receivable = _receivableService.GetObjectBySource(Core.Constants.Constant.ReceivableSource.CashSalesInvoice, cashSalesInvoice.Id);
         _receivableService.SoftDeleteObject(receivable);
         _generalLedgerJournalService.CreateUnconfirmationJournalForCashSalesInvoice(cashSalesInvoice, _accountService);
         cashSalesInvoice.CoGS     = 0;
         cashSalesInvoice.Total    = 0;
         cashSalesInvoice.Discount = 0;
         cashSalesInvoice.Tax      = 0;
         cashSalesInvoice          = _repository.UnconfirmObject(cashSalesInvoice);
     }
     return(cashSalesInvoice);
 }
Ejemplo n.º 7
0
 public WarehouseMutationOrderDetail CreateObject(WarehouseMutationOrderDetail warehouseMutationOrderDetail, IWarehouseMutationOrderService _warehouseMutationOrderService,
                                                  IItemService _itemService, IWarehouseItemService _warehouseItemService)
 {
     warehouseMutationOrderDetail.Errors = new Dictionary <String, String>();
     return(warehouseMutationOrderDetail = _validator.ValidCreateObject(warehouseMutationOrderDetail, _warehouseMutationOrderService, this, _itemService, _warehouseItemService) ?
                                           _repository.CreateObject(warehouseMutationOrderDetail) : warehouseMutationOrderDetail);
 }
Ejemplo n.º 8
0
        public BarringOrder VQuantityIsInStock(BarringOrder barringOrder, IBarringOrderDetailService _barringOrderDetailService, IBarringService _barringService,
                                               IItemService _itemService, IWarehouseItemService _warehouseItemService)
        {
            IList <BarringOrderDetail> details = _barringOrderDetailService.GetObjectsByBarringOrderId(barringOrder.Id);

            // itemId contains Id of the blanket, leftbar, and rightbar
            IDictionary <int, int> ValuePairItemIdQuantity = new Dictionary <int, int>();

            foreach (var detail in details)
            {
                Barring barring = _barringService.GetObjectById(detail.BarringId);
                // blanket
                if (ValuePairItemIdQuantity.ContainsKey(barring.BlanketItemId))
                {
                    ValuePairItemIdQuantity[barring.BlanketItemId] += 1;
                }
                else
                {
                    ValuePairItemIdQuantity.Add(barring.BlanketItemId, 1);
                }

                // leftbar
                if (barring.LeftBarItemId != null)
                {
                    if (ValuePairItemIdQuantity.ContainsKey((int)barring.LeftBarItemId))
                    {
                        ValuePairItemIdQuantity[(int)barring.LeftBarItemId] += 1;
                    }
                    else
                    {
                        ValuePairItemIdQuantity.Add((int)barring.LeftBarItemId, 1);
                    }
                }

                // rightbar
                if (barring.RightBarItemId != null)
                {
                    if (ValuePairItemIdQuantity.ContainsKey((int)barring.RightBarItemId))
                    {
                        ValuePairItemIdQuantity[(int)barring.RightBarItemId] += 1;
                    }
                    else
                    {
                        ValuePairItemIdQuantity.Add((int)barring.RightBarItemId, 1);
                    }
                }
            }

            foreach (var ValuePair in ValuePairItemIdQuantity)
            {
                WarehouseItem warehouseItem = _warehouseItemService.FindOrCreateObject(barringOrder.WarehouseId, ValuePair.Key);
                if (warehouseItem.Quantity < ValuePair.Value)
                {
                    barringOrder.Errors.Add("Generic", "Stock quantity BoM untuk barring tidak boleh kurang dari jumlah di dalam barring order");
                    return(barringOrder);
                }
            }
            return(barringOrder);
        }
 public bool ValidConfirmObject(DeliveryOrderDetail deliveryOrderDetail, IDeliveryOrderService _deliveryOrderService,
                                IDeliveryOrderDetailService _deliveryOrderDetailService, ISalesOrderDetailService _salesOrderDetailService,
                                IItemService _itemService, IWarehouseItemService _warehouseItemService)
 {
     deliveryOrderDetail.Errors.Clear();
     VConfirmObject(deliveryOrderDetail, _deliveryOrderService, _deliveryOrderDetailService, _salesOrderDetailService, _itemService, _warehouseItemService);
     return(isValid(deliveryOrderDetail));
 }
Ejemplo n.º 10
0
 public MstWarehouseController()
 {
     _warehouseService          = new WarehouseService(new WarehouseRepository(), new WarehouseValidator());
     _warehouseItemService      = new WarehouseItemService(new WarehouseItemRepository(), new WarehouseItemValidator());
     _coreIdentificationService = new CoreIdentificationService(new CoreIdentificationRepository(), new CoreIdentificationValidator());
     _barringOrderService       = new BarringOrderService(new BarringOrderRepository(), new BarringOrderValidator());
     _itemService = new ItemService(new ItemRepository(), new ItemValidator());
 }
Ejemplo n.º 11
0
 public WarehouseItemController()
 {
     _warehouseItemService = new WarehouseItemService(new WarehouseItemRepository(), new WarehouseItemValidator());
     _warehouseService     = new WarehouseService(new WarehouseRepository(), new WarehouseValidator());
     _itemService          = new ItemService(new ItemRepository(), new ItemValidator());
     _itemTypeService      = new ItemTypeService(new ItemTypeRepository(), new ItemTypeValidator());
     _uoMService           = new UoMService(new UoMRepository(), new UoMValidator());
 }
Ejemplo n.º 12
0
 public StockMutationController()
 {
     _itemService          = new ItemService(new ItemRepository(), new ItemValidator());
     _warehouseItemService = new WarehouseItemService(new WarehouseItemRepository(), new WarehouseItemValidator());
     _warehouseService     = new WarehouseService(new WarehouseRepository(), new WarehouseValidator());
     _stockMutationService = new StockMutationService(new StockMutationRepository(), new StockMutationValidator());
     _barringService       = new BarringService(new BarringRepository(), new BarringValidator());
     _uomService           = new UoMService(new UoMRepository(), new UoMValidator());
 }
 public WarehouseMutationOrderController()
 {
     _warehouseService                    = new WarehouseService(new WarehouseRepository(), new WarehouseValidator());
     _itemService                         = new ItemService(new ItemRepository(), new ItemValidator());
     _warehouseItemService                = new WarehouseItemService(new WarehouseItemRepository(), new WarehouseItemValidator());
     _stockMutationService                = new StockMutationService(new StockMutationRepository(), new StockMutationValidator());
     _barringService                      = new BarringService(new BarringRepository(), new BarringValidator());
     _warehouseMutationOrderService       = new WarehouseMutationOrderService(new WarehouseMutationOrderRepository(), new WarehouseMutationOrderValidator());
     _warehouseMutationOrderDetailService = new WarehouseMutationOrderDetailService(new WarehouseMutationOrderDetailRepository(), new WarehouseMutationOrderDetailValidator());
 }
 public StockAdjustmentController()
 {
     _stockAdjustmentService       = new StockAdjustmentService(new StockAdjustmentRepository(), new StockAdjustmentValidator());
     _stockAdjustmentDetailService = new StockAdjustmentDetailService(new StockAdjustmentDetailRepository(), new StockAdjustmentDetailValidator());
     _warehouseService             = new WarehouseService(new WarehouseRepository(), new WarehouseValidator());
     _itemService          = new ItemService(new ItemRepository(), new ItemValidator());
     _warehouseItemService = new WarehouseItemService(new WarehouseItemRepository(), new WarehouseItemValidator());
     _stockMutationService = new StockMutationService(new StockMutationRepository(), new StockMutationValidator());
     _barringService       = new BarringService(new BarringRepository(), new BarringValidator());
 }
Ejemplo n.º 15
0
 public Warehouse CreateObject(Warehouse warehouse, IWarehouseItemService _warehouseItemService, IItemService _itemService)
 {
     warehouse.Errors = new Dictionary <String, String>();
     if (_validator.ValidCreateObject(warehouse, this))
     {
         warehouse = _repository.CreateObject(warehouse);
         // warehouse item will be created upon calling WarehouseItemService.FindOrCreateObject()
     }
     return(warehouse);
 }
Ejemplo n.º 16
0
 public BarringOrder ConfirmObject(BarringOrder barringOrder, DateTime ConfirmationDate, IBarringOrderDetailService _barringOrderDetailService, IBarringService _barringService,
                                   IItemService _itemService, IWarehouseItemService _warehouseItemService)
 {
     barringOrder.ConfirmationDate = ConfirmationDate;
     if (_validator.ValidConfirmObject(barringOrder, _barringOrderDetailService, _barringService, _itemService, _warehouseItemService))
     {
         _repository.ConfirmObject(barringOrder);
     }
     return(barringOrder);
 }
Ejemplo n.º 17
0
 public CoreIdentification UnconfirmObject(CoreIdentification coreIdentification, ICoreIdentificationDetailService _coreIdentificationDetailService, IStockMutationService _stockMutationService,
                                           IRecoveryOrderService _recoveryOrderService, ICoreBuilderService _coreBuilderService, IItemService _itemService,
                                           IWarehouseItemService _warehouseItemService, IBarringService _barringService)
 {
     if (_validator.ValidUnconfirmObject(coreIdentification, _recoveryOrderService))
     {
         _repository.UnconfirmObject(coreIdentification);
     }
     return(coreIdentification);
 }
Ejemplo n.º 18
0
        public StockMutation VHasWarehouseItem(StockMutation stockMutation, IWarehouseItemService _warehouseItemService)
        {
            WarehouseItem warehouseItem = _warehouseItemService.GetObjectById((int)stockMutation.WarehouseItemId.GetValueOrDefault());

            if (warehouseItem == null)
            {
                stockMutation.Errors.Add("Generic", "Tidak terasosiasi dengan item di warehouse");
            }
            return(stockMutation);
        }
Ejemplo n.º 19
0
 public WarehouseService(IRepository <Warehouse> warehouseRepository,
                         IMapper mapper,
                         IWarehouseItemService warehouseItemService,
                         IProductService productService)
 {
     _warehouseRepository = warehouseRepository;
     _mapper = mapper;
     _warehouseItemService = warehouseItemService;
     _productService       = productService;
 }
Ejemplo n.º 20
0
        public StockMutation VHasWarehouseItem(StockMutation stockMutation, IWarehouseItemService _warehouseItemService)
        {
            WarehouseItem warehouseItem = _warehouseItemService.GetObjectById(stockMutation.WarehouseItemId);

            if (warehouseItem == null)
            {
                stockMutation.Errors.Add("WarehouseItemId", "Tidak terasosiasi dengan item di warehouse");
            }
            return(stockMutation);
        }
Ejemplo n.º 21
0
 public CoreIdentification ConfirmObject(CoreIdentification coreIdentification, DateTime ConfirmationDate, ICoreIdentificationDetailService _coreIdentificationDetailService, IStockMutationService _stockMutationService,
                                         IRecoveryOrderService _recoveryOrderService, IRecoveryOrderDetailService _recoveryOrderDetailService, ICoreBuilderService _coreBuilderService,
                                         IItemService _itemService, IWarehouseItemService _warehouseItemService, IBarringService _barringService)
 {
     coreIdentification.ConfirmationDate = ConfirmationDate;
     if (_validator.ValidConfirmObject(coreIdentification, _coreIdentificationDetailService, _coreBuilderService, _itemService, _warehouseItemService))
     {
         _repository.ConfirmObject(coreIdentification);
     }
     return(coreIdentification);
 }
Ejemplo n.º 22
0
 public Barring CreateObject(Barring barring, IBarringService _barringService, IUoMService _uomService, IItemService _itemService, IItemTypeService _itemTypeService,
                             IContactService _contactService, IMachineService _machineService,
                             IWarehouseItemService _warehouseItemService, IWarehouseService _warehouseService)
 {
     barring.Errors = new Dictionary <String, String>();
     if (_validator.ValidCreateObject(barring, _barringService, _uomService, _itemService, _itemTypeService, _contactService, _machineService))
     {
         barring = _repository.CreateObject(barring);
     }
     return(barring);
 }
Ejemplo n.º 23
0
 public MstBarringController()
 {
     _itemTypeService      = new ItemTypeService(new ItemTypeRepository(), new ItemTypeValidator());
     _warehouseItemService = new WarehouseItemService(new WarehouseItemRepository(), new WarehouseItemValidator());
     _itemService          = new ItemService(new ItemRepository(), new ItemValidator());
     _uomService           = new UoMService(new UoMRepository(), new UoMValidator());
     _warehouseService     = new WarehouseService(new WarehouseRepository(), new WarehouseValidator());
     _machineService       = new MachineService(new MachineRepository(), new MachineValidator());
     _barringService       = new BarringService(new BarringRepository(), new BarringValidator());
     _contactService       = new ContactService(new ContactRepository(), new ContactValidator());
 }
Ejemplo n.º 24
0
 public PurchaseOrderController()
 {
     _itemService                   = new ItemService(new ItemRepository(), new ItemValidator());
     _warehouseItemService          = new WarehouseItemService(new WarehouseItemRepository(), new WarehouseItemValidator());
     _stockMutationService          = new StockMutationService(new StockMutationRepository(), new StockMutationValidator());
     _barringService                = new BarringService(new BarringRepository(), new BarringValidator());
     _purchaseOrderService          = new PurchaseOrderService(new PurchaseOrderRepository(), new PurchaseOrderValidator());
     _purchaseOrderDetailService    = new PurchaseOrderDetailService(new PurchaseOrderDetailRepository(), new PurchaseOrderDetailValidator());
     _contactService                = new ContactService(new ContactRepository(), new ContactValidator());
     _purchaseReceivalService       = new PurchaseReceivalService(new PurchaseReceivalRepository(), new PurchaseReceivalValidator());
     _purchaseReceivalDetailService = new PurchaseReceivalDetailService(new PurchaseReceivalDetailRepository(), new PurchaseReceivalDetailValidator());
 }
Ejemplo n.º 25
0
 public SalesOrderController()
 {
     _itemService                = new ItemService(new ItemRepository(), new ItemValidator());
     _warehouseItemService       = new WarehouseItemService(new WarehouseItemRepository(), new WarehouseItemValidator());
     _stockMutationService       = new StockMutationService(new StockMutationRepository(), new StockMutationValidator());
     _barringService             = new BarringService(new BarringRepository(), new BarringValidator());
     _contactService             = new ContactService(new ContactRepository(), new ContactValidator());
     _salesOrderService          = new SalesOrderService(new SalesOrderRepository(), new SalesOrderValidator());
     _salesOrderDetailService    = new SalesOrderDetailService(new SalesOrderDetailRepository(), new SalesOrderDetailValidator());
     _deliveryOrderService       = new DeliveryOrderService(new DeliveryOrderRepository(), new DeliveryOrderValidator());
     _deliveryOrderDetailService = new DeliveryOrderDetailService(new DeliveryOrderDetailRepository(), new DeliveryOrderDetailValidator());
 }
Ejemplo n.º 26
0
 public MstRollerBuilderController()
 {
     _coreBuilderService         = new CoreBuilderService(new CoreBuilderRepository(), new CoreBuilderValidator());
     _itemTypeService            = new ItemTypeService(new ItemTypeRepository(), new ItemTypeValidator());
     _rollerBuilderService       = new RollerBuilderService(new RollerBuilderRepository(), new RollerBuilderValidator());
     _recoveryOrderDetailService = new RecoveryOrderDetailService(new RecoveryOrderDetailRepository(), new RecoveryOrderDetailValidator());
     _warehouseItemService       = new WarehouseItemService(new WarehouseItemRepository(), new WarehouseItemValidator());
     _stockMutationService       = new StockMutationService(new StockMutationRepository(), new StockMutationValidator());
     _itemService       = new ItemService(new ItemRepository(), new ItemValidator());
     _uomService        = new UoMService(new UoMRepository(), new UoMValidator());
     _warehouseService  = new WarehouseService(new WarehouseRepository(), new WarehouseValidator());
     _machineService    = new MachineService(new MachineRepository(), new MachineValidator());
     _rollerTypeService = new RollerTypeService(new RollerTypeRepository(), new RollerTypeValidator());
 }
Ejemplo n.º 27
0
        public Warehouse VWarehouseQuantityMustBeZero(Warehouse warehouse, IWarehouseItemService _warehouseItemService)
        {
            IList <WarehouseItem> warehouseItems = _warehouseItemService.GetObjectsByWarehouseId(warehouse.Id);

            foreach (var warehouseItem in warehouseItems)
            {
                if (warehouseItem.Quantity > 0)
                {
                    warehouse.Errors.Add("Generic", "Item quantity di dalam warehouse harus 0");
                    return(warehouse);
                }
            }
            return(warehouse);
        }
Ejemplo n.º 28
0
        public Item VWarehouseQuantityMustBeZero(Item item, IWarehouseItemService _warehouseItemService)
        {
            IList <WarehouseItem> warehouseitems = _warehouseItemService.GetObjectsByItemId(item.Id);

            foreach (var warehouseitem in warehouseitems)
            {
                if (warehouseitem.Quantity > 0)
                {
                    item.Errors.Add("Generic", "quantity di semua warehouse harus 0");
                    return(item);
                }
            }
            return(item);
        }
Ejemplo n.º 29
0
 public StockAdjustmentController()
 {
     _stockAdjustmentService       = new StockAdjustmentService(new StockAdjustmentRepository(), new StockAdjustmentValidator());
     _stockAdjustmentDetailService = new StockAdjustmentDetailService(new StockAdjustmentDetailRepository(), new StockAdjustmentDetailValidator());
     _warehouseService             = new WarehouseService(new WarehouseRepository(), new WarehouseValidator());
     _itemService                 = new ItemService(new ItemRepository(), new ItemValidator());
     _warehouseItemService        = new WarehouseItemService(new WarehouseItemRepository(), new WarehouseItemValidator());
     _stockMutationService        = new StockMutationService(new StockMutationRepository(), new StockMutationValidator());
     _barringService              = new BarringService(new BarringRepository(), new BarringValidator());
     _accountService              = new AccountService(new AccountRepository(), new AccountValidator());
     _generalLedgerJournalService = new GeneralLedgerJournalService(new GeneralLedgerJournalRepository(), new GeneralLedgerJournalValidator());
     _closingService              = new ClosingService(new ClosingRepository(), new ClosingValidator());
     _validCombService            = new ValidCombService(new ValidCombRepository(), new ValidCombValidator());
 }
Ejemplo n.º 30
0
        public Barring VWarehouseQuantityMustBeZero(Barring barring, IWarehouseItemService _warehouseItemService)
        {
            IList <WarehouseItem> warehouseItems = _warehouseItemService.GetObjectsByItemId(barring.Id);

            foreach (var warehouseitem in warehouseItems)
            {
                if (warehouseitem.Quantity > 0)
                {
                    barring.Errors.Add("Generic", "Quantity di setiap warehouse harus 0");
                    return(barring);
                }
            }
            return(barring);
        }