//On MoneyIn completed checks ammount due and acts accordingly public void CompleteSale(MoneyIn moneyIn) { moneyIn.UpdateDue(); if (moneyIn.currentDue == 0) { try { API.SubmitTransaction(CreateTransactionJson()); moneyIn.Close(); POS.NewSale(); } catch { MessageBox.Show("ERROR"); } } else if (moneyIn.currentDue < 0) { try { MessageBox.Show("Change:" + (moneyIn.currentDue * -1)); API.SubmitTransaction(CreateTransactionJson()); moneyIn.Close(); POS.NewSale(); } catch { MessageBox.Show("ERROR"); } } else if (moneyIn.currentDue > 0) { MessageBox.Show("This Sale has not be paid fully"); } }
//On complete sale button updates total and opens MoneyIn private void TakePayment(object sender, EventArgs e) { UpdateTotal(); if (Total != 0) { MoneyIn saleForm = new MoneyIn(Total, this); this.Enabled = false; saleForm.Show(); } if (Total == 0) { MessageBox.Show("No items to process", "ERROR"); } }