public ReceivingController()
 {
     service = IoC.Resolve<IReceivingService>("ReceivingService");
     poService = IoC.Resolve<IPurchaseOrderService>("PurchaseOrderService");
     itemService = IoC.Resolve<IItemService>("ItemService");
     lotService = IoC.Resolve<ILotNumberService>("LotNumberService");
 }
 public PurchaseOrderController(IPurchaseOrderService purchaseOrderService,IVendorService vendorService, IContactService contactService,IUserService userService, IGroupService groupService)
 {
     this.purchaseOrderService = purchaseOrderService;
     this.vendorService = vendorService;
     this.contactService = contactService;
     this.groupService = groupService;
     this.userService = userService;
 }
        public Init3006Controller(IPurchaseOrderService purchaseOrderService, IPurchaseInvoiceService purchaseInvoiceService, IGoodsReceiptService goodsReceiptService, IPurchaseOrderRepository purchaseOrderRepository, ICommodityRepository commodityRepository, IVehicleTransferOrderService transferOrderService)
            : base(purchaseOrderService)
        {
            this.purchaseOrderService = purchaseOrderService;
            this.purchaseInvoiceService = purchaseInvoiceService;
            this.goodsReceiptService = goodsReceiptService;

            this.purchaseOrderRepository = purchaseOrderRepository;
            this.commodityRepository = commodityRepository;

            this.transferOrderService = transferOrderService;
        }
 public PurchaseReceival UnconfirmObject(PurchaseReceival purchaseReceival, IPurchaseReceivalDetailService _purchaseReceivalDetailService,
                                         IPurchaseInvoiceService _purchaseInvoiceService, IPurchaseInvoiceDetailService _purchaseInvoiceDetailService,
                                         IPurchaseOrderService _purchaseOrderService, IPurchaseOrderDetailService _purchaseOrderDetailService,
                                         IStockMutationService _stockMutationService, IItemService _itemService,
                                         IBarringService _barringService, IWarehouseItemService _warehouseItemService)
 {
     if (_validator.ValidUnconfirmObject(purchaseReceival, _purchaseInvoiceService))
     {
         IList <PurchaseReceivalDetail> purchaseReceivalDetails = _purchaseReceivalDetailService.GetObjectsByPurchaseReceivalId(purchaseReceival.Id);
         foreach (var detail in purchaseReceivalDetails)
         {
             detail.Errors = new Dictionary <string, string>();
             _purchaseReceivalDetailService.UnconfirmObject(detail, this, _purchaseOrderService, _purchaseOrderDetailService,
                                                            _purchaseInvoiceDetailService, _stockMutationService, _itemService,
                                                            _barringService, _warehouseItemService);
         }
         _repository.UnconfirmObject(purchaseReceival);
         PurchaseOrder purchaseOrder = _purchaseOrderService.GetObjectById(purchaseReceival.PurchaseOrderId);
         _purchaseOrderService.UnsetReceivalComplete(purchaseOrder);
     }
     return(purchaseReceival);
 }
Exemple #5
0
 public PurchaseReceivalDetail UnconfirmObject(PurchaseReceivalDetail purchaseReceivalDetail, IPurchaseReceivalService _purchaseReceivalService,
                                               IPurchaseOrderService _purchaseOrderService, IPurchaseOrderDetailService _purchaseOrderDetailService,
                                               IPurchaseInvoiceDetailService _purchaseInvoiceDetailService, IStockMutationService _stockMutationService,
                                               IItemService _itemService, IBarringService _barringService, IWarehouseItemService _warehouseItemService)
 {
     if (_validator.ValidUnconfirmObject(purchaseReceivalDetail, _purchaseInvoiceDetailService, _itemService))
     {
         purchaseReceivalDetail = _repository.UnconfirmObject(purchaseReceivalDetail);
         PurchaseReceival      purchaseReceival = _purchaseReceivalService.GetObjectById(purchaseReceivalDetail.PurchaseReceivalId);
         WarehouseItem         warehouseItem    = _warehouseItemService.FindOrCreateObject(purchaseReceival.WarehouseId, purchaseReceivalDetail.ItemId);
         Item                  item             = _itemService.GetObjectById(purchaseReceivalDetail.ItemId);
         IList <StockMutation> stockMutations   = _stockMutationService.SoftDeleteStockMutationForPurchaseReceival(purchaseReceivalDetail, warehouseItem);
         foreach (var stockMutation in stockMutations)
         {
             decimal itemPrice = _purchaseOrderDetailService.GetObjectById(purchaseReceivalDetail.PurchaseOrderDetailId).Price;
             item.AvgPrice = _itemService.CalculateAndUpdateAvgPrice(item, purchaseReceivalDetail.Quantity * (-1), itemPrice);
             _stockMutationService.ReverseStockMutateObject(stockMutation, _itemService, _barringService, _warehouseItemService);
         }
         PurchaseOrderDetail purchaseOrderDetail = _purchaseOrderDetailService.GetObjectById(purchaseReceivalDetail.PurchaseOrderDetailId);
         _purchaseOrderDetailService.UnsetReceivalComplete(purchaseOrderDetail, purchaseReceivalDetail.Quantity, _purchaseOrderService);
     }
     return(purchaseReceivalDetail);
 }
Exemple #6
0
 public ExpenseService(IDapperRepositoryBase <ExpenseAccount, CrmDBContext> expenseAccountRepository
                       , IDapperRepositoryBase <ExpenseLineConfirmHistory, CrmDBContext> expenseHistoryRepository
                       , IMapper mapper
                       , CrmDBContext crmDbContext
                       , IUnitOfWorkFactory <CrmDBContext> uowCrm
                       , IPurchaseOrderService purchaseOrderService
                       , IDapperRepositoryBase <BusinessRedirectSplitInfoVersion, CrmDBContext> businessRedirectSplitRepository
                       , IDapperRepositoryBase <DepartMentVersion, CrmDBContext> departRepository
                       , IDapperRepositoryBase <v_AchievementBusinessDepartMappingVersion, CrmDBContext> achMappingRepository
                       , IDapperRepositoryBase <FixedAssetsDepreciationHistory, CrmDBContext> fixedAssetsDepreciationRepository
                       )
 {
     _expenseAccountRepository = expenseAccountRepository;
     _expenseHistoryRepository = expenseHistoryRepository;
     _mapper       = mapper;
     _crmDbContext = crmDbContext;
     _uowCrm       = uowCrm;
     _businessRedirectSplitRepository = businessRedirectSplitRepository;
     _purchaseOrderService            = purchaseOrderService;
     _departRepository     = departRepository;
     _achMappingRepository = achMappingRepository;
     _fixedAssetsDepreciationRepository = fixedAssetsDepreciationRepository;
 }
 public PurchaseRequestController(IRepository <PurchaseRequest> purchaseRequestRepository,
                                  IRepository <PurchaseRequestItem> purchaseRequestItemRepository,
                                  IRepository <RequestForQuotation> requestForQuotationRepository,
                                  IRepository <PurchaseOrder> purchaseOrderRepository,
                                  IRepository <Assignment> assignmentRepository,
                                  IRepository <AssignmentHistory> assignmentHistoryRepository,
                                  IPurchaseRequestService purchaseRequestService,
                                  IRequestForQuotationService requestForQuotationService,
                                  IPurchaseOrderService purchaseOrderService,
                                  IItemService itemService,
                                  IAutoNumberService autoNumberService,
                                  IDateTimeHelper dateTimeHelper,
                                  ILocalizationService localizationService,
                                  IPermissionService permissionService,
                                  HttpContextBase httpContext,
                                  IWorkContext workContext,
                                  IDbContext dbContext)
 {
     this._purchaseRequestRepository     = purchaseRequestRepository;
     this._purchaseRequestItemRepository = purchaseRequestItemRepository;
     this._requestForQuotationRepository = requestForQuotationRepository;
     this._purchaseOrderRepository       = purchaseOrderRepository;
     this._assignmentRepository          = assignmentRepository;
     this._assignmentHistoryRepository   = assignmentHistoryRepository;
     this._localizationService           = localizationService;
     this._purchaseRequestService        = purchaseRequestService;
     this._requestForQuotationService    = requestForQuotationService;
     this._purchaseOrderService          = purchaseOrderService;
     this._itemService       = itemService;
     this._autoNumberService = autoNumberService;
     this._dateTimeHelper    = dateTimeHelper;
     this._permissionService = permissionService;
     this._httpContext       = httpContext;
     this._workContext       = workContext;
     this._dbContext         = dbContext;
 }
Exemple #8
0
 public InsertPOCommandHandler(IPurchaseOrderService purchaseOrderService)
 {
     _purchaseOrderService = purchaseOrderService;
 }
Exemple #9
0
 public PurchaseOrderScreen(IPurchaseOrderService purchaseOrderService, ITerminal terminal)
 {
     this.terminal             = terminal;
     this.purchaseOrderService = purchaseOrderService;
 }
        public PurchaseInvoice ConfirmObject(PurchaseInvoice purchaseInvoice, DateTime ConfirmationDate, IPurchaseInvoiceDetailService _purchaseInvoiceDetailService, IPurchaseOrderService _purchaseOrderService,
                                             IPurchaseReceivalService _purchaseReceivalService, IPurchaseReceivalDetailService _purchaseReceivalDetailService, IPayableService _payableService)
        {
            purchaseInvoice.ConfirmationDate = ConfirmationDate;
            if (_validator.ValidConfirmObject(purchaseInvoice, _purchaseInvoiceDetailService, _purchaseReceivalService, _purchaseReceivalDetailService))
            {
                // confirm details
                // add all amount into amountpayable
                IList <PurchaseInvoiceDetail> details = _purchaseInvoiceDetailService.GetObjectsByPurchaseInvoiceId(purchaseInvoice.Id);
                foreach (var detail in details)
                {
                    detail.Errors = new Dictionary <string, string>();
                    _purchaseInvoiceDetailService.ConfirmObject(detail, ConfirmationDate, _purchaseReceivalDetailService);
                }
                purchaseInvoice = CalculateAmountPayable(purchaseInvoice, _purchaseInvoiceDetailService);

                // confirm object
                // create payable
                purchaseInvoice = _repository.ConfirmObject(purchaseInvoice);
                PurchaseReceival purchaseReceival = _purchaseReceivalService.GetObjectById(purchaseInvoice.PurchaseReceivalId);
                _purchaseReceivalService.CheckAndSetInvoiceComplete(purchaseReceival, _purchaseReceivalDetailService);
                PurchaseOrder purchaseOrder = _purchaseOrderService.GetObjectById(purchaseReceival.PurchaseOrderId);
                Payable       payable       = _payableService.CreateObject(purchaseOrder.ContactId, Constant.PayableSource.PurchaseInvoice, purchaseInvoice.Id, purchaseInvoice.AmountPayable, purchaseInvoice.DueDate);
            }
            return(purchaseInvoice);
        }
Exemple #11
0
 public POController(IUserContext userContext, IPermissionService permissionService, IPurchaseOrderService _POSvc, IStaffService _staffSvc)
     : base(userContext, permissionService)
 {
     this.POSvc    = _POSvc;
     this.staffSvc = _staffSvc;
 }
 public PurchaseOrderController()
 {
     service = IoC.Resolve<IPurchaseOrderService>("PurchaseOrderService");
     buyerService = IoC.Resolve<IBuyerService>("BuyerService");
     vendorService = IoC.Resolve<IVendorService>("VendorService");
 }
Exemple #13
0
 public bool ValidCreateObject(PurchaseOrderDetail purchaseOrderDetail, IPurchaseOrderDetailService _purchaseOrderDetails, IPurchaseOrderService _purchaseOrderService, IItemService _itemService)
 {
     VCreateObject(purchaseOrderDetail, _purchaseOrderDetails, _purchaseOrderService, _itemService);
     return(isValid(purchaseOrderDetail));
 }
Exemple #14
0
 public PurchaseOrderApiAsyncController(IPurchaseOrderService purchaseOrderService)
 {
     _purchaseOrderService = purchaseOrderService;
 }
 public InsertPOWithFarmerOrderCommandHandler(IPurchaseOrderService purchaseOrderService, IPurchaseOrderQueries purchaseOrderQueries)
 {
     _purchaseOrderService = purchaseOrderService;
     _purchaseOrderQueries = purchaseOrderQueries;
 }
 public PurchaseOrdersController(IPurchaseOrderService <TDto, TPrimitiveDto, TDtoDetail> purchaseOrderService, IPurchaseOrderViewModelSelectListBuilder <TViewDetailViewModel> purchaseOrderViewModelSelectListBuilder)
     : base(purchaseOrderService, purchaseOrderViewModelSelectListBuilder)
 {
 }
 public HomeController(IPurchaseOrderService poService)
 {
     _poService = poService;
 }
Exemple #18
0
 public SapPurchaseOrder(IPurchaseOrderService purchaseOrderService) : base()
 {
     _purchaseOrderService = purchaseOrderService;
 }
Exemple #19
0
        public PurchaseBuilder()
        {
            _accountService                  = new AccountService(new AccountRepository(), new AccountValidator());
            _barringService                  = new BarringService(new BarringRepository(), new BarringValidator());
            _barringOrderService             = new BarringOrderService(new BarringOrderRepository(), new BarringOrderValidator());
            _barringOrderDetailService       = new BarringOrderDetailService(new BarringOrderDetailRepository(), new BarringOrderDetailValidator());
            _cashBankAdjustmentService       = new CashBankAdjustmentService(new CashBankAdjustmentRepository(), new CashBankAdjustmentValidator());
            _cashBankMutationService         = new CashBankMutationService(new CashBankMutationRepository(), new CashBankMutationValidator());
            _cashBankService                 = new CashBankService(new CashBankRepository(), new CashBankValidator());
            _cashMutationService             = new CashMutationService(new CashMutationRepository(), new CashMutationValidator());
            _closingService                  = new ClosingService(new ClosingRepository(), new ClosingValidator());
            _coreBuilderService              = new CoreBuilderService(new CoreBuilderRepository(), new CoreBuilderValidator());
            _coreIdentificationDetailService = new CoreIdentificationDetailService(new CoreIdentificationDetailRepository(), new CoreIdentificationDetailValidator());
            _coreIdentificationService       = new CoreIdentificationService(new CoreIdentificationRepository(), new CoreIdentificationValidator());
            _contactService                  = new ContactService(new ContactRepository(), new ContactValidator());
            _deliveryOrderService            = new DeliveryOrderService(new DeliveryOrderRepository(), new DeliveryOrderValidator());
            _deliveryOrderDetailService      = new DeliveryOrderDetailService(new DeliveryOrderDetailRepository(), new DeliveryOrderDetailValidator());
            _generalLedgerJournalService     = new GeneralLedgerJournalService(new GeneralLedgerJournalRepository(), new GeneralLedgerJournalValidator());
            _itemService                          = new ItemService(new ItemRepository(), new ItemValidator());
            _itemTypeService                      = new ItemTypeService(new ItemTypeRepository(), new ItemTypeValidator());
            _machineService                       = new MachineService(new MachineRepository(), new MachineValidator());
            _payableService                       = new PayableService(new PayableRepository(), new PayableValidator());
            _paymentVoucherDetailService          = new PaymentVoucherDetailService(new PaymentVoucherDetailRepository(), new PaymentVoucherDetailValidator());
            _paymentVoucherService                = new PaymentVoucherService(new PaymentVoucherRepository(), new PaymentVoucherValidator());
            _purchaseInvoiceDetailService         = new PurchaseInvoiceDetailService(new PurchaseInvoiceDetailRepository(), new PurchaseInvoiceDetailValidator());
            _purchaseInvoiceService               = new PurchaseInvoiceService(new PurchaseInvoiceRepository(), new PurchaseInvoiceValidator());
            _purchaseOrderService                 = new PurchaseOrderService(new PurchaseOrderRepository(), new PurchaseOrderValidator());
            _purchaseOrderDetailService           = new PurchaseOrderDetailService(new PurchaseOrderDetailRepository(), new PurchaseOrderDetailValidator());
            _purchaseReceivalService              = new PurchaseReceivalService(new PurchaseReceivalRepository(), new PurchaseReceivalValidator());
            _purchaseReceivalDetailService        = new PurchaseReceivalDetailService(new PurchaseReceivalDetailRepository(), new PurchaseReceivalDetailValidator());
            _receivableService                    = new ReceivableService(new ReceivableRepository(), new ReceivableValidator());
            _receiptVoucherDetailService          = new ReceiptVoucherDetailService(new ReceiptVoucherDetailRepository(), new ReceiptVoucherDetailValidator());
            _receiptVoucherService                = new ReceiptVoucherService(new ReceiptVoucherRepository(), new ReceiptVoucherValidator());
            _recoveryOrderDetailService           = new RecoveryOrderDetailService(new RecoveryOrderDetailRepository(), new RecoveryOrderDetailValidator());
            _recoveryOrderService                 = new RecoveryOrderService(new RecoveryOrderRepository(), new RecoveryOrderValidator());
            _recoveryAccessoryDetailService       = new RecoveryAccessoryDetailService(new RecoveryAccessoryDetailRepository(), new RecoveryAccessoryDetailValidator());
            _rollerBuilderService                 = new RollerBuilderService(new RollerBuilderRepository(), new RollerBuilderValidator());
            _rollerTypeService                    = new RollerTypeService(new RollerTypeRepository(), new RollerTypeValidator());
            _rollerWarehouseMutationDetailService = new RollerWarehouseMutationDetailService(new RollerWarehouseMutationDetailRepository(), new RollerWarehouseMutationDetailValidator());
            _rollerWarehouseMutationService       = new RollerWarehouseMutationService(new RollerWarehouseMutationRepository(), new RollerWarehouseMutationValidator());
            _salesInvoiceDetailService            = new SalesInvoiceDetailService(new SalesInvoiceDetailRepository(), new SalesInvoiceDetailValidator());
            _salesInvoiceService                  = new SalesInvoiceService(new SalesInvoiceRepository(), new SalesInvoiceValidator());
            _salesOrderService                    = new SalesOrderService(new SalesOrderRepository(), new SalesOrderValidator());
            _salesOrderDetailService              = new SalesOrderDetailService(new SalesOrderDetailRepository(), new SalesOrderDetailValidator());
            _stockAdjustmentDetailService         = new StockAdjustmentDetailService(new StockAdjustmentDetailRepository(), new StockAdjustmentDetailValidator());
            _stockAdjustmentService               = new StockAdjustmentService(new StockAdjustmentRepository(), new StockAdjustmentValidator());
            _stockMutationService                 = new StockMutationService(new StockMutationRepository(), new StockMutationValidator());
            _uomService                          = new UoMService(new UoMRepository(), new UoMValidator());
            _validCombService                    = new ValidCombService(new ValidCombRepository(), new ValidCombValidator());
            _warehouseItemService                = new WarehouseItemService(new WarehouseItemRepository(), new WarehouseItemValidator());
            _warehouseService                    = new WarehouseService(new WarehouseRepository(), new WarehouseValidator());
            _warehouseMutationOrderService       = new WarehouseMutationOrderService(new WarehouseMutationOrderRepository(), new WarehouseMutationOrderValidator());
            _warehouseMutationOrderDetailService = new WarehouseMutationOrderDetailService(new WarehouseMutationOrderDetailRepository(), new WarehouseMutationOrderDetailValidator());

            _priceMutationService = new PriceMutationService(new PriceMutationRepository(), new PriceMutationValidator());
            _contactGroupService  = new ContactGroupService(new ContactGroupRepository(), new ContactGroupValidator());

            typeAccessory    = _itemTypeService.CreateObject("Accessory", "Accessory");
            typeBar          = _itemTypeService.CreateObject("Bar", "Bar");
            typeBarring      = _itemTypeService.CreateObject("Barring", "Barring", true);
            typeBearing      = _itemTypeService.CreateObject("Bearing", "Bearing");
            typeBlanket      = _itemTypeService.CreateObject("Blanket", "Blanket");
            typeChemical     = _itemTypeService.CreateObject("Chemical", "Chemical");
            typeCompound     = _itemTypeService.CreateObject("Compound", "Compound");
            typeConsumable   = _itemTypeService.CreateObject("Consumable", "Consumable");
            typeCore         = _itemTypeService.CreateObject("Core", "Core", true);
            typeGlue         = _itemTypeService.CreateObject("Glue", "Glue");
            typeUnderpacking = _itemTypeService.CreateObject("Underpacking", "Underpacking");
            typeRoller       = _itemTypeService.CreateObject("Roller", "Roller", true);

            typeDamp       = _rollerTypeService.CreateObject("Damp", "Damp");
            typeFoundDT    = _rollerTypeService.CreateObject("Found DT", "Found DT");
            typeInkFormX   = _rollerTypeService.CreateObject("Ink Form X", "Ink Form X");
            typeInkDistD   = _rollerTypeService.CreateObject("Ink Dist D", "Ink Dist D");
            typeInkDistM   = _rollerTypeService.CreateObject("Ink Dist M", "Ink Dist M");
            typeInkDistE   = _rollerTypeService.CreateObject("Ink Dist E", "Ink Dist E");
            typeInkDuctB   = _rollerTypeService.CreateObject("Ink Duct B", "Ink Duct B");
            typeInkDistH   = _rollerTypeService.CreateObject("Ink Dist H", "Ink Dist H");
            typeInkFormW   = _rollerTypeService.CreateObject("Ink Form W", "Ink Form W");
            typeInkDistHQ  = _rollerTypeService.CreateObject("Ink Dist HQ", "Ink Dist HQ");
            typeDampFormDQ = _rollerTypeService.CreateObject("Damp Form DQ", "Damp Form DQ");
            typeInkFormY   = _rollerTypeService.CreateObject("Ink Form Y", "Ink Form Y");

            baseGroup = _contactGroupService.CreateObject(Core.Constants.Constant.GroupType.Base, "Base Group", true);

            if (!_accountService.GetLegacyObjects().Any())
            {
                Asset = _accountService.CreateLegacyObject(new Account()
                {
                    Name = "Asset", Code = Constant.AccountCode.Asset, LegacyCode = Constant.AccountLegacyCode.Asset, Level = 1, Group = Constant.AccountGroup.Asset, IsLegacy = true
                }, _accountService);
                CashBank = _accountService.CreateLegacyObject(new Account()
                {
                    Name = "CashBank", Code = Constant.AccountCode.CashBank, LegacyCode = Constant.AccountLegacyCode.CashBank, Level = 2, Group = Constant.AccountGroup.Asset, ParentId = Asset.Id, IsLegacy = true
                }, _accountService);
                AccountReceivable = _accountService.CreateLegacyObject(new Account()
                {
                    Name = "Account Receivable", IsLeaf = true, Code = Constant.AccountCode.AccountReceivable, LegacyCode = Constant.AccountLegacyCode.AccountReceivable, Level = 2, Group = Constant.AccountGroup.Asset, ParentId = Asset.Id, IsLegacy = true
                }, _accountService);
                GBCHReceivable = _accountService.CreateLegacyObject(new Account()
                {
                    Name = "GBCH Receivable", IsLeaf = true, Code = Constant.AccountCode.GBCHReceivable, LegacyCode = Constant.AccountLegacyCode.GBCHReceivable, Level = 2, Group = Constant.AccountGroup.Asset, ParentId = Asset.Id, IsLegacy = true
                }, _accountService);
                Inventory = _accountService.CreateLegacyObject(new Account()
                {
                    Name = "Inventory", IsLeaf = true, Code = Constant.AccountCode.Inventory, LegacyCode = Constant.AccountLegacyCode.Inventory, Level = 2, Group = Constant.AccountGroup.Asset, ParentId = Asset.Id, IsLegacy = true
                }, _accountService);

                Expense = _accountService.CreateLegacyObject(new Account()
                {
                    Name = "Expense", Code = Constant.AccountCode.Expense, LegacyCode = Constant.AccountLegacyCode.Expense, Level = 1, Group = Constant.AccountGroup.Expense, IsLegacy = true
                }, _accountService);
                CashBankAdjustmentExpense = _accountService.CreateLegacyObject(new Account()
                {
                    Name = "CashBank Adjustment Expense", IsLeaf = true, Code = Constant.AccountCode.CashBankAdjustmentExpense, LegacyCode = Constant.AccountLegacyCode.CashBankAdjustmentExpense, Level = 2, Group = Constant.AccountGroup.Expense, ParentId = Expense.Id, IsLegacy = true
                }, _accountService);
                COGS = _accountService.CreateLegacyObject(new Account()
                {
                    Name = "Cost Of Goods Sold", IsLeaf = true, Code = Constant.AccountCode.COGS, LegacyCode = Constant.AccountLegacyCode.COGS, Level = 2, Group = Constant.AccountGroup.Expense, ParentId = Expense.Id, IsLegacy = true
                }, _accountService);
                Discount = _accountService.CreateLegacyObject(new Account()
                {
                    Name = "Discount", IsLeaf = true, Code = Constant.AccountCode.Discount, LegacyCode = Constant.AccountLegacyCode.Discount, Level = 2, Group = Constant.AccountGroup.Expense, ParentId = Expense.Id, IsLegacy = true
                }, _accountService);
                SalesAllowance = _accountService.CreateLegacyObject(new Account()
                {
                    Name = "Sales Allowance", IsLeaf = true, Code = Constant.AccountCode.SalesAllowance, LegacyCode = Constant.AccountLegacyCode.SalesAllowance, Level = 2, Group = Constant.AccountGroup.Expense, ParentId = Expense.Id, IsLegacy = true
                }, _accountService);
                StockAdjustmentExpense = _accountService.CreateLegacyObject(new Account()
                {
                    Name = "Stock Adjustment Expense", IsLeaf = true, Code = Constant.AccountCode.StockAdjustmentExpense, LegacyCode = Constant.AccountLegacyCode.StockAdjustmentExpense, Level = 2, Group = Constant.AccountGroup.Expense, ParentId = Expense.Id, IsLegacy = true
                }, _accountService);

                Liability = _accountService.CreateLegacyObject(new Account()
                {
                    Name = "Liability", Code = Constant.AccountCode.Liability, LegacyCode = Constant.AccountLegacyCode.Liability, Level = 1, Group = Constant.AccountGroup.Liability, IsLegacy = true
                }, _accountService);
                AccountPayable = _accountService.CreateLegacyObject(new Account()
                {
                    Name = "Account Payable", IsLeaf = true, Code = Constant.AccountCode.AccountPayable, LegacyCode = Constant.AccountLegacyCode.AccountPayable, Level = 2, Group = Constant.AccountGroup.Liability, ParentId = Liability.Id, IsLegacy = true
                }, _accountService);
                GBCHPayable = _accountService.CreateLegacyObject(new Account()
                {
                    Name = "GBCH Payable", IsLeaf = true, Code = Constant.AccountCode.GBCHPayable, LegacyCode = Constant.AccountLegacyCode.GBCHPayable, Level = 2, Group = Constant.AccountGroup.Liability, ParentId = Liability.Id, IsLegacy = true
                }, _accountService);
                GoodsPendingClearance = _accountService.CreateLegacyObject(new Account()
                {
                    Name = "Goods Pending Clearance", IsLeaf = true, Code = Constant.AccountCode.GoodsPendingClearance, LegacyCode = Constant.AccountLegacyCode.GoodsPendingClearance, Level = 2, Group = Constant.AccountGroup.Liability, ParentId = Liability.Id, IsLegacy = true
                }, _accountService);

                Equity = _accountService.CreateLegacyObject(new Account()
                {
                    Name = "Equity", Code = Constant.AccountCode.Equity, LegacyCode = Constant.AccountLegacyCode.Equity, Level = 1, Group = Constant.AccountGroup.Equity, IsLegacy = true
                }, _accountService);
                OwnersEquity = _accountService.CreateLegacyObject(new Account()
                {
                    Name = "Owners Equity", Code = Constant.AccountCode.OwnersEquity, LegacyCode = Constant.AccountLegacyCode.OwnersEquity, Level = 2, Group = Constant.AccountGroup.Equity, ParentId = Equity.Id, IsLegacy = true
                }, _accountService);
                EquityAdjustment = _accountService.CreateLegacyObject(new Account()
                {
                    Name = "Equity Adjustment", IsLeaf = true, Code = Constant.AccountCode.EquityAdjustment, LegacyCode = Constant.AccountLegacyCode.EquityAdjustment, Level = 3, Group = Constant.AccountGroup.Equity, ParentId = OwnersEquity.Id, IsLegacy = true
                }, _accountService);

                Revenue = _accountService.CreateLegacyObject(new Account()
                {
                    Name = "Revenue", IsLeaf = true, Code = Constant.AccountCode.Revenue, LegacyCode = Constant.AccountLegacyCode.Revenue, Level = 1, Group = Constant.AccountGroup.Revenue, IsLegacy = true
                }, _accountService);
            }
        }
Exemple #20
0
 public PurchaseOrderApiController(IPurchaseOrderService purchaseOrderService, IPartnershipService partnershipService)
 {
     _purchaseOrderService = purchaseOrderService;
     _partnershipService   = partnershipService;
 }
 public PurchaseOrderItemsController(IPurchaseOrderItem ipOrderItem, IInventoryService inventoryService, IPurchaseOrderService ipPurchaseOrderService, ApplicationDbContext context)
 {
     this.ipOrderItem            = ipOrderItem;
     this.inventoryService       = inventoryService;
     this.ipPurchaseOrderService = ipPurchaseOrderService;
     _context = context;
 }
Exemple #22
0
        public PurchaseOrderDetail VHasPurchaseOrder(PurchaseOrderDetail purchaseOrderDetail, IPurchaseOrderService _purchaseOrderService)
        {
            PurchaseOrder purchaseOrder = _purchaseOrderService.GetObjectById(purchaseOrderDetail.PurchaseOrderId);

            if (purchaseOrder == null)
            {
                purchaseOrderDetail.Errors.Add("PurchaseOrder", "Tidak boleh tidak ada");
            }
            return(purchaseOrderDetail);
        }
Exemple #23
0
 public PurchaseOrdersController(IPurchaseOrderService PurchaseOrderService, IPurchaseOrderViewModelSelectListBuilder PurchaseOrderViewModelSelectListBuilder)
     : base(PurchaseOrderService, PurchaseOrderViewModelSelectListBuilder, true)
 {
 }
 public PurchaseOrderController(IPurchaseOrderService service)
 {
     _purchaseOrderService = service;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="BuyController"/> class.
 /// </summary>
 /// <param name="purchaseOrderService">The purchase order service.</param>
 public BuyController(IPurchaseOrderService purchaseOrderService)
 {
     _purchaseOrderService = purchaseOrderService;
 }
 public PurchaseReceival CreateObject(PurchaseReceival purchaseReceival, IPurchaseOrderService _purchaseOrderService, IWarehouseService _warehouseService)
 {
     purchaseReceival.Errors = new Dictionary <String, String>();
     return(_validator.ValidCreateObject(purchaseReceival, _purchaseOrderService, _warehouseService) ? _repository.CreateObject(purchaseReceival) : purchaseReceival);
 }
Exemple #27
0
 public FrmPurchaseOrder(IPurchaseOrderService purchaseOrderService, IProductService productService)
 {
     _purchaseOrderService = purchaseOrderService;
     _productService       = productService;
     InitializeComponent();
 }
        public PurchaseReceival CreateObject(int warehouseId, int purchaseOrderId, DateTime receivalDate, IPurchaseOrderService _purchaseOrderService, IWarehouseService _warehouseService)
        {
            PurchaseReceival purchaseReceival = new PurchaseReceival
            {
                PurchaseOrderId = purchaseOrderId,
                ReceivalDate    = receivalDate,
                WarehouseId     = warehouseId
            };

            return(this.CreateObject(purchaseReceival, _purchaseOrderService, _warehouseService));
        }
Exemple #29
0
 public PurchaseOrderDetail VCreateObject(PurchaseOrderDetail purchaseOrderDetail, IPurchaseOrderDetailService _purchaseOrderDetails, IPurchaseOrderService _purchaseOrderService, IItemService _itemService)
 {
     VHasPurchaseOrder(purchaseOrderDetail, _purchaseOrderService);
     if (!isValid(purchaseOrderDetail))
     {
         return(purchaseOrderDetail);
     }
     VHasItem(purchaseOrderDetail, _itemService);
     if (!isValid(purchaseOrderDetail))
     {
         return(purchaseOrderDetail);
     }
     VNonZeroNorNegativeQuantity(purchaseOrderDetail);
     if (!isValid(purchaseOrderDetail))
     {
         return(purchaseOrderDetail);
     }
     VNonNegativePrice(purchaseOrderDetail);
     if (!isValid(purchaseOrderDetail))
     {
         return(purchaseOrderDetail);
     }
     VUniquePurchaseOrderDetail(purchaseOrderDetail, _purchaseOrderDetails, _itemService);
     return(purchaseOrderDetail);
 }
 public PurchaseReceival UpdateObject(PurchaseReceival purchaseReceival, IPurchaseOrderService _purchaseOrderService, IWarehouseService _warehouseService)
 {
     return(_validator.ValidUpdateObject(purchaseReceival, _purchaseOrderService, _warehouseService) ? _repository.UpdateObject(purchaseReceival) : purchaseReceival);
 }
Exemple #31
0
 public PurchaseOrderDetail VUpdateObject(PurchaseOrderDetail purchaseOrderDetail, IPurchaseOrderDetailService _purchaseOrderDetails, IPurchaseOrderService _purchaseOrderService, IItemService _itemService)
 {
     VCreateObject(purchaseOrderDetail, _purchaseOrderDetails, _purchaseOrderService, _itemService);
     if (!isValid(purchaseOrderDetail))
     {
         return(purchaseOrderDetail);
     }
     VHasNotBeenConfirmed(purchaseOrderDetail);
     return(purchaseOrderDetail);
 }
        void before_each()
        {
            var db = new OffsetPrintingSuppliesEntities();

            using (db)
            {
                db.DeleteAllTables();
                itemService           = new ItemService(new ItemRepository(), new ItemValidator());
                contactService        = new ContactService(new ContactRepository(), new ContactValidator());
                poService             = new PurchaseOrderService(new PurchaseOrderRepository(), new PurchaseOrderValidator());
                poDetailService       = new PurchaseOrderDetailService(new PurchaseOrderDetailRepository(), new PurchaseOrderDetailValidator());
                stockMutationService  = new StockMutationService(new StockMutationRepository(), new StockMutationValidator());
                _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());
                _barringService       = new BarringService(new BarringRepository(), new BarringValidator());

                Pcs = new UoM()
                {
                    Name = "Pcs"
                };
                _uomService.CreateObject(Pcs);

                contact = new Contact()
                {
                    Name         = "President of Indonesia",
                    Address      = "Istana Negara Jl. Veteran No. 16 Jakarta Pusat",
                    ContactNo    = "021 3863777",
                    PIC          = "Mr. President",
                    PICContactNo = "021 3863777",
                    Email        = "*****@*****.**"
                };
                contact = contactService.CreateObject(contact);

                type = _itemTypeService.CreateObject("Item", "Item");

                warehouse = new Warehouse()
                {
                    Name        = "Sentral Solusi Data",
                    Description = "Kali Besar Jakarta",
                    Code        = "LCL"
                };
                warehouse = _warehouseService.CreateObject(warehouse, _warehouseItemService, itemService);

                item1 = new Item()
                {
                    ItemTypeId = _itemTypeService.GetObjectByName("Item").Id,
                    Name       = "Batik Tulis",
                    Category   = "Item",
                    Sku        = "bt123",
                    UoMId      = Pcs.Id
                };
                itemService.CreateObject(item1, _uomService, _itemTypeService, _warehouseItemService, _warehouseService);
                itemService.AdjustQuantity(item1, 1000);
                _warehouseItemService.AdjustQuantity(_warehouseItemService.FindOrCreateObject(warehouse.Id, item1.Id), 1000);

                item2 = new Item()
                {
                    ItemTypeId = _itemTypeService.GetObjectByName("Item").Id,
                    Name       = "Buku Gambar",
                    Category   = "Item",
                    Sku        = "bg123",
                    UoMId      = Pcs.Id
                };
                itemService.CreateObject(item2, _uomService, _itemTypeService, _warehouseItemService, _warehouseService);
                itemService.AdjustQuantity(item2, 1000);
                _warehouseItemService.AdjustQuantity(_warehouseItemService.FindOrCreateObject(warehouse.Id, item2.Id), 1000);
            }
        }
Exemple #33
0
 public bool ValidUpdateObject(PurchaseOrderDetail purchaseOrderDetail, IPurchaseOrderDetailService _purchaseOrderDetails, IPurchaseOrderService _purchaseOrderService, IItemService _itemService)
 {
     purchaseOrderDetail.Errors.Clear();
     VUpdateObject(purchaseOrderDetail, _purchaseOrderDetails, _purchaseOrderService, _itemService);
     return(isValid(purchaseOrderDetail));
 }
Exemple #34
0
        void before_each()
        {
            var db = new OffsetPrintingSuppliesEntities();

            using (db)
            {
                db.DeleteAllTables();
                itemService                   = new ItemService(new ItemRepository(), new ItemValidator());
                contactService                = new ContactService(new ContactRepository(), new ContactValidator());
                poService                     = new PurchaseOrderService(new PurchaseOrderRepository(), new PurchaseOrderValidator());
                poDetailService               = new PurchaseOrderDetailService(new PurchaseOrderDetailRepository(), new PurchaseOrderDetailValidator());
                _stockMutationService         = new StockMutationService(new StockMutationRepository(), new StockMutationValidator());
                _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());
                _barringService               = new BarringService(new BarringRepository(), new BarringValidator());
                _itemService                  = new ItemService(new ItemRepository(), new ItemValidator());
                _stockAdjustmentService       = new StockAdjustmentService(new StockAdjustmentRepository(), new StockAdjustmentValidator());
                _stockAdjustmentDetailService = new StockAdjustmentDetailService(new StockAdjustmentDetailRepository(), new StockAdjustmentDetailValidator());
                _accountService               = new AccountService(new AccountRepository(), new AccountValidator());
                _closingService               = new ClosingService(new ClosingRepository(), new ClosingValidator());
                _generalLedgerJournalService  = new GeneralLedgerJournalService(new GeneralLedgerJournalRepository(), new GeneralLedgerJournalValidator());
                _priceMutationService         = new PriceMutationService(new PriceMutationRepository(), new PriceMutationValidator());
                _contactGroupService          = new ContactGroupService(new ContactGroupRepository(), new ContactGroupValidator());

                if (!_accountService.GetLegacyObjects().Any())
                {
                    Asset = _accountService.CreateLegacyObject(new Account()
                    {
                        Name = "Asset", Code = Constant.AccountCode.Asset, LegacyCode = Constant.AccountLegacyCode.Asset, Level = 1, Group = Constant.AccountGroup.Asset, IsLegacy = true
                    }, _accountService);
                    CashBank = _accountService.CreateLegacyObject(new Account()
                    {
                        Name = "CashBank", Code = Constant.AccountCode.CashBank, LegacyCode = Constant.AccountLegacyCode.CashBank, Level = 2, Group = Constant.AccountGroup.Asset, ParentId = Asset.Id, IsLegacy = true
                    }, _accountService);
                    AccountReceivable = _accountService.CreateLegacyObject(new Account()
                    {
                        Name = "Account Receivable", IsLeaf = true, Code = Constant.AccountCode.AccountReceivable, LegacyCode = Constant.AccountLegacyCode.AccountReceivable, Level = 2, Group = Constant.AccountGroup.Asset, ParentId = Asset.Id, IsLegacy = true
                    }, _accountService);
                    GBCHReceivable = _accountService.CreateLegacyObject(new Account()
                    {
                        Name = "GBCH Receivable", IsLeaf = true, Code = Constant.AccountCode.GBCHReceivable, LegacyCode = Constant.AccountLegacyCode.GBCHReceivable, Level = 2, Group = Constant.AccountGroup.Asset, ParentId = Asset.Id, IsLegacy = true
                    }, _accountService);
                    Inventory = _accountService.CreateLegacyObject(new Account()
                    {
                        Name = "Inventory", IsLeaf = true, Code = Constant.AccountCode.Inventory, LegacyCode = Constant.AccountLegacyCode.Inventory, Level = 2, Group = Constant.AccountGroup.Asset, ParentId = Asset.Id, IsLegacy = true
                    }, _accountService);

                    Expense = _accountService.CreateLegacyObject(new Account()
                    {
                        Name = "Expense", Code = Constant.AccountCode.Expense, LegacyCode = Constant.AccountLegacyCode.Expense, Level = 1, Group = Constant.AccountGroup.Expense, IsLegacy = true
                    }, _accountService);
                    CashBankAdjustmentExpense = _accountService.CreateLegacyObject(new Account()
                    {
                        Name = "CashBank Adjustment Expense", IsLeaf = true, Code = Constant.AccountCode.CashBankAdjustmentExpense, LegacyCode = Constant.AccountLegacyCode.CashBankAdjustmentExpense, Level = 2, Group = Constant.AccountGroup.Expense, ParentId = Expense.Id, IsLegacy = true
                    }, _accountService);
                    COGS = _accountService.CreateLegacyObject(new Account()
                    {
                        Name = "Cost Of Goods Sold", IsLeaf = true, Code = Constant.AccountCode.COGS, LegacyCode = Constant.AccountLegacyCode.COGS, Level = 2, Group = Constant.AccountGroup.Expense, ParentId = Expense.Id, IsLegacy = true
                    }, _accountService);
                    Discount = _accountService.CreateLegacyObject(new Account()
                    {
                        Name = "Discount", IsLeaf = true, Code = Constant.AccountCode.Discount, LegacyCode = Constant.AccountLegacyCode.Discount, Level = 2, Group = Constant.AccountGroup.Expense, ParentId = Expense.Id, IsLegacy = true
                    }, _accountService);
                    SalesAllowance = _accountService.CreateLegacyObject(new Account()
                    {
                        Name = "Sales Allowance", IsLeaf = true, Code = Constant.AccountCode.SalesAllowance, LegacyCode = Constant.AccountLegacyCode.SalesAllowance, Level = 2, Group = Constant.AccountGroup.Expense, ParentId = Expense.Id, IsLegacy = true
                    }, _accountService);
                    StockAdjustmentExpense = _accountService.CreateLegacyObject(new Account()
                    {
                        Name = "Stock Adjustment Expense", IsLeaf = true, Code = Constant.AccountCode.StockAdjustmentExpense, LegacyCode = Constant.AccountLegacyCode.StockAdjustmentExpense, Level = 2, Group = Constant.AccountGroup.Expense, ParentId = Expense.Id, IsLegacy = true
                    }, _accountService);

                    Liability = _accountService.CreateLegacyObject(new Account()
                    {
                        Name = "Liability", Code = Constant.AccountCode.Liability, LegacyCode = Constant.AccountLegacyCode.Liability, Level = 1, Group = Constant.AccountGroup.Liability, IsLegacy = true
                    }, _accountService);
                    AccountPayable = _accountService.CreateLegacyObject(new Account()
                    {
                        Name = "Account Payable", IsLeaf = true, Code = Constant.AccountCode.AccountPayable, LegacyCode = Constant.AccountLegacyCode.AccountPayable, Level = 2, Group = Constant.AccountGroup.Liability, ParentId = Liability.Id, IsLegacy = true
                    }, _accountService);
                    GBCHPayable = _accountService.CreateLegacyObject(new Account()
                    {
                        Name = "GBCH Payable", IsLeaf = true, Code = Constant.AccountCode.GBCHPayable, LegacyCode = Constant.AccountLegacyCode.GBCHPayable, Level = 2, Group = Constant.AccountGroup.Liability, ParentId = Liability.Id, IsLegacy = true
                    }, _accountService);
                    GoodsPendingClearance = _accountService.CreateLegacyObject(new Account()
                    {
                        Name = "Goods Pending Clearance", IsLeaf = true, Code = Constant.AccountCode.GoodsPendingClearance, LegacyCode = Constant.AccountLegacyCode.GoodsPendingClearance, Level = 2, Group = Constant.AccountGroup.Liability, ParentId = Liability.Id, IsLegacy = true
                    }, _accountService);

                    Equity = _accountService.CreateLegacyObject(new Account()
                    {
                        Name = "Equity", Code = Constant.AccountCode.Equity, LegacyCode = Constant.AccountLegacyCode.Equity, Level = 1, Group = Constant.AccountGroup.Equity, IsLegacy = true
                    }, _accountService);
                    OwnersEquity = _accountService.CreateLegacyObject(new Account()
                    {
                        Name = "Owners Equity", Code = Constant.AccountCode.OwnersEquity, LegacyCode = Constant.AccountLegacyCode.OwnersEquity, Level = 2, Group = Constant.AccountGroup.Equity, ParentId = Equity.Id, IsLegacy = true
                    }, _accountService);
                    EquityAdjustment = _accountService.CreateLegacyObject(new Account()
                    {
                        Name = "Equity Adjustment", IsLeaf = true, Code = Constant.AccountCode.EquityAdjustment, LegacyCode = Constant.AccountLegacyCode.EquityAdjustment, Level = 3, Group = Constant.AccountGroup.Equity, ParentId = OwnersEquity.Id, IsLegacy = true
                    }, _accountService);

                    Revenue = _accountService.CreateLegacyObject(new Account()
                    {
                        Name = "Revenue", IsLeaf = true, Code = Constant.AccountCode.Revenue, LegacyCode = Constant.AccountLegacyCode.Revenue, Level = 1, Group = Constant.AccountGroup.Revenue, IsLegacy = true
                    }, _accountService);
                }

                baseGroup = _contactGroupService.CreateObject(Core.Constants.Constant.GroupType.Base, "Base Group", true);

                Pcs = new UoM()
                {
                    Name = "Pcs"
                };
                _uomService.CreateObject(Pcs);

                contact = new Contact()
                {
                    Name         = "President of Indonesia",
                    Address      = "Istana Negara Jl. Veteran No. 16 Jakarta Pusat",
                    ContactNo    = "021 3863777",
                    PIC          = "Mr. President",
                    PICContactNo = "021 3863777",
                    Email        = "*****@*****.**"
                };
                contact = contactService.CreateObject(contact, _contactGroupService);

                type = _itemTypeService.CreateObject("Item", "Item");

                warehouse = new Warehouse()
                {
                    Name        = "Sentral Solusi Data",
                    Description = "Kali Besar Jakarta",
                    Code        = "LCL"
                };
                warehouse = _warehouseService.CreateObject(warehouse, _warehouseItemService, itemService);

                item1 = new Item()
                {
                    ItemTypeId = _itemTypeService.GetObjectByName("Item").Id,
                    Name       = "Batik Tulis",
                    Category   = "Item",
                    Sku        = "bt123",
                    UoMId      = Pcs.Id
                };
                itemService.CreateObject(item1, _uomService, _itemTypeService, _warehouseItemService, _warehouseService, _priceMutationService, _contactGroupService);

                item2 = new Item()
                {
                    ItemTypeId = _itemTypeService.GetObjectByName("Item").Id,
                    Name       = "Buku Gambar",
                    Category   = "Item",
                    Sku        = "bg123",
                    UoMId      = Pcs.Id
                };
                itemService.CreateObject(item2, _uomService, _itemTypeService, _warehouseItemService, _warehouseService, _priceMutationService, _contactGroupService);

                StockAdjustment sa = new StockAdjustment()
                {
                    AdjustmentDate = DateTime.Today, WarehouseId = warehouse.Id, Description = "item adjustment"
                };
                _stockAdjustmentService.CreateObject(sa, _warehouseService);
                StockAdjustmentDetail sadItem1 = new StockAdjustmentDetail()
                {
                    ItemId            = item1.Id,
                    Quantity          = 1000,
                    StockAdjustmentId = sa.Id
                };
                _stockAdjustmentDetailService.CreateObject(sadItem1, _stockAdjustmentService, _itemService, _warehouseItemService);

                StockAdjustmentDetail sadItem2 = new StockAdjustmentDetail()
                {
                    ItemId            = item2.Id,
                    Quantity          = 1000,
                    StockAdjustmentId = sa.Id
                };
                _stockAdjustmentDetailService.CreateObject(sadItem2, _stockAdjustmentService, _itemService, _warehouseItemService);

                _stockAdjustmentService.ConfirmObject(sa, DateTime.Today, _stockAdjustmentDetailService, _stockMutationService,
                                                      _itemService, _barringService, _warehouseItemService, _generalLedgerJournalService,
                                                      _accountService, _closingService);
            }
        }