Esempio n. 1
0
        private void receiptBtn_Click(object sender, EventArgs e)
        {
            if (!myLines.Any())
            {
                MessageBox.Show("You can not create a receipt for an empty invoice.");
                this.DialogResult = DialogResult.Retry;
                return;
            }

            decimal feeTotal = (decimal)myLines.Sum(od => od.Fee);
            decimal gstTotal = (decimal)myLines.Sum(od => od.GST);
            decimal _invoiceTotal = decimal.Add(feeTotal, gstTotal);

            if (myReceiptAmounts.Sum(r => r.InvRecAmnt) >= _invoiceTotal)
            {
                MessageBox.Show("This invoice has already being paid in full.");
                return;
            }

            if (isOfficial != true)
            {
                MessageBox.Show("Please make the invoice official.");
                return;
            }

            var myReceiptForm = new Receipt.receiptViewForm(myInvoice, myClaimant);
            myReceiptForm.ShowDialog();
            if (myReceiptForm.DialogResult == DialogResult.OK)
            {
                this.myReceipts.Add(myReceiptForm.myReceipt);
                foreach (var x in myReceiptForm.myInvoiceReceipts)
                {
                    this.myReceiptAmounts.Add(x);
                }
            }
            myReceiptForm.Dispose();
        }
Esempio n. 2
0
 public void newReceipt()
 {
     myReceiptForm = new Receipt.receiptViewForm(myInvoice, myClaimant);
     myReceiptForm.ShowDialog();
     if (myReceiptForm.DialogResult == DialogResult.OK)
     {
         invoiceChanged = true;
         this.myReceipts.Add(myReceiptForm.myReceipt);
         foreach (var x in myReceiptForm.myInvoiceReceipts)
         {
             this.myReceiptAmounts.Add(x);
         }
     }
     myReceiptForm.Dispose();
 }