public static InvoiceLine GetCallLine(this Invoice invoice, Contract contract, Call call) { return new InvoiceLine { ContractId = contract.Id.Value, Call = call, Description = "TEST CALL to " + call.NumberCalled, Invoice = invoice, Quantity = Convert.ToDouble(call.Volume), GstAmount = call.Cost / 11M, LineAmount = call.Cost }; }
public virtual void AddLine(string description, double quantity, decimal lineAmount, Call call, Contract contract) { var line = new InvoiceLine { Description = description, Quantity = quantity, LineAmount = lineAmount, GstAmount = lineAmount/11M, Call = call, Invoice = this }; if (contract != null) line.ContractId = contract.Id.Value; _lines.Add(line); }