Пример #1
0
 public InvoiceBuilder(int invID)
 {
     m_invMgr = Database.InvoiceMgr.Instance;
     m_invoice = Database.InvoiceMgr.Instance.getInvoiceByID(invID);
     foreach (Database.inv_line line in m_invoice.inv_line)
     {
         m_lstInvLine.AddLast(line);
     }
     m_bIsSaved = true;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the invoices EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToinvoices(invoice invoice)
 {
     base.AddObject("invoices", invoice);
 }
 /// <summary>
 /// Create a new invoice object.
 /// </summary>
 /// <param name="invID">Initial value of the invID property.</param>
 /// <param name="invDate">Initial value of the invDate property.</param>
 /// <param name="patID">Initial value of the patID property.</param>
 /// <param name="invCommitted">Initial value of the invCommitted property.</param>
 /// <param name="docID">Initial value of the docID property.</param>
 public static invoice Createinvoice(global::System.Int32 invID, global::System.DateTime invDate, global::System.Int32 patID, global::System.Boolean invCommitted, global::System.Int32 docID)
 {
     invoice invoice = new invoice();
     invoice.invID = invID;
     invoice.invDate = invDate;
     invoice.patID = patID;
     invoice.invCommitted = invCommitted;
     invoice.docID = docID;
     return invoice;
 }
Пример #4
0
        public decimal getInvoiceTotal(invoice inv)
        {
            decimal total = 0;
            if (inv != null)
            {
                foreach (inv_line invLine in inv.inv_line)
                {
                    if (invLine.linePrice != null)
                    {
                        // Old version for when discount was a percentage, changed to dollage ammount per client request
                        //total += (decimal)invLine.linePrice * invLine.itryQty * (100 - invLine.line_discount)/100;
                        total += (decimal)(invLine.linePrice * invLine.itryQty) - invLine.line_discount;
                    }
                }
            }

            return total;
        }
Пример #5
0
 public decimal getInvoiceAmountOweing(invoice inv)
 {
     decimal total = getInvoiceTotal(inv);
     foreach (payment p in inv.payments)
     {
         total -= p.payAmount;
     }
     return total;
 }
Пример #6
0
 public void deleteInvoice(invoice inv)
 {
     clearLinesFromInvoice(inv.invID);
     Context.DeleteObject(getInvoiceByID(inv.invID));
     saveChanges();
 }
Пример #7
0
 public void changeStatus(int statusID, invoice inv)
 {
     inv.invStatus = statusID;
     saveChanges();
 }
Пример #8
0
 public int addNewInvoice(invoice inv)
 {
     Context.AddToinvoices(inv);
     saveChanges();
     return inv.invID;
 }
Пример #9
0
 public InvoiceBuilder()
 {
     m_invoice = new Database.invoice();
     m_bIsSaved = false;
 }