示例#1
0
        private void btnImportarNC_Click(object sender, EventArgs e)
        {
            RecibocajaingresoImpNotaCreditoFrm recibocajaingresoImpNotaCreditoFrm = new RecibocajaingresoImpNotaCreditoFrm(IdCpVentaSel);

            if (recibocajaingresoImpNotaCreditoFrm.ShowDialog() == DialogResult.OK)
            {
                if (recibocajaingresoImpNotaCreditoFrm.VwNotacreditoclireciboingresoimp != null)
                {
                    rNumeroNc.EditValue =
                        string.Format(
                            "{0}-{1}",
                            recibocajaingresoImpNotaCreditoFrm.VwNotacreditoclireciboingresoimp.Serienotacredito,
                            recibocajaingresoImpNotaCreditoFrm.VwNotacreditoclireciboingresoimp.Numeronotacredito);

                    rFechaNc.EditValue =
                        recibocajaingresoImpNotaCreditoFrm.VwNotacreditoclireciboingresoimp.Fechaemision;

                    nTotalNotaCredito.EditValue =
                        recibocajaingresoImpNotaCreditoFrm.VwNotacreditoclireciboingresoimp.Saldoaimportar;

                    iIdnotacreditocli.EditValue =
                        recibocajaingresoImpNotaCreditoFrm.VwNotacreditoclireciboingresoimp.Idnotacreditocli;

                    VwRecibocajaingresodet vwRecibocajaingresodet = VwRecibocajaingresodetList.FirstOrDefault(x => x.Idmediopago == 9);
                    if (vwRecibocajaingresodet != null)
                    {
                        vwRecibocajaingresodet.Idnotacreditocli = (int?)iIdnotacreditocli.EditValue;
                        vwRecibocajaingresodet.Importenc        = (decimal)nTotalNotaCredito.EditValue;
                        gvMedioPago.RefreshData();
                    }
                    SumarMedioPago();
                }
            }
        }
示例#2
0
        private void SumarMedioPago()
        {
            gcMedioPago.RefreshDataSource();
            decimal totalMedioPago = VwRecibocajaingresodetList.Where(x => x.DataEntityState != DataEntityState.Deleted).Sum(x => x.Importepago);

            nTotalMedioPago.EditValue = totalMedioPago;
            nPendiente.EditValue      = (decimal)nTotaldocumento.EditValue - totalMedioPago;
        }
示例#3
0
        private void SumarMedioPago()
        {
            gcMedioPago.RefreshDataSource();
            decimal totalEfectivo      = VwRecibocajaingresodetList.Where(x => x.DataEntityState != DataEntityState.Deleted && x.Idmediopago == 9).Sum(x => x.Importepago);
            decimal totalOtroMedioPago = VwRecibocajaingresodetList.Where(x => x.DataEntityState != DataEntityState.Deleted && x.Idmediopago != 9).Sum(x => x.Importepago);
            decimal ntotalNotaCredito  = (decimal)nTotalNotaCredito.EditValue;

            nTotalEfectivo.EditValue      = totalEfectivo;
            nTotalOtroMedioPago.EditValue = totalOtroMedioPago;
            nPendiente.EditValue          = (decimal)nTotaldocumento.EditValue - (totalEfectivo + totalOtroMedioPago + ntotalNotaCredito);
            CalcularVuelto();
        }
示例#4
0
        private void AgregarItemMedioPagoEfectivo()
        {
            VwRecibocajaingresodet vwRecibocajaingresodet = new VwRecibocajaingresodet();

            vwRecibocajaingresodet.Numeroitem      = 1;
            vwRecibocajaingresodet.Idtipodocmov    = 1; //CpVenta
            vwRecibocajaingresodet.Idtipocp        = VwCpventa.Idtipocp;
            vwRecibocajaingresodet.Serietipocp     = VwCpventa.Seriecpventa;
            vwRecibocajaingresodet.Numerotipocp    = VwCpventa.Numerocpventa;
            vwRecibocajaingresodet.Importepago     = (decimal)nTotaldocumento.EditValue;
            vwRecibocajaingresodet.Idmediopago     = 9; // MedioPago: Efectivo
            vwRecibocajaingresodet.Nombremediopago = "EFECTIVO, EN LOS DEMAS CASOS";
            vwRecibocajaingresodet.Numeromediopago = string.Empty;
            vwRecibocajaingresodet.Comentario      = string.Empty;
            VwRecibocajaingresodetList.Add(vwRecibocajaingresodet);
            SumarMedioPago();
        }
示例#5
0
        private void bmMedioDePago_ItemClick(object sender, ItemClickEventArgs e)
        {
            var subMenu = e.Item as BarSubItem;

            if (subMenu != null)
            {
                return;
            }

            var idTipoCpSel = VwCpventa.Idtipocp;

            if (idTipoCpSel == null)
            {
                return;
            }



            if (VwCpventa != null)
            {
                CajaCobroMedioPagoCpVentaMntItemFrm cajaCobroMedioPagoMntItemFrm;
                VwRecibocajaingresodet vwRecibocajaingresodetMnt;

                switch (e.Item.Name)
                {
                case "btnAddMedioPago":


                    vwRecibocajaingresodetMnt = new VwRecibocajaingresodet();

                    //Asignar el siguiente item
                    var sgtItem =
                        VwRecibocajaingresodetList.Where(w => w.DataEntityState != DataEntityState.Deleted)
                        .OrderByDescending(t => t.Numeroitem)
                        .FirstOrDefault();

                    vwRecibocajaingresodetMnt.Numeroitem       = sgtItem == null ? 1 : sgtItem.Numeroitem + 1;
                    vwRecibocajaingresodetMnt.ImportePendiente = (decimal)nPendiente.EditValue;

                    cajaCobroMedioPagoMntItemFrm = new CajaCobroMedioPagoCpVentaMntItemFrm(TipoMantenimiento.Nuevo, vwRecibocajaingresodetMnt, VwCpventa, VwRecibocajaingresodetList);
                    if (cajaCobroMedioPagoMntItemFrm.ShowDialog() == DialogResult.OK)
                    {
                        VwRecibocajaingresodetList.Add(vwRecibocajaingresodetMnt);
                    }

                    SumarMedioPago();

                    if (!gvMedioPago.IsLastRow)
                    {
                        gvMedioPago.MoveLastVisible();
                        gvMedioPago.Focus();
                        gvMedioPago.FocusedColumn = gvMedioPago.Columns["Importepago"];
                    }
                    break;

                case "btnEditMedioPago":

                    if (gvMedioPago.RowCount == 0)
                    {
                        break;
                    }

                    vwRecibocajaingresodetMnt    = (VwRecibocajaingresodet)gvMedioPago.GetFocusedRow();
                    cajaCobroMedioPagoMntItemFrm = new CajaCobroMedioPagoCpVentaMntItemFrm(TipoMantenimiento.Modificar, vwRecibocajaingresodetMnt, VwCpventa, VwRecibocajaingresodetList);
                    cajaCobroMedioPagoMntItemFrm.ShowDialog();

                    if (cajaCobroMedioPagoMntItemFrm.DialogResult == DialogResult.OK)
                    {
                        SumarMedioPago();
                    }
                    break;

                case "btnDelMedioPago":
                    if (gvMedioPago.RowCount == 0)
                    {
                        break;
                    }
                    if (DialogResult.Yes ==
                        XtraMessageBox.Show("¿Desea eliminar el item seleccionado?", "Eliminar item",
                                            MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1))
                    {
                        vwRecibocajaingresodetMnt = (VwRecibocajaingresodet)gvMedioPago.GetFocusedRow();
                        vwRecibocajaingresodetMnt.DataEntityState = DataEntityState.Deleted;
                        if (!gvMedioPago.IsFirstRow)
                        {
                            gvMedioPago.MovePrev();
                        }
                        SumarMedioPago();
                    }
                    break;
                }
            }
        }