/// <summary> /// CALCULAR EL TOTAL EN LETRAS /// </summary> /// <param name="Num"></param> private void ALF_TOTA(decimal Num) { try { if (lueCOD_MONE.EditValue == null) throw new ArgumentException("Seleccione la moneda"); var SIMB = (BESVMC_MONE)lueCOD_MONE.GetSelectedDataRow(); var molt = new BRNumLetter(); lblALF_SONN.Text = molt.Convertir(Num.ToString(), true, SIMB.ALF_MONE_SIMB); } catch (Exception ex) { XtraMessageBox.Show(ex.Message, "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void txtNUM_DESC_EditValueChanging(object sender, ChangingEventArgs e) { if (e.NewValue == null) return; if (string.IsNullOrWhiteSpace(e.NewValue.ToString())) e.NewValue = 0; var lines = (List<BEDocumentLines>)gdvLines.DataSource; var amount = lines.Sum(item => item.NUM_IMPO); var descue = Convert.ToDecimal(e.NewValue); var amodes = amount - descue; var igv = (rdgIND_TIPO_COMP.SelectedIndex == 1) ? Math.Round((amodes * 18) / 100, 2) : Convert.ToDecimal(0.00); var total = amodes + igv; txtNUM_SUBB_TOTA.EditValue = amount; txtNUM_IGVV.EditValue = igv; txtNUM_TOTA.EditValue = total; var SIMB = (BESVMC_MONE)lkeCOD_MONE.GetSelectedDataRow(); var molt = new BRNumLetter(); lblTotalLetter.Text = molt.Convertir(txtNUM_TOTA.EditValue.ToString(), true, SIMB.ALF_MONE_SIMB); }
private void Set_Invoice(BEDocument row) { ClearControls(); txtCOD_DOCU.Text = row.COD_DOCU.ToString(); rdgIND_TIPO_COMP.EditValue = row.IND_TIPO_COMP; bteCOD_SOCI_NEGO.Properties.Buttons[0].Caption = row.COD_SOCI_NEGO.ToString(); bteCOD_SOCI_NEGO.Text = row.ALF_SOCI_NEGO; txtALF_NUM_SERI.Text = row.ALF_NUM_SERI; txtALF_NUM_CORR.Text = row.ALF_NUM_CORR; lkeCOD_COND_PAGO.EditValue = row.COD_COND_PAGO; lkeCOD_ALMA.EditValue = row.COD_ALMA; lkeCOD_MONE.EditValue = row.COD_MONE; txtNUM_TIPO_CAMB.EditValue = row.NUM_TIPO_CAMB; lkeIND_ESTA.EditValue = row.IND_ESTA; dteFEC_REGI.EditValue = row.FEC_REGI; dteFEC_ENTR.EditValue = row.FEC_ENTR; dteFEC_DOCU.EditValue = row.FEC_DOCU; dteFEC_PAGO.EditValue = row.FEC_PAGO; txtALF_NUM_RUCC.Text = row.ALF_NUM_RUCC; mmeALF_DIRE_FISC.Text = row.ALF_DIRE_FISC; mmeALF_DIRE_ENTR.Text = row.ALF_DIRE_ENTR; mmeALF_COME.Text = row.ALF_COME; var obj = new BEDocument() { COD_DOCU = row.COD_DOCU }; var obr = new BRPurchase(); var olst = obr.Get_PSCP_SPLS_SCPD_OINV(obj); gdcLines.DataSource = olst; gdvLines.RefreshData(); txtNUM_SUBB_TOTA.EditValue = row.NUM_SUBB_TOTA; txtNUM_DESC.EditValue = row.NUM_DESC; txtNUM_IGVV.EditValue = row.NUM_IGVV; txtNUM_TOTA.EditValue = row.NUM_TOTA; var SIMB = (BESVMC_MONE)lkeCOD_MONE.GetSelectedDataRow(); var molt = new BRNumLetter(); lblTotalLetter.Text = molt.Convertir(row.NUM_TOTA.ToString(), true, SIMB.ALF_MONE_SIMB); StateControls(true); txtCOD_DOCU.Focus(); }
private void Set_Totals() { var lines = (List<BEDocumentLines>)gdvLines.DataSource; var amount = lines.Sum(item => item.NUM_IMPO); var descue = Convert.ToDecimal(txtNUM_DESC.EditValue); var amodes = amount - descue; var igv = (rdgIND_TIPO_COMP.SelectedIndex == 1) ? Math.Round((amodes * 18) / 100, 2) : Convert.ToDecimal(0.00); var total = amodes + igv; txtNUM_SUBB_TOTA.EditValue = amount; txtNUM_IGVV.EditValue = igv; txtNUM_TOTA.EditValue = total; var SIMB = (BESVMC_MONE)lkeCOD_MONE.GetSelectedDataRow(); var molt = new BRNumLetter(); lblTotalLetter.Text = molt.Convertir(txtNUM_TOTA.EditValue.ToString(), true, SIMB.ALF_MONE_SIMB); }
private void Set_DocumentBase() { ClearControls(); StateControls(false); rdgIND_TIPO_COMP.EditValue = docb.IND_TIPO_COMP; bteCOD_SOCI_NEGO.Properties.Buttons[0].Caption = docb.COD_SOCI_NEGO.ToString(); bteCOD_SOCI_NEGO.Text = docb.ALF_SOCI_NEGO; lkeCOD_COND_PAGO.EditValue = docb.COD_COND_PAGO; lkeCOD_ALMA.EditValue = docb.COD_ALMA; lkeCOD_MONE.EditValue = docb.COD_MONE; txtNUM_TIPO_CAMB.EditValue = docb.NUM_TIPO_CAMB; lkeIND_ESTA.EditValue = docb.IND_ESTA; dteFEC_REGI.EditValue = docb.FEC_REGI; dteFEC_ENTR.EditValue = docb.FEC_ENTR; dteFEC_DOCU.EditValue = docb.FEC_DOCU; dteFEC_PAGO.EditValue = docb.FEC_PAGO; txtALF_NUM_RUCC.Text = docb.ALF_NUM_RUCC; mmeALF_DIRE_FISC.Text = docb.ALF_DIRE_FISC; mmeALF_DIRE_ENTR.Text = docb.ALF_DIRE_ENTR; mmeALF_COME.Text = docb.ALF_COME; var obj = new BEDocument() { COD_DOCU = docb.COD_DOCU }; var obr = new BRPurchase(); var olst = obr.Get_PSCP_SPLS_SCPD_GUIA(obj); olst.ForEach(item => { item.TIP_DOCU_BASE = 2; item.COD_DOCU_BASE = item.COD_DOCU; item.NUM_LINE_BASE = item.NUM_LINE; item.COD_ARTI_BASE = item.COD_ARTI; }); gdcLines.DataSource = olst; gdvLines.RefreshData(); txtNUM_SUBB_TOTA.EditValue = docb.NUM_SUBB_TOTA; txtNUM_DESC.EditValue = docb.NUM_DESC; txtNUM_IGVV.EditValue = docb.NUM_IGVV; txtNUM_TOTA.EditValue = docb.NUM_TOTA; var SIMB = (BESVMC_MONE)lkeCOD_MONE.GetSelectedDataRow(); var molt = new BRNumLetter(); lblTotalLetter.Text = molt.Convertir(docb.NUM_TOTA.ToString(), true, SIMB.ALF_MONE_SIMB); }