private void SumarTotales(bool actualizar) { gvDetalle.BeginDataUpdate(); gvDetalle.RefreshData(); Recibocajaegreso recibocaja = new Recibocajaegreso(); if (VwRecibocajadetList.Count > 0) { decimal totalbruto = VwRecibocajadetList.Sum(s => s.Importepago); decimal totalOtros = VwRecibocajaimprevistosList.Sum(s => s.Importepago); rTotaldocumento.EditValue = totalbruto + totalOtros; recibocaja.Idrecibocajaegreso = IdEntidadMnt; recibocaja.Totaldocumento = (decimal)rTotaldocumento.EditValue; } else { rTotaldocumento.EditValue = 0m; recibocaja.Idrecibocajaegreso = IdEntidadMnt; recibocaja.Totaldocumento = 0m; } if (actualizar) { Service.ActualizarTotalesReciboCajaEgreso(recibocaja); } gvDetalle.EndDataUpdate(); gvDetalle.BestFitColumns(true); }
public void FormatoReciboEgreso(Recibocajaegreso recibocajaegreso) { var tipocp = Service.GetTipocp(x => x.Idtipocp == recibocajaegreso.Idtipocp); const string nameRelation = "finanzas.vwrecibocajaegresoimpresion"; string whereList = string.Format("idrecibocajaegreso = {0}", recibocajaegreso.Idrecibocajaegreso); const string ordersList = "numeroitem"; const string fieldsList = "*"; DataTable dt = HelperDb.SqlConsulta(nameRelation, whereList, ordersList, fieldsList); if (string.IsNullOrEmpty(tipocp.Nombrereporte)) { XtraMessageBox.Show("No se asignó un formato de impresión", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } Report report = new Report(); string nameReporte = FilesHelper.FindingFileName(Application.StartupPath, string.Format("Reportes\\Finanzas\\{0}", tipocp.Nombrereporte.Trim())); report.Load(nameReporte); report.RegisterData(dt, "re"); report.RegisterData(VwSucursalList, "emp"); ReportHelper1 reportHelper1 = new ReportHelper1(report); reportHelper1.ShowDialog(); }
private void InicioTipoMantenimiento() { switch (TipoMnt) { case TipoMantenimiento.Nuevo: pkIdEntidad.EditValue = IdEntidadMnt; CargarReferencias(); ValoresPorDefecto(); btnEliminar.Enabled = false; btnActualizar.Enabled = false; RecibocajaMnt = new Recibocajaegreso(); CargarDetalle(); break; case TipoMantenimiento.Modificar: pkIdEntidad.EditValue = IdEntidadMnt; CargarReferencias(); TraerDatos(); CargarDetalle(); EstadoReferenciaCajaChica(); if (iAnulado.Checked) { DeshabilitarModificacion(); } SumarTotales(false); iIdempleado.Enabled = false; break; } }
private void CargarDatosReciboCajaEgreso() { //int idTipoCp = (int)iIdTipoDocCotizacion.EditValue; //int idSucursal = (int)rIdsucursal.EditValue; //string serieCotizacion = (string)rSerieCotizacion.EditValue; //string numeroCotizacion = (string)iNumeroCotizacion.EditValue; Recibocajaegreso recibocaja = Service.GetRecibocajaegreso(x => x.Idrecibocajaegreso == (int)iIdrecibocaja.EditValue); if (recibocaja != null) { iIdTipoDocRecibo.EditValue = recibocaja.Idtipocp; //rSerieCotizacion.EditValue = cotizacionprv.Sericotizacionprv; iNumeroTipocp.EditValue = recibocaja.Numerorecibo; rImporterecibo.EditValue = recibocaja.Totaldocumento; rFecharecibo.EditValue = recibocaja.Fecharecibo; } }
public bool ActualizarTotalesReciboCajaEgreso(Recibocajaegreso recibocajaegreso) { return(RecibocajaegresoDao.ActualizarTotalesReciboCajaEgreso(recibocajaegreso)); }
private void bmMantenimiento_ItemClick(object sender, ItemClickEventArgs e) { var subMenu = e.Item as BarSubItem; if (subMenu != null) { return; } switch (e.Item.Name) { case "btnNuevo": LimpiarCampos(); TipoMnt = TipoMantenimiento.Nuevo; IdEntidadMnt = 0; pkIdEntidad.EditValue = 0; RecibocajaMnt = null; RecibocajaMnt = new Recibocajaegreso(); btnGrabar.Enabled = true; btnGrabarCerrar.Enabled = true; btnGrabarNuevo.Enabled = true; btnEliminar.Enabled = false; btnActualizar.Enabled = false; ValoresPorDefecto(); if (Permisos.Nuevo) { CamposSoloLectura(false); } break; case "btnGrabar": if (Guardar()) { SeGuardoObjeto = true; //btnGrabar.Enabled = false; //btnGrabarCerrar.Enabled = false; btnGrabarNuevo.Enabled = false; if (IdEntidadMnt > 0) { TipoMnt = TipoMantenimiento.Modificar; } if (Permisos.Eliminar) { btnEliminar.Enabled = true; btnActualizar.Enabled = true; } DeshabilitarModificacion(); } break; case "btnGrabarCerrar": if (Guardar()) { SeGuardoObjeto = true; DialogResult = DialogResult.OK; } break; case "btnEliminar": EliminaRegistro(); break; case "btnLimpiarCampos": LimpiarCampos(); break; case "btnActualizar": if (IdEntidadMnt > 0) { TraerDatos(); CargarDetalle(); } break; case "btnCerrar": if (SeGuardoObjeto) { DialogResult = DialogResult.OK; } else { RecibocajaMnt = null; DialogResult = DialogResult.OK; } break; case "btnCtacteCliente": if (!ValidarDatosImportacion()) { return; } List <VwRecibocajaegresodet> vwRecibocajadetMntList = new List <VwRecibocajaegresodet>(); RecibocajaImpCtacteProveedorFrm recibocajaImpCtacteProveedorFrm = new RecibocajaImpCtacteProveedorFrm(vwRecibocajadetMntList, VwSocionegocioSel, (int)iIdtipomoneda.EditValue); recibocajaImpCtacteProveedorFrm.ShowDialog(); if (recibocajaImpCtacteProveedorFrm.DialogResult == DialogResult.OK) { VwRecibocajaegreso vwRecibocajaSelImp = recibocajaImpCtacteProveedorFrm.VwRecibocajaSel; if (vwRecibocajaSelImp != null) { iIdsocionegocio.EditValue = vwRecibocajaSelImp.Idsocionegocio; iIdtipomoneda.EditValue = vwRecibocajaSelImp.Idtipomoneda; } foreach (var item in vwRecibocajadetMntList) { Recibocajaegresodet recibocajadet = new Recibocajaegresodet(); recibocajadet.Idrecibocajaegreso = IdEntidadMnt; recibocajadet.Idrecibocajaegresodet = item.Idrecibocajaegresodet; recibocajadet.Numeroitem = item.Numeroitem; recibocajadet.Importepago = item.Importepago; recibocajadet.Idmediopago = item.Idmediopago; recibocajadet.Numeromediopago = item.Numeromediopago; recibocajadet.Comentario = item.Comentario; recibocajadet.Idcpcompra = item.Idcpcompra; Service.SaveRecibocajaegresodet(recibocajadet); } CargarDetalle(); CargarDetalleImprevistos(); SumarTotales(true); } break; case "btnImprimir": if (ImpresionFormato == null) { ImpresionFormato = new ImpresionFormato(); } if (IdEntidadMnt > 0) { ImpresionFormato.FormatoReciboEgreso(RecibocajaMnt); } break; } }
public void UpdateRecibocajaegreso(Recibocajaegreso entity) { RecibocajaegresoDao.Update(entity); }
public int SaveRecibocajaegreso(Recibocajaegreso entity) { return(RecibocajaegresoDao.Save(entity)); }