//================METHOD HITUNG========================================= public void hitung() { String noref = "-"; if (value1 < total) { MessageBox.Show("Your total payment is less than total spend"); } else { if (method_payment == "cash") { change = value1 - total; String change2 = change.ToString(); update_status(); value1_string = value1.ToString(); textBox1.Text = ""; uc_kembalian uc_k = new uc_kembalian(f1); f1.p_kanan.Controls.Clear(); if (!f1.p_kanan.Controls.Contains(uc_kembalian.Instance)) { f1.p_kanan.Controls.Add(uc_kembalian.Instance); uc_kembalian.Instance.Dock = DockStyle.Fill; uc_kembalian.Instance.kembali(value1_string, change2, id_trans); uc_kembalian.Instance.for_struk(type, noref, value1, change); uc_kembalian.Instance.Show(); } else { uc_kembalian.Instance.Show(); } fungsi_cetak_struk(); } else { change = value1 - total; String change2 = change.ToString(); update_status(); value1_string = value1.ToString(); textBox1.Text = ""; uc_kembalian uc_k = new uc_kembalian(f1); f1.p_kanan.Controls.Clear(); if (!f1.p_kanan.Controls.Contains(uc_kembalian.Instance)) { f1.p_kanan.Controls.Add(uc_kembalian.Instance); uc_kembalian.Instance.Dock = DockStyle.Fill; uc_kembalian.Instance.kembali(value1_string, change2, id_trans); uc_kembalian.Instance.for_struk(type, noref, value1, change); uc_kembalian.Instance.Show(); } else { uc_kembalian.Instance.Show(); } fungsi_cetak_struk(); } } }
//==============fungsi hitung dan update transaction===================================== public void hitung() { int transType; if (cust_Id != "") { transType = 3; } else { transType = 1; } String cmd_update = "UPDATE [transaction] SET DISCOUNT='" + field_diskon2 + "',TOTAL='" + tot_bel + "', STATUS='1', PAYMENT_TYPE='3', EDC='" + edc1 + "', EDC2='" + edc2 + "' ,BANK_NAME='" + id_bank + "',BANK_NAME2='" + id_bank2 + "' ,NO_REF='" + t_rev.Text + "',NO_REF2='" + t_rev2.Text + "', TRANSACTION_TYPE = '" + transType + "' WHERE TRANSACTION_ID ='" + id_trans + "'"; CRUD edit = new CRUD(); edit.ExecuteNonQuery(cmd_update); uc_kembalian uc_k = new uc_kembalian(f1); f1.p_kanan.Controls.Clear(); //bunifuFlatButton1.selected = true; if (!f1.p_kanan.Controls.Contains(uc_kembalian.Instance)) { f1.p_kanan.Controls.Add(uc_kembalian.Instance); uc_kembalian.Instance.Dock = DockStyle.Fill; uc_kembalian.Instance.split_edc(id_trans, edc1, edc2, combo_bank1.Text, combo_bank2.Text); uc_kembalian.Instance.Show(); //uc_transaction.Instance.BringToFront(); } else { uc_kembalian.Instance.split_edc(id_trans, edc1, edc2, combo_bank1.Text, combo_bank2.Text); uc_kembalian.Instance.Show(); } }
public void hitung() { Double change = 0; get_id_bank(); update_status(); uc_kembalian uc_k = new uc_kembalian(f1); f1.p_kanan.Controls.Clear(); //bunifuFlatButton1.selected = true; if (!f1.p_kanan.Controls.Contains(uc_kembalian.Instance)) { f1.p_kanan.Controls.Add(uc_kembalian.Instance); uc_kembalian.Instance.Dock = DockStyle.Fill; uc_kembalian.Instance.edc(id_trans, total, combo_bank.Text); uc_kembalian.Instance.for_struk(type, t_rev.Text, total, change); uc_kembalian.Instance.Show(); //uc_transaction.Instance.BringToFront(); } else { uc_kembalian.Instance.edc(id_trans, total, combo_bank.Text); uc_kembalian.Instance.for_struk(type, t_rev.Text, total, change); uc_kembalian.Instance.Show(); } }
//============================================================================================================================= //============================================================================================================================= public void hitung() { int transType; if (cust_Id != "") { transType = 3; } else { transType = 1; } //cash = Int32.Parse(t_cash.Text); //edc = Int32.Parse(t_edc.Text); total_double = tot_bel; //total = tot_bel; buyer_double = double_Tcash + double_Tedc; //buyer = cash + edc; change_double = buyer_double - total_double; //change = buyer - total; if (change_double == 0) { String cmd_update = "UPDATE [transaction] SET DISCOUNT='" + field_diskon2 + "',TOTAL='" + total_double + "', STATUS='1', PAYMENT_TYPE='2', CASH='" + double_Tcash + "', EDC='" + double_Tedc + "', CHANGEE='" + change_double + "', BANK_NAME='" + id_bank + "', NO_REF='" + t_rev.Text + "', TRANSACTION_TYPE = '" + transType + "' WHERE TRANSACTION_ID='" + id_trans + "'"; edit.ExecuteNonQuery(cmd_update); uc_kembalian uc_k = new uc_kembalian(f1); f1.p_kanan.Controls.Clear(); if (!f1.p_kanan.Controls.Contains(uc_kembalian.Instance)) { f1.p_kanan.Controls.Add(uc_kembalian.Instance); uc_kembalian.Instance.Dock = DockStyle.Fill; //uc_kembalian.Instance.kembali(double_Tcash.ToString(), change_double.ToString(), id_trans); uc_kembalian.Instance.split(change_double, double_Tcash, combo_bank.Text, double_Tedc, id_trans, tot_bel); uc_kembalian.Instance.for_struk(type, t_rev.Text, tot_bel, change_double); uc_kembalian.Instance.Show(); } else { uc_kembalian.Instance.Show(); } } else { int cash2 = cash - change; String cmd_update = "UPDATE [transaction] SET TOTAL='" + total_double + "', STATUS='1', PAYMENT_TYPE='2', CASH='" + double_Tcash + "', EDC='" + double_Tedc + "', CHANGEE='" + change_double + "', BANK_NAME='" + id_bank + "', NO_REF='" + t_rev.Text + "', TRANSACTION_TYPE = '" + transType + "' WHERE TRANSACTION_ID='" + id_trans + "'"; edit.ExecuteNonQuery(cmd_update); uc_kembalian uc_k = new uc_kembalian(f1); f1.p_kanan.Controls.Clear(); if (!f1.p_kanan.Controls.Contains(uc_kembalian.Instance)) { f1.p_kanan.Controls.Add(uc_kembalian.Instance); uc_kembalian.Instance.Dock = DockStyle.Fill; // uc_kembalian.Instance.kembali(double_Tcash.ToString(), change_double.ToString(), id_trans); uc_kembalian.Instance.split(change_double, double_Tcash, combo_bank.Text, double_Tedc, id_trans, tot_bel); uc_kembalian.Instance.for_struk(type, t_rev.Text, tot_bel, change_double); uc_kembalian.Instance.Show(); } else { uc_kembalian.Instance.Show(); } //cash3 = cash2; } }