public void SetUp() { List <SalesInvoice> salesInvoiceTest = new List <SalesInvoice>(); { new SalesInvoice { SalesInvoiceId = 1, CustomerId = 1, BranchId = 1, SalesType = 0, UserId = "98f74499-a614-4373-aacd-5eec5b46ef95", DateSold = DateTime.Parse("2016-10-09") }; new SalesInvoice { SalesInvoiceId = 2, CustomerId = 2, BranchId = 2, SalesType = 1, UserId = "98f74499-a614-4373-aacd-5eec5b46ef95", DateSold = DateTime.Parse("2016-10-09") }; } List <Customer> customerTest = new List <Customer>(); { new Customer { FirstName = "Tewodros", LastName = "Afro", Address = "Arat Killo", TelephoneNo = "123456789", TIN = "123456789", VATNumber = "123456789", Trusted = true }; new Customer { FirstName = "Tilahun", LastName = "Gessesse", Address = "Arat Killo", TelephoneNo = "123456789", TIN = "123456789", VATNumber = "123456789", Trusted = true }; } List <Branch> branchTest = new List <Branch>(); { new Branch { BranchName = "Main", BranchLocation = "Addis Ababa", BranchDescription = "Country Main Branch" }; new Branch { BranchName = "South Branch", BranchLocation = "Awassa", BranchDescription = "SNNP Branch in Awassa" }; } List <Productc> productcTest = new List <Productc>(); { new Productc { ProductName = "Toyota Vitz", ProductDescription = "Toyota Vitz 2014", Model = "Vitz 2014", UnitOfMeasure = "Pcs", UnitCost = 200000.00M, UnitPrice = 250000.00M, CategoryId = 1 }; new Productc { ProductName = "Toyota Yaris", ProductDescription = "Toyota Yaris 2012", Model = "Yaris 2012", UnitOfMeasure = "Pcs", UnitCost = 350000.00M, UnitPrice = 400000.00M, CategoryId = 1 }; } Mock <ISalesInvoiceService> mockSalesInvoiceService = new Mock <ISalesInvoiceService>(); Mock <ICustomerService> mockCustomerService = new Mock <ICustomerService>(); Mock <IBranchService> mockBranchService = new Mock <IBranchService>(); Mock <IProductService> mockProductService = new Mock <IProductService>(); mockSalesInvoiceService.Setup(m => m.GetAllSalesInvoices()).Returns(salesInvoiceTest); mockCustomerService.Setup(m => m.GetAllCustomers()).Returns(customerTest); mockBranchService.Setup(m => m.GetAllBranches()).Returns(branchTest); mockProductService.Setup(m => m.GetAllProducts()).Returns(productcTest); MockSalesInvoiceService = mockSalesInvoiceService.Object; MockCustomerService = mockCustomerService.Object; MockBranchService = mockBranchService.Object; MockProductService = mockProductService.Object; _salesInvoicesController = new SalesInvoicesController(MockSalesInvoiceService, MockCustomerService, MockBranchService, MockProductService); }
public DeliveryOrder VHasNoSalesInvoice(DeliveryOrder deliveryOrder, ISalesInvoiceService _salesInvoiceService) { IList <SalesInvoice> salesInvoices = _salesInvoiceService.GetObjectsByDeliveryOrderId(deliveryOrder.Id); if (salesInvoices.Any()) { deliveryOrder.Errors.Add("Generic", "Sudah memiliki sales invoice"); } return(deliveryOrder); }
public HomeController(ISalesInvoiceService salesInvoiceService, IProductService productService, IProductReceiveService productReceiveService, IProductTransferService productTransferService, IBranchService branchService) { _salesInvoiceService = salesInvoiceService; _productService = productService; _productReceiveService = productReceiveService; _productTransferService = productTransferService; _branchService = branchService; }
public DeliveryOrder VUnconfirmObject(DeliveryOrder deliveryOrder, ISalesInvoiceService _salesInvoiceService) { VHasBeenConfirmed(deliveryOrder); if (!isValid(deliveryOrder)) { return(deliveryOrder); } VHasNoSalesInvoice(deliveryOrder, _salesInvoiceService); return(deliveryOrder); }
public SalesInvoiceDetail CreateObject(int salesInvoiceId, int deliveryOrderDetailId, int quantity, decimal amount, ISalesInvoiceService _salesInvoiceService, ISalesOrderDetailService _salesOrderDetailService, IDeliveryOrderDetailService _deliveryOrderDetailService) { SalesInvoiceDetail salesInvoiceDetail = new SalesInvoiceDetail { SalesInvoiceId = salesInvoiceId, DeliveryOrderDetailId = deliveryOrderDetailId, Quantity = quantity }; return(this.CreateObject(salesInvoiceDetail, _salesInvoiceService, _salesOrderDetailService, _deliveryOrderDetailService)); }
public SalesInvoiceController(IHostingEnvironment hostingEnvironment, ISalesInvoiceService salesInvoiceService, IDropDownService idropDownService, ICommonService iCommonService, IStringLocalizer <RocketPOSResources> sharedLocalizer, LocService locService) { _hostingEnvironment = hostingEnvironment; _iSalesInvoiceService = salesInvoiceService; _iDropDownService = idropDownService; _iCommonService = iCommonService; _sharedLocalizer = sharedLocalizer; _locService = locService; }
public DeliveryOrderController() { _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()); _warehouseService = new WarehouseService(new WarehouseRepository(), new WarehouseValidator()); _deliveryOrderService = new DeliveryOrderService(new DeliveryOrderRepository(), new DeliveryOrderValidator()); _deliveryOrderDetailService = new DeliveryOrderDetailService(new DeliveryOrderDetailRepository(), new DeliveryOrderDetailValidator()); _salesInvoiceService = new SalesInvoiceService(new SalesInvoiceRepository(), new SalesInvoiceValidator()); _salesInvoiceDetailService = new SalesInvoiceDetailService(new SalesInvoiceDetailRepository(), new SalesInvoiceDetailValidator()); _salesOrderService = new SalesOrderService(new SalesOrderRepository(), new SalesOrderValidator()); _salesOrderDetailService = new SalesOrderDetailService(new SalesOrderDetailRepository(), new SalesOrderDetailValidator()); }
public SalesInvoicesController(ISalesInvoiceService salesInvoiceService, ICustomerService customerService, IBranchService branchService, IProductService productService) { _salesInvoiceService = salesInvoiceService; _customerService = customerService; _branchService = branchService; _productService = productService; MyIdentityDbContext db = new MyIdentityDbContext(); UserStore <MyIdentityUser> userStore = new UserStore <MyIdentityUser>(db); userManager = new UserManager <MyIdentityUser>(userStore); RoleStore <MyIdentityRole> roleStore = new RoleStore <MyIdentityRole>(db); roleManager = new RoleManager <MyIdentityRole>(roleStore); }
public DeliveryOrder UnconfirmObject(DeliveryOrder deliveryOrder, IDeliveryOrderDetailService _deliveryOrderDetailService, ISalesInvoiceService _salesInvoiceService, ISalesInvoiceDetailService _salesInvoiceDetailService, ISalesOrderService _salesOrderService, ISalesOrderDetailService _salesOrderDetailService, IStockMutationService _stockMutationService, IItemService _itemService, IBarringService _barringService, IWarehouseItemService _warehouseItemService) { if (_validator.ValidUnconfirmObject(deliveryOrder, _salesInvoiceService)) { IList <DeliveryOrderDetail> deliveryOrderDetails = _deliveryOrderDetailService.GetObjectsByDeliveryOrderId(deliveryOrder.Id); foreach (var detail in deliveryOrderDetails) { detail.Errors = new Dictionary <string, string>(); _deliveryOrderDetailService.UnconfirmObject(detail, this, _salesOrderService, _salesOrderDetailService, _salesInvoiceDetailService, _stockMutationService, _itemService, _barringService, _warehouseItemService); } _repository.UnconfirmObject(deliveryOrder); } return(deliveryOrder); }
public SalesInvoiceController() { _purchaseOrderService = new PurchaseOrderService(new PurchaseOrderRepository(), new PurchaseOrderValidator()); _purchaseOrderDetailService = new PurchaseOrderDetailService(new PurchaseOrderDetailRepository(), new PurchaseOrderDetailValidator()); _purchaseInvoiceService = new PurchaseInvoiceService(new PurchaseInvoiceRepository(), new PurchaseInvoiceValidator()); _purchaseInvoiceDetailService = new PurchaseInvoiceDetailService(new PurchaseInvoiceDetailRepository(), new PurchaseInvoiceDetailValidator()); _purchaseReceivalService = new PurchaseReceivalService(new PurchaseReceivalRepository(), new PurchaseReceivalValidator()); _purchaseReceivalDetailService = new PurchaseReceivalDetailService(new PurchaseReceivalDetailRepository(), new PurchaseReceivalDetailValidator()); _paymentVoucherDetailService = new PaymentVoucherDetailService(new PaymentVoucherDetailRepository(), new PaymentVoucherDetailValidator()); _payableService = new PayableService(new PayableRepository(), new PayableValidator()); _itemService = new ItemService(new ItemRepository(), new ItemValidator()); _salesInvoiceService = new SalesInvoiceService(new SalesInvoiceRepository(), new SalesInvoiceValidator()); _salesInvoiceDetailService = new SalesInvoiceDetailService(new SalesInvoiceDetailRepository(), new SalesInvoiceDetailValidator()); _deliveryOrderDetailService = new DeliveryOrderDetailService(new DeliveryOrderDetailRepository(), new DeliveryOrderDetailValidator()); _receiptVoucherDetailService = new ReceiptVoucherDetailService(new ReceiptVoucherDetailRepository(), new ReceiptVoucherDetailValidator()); _receivableService = new ReceivableService(new ReceivableRepository(), new ReceivableValidator()); _salesOrderService = new SalesOrderService(new SalesOrderRepository(), new SalesOrderValidator()); _deliveryOrderDetailService = new DeliveryOrderDetailService(new DeliveryOrderDetailRepository(), new DeliveryOrderDetailValidator()); _salesOrderDetailService = new SalesOrderDetailService(new SalesOrderDetailRepository(), new SalesOrderDetailValidator()); _deliveryOrderService = new DeliveryOrderService(new DeliveryOrderRepository(), new DeliveryOrderValidator()); }
public bool ValidUnconfirmObject(DeliveryOrder deliveryOrder, ISalesInvoiceService _salesInvoiceService) { deliveryOrder.Errors.Clear(); VUnconfirmObject(deliveryOrder, _salesInvoiceService); return(isValid(deliveryOrder)); }
void before_each() { var db = new OffsetPrintingSuppliesEntities(); using (db) { db.DeleteAllTables(); _contactService = new ContactService(new ContactRepository(), new ContactValidator()); _itemService = new ItemService(new ItemRepository(), new ItemValidator()); _stockMutationService = new StockMutationService(new StockMutationRepository(), new StockMutationValidator()); _salesOrderService = new SalesOrderService(new SalesOrderRepository(), new SalesOrderValidator()); _salesOrderDetailService = new SalesOrderDetailService(new SalesOrderDetailRepository(), new SalesOrderDetailValidator()); _salesInvoiceService = new SalesInvoiceService(new SalesInvoiceRepository(), new SalesInvoiceValidator()); _salesInvoiceDetailService = new SalesInvoiceDetailService(new SalesInvoiceDetailRepository(), new SalesInvoiceDetailValidator()); _deliveryOrderService = new DeliveryOrderService(new DeliveryOrderRepository(), new DeliveryOrderValidator()); _deliveryOrderDetailService = new DeliveryOrderDetailService(new DeliveryOrderDetailRepository(), new DeliveryOrderDetailValidator()); _stockAdjustmentService = new StockAdjustmentService(new StockAdjustmentRepository(), new StockAdjustmentValidator()); _stockAdjustmentDetailService = new StockAdjustmentDetailService(new StockAdjustmentDetailRepository(), new StockAdjustmentDetailValidator()); _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); item_batiktulis = new Item() { ItemTypeId = _itemTypeService.GetObjectByName("Item").Id, Name = "Batik Tulis", Category = "Item", Sku = "bt123", UoMId = Pcs.Id }; item_batiktulis = _itemService.CreateObject(item_batiktulis, _uomService, _itemTypeService, _warehouseItemService, _warehouseService); _itemService.AdjustQuantity(item_batiktulis, 1000); _warehouseItemService.AdjustQuantity(_warehouseItemService.FindOrCreateObject(warehouse.Id, item_batiktulis.Id), 1000); item_busway = new Item() { ItemTypeId = _itemTypeService.GetObjectByName("Item").Id, Name = "Busway", Category = "Untuk disumbangkan bagi kebutuhan DKI Jakarta", Sku = "DKI002", UoMId = Pcs.Id }; item_busway = _itemService.CreateObject(item_busway, _uomService, _itemTypeService, _warehouseItemService, _warehouseService); _itemService.AdjustQuantity(item_busway, 200); _warehouseItemService.AdjustQuantity(_warehouseItemService.FindOrCreateObject(warehouse.Id, item_busway.Id), 200); item_botolaqua = new Item() { ItemTypeId = _itemTypeService.GetObjectByName("Item").Id, Name = "Botol Aqua", Category = "Minuman", Sku = "DKI003", UoMId = Pcs.Id }; item_botolaqua = _itemService.CreateObject(item_botolaqua, _uomService, _itemTypeService, _warehouseItemService, _warehouseService); _itemService.AdjustQuantity(item_botolaqua, 20000); _warehouseItemService.AdjustQuantity(_warehouseItemService.FindOrCreateObject(warehouse.Id, item_botolaqua.Id), 20000); salesOrder1 = _salesOrderService.CreateObject(contact.Id, new DateTime(2014, 07, 09), _contactService); salesOrder2 = _salesOrderService.CreateObject(contact.Id, new DateTime(2014, 04, 09), _contactService); salesOrderDetail_batiktulis_so1 = _salesOrderDetailService.CreateObject(salesOrder1.Id, item_batiktulis.Id, 500, 2000000, _salesOrderService, _itemService); salesOrderDetail_busway_so1 = _salesOrderDetailService.CreateObject(salesOrder1.Id, item_busway.Id, 91, 800000000, _salesOrderService, _itemService); salesOrderDetail_botolaqua_so1 = _salesOrderDetailService.CreateObject(salesOrder1.Id, item_botolaqua.Id, 2000, 5000, _salesOrderService, _itemService); salesOrderDetail_batiktulis_so2 = _salesOrderDetailService.CreateObject(salesOrder2.Id, item_batiktulis.Id, 40, 2000500, _salesOrderService, _itemService); salesOrderDetail_busway_so2 = _salesOrderDetailService.CreateObject(salesOrder2.Id, item_busway.Id, 3, 810000000, _salesOrderService, _itemService); salesOrderDetail_botolaqua_so2 = _salesOrderDetailService.CreateObject(salesOrder2.Id, item_botolaqua.Id, 340, 5500, _salesOrderService, _itemService); salesOrder1 = _salesOrderService.ConfirmObject(salesOrder1, DateTime.Today, _salesOrderDetailService, _stockMutationService, _itemService, _barringService, _warehouseItemService); salesOrder2 = _salesOrderService.ConfirmObject(salesOrder2, DateTime.Today, _salesOrderDetailService, _stockMutationService, _itemService, _barringService, _warehouseItemService); } }
void before_each() { var db = new OffsetPrintingSuppliesEntities(); using (db) { db.DeleteAllTables(); _accountService = new AccountService(new AccountRepository(), new AccountValidator()); _closingService = new ClosingService(new ClosingRepository(), new ClosingValidator()); _contactService = new ContactService(new ContactRepository(), new ContactValidator()); _generalLedgerJournalService = new GeneralLedgerJournalService(new GeneralLedgerJournalRepository(), new GeneralLedgerJournalValidator()); _itemService = new ItemService(new ItemRepository(), new ItemValidator()); _stockMutationService = new StockMutationService(new StockMutationRepository(), new StockMutationValidator()); _salesOrderService = new SalesOrderService(new SalesOrderRepository(), new SalesOrderValidator()); _salesOrderDetailService = new SalesOrderDetailService(new SalesOrderDetailRepository(), new SalesOrderDetailValidator()); _salesInvoiceService = new SalesInvoiceService(new SalesInvoiceRepository(), new SalesInvoiceValidator()); _salesInvoiceDetailService = new SalesInvoiceDetailService(new SalesInvoiceDetailRepository(), new SalesInvoiceDetailValidator()); _deliveryOrderService = new DeliveryOrderService(new DeliveryOrderRepository(), new DeliveryOrderValidator()); _deliveryOrderDetailService = new DeliveryOrderDetailService(new DeliveryOrderDetailRepository(), new DeliveryOrderDetailValidator()); _stockAdjustmentService = new StockAdjustmentService(new StockAdjustmentRepository(), new StockAdjustmentValidator()); _stockAdjustmentDetailService = new StockAdjustmentDetailService(new StockAdjustmentDetailRepository(), new StockAdjustmentDetailValidator()); _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()); _priceMutationService = new PriceMutationService(new PriceMutationRepository(), new PriceMutationValidator()); _contactGroupService = new ContactGroupService(new ContactGroupRepository(), new ContactGroupValidator()); 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); } 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); item_batiktulis = new Item() { ItemTypeId = _itemTypeService.GetObjectByName("Item").Id, Name = "Batik Tulis", Category = "Item", Sku = "bt123", UoMId = Pcs.Id }; item_batiktulis = _itemService.CreateObject(item_batiktulis, _uomService, _itemTypeService, _warehouseItemService, _warehouseService, _priceMutationService, _contactGroupService); item_busway = new Item() { ItemTypeId = _itemTypeService.GetObjectByName("Item").Id, Name = "Busway", Category = "Untuk disumbangkan bagi kebutuhan DKI Jakarta", Sku = "DKI002", UoMId = Pcs.Id }; item_busway = _itemService.CreateObject(item_busway, _uomService, _itemTypeService, _warehouseItemService, _warehouseService, _priceMutationService, _contactGroupService); item_botolaqua = new Item() { ItemTypeId = _itemTypeService.GetObjectByName("Item").Id, Name = "Botol Aqua", Category = "Minuman", Sku = "DKI003", UoMId = Pcs.Id }; item_botolaqua = _itemService.CreateObject(item_botolaqua, _uomService, _itemTypeService, _warehouseItemService, _warehouseService, _priceMutationService, _contactGroupService); StockAdjustment sa = new StockAdjustment() { AdjustmentDate = DateTime.Today, WarehouseId = warehouse.Id, Description = "item adjustment" }; _stockAdjustmentService.CreateObject(sa, _warehouseService); StockAdjustmentDetail sadBatikTulis = new StockAdjustmentDetail() { ItemId = item_batiktulis.Id, Quantity = 1000, StockAdjustmentId = sa.Id }; _stockAdjustmentDetailService.CreateObject(sadBatikTulis, _stockAdjustmentService, _itemService, _warehouseItemService); StockAdjustmentDetail sadBusWay = new StockAdjustmentDetail() { ItemId = item_busway.Id, Quantity = 200, StockAdjustmentId = sa.Id }; _stockAdjustmentDetailService.CreateObject(sadBusWay, _stockAdjustmentService, _itemService, _warehouseItemService); StockAdjustmentDetail sadBotolAqua = new StockAdjustmentDetail() { ItemId = item_botolaqua.Id, Quantity = 20000, StockAdjustmentId = sa.Id }; _stockAdjustmentDetailService.CreateObject(sadBotolAqua, _stockAdjustmentService, _itemService, _warehouseItemService); _stockAdjustmentService.ConfirmObject(sa, DateTime.Today, _stockAdjustmentDetailService, _stockMutationService, _itemService, _barringService, _warehouseItemService, _generalLedgerJournalService, _accountService, _closingService); salesOrder1 = _salesOrderService.CreateObject(contact.Id, new DateTime(2014, 07, 09), _contactService); salesOrder2 = _salesOrderService.CreateObject(contact.Id, new DateTime(2014, 04, 09), _contactService); salesOrderDetail_batiktulis_so1 = _salesOrderDetailService.CreateObject(salesOrder1.Id, item_batiktulis.Id, 500, 2000000, _salesOrderService, _itemService); salesOrderDetail_busway_so1 = _salesOrderDetailService.CreateObject(salesOrder1.Id, item_busway.Id, 91, 800000000, _salesOrderService, _itemService); salesOrderDetail_botolaqua_so1 = _salesOrderDetailService.CreateObject(salesOrder1.Id, item_botolaqua.Id, 2000, 5000, _salesOrderService, _itemService); salesOrderDetail_batiktulis_so2 = _salesOrderDetailService.CreateObject(salesOrder2.Id, item_batiktulis.Id, 40, 2000500, _salesOrderService, _itemService); salesOrderDetail_busway_so2 = _salesOrderDetailService.CreateObject(salesOrder2.Id, item_busway.Id, 3, 810000000, _salesOrderService, _itemService); salesOrderDetail_botolaqua_so2 = _salesOrderDetailService.CreateObject(salesOrder2.Id, item_botolaqua.Id, 340, 5500, _salesOrderService, _itemService); salesOrder1 = _salesOrderService.ConfirmObject(salesOrder1, DateTime.Today, _salesOrderDetailService, _stockMutationService, _itemService, _barringService, _warehouseItemService); salesOrder2 = _salesOrderService.ConfirmObject(salesOrder2, DateTime.Today, _salesOrderDetailService, _stockMutationService, _itemService, _barringService, _warehouseItemService); } }
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); } }
public SalesInvoiceController(ISalesInvoiceService salesInvoiceService) { _salesInvoiceService = salesInvoiceService; }
public MoneyBirdClient(IContactService contactService, ISalesInvoiceService salesInvoiceService, IRecurringSalesInvoiceService recurringSalesInvoiceService) { _contactService = contactService; _salesInvoiceService = salesInvoiceService; _recurringSalesInvoiceService = recurringSalesInvoiceService; }
public bool ValidUpdateObject(SalesInvoiceDetail salesInvoiceDetail, ISalesInvoiceService _salesInvoiceService, ISalesInvoiceDetailService _salesInvoiceDetailService, IDeliveryOrderDetailService _deliveryOrderDetailService) { salesInvoiceDetail.Errors.Clear(); VUpdateObject(salesInvoiceDetail, _salesInvoiceService, _salesInvoiceDetailService, _deliveryOrderDetailService); return(isValid(salesInvoiceDetail)); }
public SalesInvoiceDetail VUpdateObject(SalesInvoiceDetail salesInvoiceDetail, ISalesInvoiceService _salesInvoiceService, ISalesInvoiceDetailService _salesInvoiceDetailService, IDeliveryOrderDetailService _deliveryOrderDetailService) { VHasNotBeenConfirmed(salesInvoiceDetail); if (!isValid(salesInvoiceDetail)) { return(salesInvoiceDetail); } VCreateObject(salesInvoiceDetail, _salesInvoiceService, _salesInvoiceDetailService, _deliveryOrderDetailService); return(salesInvoiceDetail); }
public SalesInvoiceDetail CreateObject(SalesInvoiceDetail salesInvoiceDetail, ISalesInvoiceService _salesInvoiceService, ISalesOrderDetailService _salesOrderDetailService, IDeliveryOrderDetailService _deliveryOrderDetailService) { salesInvoiceDetail.Errors = new Dictionary <String, String>(); if (_validator.ValidCreateObject(salesInvoiceDetail, _salesInvoiceService, this, _deliveryOrderDetailService)) { DeliveryOrderDetail deliveryOrderDetail = _deliveryOrderDetailService.GetObjectById(salesInvoiceDetail.DeliveryOrderDetailId); SalesOrderDetail salesOrderDetail = _salesOrderDetailService.GetObjectById(deliveryOrderDetail.SalesOrderDetailId); salesInvoiceDetail.Amount = salesInvoiceDetail.Quantity * salesOrderDetail.Price; salesInvoiceDetail = _repository.CreateObject(salesInvoiceDetail); SalesInvoice salesInvoice = _salesInvoiceService.GetObjectById(salesInvoiceDetail.SalesInvoiceId); _salesInvoiceService.CalculateAmountReceivable(salesInvoice, this); } return(salesInvoiceDetail); }
public SalesInvoiceController(ISalesInvoiceService salesinvoiceService, IMapper mapper) { _salesinvoiceService = salesinvoiceService; _mapper = mapper; }
public SalesInvoiceDetail VCreateObject(SalesInvoiceDetail salesInvoiceDetail, ISalesInvoiceService _salesInvoiceService, ISalesInvoiceDetailService _salesInvoiceDetailService, IDeliveryOrderDetailService _deliveryOrderDetailService) { VHasSalesInvoice(salesInvoiceDetail, _salesInvoiceService); if (!isValid(salesInvoiceDetail)) { return(salesInvoiceDetail); } VHasDeliveryOrderDetail(salesInvoiceDetail, _deliveryOrderDetailService); if (!isValid(salesInvoiceDetail)) { return(salesInvoiceDetail); } VDeliveryOrderDetailAndSalesInvoiceMustHaveTheSameDeliveryOrder(salesInvoiceDetail, _deliveryOrderDetailService, _salesInvoiceService); if (!isValid(salesInvoiceDetail)) { return(salesInvoiceDetail); } VIsUniqueDeliveryOrderDetail(salesInvoiceDetail, _salesInvoiceDetailService, _deliveryOrderDetailService); if (!isValid(salesInvoiceDetail)) { return(salesInvoiceDetail); } VNonNegativeNorZeroQuantity(salesInvoiceDetail); if (!isValid(salesInvoiceDetail)) { return(salesInvoiceDetail); } VQuantityIsLessThanOrEqualPendingInvoiceQuantity(salesInvoiceDetail, _deliveryOrderDetailService); return(salesInvoiceDetail); }
public SalesInvoiceDetail VHasSalesInvoice(SalesInvoiceDetail salesInvoiceDetail, ISalesInvoiceService _salesInvoiceService) { SalesInvoice salesInvoice = _salesInvoiceService.GetObjectById(salesInvoiceDetail.SalesInvoiceId); if (salesInvoice == null) { salesInvoiceDetail.Errors.Add("SalesInvoiceId", "Tidak terasosiasi dengan sales invoice"); } return(salesInvoiceDetail); }
public PurchaseBuilder() { _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()); _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()); _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()); _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()); 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"); }
public bool ValidCreateObject(SalesInvoiceDetail salesInvoiceDetail, ISalesInvoiceService _salesInvoiceService, ISalesInvoiceDetailService _salesInvoiceDetailService, IDeliveryOrderDetailService _deliveryOrderDetailService) { VCreateObject(salesInvoiceDetail, _salesInvoiceService, _salesInvoiceDetailService, _deliveryOrderDetailService); return(isValid(salesInvoiceDetail)); }
public SalesInvoiceDetail UpdateObject(SalesInvoiceDetail salesInvoiceDetail, ISalesInvoiceService _salesInvoiceService, ISalesOrderDetailService _salesOrderDetailService, IDeliveryOrderDetailService _deliveryOrderDetailService) { if (_validator.ValidUpdateObject(salesInvoiceDetail, _salesInvoiceService, this, _deliveryOrderDetailService)) { DeliveryOrderDetail deliveryOrderDetail = _deliveryOrderDetailService.GetObjectById(salesInvoiceDetail.DeliveryOrderDetailId); SalesOrderDetail salesOrderDetail = _salesOrderDetailService.GetObjectById(deliveryOrderDetail.SalesOrderDetailId); salesInvoiceDetail.Amount = salesInvoiceDetail.Quantity * salesOrderDetail.Price; _repository.UpdateObject(salesInvoiceDetail); SalesInvoice salesInvoice = _salesInvoiceService.GetObjectById(salesInvoiceDetail.SalesInvoiceId); _salesInvoiceService.CalculateAmountReceivable(salesInvoice, this); } return(salesInvoiceDetail); }
public SalesInvoiceDetail VDeliveryOrderDetailAndSalesInvoiceMustHaveTheSameDeliveryOrder(SalesInvoiceDetail salesInvoiceDetail, IDeliveryOrderDetailService _deliveryOrderDetailService, ISalesInvoiceService _salesInvoiceService) { DeliveryOrderDetail deliveryOrderDetail = _deliveryOrderDetailService.GetObjectById(salesInvoiceDetail.DeliveryOrderDetailId); SalesInvoice salesInvoice = _salesInvoiceService.GetObjectById(salesInvoiceDetail.SalesInvoiceId); if (deliveryOrderDetail.DeliveryOrderId != salesInvoice.DeliveryOrderId) { deliveryOrderDetail.Errors.Add("Generic", "Delivery order detail dan sales invoice memiliki delivery order berbeda"); } return(salesInvoiceDetail); }
public SalesInvoiceDetail SoftDeleteObject(SalesInvoiceDetail salesInvoiceDetail, ISalesInvoiceService _salesInvoiceService) { if (_validator.ValidDeleteObject(salesInvoiceDetail)) { SalesInvoice salesInvoice = _salesInvoiceService.GetObjectById(salesInvoiceDetail.SalesInvoiceId); _repository.SoftDeleteObject(salesInvoiceDetail); _salesInvoiceService.CalculateAmountReceivable(salesInvoice, this); } return(salesInvoiceDetail); }