public PurchaseOrder UnconfirmObject(PurchaseOrder purchaseOrder, IPurchaseOrderDetailService _purchaseOrderDetailService, IPurchaseReceivalService _purchaseReceivalService, IPurchaseReceivalDetailService _purchaseReceivalDetailService, IStockMutationService _stockMutationService, IItemService _itemService, IBarringService _barringService, IWarehouseItemService _warehouseItemService) { if (_validator.ValidUnconfirmObject(purchaseOrder, _purchaseReceivalService)) { IList <PurchaseOrderDetail> purchaseOrderDetails = _purchaseOrderDetailService.GetObjectsByPurchaseOrderId(purchaseOrder.Id); foreach (var detail in purchaseOrderDetails) { detail.Errors = new Dictionary <string, string>(); _purchaseOrderDetailService.UnconfirmObject(detail, _purchaseReceivalDetailService, _stockMutationService, _itemService, _barringService, _warehouseItemService); } _repository.UnconfirmObject(purchaseOrder); } return(purchaseOrder); }