diff --git a/App_Code/ClsAF.vb b/App_Code/ClsAF.vb index 8c9c1da2b..cd7bbc863 100644 --- a/App_Code/ClsAF.vb +++ b/App_Code/ClsAF.vb @@ -2604,7 +2604,7 @@ Public Class ClsAF .Add("@FechaVF", SqlDbType.DateTime).Value = FechaVF .Add("@CveDispositivo", SqlDbType.Int).Value = CveDispositivo .Add("@CveCliente", SqlDbType.Int).Value = CveCliente - .Add("@CveCliente", SqlDbType.Int).Value = Estatus + .Add("@Estatus", SqlDbType.Int).Value = Estatus End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsMovimientos.vb b/App_Code/ClsMovimientos.vb index a382bb7e6..35896829d 100644 --- a/App_Code/ClsMovimientos.vb +++ b/App_Code/ClsMovimientos.vb @@ -241,7 +241,7 @@ Public Class ClsMovimientos Gpo As Integer, CveResponsable As Integer, TipoCambio As Integer, Optional TCEspecifico As Double = -1, Optional TipoDocto As String = "-1", Optional FechaVI As String = "-1", Optional FechaVF As String = "-1", Optional FechaCorte As Date = Nothing, Optional EstatusCliente As Integer = -1, Optional CveUsuarioConsulta As Integer = -1, - Optional CveCobranzaEstatus As Integer = -1, Optional CveClienteClasificacion As Integer = -1, Optional TipoCliente As Integer = -1) As Boolean + Optional CveCobranzaEstatus As Integer = -1, Optional CveClienteClasificacion As Integer = -1, Optional TipoCliente As Integer = -1, Optional AplicaAnticiposPagados As Integer = 1) As Boolean Dim Retorno As Boolean = False 'Data = New DataTable @@ -273,7 +273,8 @@ Public Class ClsMovimientos .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta .Add("@CveCobranzaEstatus", SqlDbType.Int).Value = CveCobranzaEstatus .Add("@CveClienteClasificacion", SqlDbType.Int).Value = CveClienteClasificacion - .Add("@TipoCliente", SqlDbType.Int).Value = TipoCliente + .Add("@TipoCliente", SqlDbType.Int).Value = TipoCliente + .Add("@AplicaAnticiposPagados", SqlDbType.Int).Value = AplicaAnticiposPagados End With Try @@ -324,7 +325,7 @@ Public Class ClsMovimientos CveResponsable As Integer, TipoCambio As Integer, Optional TCEspecifico As Double = -1, Optional TipoDocto As String = "-1", Optional FechaVI As String = "-1", Optional FechaVF As String = "1", Optional FechaCorte As Date = Nothing, Optional CveUsuarioConsulta As Integer = -1, Optional CveCobranzaEstatus As Integer = -1, Optional CveClienteClasificacion As Integer = -1, Optional LimiteCredito As Decimal = -1, - Optional TipoCliente As Integer = -1, Optional CveMoneda As Integer = -1, Optional EstatusCliente As Integer = -1) As Boolean + Optional TipoCliente As Integer = -1, Optional CveMoneda As Integer = -1, Optional EstatusCliente As Integer = -1, Optional AplicaAnticiposPagados As Integer = 1) As Boolean Dim Retorno As Boolean = False 'Data = New DataTable @@ -364,8 +365,8 @@ Public Class ClsMovimientos .Add("@LimiteCredito", SqlDbType.Float).Value = LimiteCredito .Add("@TipoCliente", SqlDbType.Int).Value = TipoCliente .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda - .Add("@EstatusCliente", SqlDbType.Int).Value = EstatusCliente - + .Add("@EstatusCliente", SqlDbType.Int).Value = EstatusCliente + .Add("@AplicaAnticiposPagados", SqlDbType.Int).Value = AplicaAnticiposPagados End With Try diff --git a/Bancos/DepositosCaja.aspx.vb b/Bancos/DepositosCaja.aspx.vb index 387a9454a..9eb7eea46 100644 --- a/Bancos/DepositosCaja.aspx.vb +++ b/Bancos/DepositosCaja.aspx.vb @@ -157,7 +157,6 @@ Partial Class Bancos_DepositosCaja Dim imprimirFolios As String = "" Dim CveSubProyectoIntermediario As Integer = -1 Dim CveClasificacionIntermediario As Integer = -1 - Dim CveProveedorIntermediario As Integer = -1 If drOrigen IsNot Nothing Then CveMoneda = drOrigen("CveMoneda").ToString.ToEntero @@ -230,75 +229,90 @@ Partial Class Bancos_DepositosCaja CveSubProyectoDescuento = DdlSubProyectoDescuento.SelectedValue.ToEntero CveClasificacionDescuento = DdlClasificacionDescuento.SelectedValue.ToEntero - If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, False, Descuento, DdlClasificacionDescuento.SelectedItem.Text, 51, DdlClasificacionDescuento.SelectedItem.Text, Fecha, IdCuentaBancariaOrigen, -1, CveClasificacion:=CveClasificacionDescuento, CveSubProyecto:=CveSubProyecto, ImporteMX:=Comision * TipoCambio) Then + If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, False, Descuento, DdlClasificacionDescuento.SelectedItem.Text, 51, DdlClasificacionDescuento.SelectedItem.Text, Fecha, IdCuentaBancariaOrigen, -1, CveClasificacion:=CveClasificacionDescuento, CveSubProyecto:=CveSubProyecto, ImporteMX:=Comision * TipoCambio, CveCuenta:=CveCuentaBancariaOrigen) Then OcurrioError = True End If End If + If 1 = 1 Then + CveSubProyectoIntermediario = DdlSubProyectoIntermediario.SelectedValue.ToEntero + CveSubProyectoIntermediario = DdlClasificacionIntermediario.SelectedValue.ToEntero - Else - OcurrioError = True - End If + If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, False, Descuento, DdlClasificacionDescuento.SelectedItem.Text, 51, DdlClasificacionDescuento.SelectedItem.Text, Fecha, IdCuentaBancariaOrigen, -1, CveClasificacion:=CveClasificacionDescuento, CveSubProyecto:=CveSubProyecto, ImporteMX:=Comision * TipoCambio) Then + OcurrioError = True + End If - For Each Gvr As GridViewRow In GvFacturas.Rows + If IVA <> 0 Then + If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, False, IVA, DdlClasificacionIntermediario.SelectedItem.Text, 14, DdlClasificacion.SelectedItem.Text, Fecha, IdCuentaBancariaOrigen, -1, CveClasificacion:=CveClasificacionIntermediario, CveSubProyecto:=CveSubProyectoIntermediario, ImporteMX:=IVA, CveCuenta:=CveCuentaBancariaOrigen, PorcentajeImpuesto:=0.16D) Then + OcurrioError = True + End If + End If - If Gvr.FCCheckBox("ChkFactura").Checked Then - 'Datos de las Nuevas PrePolizas - 'Entrada a Bancos - - Dim Importe As Decimal = Gvr.DataKey("Importe").ToDecimal - Dim SerieFolio As String = Gvr.DataKey("SerieFolio").ToString - - 'Datos de las Prepolizas A Cancelar - Dim CveIE As Integer = Gvr.DataKey("CveIE").ToEntero - Dim CveVenta As Integer = Gvr.DataKey("CveVenta").ToEntero - Dim CvePrePoliza As Integer = Gvr.DataKey("CvePrePoliza").ToEntero - - FolioIE = ObjBancos.GetNextFolio(DdlCajaChica.SelectedValue.ToEntero, 2) - If Not FolioIE > 0 Then - OcurrioError = True - Exit For - End If - CveIEDestino = ObjBancos.AddBancos_IE(DdlCajaChica.SelectedValue.ToEntero, 2, Fecha, FolioIE.ToString, String.Format("Depósito Bancario: {0}", SerieFolio), Importe, CveMoneda, 1, "Depósito Bancario", "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - - - If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, True, Importe, SerieFolio, 30, String.Format("Depósito Bancario: {0}", SerieFolio), Fecha, IdCuentaBancariaDestino, -1, CveClasificacion:=CveClasificacion, CveSubProyecto:=CveSubProyecto, CveIE:=CveIEDestino, ImporteMX:=Importe * TipoCambio, CveCuenta:=CveCuentaBancariaDestino) Then - OcurrioError = True - Exit For End If - 'Asignamos la cuenta Deposito - If Not OcurrioError AndAlso Not ObjBancos.UpdateBancos_IECuentaDeposito(CveIEDestino, CveIE) Then - OcurrioError = True - Exit For - End If - Dim StrEncript As String = Encripta($"OP=DC&CveIE={CveIEDestino}&CuentaCaja={DdlCajaChica.SelectedItem.Text}&CuentaDepo={DdlCuentaDeposito.SelectedItem.Text}") - - 'documentos += String.Format("Imprimir {1}

", StrEncript, SerieFolio) + Else + OcurrioError = True End If - Next + For Each Gvr As GridViewRow In GvFacturas.Rows + + If Gvr.FCCheckBox("ChkFactura").Checked Then + 'Datos de las Nuevas PrePolizas + 'Entrada a Bancos + + Dim Importe As Decimal = Gvr.DataKey("Importe").ToDecimal + Dim SerieFolio As String = Gvr.DataKey("SerieFolio").ToString + + 'Datos de las Prepolizas A Cancelar + Dim CveIE As Integer = Gvr.DataKey("CveIE").ToEntero + Dim CveVenta As Integer = Gvr.DataKey("CveVenta").ToEntero + Dim CvePrePoliza As Integer = Gvr.DataKey("CvePrePoliza").ToEntero + + FolioIE = ObjBancos.GetNextFolio(DdlCajaChica.SelectedValue.ToEntero, 2) + If Not FolioIE > 0 Then + OcurrioError = True + Exit For + End If + CveIEDestino = ObjBancos.AddBancos_IE(DdlCajaChica.SelectedValue.ToEntero, 2, Fecha, FolioIE.ToString, String.Format("Depósito Bancario: {0}", SerieFolio), Importe, CveMoneda, 1, "Depósito Bancario", "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - If OcurrioError Then - ObjContabilidad.RollBack() - Alert("Ocurrio un error al realizar los depositos", TipoMensaje.MsgError) - Else - ObjContabilidad.Commit() - CargaDatos() + If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, True, Importe, SerieFolio, 30, String.Format("Depósito Bancario: {0}", SerieFolio), Fecha, IdCuentaBancariaDestino, -1, CveClasificacion:=CveClasificacion, CveSubProyecto:=CveSubProyecto, CveIE:=CveIEDestino, ImporteMX:=Importe * TipoCambio, CveCuenta:=CveCuentaBancariaDestino) Then + OcurrioError = True + Exit For + End If - documentos += String.Format("Prepóliza

", NuevaCvePrePoliza) + 'Asignamos la cuenta Deposito + If Not OcurrioError AndAlso Not ObjBancos.UpdateBancos_IECuentaDeposito(CveIEDestino, CveIE) Then + OcurrioError = True + Exit For + End If + Dim StrEncript As String = Encripta($"OP=DC&CveIE={CveIEDestino}&CuentaCaja={DdlCajaChica.SelectedItem.Text}&CuentaDepo={DdlCuentaDeposito.SelectedItem.Text}") - Alert(documentos.ToString) + 'documentos += String.Format("Imprimir {1}

", StrEncript, SerieFolio) + End If + + Next - End If - TxtComision.Text = "" - TxtDescuento.Text = "" - TxtIVA.Text = "" - TxtComisionIntermediario.Text = "" - ObjContabilidad.Dispose() + If OcurrioError Then + ObjContabilidad.RollBack() + Alert("Ocurrio un error al realizar los depositos", TipoMensaje.MsgError) + Else + ObjContabilidad.Commit() + CargaDatos() + + documentos += String.Format("Prepóliza

", NuevaCvePrePoliza) + + Alert(documentos.ToString) + + + End If + TxtComision.Text = "" + TxtDescuento.Text = "" + TxtIVA.Text = "" + TxtComisionIntermediario.Text = "" + ObjContabilidad.Dispose() End Sub Private Sub ObtenerTotalImporta() diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index a23bab7ba..869450e2f 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -735,8 +735,8 @@ Partial Class ContabilidadC_RegPrePolizaS dr("CvePersonal") = drt("CvePersonal") dr("CveClasificacion") = -1 dr("MultipleSubProyecto") = drt("MultipleSubProyecto") - dr("FolioPoliza") = drt("FolioPoliza") - + 'dr("FolioPoliza") = 0 'drt("FolioPoliza") + DtMovimientos.Rows.Add(dr) Next diff --git a/Contratos/ContratoObra.aspx.vb b/Contratos/ContratoObra.aspx.vb index 8573e6e37..9826998e5 100644 --- a/Contratos/ContratoObra.aspx.vb +++ b/Contratos/ContratoObra.aspx.vb @@ -1679,9 +1679,9 @@ Partial Class Contratos_ContratoObra If e.Row.DBCampo("PermitirEstimacion").ToString = "1" Then ' e.Row.FCCheckBox("CHKPEstimacion").Checked = True End If - If Autorizado Then - e.Row.FCLinkButton("imgE").Visible = False - e.Row.FCLinkButton("imgD").Visible = False + If Autorizado Then + ' e.Row.FCLinkButton("imgE").Visible = False + 'e.Row.FCLinkButton("imgD").Visible = False End If If CveTipoContrato = 25 Then e.Row.Cells(1).Width = Unit.Pixel(10) @@ -2044,8 +2044,8 @@ Partial Class Contratos_ContratoObra ' e.Row.FCCheckBox("CHKPEstimacion").Checked = True End If If Autorizado Then - e.Row.FCLinkButton("imgE").Visible = False - e.Row.FCLinkButton("imgD").Visible = False + 'e.Row.FCLinkButton("imgE").Visible = False + 'e.Row.FCLinkButton("imgD").Visible = False End If End If diff --git a/Contratos/FacturacionMasiva.aspx.vb b/Contratos/FacturacionMasiva.aspx.vb index 7e2e5216f..8deac32ec 100644 --- a/Contratos/FacturacionMasiva.aspx.vb +++ b/Contratos/FacturacionMasiva.aspx.vb @@ -566,16 +566,21 @@ Partial Class Contratos_FacturacionMasiva DtR("Cantidad") = row("CantidadContratada") DtR("CveUM") = row("CveUM") DtR("UM") = row("UM") - DtR("SATClaveUM") = row("SATClaveUnidadMedida") + + DtR("SATClaveUM") = row("SATClaveUM") DtR("CveClasificacion") = row("CveClasificacion") DtR("Clasificacion") = row("Clasificacion") DtR("CvePS") = row("CvePS") DtR("PS") = row("PS") DtR("CodigoPS") = row("CodigoPS") - DtR("SATClaveProdServ") = row("SATClavePS") + + DtR("SATClaveProdServ") = row("SATClaveProdServ") + DtR("NoIdentificacion") = row("NoIdentificacion") + DtR("CveTipoPS") = drPS("CveTipoPS") DtR("CveTipoInvPS") = drPS("Inv_CveMetodoInventario") + DtR("Obs") = TxtObservaciones.Text + " " + row("Observacion").ToString DtR("PU") = row("PU") DtR("IVA") = row("PorcentajeIVA") diff --git a/CxC/RepCxC.aspx b/CxC/RepCxC.aspx index 82e7afba0..374b50382 100644 --- a/CxC/RepCxC.aspx +++ b/CxC/RepCxC.aspx @@ -335,6 +335,9 @@ +
+ +
diff --git a/CxC/RepCxC.aspx.vb b/CxC/RepCxC.aspx.vb index f049dfde1..e625f98bc 100644 --- a/CxC/RepCxC.aspx.vb +++ b/CxC/RepCxC.aspx.vb @@ -105,6 +105,7 @@ Partial Class RepCxC CargaCombos() CargaGvPersonalizarRaqngoColumnas() CargaDatos() + If UsuarioActual.CveEmpresa.Contiene(72, 80, 146) Then ChkAnticipos.visible = True ActivaEnviarEstadoCuenta() If UsuarioActual.CveRol = 1 Or UsuarioActual.TienePermisoProceso(243) Then LnkDescargarSegmentos.Visible = True CreaDataTableColor() @@ -195,12 +196,14 @@ Partial Class RepCxC CveCobranzaEstatus = DdlCobranzaEstatus.SelectedValue.ToEntero CveClienteClasificacion = DdlClienteClasificacion.SelectedValue.ToEntero Dim CveCliente = If(DdlClientesWS.SelectedValue.ToEntero > 0, DdlClientesWS.SelectedValue.ToEntero, -1) + Dim AplicaAnticipos As Integer = If(ChkAnticipos.checked, 1, 0) + If ObjMovtos.GetCxC(FechaI, FechaF, CveCliente, DdlSubProyecto.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero, -1, "-1", UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, DdlResponsable.SelectedValue.ToEntero, RblTipoCambio.SelectedValue.ToEntero, TCEspecifico, If(DdlTipoDocto.GetSelectedValuesM = "", "-1", DdlTipoDocto.GetSelectedValuesM), FechaVI, FechaVF, FechaCorte:=txtCorteA.Text.ToDate, EstatusCliente:=DdlEstatusCliente.SelectedValue.ToEntero, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveCobranzaEstatus:=CveCobranzaEstatus, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, - TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero) Then + TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, AplicaAnticiposPagados:=AplicaAnticipos) Then GvDatos.DataSource = ObjMovtos.DtResultados DtDatos = ObjMovtos.DtResultados