Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
 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);
 }