From 3689b897c5dffe27d8e7cfcbd325e14559c4355b Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Wed, 26 Feb 2020 08:53:26 -0700 Subject: [PATCH 01/34] Reclutamiento se qiuita required telefono en caso de emergencia --- Compras/RepDocumentacionProveedor.aspx | 51 +++++--------------------- PortalProveedor/PortalProveedor.aspx | 2 + RH/Reclutamiento.aspx | 3 +- vwd.webinfo | 2 + 4 files changed, 14 insertions(+), 44 deletions(-) diff --git a/Compras/RepDocumentacionProveedor.aspx b/Compras/RepDocumentacionProveedor.aspx index c6704dc1e..f4f0139f4 100644 --- a/Compras/RepDocumentacionProveedor.aspx +++ b/Compras/RepDocumentacionProveedor.aspx @@ -31,7 +31,6 @@ -
@@ -60,12 +59,8 @@
- - - <%-- --%> - - - <%----%> + + @@ -77,17 +72,12 @@ - <%-- --%> + - - - <%----%> - - - <%----%> + + -
Estatus
@@ -100,18 +90,12 @@ Completado - - + - - -
> +
- - -
@@ -211,17 +195,7 @@ - - - - - - <%-- - - - - --%> + @@ -258,14 +232,7 @@ - - -<%-- - - - - --%> - + diff --git a/PortalProveedor/PortalProveedor.aspx b/PortalProveedor/PortalProveedor.aspx index 912ae99df..9f78f83f6 100644 --- a/PortalProveedor/PortalProveedor.aspx +++ b/PortalProveedor/PortalProveedor.aspx @@ -801,6 +801,7 @@ <%---2020/02/06 - Auditoria--%> + @@ -931,6 +932,7 @@ + diff --git a/RH/Reclutamiento.aspx b/RH/Reclutamiento.aspx index 5108a7c66..14a22baa5 100644 --- a/RH/Reclutamiento.aspx +++ b/RH/Reclutamiento.aspx @@ -552,8 +552,7 @@
- +
diff --git a/vwd.webinfo b/vwd.webinfo index 0770194b6..2515705b1 100644 --- a/vwd.webinfo +++ b/vwd.webinfo @@ -19,6 +19,8 @@ + + \ No newline at end of file From 21e0d4e1a0a9a97cd07ba6ef593b677d064671d5 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Wed, 26 Feb 2020 09:13:59 -0700 Subject: [PATCH 02/34] cambios en los titulos --- AC/Reportes/RepEstadoActividades.rdlc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/AC/Reportes/RepEstadoActividades.rdlc b/AC/Reportes/RepEstadoActividades.rdlc index ccef55f1d..931f42736 100644 --- a/AC/Reportes/RepEstadoActividades.rdlc +++ b/AC/Reportes/RepEstadoActividades.rdlc @@ -754,7 +754,7 @@ - Resultados del Ejercicio (Ahorro/Desahorro): + Resultados del ejercicio(Utilidad o pérdida): - - + + + =Parameters!CiudadSucursal.Value + + + + diff --git a/Inventarios/PopUpExistenciasAlmacen.aspx b/Inventarios/PopUpExistenciasAlmacen.aspx index 4d0b6cd19..6b9f912bd 100644 --- a/Inventarios/PopUpExistenciasAlmacen.aspx +++ b/Inventarios/PopUpExistenciasAlmacen.aspx @@ -36,6 +36,18 @@ + + Medida: + + + + + + Rin: + + + + C. Barras: @@ -89,7 +101,7 @@
-
+
@@ -101,6 +113,18 @@
+
+ + + + + + + + + + +
diff --git a/Inventarios/PopUpExistenciasAlmacen.aspx.vb b/Inventarios/PopUpExistenciasAlmacen.aspx.vb index a3b1a02d3..4f988dc7f 100644 --- a/Inventarios/PopUpExistenciasAlmacen.aspx.vb +++ b/Inventarios/PopUpExistenciasAlmacen.aspx.vb @@ -65,6 +65,13 @@ Partial Class Inventarios_Default DDlPS.DataBind() End If + If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then + DivMed.Visible = True + DivRin.Visible = True + CargarMedRin() + DivMedRin.Visible = True + DivPS.Visible = False + End If Dim Txt As String = IfNull(Request("Txt"), "").ToString If Txt <> "" Then LblTitulo.Text = String.Format("Búsqueda de {0}", Txt) @@ -80,7 +87,11 @@ Partial Class Inventarios_Default End Sub Protected Sub BtnBuscar_Click(sender As Object, e As System.EventArgs) Handles BtnBuscar.Click - CargaDatos(DDlPS.SelectedValue.ToEntero, 1) + If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then + CargarDatosMedRin() + Else + CargaDatos(DDlPS.SelectedValue.ToEntero, 1) + End If End Sub Private Sub CargaDatos(CvePS As Integer, Tipo As Integer) Dim ObjInventarios As New ClsInventarios() @@ -162,6 +173,19 @@ Partial Class Inventarios_Default End If End Sub + Private Sub GvMedRin_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvMedRin.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then + If e.Row.DBCampo("CveAlmacen") = "" Then + e.Row.CssClass = "Totales" + End If + + If UsuarioActual.CveEmpresa = 119 Then + GV.Columns(5).Visible = True + End If + End If + End Sub + + #Region " BUSCA | CODIGO - SERIE " Protected Sub BtnCodigoPS_Click(sender As Object, e As EventArgs) @@ -178,11 +202,38 @@ Partial Class Inventarios_Default Exit Sub End If + CargaDatos(DrPS("CvePS").ToString.ToEntero, 2) + TxtCodigoPS.Text = "" TxtCodigoPS.Focus() End Sub #End Region + Private Sub CargarMedRin() + Dim ObjGral As New ClsGenerales + If ObjGral.GetMedidas(UsuarioActual.CveEmpresa) Then + DdlMedidas.DataSource = ObjGral.DtResultados + If ObjGral.GetRimTamanios(UsuarioActual.CveEmpresa) Then + DdlRin.DataSource = ObjGral.DtResultados + End If + End If + ObjGral.Dispose() + DdlMedidas.DataBind() + DdlRin.DataBind() + DdlMedidas.Items.Insert(0, New ListItem("-", "-1")) + DdlRin.Items.Insert(0, New ListItem("-", "-1")) + End Sub + + Private Sub CargarDatosMedRin() + Dim ObjInventarios As New ClsInventarios + If ObjInventarios.GetExistenciasMedRin(DDlPS.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlRin.SelectedValue.ToEntero, DdlMedidas.SelectedValue.ToEntero) Then + GvMedRin.DataSource = ObjInventarios.DtResultados + End If + ObjInventarios.Dispose() + GvMedRin.DataBind() + UPDatos.Update() + End Sub + End Class From 017f404b32f579ae6e45bbd18b9be91581cac00b Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 26 Feb 2020 19:01:27 -0700 Subject: [PATCH 04/34] Generar OC a partir de una cotizacion y modificar precios --- App_Code/ClsOC.vb | 5 ++-- App_Code/ClsVentas.vb | 22 +++++++++++++- OC/OC.aspx.vb | 68 ++++++++++++++++++++++++++++++++++++++++--- Ventas/Ventas.aspx | 5 +++- Ventas/Ventas.aspx.vb | 23 +++++++++++++-- 5 files changed, 112 insertions(+), 11 deletions(-) diff --git a/App_Code/ClsOC.vb b/App_Code/ClsOC.vb index 463101747..0cbe50889 100644 --- a/App_Code/ClsOC.vb +++ b/App_Code/ClsOC.vb @@ -1230,7 +1230,7 @@ Public Class ClsOC pObservacion As String, pCveUsuario As Integer, Optional pCveOrdenCompraPadre As Integer = -1, Optional CvePresupuestoEgreso As Integer = -1, Optional Descuento As Double = 0, Optional IEPSPS As Double = 0, Optional IEPSPSIVA As Double = 0, Optional IVA As Double = 0, Optional RetIVA As Double = 0, Optional RetISR As Double = 0, Optional Total As Double = 0, Optional CveContratoDetalle As Integer = -1, Optional IVAPorcentaje As Double = 0, Optional RetIVAPorcentaje As Double = 0, Optional RetISRPorcentaje As Double = 0, Optional IEPSPSPorcentaje As Double = 0, - Optional IEPSPSIVAPorcentaje As Double = 0) As Boolean + Optional IEPSPSIVAPorcentaje As Double = 0, Optional CveVentaDetalleCotizacion As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OC_OrdenesCompraDetalleAdd") @@ -1259,7 +1259,8 @@ Public Class ClsOC .Add("@RetIVAPorcentaje", SqlDbType.Float).Value = RetIVAPorcentaje .Add("@RetISRPorcentaje", SqlDbType.Float).Value = RetISRPorcentaje .Add("@IEPSPSPorcentaje", SqlDbType.Float).Value = IEPSPSPorcentaje - .Add("@IEPSPSIVAPorcentaje", SqlDbType.Float).Value = IEPSPSIVAPorcentaje + .Add("@IEPSPSIVAPorcentaje", SqlDbType.Float).Value = IEPSPSIVAPorcentaje + .Add("@CveVentaDetalleCotizacion", SqlDbType.Int).Value = CveVentaDetalleCotizacion End With Try diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 7334abade..04e7b8bb6 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -179,6 +179,25 @@ Public Class ClsVentas Return Retorno End Function + Public Function GetVentasCotizacionesOC(CveVenta As Integer, CveOC As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_VentasCotizacionesOCGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .Add("@CveOC", SqlDbType.Int).Value = CveOC + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los datos de la cotizacion, VentaTerminal.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function Public Function GetVentas(CveEmpresa As Integer, TipoDocto As String, Serie As String, Folio As Integer, Codigo As String, CveCliente As Integer, CveSubProyecto As Integer, CveEstatus As Integer, CveUsuario As Integer, FechaI As String, FechaF As String, FolioFiscal As String, Optional CveClienteSucursal As Integer = -1, Optional CvePS As Integer = -1, Optional PedidoContrato As String = "-1", Optional OrdenCompra As String = "-1", Optional CveUsuarioConsulta As Integer = -1, Optional ClienteRFC As String = "-1", @@ -3934,7 +3953,7 @@ Public Class ClsVentas Return retorno End Function - Public Function RepIngresosDetalle(CveEmpresa As Integer, FechaInicio As Date, FechaFin As Date, TipoDocto As String, CveSubProyecto As Integer, CveConceptoContable As Integer, CveCuenta As Integer) As Boolean + Public Function RepIngresosDetalle(CveEmpresa As Integer, FechaInicio As Date, FechaFin As Date, TipoDocto As String, CveSubProyecto As Integer, CveConceptoContable As Integer, CveCuenta As Integer, TipoAmortizacion As Integer) As Boolean Dim retorno As Boolean = False DataAdapter("PA_Ventas_RepIngresosDetalle", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters @@ -3945,6 +3964,7 @@ Public Class ClsVentas .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveConceptoContable", SqlDbType.Int).Value = CveConceptoContable .Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta + .Add("@TipoAmortizacion", SqlDbType.Int).Value = TipoAmortizacion End With Try SqlAdapter.Fill(Data) diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index 4e74dad9d..f1b7bf225 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -534,6 +534,18 @@ Partial Class OC End If End If + Dim DtOCGeneradas As DataTable = Nothing + If ObjVentas.GetVentasCotizacionesOC(Me.CveVenta, -1, UsuarioActual.CveEmpresa) Then + DtOCGeneradas = ObjVentas.DtResultados.Copy() + End If + + If DtOCGeneradas IsNot Nothing AndAlso DtOCGeneradas.Rows.Count > 0 Then + ObjVentas.Dispose() + BtnGuardar.Enabled = False + Alert("Ya existe una OC con esta cotización", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + CargaClasificacionesPopUp(CveCotizacion) ObjVentas.Dispose() End If @@ -971,6 +983,8 @@ Partial Class OC DtDetalle.Columns.Add("CveContratoDetalle", GetType(Integer)) DtDetalle.Columns.Add("CantidadNoEditable", GetType(Double)) + DtDetalle.Columns.Add("CveVentaDetalleCotizacion", GetType(Integer)) + 'DtDetalle.Columns.Add("CveOrdenCompraDetalle", GetType(Integer)) ' DtDetalle.Columns.Add("ClasificacionOG", GetType(String)) @@ -1040,6 +1054,10 @@ Partial Class OC dr("CveTipoGasto") = -1 dr("CveClasificacionOG") = -1 + If UsuarioActual.Empresa.Funcionalidad(583) = "1" Then + dr("CveVentaDetalleCotizacion") = RowV("CveVentaDetalle") + End If + DtDetalle.Rows.Add(dr) Next @@ -2318,7 +2336,7 @@ Partial Class OC Dim OCBitacora As New ClsOIEventos(OC.IniciaTransacSQL()) Dim ObjInventarios As New ClsInventarios(OC.IniciaTransacSQL()) Dim ObjConta As New ClsContabilidad(OC.IniciaTransacSQL()) - + Dim ObjVentas As New ClsVentas(OC.IniciaTransacSQL()) Dim Conta As ClsContPAQi = Nothing If (UsuarioActual.Empresa.UsaAC AndAlso VerificaPresupuesto) Or UsuarioActual.Empresa.Funcionalidad(200) = "1" Then Conta = New ClsContPAQi(UsuarioActual.Empresa) @@ -2361,7 +2379,12 @@ Partial Class OC CveOrdenCompraPadre = OC.CveOrdenCompra If CveOrdenCompraPadre > 0 Then For Each dr As DataRow In DtDetalle.Rows - If Not OC.AddOrdenCompraDetalle(CveOrdenCompraPadre, dr("Cantidad").ToString.ToDouble(), dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDouble, dr("CveSubProyecto").ToString.ToEntero(), dr("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, UsuarioActual.CveUsuario, Descuento:=dr("Descuento").ToString.ToDouble, IEPSPS:=dr("IEPSPS").ToString.ToDouble, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDouble, IVA:=dr("IVA").ToString.ToDouble, RetIVA:=dr("RetIVA").ToString.ToDouble, RetISR:=dr("RetISR").ToString.ToDouble, Total:=dr("Total").ToString.ToDouble, CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble) Then + If Not OC.AddOrdenCompraDetalle(CveOrdenCompraPadre, dr("Cantidad").ToString.ToDouble(), dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDouble, + dr("CveSubProyecto").ToString.ToEntero(), dr("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, UsuarioActual.CveUsuario, Descuento:=dr("Descuento").ToString.ToDouble, + IEPSPS:=dr("IEPSPS").ToString.ToDouble, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDouble, IVA:=dr("IVA").ToString.ToDouble, RetIVA:=dr("RetIVA").ToString.ToDouble, + RetISR:=dr("RetISR").ToString.ToDouble, Total:=dr("Total").ToString.ToDouble, CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDouble, + RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble, + IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble) Then TieneError = True Exit For End If @@ -2435,11 +2458,20 @@ Partial Class OC For Each dr As DataRow In DtDetalle.Rows - If Not OC.AddOrdenCompraDetalle(CveOrdenCompra, dr("Cantidad").ToString.ToDouble(), dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDouble, dr("CveSubProyecto").ToString.ToEntero(), dr("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, UsuarioActual.CveUsuario, CvePresupuestoEgreso:=dr("CvePresupuestoEgreso").ToString.ToEntero, pCveOrdenCompraPadre:=CveOrdenCompraPadre, Descuento:=dr("Descuento").ToString.ToDouble, IEPSPS:=dr("IEPSPS").ToString.ToDouble, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDouble, IVA:=dr("IVA").ToString.ToDouble, RetIVA:=dr("RetIVA").ToString.ToDouble, RetISR:=dr("RetISR").ToString.ToDouble, Total:=dr("Total").ToString.ToDouble, CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble) Then + If Not OC.AddOrdenCompraDetalle(CveOrdenCompra, dr("Cantidad").ToString.ToDouble(), dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDouble, dr("CveSubProyecto").ToString.ToEntero(), dr("CveActivoFijo").ToString.ToEntero, + dr("Observacion").ToString, UsuarioActual.CveUsuario, CvePresupuestoEgreso:=dr("CvePresupuestoEgreso").ToString.ToEntero, pCveOrdenCompraPadre:=CveOrdenCompraPadre, Descuento:=dr("Descuento").ToString.ToDouble, IEPSPS:=dr("IEPSPS").ToString.ToDouble, + IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDouble, IVA:=dr("IVA").ToString.ToDouble, RetIVA:=dr("RetIVA").ToString.ToDouble, RetISR:=dr("RetISR").ToString.ToDouble, Total:=dr("Total").ToString.ToDouble, CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, + IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble, + IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble, CveVentaDetalleCotizacion:=dr("CveVentaDetalleCotizacion").ToString().ToEntero()) Then TieneError = True Exit For End If Next + + If Not TieneError AndAlso UsuarioActual.Empresa.Funcionalidad(583) = "1" Then + TieneError = Not ActualizarCotizacion(ObjVentas) + End If + Else TieneError = True End If @@ -2887,6 +2919,7 @@ Partial Class OC Else 'TERMINA TODO POR SI OCURRIÓ ALGO RARO If OC IsNot Nothing Then OC.Dispose() + If ObjVentas IsNot Nothing Then ObjVentas.Dispose() If Conta IsNot Nothing Then Conta.Dispose() 'MANDA CORREOS SI EL ESTATUS ES MAYOR A 0 @@ -5043,7 +5076,7 @@ Partial Class OC End Function #End Region -#Region " COTIZACIONES " +#Region "C O T I Z A C I O N E S" Protected Sub VerificaSiRequiereCotizacion() If TipoOC = "REQ" Then If ChkCotizacion.Checked Then @@ -5083,6 +5116,32 @@ Partial Class OC VerificaCotizacionesGanadoras() End If End Sub + + Protected Function ActualizarCotizacion(ByRef ObjVentas As ClsVentas) As Boolean + Dim OcurrioError As Boolean = False + Try + Dim PorcentajeGanancia As Decimal = 0.1D + For Each Row As DataRow In DtDetalle.Rows + Dim CvePS As Integer = Row("CvePS").ToString.ToEntero + Dim DrPS = GlobalDTPS(CveEmpresaActual, CvePS:=CvePS).FiltroPrimero("") + + Dim Cantidad As Decimal = Row("Cantidad").ToString.ToDecimal + Dim PU As Decimal = Row("Importe").ToString.ToDecimal() + (Row("Importe").ToString.ToDecimal() * PorcentajeGanancia) + Dim IEPSPS As Decimal = DrPS("IEPSPorcentaje").ToString.ToDecimal + Dim ImporteIEPS As Decimal = ((Cantidad * PU) * IEPSPS).RoundSQL(2) + + If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalleCotizacion").ToString.ToEntero, CvePS, Cantidad, PU, ImporteIEPS, "", UsuarioActual.CveUsuario) Then + OcurrioError = True + Exit For + End If + Next + Catch ex As Exception + OcurrioError = True + OnError("Ocurrió un error al guardar la cotización", ex) + End Try + + Return Not OcurrioError + End Function #End Region Private Function notienepresupuesto() As Boolean @@ -7544,4 +7603,5 @@ Partial Class OC End Sub #End Region + End Class diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 40b64fa71..840c535f4 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -308,6 +308,9 @@ <%----%> Saldar +
  • + Generar Orden de Compra +
  • @@ -3541,7 +3544,7 @@
    + DataKeyNames="ISTotal,Saldo,CveIE,Folio,Tipo,CveVenta,CveConceptoContable,CveConceptoContableAmor, TotalAnticipo, SubTotalAnticipo, IVAAnticipo, ImpuestosLocalesAnticipo, SubTotalAmortizacion, SubTotal, Original, IVA, RetIVA, RetISR, IdCtaContableNC,FolioFiscal, CveClasificacionNC, IdCtaContableNCSIG, TipoCambio,TipoCambioPago,TipoCambioHoy, CveMoneda,Fecha,SaldoSubTotal"> diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index d5fb792ac..4713b0e7e 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -3543,6 +3543,7 @@ Partial Class Ventas ' LbCancelarDocumentoManual.Visible = True 'End If + If Not CveEstatus.Contiene(4, 5, 12, 13, 20) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Egs", "Ant") AndAlso UsuarioActual.TienePermisoProceso(159) Then Dim TienePermiso As String = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, -1).FiltroPrimeroValor("CveSubProyecto", String.Format("CveSubProyecto = {0}", DbRowVenta("CveSubProyecto"))) If TienePermiso <> "" Then @@ -4362,6 +4363,19 @@ Partial Class Ventas CargaCodigoUnico() + 'SI ES COTIZACION PUEDE GENERAR UNA OC PARA MODIFICAR LOS IMPORTES + If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(583) = "1" Then + Dim DtOCGeneradas As DataTable = Nothing + If ObjVentas.GetVentasCotizacionesOC(Me.CveVenta, -1, UsuarioActual.CveEmpresa) Then + DtOCGeneradas = ObjVentas.DtResultados.Copy() + End If + If DtOCGeneradas IsNot Nothing AndAlso DtOCGeneradas.Rows.Count > 0 Then + LtGenerarOC.Visible = False + Else + LtGenerarOC.Visible = True + End If + End If + UpPS.Update() UpContado.Update() UpEstatus.Update() @@ -11670,7 +11684,7 @@ Partial Class Ventas If e.Row.DBCampo("Tipo").ToString = "NC" And e.Row.DataKey("CveVenta").ToString.ToEntero > 0 Then If e.Row.DBCampo("CveMoneda").ToString.ToEntero = 2 Then - tipoCambio = e.Row.DataKey("TipoCambio").ToString.ToDecimal + tipoCambio = e.Row.DBCampo("TipoCambioHoy").ToString.ToDecimal Else tipoCambio = GlobalTipoCambio(e.Row.DataKey("Fecha").ToString.ToDate).ToDecimal End If @@ -11703,7 +11717,7 @@ Partial Class Ventas maxsaldo = total End If - e.Row.FCLiteral("MonedaVenta").Text = saldo.FormatoNumero(4) + e.Row.FCLiteral("MonedaVenta").Text = saldo.FormatoNumero(2) e.Row.FCCheckBox("Chk" & e.Row.RowIndex).Attributes.Add("onclick", String.Format("chkAnt(this,{0},{1});", e.Row.FCTextBox("TxtAnticipo" & e.Row.RowIndex).ClientID, saldo)) e.Row.FCTextBox("TxtAnticipo" & e.Row.RowIndex).Attributes.Add("onKeyUp", String.Format("FnCambiaAnt({0},this,{1});", e.Row.FCCheckBox("Chk" & e.Row.RowIndex).ClientID, saldo)) e.Row.FCTextBox("TxtTC" & e.Row.RowIndex).Attributes.Add("onKeyUp", String.Format("CambioTipoMoneda({0},{1},{2},{3},{4});", e.Row.FCCheckBox("Chk" & e.Row.RowIndex).ClientID, e.Row.DataKey("Saldo"), e.Row.FCTextBox("TxtAnticipo" & e.Row.RowIndex).ClientID, e.Row.FCTextBox("TxtTC" & e.Row.RowIndex).ClientID, e.Row.DataKey("CveMoneda"))) @@ -11874,7 +11888,7 @@ Partial Class Ventas tipoCambioVentaValuacion = If(TxtFecha.Text.ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, TxtTipoCambio.Text.ToDecimal) PorcentajePago = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("Original").ToDecimal ElseIf DdlMoneda.SelectedValue.ToEntero = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then 'SI LA VENTA VIENE EN PESOS Y SE VA A PAGAR EN DOLARES - tipoCambioPago = gvr.DataKey("TipoCambio").ToDecimal() ' gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal + tipoCambioPago = gvr.DataKey("TipoCambioHoy").ToDecimal() ' gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal tipoCambioVenta = 1 tipoCambioVentaValuacion = If(TxtFecha.Text.ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, TxtTipoCambio.Text.ToDecimal) PorcentajePago = (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal) / gvr.DataKey("Original").ToDecimal @@ -24658,4 +24672,7 @@ Partial Class Ventas ' Return File 'End Function + Protected Sub LnkGenerarOC_Click(sender As Object, e As EventArgs) + Response.Redirect($"~/OC/OC.aspx?CveCotizacion={Me.CveVenta}&Tipo=OC") + End Sub End Class \ No newline at end of file From f5e0e20efe5624ea81350d27b49899199c3b84ed Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 26 Feb 2020 19:01:51 -0700 Subject: [PATCH 05/34] Mostar detalle en el reporte de ingresos --- Ventas/RepIngresos.aspx | 12 ++++++------ Ventas/RepIngresos.aspx.vb | 6 +++--- Ventas/RepIngresosDetalle.aspx.vb | 25 +++++++++++++++++++------ 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/Ventas/RepIngresos.aspx b/Ventas/RepIngresos.aspx index 6647ee016..3a763c711 100644 --- a/Ventas/RepIngresos.aspx +++ b/Ventas/RepIngresos.aspx @@ -166,32 +166,32 @@ - + - + - + - + - + - + diff --git a/Ventas/RepIngresos.aspx.vb b/Ventas/RepIngresos.aspx.vb index 56a2fed0a..021cd086b 100644 --- a/Ventas/RepIngresos.aspx.vb +++ b/Ventas/RepIngresos.aspx.vb @@ -60,7 +60,7 @@ Partial Class Ventas_RepIngresos Set ViewState("CveSubProyecto") = Value End Set - End Property + End Property Private Property DtDatos As DataTable Get DtDatos = DirectCast(ViewState("DtDatos"), DataTable) @@ -69,9 +69,9 @@ Partial Class Ventas_RepIngresos Set(ByVal value As DataTable) ViewState("DtDatos") = value End Set - End Property + End Property #End Region - + Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not IsPostBack Then CveSubProyecto = -1 diff --git a/Ventas/RepIngresosDetalle.aspx.vb b/Ventas/RepIngresosDetalle.aspx.vb index ab6cd3e4f..c34689dc5 100644 --- a/Ventas/RepIngresosDetalle.aspx.vb +++ b/Ventas/RepIngresosDetalle.aspx.vb @@ -54,9 +54,20 @@ Partial Class Ventas_RepIngresosDetalle Set ViewState("CveCuenta") = Value End Set - End Property + End Property + + Private Property TipoAmortizacion() As Integer + Get + Return If(IsNothing(ViewState("TipoAmortizacion")), -1, ViewState("TipoAmortizacion").ToString().ToEntero()) + End Get + Set + ViewState("TipoAmortizacion") = Value + End Set + End Property + + #End Region - + Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not IsPostBack Then DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) @@ -67,18 +78,20 @@ Partial Class Ventas_RepIngresosDetalle CveCuenta = If(IsNothing(Request("CveCuenta")), "", Request("CveCuenta").ToString()) CveSubProyecto = If(IsNothing(Request("CveSubProyecto")), 0, Request("CveSubProyecto").ToString().ToEntero()) CveConceptoContable = If(IsNothing(Request("CveConceptoContable")), -1, Request("CveConceptoContable").ToString().ToEntero()) + TipoAmortizacion = If(IsNothing(Request("TipoAmortizacion")), -1, Request("TipoAmortizacion").ToString().ToEntero()) TxtFechaInicio.Text = If(RsFechaI.Length > 6, DateTime.ParseExact(RsFechaI, "yyyy/MM/dd", Nothing).ToString("dd/MM/yyyy"), "") TxtFechaFin.Text = If(RsFechaF.Length > 6, DateTime.ParseExact(RsFechaF, "yyyy/MM/dd", Nothing).ToString("dd/MM/yyyy"), "") DdlTipoDocto.SelectedValueExist(TipoDoc) DdlSubProyecto.SelectedValueExist(CveSubProyecto.ToString()) ' - CargaRepIngresosDetalle() + LnkFiltrar_Click(LnkFiltrar, EventArgs.Empty) End If End Sub Protected Sub CargaRepIngresosDetalle() Dim ObjRepI As New ClsVentas() - ObjRepI.RepIngresosDetalle(UsuarioActual.CveEmpresa, If(RsFechaI = "", MinFecha, RsFechaI.ToDate), If(RsFechaF = "", MaxFecha, RsFechaF.ToDate), TipoDoc, CveSubProyecto, CveConceptoContable, CveCuenta) - GVRepIngresos.DataSource = ObjRepI.DtResultados + If ObjRepI.RepIngresosDetalle(UsuarioActual.CveEmpresa, If(RsFechaI = "", MinFecha, RsFechaI.ToDate), If(RsFechaF = "", MaxFecha, RsFechaF.ToDate), TipoDoc, CveSubProyecto, CveConceptoContable, CveCuenta, TipoAmortizacion) Then + GVRepIngresos.DataSource = ObjRepI.DtResultados + End If ObjRepI.Dispose() GVRepIngresos.DataBind() upDatosRepI.Update() @@ -94,7 +107,7 @@ Partial Class Ventas_RepIngresosDetalle End Sub Protected Sub GVRepIngresos_RowDataBound(sender As Object, e As GridViewRowEventArgs) If e.Row.RowType = DataControlRowType.DataRow Then - If e.Row.DBCampo("GTipoDocto").ToString().ToEntero() = -1 Then + If e.Row.DBCampo("GTipoDocto").ToString().ToEntero() = -1 OrElse e.Row.DBCampo("SerieFolio").ToString() = "TOTAL" Then e.Row.CssClass = "Totales" End If End If From 8253081b9c65a825b19f35a0e54be50379a727fd Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Thu, 27 Feb 2020 15:23:33 -0700 Subject: [PATCH 06/34] agregando nuevo modulo de reporte --- App_Code/ClsCompras.vb | 19 ++ App_Code/ClsPaginas.vb | 2 +- Compras/RepEvaluacionesProveedores.aspx | 267 +++++++++++++++++++++ Compras/RepEvaluacionesProveedores.aspx.vb | 75 ++++++ 4 files changed, 362 insertions(+), 1 deletion(-) create mode 100644 Compras/RepEvaluacionesProveedores.aspx create mode 100644 Compras/RepEvaluacionesProveedores.aspx.vb diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index fc78fae11..38182d35c 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -2981,6 +2981,25 @@ Public Class ClsCompras Return Retorno End Function + Public Function GetRepEvaluacionesProveedores(CveEmpresa As Integer, CveProveedor As Integer, FechaI As Date, FechaF As Date, Evaluado As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Comp_RepEvaluacionesProveedoresGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@FechaI", SqlDbType.DateTime).Value = FechaI + .Add("@FechaF", SqlDbType.DateTime).Value = FechaF + .Add("@Evaluado", SqlDbType.Int).Value = Evaluado + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al querer obtener el reporte de evaluaciones de proveedores.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + #Region "REPORTE PUE SIN PAGO" Public Function GetPUESinPago(FI As DateTime, FF As DateTime, CveProveedor As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, Optional CveUsuario As Integer = -1) As Boolean diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index c38c36938..82c2fb15b 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -3959,7 +3959,7 @@ Public Class ClsPaginas PaginaDict.Add("/Compras/RepComprasPrecios.aspx".ToUpper(), 690) PaginaDict.Add("/Compras/RepDocumentacionProveedor.aspx".ToUpper(), 1206) PaginaDict.Add("/Compras/CatPaqueteriasGuiasTipo.aspx".ToUpper(), 753) - + PaginaDict.Add("/Compras/RepEvaluacionesProveedores.aspx".ToUpper(), 754) #End Region diff --git a/Compras/RepEvaluacionesProveedores.aspx b/Compras/RepEvaluacionesProveedores.aspx new file mode 100644 index 000000000..1824c9b33 --- /dev/null +++ b/Compras/RepEvaluacionesProveedores.aspx @@ -0,0 +1,267 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepEvaluacionesProveedores.aspx.vb" Inherits="RepEvaluacionesProveedores" %> + + + + + + + + + + + Evaluaciones de Proveedores + + +
  • + PDF +
  • +
  • + Excel +
  • +
    + + + +
    +
    +
    + + "> + +
    +
    +
    + +
    Proveedor
    +
    + +
    + +
    Fecha Inicio
    +
    +
    + + + + +
    + + + +
    + +
    Fecha Fin
    +
    +
    + + + + +
    + + +
    + +
    Evaluado
    +
    + + - + Sin Evaluar + Evaluar + +
    +
    + +
    +
    +
    > +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + <%-- --%> + \ No newline at end of file diff --git a/Compras/RepEvaluacionesProveedores.aspx.vb b/Compras/RepEvaluacionesProveedores.aspx.vb new file mode 100644 index 000000000..ff60e4eb8 --- /dev/null +++ b/Compras/RepEvaluacionesProveedores.aspx.vb @@ -0,0 +1,75 @@ +Imports System.Data +Imports Extensiones +Imports Microsoft.Reporting.WebForms + +Partial Class RepEvaluacionesProveedores + Inherits ClsPaginas + + Private Property DtDatos As DataTable + Get + DtDatos = DirectCast(ViewState("DtDatos"), DataTable) + End Get + + Set(ByVal value As DataTable) + ViewState("DtDatos") = value + End Set + End Property + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + If Not IsPostBack Then + CargaParametrosBusqueda() + CargarDatos() + End If + End Sub + + Private Sub CargaParametrosBusqueda() + DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) + DdlProveedor.DataBind() + DdlProveedor.Items.Insert(0, New ListItem("Todos", "-1")) + + Dim dNow As Date = Now + TxtFechaF.Text = dNow.ToString("dd/MM/yyyy") + dNow = dNow.AddDays(-30) + TxtFechaI.Text = dNow.ToString("dd/MM/yyyy") + End Sub + + Private Sub CargarDatos() + Dim ObjCompras As New ClsCompras + If ObjCompras.GetRepEvaluacionesProveedores(UsuarioActual.CveEmpresa, DdlProveedor.SelectedValue.ToEntero, TxtFechaI.Text, TxtFechaF.Text, DdlEvaluado.SelectedValue.ToEntero) Then + GV.DataSource = ObjCompras.DtResultados + DtDatos = ObjCompras.DtResultados + End If + ObjCompras.Dispose() + GV.DataBind() + UPDatos.Update() + End Sub + + Public Sub btConsultar_Click(sender As Object, e As EventArgs) Handles btConsultar.Click + CargarDatos() + End Sub + + Private Sub LnkPDF_Click(sender As Object, e As EventArgs) Handles LnkPDF.Click + Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) + Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + + Dim params As New List(Of ReportParameter) + params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa)) + If Imagen.Exists Then + params.Add(New ReportParameter("pImg", logouri)) + Else + params.Add(New ReportParameter("pImg", "")) + End If + params.Add(New ReportParameter("FechaInicial", TxtFechaI.Text)) + params.Add(New ReportParameter("FechaFinal", TxtFechaF.Text)) + params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) + params.Add(New ReportParameter("FechaImpresion", Today)) + params.Add(New ReportParameter("Proveedor", DdlProveedor.SelectedItem.ToString)) + + + ImprimirPDF("Empresas/Grales/Formatos/RepEvaluacionesProveedores.rdlc", DtDatos, params, "RepEvaluacionesProveedores", "PDF", RDSName:="DataSet1") + End Sub + + Public Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click + GV.ExportToExcel("Evaluaciones de Proveedores" & Now.ToShortDateString & ".xls") + End Sub +End Class \ No newline at end of file From c8a597ad80e3afec0eee19fb5c2f8602b7fab2bf Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Thu, 27 Feb 2020 17:59:10 -0700 Subject: [PATCH 07/34] Cambios en carta de proveedor --- Compras/EvaluacionProveedor.aspx.vb | 3 ++- .../Formatos/Plantillas/CartaProveedor.docx | Bin 87695 -> 87827 bytes 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Compras/EvaluacionProveedor.aspx.vb b/Compras/EvaluacionProveedor.aspx.vb index 6b2aef0a8..b842df48b 100644 --- a/Compras/EvaluacionProveedor.aspx.vb +++ b/Compras/EvaluacionProveedor.aspx.vb @@ -334,9 +334,10 @@ Partial Class Compras_EvaluacionProveedor ListaTagsDocumentost.Add(New TagsDocumentos("{{Proveedor}}", Proveedor)) ListaTagsDocumentost.Add(New TagsDocumentos("{{Dia}}", Dia)) ListaTagsDocumentost.Add(New TagsDocumentos("{{Mes}}", Mes)) + ListaTagsDocumentost.Add(New TagsDocumentos("{{Anio}}", Now.Year)) ListaTagsDocumentost.Add(New TagsDocumentos("{{Calificacion}}", Calificacion)) ListaTagsDocumentost.Add(New TagsDocumentos("{{Resultado}}", Resultado)) - ListaTagsDocumentost.Add(New TagsDocumentos("{{Usuario}}", UsuarioActual.Nombre)) + 'ListaTagsDocumentost.Add(New TagsDocumentos("{{Usuario}}", UsuarioActual.Nombre)) Dim MensajeInvitacion As String = "Le invitamos a participar en la implementación de acciones para la mejora de sus procesos." diff --git a/Empresas/13/Formatos/Plantillas/CartaProveedor.docx b/Empresas/13/Formatos/Plantillas/CartaProveedor.docx index 5d17cc4e6d047eb5349a98a160af54ed477a6655..5ae05f3644be4c70057d84a10f0e888dd446021e 100644 GIT binary patch delta 12565 zcmb7qWmH_tvM>_d-Q67m!QI_mg1fth9h~4kxVu{j8rKme+mNz)ZjCVZ06h%m$}AUhyDxI)t*W7cTC zC?aAqu|n#Guo~Kis3Yt=!9ALf`)N0-iBaed)(!vZ`?r}INhGtpa`2D50m2$VbLW!0 zb(V}nX6_W9X6WpxxyM-pCh*MZMz)iI@qNs?U*;Y#TZsFAI23pMAmz=K zO_k-d`Dg=6naJh~D&UGUXJBc3)YX0~>wer(|KqvpMYc}2TOmc%y;9kUh^N(`r`e(C=6va1t@4s}ECcq;c2@P(G~o`5ELQ z+Nk04qPU9UrBmm^CbYmjEHQWp`}Hv!s z_ngtpC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S;}Mt9}2?fn5Y~vFr(X;3&WGj(2llwGxUIw$}K2*vsVD z^7*>AbOee_wIOGWGN+kEat!O>Mmhr2EtG!a>Xu;tSO|9)HtM4vW8wA^z3*S^+JAn+> z5Q2l`7WItwq$ON-gHuy%Xe~Y#vJU;ojrDY#IMJH^YOT_%>k<6PIkuP;VNxs7xMmIm z^4QCj?k|v>y&mvVM)Z=u1~FDk_EIt>8i&LOQHmH$EU|FYfYk7O7bjYD9Zo0HxpLmT zgi}0Sfb8$3`5NAU4Kj^OlQ>$%+kR^n$n1fu8LxsQ*?F~VvGT3_a^>r34~CW7 zo?BGn4{eoDVD6k$oC@JDGn?agoGZe(T4Fb$=eOl`fo)z2O>;)qfCgmva^w8%N5Md5zA#JHp5+i zWvi~R!DQBu6qR~vO`%cyG~$0f)ZYR|DOPHqQ}B=F>(hlDer^Z;N~QX{ jSfrGzecJGk|LId; Date: Fri, 28 Feb 2020 09:14:58 -0700 Subject: [PATCH 08/34] - 141, para concepto 205 --- Compras/Compras.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 835abc0c4..9dfd2f0a2 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -4396,7 +4396,7 @@ Partial Class Compras_Compras 'End If 'METODO DE PREPOLIZA DE ALMACEN - If UsuarioActual.CveEmpresa.Contiene(1, 119, 72, 80, 140) And UsuarioActual.Empresa.UsaInventarios And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Then + If UsuarioActual.CveEmpresa.Contiene(1, 119, 72, 80, 140, 141) And UsuarioActual.Empresa.UsaInventarios And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Then Dim ImporteAlmacen = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 AND ISNULL(CveAlmacen,0) = 0 AND ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveTipoPS = 2").ToString.ToDecimal If ImporteAlmacen > 0 Then If Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then From 13b99a68d4daf05181ce61481c9faeaf68e255b2 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 28 Feb 2020 10:16:15 -0700 Subject: [PATCH 09/34] Correciones en tc --- Bancos/ProveedoresAbonar.aspx.vb | 74 ++++++++++++++++++++++++++------ 1 file changed, 62 insertions(+), 12 deletions(-) diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index 6d0c5000c..08c61a789 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -880,8 +880,24 @@ Partial Class Bancos_ProveedoresAbonar Dim tipoCambioCompra As Decimal Dim TipoCambioPago As Decimal = 0 Dim TipoCambioGeneral As Decimal = 0 - Dim FuncionalidadFluctuacionImpuestos As Boolean = If(UsuarioActual.Empresa.Funcionalidad(159) = "1", True, False) - + Dim tipoCambioCompraValuacion As Decimal = 1 + Dim FuncionalidadFluctuacionImpuestos As Boolean = If(UsuarioActual.Empresa.Funcionalidad(159) = "1", True, False) + + Dim TipoCambioFluctuacion As Decimal = 1 + Dim FechaUltimaFluctuacion As Date = MinFecha + If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then + If ObjIE.DtResultados.Rows.Count > 0 Then + Dim tFecha As Date = TxtFechaDocumento.Text.ToDate + Dim FechaC As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day) + Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & FechaC & "#", "Fecha DESC") + + If drr IsNot Nothing Then + FechaUltimaFluctuacion = drr("Fecha").ToString.ToDate + TipoCambioFluctuacion = drr("TipoCambio").ToString.ToDecimal + End If + + End If + End If 'inserto las compras que voy a pagar For Each gvr As GridViewRow In GvCxP.Rows @@ -895,11 +911,13 @@ Partial Class Bancos_ProveedoresAbonar ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then 'Si la venta viene en Dolares y se va a pagar en Pesos TipoCambioPago = TxtTC.Text.ToDecimal tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal + tipoCambioCompraValuacion = If(gvr.DataKey("Fecha").ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, gvr.DataKey("TipoCambio").ToDecimal) PorcentajePago = ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) / gvr.DataKey("Original").ToDecimal).RoundSQL ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then 'Si la venta viene en Dolares y se va a pagar en DOLARES 'TipoCambioPago = 'GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).ToString.ToDecimal TipoCambioPago = TxtTCDolaresDolares.Text.ToDecimal - tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal + tipoCambioCompraValuacion = If(gvr.DataKey("Fecha").ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, gvr.DataKey("TipoCambio").ToDecimal) PorcentajePago = gvr.FCTextBox("TxtAbonar").Text.ToDecimal / gvr.DataKey("Original").ToDecimal ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES TipoCambioPago = TxtTCDolares.Text.ToDecimal @@ -926,17 +944,17 @@ Partial Class Bancos_ProveedoresAbonar importeMX = ImporteMovimiento ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal - importeMX = gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioCompra + importeMX = gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioCompraValuacion ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal - importeMX = gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioCompra + importeMX = gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioCompraValuacion ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal - importeMX = ImporteMovimiento * tipoCambioCompra + importeMX = ImporteMovimiento * tipoCambioCompraValuacion End If ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero) importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero) - TipoCambioGeneral = tipoCambioCompra + TipoCambioGeneral = tipoCambioCompraValuacion ConceptoMovimiento = $"{HplProveedor.Text} F:{gvr.DataKey("SerieFolio")}" 'cuando son dolares, y tienen complementaria, se hace el registro If gvr.DataKey("CveMoneda").ToEntero = 1 Then @@ -961,12 +979,14 @@ Partial Class Bancos_ProveedoresAbonar ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago importeMX = ImporteMovimiento ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago importeMX = ImporteMovimiento * tipoCambioCompra ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago importeMX = ImporteMovimiento * tipoCambioCompra ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago importeMX = ImporteMovimiento * tipoCambioCompra End If @@ -1007,18 +1027,20 @@ Partial Class Bancos_ProveedoresAbonar ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago importeMX = ImporteMovimiento ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * tipoCambioCompra ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) End If ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero) importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero) - TipoCambioGeneral = TipoCambioPago + TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" @@ -1041,12 +1063,14 @@ Partial Class Bancos_ProveedoresAbonar ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago importeMX = ImporteMovimiento ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago importeMX = ImporteMovimiento * tipoCambioCompra ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago importeMX = ImporteMovimiento * tipoCambioCompra ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago importeMX = ImporteMovimiento * tipoCambioCompra End If @@ -1086,18 +1110,20 @@ Partial Class Bancos_ProveedoresAbonar ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago importeMX = ImporteMovimiento ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * tipoCambioCompra ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) End If ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero) importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero) - TipoCambioGeneral = TipoCambioPago + TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" @@ -1120,12 +1146,14 @@ Partial Class Bancos_ProveedoresAbonar ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago importeMX = ImporteMovimiento ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago importeMX = ImporteMovimiento * tipoCambioCompra ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago importeMX = ImporteMovimiento * tipoCambioCompra ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago importeMX = ImporteMovimiento * tipoCambioCompra End If @@ -1165,18 +1193,20 @@ Partial Class Bancos_ProveedoresAbonar ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago importeMX = ImporteMovimiento ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * tipoCambioCompra ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) End If ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero) importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero) - TipoCambioGeneral = TipoCambioPago + TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" @@ -1199,18 +1229,20 @@ Partial Class Bancos_ProveedoresAbonar ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago importeMX = ImporteMovimiento ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * tipoCambioCompra ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * tipoCambioCompra ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * tipoCambioCompra End If ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero) importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero) - TipoCambioGeneral = TipoCambioPago + TipoCambioGeneral = tipoCambioCompra If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" @@ -1233,18 +1265,20 @@ Partial Class Bancos_ProveedoresAbonar ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago importeMX = ImporteMovimiento ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * tipoCambioCompra ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) End If ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero) importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero) - TipoCambioGeneral = TipoCambioPago + TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" @@ -1267,12 +1301,14 @@ Partial Class Bancos_ProveedoresAbonar ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago importeMX = ImporteMovimiento ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * tipoCambioCompra ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) End If @@ -1300,12 +1336,14 @@ Partial Class Bancos_ProveedoresAbonar ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago importeMX = ImporteMovimiento ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * tipoCambioCompra ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) End If @@ -1517,12 +1555,14 @@ Partial Class Bancos_ProveedoresAbonar ImporteMovimiento = gvr.DataKey("IVA").ToDecimal importeMX = ImporteMovimiento ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal ImporteMovimiento = gvr.DataKey("IVA").ToDecimal importeMX = ImporteMovimiento * tipoCambioCompra ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then ImporteMovimiento = gvr.DataKey("IVA").ToDecimal importeMX = ImporteMovimiento * tipoCambioCompra ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal ImporteMovimiento = gvr.DataKey("IVA").ToDecimal importeMX = ImporteMovimiento * tipoCambioCompra End If @@ -1539,12 +1579,14 @@ Partial Class Bancos_ProveedoresAbonar ImporteMovimiento = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IVAPorPagar").ToDecimal - (gvr.DataKey("IVA").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IVAPorPagar").ToDecimal, gvr.DataKey("IVA").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal ImporteMovimiento = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IVAPorPagar").ToDecimal - (gvr.DataKey("IVA").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IVAPorPagar").ToDecimal, gvr.DataKey("IVA").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * tipoCambioCompra ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then ImporteMovimiento = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IVAPorPagar").ToDecimal - (gvr.DataKey("IVA").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IVAPorPagar").ToDecimal, gvr.DataKey("IVA").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * tipoCambioCompra ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal ImporteMovimiento = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IVAPorPagar").ToDecimal - (gvr.DataKey("IVA").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IVAPorPagar").ToDecimal, gvr.DataKey("IVA").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * tipoCambioCompra End If @@ -1579,12 +1621,14 @@ Partial Class Bancos_ProveedoresAbonar ImporteMovimiento = gvr.DataKey("IVADeducible").ToDecimal importeMX = ImporteMovimiento ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal ImporteMovimiento = gvr.DataKey("IVADeducible").ToDecimal importeMX = gvr.DataKey("IVADeducible").ToDecimal * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then ImporteMovimiento = gvr.DataKey("IVADeducible").ToDecimal importeMX = ImporteMovimiento * tipoCambioCompra ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal ImporteMovimiento = gvr.DataKey("IVADeducible").ToDecimal importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) End If @@ -1601,12 +1645,14 @@ Partial Class Bancos_ProveedoresAbonar ImporteMovimiento = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IVAPorPagar").ToDecimal - (gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IVAPorPagar").ToDecimal, gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal ImporteMovimiento = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IVAPorPagar").ToDecimal - (gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IVAPorPagar").ToDecimal, gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then ImporteMovimiento = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IVAPorPagar").ToDecimal - (gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IVAPorPagar").ToDecimal, gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * tipoCambioCompra ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal ImporteMovimiento = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IVAPorPagar").ToDecimal - (gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IVAPorPagar").ToDecimal, gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) End If @@ -1654,12 +1700,14 @@ Partial Class Bancos_ProveedoresAbonar ImporteMovimiento = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IEPSPorPagar").ToDecimal - (gvr.DataKey("IEPS").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IEPSPorPagar").ToDecimal, gvr.DataKey("IEPS").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal ImporteMovimiento = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IEPSPorPagar").ToDecimal - (gvr.DataKey("IEPS").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IEPSPorPagar").ToDecimal, gvr.DataKey("IEPS").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * tipoCambioCompra ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then ImporteMovimiento = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IEPSPorPagar").ToDecimal - (gvr.DataKey("IEPS").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IEPSPorPagar").ToDecimal, gvr.DataKey("IEPS").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * tipoCambioCompra ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal ImporteMovimiento = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IEPSPorPagar").ToDecimal - (gvr.DataKey("IEPS").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IEPSPorPagar").ToDecimal, gvr.DataKey("IEPS").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * tipoCambioCompra End If @@ -1680,12 +1728,14 @@ Partial Class Bancos_ProveedoresAbonar ImporteMovimiento = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IEPSPorPagar").ToDecimal - (gvr.DataKey("IEPS").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IEPSPorPagar").ToDecimal, gvr.DataKey("IEPS").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal ImporteMovimiento = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IEPSPorPagar").ToDecimal - (gvr.DataKey("IEPS").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IEPSPorPagar").ToDecimal, gvr.DataKey("IEPS").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then ImporteMovimiento = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IEPSPorPagar").ToDecimal - (gvr.DataKey("IEPS").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IEPSPorPagar").ToDecimal, gvr.DataKey("IEPS").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * tipoCambioCompra ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal ImporteMovimiento = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IEPSPorPagar").ToDecimal - (gvr.DataKey("IEPS").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IEPSPorPagar").ToDecimal, gvr.DataKey("IEPS").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) End If From 0f63849642e2c2a0691f5ab42e55ec0d03da3578 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 28 Feb 2020 10:16:25 -0700 Subject: [PATCH 10/34] Correcion de bug --- asmx/WsTSoft.asmx | 63 +++++++++++++++++++++++++++++++---------------- 1 file changed, 42 insertions(+), 21 deletions(-) diff --git a/asmx/WsTSoft.asmx b/asmx/WsTSoft.asmx index 7d9e99ee5..626fdbb83 100644 --- a/asmx/WsTSoft.asmx +++ b/asmx/WsTSoft.asmx @@ -65,13 +65,20 @@ Public Class WsTSoft If Continuar Then 'CONSULTA DIRECCIONES Dim Direcciones As JArray = ConsultarDirecciones(ObjGPS.DtResultados, "Lat", "Lng") - For Each Dir As JObject In Direcciones - ObjGPS.DtResultados.Rows(Dir("Indice").ToEntero())("Direccion") = Dir("Direccion").ToString() - Next - - ObjPos.Lat = ObjGPS.DtResultados.Rows("0")("Lat").ToString - ObjPos.Lng = ObjGPS.DtResultados.Rows("0")("Lng").ToString - ObjPos.Direccion = ObjGPS.DtResultados.Rows("0")("Direccion").ToString + Try + If Direcciones IsNot Nothing Then + For Each Dir As JObject In Direcciones + ObjGPS.DtResultados.Rows(Dir("Indice").ToEntero())("Direccion") = Dir("Direccion").ToString() + Next + End If + + ObjPos.Lat = ObjGPS.DtResultados.Rows("0")("Lat").ToString + ObjPos.Lng = ObjGPS.DtResultados.Rows("0")("Lng").ToString + ObjPos.Direccion = ObjGPS.DtResultados.Rows("0")("Direccion").ToString + Catch ex As Exception + ObjPos.CurrentError = "No se pudo obtener la posición." + OnError("Ocurrió un error al asignar las direcciones", ex) + End Try Else ObjPos.CurrentError = "No se pudo obtener la posición." End If @@ -103,17 +110,25 @@ Public Class WsTSoft Dim Continuar As Boolean = objTsoft.GETRemisionesHistorial(FolioRemision, NoEconomico) Dim objRem As New GetRemisionHistorialesObj If Continuar Then - Dim Dt = objTsoft.DtResultados.Copy() - Dt.Columns.Add("Direccion", GetType(String)) + Try + Dim Dt = objTsoft.DtResultados.Copy() + Dt.Columns.Add("Direccion", GetType(String)) - 'CONSULTA DIRECCIONES - Dim Direcciones As JArray = ConsultarDirecciones(Dt, "Lat", "Lon") - For Each Dir As JObject In Direcciones - Dt.Rows(Dir("Indice").ToEntero())("Direccion") = Dir("Direccion").ToString() - Next + 'CONSULTA DIRECCIONES + Dim Direcciones As JArray = ConsultarDirecciones(Dt, "Lat", "Lon") + If Direcciones IsNot Nothing Then + For Each Dir As JObject In Direcciones + Dt.Rows(Dir("Indice").ToEntero())("Direccion") = Dir("Direccion").ToString() + Next + End If - objRem.Historial = Dt.DataTableToObject(Of GetRemisionHistorialsObj) - objRem.CurrentError = "" + objRem.Historial = Dt.DataTableToObject(Of GetRemisionHistorialsObj) + objRem.CurrentError = "" + Catch ex As Exception + objRem.CurrentError = "Ocurrió un error al asignar las direcciones" + OnError("Ocurrió un error al asignar las direcciones", ex) + End Try + Else objRem.Historial = New List(Of GetRemisionHistorialsObj) objRem.CurrentError = objTsoft.MyCurrentError @@ -129,11 +144,17 @@ Public Class WsTSoft Dim objTsoft As New ClsTSoft If objTsoft.GetInfoEventosPenske(FechaInicio.ToDateTime(), FechaFin.ToDateTime()) Then If objTsoft.DtResultados.Rows.Count > 0 Then - 'CONSULTA DIRECCIONES - Dim Direcciones As JArray = ConsultarDirecciones(objTsoft.DtResultados) - For Each Dir As JObject In Direcciones - objTsoft.DtResultados.Rows(Dir("Indice").ToEntero())("Direccion") = Dir("Direccion").ToString() - Next + Try + 'CONSULTA DIRECCIONES + Dim Direcciones As JArray = ConsultarDirecciones(objTsoft.DtResultados) + If Direcciones IsNot Nothing Then + For Each Dir As JObject In Direcciones + objTsoft.DtResultados.Rows(Dir("Indice").ToEntero())("Direccion") = Dir("Direccion").ToString() + Next + End If + Catch ex As Exception + OnError("Ocurrió un error al asignar las direcciones", ex) + End Try retorno = objTsoft.DtResultados.DataTableToJSONIPP() Else From 8da0ad5798def8f31665f17e80e531a3fbf53502 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 28 Feb 2020 10:16:37 -0700 Subject: [PATCH 11/34] Tipos de cambio correcto --- Bancos/ProveedoresAbonar.aspx.vb | 126 ++++++++++++++++++++++--------- 1 file changed, 89 insertions(+), 37 deletions(-) diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index 08c61a789..bf0ac93bf 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -966,7 +966,7 @@ Partial Class Bancos_ProveedoresAbonar CveCuenta = CveCuentaProveedorExtranjera If ImporteMovimiento <> 0 AndAlso (UsuarioActual.CveEmpresa = 119 Or IdCtaContable > 0) Then 'Cuando tiene complementaria lo dividimos en dos importeMX = ImporteMovimiento - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0.00D, Referencia, 206, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, CveCompra:=gvr.DataKey("CveCompra").ToEntero, CveProveedor:=CveProveedor, ImporteMX:=Math.Round(ImporteMovimiento * tipoCambioCompra - ImporteMovimiento, 2, MidpointRounding.AwayFromZero), ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioCompra, CveCuenta:=CveCuentaComplementaria) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0.00D, Referencia, 206, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, CveCompra:=gvr.DataKey("CveCompra").ToEntero, CveProveedor:=CveProveedor, ImporteMX:=Math.Round(ImporteMovimiento * tipoCambioCompraValuacion - ImporteMovimiento, 2, MidpointRounding.AwayFromZero), ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioCompraValuacion, CveCuenta:=CveCuentaComplementaria) Then MsgError = "No se pudo insertar la póliza" End If End If @@ -1750,49 +1750,101 @@ Partial Class Bancos_ProveedoresAbonar End If End If Case 64 'Ganancia - If CveMoneda <> 1 OrElse gvr.DataKey("CveMoneda").ToEntero <> 1 Then - Dim TotalImporte As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal - - 'Dim IVA As Decimal = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal, gvr.DataKey("IVAPorPagar").ToDecimal, gvr.DataKey("IVA").ToDecimal * PorcentajePago) - Dim IVA As Decimal = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IVAPorPagar").ToDecimal - (gvr.DataKey("IVA").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IVAPorPagar").ToDecimal, gvr.DataKey("IVA").ToDecimal * PorcentajePago) - Dim IEPS As Decimal = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IEPSPorPagar").ToDecimal - (gvr.DataKey("IEPS").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IEPSPorPagar").ToDecimal, gvr.DataKey("IEPS").ToDecimal * PorcentajePago) 'If(TotalImporte = gvr.DataKey("Saldo").ToDecimal, gvr.DataKey("IEPSPorPagar").ToDecimal, gvr.DataKey("IEPS").ToDecimal * PorcentajePago) - - IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria - CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria - Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) - TipoCambioGeneral = TCImpuestos - '' si tiene funcionalidad de flucturación con ivas, tomar tipocambioCompra - If TipoCambioPago < tipoCambioCompra AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - ImporteMovimiento = (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * TipoCambioPago) - (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioCompra) 'Añadimos la diferencia de ganancia en la venta - ImporteMovimiento -= (IVA * TCImpuestos) - (IVA * tipoCambioCompra) 'Añadimos la diferencia de ganancia en el IVA - ImporteMovimiento += ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * tipoCambioCompra) 'Añadimos la diferencia de ganancia en el RetIVA - ImporteMovimiento += ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambioCompra) 'Añadimos la diferencia de ganancia en el RetISR - ImporteMovimiento -= (IEPS * TCImpuestos) - (IEPS * tipoCambioCompra) 'Añadimos la diferencia de ganancia en el IEPS - ImporteMovimiento = Math.Abs(Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)) - importeMX = ImporteMovimiento - End If + If CveMoneda <> 1 OrElse gvr.DataKey("CveMoneda").ToEntero <> 1 Then + + IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria + CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria + 'tipoCambioVentaDiferenciaCambiaria = If(gvr.DataKey("Fecha").ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, gvr.DataKey("TipoCambio").ToDecimal) + Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompraValuacion) + + + Dim Diferencia As Decimal = ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * tipoCambioCompraValuacion) - ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * TipoCambioPago) 'Añadimos la diferencia de perdida en la venta + Diferencia -= ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambioCompra) - ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IVA + Diferencia += ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * tipoCambioCompra) - ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetIVA + Diferencia += ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambioCompra) - ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetISR + Diferencia -= ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * tipoCambioCompra) - ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IEPS + Diferencia = Math.Round(Diferencia, 2) + + '' se considera, las diferencias, y no el tipo de cambio, por el caso de las fluctuaciones + + '' si tiene funcionalidad de flucturación con ivas, tomar tipocambioventa + If Diferencia > 0 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + ImporteMovimiento = Math.Abs(Diferencia) + importeMX = ImporteMovimiento + End If + + '' si tiene funcionalidad de flucturación con ivas, tomar tipocambioventa + 'If tipoCambioPago > tipoCambioVentaDiferenciaCambiaria AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + ' ImporteMovimiento = (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioPago) - (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioVentaDiferenciaCambiaria) 'Añadimos la diferencia de ganancia en la venta + ' ImporteMovimiento -= ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambioVentaDiferenciaCambiaria) 'Añadimos la diferencia de ganancia en el IVA + ' ImporteMovimiento += ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * tipoCambioVentaDiferenciaCambiaria) 'Añadimos la diferencia de ganancia en el RetIVA + ' ImporteMovimiento += ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambioVentaDiferenciaCambiaria) 'Añadimos la diferencia de ganancia en el RetISR + ' ImporteMovimiento -= ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * tipoCambioVentaDiferenciaCambiaria) 'Añadimos la diferencia de ganancia en el IEPS + ' ImporteMovimiento = Math.Abs(Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)) + ' importeMX = ImporteMovimiento + 'End If + + + 'Dim TotalImporte As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal + + ''Dim IVA As Decimal = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal, gvr.DataKey("IVAPorPagar").ToDecimal, gvr.DataKey("IVA").ToDecimal * PorcentajePago) + 'Dim IVA As Decimal = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IVAPorPagar").ToDecimal - (gvr.DataKey("IVA").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IVAPorPagar").ToDecimal, gvr.DataKey("IVA").ToDecimal * PorcentajePago) + 'Dim IEPS As Decimal = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IEPSPorPagar").ToDecimal - (gvr.DataKey("IEPS").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IEPSPorPagar").ToDecimal, gvr.DataKey("IEPS").ToDecimal * PorcentajePago) 'If(TotalImporte = gvr.DataKey("Saldo").ToDecimal, gvr.DataKey("IEPSPorPagar").ToDecimal, gvr.DataKey("IEPS").ToDecimal * PorcentajePago) + + 'IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria + 'CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria + 'Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompraValuacion) + 'TipoCambioGeneral = TCImpuestos + ''' si tiene funcionalidad de flucturación con ivas, tomar tipocambioCompra + 'If TipoCambioPago < tipoCambioCompra AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + ' ImporteMovimiento = (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * TipoCambioPago) - (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioCompra) 'Añadimos la diferencia de ganancia en la venta + ' ImporteMovimiento -= (IVA * TCImpuestos) - (IVA * tipoCambioCompra) 'Añadimos la diferencia de ganancia en el IVA + ' ImporteMovimiento += ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * tipoCambioCompra) 'Añadimos la diferencia de ganancia en el RetIVA + ' ImporteMovimiento += ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambioCompra) 'Añadimos la diferencia de ganancia en el RetISR + ' ImporteMovimiento -= (IEPS * TCImpuestos) - (IEPS * tipoCambioCompra) 'Añadimos la diferencia de ganancia en el IEPS + ' ImporteMovimiento = Math.Abs(Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)) + ' importeMX = ImporteMovimiento + 'End If Else ImporteMovimiento = 0 End If Case 65 'Perdida If CveMoneda <> 1 OrElse gvr.DataKey("CveMoneda").ToEntero <> 1 Then - Dim TotalImporte As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal - Dim IVA As Decimal = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IVAPorPagar").ToDecimal - (gvr.DataKey("IVA").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IVAPorPagar").ToDecimal, gvr.DataKey("IVA").ToDecimal * PorcentajePago) - Dim IEPS As Decimal = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IEPSPorPagar").ToDecimal - (gvr.DataKey("IEPS").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IEPSPorPagar").ToDecimal, gvr.DataKey("IEPS").ToDecimal * PorcentajePago) 'If(TotalImporte = gvr.DataKey("Saldo").ToDecimal, gvr.DataKey("IEPSPorPagar").ToDecimal, gvr.DataKey("IEPS").ToDecimal * PorcentajePago) - IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria - CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria - Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) - '' si tiene funcionalidad de flucturación con ivas, tomar tipocambioCompra - If TipoCambioPago > tipoCambioCompra AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then - ImporteMovimiento = (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioCompra) - (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * TipoCambioPago) 'Añadimos la diferencia de ganancia en la venta - ImporteMovimiento -= (IVA * tipoCambioCompra) - (IVA * TCImpuestos) 'Añadimos la diferencia de ganancia en el IVA - ImporteMovimiento += ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * tipoCambioCompra) - ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetIVA - ImporteMovimiento += ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambioCompra) - ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetISR - ImporteMovimiento -= (IEPS * tipoCambioCompra) - (IEPS * TCImpuestos) 'Añadimos la diferencia de ganancia en el IEPS - ImporteMovimiento = Math.Abs(Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)) - importeMX = ImporteMovimiento + IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria + CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria + 'tipoCambioVentaDiferenciaCambiaria = If(gvr.DataKey("Fecha").ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, gvr.DataKey("TipoCambio").ToDecimal) + Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) + + Dim Diferencia As Decimal = ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * tipoCambioCompraValuacion) - ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * TipoCambioPago) 'Añadimos la diferencia de perdida en la venta + Diferencia -= ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambioCompra) - ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IVA + Diferencia += ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * tipoCambioCompra) - ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetIVA + Diferencia += ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambioCompra) - ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetISR + Diferencia -= ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * tipoCambioCompra) - ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IEPS + Diferencia = Math.Round(Diferencia, 2) + 'si la diferencia es negativa es pérdida, si es positiva es ganancia + If Diferencia < 0 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + ImporteMovimiento = Math.Abs(Diferencia) + importeMX = ImporteMovimiento End If + + 'Dim TotalImporte As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal + 'Dim IVA As Decimal = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IVAPorPagar").ToDecimal - (gvr.DataKey("IVA").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IVAPorPagar").ToDecimal, gvr.DataKey("IVA").ToDecimal * PorcentajePago) + 'Dim IEPS As Decimal = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IEPSPorPagar").ToDecimal - (gvr.DataKey("IEPS").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IEPSPorPagar").ToDecimal, gvr.DataKey("IEPS").ToDecimal * PorcentajePago) 'If(TotalImporte = gvr.DataKey("Saldo").ToDecimal, gvr.DataKey("IEPSPorPagar").ToDecimal, gvr.DataKey("IEPS").ToDecimal * PorcentajePago) + + 'IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria + 'CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria + 'Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompraValuacion) + '' si tiene funcionalidad de flucturación con ivas, tomar tipocambioCompra + 'If TipoCambioPago > tipoCambioCompra AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then + ' ImporteMovimiento = (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioCompra) - (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * TipoCambioPago) 'Añadimos la diferencia de ganancia en la venta + ' ImporteMovimiento -= (IVA * tipoCambioCompra) - (IVA * TCImpuestos) 'Añadimos la diferencia de ganancia en el IVA + ' ImporteMovimiento += ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * tipoCambioCompra) - ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetIVA + ' ImporteMovimiento += ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambioCompra) - ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetISR + ' ImporteMovimiento -= (IEPS * tipoCambioCompra) - (IEPS * TCImpuestos) 'Añadimos la diferencia de ganancia en el IEPS + ' ImporteMovimiento = Math.Abs(Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)) + ' importeMX = ImporteMovimiento + 'End If Else ImporteMovimiento = 0 End If From 1070d8c14799bc0d1c80c553d11d9277ff657688 Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Fri, 28 Feb 2020 11:40:23 -0700 Subject: [PATCH 12/34] --- Compras/Compras.aspx.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 835abc0c4..134e806e2 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -4396,7 +4396,7 @@ Partial Class Compras_Compras 'End If 'METODO DE PREPOLIZA DE ALMACEN - If UsuarioActual.CveEmpresa.Contiene(1, 119, 72, 80, 140) And UsuarioActual.Empresa.UsaInventarios And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Then + If UsuarioActual.CveEmpresa.Contiene(1, 119, 72, 80, 140, 141) And UsuarioActual.Empresa.UsaInventarios And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Then Dim ImporteAlmacen = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 AND ISNULL(CveAlmacen,0) = 0 AND ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveTipoPS = 2").ToString.ToDecimal If ImporteAlmacen > 0 Then If Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then @@ -4408,7 +4408,7 @@ Partial Class Compras_Compras If OCVinculada And Not (CveImportacion > 0 Or CveFlete > 0) Then CveConceptoContableAlmacen = DdlOCVinculaInv.SelectedValue.ToEntero End If - If UsuarioActual.CveEmpresa.Contiene(72, 80) Then + If UsuarioActual.CveEmpresa.Contiene(72, 80, 140, 141) Then CveConceptoContableAlmacen = 205 End If Else From 7dd387db3e1e2b86e69007548c71e12d4fa796e3 Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Fri, 28 Feb 2020 11:59:22 -0700 Subject: [PATCH 13/34] Ventas TmpDT EsOutSourcing default = true --- Ventas/Ventas.aspx.vb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 4713b0e7e..4cf6840bd 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -14701,6 +14701,8 @@ Partial Class Ventas TmpDT.Columns.Add("EsOutSourcing", GetType(Boolean)) TmpDT.Columns.Add("EsCargo", GetType(Boolean)) + TmpDT.Columns("EsOutSourcing").DefaultValue = False + End Sub Private Sub CreaDTmpC() DTmpC = New DataTable From ba355845f590699e49c814d7ed3504d66f22b147 Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 28 Feb 2020 13:45:52 -0700 Subject: [PATCH 14/34] - condicion para conta SIG --- App_Code/ClsPaginas.vb | 3 +- Contabilidad/RegPrePoliza.aspx.vb | 4 + Contabilidad/RegPrePolizaS.aspx | 883 +++++++++++++++ Contabilidad/RegPrePolizaS.aspx.vb | 1702 ++++++++++++++++++++++++++++ 4 files changed, 2591 insertions(+), 1 deletion(-) create mode 100644 Contabilidad/RegPrePolizaS.aspx create mode 100644 Contabilidad/RegPrePolizaS.aspx.vb diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index c38c36938..3e63cb4c9 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4001,7 +4001,8 @@ Public Class ClsPaginas PaginaDict.Add("/Contabilidad/RepIVADiferencias.aspx".ToUpper(), 127) PaginaDict.Add("/Contabilidad/PolizasImpresion.aspx".ToUpper(), 380) PaginaDict.Add("/Contabilidad/RegPrePoliza.aspx".ToUpper(), 398) - PaginaDict.Add("/Contabilidad/RegPrePoliza1.aspx".ToUpper(), 398) + PaginaDict.Add("/Contabilidad/RegPrePoliza1.aspx".ToUpper(), 398) + PaginaDict.Add("/Contabilidad/RegPrePolizaS.aspx".ToUpper(), 398) PaginaDict.Add("/Contabilidad/DescargaRespaldos.aspx".ToUpper(), 400) PaginaDict.Add("/Contabilidad/RepBalanceGeneral2.aspx".ToUpper(), -1) PaginaDict.Add("/Contabilidad/CatEjercicios.aspx".ToUpper(), 570) diff --git a/Contabilidad/RegPrePoliza.aspx.vb b/Contabilidad/RegPrePoliza.aspx.vb index 071e8c784..206ab0252 100644 --- a/Contabilidad/RegPrePoliza.aspx.vb +++ b/Contabilidad/RegPrePoliza.aspx.vb @@ -171,6 +171,10 @@ Partial Class ContabilidadC_RegPrePoliza Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not Page.IsPostBack Then + If UsuarioActual.Empresa.TipoContabilizacion = 1 Then + Response.Redirect(Request.Url.PathAndQuery.Replace("RegPrePoliza", "RegPrePolizaS")) + End If + CveMoneda = 1 ViewState("CvePrePoliza") = 0 ViewState("CvePeriodo") = "0" diff --git a/Contabilidad/RegPrePolizaS.aspx b/Contabilidad/RegPrePolizaS.aspx new file mode 100644 index 000000000..42dc3d8b6 --- /dev/null +++ b/Contabilidad/RegPrePolizaS.aspx @@ -0,0 +1,883 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RegPrePolizaS.aspx.vb" Inherits="ContabilidadC_RegPrePolizaS" %> + + + + + + + + + + + + +

  • + Crear Complemento de Pago +
  • + + +
  • + Agregar Concepto +
  • +
    +
    + + + + + + + +
    + + + +
    +
    +
    + +
    +
    + + + + +
    + + + + + + + +
    + + + +
    + +
    + + +
    + +
    + +
    + + + + + +
    +
    +
    +
    + +
    +
    +
    +
    + +
    + +
    + +
    + + +
    + + + +
    + +
    +
    + +
    + +
    +
    +
    + +
    + + + + +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + +
    Concepto + Cta. ContableReferenciaDescripciónSubProyectoCargoAbonoComandos
    + +
    + +
    +
    + + +
    +
    +
    + +
    +
    + + + + + +
    +
    + + + + + + +
    +
    +
    +
    +
    +
    +
    + + + +
    + +
    + + + + + +
    + + +
    +
    + + + + +
    + + + + + + + +
    + + +
    + +
    + +
    +
    + +
    + Si +
    +
    +
    + +
    + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    CuentaReferenciaDescripciónSubProyecto +
    +
    +
    Tipo GastoRef. BancariaCargoAbono
    + +
    + + + + Cuenta + +
    + +
    + +
    + + Referencia + + + + + + + Concepto + + + + + + + SubProyecto + + + + + + + TipoGasto + + + + + + + Ref. Bancaria + + + + + + + Cargo + + + + + + + Abono + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    +
    +
    +
    + + + +
    + + + + Movimiento + +
    +<%-- + + + + + --%> +
    + +
    + + + Documento + + +
    +
    + +
    + + + Referencia + +
    +
    + +
    + + + Concepto + +
    +
    + +
    + + + SubProyecto + <%-- --%> + + +
    + <%----%> + <%--
    --%> +
    + +
    + + TipoGasto + +
    + <%----%> + <%----%> +
    + +
    + + Cuenta + +
    + <%----%> + <%--
    --%> +
    + +
    + + TC + +
    +
    + +
    + + Cargo + +
    +
    +
    + <%-- + --%> +
    +
    + + Abono + +
    +
    +
    + <%-- + --%> +
    +
    + + + + + + + + +
    + + + +
    +
    +
    +
    + + + + + + + + + + + +
      + +
    + + + + + + + + +
    + + + + + + + + + + +
    + + + diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb new file mode 100644 index 000000000..3ab52f059 --- /dev/null +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -0,0 +1,1702 @@ + + +Imports System.Data +Imports Extensiones +Imports System.Linq +Imports System.Web.Services + +Partial Class ContabilidadC_RegPrePolizaS + Inherits ClsPaginas + + +#Region "Propiedades" + Public Property ArregloMovs As ArrayList + Get + Return CType(ViewState("ArregloMovs"), ArrayList) + End Get + Set(value As ArrayList) + ViewState("ArregloMovs") = value + End Set + End Property + Public Property DtMovimientos As DataTable + Get + Return CType(ViewState("DtMovimientos"), DataTable) + End Get + Set(value As DataTable) + ViewState("DtMovimientos") = value + End Set + End Property + Public Property DtCuentasContables As DataTable + Get + Return CType(ViewState("DtCuentasContables"), DataTable) + End Get + Set(value As DataTable) + ViewState("DtCuentasContables") = value + End Set + End Property + Public Property TipoPlantilla As Integer + Get + Return CType(ViewState("TipoPlantilla"), Integer) + End Get + Set(value As Integer) + ViewState("TipoPlantilla") = value + End Set + End Property + Public Property CveMoneda As Integer + Get + Return CType(ViewState("CveMoneda"), Integer) + End Get + Set(value As Integer) + ViewState("CveMoneda") = value + End Set + End Property + Private ReadOnly Property CvePrePoliza As Integer + Get + Return ViewState("CvePrePoliza").ToString.ToEntero + End Get + End Property + + 'PARA CREAR IE + Private Property CveConcepto As Integer + Get + Return ViewState("CveConcepto").ToString.ToEntero + End Get + Set(value As Integer) + ViewState("CveConcepto") = value + End Set + End Property + Private Property CveTipoTransaccion As Integer + Get + Return ViewState("CveTipoTransaccion").ToString.ToEntero + End Get + Set(value As Integer) + ViewState("CveTipoTransaccion") = value + End Set + End Property + Private Property CveCuenta As Integer + Get + Return ViewState("CveCuenta").ToString.ToEntero + End Get + Set(value As Integer) + ViewState("CveCuenta") = value + End Set + End Property + Private Property Folio As String + Get + Return ViewState("Folio").ToString + End Get + Set(value As String) + ViewState("Folio") = value + End Set + End Property + Private Property ImporteDocumento As Decimal + Get + Return ViewState("ImporteDocumento").ToString.ToDecimal + End Get + Set(value As Decimal) + ViewState("ImporteDocumento") = value + End Set + End Property + Private Property Observaciones As String + Get + Return ViewState("Observaciones").ToString + End Get + Set(value As String) + ViewState("Observaciones") = value + End Set + End Property + Private Property Beneficiario As String + Get + Return ViewState("Beneficiario").ToString + End Get + Set(value As String) + ViewState("Beneficiario") = value + End Set + End Property + Private Property RowIndex As Integer + Get + Return ViewState("RowIndex").ToString.ToEntero + End Get + Set(value As Integer) + ViewState("RowIndex") = value + End Set + End Property + Private Property Actualizar As Boolean + Get + Return CBool(ViewState("Actualizar").ToString) + End Get + Set(value As Boolean) + ViewState("Actualizar") = value + End Set + End Property + + Private ReadOnly Property CvePeriodo As Integer + Get + Return CType(ViewState("CvePeriodo"), Integer) + End Get + End Property + Private ReadOnly Property CveProyecto As Integer + Get + Return CType(ViewState("CveProyecto"), Integer) + End Get + End Property + Private ReadOnly Property CveSubProyecto As Integer + Get + Return CType(ViewState("CveSubProyecto"), Integer) + End Get + End Property + Private ReadOnly Property CveTurno As Integer + Get + Return CType(ViewState("CveTurno"), Integer) + End Get + End Property + Public Property IndiceGrid As Integer + Get + Return CType(ViewState("IndiceGrid"), Integer) + End Get + Set(value As Integer) + ViewState("IndiceGrid") = value + End Set + End Property +#End Region + + Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load + + If Not Page.IsPostBack Then + CveMoneda = 1 + ViewState("CvePrePoliza") = 0 + ViewState("CvePeriodo") = "0" + CveConcepto = -1 + CveTipoTransaccion = -1 + CveCuenta = -1 + Folio = "-1" + ImporteDocumento = -1 + Observaciones = "-1" + Beneficiario = "-1" + Actualizar = False + + If IfNull(Request("Tipo"), "").ToString = "NOMPROV" Then + DivTipoGasto.Visible = True + ThTipoGasto.Visible = True + CargaTiposGasto() + End If + + If Request("CvePrePoliza") IsNot Nothing AndAlso IsNumeric(Request("CvePrePoliza")) AndAlso Request("CvePrePoliza").ToEntero > 0 Then + ViewState("CvePrePoliza") = Request("CvePrePoliza").ToEntero + CreaDT() + CargaPrePoliza() + If IfNull(Request("Tipo"), "").ToString <> "NOMPROV" Then + GvPrePoliza.Columns(5).Visible = False + DivTG.Visible = False + GvMov.Columns(5).Visible = False + End If + Exit Sub + Else + CreaDT() + BtnEliminar.Visible = False + End If + + + TipoPlantilla = 0 + If IfNull(Request("Tipo"), "").ToString = "Ing" Then + TipoPlantilla = 1 + LblEncabezado.Text = "Otros Ingresos" + End If + + CargaPlantillas(TipoPlantilla) + + If UsuarioActual.CveRol = 1 Then trNotificar.Visible = True + + CargaConceptos() + CargaSubProyectos() + CargaCuentasContables() + + 'crea tabla temporal + ArregloMovs = New ArrayList + + CargaCuentas() + + If Request("CvePeriodo") IsNot Nothing AndAlso IsNumeric(Request("CvePeriodo")) AndAlso Request("CvePeriodo").ToEntero > 0 Then + ViewState("CvePeriodo") = Request("CvePeriodo").ToEntero + ViewState("CveProyecto") = Request("CveProyecto").ToEntero + ViewState("CveSubProyecto") = Request("CveSubProyecto").ToEntero + ViewState("CveTurno") = Request("CveTurno").ToEntero + + DdlPlantilla.Items.Add(New ListItem("Pago Nomina", "61")) + DdlPlantilla.SelectedValue = "61" + DdlPlantilla.Enabled = False + DivAgregarConceptos.Visible = False + + CargaNomina() + + RegistraScript("$(document).ready(function () { calculateCargo(); Sys.Application.add_load(function (s, e) { calculateCargo(); }); } );", 1) + RegistraScript("$(document).ready(function () { calculateAbono(); Sys.Application.add_load(function (s, e) { calculateAbono(); }); } );", 2) + RegistraScript("$(document).ready(function () { comparar(); Sys.Application.add_load(function (s, e) { comparar(); }); } );", 3) + End If + + If IfNull(Request("Tipo"), "").ToString <> "NOMPROV" Then + GvPrePoliza.Columns(4).Visible = False + GvMov.Columns(4).Visible = False + End If + + + + End If + + End Sub + + Private Sub CreaDT() + DtMovimientos = New DataTable("Movimientos") + Dim IDMov As DataColumn = DtMovimientos.Columns.Add("IdMov", Type.GetType("System.Int32")) : IDMov.AutoIncrement = True + With DtMovimientos.Columns + .Add("IdCuenta", Type.GetType("System.Int32")) + .Add("CodigoCuenta", Type.GetType("System.String")) + .Add("Cuenta", Type.GetType("System.String")) + .Add("Referencia", Type.GetType("System.String")) + .Add("Concepto", Type.GetType("System.String")) + .Add("Cargo", Type.GetType("System.Double")) + .Add("Abono", Type.GetType("System.Double")) + .Add("TipoMovto", Type.GetType("System.Int32")) + .Add("EsComodin", Type.GetType("System.Int32")) + .Add("CveConcepto", Type.GetType("System.Int32")) + .Add("CveSubProyecto", Type.GetType("System.Int32")) + .Add("Descripcion", Type.GetType("System.String")) + .Add("CveProveedor", Type.GetType("System.Int32")) + .Add("CvePersonal", Type.GetType("System.Int32")) + .Add("CveCompra", Type.GetType("System.Int32")) + .Add("CveCliente", Type.GetType("System.Int32")) + .Add("CveVenta", Type.GetType("System.Int32")) + .Add("CveClasificacion", Type.GetType("System.Int32")) + .Add("MultipleSubProyecto", Type.GetType("System.Boolean")) + .Add("CveTipoGasto", Type.GetType("System.Int32")) + .Add("CvePrePolizaDetalle", Type.GetType("System.Int32")) + .Add("CveConceptoContable", Type.GetType("System.Int32")) + .Add("IdCtaContable", Type.GetType("System.Int32")) + .Add("ConceptoContable", Type.GetType("System.String")) + End With + End Sub + + Private Sub CargaNomina() + Dim CvePlantilla As Integer = DdlPlantilla.SelectedValue.ToEntero + Dim ObjNomina As New ClsNominas + Dim ObjConta As New ClsContabilidad + + Dim Dt As DataTable = Nothing + Dim Cuenta As String = "" + Dim Concepto As String = "" + Dim IdCuenta As Integer = 0 + Dim TipoMovto As Integer + Dim CveConcepto As Integer + Dim CodigoCuenta As String = "" + Dim NombreCuenta As String = "" + Dim Referencia As String = "" + Dim EsComodin As Integer = 0 + DtMovimientos.Clear() + + If ObjNomina.GetProvisionNomina(CveProyecto, CveSubProyecto, CveTurno, CvePeriodo, UsuarioActual.CveEmpresa) Then + Dt = ObjNomina.DtResultados + + For Each drt As DataRow In Dt.Rows + Dim dr As DataRow = DtMovimientos.NewRow + + If drt("NombreCompleto").ToString = "" AndAlso ObjConta.GetRetCuenta(31, UsuarioActual.CveEmpresa) Then + CveConcepto = 98 + Cuenta = "Nominas por Pagar" + IdCuenta = ObjConta.DtResultados(0)("IdCtaContable").ToString.ToEntero + Concepto = "Pago Nomina" + Referencia = "Pago Nomina" + Else + Concepto = drt("NombreCompleto") + Referencia = "" + CveConcepto = drt("CveConceptoContable").ToString.ToEntero + Cuenta = drt("ConceptoContable").ToString + IdCuenta = drt("IdCtaContable").ToString.ToEntero + End If + + Dim drr As DataRow = DtCuentasContables.FiltroPrimero($"Id={IdCuenta}") + CodigoCuenta = If(drr IsNot Nothing, drr("CuentaFormato").ToString(), "") + NombreCuenta = If(drr IsNot Nothing, drr("Nombre").ToString(), "") + + TipoMovto = drt("TipoMovto") + + If TipoMovto = 0 Then + dr("Cargo") = Math.Abs(drt("Importe").ToString.ToDecimal) + dr("Abono") = 0 + Else + dr("Cargo") = 0 + dr("Abono") = Math.Abs(drt("Importe").ToString.ToDecimal) + End If + + dr("IdCuenta") = IdCuenta + dr("CodigoCuenta") = CodigoCuenta & "
    " & NombreCuenta + dr("Cuenta") = Cuenta + dr("Concepto") = Concepto + dr("Descripcion") = Concepto + dr("Referencia") = Referencia + dr("TipoMovto") = TipoMovto + dr("EsComodin") = EsComodin + dr("CveConcepto") = CveConcepto + dr("CveProveedor") = "-1" + dr("CveSubProyecto") = drt("CveSubProyecto") + dr("CvePersonal") = drt("CvePersonal") + dr("CveClasificacion") = drt("CveClasificacion") + dr("CveTipoGasto") = drt("CveTipoGasto") + + DtMovimientos.Rows.Add(dr) + Next + + GvMov.DataSource = DtMovimientos + GvMov.DataBind() + UPMovs.Update() + End If + + End Sub + + Private Sub CargaPrePoliza() + BtnEliminar.Visible = True + LblEncabezado.Text = "Edición de Póliza" + + Dim ObjContabilidad As New ClsContabilidad + If ObjContabilidad.GetPrePoliza(CvePrePoliza, UsuarioActual.CveEmpresa) Then + Dim dr As DataRow = ObjContabilidad.DtResultados.FiltroPrimero("") + If dr IsNot Nothing Then + DivAgregarConceptos.Visible = False + DdlTipoPoliza.SelectedValue = dr("CveTipoPoliza") + TxtFechaDocumento.Text = dr("Fecha") + TxtConcepto.Text = dr("Concepto") + DivDatosPoliza.Visible = True + + If UsuarioActual.CveRol = 1 OrElse UsuarioActual.TienePermisoProceso(221) Then + 'DivAgregarConceptos.Visible = True + LnkAddConcepto.Visible = True + CargaConceptos() + CargaSubProyectos() + CargaCuentasContables() + End If + + ObjContabilidad.GetContabilizacionDiarioDetalle(CvePrePoliza) + + DtMovimientos = ObjContabilidad.DtResultados.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa}") + GvPrePoliza.DataSource = DtMovimientos + GvPrePoliza.DataBind() + + If UsuarioActual.CveRol = 1 AndAlso DtMovimientos.COUNT("TC", "TC > 1") > 0 Then + GvPrePoliza.Columns(7).Visible = True + End If + + If DtMovimientos.FiltraParametros("CveConceptoContable IN (2,17)").Rows.Count > 0 Then + LnkComplementoPago.Visible = True + End If + + If dr("IdPoliza").ToString.ToEntero > 0 Then + HplContabilizada.NavigateUrl = String.Format("RegPoliza.aspx?IdPoliza={0}", dr("IdPoliza")) + divContabilziada.Visible = True + ElseIf TxtTotalCargos.Text.ToDouble = TxtTotalAbonos.Text.ToDouble Then + 'sino está contabilizada, se activa el botón + BtnContabilizar.Visible = True + End If + + divDatosPrincipales.Visible = False + divObservaciones.Visible = False + UPMovs.Visible = False + UPMovs.Update() + UPPDocumento.Update() + UpPrePoliza.Update() + + RegistraScript("comparar();") + + If Request("Tipo") IsNot Nothing AndAlso IsNumeric(Request("Tipo")) AndAlso Request("Tipo").ToEntero = 1 AndAlso UsuarioActual.CveUsuario <> 100 Then + 'For Each row As GridViewRow In GvPrePoliza.Rows + ' row.FCTextBox("TxtCargo").Enabled = False + ' row.FCTextBox("TxtAbono").Enabled = False + 'Next + End If + + Else + Alert("El documento solicitado no existe, favor de revisar su búsqueda.", TipoMensaje.MsgAdvertencia) + BtnEliminar.Visible = False + End If + + End If + + ObjContabilidad.Dispose() + UpPoliza.Update() + End Sub + + Private Sub GvPrePoliza_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvPrePoliza.RowDataBound + + If e.Row.RowType = DataControlRowType.DataRow Then + + ''Asignamos los Subproyectos + 'e.Row.FCDropDownList("DdlSubProyecto").DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) + 'e.Row.FCDropDownList("DdlSubProyecto").DataBind() + 'e.Row.FCDropDownList("DdlSubProyecto").Items.Insert(0, New ListItem(" - ", "-1")) + 'e.Row.FCDropDownList("DdlSubProyecto").SelectedValueExist(e.Row.DataKey("CveSubProyecto")) + + 'Asignamos los Tipos de Gasto + 'e.Row.FCDropDownList("DdlTipoGasto").DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa) + 'e.Row.FCDropDownList("DdlTipoGasto").DataBind() + 'e.Row.FCDropDownList("DdlTipoGasto").Items.Insert(0, New ListItem("Sin Asignar", "-1")) + 'e.Row.FCDropDownList("DdlTipoGasto").SelectedValueExist(e.Row.DataKey("CveTipoGasto")) + + 'ASignamos las CuentasContables + 'e.Row.FCDropDownList("DdlCtaContable").DataSource = Session("DtCuentas") + 'e.Row.FCDropDownList("DdlCtaContable").DataBind() + 'e.Row.FCDropDownList("DdlCtaContable").Items.Insert(0, New ListItem("Sin Asignar", "0")) + 'e.Row.FCDropDownList("DdlCtaContable").SelectedValueExist(e.Row.DataKey("IdCtaContable")) + + If e.Row.DataKey("IdCtaContable") > 0 Then + Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", e.Row.DataKey("IdCtaContable"))) + If drr IsNot Nothing Then + e.Row.FCLiteral("DdlCtaContable").Text = drr("CuentaFormato").ToString() + " - " + drr("Nombre").ToString() + End If + End If + + TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + e.Row.FCLiteral("TxtCargo").Text.ToDouble).ToString.FormatoNumero + TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + e.Row.FCLiteral("TxtAbono").Text.ToDouble).ToString.FormatoNumero + + Dim CveConceptoContable As Integer = e.Row.DataKey("CveConceptoContable").ToEntero + + If CveConceptoContable.Contiene(1, 2, 13, 38, 207, 203, 39, 61, 62, 63) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DataKey("CveVenta")) + If CveConceptoContable.Contiene(5, 6, 17, 18, 14, 19, 25, 26, 60, 234, 235, 240) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DataKey("CveCompra")) + If CveConceptoContable.Contiene(68) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}", e.Row.DBCampo("CveMovimientoAlmacen")) + If CveConceptoContable.Contiene(30, 204) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Bancos/IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE")) + + 'e.Row.FCHyperLink("HlReferencia").NavigateUrl = CveConceptoContable + + End If + + If e.Row.RowType = DataControlRowType.Header Then + 'e.Row.FCDropDownList("DdlSubProyectoFiltro").DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) + 'e.Row.FCDropDownList("DdlSubProyectoFiltro").DataBind() + 'e.Row.FCDropDownList("DdlSubProyectoFiltro").Items.Insert(0, New ListItem("Todos", "-1")) + End If + + End Sub + + Private Sub CargaPlantillas(TipoPlantilla As Integer) + + 'GvPlantillas.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, TipoPlantilla) + 'GvPlantillas.DataBind() + + DdlPlantilla.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, TipoPlantilla) + DdlPlantilla.DataBind() + DdlPlantilla.Items.Insert(0, New ListItem("Plantilla Personalizada", "53")) + End Sub + + Private Sub CargaConceptos() + DdlConceptosContables.DataSource = GlobalDTContaConceptosContables(-1) + DdlConceptosContables.DataBind() + End Sub + + Private Sub DdlConceptosContables_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlConceptosContables.SelectedIndexChanged + If DdlConceptosContables.SelectedValue.ToEntero.Contiene(5, 17, 201, 206, 14, 15, 16, 19, 25, 26, 21) Then + CargaProveedores() + DdlProveedores.Visible = True + DdlCompras.Visible = True + Else + DdlProveedores.Visible = False + DdlCompras.Visible = False + End If + + If DdlConceptosContables.SelectedValue.ToEntero.Contiene(28, 29) Then + CargaPersonal() + DdlPersonal.Visible = True + Else + DdlPersonal.Visible = False + End If + If DdlConceptosContables.SelectedValue.ToEntero.Contiene(1, 2, 203, 207, 13, 61, 8, 9, 62, 63, 38, 39) Then + CargaClientes() + DdlClientes.Visible = True + DdlVentas.Visible = True + Else + DdlClientes.Visible = False + DdlVentas.Visible = False + End If + End Sub + + Private Sub DdlProveedores_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProveedores.SelectedIndexChanged + CargaCompras(DdlProveedores.SelectedValue.ToEntero) + End Sub + + Private Sub DdlClientes_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlClientes.selectedindexchange + CargaVentas(DdlClientes.SelectedValue.ToEntero) + End Sub + + Private Sub CargaSubProyectos() + DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) + DdlSubProyecto.DataBind() + DdlSubProyecto.Items.Insert(0, New ListItem(" - ", "-1")) + DdlSubProyectoFiltroMov.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) + DdlSubProyectoFiltroMov.DataBind() + DdlSubProyectoFiltroMov.Items.Insert(0, New ListItem("Todos", "-1")) + End Sub + + Private Sub CargaCuentasContables() + DdlCtaContable.DataSource = Session("DtCuentas") + DdlCtaContable.DataBind() + DdlCtaContable.Items.Insert(0, New ListItem("Sin Asignar", "0")) + End Sub + + Private Sub CargaTiposGasto() + DdlTipoGasto.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa) + DdlTipoGasto.DataBind() + DdlTipoGasto.Items.Insert(0, New ListItem("Sin Asignar", "0")) + End Sub + + Private Sub CargaProveedores() + DdlProveedores.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) + DdlProveedores.DataBind() + DdlProveedores.Items.Insert(0, New ListItem(" - ", "-1")) + End Sub + + Private Sub CargaCompras(CveProveedor As Integer) + If Not DdlConceptosContables.SelectedValue.ToEntero.Contiene(21) Then + Dim ObjCompras As New ClsCompras + + DdlCompras.ClearSelection() + If ObjCompras.GetCompras(-1, "-1", "-1", CveProveedor, -1, UsuarioActual.CveEmpresa) Then + DdlCompras.DataSource = ObjCompras.DtResultados.FiltraParametros("Saldo > 0") + DdlCompras.DataBind() + DdlCompras.Items.Insert(0, New ListItem(" - ", "-1")) + Else + DdlCompras.DataSource = Nothing + DdlCompras.DataBind() + DdlCompras.Items.Insert(0, New ListItem(" - ", "-1")) + End If + ObjCompras.Dispose() + End If + End Sub + + Private Sub CargaClientes() + DdlClientes.setEsWebService(True) + DdlClientes.Attributes.Add("data-metodo", "getcliente") + DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa) + DdlClientes.DataBind() + ' DdlClientes.Items.Insert(0, New ListItem(" - ", "-1")) + End Sub + + Private Sub CargaVentas(CveCliente As Integer) + Dim ObjVentas As New ClsVentas + + DdlVentas.ClearSelection() + If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1", CveCliente, -1, -1, -1, "-1", "-1", "-1", CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then + DdlVentas.DataSource = ObjVentas.DtResultados '.FiltraParametros("Saldo > 0") + DdlVentas.DataBind() + DdlVentas.Items.Insert(0, New ListItem(" - ", "-1")) + Else + DdlVentas.DataSource = Nothing + DdlVentas.DataBind() + DdlVentas.Items.Insert(0, New ListItem(" - ", "-1")) + End If + ObjVentas.Dispose() + End Sub + + Private Sub CargaPersonal() + DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa) + DdlPersonal.DataBind() + DdlPersonal.Items.Insert(0, New ListItem(" - ", "-1")) + End Sub + + + Protected Sub DdlPlantilla_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPlantilla.SelectedIndexChanged + + TxtTotalAbonos.Text = "" + TxtTotalCargos.Text = "" + + If DdlPlantilla.SelectedValue.ToEntero <= 0 Then + Alert("Seleccione un Movimiento Válido", TipoMensaje.MsgAdvertencia) + DdlPlantilla.SelectedValue = "-1" + Exit Sub + End If + + If DdlPlantilla.SelectedValue.ToEntero = 53 Then 'Plantilla Personalizada + DivAgregarConceptos.Visible = True + Else + DivAgregarConceptos.Visible = False + End If + + + + Dim CvePlantilla As Integer = DdlPlantilla.SelectedValue.ToEntero + + Dim Dt As DataTable = GlobalDTContaPlantillasPolizasDetalle(CvePlantilla).FiltraParametros(String.Format("CveEmpresa={0}", UsuarioActual.CveEmpresa), "Orden") + Dim Cuenta As String = "" + Dim IdCuenta As Integer = 0 + Dim CodigoCuenta As String = "" + Dim NombreCuenta As String = "" + Dim EsComodin As Integer = 0 + DtMovimientos.Clear() + + For Each drt As DataRow In Dt.Rows + + Cuenta = drt("ConceptoContable").ToString + IdCuenta = 0 + CodigoCuenta = "" + NombreCuenta = "" + If drt("IdCtaContable").ToString.ToEntero > 0 Then 'DtCuentasContables + Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", drt("IdCtaContable").ToString)) + If drr IsNot Nothing Then + IdCuenta = drt("IdCtaContable").ToString.ToEntero + CodigoCuenta = drr("CuentaFormato").ToString() + NombreCuenta = drr("Nombre").ToString() + 'Cuenta = drr("Nombre").ToString() + End If + EsComodin = 0 + End If + + Dim dr As DataRow = DtMovimientos.NewRow + dr("IdCuenta") = IdCuenta + dr("CodigoCuenta") = CodigoCuenta & "
    " & NombreCuenta + dr("Cuenta") = Cuenta 'TxtCuentaContable.Text + dr("Referencia") = If(drt("CveConcepto").ToString.Contiene("29", "130"), drt("Personal"), drt("RazonSocial")) + dr("Concepto") = TxtObservaciones.Text + dr("TipoMovto") = If(drt("TipoMovto").ToString = "False", 0, 1) + dr("EsComodin") = EsComodin + dr("CveConcepto") = drt("CveConcepto") + dr("CveSubProyecto") = drt("CveSubProyectoNegativo") + dr("Cargo") = TxtCargo.Text.ToDouble + dr("Abono") = TxtAbono.Text.ToDouble + dr("CveProveedor") = drt("CveProveedor") + dr("CvePersonal") = drt("CvePersonal") + dr("CveClasificacion") = -1 + dr("MultipleSubProyecto") = drt("MultipleSubProyecto") + DtMovimientos.Rows.Add(dr) + Next + + + GvMov.DataSource = DtMovimientos + GvMov.DataBind() + UPMovs.Update() + + End Sub + + Protected Sub GvMov_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvMov.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then + + e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left + e.Row.Height = Unit.Pixel(1) + e.Row.Cells(0).ToolTip = e.Row.DBCampo("IdCuenta") + + If e.Row.DBCampo("TipoMovto") = "1" Then + e.Row.FCTextBox("TxtAbono").Visible = True + Else + e.Row.FCTextBox("TxtCargo").Visible = True + End If + + e.Row.FCTextBox("TxtAbono").Text = If(e.Row.DBCampo("Abono") = 0, "", e.Row.DBCampo("Abono")) + e.Row.FCTextBox("TxtCargo").Text = If(e.Row.DBCampo("Cargo") = 0, "", e.Row.DBCampo("Cargo")) + e.Row.FCTextBox("TxtConcepto").Text = e.Row.DBCampo("Descripcion") + + If CvePeriodo > 0 Then + e.Row.FCTextBox("TxtCargo").Enabled = False + e.Row.FCTextBox("TxtAbono").Enabled = False + End If + + e.Row.FCDropDownList("DdlSubProyecto").DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) + e.Row.FCDropDownList("DdlSubProyecto").DataBind() + e.Row.FCDropDownList("DdlSubProyecto").Items.Insert(0, New ListItem(" - ", "-1")) + e.Row.FCDropDownList("DdlSubProyecto").SelectedValue = e.Row.DBCampo("CveSubProyecto") + + 'Asignamos los Tipos de Gasto + e.Row.FCDropDownList("DdlTipoGasto").DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa) + e.Row.FCDropDownList("DdlTipoGasto").DataBind() + e.Row.FCDropDownList("DdlTipoGasto").Items.Insert(0, New ListItem("Sin Asignar", "-1")) + e.Row.FCDropDownList("DdlTipoGasto").SelectedValue = e.Row.DBCampo("CveTipoGasto") + + If DdlPlantilla.SelectedValue.ToEntero = 53 Then 'Plantilla Personalizada + e.Row.FCDropDownList("DdlSubProyecto").Enabled = True + e.Row.FCImageButton("imgD").Visible = True + Else + e.Row.FCDropDownList("DdlSubProyecto").Enabled = False + End If + + If e.Row.DBCampo("MultipleSubProyecto") = "True" Then + e.Row.FCDropDownList("DdlSubProyecto").Enabled = True + End If + + 'Agregamos la opcion para vincular los movimientos bancarios + If e.Row.DataKey("CveConcepto").ToEntero.Contiene(41) Then + Dim ObjMovimientos As New ClsMovimientos + Dim DdlSaldos As DropDownList = e.Row.FCDropDownList("DdlSaldos") + + Select Case e.Row.DataKey("CveConcepto").ToEntero + + 'Acreedores + Case 41 + If (ObjMovimientos.GetAcreedoresSaldosDetalles(-1, CveMoneda, UsuarioActual.CveEmpresa)) Then + DdlSaldos.Visible = True + DdlSaldos.DataSource = ObjMovimientos.DtResultados.FiltraParametros($"CveIE > 0 AND CveProveedor = {e.Row.DataKey("CveProveedor").ToEntero}") + DdlSaldos.DataBind() + DdlSaldos.Items.Insert(0, New ListItem("Seleccione", "-1")) + End If + + End Select + + ObjMovimientos.Dispose() + End If + + If e.Row.DataKey("CveConcepto").ToEntero.Contiene(30) Then + e.Row.FCLinkButton("ImgBancos").Visible = True + + + If CveTipoTransaccion > 0 And CveCuenta > 0 And Folio.Length > 0 And ImporteDocumento > 0 And Beneficiario.Length > 0 Then + e.Row.FCLinkButton("ImgBancos").CssClass = "btn btn-circle btn-sm green" + End If + End If + End If + End Sub + + Protected Sub BtnIEGuardar_Click(sender As Object, e As EventArgs) Handles BtnIEGuardar.Click + Dim TotalCargos, TotalAbonos As Decimal + + If CvePrePoliza > 0 Then + TotalCargos = TxtTotalCargos.Text.ToDecimal + TotalAbonos = TxtTotalAbonos.Text.ToDecimal + Else + For Each Gvr As GridViewRow In GvMov.Rows + TotalCargos += Gvr.FCTextBox("TxtCargo").Text.ToDecimal + TotalAbonos += Gvr.FCTextBox("TxtAbono").Text.ToDecimal + Next + End If + + If Not (TotalCargos = TotalAbonos AndAlso (GvPrePoliza.Rows.Count > 0 Or GvMov.Rows.Count > 0)) Then + Alert($"La suma de los movimientos no son iguales ({TotalCargos}-{TotalAbonos})", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + If CvePrePoliza > 0 Then + 'Nuevo Modulo Charlie + ActualizarPrePoliza() + Else + Dim MensajeAlert = New StringBuilder + Dim ObjIE As New ClsBancos() + Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL) + Dim ObjNom As New ClsNominas(ObjIE.IniciaTransacSQL) + Dim Conta As ClsContPAQi = Nothing + Dim IDPoliza As Integer = 0 + Dim MsgError As String = "" + Dim CveIE As Integer + Dim FolioIE As String = "" + + Try + Dim CvePrePoliza As Integer + Dim ConceptoPoliza As String = TxtObservaciones.Text + CvePrePoliza = ObjMov.AddPrePolizas("Contabilidad/RegPrePoliza", DdlPlantilla.SelectedValue.ToEntero, TotalCargos, TotalAbonos, 1, TxtFecha.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=DdlTipoPolizaAdd.SelectedValue.ToEntero) + + If CvePrePoliza > 0 Then + Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:

    " + Dim idCuentaContabilizacion As Long = 1 + Dim Importe As Double = 0 + Dim TipoMovto As Boolean = False + Dim IdCtaContable As Integer = 0 + + 'Registra movimieno bancario + If CveConcepto = 30 Then + CveIE = ObjIE.AddBancos_IE(CveCuenta, CveTipoTransaccion, TxtFecha.Text, Folio, Beneficiario, ImporteDocumento, CveMoneda, 0, Observaciones, "", False, False, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + If CveIE < 0 Then MsgError = "No se pudo registrar movimiento bancario" + If ObjIE.GetBancosIE(CveIE, -1, -1, "-1", -1, "-1", "-1", -1, -1, -1, -1, -1, MinFecha, MaxFecha, MinFecha, MaxFecha, MinFecha, MaxFecha, -1, -1, UsuarioActual.CveEmpresa) Then + FolioIE = ObjIE.Folio + End If + End If + + + + 'inserto las compras que voy a pagarDdlSaldos + For Each gvr As GridViewRow In GvMov.Rows + If gvr.DataKey("IDCuenta").ToEntero > 0 Then + IdCtaContable = gvr.DataKey("IDCuenta") + End If + + If gvr.DataKey("TipoMovto").ToDouble > 0 Then + Importe = gvr.FCTextBox("TxtAbono").Text.ToDouble + TipoMovto = True + Else + Importe = gvr.FCTextBox("TxtCargo").Text.ToDouble + TipoMovto = False + End If + + If CveConcepto = 41 Then + CveIE = gvr.FCDropDownList("DdlSaldos").SelectedValue.ToEntero + Else + CveIE = -1 + End If + + + If idCuentaContabilizacion = 1 AndAlso (IdCtaContable = 0) Then + idCuentaContabilizacion = 0 + End If + If Importe > 0 Then + If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, gvr.FCLiteral("LtlReferencia").Text, gvr.DataKey("CveConcepto").ToEntero, gvr.FCTextBox("TxtConcepto").Text, + TxtFecha.Text.ToDate, IdCtaContable, -1, CveSubProyecto:=gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero, CveIE:=CveIE, + CveProveedor:=gvr.DataKey("CveProveedor").ToEntero, CveCompra:=gvr.DataKey("CveCompra").ToEntero, + CvePersonal:=gvr.DataKey("CvePersonal").ToEntero, CveClasificacion:=gvr.DataKey("CveClasificacion").ToEntero, + ImporteMX:=Importe, CveTipoGasto:=gvr.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero, + CveCliente:=gvr.DataKey("CveCliente").ToEntero, CveVenta:=gvr.DataKey("CveVenta").ToEntero) Then + Else + MsgError = "No se pudo insertar el detalle de la póliza2" + Exit For + End If + End If + Next + + 'El movimiento 2 es el de Pago + If ChkAutoConta.Checked AndAlso UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError = "" Then + If idCuentaContabilizacion > 0 Then + If ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then + + 'MENSAJE PRINCIPAL + MensajeAlert.AppendFormat("

    Folio de Salida:
    {1}", ObjMov.ContaIdPoliza, ObjMov.ContaFolio) + 'Alert(MensajeAlert.ToString, ModExtensiones.TipoMensaje.MsgInformacion) + Else + Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico") + End If + Else + Alert("No se puede contabilizar la Prepoliza debido a que una o mas cuentas son inválidas") + End If + End If + If CvePeriodo > 0 Then + If Not ObjNom.UpdateProvisionNomina(CvePeriodo, CvePrePoliza, UsuarioActual.CveEmpresa) Then + MsgError = "No se pudo actualizar el periodo de la nómina" + End If + End If + + If ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 1) Then + If ObjMov.ValorPolizaDescuadre > 0 Then + GuardaLogAD($"Contabilidad/RegPrePolizas | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") + MsgError = ObjMov.MensajePolizaDescuadre + End If + End If + + Else + MsgError = "No se pudo insertar la póliza" + End If + Catch ex As Exception + MsgError = "Error" + End Try + + If MsgError = "" Then + 'MENSAJE IE + If CveIE Then + MensajeAlert.AppendFormat("

    Folio Bancario: {1}", CveIE, FolioIE) + Alert(MensajeAlert.ToString, ModExtensiones.TipoMensaje.MsgInformacion, "window.location.reload()") + Else + Alert(If(MensajeAlert.ToString = "", "Se registro con exito.", MensajeAlert.ToString), TipoMensaje.MsgInformacion, "window.location.reload()") + End If + + ObjIE.Commit() + If Conta IsNot Nothing Then Conta.Commit() + + UPPDocumento.Update() + + TxtObservaciones.Text = "" + GvMov.DataBind() + TxtFecha.Text = "" + TxtObservaciones.Text = "" + Else + ObjIE.RollBack() + If Conta IsNot Nothing Then Conta.RollBack() + End If + + ObjIE.Dispose() + ObjMov.Dispose() + If Conta IsNot Nothing Then Conta.Dispose() + End If + End Sub + + Private Sub ActualizarPrePoliza() + + Dim OcurrioError As Boolean = False + Dim ObjContabilidad As New ClsContabilidad + ObjContabilidad.IniciaTransacSQL() + + ObjContabilidad.UpdatePrePoliza(MinFecha, -1, DdlTipoPoliza.SelectedValue.ToEntero, -1, CvePrePoliza, UsuarioActual.CveEmpresa, Concepto:=TxtConcepto.Text, FechaPoliza:=TxtFechaDocumento.Text.ToDate) + + For Each row As GridViewRow In GvPrePoliza.Rows + If row.DataKey("CvePrePolizaDetalle").ToEntero > 0 Then + If Not ObjContabilidad.UpdatePrepolizasDetalle(row.DataKey("CvePrePolizaDetalle").ToEntero, row.FCLiteral("TxtConcepto").Text, row.DataKey("CveSubProyecto").ToEntero, + row.DataKey("IdCtaContable").ToEntero, If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, False, True), If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, + row.FCLiteral("TxtCargo").Text.ToDecimal, row.FCLiteral("TxtAbono").Text.ToDecimal), CveTipoGasto:=If(DdlTipoGasto.Visible, row.DataKey("CveTipoGasto").ToEntero, row.DataKey("CveTipoGasto").ToEntero), + CveConceptoContable:=row.DataKey("CveConceptoContable").ToEntero, CveProveedor:=row.DataKey("CveProveedor").ToEntero, CveCompra:=row.DataKey("CveCompra").ToEntero, + CveCliente:=row.DataKey("CveCliente").ToEntero, CveVenta:=row.DataKey("CveVenta").ToEntero, CvePersonal:=row.DataKey("CvePersonal").ToEntero, Referencia:=row.FCLiteral("TxtRef").Text) Then + OcurrioError = True + Exit For + End If + Else + If Not ObjContabilidad.AddPrePolizasDetalle(CvePrePoliza, If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, False, True), If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, + row.FCLiteral("TxtCargo").Text.ToDecimal, row.FCLiteral("TxtAbono").Text.ToDecimal), row.DataKey("Referencia").ToString, + row.DataKey("CveConceptoContable").ToEntero, row.FCLiteral("TxtConcepto").Text, Now, + row.DataKey("IdCtaContable").ToEntero, 0, CveSubProyecto:=row.DataKey("CveSubProyecto").ToEntero, + CveTipoGasto:=If(DdlTipoGasto.Visible, row.DataKey("CveTipoGasto").ToEntero, row.DataKey("CveTipoGasto").ToEntero), + ImporteMX:=If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, + row.FCLiteral("TxtCargo").Text.ToDecimal, row.FCLiteral("TxtAbono").Text.ToDecimal), CveProveedor:=row.DataKey("CveProveedor").ToEntero, + CveCompra:=row.DataKey("CveCompra").ToEntero, CveCliente:=row.DataKey("CveCliente").ToEntero, CveVenta:=row.DataKey("CveVenta").ToEntero, + CvePersonal:=row.DataKey("CvePersonal").ToEntero) Then + OcurrioError = True + Exit For + End If + End If + + Next + + If Not OcurrioError Then + ObjContabilidad.Commit() + Alert("La PrePoliza se actualizó correctamente.", TipoMensaje.MsgInformacion) + Else + ObjContabilidad.RollBack() + Alert("Ocurrio un error al actualizar la PrePoliza.", TipoMensaje.MsgError) + End If + + ObjContabilidad.Dispose() + CargaPrePoliza() + End Sub + Protected Sub LnkAddConcepto_Click(sender As Object, e As EventArgs) + RegistraScript(String.Format("$('#{0}').modal();", "DivEditConcepto")) + LtlTitulo.Text = "Agregar Concepto" + BtnAceptar.Text = "Agregar" + LimpiaCampos() + + CargaConceptosContablesE() + CargaSubProyectoE() + CargaTipoGastoE() + CargaCtaContableE() + + + UpdatePanel1.Update() + End Sub + Protected Sub GvPrePoliza_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvPrePoliza.RowUpdating + RegistraScript(String.Format("$('#{0}').modal();", "DivEditConcepto")) + LtlTitulo.Text = "Editar Concepto" + BtnAceptar.Text = "Aceptar" + LimpiaCampos() + IndiceGrid = e.RowIndex + + Dim CveConceptoContable As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveConceptoContable").ToEntero + Dim CveProveedor As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveProveedor").ToEntero + Dim CveCompra As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveCompra").ToEntero + Dim CvePersonal As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CvePersonal").ToEntero + Dim CveCliente As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveCliente").ToEntero + Dim CveVenta As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveVenta").ToEntero + 'Dim FolioFactura As String = GvPrePoliza.Rows(IndiceGrid).FCHyperLink("HlReferencia").Text + Dim Concepto As String = GvPrePoliza.Rows(IndiceGrid).FCLiteral("TxtConcepto").Text + Dim Referencia As String = GvPrePoliza.Rows(IndiceGrid).FCLiteral("TxtRef").Text + Dim CveSubProyecto As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveSubProyecto").ToString.ToEntero + Dim CveTipoGasto As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveTipoGasto").ToString.ToEntero + Dim IdCtaContable As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("IdCtaContable").ToString.ToEntero + Dim Cargo As Double = GvPrePoliza.Rows(IndiceGrid).FCLiteral("TxtCargo").Text.ToDouble + Dim Abono As Double = GvPrePoliza.Rows(IndiceGrid).FCLiteral("TxtAbono").Text.ToDouble + + CargaConceptosContablesE() + DdlConceptosContablesE.SelectedValueExist(CveConceptoContable) + DdlConceptosContablesE_SelectedIndexChanged(DdlConceptosContablesE, e) + + DdlProveedoresE.SelectedValueExist(CveProveedor) + DdlProveedoresE_SelectedIndexChanged(DdlProveedoresE, e) + DdlComprasE.SelectedValueExist(CveCompra) + + DdlPersonalE.SelectedValueExist(CvePersonal) + + DdlClientesE.SelectedValue = CveCliente + DdlClientesE.SelectedText = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("NombreComercial", $"CveCliente={CveCliente}") + DdlClientesE_SelectedIndexChanged(DdlClientesE, e) + DdlVentasE.SelectedValueExist(CveVenta) + + TxtConceptoE.Text = Concepto + TxtReferenciaE.Text = Referencia + + CargaSubProyectoE() + DdlSubProyectoE.SelectedValueExist(CveSubProyecto) + CargaTipoGastoE() + DdlTipoGastoE.SelectedValueExist(CveTipoGasto) + CargaCtaContableE() + DdlCtaContableE.SelectedValueExist(IdCtaContable) + + If Cargo <> 0 Then + TxtCargoE.Text = Cargo + End If + + If Abono <> 0 Then + TxtAbonoE.Text = Abono + End If + + UpdatePanel1.Update() + + End Sub + Private Sub LimpiaCampos() + IndiceGrid = -1 + TxtConceptoE.Text = "" + TxtCargoE.Text = "" + TxtAbonoE.Text = "" + TxtReferenciaE.Text = "" + End Sub + Private Sub CargaConceptosContablesE() + DdlConceptosContablesE.DataSource = GlobalDTContaConceptosContables(-1) + DdlConceptosContablesE.DataBind() + End Sub + Private Sub CargaSubProyectoE() + DdlSubProyectoE.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) + DdlSubProyectoE.DataBind() + DdlSubProyectoE.Items.Insert(0, New ListItem(" - ", "-1")) + End Sub + Private Sub CargaTipoGastoE() + DdlTipoGastoE.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa) + DdlTipoGastoE.DataBind() + DdlTipoGastoE.Items.Insert(0, New ListItem("Sin Asignar", "0")) + End Sub + Private Sub CargaCtaContableE() + DdlCtaContableE.DataSource = Session("DtCuentas") + DdlCtaContableE.DataBind() + DdlCtaContableE.Items.Insert(0, New ListItem("Sin Asignar", "0")) + End Sub + Private Sub DdlConceptosContablesE_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlConceptosContablesE.SelectedIndexChanged + If DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(5, 17, 201, 206, 14, 15, 16, 19, 25, 26, 21) Then + CargaProveedoresE() + DdlProveedoresE.Visible = True + DdlComprasE.Visible = True + Else + DdlProveedoresE.Visible = False + DdlComprasE.Visible = False + End If + + If DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(28, 29) Then + CargaPersonalE() + DdlPersonalE.Visible = True + Else + DdlPersonalE.Visible = False + End If + If DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(1, 2, 203, 207, 13, 61, 8, 9, 62, 63, 38, 39) Then + CargaClientesE() + DdlClientesE.Visible = True + DdlVentasE.Visible = True + Else + DdlClientesE.Visible = False + DdlVentasE.Visible = False + End If + End Sub + Private Sub CargaProveedoresE() + DdlProveedoresE.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) + DdlProveedoresE.DataBind() + DdlProveedoresE.Items.Insert(0, New ListItem(" - ", "-1")) + End Sub + Private Sub CargaComprasE(CveProveedor As Integer) + If Not DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(21) Then + Dim ObjCompras As New ClsCompras + + DdlComprasE.ClearSelection() + If ObjCompras.GetCompras(-1, "-1", "-1", CveProveedor, -1, UsuarioActual.CveEmpresa) Then + DdlComprasE.DataSource = ObjCompras.DtResultados.FiltraParametros("Saldo > 0") + DdlComprasE.DataBind() + DdlComprasE.Items.Insert(0, New ListItem(" - ", "-1")) + Else + DdlComprasE.DataSource = Nothing + DdlComprasE.DataBind() + DdlComprasE.Items.Insert(0, New ListItem(" - ", "-1")) + End If + ObjCompras.Dispose() + End If + End Sub + Private Sub CargaClientesE() + DdlClientesE.setEsWebService(True) + DdlClientesE.Attributes.Add("data-metodo", "getcliente") + DdlClientesE.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa) + DdlClientesE.DataBind() + ' DdlClientes.Items.Insert(0, New ListItem(" - ", "-1")) + End Sub + Private Sub CargaVentasE(CveCliente As Integer) + Dim ObjVentas As New ClsVentas + + DdlVentasE.ClearSelection() + If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1", CveCliente, -1, -1, -1, "-1", "-1", "-1", CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then + DdlVentasE.DataSource = ObjVentas.DtResultados '.FiltraParametros("Saldo > 0") + DdlVentasE.DataBind() + DdlVentasE.Items.Insert(0, New ListItem(" - ", "-1")) + Else + DdlVentasE.DataSource = Nothing + DdlVentasE.DataBind() + DdlVentasE.Items.Insert(0, New ListItem(" - ", "-1")) + End If + ObjVentas.Dispose() + End Sub + Private Sub CargaPersonalE() + DdlPersonalE.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa) + DdlPersonalE.DataBind() + DdlPersonalE.Items.Insert(0, New ListItem(" - ", "-1")) + End Sub + Private Sub DdlProveedoresE_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProveedoresE.SelectedIndexChanged + CargaComprasE(DdlProveedoresE.SelectedValue.ToEntero) + End Sub + Private Sub DdlClientesE_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlClientesE.selectedindexchange + CargaVentasE(DdlClientesE.SelectedValue.ToEntero) + End Sub + Protected Sub BtnAceptar_Click(sender As Object, e As EventArgs) Handles BtnAceptar.Click + + If IndiceGrid = -1 Then + If DtMovimientos Is Nothing Then CreaDT() + If CvePrePoliza > 0 Then + Dim dr As DataRow = DtMovimientos.NewRow + dr("IdCtaContable") = DdlCtaContableE.SelectedValue + dr("ConceptoContable") = DdlConceptosContablesE.SelectedItem.Text + dr("CveConceptoContable") = DdlConceptosContablesE.SelectedValue + dr("Concepto") = TxtConceptoE.Text + dr("Referencia") = TxtReferenciaE.Text + dr("TipoMovto") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, 0, 1) + dr("Cargo") = TxtCargoE.Text.ToDouble + dr("Abono") = TxtAbonoE.Text.ToDouble + dr("ImporteMN") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, TxtCargoE.Text.ToDouble, TxtAbonoE.Text.ToDouble) + dr("CveSubProyecto") = DdlSubProyectoE.SelectedValue + dr("SubProyecto") = DdlSubProyectoE.SelectedItem.Text + dr("CveProveedor") = DdlProveedoresE.SelectedValue.ToEntero + dr("CveCompra") = DdlComprasE.SelectedValue.ToEntero + dr("CvePersonal") = DdlPersonalE.SelectedValue.ToEntero + dr("CveCliente") = DdlClientesE.SelectedValue.ToEntero + dr("CveVenta") = DdlVentasE.SelectedValue.ToEntero + dr("FolioFactura") = If(DdlComprasE.Visible = True, DdlComprasE.SelectedItem.ToString, If(DdlVentasE.Visible = True, DdlVentasE.SelectedItem.ToString, "")) + + + TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbonoE.Text.ToDouble).ToString.FormatoNumero + TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargoE.Text.ToDouble).ToString.FormatoNumero + DtMovimientos.Rows.Add(dr) + DtMovimientos.AcceptChanges() + + If CvePrePoliza > 0 Then + GvPrePoliza.DataSource = DtMovimientos + GvPrePoliza.DataBind() + UpPrePoliza.Update() + End If + Else + 'Dim dr As DataRow = DtMovimientos.NewRow + 'Dim CodigoCuenta As String = "" + 'Dim NombreCuenta As String = "" + + 'dr("IdCuenta") = DdlCtaContableE.SelectedValue + + 'If DdlCtaContableE.SelectedValue.ToEntero > 0 Then + ' Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", DdlCtaContableE.SelectedValue)) + ' If drr IsNot Nothing Then + ' CodigoCuenta = drr("CuentaFormato").ToString() + ' NombreCuenta = drr("Nombre").ToString() + ' End If + 'End If + + 'dr("CodigoCuenta") = CodigoCuenta & "
    " & NombreCuenta + 'dr("Cuenta") = DdlConceptosContablesE.SelectedItem.Text + 'dr("Referencia") = TxtReferenciaE.Text + 'dr("Concepto") = TxtConceptoE.Text + 'dr("TipoMovto") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, 0, 1) + 'dr("EsComodin") = 0 + 'dr("CveConcepto") = DdlConceptosContablesE.SelectedValue + 'dr("CveConceptoContable") = DdlConceptosContablesE.SelectedValue + 'dr("ConceptoContable") = DdlConceptosContablesE.SelectedItem.Text + 'dr("Cargo") = TxtCargoE.Text.ToDouble + 'dr("Abono") = TxtAbonoE.Text.ToDouble + ''dr("Descripcion") = TxtDescripcionE.Text + 'dr("CveSubProyecto") = DdlSubProyectoE.SelectedValue + 'dr("CveProveedor") = DdlProveedoresE.SelectedValue.ToEntero + 'dr("CveCompra") = DdlComprasE.SelectedValue.ToEntero + 'dr("CvePersonal") = DdlPersonalE.SelectedValue.ToEntero + 'dr("CveClasificacion") = -1 + 'dr("CveCliente") = DdlClientesE.SelectedValue.ToEntero + 'dr("CveVenta") = DdlVentasE.SelectedValue.ToEntero + + 'TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbonoE.Text.ToDouble).ToString.FormatoNumero + 'TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargoE.Text.ToDouble).ToString.FormatoNumero + 'DtMovimientos.Rows.Add(dr) + 'DtMovimientos.AcceptChanges() + + 'GvMov.DataSource = DtMovimientos + 'GvMov.DataBind() + 'UPMovs.Update() + 'Actualizar = False + + End If + Else + Dim CvePrePolizaDetalle As Integer = GvPrePoliza.DataKeys(IndiceGrid).Value.ToString.ToEntero + Dim Rows As DataRow() = DtMovimientos.Select("CvePrePolizaDetalle = " & CvePrePolizaDetalle) + + If Rows.Count > 0 Then + Dim dr As DataRow = Rows(0) + dr("IdCtaContable") = DdlCtaContableE.SelectedValue + dr("ConceptoContable") = DdlConceptosContablesE.SelectedItem.Text + dr("CveConceptoContable") = DdlConceptosContablesE.SelectedValue + dr("Concepto") = TxtConceptoE.Text + dr("Referencia") = TxtReferenciaE.Text + dr("TipoMovto") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, 0, 1) + dr("ImporteMN") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, TxtCargoE.Text.ToDouble, TxtAbonoE.Text.ToDouble) + dr("CveSubProyecto") = DdlSubProyectoE.SelectedValue + dr("SubProyecto") = DdlSubProyectoE.SelectedItem.Text + dr("CveProveedor") = DdlProveedoresE.SelectedValue.ToEntero + dr("CveCompra") = DdlComprasE.SelectedValue.ToEntero + dr("CvePersonal") = DdlPersonalE.SelectedValue.ToEntero + dr("CveCliente") = DdlClientesE.SelectedValue.ToEntero + dr("CveVenta") = DdlVentasE.SelectedValue.ToEntero + dr("FolioFactura") = If(DdlComprasE.Visible = True, DdlComprasE.SelectedItem.ToString, If(DdlVentasE.Visible = True, DdlVentasE.SelectedItem.ToString, "")) + + 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnConceptoContable").Value = DdlConceptosContablesE.SelectedValue.ToEntero + 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnProveedor").Value = DdlProveedoresE.SelectedValue.ToEntero + 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnCompra").Value = DdlComprasE.SelectedValue.ToEntero + 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnPersonal").Value = DdlPersonalE.SelectedValue.ToEntero + 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnCliente").Value = DdlClientesE.SelectedValue.ToEntero + 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnVenta").Value = DdlVentasE.SelectedValue.ToEntero + + 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnSubProyecto").Value = DdlSubProyectoE.SelectedValue.ToEntero + 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnTipoGasto").Value = DdlTipoGastoE.SelectedValue.ToEntero + 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnCtaContable").Value = DdlCtaContableE.SelectedValue.ToEntero + + If TxtCargoE.Text <> "" Then + dr("Cargo") = TxtCargoE.Text.ToDouble + dr("Abono") = "".ToDouble + Else + dr("Abono") = TxtAbonoE.Text.ToDouble + dr("Cargo") = "".ToDouble + End If + + TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbonoE.Text.ToDouble).ToString.FormatoNumero + TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargoE.Text.ToDouble).ToString.FormatoNumero + DtMovimientos.AcceptChanges() + GvPrePoliza.EditIndex = -1 + + If CvePrePoliza > 0 Then + GvPrePoliza.DataSource = DtMovimientos + GvPrePoliza.DataBind() + UpPrePoliza.Update() + End If + + End If + End If + + UpPrePoliza.Update() + RegistraScript("$('#DivEditConcepto').modal('hide')", "hidemodal") + End Sub + Protected Sub GvMov_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvMov.RowDeleting + + Dim idMov As Integer = GvMov.DataKeys(e.RowIndex).Value.ToString.ToEntero + + Dim Rows As DataRow() = DtMovimientos.Select("IDMov = " & idMov) + If Rows.Count > 0 Then + DtMovimientos.Rows.Remove(Rows(0)) + DtMovimientos.AcceptChanges() + End If + GvMov.DataSource = DtMovimientos + GvMov.DataBind() + + TxtTotalAbonos.Text = DtMovimientos.SUM("Abono").FormatoNumero + TxtTotalCargos.Text = DtMovimientos.SUM("Cargo").FormatoNumero + + 'saco de la póliza el importe del cheque, que coincida la cuenta contable con la bancaria + + End Sub + + Private Sub LbAgregar_Click(sender As Object, e As EventArgs) Handles LbAgregar.Click + + If DtMovimientos Is Nothing Then CreaDT() + + If Actualizar Then + + Dim Rows As DataRow() = DtMovimientos.Select("IDMov = " & HdnCve.Value) + + If Rows.Count > 0 Then + Dim dr As DataRow = Rows(0) + Dim CodigoCuenta As String = "" + Dim NombreCuenta As String = "" + dr("IdCuenta") = DdlCtaContable.SelectedValue + + If DdlCtaContable.SelectedValue.ToEntero > 0 Then + Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", DdlCtaContable.SelectedValue)) + If drr IsNot Nothing Then + CodigoCuenta = drr("CuentaFormato").ToString() + NombreCuenta = drr("Nombre").ToString() + End If + End If + + dr("CodigoCuenta") = CodigoCuenta & "
    " & NombreCuenta + dr("Cuenta") = DdlConceptosContables.SelectedItem + dr("Referencia") = TxtReferencia.Text + dr("Concepto") = TxtObservaciones.Text + dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1) + dr("EsComodin") = 0 + dr("CveConcepto") = DdlConceptosContables.SelectedValue + dr("Cargo") = TxtCargo.Text.ToDouble + dr("Abono") = TxtAbono.Text.ToDouble + dr("Descripcion") = TxtDescripcion.Text + dr("CveSubProyecto") = DdlSubProyecto.SelectedValue + dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero + dr("CveCompra") = DdlCompras.SelectedValue.ToEntero + dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero + dr("CveClasificacion") = -1 + dr("CveCliente") = DdlClientes.SelectedValue.ToEntero + dr("CveVenta") = DdlVentas.SelectedValue.ToEntero + End If + LbCancelarEdicion.Visible = False + LbAgregar.Text = "Agregar" + + Else + + If CvePrePoliza > 0 Then + Dim dr As DataRow = DtMovimientos.NewRow + dr("IdCtaContable") = DdlCtaContable.SelectedValue + dr("ConceptoContable") = DdlConceptosContables.SelectedItem.Text + dr("CveConceptoContable") = DdlConceptosContables.SelectedValue + dr("Concepto") = TxtDescripcion.Text + dr("Referencia") = TxtReferencia.Text + dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1) + dr("Cargo") = TxtCargo.Text.ToDouble + dr("Abono") = TxtAbono.Text.ToDouble + dr("ImporteMN") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, TxtCargo.Text.ToDouble, TxtAbono.Text.ToDouble) + dr("CveSubProyecto") = DdlSubProyecto.SelectedValue + dr("SubProyecto") = DdlSubProyecto.SelectedItem.Text + dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero + dr("CveCompra") = DdlCompras.SelectedValue.ToEntero + dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero + dr("CveCliente") = DdlClientes.SelectedValue.ToEntero + dr("CveVenta") = DdlVentas.SelectedValue.ToEntero + + + TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString.FormatoNumero + TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString.FormatoNumero + DtMovimientos.Rows.Add(dr) + DtMovimientos.AcceptChanges() + + If CvePrePoliza > 0 Then + GvPrePoliza.DataSource = DtMovimientos + GvPrePoliza.DataBind() + UpPrePoliza.Update() + End If + Else + Dim dr As DataRow = DtMovimientos.NewRow + Dim CodigoCuenta As String = "" + Dim NombreCuenta As String = "" + + dr("IdCuenta") = DdlCtaContable.SelectedValue + + If DdlCtaContable.SelectedValue.ToEntero > 0 Then + Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", DdlCtaContable.SelectedValue)) + If drr IsNot Nothing Then + CodigoCuenta = drr("CuentaFormato").ToString() + NombreCuenta = drr("Nombre").ToString() + End If + End If + + dr("CodigoCuenta") = CodigoCuenta & "
    " & NombreCuenta + dr("Cuenta") = DdlConceptosContables.SelectedItem.Text + dr("Referencia") = TxtReferencia.Text + dr("Concepto") = TxtObservaciones.Text + dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1) + dr("EsComodin") = 0 + dr("CveConcepto") = DdlConceptosContables.SelectedValue + dr("CveConceptoContable") = DdlConceptosContables.SelectedValue + dr("ConceptoContable") = DdlConceptosContables.SelectedItem.Text + dr("Cargo") = TxtCargo.Text.ToDouble + dr("Abono") = TxtAbono.Text.ToDouble + dr("Descripcion") = TxtDescripcion.Text + dr("CveSubProyecto") = DdlSubProyecto.SelectedValue + dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero + dr("CveCompra") = DdlCompras.SelectedValue.ToEntero + dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero + dr("CveClasificacion") = -1 + dr("CveCliente") = DdlClientes.SelectedValue.ToEntero + dr("CveVenta") = DdlVentas.SelectedValue.ToEntero + + TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString.FormatoNumero + TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString.FormatoNumero + DtMovimientos.Rows.Add(dr) + DtMovimientos.AcceptChanges() + + 'If CvePrePoliza > 0 Then + ' GvPrePoliza.DataSource = DtMovimientos + ' GvPrePoliza.DataBind() + ' UpPrePoliza.Update() + 'End If + + GvMov.DataSource = DtMovimientos + GvMov.DataBind() + UPMovs.Update() + Actualizar = False + + End If + + End If + + TxtCargo.Text = "" + TxtAbono.Text = "" + TxtReferencia.Text = "" + TxtDescripcion.Text = "" + End Sub + +#Region "PESTAÑA INFORMACION GENERAL DE BANCO IE" + Public Sub Bancos_Click(sender As Object, e As EventArgs) + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + RowIndex = GvRow.RowIndex + + If GvRow.FCTextBox("TxtAbono").Text = "" Then + CargaTipoTransaccion("Ing") + Else + CargaTipoTransaccion("Egs") + End If + + + TxtDocumentoImporte.Text = If(GvRow.FCTextBox("TxtAbono").Text = "", GvRow.FCTextBox("TxtCargo").Text.FormatoNumero, GvRow.FCTextBox("TxtAbono").Text.FormatoNumero) + UpBancos.Update() + RegistraScript(String.Format("$('#{0}').modal();", "DivContadoModal")) + End Sub + Private Sub CargaTipoTransaccion(Tipo As String) + DdlTipoTransaccion.Items.Clear() + DdlTipoTransaccion.DataSource = GlobalDTTipoTransacciones.FiltraParametros($"Tipo = '{Tipo}'") + DdlTipoTransaccion.DataBind() + DdlTipoTransaccion.Items.Insert(0, New ListItem("Seleccione Tipo Movimiento", "-1")) + End Sub + Private Sub CargaCuentas() + DdlCuenta.Items.Clear() + DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario) '.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", DdlMoneda.SelectedValue)) + DdlCuenta.DataBind() + DdlCuenta.Items.Insert(0, New ListItem("Seleccione", "-1")) + End Sub + Private Sub BtnContado_Click(sender As Object, e As EventArgs) Handles BtnContado.Click + CveConcepto = 30 + CveTipoTransaccion = DdlTipoTransaccion.SelectedValue.ToEntero + CveCuenta = DdlCuenta.SelectedValue.ToEntero + Folio = TxtDocumentoFolio.Text + ImporteDocumento = TxtDocumentoImporte.Text.ToDecimal + Observaciones = TxtDocumentoObservaciones.Text + Beneficiario = TxtDocumentoBeneficiario.Text + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivContadoModal")) + GvMov.Rows(RowIndex).FCLinkButton("ImgBancos").CssClass = "btn btn-circle btn-sm green" + UPMovs.Update() + End Sub + + Private Sub BtnEliminar_Click(sender As Object, e As EventArgs) Handles BtnEliminar.Click + Dim ObjContabilidad As New ClsContabilidad + + If ObjContabilidad.RemovePrePolizas(CvePrePoliza, UsuarioActual.CveEmpresa) Then + Alert("La Prepóliza ha sido eliminada", TipoMensaje.MsgInformacion) + Else + Alert("La Prepóliza ha podido ser eliminada", TipoMensaje.MsgError) + End If + + ObjContabilidad.Dispose() + End Sub +#End Region + + Protected Sub DdlTipoGasto_SelectedIndexChanged(sender As Object, e As EventArgs) + If UpPrePoliza.Visible Then + For Each Gvr As GridViewRow In GvPrePoliza.Rows + Gvr.FCDropDownList("DdlTipoGasto").SelectedValueExist(DdlTipoGasto.SelectedValue) + Next + UpPrePoliza.Update() + End If + If UPMovs.Visible Then + For Each Gvr As GridViewRow In GvMov.Rows + Gvr.FCDropDownList("DdlTipoGasto").SelectedValueExist(DdlTipoGasto.SelectedValue) + Next + UPMovs.Update() + End If + End Sub + Protected Sub DdlSubProyectoFiltro_SelectedIndexChanged(sender As Object, e As EventArgs) + Dim Ddl As DropDownList = CType(sender, DropDownList) + For Each Gvr As GridViewRow In GvPrePoliza.Rows + If Ddl.SelectedValue.ToEntero > 0 Then + If Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero = Ddl.SelectedValue.ToEntero Or Not Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero > 0 Then + Gvr.Visible = True + Else + Gvr.Visible = False + End If + Else + Gvr.Visible = True + End If + Next + UpPrePoliza.Update() + RegistraScript("calculateAbono()", "cargo") + RegistraScript("calculateCargo()", "abono") + RegistraScript("comparar()", "compara") + End Sub + Protected Sub DdlSubProyectoFiltroMov_SelectedIndexChanged(sender As Object, e As EventArgs) + For Each Gvr As GridViewRow In GvMov.Rows + If DdlSubProyectoFiltroMov.SelectedValue.ToEntero > 0 Then + If Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero = DdlSubProyectoFiltroMov.SelectedValue.ToEntero Or Not Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero > 0 Then + Gvr.Visible = True + Else + Gvr.Visible = False + End If + Else + Gvr.Visible = True + End If + Next + UpPrePoliza.Update() + RegistraScript("calculateAbono()", "cargo") + RegistraScript("calculateCargo()", "abono") + RegistraScript("comparar()", "compara") + End Sub + + Private Sub GvMov_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GvMov.RowEditing + Actualizar = True + GvMov.DataKeys(e.NewEditIndex).Value.ToString.ToEntero + Dim idMov As Integer = GvMov.DataKeys(e.NewEditIndex).Value.ToString.ToEntero + + Dim DrM As DataRow = DtMovimientos.Rows(e.NewEditIndex) + + If DrM IsNot Nothing Then + HdnCve.Value = idMov.ToString + + DdlCtaContable.SelectedValue = DrM("IdCuenta") + TxtReferencia.Text = DrM("Referencia") + TxtObservaciones.Text = DrM("Concepto") + ' (Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1) = dr("TipoMovto") + DrM("EsComodin") = 0 + DdlConceptosContables.SelectedValue = DrM("CveConcepto").ToString + TxtCargo.Text = DrM("Cargo").ToString + TxtAbono.Text = DrM("Abono").ToString + TxtDescripcion.Text = DrM("Descripcion") + DdlSubProyecto.SelectedValue = DrM("CveSubProyecto") + DdlProveedores.SelectedValue = DrM("CveProveedor") + DdlCompras.SelectedValue = DrM("CveCompra") + DdlPersonal.SelectedValue = DrM("CvePersonal") + ' DrM("CveClasificacion") = -1 + DdlClientes.SelectedValue = DrM("CveCliente") + DdlVentas.SelectedValue = DrM("CveVenta") + LbCancelarEdicion.Visible = True + LbAgregar.Text = "Actualizar" + + End If + + UPPDocumento.Update() + DivAgregarConceptos.Visible = True + + 'If DtMovimientos Is Nothing Then CreaDT() + + 'Dim dr As DataRow = DtMovimientos.NewRow + 'Dim CodigoCuenta As String = "" + 'Dim NombreCuenta As String = "" + + 'dr("IdCuenta") = DdlCtaContable.SelectedValue + + 'If DdlCtaContable.SelectedValue.ToEntero > 0 Then + ' Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", DdlCtaContable.SelectedValue)) + ' If drr IsNot Nothing Then + ' CodigoCuenta = drr("CuentaFormato").ToString() + ' NombreCuenta = drr("Nombre").ToString() + ' End If + 'End If + + 'dr("CodigoCuenta") = CodigoCuenta & "
    " & NombreCuenta + 'dr("Cuenta") = DdlConceptosContables.SelectedItem + 'dr("Referencia") = TxtReferencia.Text + 'dr("Concepto") = TxtObservaciones.Text + 'dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1) + 'dr("EsComodin") = 0 + 'dr("CveConcepto") = DdlConceptosContables.SelectedValue + 'dr("Cargo") = TxtCargo.Text.ToDouble + 'dr("Abono") = TxtAbono.Text.ToDouble + 'dr("Descripcion") = TxtDescripcion.Text + 'dr("CveSubProyecto") = DdlSubProyecto.SelectedValue + 'dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero + 'dr("CveCompra") = DdlCompras.SelectedValue.ToEntero + 'dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero + 'dr("CveClasificacion") = -1 + 'dr("CveCliente") = DdlClientes.SelectedValue.ToEntero + 'dr("CveVenta") = DdlVentas.SelectedValue.ToEntero + + 'TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString.FormatoNumero + 'TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString.FormatoNumero + 'DtMovimientos.Rows.Add(dr) + + 'If CvePrePoliza > 0 Then + ' GvPrePoliza.DataSource = DtMovimientos + ' GvPrePoliza.DataBind() + 'End If + + + 'GvMov.DataSource = DtMovimientos + 'GvMov.DataBind() + 'UPMovs.Update() + + + End Sub + + Private Sub LbCancelarEdicion_Click(sender As Object, e As EventArgs) Handles LbCancelarEdicion.Click + LbCancelarEdicion.Visible = False + TxtObservaciones.Text = "" + Actualizar = False + LbAgregar.Text = "Agregar" + End Sub + + Private Sub BtnContabilizar_Click(sender As Object, e As EventArgs) Handles BtnContabilizar.Click + + Dim ObjConta As New ClsContabilidad + + If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then + Alert(String.Format("Prepóliza contabilizada.

    Folio:Ver Póliza", ObjConta.ContaIdPoliza), ModExtensiones.TipoMensaje.MsgInformacion) + Else + + Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia) + End If + + ObjConta.Dispose() + + + End Sub + + +#Region "COMPLEMENTO DE PAGO" + + Private Sub GeneraTimbre(CvePrePoliza As Integer) + Dim Str As New StringBuilder + Dim Banco As New ClsBancos + Banco.IniciaTransacSQL() + If Banco.GeneraTimbrePago(-1, -1, UsuarioActual, CvePrePoliza:=CvePrePoliza) Then + If Banco.Mensaje = "" Then + Banco.Commit() + PDFReciboDePagos(-1, -1, Banco.CveComplementoPago, False) + Str.AppendFormat("Folio: {0}  ", Banco.ComplementoSerieFolio) + Str.AppendFormat("XML    ", Encripta(String.Format("OP=CompP&EXT=xml&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago))) + Str.AppendFormat("PDF   ", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago))) + MandaCorreo(Banco.ComplementoSerieFolio, Banco.CobranzaCorreo) + End If + Else + Banco.RollBack() + Str.AppendFormat("No se genero complemento por el siguiente motivo: {0}", Banco.Mensaje) + End If + Banco.Dispose() + Alert(Str.ToString, TipoMensaje.MsgInformacion, "self.parent.tb_remove();self.parent.location.reload();") + End Sub + + Private Sub MandaCorreo(NombreArchivo As String, Correo As String, Optional ConAlerta As Boolean = True) + Try + Dim Msg As String = "" + If NombreArchivo <> "-1" Then ' + Dim ObjMail As New ClsSisMail() + Dim RutaXML As String = String.Format("{0}\XML\Pag\{1}.xml", UsuarioActual.Empresa.Ruta, NombreArchivo) + Dim RutaPDF As String = String.Format("{0}\PDF\Pag\{1}.pdf", UsuarioActual.Empresa.Ruta, NombreArchivo) + Dim Cuerpo As String = "Se hace entrega del comprobante de pago" + Dim Asunto As String = "Entrega de comprobante de pago" + If IO.File.Exists(RutaPDF) AndAlso IO.File.Exists(RutaXML) Then + Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail) + LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = RutaPDF}) + LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = RutaXML}) + If ObjMail.SendMail(UsuarioActual.Empresa, Correo, Asunto, Cuerpo, "", LSRutasMail) Then + If ConAlerta Then + 'RegistraScript("$('#ModalDivMail').modal('hide');") + Alert("El correo se envió correctamente", TipoMensaje.MsgInformacion) + End If + Else + Msg = "No se pudo enviar el correo electrónico." + End If + Else + Msg = "No se pudo adjuntar el correo electrónico." + End If + End If + If ConAlerta AndAlso Msg <> "" Then + Alert(Msg, TipoMensaje.MsgError) + End If + Catch ex As Exception + OnError("Ocurrió error al mandar MAIL", ex) + End Try + End Sub + + Protected Sub LnkComplementoPago_Click(sender As Object, e As EventArgs) + GeneraTimbre(CvePrePoliza) + End Sub +#End Region + + + +End Class + From 161dad4592fcc29f3242f08910c2b00545545d61 Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 28 Feb 2020 13:48:31 -0700 Subject: [PATCH 15/34] - --- Contabilidad/RegPrePoliza1.aspx.vb | 22 +++------------------- Inventarios/RecepcionAlmacen.aspx.vb | 3 ++- Ventas/ClientesAbonar.aspx.vb | 2 +- Ventas/Ventas.aspx.vb | 1 + 4 files changed, 7 insertions(+), 21 deletions(-) diff --git a/Contabilidad/RegPrePoliza1.aspx.vb b/Contabilidad/RegPrePoliza1.aspx.vb index 36f359c07..396eb55d9 100644 --- a/Contabilidad/RegPrePoliza1.aspx.vb +++ b/Contabilidad/RegPrePoliza1.aspx.vb @@ -175,18 +175,7 @@ Partial Class ContabilidadC_RegPrePoliza Beneficiario = "-1" Actualizar = False - Dim dt As DataTable = Nothing - If UsuarioActual.Empresa.UsaContabilidad Then - Dim Conta As New ClsContPAQi(UsuarioActual.Empresa) - - If Conta.GetCuentas(-1, "-1", 1) Then - dt = Conta.DtResultados - DtCuentasContables = Conta.DtResultados - Session("DtCuentas") = Conta.DtResultados - End If - Conta.Dispose() - - If IfNull(Request("Tipo"), "").ToString = "NOMPROV" Then + If IfNull(Request("Tipo"), "").ToString = "NOMPROV" Then DivTipoGasto.Visible = True ThTipoGasto.Visible = True CargaTiposGasto() @@ -250,14 +239,9 @@ Partial Class ContabilidadC_RegPrePoliza GvMov.Columns(4).Visible = False End If - Else - Alert("Este módulo requiere el uso de Contabilidad.", TipoMensaje.MsgAdvertencia) - BtnIEGuardar.Enabled = False - BtnEliminar.Visible = False - LbAgregar.Enabled = False - End If - End If + + End If End Sub diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index 12c73fb0e..e5801a2a1 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -2999,7 +2999,7 @@ Partial Class Inventarios_RecepcionAlmacen End If End If - If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then + If Not ErrorMovInv AndAlso UsuarioActual.Empresa.Funcionalidad(200) = "1" Then ObjContaAC = New ClsContPAQi(UsuarioActual.Empresa) ObjContaAC.IniciaTransacSQL() If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContaAC) Then @@ -3029,6 +3029,7 @@ Partial Class Inventarios_RecepcionAlmacen ObjInventario.RollBack() If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack() RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") + GuardaLog(MensajeError) Alert("Error al guardar el movimiento de almacen. Por favor vuelva a intentar.", TipoMensaje.MsgError) End If diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb index fa1d019a5..a9c503494 100644 --- a/Ventas/ClientesAbonar.aspx.vb +++ b/Ventas/ClientesAbonar.aspx.vb @@ -1385,7 +1385,7 @@ Partial Class Ventas_ClientesAbonar ImporteMovimiento = 0 End Select - If ImporteMovimiento <> 0 Then + If ImporteMovimiento <> 0 AndAlso MsgError = "" Then 'Conta ContPAQ If (IdCtaContable < 1 Or IdCuentaBancaria < 1) Then CuentasContablesInvalidas.Append("
    " & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index d5fb792ac..3c3e134ce 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -11695,6 +11695,7 @@ Partial Class Ventas End If End If + saldo = saldo.RoundSQL() Dim maxsaldo As Decimal If total > saldo Then From 474a6239a84799cfb0e887d0db09849f113c4aeb Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Fri, 28 Feb 2020 16:44:29 -0700 Subject: [PATCH 16/34] OC Ddlclientes se pasa a DropDownLost, si se selcciona cliente se debe de seleccionr vendedor --- OC/OC.aspx | 5 ++-- OC/OC.aspx.vb | 69 +++++++++++++++++++++++++++++++++++++-------------- vwd.webinfo | 4 +++ 3 files changed, 56 insertions(+), 22 deletions(-) diff --git a/OC/OC.aspx b/OC/OC.aspx index 695e0f215..e7fe70a15 100644 --- a/OC/OC.aspx +++ b/OC/OC.aspx @@ -587,11 +587,10 @@
    - Cliente: - + Cliente:
    - + <%-- --%>
    diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index f1b7bf225..4b84a2229 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -529,7 +529,19 @@ Partial Class OC If DrCot IsNot Nothing Then HLCotizacion.Text = String.Format("{0}-{1}", DrCot("Serie"), DrCot("Folio")) 'CveVendedor DdlVendedor.SelectedValueExist(DrCot("CveVendedor").ToString()) - Ddlcliente.SelectedValueExist(DrCot("CveCliente").ToString()) + + + Try + Ddlcliente.txtText.Value = DrCot("ClienteNombre").ToString() + Ddlcliente.txtValue.Value = DrCot("CveCliente").ToString() + Catch ex As Exception + + End Try + + + + + End If End If End If @@ -1207,10 +1219,15 @@ Partial Class OC ''DATOS DE VENTA If UsuarioActual.Empresa.Funcionalidad(108) = "1" Then - Ddlcliente.SelectedValueExist(objOC.CveCliente.ToString) - If Ddlcliente.SelectedValue <> objOC.CveCliente.ToString Then - Ddlcliente.Items.Insert(1, New ListItem(GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Nombre", $"CveCliente = {objOC.CveCliente}"), objOC.CveCliente.ToString)) - End If + + Ddlcliente.txtValue.Value = objOC.CveCliente.ToString + Ddlcliente.txtText.Value = objOC.NombreCliente + + 'If Ddlcliente.SelectedValue <> objOC.CveCliente.ToString Then + + ' Ddlcliente.Items.Insert(1, New ListItem(GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Nombre", $"CveCliente = {objOC.CveCliente}"), objOC.CveCliente.ToString)) + + 'End If DdlVendedor.SelectedValueExist(objOC.CveVendedor.ToString) If DdlVendedor.SelectedValue <> objOC.CveVendedor.ToString Then @@ -2121,7 +2138,7 @@ Partial Class OC Dim TieneError = False 'Entrega Directa requiere Cliente y Vendedor - If ChkEntregaDirecta.Checked And Ddlcliente.SelectedValue.ToEntero <= 0 Then + If ChkEntregaDirecta.Checked And Ddlcliente.txtValue.Value.ToEntero <= 0 Then Alert("Al ser una Entrega Directa es necesario seleccionar un cliente, por favor seleccione uno.") Return True End If @@ -2138,6 +2155,11 @@ Partial Class OC Return True End If + If Ddlcliente.txtValue.Value.ToEntero > 0 And DdlVendedor.SelectedValue.ToEntero <= 0 Then + Alert("Debe de seleccionar Un vendedor ", TipoMensaje.MsgAdvertencia) + TieneError = True + End If + 'SI ES REQUISICION, NO REQUIERE COTIZACION Y ES ESTATUSFINALOK... ENTONCES DEBE DE TENER UN PROVEEDOR SELECCIONADO Y LOS PRECIOS CAPTURADOS @@ -2372,7 +2394,7 @@ Partial Class OC If Not TieneError Then ' AGREGAR REQUISICION If OC.AddOrdenCompra("REQ", -1, TxtDescrip.Text, TxtJustificacion.Text, DdlPrioridad.SelectedValue.ToEntero, TxtFecha.Text.ToDate, DdlMoneda.SelectedValue.ToEntero, CboE.SelectedValue.ToEntero, If(TxtFechaEstimadaEntrega.Text.Trim = "", "-1", TxtFechaEstimadaEntrega.Text.Trim), LugarEntrega, UsuarioActual.CveUsuario, CveEmpresaActual, GvD.Rows(0).FCHiddenField("HdnCvePresupuestoEgreso").Value.ToString.ToEntero, pCveProveedor:=CveProveedor, pCveProveedorSucursal:=CveProveedorSucursal, - RequiereCotizacion:=ChkCotizacion.Checked, CveCliente:=Ddlcliente.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text, PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, + RequiereCotizacion:=ChkCotizacion.Checked, CveCliente:=Ddlcliente.txtValue.Value.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text, PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), Guia:=TxtGuia.Text.Trim, IEPS:=TxtIEPS.Text.ToDecimal, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, Promocion:=Promocion, CveProveedorContacto:=CveProveedorContacto) Then @@ -2406,7 +2428,7 @@ Partial Class OC If OC.AddOrdenCompra(If(TipoOS, "OS", TipoOC), -1, TxtDescrip.Text, TxtJustificacion.Text, DdlPrioridad.SelectedValue.ToEntero, TxtFecha.Text.ToDate, DdlMoneda.SelectedValue.ToEntero, CveEstatusNuevo, If(TxtFechaEstimadaEntrega.Text.Trim = "", "-1", TxtFechaEstimadaEntrega.Text.Trim), LugarEntrega, UsuarioActual.CveUsuario, CveEmpresaActual, GvD.Rows(0).FCHiddenField("HdnCvePresupuestoEgreso").Value.ToString.ToEntero, pCveProveedor:=CveProveedor, pCveProveedorSucursal:=CveProveedorSucursal, - RequiereCotizacion:=ChkCotizacion.Checked, CveUsuarioAsignado:=DdlUsuariosAsignado.SelectedValue.ToEntero, CveCliente:=Ddlcliente.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text, + RequiereCotizacion:=ChkCotizacion.Checked, CveUsuarioAsignado:=DdlUsuariosAsignado.SelectedValue.ToEntero, CveCliente:=Ddlcliente.txtValue.Value.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text, PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), Guia:=TxtGuia.Text.Trim, IEPS:=TxtIEPS.Text.ToDecimal, CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=LtImporteIEAnticipo.Text.ToDouble, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, Promocion:=Promocion, CveProveedorContacto:=CveProveedorContacto) Then @@ -2539,7 +2561,7 @@ Partial Class OC End If If Not OC.UpdateOrdenCompra(-1, TxtDescrip.Text, TxtJustificacion.Text, DdlPrioridad.SelectedValue.ToEntero, ChkCotizacion.Checked, If(TxtFechaEstimadaEntrega.Text.Trim = "", "-1", TxtFechaEstimadaEntrega.Text.Trim), - LugarEntrega, DdlMoneda.SelectedValue.ToEntero, CveProveedor, CveOrdenCompra, UsuarioActual.CveUsuario, Ddlcliente.SelectedValue.ToEntero, + LugarEntrega, DdlMoneda.SelectedValue.ToEntero, CveProveedor, CveOrdenCompra, UsuarioActual.CveUsuario, Ddlcliente.txtValue.Value.ToEntero, DdlVendedor.SelectedValue.ToEntero, txtobsprioridad.Text, IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), Guia:=TxtGuia.Text.Trim, IEPS:=TxtIEPS.Text.ToDecimal, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, Promocion:=Promocion, pCveProveedorSucursal:=DdlProveedorSucursal.SelectedValue.ToEntero, CveProveedorContacto:=CveProveedorContacto, PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2)) Then @@ -2939,6 +2961,13 @@ Partial Class OC End Sub Protected Function GeneraOrdenes(ByRef objOrdenCompra As ClsOC, Conta As ClsContPAQi, ByRef ObjInventarios As ClsInventarios) As Boolean + + + 'If Ddlcliente.txtValue.Value.ToEntero > 0 And DdlVendedor.SelectedValue.ToEntero <= 0 Then + ' Alert("Debe de seleccionar Un vendedor ", TipoMensaje.MsgAdvertencia) + ' Exit Function + 'End If + If TipoOS Then Return False Dim CveCotizacion As Integer = 0 @@ -2978,7 +3007,7 @@ Partial Class OC RetISR = TxtRetISR.Text.ToDecimal If objOrdenCompra.AddOrdenCompra("OC", -1, TxtDescrip.Text, TxtJustificacion.Text, DdlPrioridad.SelectedValue.ToEntero, TxtFecha.Text.ToDate, DdlMoneda.SelectedValue.ToEntero, CveEstatusInicialOC, TxtFechaEstimadaEntrega.Text, LugarEntrega, - CveUsuario, CveEmpresaActual, 0, pCveProveedor:=CveProveedor, CveCliente:=Ddlcliente.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text, + CveUsuario, CveEmpresaActual, 0, pCveProveedor:=CveProveedor, CveCliente:=Ddlcliente.txtValue.Value.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text, PorcentajeIVA:=PorIVA, IVA:=IVACot, RetIVA:=RetIVA.ToString.ToDecimal, RetISR:=RetISR.ToString.ToDecimal, IDPoliza:=IdPoliza, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), IEPS:=TxtIEPS.Text.ToDecimal, CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=LtImporteIEAnticipo.Text.ToDouble, Promocion:=Promocion, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero) Then @@ -3045,7 +3074,7 @@ Partial Class OC Else If objOrdenCompra.AddOrdenCompra("OC", -1, TxtDescrip.Text, TxtJustificacion.Text, DdlPrioridad.SelectedValue.ToEntero, TxtFecha.Text.ToDate, DdlMoneda.SelectedValue.ToEntero, CveEstatusInicialOC, TxtFechaEstimadaEntrega.Text, LugarEntrega, - CveUsuario, CveEmpresaActual, 0, pCveProveedor:=DdlProveedores.SelectedValue.ToEntero, pCveProveedorSucursal:=DdlProveedorSucursal.SelectedValue.ToEntero, CveCliente:=Ddlcliente.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text, + CveUsuario, CveEmpresaActual, 0, pCveProveedor:=DdlProveedores.SelectedValue.ToEntero, pCveProveedorSucursal:=DdlProveedorSucursal.SelectedValue.ToEntero, CveCliente:=Ddlcliente.txtValue.Value.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text, PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, IDPoliza:=IDPolizaPresupuestal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), IEPS:=TxtIEPS.Text.ToDecimal, CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=LtImporteIEAnticipo.Text.ToDouble, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, Promocion:=Promocion) Then @@ -4855,7 +4884,9 @@ Partial Class OC generarAnticipo.Visible = True Ddlcliente.DataSource = GlobalDTCliente(CveEmpresaActual) Ddlcliente.DataBind() - Ddlcliente.Items.Insert(0, New ListItem(" - ", "-1")) + + 'Ddlcliente.Items.Insert(0, New ListItem(" - ", "-1")) + DdlVendedor.DataSource = GlobalDTVendedores(CveEmpresaActual) DdlVendedor.DataBind() DdlVendedor.Items.Insert(0, New ListItem(" - ", "-1")) @@ -5349,7 +5380,7 @@ Partial Class OC Protected Sub Ddlcliente_SelectedIndexChanged(sender As Object, e As EventArgs) - DdlVendedor.SelectedValueExist(GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveVendedor", $"CveCliente = {Ddlcliente.SelectedValue}")) + DdlVendedor.SelectedValueExist(GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveVendedor", $"CveCliente = {Ddlcliente.txtValue.Value}")) DdlDireccionEnvio.Visible = False TxtLugarEntregaDirecta.Visible = False @@ -5363,7 +5394,7 @@ Partial Class OC End Sub Private Sub CargaDireccionesEnvioCliente() Dim ObjClientes As New ClsClientes - If ObjClientes.DireccionEnvioGet(-1, Ddlcliente.SelectedValue.ToEntero, -1) Then + If ObjClientes.DireccionEnvioGet(-1, Ddlcliente.txtValue.Value.ToEntero, -1) Then DdlDireccionEnvio.DataSource = ObjClientes.DtResultados If ObjClientes.DtResultados.Rows.Count > 0 Then DdlDireccionEnvio.Visible = True @@ -6563,7 +6594,7 @@ Partial Class OC End Sub Protected Sub ImgCambiaClienteVendedor_Click(sender As Object, e As ImageClickEventArgs) Handles ImgCambiaClienteVendedor.Click Dim OC As New ClsOC - If OC.UpdateClienteVendedorOrdenCompra(Ddlcliente.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, CveOrdenCompra, UsuarioActual.CveUsuario, CveEmpresaActual) Then + If OC.UpdateClienteVendedorOrdenCompra(Ddlcliente.txtValue.Value.ToEntero, DdlVendedor.SelectedValue.ToEntero, CveOrdenCompra, UsuarioActual.CveUsuario, CveEmpresaActual) Then CargaHistorial() Alert("El cambio de cliente/vendedor se hizo correctamente", TipoMensaje.MsgInformacion) End If @@ -7238,7 +7269,7 @@ Partial Class OC End If Next TxtGrid.Text = If(DtDetalle.Rows.Count = 0, "", DtDetalle.Rows.Count.ToString) - Ddlcliente.SelectedValue = DdlClientes.SelectedValue + Ddlcliente.txtValue.Value = DdlClientes.SelectedValue CargaSuperior() CargaDatosDetalles() @@ -7282,7 +7313,7 @@ Partial Class OC DdlClienteSucursalEnvio.Items.Clear() - If ObjCliente.GetSucursales(Ddlcliente.SelectedValue.ToEntero) Then + If ObjCliente.GetSucursales(Ddlcliente.txtValue.Value.ToEntero) Then If ObjCliente.DtResultados.Rows.Count > 0 Then DdlClienteSucursalEnvio.DataSource = ObjCliente.DtResultados End If @@ -7312,7 +7343,7 @@ Partial Class OC Private Sub BtnAgregarDireccion_Click(sender As Object, e As EventArgs) Handles BtnAgregarDireccion.Click - If Not Ddlcliente.SelectedValue.ToEntero > 0 Then + If Not Ddlcliente.txtValue.Value.ToEntero > 0 Then Alert("Tiene que tener un cliente seleccionado", TipoMensaje.MsgAdvertencia) Exit Sub End If @@ -7321,7 +7352,7 @@ Partial Class OC Dim TieneError = False Dim Estatus = If(ChkEstatus.Checked, 1, 0) - CveDireccionEnvio = ObjClientes.DireccionEnvioAdd(Ddlcliente.SelectedValue.ToEntero, TxtEnvioDireccion.Text.Trim, TxtEnvioNoExt.Text.Trim, TxtEnvioNoInt.Text.Trim, TxtEnvioColonia.Text.Trim, TxtEnvioCiudad.Text.Trim, TxtEnvioEstado.Text.Trim, TxtEnvioCP.Text.ToEntero, TxtEnvioContacto.Text.Trim, UsuarioActual.CveUsuario, Estatus, CveClienteSucursal:=DdlClienteSucursalEnvio.SelectedValue.ToEntero, EnvioTel:=TxtEnvioTel.Text.Trim.Replace(" ", "").Replace("(", "").Replace(")", "").Replace("-", "").Replace("_", "")) + CveDireccionEnvio = ObjClientes.DireccionEnvioAdd(Ddlcliente.txtValue.Value.ToEntero, TxtEnvioDireccion.Text.Trim, TxtEnvioNoExt.Text.Trim, TxtEnvioNoInt.Text.Trim, TxtEnvioColonia.Text.Trim, TxtEnvioCiudad.Text.Trim, TxtEnvioEstado.Text.Trim, TxtEnvioCP.Text.ToEntero, TxtEnvioContacto.Text.Trim, UsuarioActual.CveUsuario, Estatus, CveClienteSucursal:=DdlClienteSucursalEnvio.SelectedValue.ToEntero, EnvioTel:=TxtEnvioTel.Text.Trim.Replace(" ", "").Replace("(", "").Replace(")", "").Replace("-", "").Replace("_", "")) If CveDireccionEnvio < 0 Then TieneError = True diff --git a/vwd.webinfo b/vwd.webinfo index 2515705b1..a280964b8 100644 --- a/vwd.webinfo +++ b/vwd.webinfo @@ -21,6 +21,10 @@ + + + + \ No newline at end of file From dce00384d416c7c931249719adf1d1a40dbb8e43 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Fri, 28 Feb 2020 18:41:21 -0700 Subject: [PATCH 17/34] nuevo reporte --- App_Code/ClsPaginas.vb | 1 + App_Code/ClsVentas.vb | 22 ++ Ventas/RepVentasMensuales.aspx | 332 ++++++++++++++++++++++++++++++ Ventas/RepVentasMensuales.aspx.vb | 88 ++++++++ 4 files changed, 443 insertions(+) create mode 100644 Ventas/RepVentasMensuales.aspx create mode 100644 Ventas/RepVentasMensuales.aspx.vb diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 82c2fb15b..38324662c 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4662,6 +4662,7 @@ Public Class ClsPaginas PaginaDict.Add("/Ventas/RepRemisionesNC.aspx".ToUpper(), 687) PaginaDict.Add("/Ventas/CatCobranzaEstatus.aspx".ToUpper(), 7003) PaginaDict.Add("/Ventas/CatCobranzaEstatusTurno.aspx".ToUpper(), 7004) + PaginaDict.Add("/Ventas/RepVentasMensuales.aspx".ToUpper(), 720) #End Region diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 04e7b8bb6..08e6787ab 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -4216,6 +4216,28 @@ Public Class ClsVentas Return retorno 'compila End Function + Public Function GetRepVentasMensuales(CveEmpresa As Integer, FechaInicio As Date, FechaFin As Date, Optional CveSubProyecto As Integer = -1, Optional CveClasificacion As Integer = -1, + Optional CveVendedor As Integer = -1, Optional CveMarca As Integer = -1, Optional Modalidad As Integer = 0) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Vta_VentasMensualesGet", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@FechaInicio", SqlDbType.DateTime).Value = FechaInicio + .Add("@FechaFin", SqlDbType.DateTime).Value = FechaFin + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion + .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor + .Add("@CveMarca", SqlDbType.Int).Value = CveMarca + .Add("@Modalidad", SqlDbType.Int).Value = Modalidad + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el reporte de ventas mensuales", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return retorno + End Function #Region "Conciliación emitidas SAT" Public Function ConciliacionemitidasSATGet(cveEmpresa As Int32) As Boolean diff --git a/Ventas/RepVentasMensuales.aspx b/Ventas/RepVentasMensuales.aspx new file mode 100644 index 000000000..ab8d6d231 --- /dev/null +++ b/Ventas/RepVentasMensuales.aspx @@ -0,0 +1,332 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepVentasMensuales.aspx.vb" Inherits="RepVentasMensuales" %> + + + + + + + + + + Ventas Mensuales + + +
  • + PDF +
  • +
  • + Excel +
  • +
    + + + +
    +
    +
    + + "> + +
    +
    +
    + + <%--
    Proveedor
    +
    + +
    --%> + +
    Fecha Inicio:
    +
    +
    + + + + +
    + + + +
    + +
    Fecha Fin:
    +
    +
    + + + + +
    + + +
    + +
    Sucursal:
    +
    + +
    +
    +
    +
    Clasificación de Productos:
    +
    + +
    + +
    Vendedor:
    +
    + +
    + +
    Marca:
    +
    + +
    + +
    +
    +
    Grupo:
    +
    + + Clientes + Sucursales + Productos Servicios + +
    +
    + +
    +
    +
    > +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + <%-- --%> + diff --git a/Ventas/RepVentasMensuales.aspx.vb b/Ventas/RepVentasMensuales.aspx.vb new file mode 100644 index 000000000..d8f37b22f --- /dev/null +++ b/Ventas/RepVentasMensuales.aspx.vb @@ -0,0 +1,88 @@ +Imports System.Data +Imports Extensiones +Imports Microsoft.Reporting.WebForms + +Partial Class RepVentasMensuales + Inherits ClsPaginas + + Private Property DtDatos As DataTable + Get + DtDatos = DirectCast(ViewState("DtDatos"), DataTable) + End Get + + Set(ByVal value As DataTable) + ViewState("DtDatos") = value + End Set + End Property + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + If Not IsPostBack Then + InicializarFiltros() + CargaDatos() + End If + End Sub + Private Sub InicializarFiltros() + Dim dNow As Date = Now + TxtFechaF.Text = dNow.ToString("dd/MM/yyyy") + dNow = dNow.AddDays(-30) + TxtFechaI.Text = dNow.ToString("dd/MM/yyyy") + + DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa) + DdlSubProyecto.DataBind() + DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1")) + + DdlClasificacionesPS.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) + DdlClasificacionesPS.DataBind() + DdlClasificacionesPS.Items.Insert(0, New ListItem("Todos", "-1")) + + DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa) + DdlVendedor.DataBind() + DdlVendedor.Items.Insert(0, New ListItem("Todos", "-1")) + + Dim ObjPS As New ClsProductosServicios + If ObjPS.GetMarcas(UsuarioActual.CveEmpresa) Then + DdlMarca.DataSource = ObjPS.DtResultados + End If + ObjPS.Dispose() + DdlMarca.DataBind() + DdlMarca.Items.Insert(0, New ListItem("Todos", "-1")) + End Sub + + Private Sub CargaDatos() + Dim ObjVentas As New ClsVentas + If ObjVentas.GetRepVentasMensuales(UsuarioActual.CveEmpresa, TxtFechaI.Text, TxtFechaF.Text, DdlSubProyecto.SelectedValue.ToEntero, DdlClasificacionesPS.SelectedValue.ToEntero, + DdlVendedor.SelectedValue.ToEntero, DdlMarca.SelectedValue.ToEntero, DdlModalidad.SelectedValue.ToEntero) Then + GV.DataSource = ObjVentas.DtResultados + DtDatos = ObjVentas.DtResultados + End If + ObjVentas.Dispose() + GV.DataBind() + End Sub + + Protected Sub btConsultar_Click(sender As Object, e As EventArgs) Handles btConsultar.Click + CargaDatos() + UPDatos.Update() + End Sub + + Public Sub LnkPDF_Click() Handles LnkPDF.Click + Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) + Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + + Dim params As New List(Of ReportParameter) + params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa)) + If Imagen.Exists Then + params.Add(New ReportParameter("pImg", logouri)) + Else + params.Add(New ReportParameter("pImg", "")) + End If + params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario)) + params.Add(New ReportParameter("FechaImpresion", Today)) + params.Add(New ReportParameter("Modalidad", DdlModalidad.SelectedValue)) + + ImprimirPDF("Empresas/Grales/Formatos/RepVentasMensuales.rdlc", DtDatos, params, "Rep. Ventas Mensuales", "PDF", RDSName:="DataSet1") + End Sub + + Public Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click + GV.ExportToExcel("Evaluaciones de Proveedores" & Now.ToShortDateString & ".xls") + End Sub +End Class From b7a737385c5027153d07154cdc82b6f93508c6d2 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 29 Feb 2020 11:54:56 -0700 Subject: [PATCH 18/34] - oc. calculo iva sobre ieps - ingreso, columna de esamortizacion --- OC/OC.aspx.vb | 8 +++++--- Ventas/RepIngresosDetalle.aspx | 10 ++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index 4b84a2229..3bb5fab27 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -3682,7 +3682,9 @@ Partial Class OC Alert("Ocurrió un error al cargar la información del producto para actualizar. Por favor vuelva a intentar.", TipoMensaje.MsgAdvertencia) Exit Sub End If - Dim IvaPS = DrPS("IVA").ToString.ToDouble + Dim IvaPS = DrPS("IVA").ToString.ToDecimal + IEPSPS = DrPS("IEPSPorcentaje").ToString.ToDouble + IEPSPSIVA = If(DrPS("IEPSGrabaIVA").ToString = "True", DrPS("IEPSPorcentaje").ToString.ToDecimal, 0) If CvePS <> CvePSAnterior Or Not CveOrdenCompra > 0 Then RetISR = DrPS("RetISR").ToString.ToDouble @@ -3690,8 +3692,8 @@ Partial Class OC 'If IvaPS = -1 Then 'IVA DE LA SUCURSAL ' IvaPS = GlobalDTSubProyectos(-1, gvr.FCDropDownList("DdlSubProyectoEdit").SelectedValue.ToEntero).FiltroPrimeroValor("IVA").ToDouble 'End If - IEPSPS = DrPS("IEPSPorcentaje").ToString.ToDouble - IEPSPSIVA = If(DrPS("IEPSGrabaIVA").ToString = "True", DrPS("IEPSPorcentaje").ToString.ToDouble, 0) + + ' IEPSPSIVA = If(DrPS("IEPSGrabaIVA").ToString = "True", DrPS("IEPSPorcentaje").ToString.ToDouble, 0) End If diff --git a/Ventas/RepIngresosDetalle.aspx b/Ventas/RepIngresosDetalle.aspx index a6de016f0..580fe6631 100644 --- a/Ventas/RepIngresosDetalle.aspx +++ b/Ventas/RepIngresosDetalle.aspx @@ -144,6 +144,11 @@ + + + + + @@ -183,6 +188,11 @@ + + + + + From 73d110410e4ce0947a6d4dd7f1e0e57a1149cb43 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Sat, 29 Feb 2020 13:51:35 -0700 Subject: [PATCH 19/34] Agregando reporte de detalle de ventas mensuales --- App_Code/ClsPaginas.vb | 1 + App_Code/ClsVentas.vb | 21 ++++ Ventas/RepVentasMensuales.aspx | 130 +++------------------ Ventas/RepVentasMensuales.aspx.vb | 32 +++++ Ventas/RepVentasMensualesDetalle.aspx | 142 +++++++++++++++++++++++ Ventas/RepVentasMensualesDetalle.aspx.vb | 74 ++++++++++++ 6 files changed, 284 insertions(+), 116 deletions(-) create mode 100644 Ventas/RepVentasMensualesDetalle.aspx create mode 100644 Ventas/RepVentasMensualesDetalle.aspx.vb diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 68b4135f7..24f10f87e 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4664,6 +4664,7 @@ Public Class ClsPaginas PaginaDict.Add("/Ventas/CatCobranzaEstatus.aspx".ToUpper(), 7003) PaginaDict.Add("/Ventas/CatCobranzaEstatusTurno.aspx".ToUpper(), 7004) PaginaDict.Add("/Ventas/RepVentasMensuales.aspx".ToUpper(), 720) + PaginaDict.Add("/Ventas/RepVentasMensualesDetalle.aspx".ToUpper(), 721) #End Region diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 08e6787ab..11ddf58d4 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -4238,6 +4238,27 @@ Public Class ClsVentas End Try Return retorno End Function + Public Function GetRepVentasMensualesDetalle(CveEmpresa As Integer, CveCliente As Integer, FechaInicio As Date, FechaFin As Date, Optional CveSubProyecto As Integer = -1, + Optional CveVendedor As Integer = -1, Optional CveMarca As Integer = -1) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Vta_VentasMensualesDetalleGet", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@FechaInicio", SqlDbType.DateTime).Value = FechaInicio + .Add("@FechaFin", SqlDbType.DateTime).Value = FechaFin + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveMarca", SqlDbType.Int).Value = CveMarca + .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el reporte de ventas mensuales", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return retorno + End Function #Region "Conciliación emitidas SAT" Public Function ConciliacionemitidasSATGet(cveEmpresa As Int32) As Boolean diff --git a/Ventas/RepVentasMensuales.aspx b/Ventas/RepVentasMensuales.aspx index ab8d6d231..248ffec8c 100644 --- a/Ventas/RepVentasMensuales.aspx +++ b/Ventas/RepVentasMensuales.aspx @@ -150,72 +150,72 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -227,106 +227,4 @@ - <%-- --%> diff --git a/Ventas/RepVentasMensuales.aspx.vb b/Ventas/RepVentasMensuales.aspx.vb index d8f37b22f..70ad49927 100644 --- a/Ventas/RepVentasMensuales.aspx.vb +++ b/Ventas/RepVentasMensuales.aspx.vb @@ -85,4 +85,36 @@ Partial Class RepVentasMensuales Public Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click GV.ExportToExcel("Evaluaciones de Proveedores" & Now.ToShortDateString & ".xls") End Sub + + Protected Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GV.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then + Dim CveCliente As Integer = -1 + Dim CveSubProyecto As Integer = -1 + If DdlModalidad.SelectedValue = "0" Then + CveCliente = e.Row.DataKey("Clave").ToEntero + CveSubProyecto = DdlSubProyecto.SelectedValue.ToEntero + Else + CveSubProyecto = e.Row.DataKey("Clave") + End If + Dim FechaInicio As Date = TxtFechaI.Text + Dim FechaFin As Date = TxtFechaF.Text + Dim CveMarca As Integer = DdlMarca.SelectedValue.ToEntero + Dim CveVendedor As Integer = DdlVendedor.SelectedValue.ToEntero + Dim URL As String = String.Format("/Ventas/RepVentasMensualesDetalle.aspx?CveCliente={0}&CveSubProyecto={1}&FechaInicio={2}&FechaFin={3}&CveMarca={4}&CveVendedor={5}", + CveCliente, CveSubProyecto, FechaInicio, FechaFin, CveMarca, CveVendedor) + e.Row.FCHyperLink("HlkNombre").NavigateUrl = URL + e.Row.FCHyperLink("LblEne").NavigateUrl = URL + e.Row.FCHyperLink("LblFeb").NavigateUrl = URL + e.Row.FCHyperLink("LblMzo").NavigateUrl = URL + e.Row.FCHyperLink("LblAbr").NavigateUrl = URL + e.Row.FCHyperLink("LblMay").NavigateUrl = URL + e.Row.FCHyperLink("LblJun").NavigateUrl = URL + e.Row.FCHyperLink("LblJul").NavigateUrl = URL + e.Row.FCHyperLink("LblAgo").NavigateUrl = URL + e.Row.FCHyperLink("LblSep").NavigateUrl = URL + e.Row.FCHyperLink("LblOct").NavigateUrl = URL + e.Row.FCHyperLink("LblNov").NavigateUrl = URL + e.Row.FCHyperLink("LblDic").NavigateUrl = URL + End If + End Sub End Class diff --git a/Ventas/RepVentasMensualesDetalle.aspx b/Ventas/RepVentasMensualesDetalle.aspx new file mode 100644 index 000000000..2aaaad5be --- /dev/null +++ b/Ventas/RepVentasMensualesDetalle.aspx @@ -0,0 +1,142 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepVentasMensualesDetalle.aspx.vb" Inherits="RepVentasMensualesDetalle" %> + + + + + + + + + + Rep. Detalle de la Venta Mensual + + +
  • + PDF +
  • +
  • + Excel +
  • +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + diff --git a/Ventas/RepVentasMensualesDetalle.aspx.vb b/Ventas/RepVentasMensualesDetalle.aspx.vb new file mode 100644 index 000000000..e707f66b6 --- /dev/null +++ b/Ventas/RepVentasMensualesDetalle.aspx.vb @@ -0,0 +1,74 @@ +Imports System.Data +Imports Extensiones +Imports Microsoft.Reporting.WebForms + +Partial Class RepVentasMensualesDetalle + Inherits ClsPaginas + + Private Property DtDatos As DataTable + Get + DtDatos = DirectCast(ViewState("DtDatos"), DataTable) + End Get + + Set(ByVal value As DataTable) + ViewState("DtDatos") = value + End Set + End Property + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + If Not IsPostBack Then + CargaDatos() + End If + End Sub + + Private Sub CargaDatos() + 'URL DE PRUEBA + '/Ventas/RepVentasMensualesDetalle.aspx?CveCliente=270821&CveSubProyecto=-1&FechaInicio=2020-02-15&FechaFin=2020-02-20&CveMarca=-1&CveVendedor=-1 + Dim FechaInicio As Date = Request.QueryString("FechaInicio") + Dim FechaFin As Date = Request.QueryString("FechaFin") + Dim CveCliente As Integer = Request.QueryString("CveCliente") + Dim CveSubProyecto As Integer = Request.QueryString("CveSubProyecto") + Dim CveMarca As Integer = Request.QueryString("CveMarca") + Dim CveVendedor As Integer = Request.QueryString("CveVendedor") + + Dim ObjVentas As New ClsVentas + If ObjVentas.GetRepVentasMensualesDetalle(UsuarioActual.CveEmpresa, CveCliente, FechaInicio, FechaFin, CveSubProyecto, CveVendedor, CveMarca) Then + GV.DataSource = ObjVentas.DtResultados + DtDatos = ObjVentas.DtResultados + End If + ObjVentas.Dispose() + GV.DataBind() + End Sub + + Public Sub LnkPDF_Click() Handles LnkPDF.Click + Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) + Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + + Dim params As New List(Of ReportParameter) + params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa)) + If Imagen.Exists Then + params.Add(New ReportParameter("pImg", logouri)) + Else + params.Add(New ReportParameter("pImg", "")) + End If + params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario)) + params.Add(New ReportParameter("FechaImpresion", Today)) + params.Add(New ReportParameter("Modalidad", 2)) + + ImprimirPDF("Empresas/Grales/Formatos/RepVentasMensualesDetalle.rdlc", DtDatos, params, "Rep. Ventas Mensuales", "PDF", RDSName:="DataSet1") + End Sub + + Public Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click + GV.ExportToExcel("Evaluaciones de Proveedores" & Now.ToShortDateString & ".xls") + End Sub + + Public Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GV.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then + If e.Row.DataKey("Etiqueta") = "Padre" Then + e.Row.CssClass = "Totales" + ElseIf e.Row.DataKey("Etiqueta") = "SubPadre" Then + e.Row.CssClass = "SubTotales" + End If + End If + End Sub +End Class From c99e549f44a8a6ab5fd2ff5e21249185f35691f9 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Sun, 1 Mar 2020 16:38:01 -0700 Subject: [PATCH 20/34] campo de mail del cliente para la 141 --- Compras/PopUpVerFactura.aspx.vb | 1 + Empresas/141/Formatos/Factura.rdlc | 40 +++++++++++++++++++++++++++--- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 38f493d93..5338a9c4d 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -887,6 +887,7 @@ Partial Class PopUpVerFactura Vta.Cliente.NoInt = dtVentas(0)("ClienteNoInt").ToString Vta.Cliente.Codigo = dtVentas(0)("ClienteCodigo").ToString Vta.Cliente.Mail = dtVentas(0)("Mail").ToString + Vta.Cliente.MailCotizacion = dtVentas(0)("SucClienteCorreo").ToString Vta.RefDocto = dtVentas(0)("Ref").ToString Vta.CveVenta = dtVentas(0)("CveVenta").ToString.ToEntero Vta.NumeroCuenta = dtVentas(0)("NumCtaPago").ToString diff --git a/Empresas/141/Formatos/Factura.rdlc b/Empresas/141/Formatos/Factura.rdlc index 894b6a23f..ee1a0f96c 100644 --- a/Empresas/141/Formatos/Factura.rdlc +++ b/Empresas/141/Formatos/Factura.rdlc @@ -2039,11 +2039,45 @@ - + =iif(Parameters!ClienteContactoMail.Value = "","","Teléfono: ") + + + + + + + =Parameters!ClienteTelefono.Value + + + + + + + + =iif(Parameters!ClienteContactoMail.Value = "","","Correo: ") + + + + =Parameters!ClienteContactoMail.Value + From 633358b95f4c011f13dcc119ac605eaf05b16b5b Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Mon, 2 Mar 2020 10:00:17 -0700 Subject: [PATCH 21/34] =?UTF-8?q?cambiando=20mensaje=20de=20alerta=20sobre?= =?UTF-8?q?=20una=20validadci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bancos/CuentasBancariasDetalle.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bancos/CuentasBancariasDetalle.aspx.vb b/Bancos/CuentasBancariasDetalle.aspx.vb index e4404f849..f4395d31a 100644 --- a/Bancos/CuentasBancariasDetalle.aspx.vb +++ b/Bancos/CuentasBancariasDetalle.aspx.vb @@ -326,7 +326,7 @@ Partial Class Bancos_CuentasBancariasDetalle End If Else If DTUsuarios.FiltraParametros(String.Format("CveUsuario = {0}", DdlUsuarios.SelectedValue.ToString)).Rows.Count > 0 Then - Alert("El usuario ya se encuntra con Acceso a la cuenta", TipoMensaje.MsgAdvertencia) + Alert("El usuario ya esta registrado en este numero de cuenta", TipoMensaje.MsgAdvertencia) Else Row = DTUsuarios.NewRow Row("CveCuenta") = DTUsuarios.Rows.Count + 1 From 16cda56be6f77f4ea91b76fd8c0bca7c69df6d83 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 2 Mar 2020 12:15:24 -0700 Subject: [PATCH 22/34] -columna de getcliente --- Ashx/SIGWeb.ashx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx index ec5a98394..9af99331f 100644 --- a/Ashx/SIGWeb.ashx +++ b/Ashx/SIGWeb.ashx @@ -177,6 +177,11 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState Private Function GetClientes(ByVal context As HttpContext) As String Dim retorno As String = "" Dim DtRetorno As DataTable = Nothing + Dim ColumnaNombre As String = "NombreComercial" + 'Abreviaturas. N. Nombre, NC. NombreComercial,... + If IfNull(context.Request("ColTexto"), "") = "N" Then + ColumnaNombre = "Nombre" + End If Dim usuario As Usuario = UsuarioActual(context) Dim CveEmpresa As String @@ -209,7 +214,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then DtRetorno.Columns("CveCliente").ColumnName = "id" - DtRetorno.Columns("NombreComercial").ColumnName = "text" + DtRetorno.Columns(ColumnaNombre).ColumnName = "text" retorno = JsonConvert.SerializeObject(DtRetorno).ToString context.Response.Write(retorno) Else From ace76cfd6e0372e134e6533390c175042fcc3598 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 2 Mar 2020 12:27:36 -0700 Subject: [PATCH 23/34] - --- OC/OC.aspx | 2 +- OC/OC.aspx.vb | 4 ++-- Ventas/RepIngresosDetalle.aspx | 7 ++++++- Ventas/Ventas.aspx.vb | 4 ++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/OC/OC.aspx b/OC/OC.aspx index e7fe70a15..50959795d 100644 --- a/OC/OC.aspx +++ b/OC/OC.aspx @@ -590,7 +590,7 @@ Cliente:
    - + <%-- --%>
    diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index 3bb5fab27..4bd97ce3b 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -5380,9 +5380,9 @@ Partial Class OC End If End Sub - Protected Sub Ddlcliente_SelectedIndexChanged(sender As Object, e As EventArgs) + Protected Sub Ddlcliente_SelectedIndexChanged(sender As Object, e As EventArgs) Handles Ddlcliente.selectedindexchange - DdlVendedor.SelectedValueExist(GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveVendedor", $"CveCliente = {Ddlcliente.txtValue.Value}")) + DdlVendedor.SelectedValueExist(GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveVendedor", $"CveCliente = {Ddlcliente.SelectedValue}")) DdlDireccionEnvio.Visible = False TxtLugarEntregaDirecta.Visible = False diff --git a/Ventas/RepIngresosDetalle.aspx b/Ventas/RepIngresosDetalle.aspx index 580fe6631..acc505d4d 100644 --- a/Ventas/RepIngresosDetalle.aspx +++ b/Ventas/RepIngresosDetalle.aspx @@ -188,11 +188,16 @@ - + + + + + + diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 1590f33d5..9ecd8ab82 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -6683,7 +6683,7 @@ Partial Class Ventas 'If (UsuarioActual.CveEmpresa.Contiene(1, 4, 5, 7, 11, 12, 72, 80, 81, 83) And UsuarioActual.CveUsuario = 100) Or UsuarioActual.CveEmpresa.Contiene(80, 83) Or UsuarioActual.CveUsuario = 100 Then If (Archivo.Exists Or Archivo2.Exists) And IfNull(CveVenta, 0).ToString.ToEntero > 0 Then HplDownPDF.Visible = True - HplDownPDF.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", CveVenta))) + HplDownPDF.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta))) End If UpnTools.Update() @@ -9763,7 +9763,7 @@ Partial Class Ventas Case 3 'Cliente If ObjFactura.TipoDocto = "Ant" Then - ConceptoContable = If(UsuarioActual.CveEmpresa.Contiene(1, 119), 95, ConceptoContable) + ConceptoContable = If(UsuarioActual.CveEmpresa.Contiene(119), 95, ConceptoContable) importeMovimiento = ObjFactura.SubTotal * ValorMultiplicador importeMX = importeMovimiento * tipoCambio * Multiplicador FechaMovimiento = ObjFactura.FechaPago From 89f91642942c4ff85ba5532afda8dd55001a98f5 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Mon, 2 Mar 2020 12:28:44 -0700 Subject: [PATCH 24/34] Asignacion de valores a objeto de subproyecto --- App_Code/ClsPaginas.vb | 3 ++- App_Code/EntityModel.vb | 6 +++++- App_Code/Modelos.vb | 15 ++------------- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 24f10f87e..91ecec956 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -5926,7 +5926,8 @@ Public Class ClsPaginas If Vta.SubProyecto.Colonia.Length > 0 Then SBDomicilioSucursal.AppendFormat(", Col: {0}", Vta.SubProyecto.Colonia) If Vta.SubProyecto.CP.ToEntero > 0 Then SBDomicilioSucursal.AppendFormat(", CP: {0}", Vta.SubProyecto.CP) If CiudadSucursal.Length > 0 Then SBDomicilioSucursal.AppendFormat(", {0}", CiudadSucursal) - If Vta.SubProyecto.Pais.Length > 0 Then SBDomicilioSucursal.AppendFormat(", {0}", Vta.SubProyecto.Pais) + If Vta.SubProyecto.Pais.Length > 0 Then SBDomicilioSucursal.AppendFormat(", {0}", Vta.SubProyecto.Pais) + If Not String.IsNullOrEmpty(Vta.SubProyecto.Telefono) AndAlso UsuarioActual.CveEmpresa = 141 Then SBDomicilioSucursal.AppendFormat(", Tel: {0}", Vta.SubProyecto.Telefono) DomicilioSucursal = SBDomicilioSucursal.ToString diff --git a/App_Code/EntityModel.vb b/App_Code/EntityModel.vb index 1476e9da8..193688795 100644 --- a/App_Code/EntityModel.vb +++ b/App_Code/EntityModel.vb @@ -49,7 +49,11 @@ Namespace Modelos Case "Single" prop.SetValue(Me, CSng(row(prop.Name))) Case "String" - prop.SetValue(Me, CStr(row(prop.Name))) + If String.IsNullOrEmpty(row(prop.Name)) Then + prop.SetValue(Me, "") + Else + prop.SetValue(Me, CStr(row(prop.Name))) + End If Case "UInt32" prop.SetValue(Me, CUInt(row(prop.Name))) Case "UInt64" diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 08036f1b9..c23e6aa8a 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -8729,6 +8729,7 @@ Namespace Modelos FormatoFactura = "" SubProyecto = "" Correo = "" + Telefono = "" UTCOffsetVerano = -7 UTCOffsetInvierno = -7 End Sub @@ -8738,20 +8739,8 @@ Namespace Modelos Public Sub New(Row As System.Data.DataRow) SetDefaultValues() If Row IsNot Nothing Then - Calle = Row("Calle").ToString - NoExt = Row("NoExt").ToString - NoInt = Row("NoInt").ToString - Colonia = Row("Colonia").ToString - Localidad = Row("Localidad").ToString - Municipio = Row("Municipio").ToString - Estado = Row("Estado").ToString - Pais = Row("Pais").ToString - CP = Row("CP").ToString - SubProyecto = Row("SubProyecto").ToString - UTCOffsetVerano = Row("UTCOffsetVerano").ToString.ToEntero() - UTCOffsetInvierno = Row("UTCOffsetInvierno").ToString.ToEntero() + Me.setValues(Row) End If - End Sub Public ReadOnly Property LugarExp As String From bf649b3e57840baa581c679f7b2fd416e7f87913 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Mon, 2 Mar 2020 13:33:53 -0700 Subject: [PATCH 25/34] Nombre comerciales desde dropdownlost --- OC/OC.aspx.vb | 2 ++ Scripts/custom.js | 1 + 2 files changed, 3 insertions(+) diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index 4bd97ce3b..0c66a6a86 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -744,6 +744,8 @@ Partial Class OC BtnSolicitudAnticipo.Visible = False End If + Ddlcliente.ddlWS.Attributes.Add("data-coltexto", "N") + 'Nuevo Proceso que permite modificar detalles If Not UsuarioActual.TienePermisoProceso(131) Then If GlobalDTOCEstatus(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveEstatus = {0}", CveEstatus)).Rows.Count > 0 Then diff --git a/Scripts/custom.js b/Scripts/custom.js index 39e2ae95b..42864abad 100644 --- a/Scripts/custom.js +++ b/Scripts/custom.js @@ -1084,6 +1084,7 @@ function setwebservice(idDdlWS, idhdValue, idhdText, btn) { CveSubProyecto: (!(DdlWS.data('cvesubproyecto')) || DdlWS.data('cvesubproyecto') == '') ? ((!(DdlWS.parent().data('cvesubproyecto')) || DdlWS.parent().data('cvesubproyecto') == '') ? -1 : DdlWS.parent().data('cvesubproyecto')) : DdlWS.data('cvesubproyecto'), metodo: (!(DdlWS.data('metodo')) || DdlWS.data('metodo') == 'getps') ? ((!(DdlWS.parent().data('metodo')) || DdlWS.parent().data('metodo') == 'getps') ? 'getps' : DdlWS.parent().data('metodo')) : DdlWS.data('metodo'), Pagina: (!(DdlWS.data('pagina')) || DdlWS.data('pagina') == '') ? '-2' : DdlWS.data('pagina'), + ColTexto: (!(DdlWS.data('coltexto')) || DdlWS.data('coltexto') == '') ? 'NC' : DdlWS.data('coltexto') //Metodo: metodo }; }, From a271feba19447a85365642941613dcb2c46b3226 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Mon, 2 Mar 2020 15:33:53 -0700 Subject: [PATCH 26/34] modificaciones --- Empresas/141/Formatos/Factura.rdlc | 60 ++----------------- .../Formatos/RepClientesPagosBancos.rdlc | 5 +- 2 files changed, 6 insertions(+), 59 deletions(-) diff --git a/Empresas/141/Formatos/Factura.rdlc b/Empresas/141/Formatos/Factura.rdlc index ee1a0f96c..fe9d24568 100644 --- a/Empresas/141/Formatos/Factura.rdlc +++ b/Empresas/141/Formatos/Factura.rdlc @@ -1498,62 +1498,10 @@ - VERACRUZ Y CUERNAVACA 148 SAN + =Parameters!DomicilioSucursal.Value - - - - - - - - - - - - @@ -1566,7 +1514,7 @@ @@ -2889,7 +2837,7 @@ - IVA (16%): + IVA: @@ -373,7 +373,7 @@ = IIF( IsNothing(Fields!CveVenta.Value), Fields!FechaDocumento.Value,Fields!FechaVencimiento.Value) @@ -498,7 +498,6 @@ 2pt - true From 5e36beeffc8870fd9a26c866115bd7168fdf6cbb Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Mon, 2 Mar 2020 15:34:20 -0700 Subject: [PATCH 27/34] agregando el nuevo modulo --- App_Code/ClsPaginas.vb | 1 + App_Code/ClsVentas.vb | 18 ++++++ Ventas/MetasVendedores.aspx | 115 +++++++++++++++++++++++++++++++++ Ventas/MetasVendedores.aspx.vb | 56 ++++++++++++++++ 4 files changed, 190 insertions(+) create mode 100644 Ventas/MetasVendedores.aspx create mode 100644 Ventas/MetasVendedores.aspx.vb diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 24f10f87e..78ac82410 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4665,6 +4665,7 @@ Public Class ClsPaginas PaginaDict.Add("/Ventas/CatCobranzaEstatusTurno.aspx".ToUpper(), 7004) PaginaDict.Add("/Ventas/RepVentasMensuales.aspx".ToUpper(), 720) PaginaDict.Add("/Ventas/RepVentasMensualesDetalle.aspx".ToUpper(), 721) + PaginaDict.Add("/Ventas/MetasVendedores.aspx".ToUpper(), 722) #End Region diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 11ddf58d4..cfddc9043 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -4259,6 +4259,24 @@ Public Class ClsVentas End Try Return retorno End Function + Public Function AddMetasVendedores(CveVendedor As Integer, MesAño As Date, CveMarca As Integer, MetaCantidad As Integer, MetaImporte As Decimal) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Vta_MetasVendedoresAdd", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor + .Add("@MesAño", SqlDbType.DateTime).Value = MesAño + .Add("@CveMarca", SqlDbType.Int).Value = CveMarca + .Add("@MetaCantidad", SqlDbType.Int).Value = MetaCantidad + .Add("@MetaImporte", SqlDbType.Decimal).Value = MetaImporte + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el reporte de ventas mensuales", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return retorno + End Function #Region "Conciliación emitidas SAT" Public Function ConciliacionemitidasSATGet(cveEmpresa As Int32) As Boolean diff --git a/Ventas/MetasVendedores.aspx b/Ventas/MetasVendedores.aspx new file mode 100644 index 000000000..6fe34dd38 --- /dev/null +++ b/Ventas/MetasVendedores.aspx @@ -0,0 +1,115 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="MetasVendedores.aspx.vb" Inherits="MetasVendedores" %> + + + + + + + + + + Metas de Vendedores + + +
  • + Agregar Meta +
  • +
  • + PDF +
  • +
  • + Excel +
  • +
    + + + + + + + diff --git a/Ventas/MetasVendedores.aspx.vb b/Ventas/MetasVendedores.aspx.vb new file mode 100644 index 000000000..9a5ca2ede --- /dev/null +++ b/Ventas/MetasVendedores.aspx.vb @@ -0,0 +1,56 @@ +Imports System.Data +Imports Extensiones +Imports Microsoft.Reporting.WebForms + +Partial Class MetasVendedores + Inherits ClsPaginas + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + If Not IsPostBack Then + CargaDatosModal() + End If + End Sub + + Private Sub CargaDatosModal() + DdlVendedores.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa) + DdlVendedores.DataBind() + DdlVendedores.Items.Insert(0, New ListItem("Seleccionar", "-1")) + + Dim ObjPS As New ClsProductosServicios + If ObjPS.GetMarcas(UsuarioActual.CveEmpresa) Then + DdlMarcas.DataSource = ObjPS.DtResultados + End If + ObjPS.Dispose() + DdlMarcas.DataBind() + DdlMarcas.Items.Insert(0, New ListItem("Todos", "-1")) + End Sub + + Private Sub ResetDatosSeleccionadosModal() + DdlVendedores.SelectedValue = "-1" + TxtFechaI.Text = "" + DdlMarcas.SelectedValue = "-1" + TxtMetaCantidad.Text = "" + TxtMetaImporte.Text = "" + UpModalTiposD.Update() + End Sub + + Protected Sub LnkAgregar_Click() Handles LnkAgregar.Click + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD")) + End Sub + + Protected Sub BtnAgregarMetaVendedor_Click(sender As Object, e As EventArgs) Handles BtnAgregarMetaVendedor.Click + + If DdlVendedores.SelectedValue.ToEntero > 0 AndAlso TxtFechaI.Text <> "" AndAlso DdlMarcas.SelectedValue.ToEntero > 0 Then + Dim ObjVentas As New ClsVentas + If ObjVentas.AddMetasVendedores(DdlVendedores.SelectedValue.ToEntero, TxtFechaI.Text, DdlMarcas.SelectedValue.ToEntero, TxtMetaCantidad.Text.ToEntero, TxtMetaImporte.Text.ToDecimal) Then + Alert("Se agregó la meta al vendedor") + Else + Alert("No se pudo agregar la meta al vendedor", TipoMensaje.MsgError) + End If + Else + Alert(String.Format("Falta Seleccionar {0}{1}{2}", If(DdlVendedores.SelectedValue.ToEntero > 0, "", "Vendedor, "), If(DdlMarcas.SelectedValue.ToEntero > 0, "", "Marca, "), If(TxtFechaI.Text <> "", "", "Fecha, "))) + End If + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")) + ResetDatosSeleccionadosModal() + End Sub +End Class From e37f192ffa7d5f088e68ec156ef6bcfea20e646c Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 3 Mar 2020 10:34:35 -0700 Subject: [PATCH 28/34] Cantidad debe ser mayor que 0 --- Ventas/Ventas.aspx.vb | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 9ecd8ab82..3c79eea5e 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -5835,6 +5835,11 @@ Partial Class Ventas Descuento = (GvPS.Rows(e.RowIndex).FCTextBox("TxtDescuento").Text.ToDecimal).RoundSQL(NumeroDecimales) CuentaPredial = GvPS.Rows(e.RowIndex).FCTextBox("TxtPredial").Text.Trim + If PU <= 0 AndAlso UsuarioActual.CveEmpresa = 141 Then + Alert("El precio debe ser mayor a 0", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + If UsuarioActual.CveEmpresa = 140 Then Descuento = CalcularDescuentos(TmpDT.Rows(e.RowIndex)("CvePS").ToString.ToEntero, Cantidad, PU) End If @@ -8803,8 +8808,8 @@ Partial Class Ventas 'siempre estaremos agregando el iva, auqnue sea en importe cero o tasa cero, para que se emita la factura ' If drr("ImporteIVA").ToString.ToDouble > 0 Then - 'si es ingreso amortizado por la totalidad, y arroja el valor total de cero, no debe de impuestos - If Timbre.Comprobante.Total > 0 Then + 'si es ingreso amortizado por la totalidad, y arroja el valor total de cero, no debe de impuestos, y si la BASE de calculo es mayor a cero + If Timbre.Comprobante.Total > 0 AndAlso concepto.Importe - concepto.Descuento + concepto.ImporteGravaIVAAdicional > 0 Then concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento + concepto.ImporteGravaIVAAdicional, .TasaOCuota = drr("PorcentajeIVA").ToString.ToDecimal, .Impuesto = "002", .Importe = drr("ImporteIVA").ToString.ToDecimal}) End If @@ -13920,6 +13925,11 @@ Partial Class Ventas Return False End If + If PU <= 0 AndAlso UsuarioActual.CveEmpresa = 141 Then + Alert("El precio debe ser mayor a 0", TipoMensaje.MsgAdvertencia) + Return False + End If + 'VALIDA PROMOCIONES Dim ObjVentas As New ClsVentas If ObjVentas.GetPromocionesPS(-1, TxtFecha.Text.ToDateTime, DdlSubProyectoDatos.SelectedValue.ToEntero, CveCliente, DdlVendedor.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then From e2c17160ce5367784107dd2bac38b6deeeca54a7 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 3 Mar 2020 10:34:52 -0700 Subject: [PATCH 29/34] Quitar timer de notificaciones de campana --- SiteGPS.master | 31 ++++++++++++++++--------------- vwd.webinfo | 2 ++ 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/SiteGPS.master b/SiteGPS.master index f1aa06e3e..657d03977 100644 --- a/SiteGPS.master +++ b/SiteGPS.master @@ -847,22 +847,23 @@ CveBitacora: -1 } } - var json = JSON.stringify(request); - $.ajax({ - data: json, - url: '/Ashx/SIGGPS.ashx', - type: 'post', - beforeSend: function () { - console.log("procesando....."); - }, - success: function (response) { - console.log("notificacion actualizada...."); - var datos = JSON.parse(response); - UpdateNotificacionesCampana(datos); - } - }); - setTimeout(startTimer, 60000); // callback + //var json = JSON.stringify(request); + //$.ajax({ + // data: json, + // url: '/Ashx/SIGGPS.ashx', + // type: 'post', + // beforeSend: function () { + // console.log("procesando....."); + // }, + // success: function (response) { + // console.log("notificacion actualizada...."); + // var datos = JSON.parse(response); + // UpdateNotificacionesCampana(datos); + // } + //}); + + //setTimeout(startTimer, 60000); // callback } // diff --git a/vwd.webinfo b/vwd.webinfo index a280964b8..2f273a97f 100644 --- a/vwd.webinfo +++ b/vwd.webinfo @@ -23,6 +23,8 @@ + + From d9966fba4f5f712faaa1cc8649c7817d14f024e0 Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Tue, 3 Mar 2020 17:48:23 -0700 Subject: [PATCH 30/34] --- Compras/Compras.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 134e806e2..055ef4dc0 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -6235,7 +6235,7 @@ Partial Class Compras_Compras End If Case 6 'Compra - Dim AgregaMercanciaInventario As Boolean = UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119, 140) AndAlso UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1" + Dim AgregaMercanciaInventario As Boolean = UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119, 140, 141) AndAlso UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Dim RegistraConcepto225 As Boolean = UsuarioActual.Empresa.UsaInventarios AndAlso DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1" If RBLPago.SelectedValue.ToEntero = 4 Then From ea3ae05358acb75cb64ab8e08398fcc720fbbf34 Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Wed, 4 Mar 2020 08:25:48 -0700 Subject: [PATCH 31/34] Documentos Proveedor(No es auditoria, son los documentos de la pagia de cliente, detro de los tipos de documento le corresponde el modulo 4) --- Compras/Proveedores.aspx | 73 ++++- Compras/Proveedores.aspx.vb | 429 ++++++++++++++++++++++++++++-- General/CatDocumentacionTipo.aspx | 2 +- vwd.webinfo | 6 + 4 files changed, 474 insertions(+), 36 deletions(-) diff --git a/Compras/Proveedores.aspx b/Compras/Proveedores.aspx index ae72b0047..234b68236 100644 --- a/Compras/Proveedores.aspx +++ b/Compras/Proveedores.aspx @@ -2286,7 +2286,12 @@ - + + + + + @@ -2300,7 +2305,7 @@ - + @@ -2308,7 +2313,7 @@ - + @@ -2322,7 +2327,7 @@ - @@ -2331,15 +2336,22 @@ - + - + + + + + + + @@ -3997,6 +4009,55 @@
    + + + + +
    diff --git a/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb index b32464910..b419978cb 100644 --- a/Compras/Proveedores.aspx.vb +++ b/Compras/Proveedores.aspx.vb @@ -323,6 +323,159 @@ Partial Class Compras_Proveedores End Property #End Region + +#Region " D O C U M E N T A C I O N" + + + + Property CveDocumentacionElectronica As Integer + Get + If ViewState("CvePersonalClienteDocumentacion") Is Nothing Then + Return -1 + Else + Return DirectCast(ViewState("CvePersonalClienteDocumentacion"), Integer) + End If + End Get + Set(value As Integer) + ViewState("CvePersonalClienteDocumentacion") = value + End Set + End Property + + Property CveDocumentacion As Integer + Get + If ViewState("CveDocumentacion") Is Nothing Then + Return -1 + Else + Return DirectCast(ViewState("CveDocumentacion"), Integer) + End If + End Get + Set(value As Integer) + ViewState("CveDocumentacion") = value + End Set + End Property + + Property Documentacion As String + Get + If ViewState("Documentacion") Is Nothing Then + Return "-1" + Else + Return ViewState("Documentacion").ToString + End If + End Get + Set(value As String) + ViewState("Documentacion") = value + End Set + End Property + + Property AdjuntoDocumentacion As String + Get + If ViewState("AdjuntoDocumentacion") Is Nothing Then + Return "" + Else + Return ViewState("AdjuntoDocumentacion").ToString + End If + End Get + Set(value As String) + ViewState("AdjuntoDocumentacion") = value + End Set + End Property + + + + Property DiasVigencia As Integer + Get + If ViewState("DiasVigencia") Is Nothing Then + Return 0 + Else + Return DirectCast(ViewState("DiasVigencia"), Integer) + End If + End Get + Set(value As Integer) + ViewState("DiasVigencia") = value + End Set + End Property + + Property AplicaFechaVencimiento As Boolean + Get + If ViewState("AplicaFechaVencimiento") Is Nothing Then + Return True + Else + Return DirectCast(ViewState("AplicaFechaVencimiento"), Boolean) + End If + End Get + Set(value As Boolean) + ViewState("AplicaFechaVencimiento") = value + End Set + End Property + + Private Property FechaVigencia As Date + Get + If ViewState("FechaVigencia") Is Nothing Then + Return Nothing + Else + Return ViewState("FechaVigencia").ToString.ToDate + End If + End Get + Set(value As Date) + ViewState("FechaVigencia") = value + End Set + End Property + + Property Estatus As Integer + Get + If ViewState("Estatus") Is Nothing Then + Return 0 + Else + Return DirectCast(ViewState("Estatus"), Integer) + End If + End Get + Set(value As Integer) + ViewState("Estatus") = value + End Set + End Property + + Property ObservacionDocumentacion As String + Get + If ViewState("ObservacionDocumentacion") Is Nothing Then + Return "" + Else + Return ViewState("ObservacionDocumentacion").ToString + End If + End Get + Set(value As String) + ViewState("ObservacionDocumentacion") = value + End Set + End Property + + Private Property FechaLimite As Date + Get + If ViewState("FechaLimite") Is Nothing Then + Return Date.Now.AddDays(15) + Else + Return ViewState("FechaLimite").ToString.ToDate + End If + End Get + Set(value As Date) + ViewState("FechaLimite") = value + End Set + End Property + + Property DTDocumentacion As DataTable + Get + If ViewState("DTDocumentacion") Is Nothing Then + Return New DataTable + Else + Return DirectCast(ViewState("DTDocumentacion"), DataTable) + End If + End Get + Set(value As DataTable) + + End Set + + End Property + +#End Region + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then CountCuentasxPagar = 0 @@ -2541,9 +2694,10 @@ Partial Class Compras_Proveedores #End Region #Region "D O C U M E N T A C I O N" + Private Sub CargaDocs() Dim Edoc As New ClsEdocumentacion - If Edoc.DocumentacionElectronicaGet(-1, -1, CveProveedor, UsuarioActual.CveEmpresa, -1) Then + If Edoc.DocumentacionElectronicaGet(-1, -1, CveProveedor, UsuarioActual.CveEmpresa, -1, -1, 4) Then GvDocs.DataSource = Edoc.DtResultados Edoc.DocumentacionGet(-1, -1, 1, UsuarioActual.CveEmpresa) ' GVEDoc.DataSource = Edoc.DtResultados @@ -2561,38 +2715,253 @@ Partial Class Compras_Proveedores GvDocs.HeaderRow.TableSection = TableRowSection.TableHeader 'RegistraScript("OrdenarGV();") End If + + UpDocumentos.Update() + End Sub - Public Sub Update_ClickDocumentacion(sender As Object, e As EventArgs) + Public Sub UploadModal_ClickDocumentacion(sender As Object, e As EventArgs) + + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + + ' Dim chkEstatus As CheckBox + CveDocumentacionElectronica = GvRow.DataKey("CveDocumentacionElectronica").ToString.ToEntero + CveDocumentacion = GvRow.DataKey("CveDocumentacion").ToString.ToEntero + Documentacion = GvRow.DataKey("Documentacion") + AdjuntoDocumentacion = GvRow.DataKey("Adjunto") + + + 'DiasVigencia = GvRow.DataKey("DiasVigencia").ToString.ToEntero + Dim x As String = GvRow.DataKey("AplicaFechaVencimiento") + If GvRow.DataKey("AplicaFechaVencimiento") = "1" Then AplicaFechaVencimiento = True Else AplicaFechaVencimiento = False + + If GvRow.DataKey("Adjunto").ToString.Length > 0 Then + FechaVigencia = GvRow.DataKey("Adjunto").ToString.ToDate + Else + FechaVigencia = Nothing + End If + + + Estatus = GvRow.DataKey("Estatus").ToEntero + + 'If chkEstatus.Checked Then + ' Estatus = 1 + 'Else + ' Estatus = 0 + 'End If + + ObservacionDocumentacion = GvRow.FCTextBox("TxtObservaciones").Text.Trim.ToUpper + FechaLimite = GvRow.FCTextBox("TxtFechaLimite").Text.ToDate + + AdjuntoDocumentacion = GvRow.DataKey("Adjunto") + + LtlModalUploadTitulo.Text = "Subir " & Documentacion + + UpModalTitleUploadDocumento.Update() + + RegistraScript("$('#ModalUploadDoc').modal({ backdrop: 'static', keyboard: false});") + + End Sub + + Protected Sub GvDocs_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDocs.RowDataBound + + + If e.Row.RowType = DataControlRowType.DataRow Then + + Dim Adjunto As String = e.Row.DBCampo("Adjunto").ToString + + Dim ImgDownLoad As Literal = e.Row.FCLiteral("ImgDownLoad") + Dim ImgUpload As LinkButton = e.Row.FCLinkButton("ImgUpload") + Dim ImgRequired As Literal = e.Row.FCLiteral("ImgRequired") + Dim txtFechaLimite As TextBox = e.Row.FCTextBox("TxtFechaLimite") + Dim ChkEstatus As CheckBox = e.Row.FCCheckBox("chkEstatus") + ' Dim txtFechaVigencia As TextBox = e.Row.FCTextBox("TxtFechaVigencia") + Dim CveDocumentacionElectronica As String = e.Row.DataKey("CveDocumentacionElectronica") + + Dim requerido As Boolean = Boolean.Parse(e.Row.DBCampo("Requerido")) + + 'Dim chkEstatus As CheckBox = e.Row.FCCheckBox("chkEstatus") + Dim separado As Char() = ".".ToCharArray + Dim array() As String = Adjunto.Split(separado) + Dim extencion As String = "" + + Dim DiasLimite As Integer = e.Row.DataKey("DiasLimite").ToString.ToEntero + Dim AplicaDiasLimite As Boolean = If(e.Row.DataKey("AplicaDiasLimite").ToString = "1", True, False) + Dim AplicaFechaVencimiento As Boolean = If(e.Row.DataKey("AplicaFechaVencimiento").ToString = "1", True, False) + + txtFechaLimite.Visible = If(AplicaDiasLimite, True, False) + ' txtFechaVigencia.Visible = If(AplicaFechaVencimiento, True, False) + + If e.Row.DataKey("Estatus").ToEntero = 1 Then + ChkEstatus.Checked = True + Else + ChkEstatus.Checked = False + End If + + 'If e.Row.DBCampo("FechaVigencia").ToString.Length > 0 Then + ' txtFechaVigencia.Text = e.Row.DBCampo("FechaVigencia").ToString.ToDate.ToString("dd/MM/yyyy") + ' If DateTime.Today > e.Row.DBCampo("FechaVigencia").ToString.ToDateTime Then + ' txtFechaVigencia.ForeColor = Drawing.Color.Red + ' End If + 'End If + + + If array.Length > 0 Then + extencion = array(array.Length - 1) + End If + + If e.Row.DBCampo("Estatus").ToString.ToEntero.Contiene(3) Then + ' chkEstatus.Checked = True + ImgUpload.Visible = False + Else + 'chkEstatus.Checked = False + End If + + txtFechaLimite.Text = e.Row.DBCampo("FechaLimite").ToString.ToDate.ToString("dd/MM/yyyy") + + 'If e.Row.DBCampo("FechaVigencia").ToString.Length > 0 Then + ' txtFechaVigencia.Text = e.Row.DBCampo("FechaVigencia").ToString.ToDate.ToString("dd/MM/yyyy") + 'End If + + 'Dim scripMascara = "$('#" & txtFechaLimite.ClientID & "').mask('00/00/0000');$('#" & txtFechaVigencia.ClientID & "').mask('00/00/0000');" + 'RegistraScript(scripMascara, "scriptMascara") + + If Adjunto.Trim.Length > 0 Then + + Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/Edoc/Proveedor/" & CveProveedor & "/" & Adjunto + Dim linkDescargaArchivo = UsuarioActual.Empresa.Ruta & "Edoc/Proveedor/" & CveProveedor & "/" & Adjunto + + If File.Exists(linkDescargaArchivo) Then + ImgDownLoad.Visible = True + + If extencion.Length > 0 Then + ImgDownLoad.Text = String.Format(" ", linkDescarga, CveDocumentacionElectronica & "." & extencion) + Else + ImgDownLoad.Text = String.Format(" ", linkDescarga, CveDocumentacionElectronica) + End If + Else + ImgDownLoad.Visible = False + End If + + Else + ImgDownLoad.Visible = False + End If + + If requerido Then + ImgRequired.Text = " " + End If + + 'chkEstatus.Checked = ImgDownLoad.Visible + + End If + End Sub + + Protected Sub BtnUploadFileDoc_Click(sender As Object, e As EventArgs) Handles btnUploadFileDoc.Click + + Dim FileExtension As String = "-1" + Dim Filesgral As List(Of Archivo) = TxtFileDocumentacion.getfiles().Archivos + Dim Filename As String = "" + Dim ErrorProceso As Boolean = False + + If AplicaFechaVencimiento And DiasVigencia > 0 Then + FechaVigencia = DateTime.Today.AddDays(DiasVigencia) + End If + + For Each fileItem As Archivo In Filesgral + + Try + + FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "") + Dim tempArray() As String + tempArray = fileItem.filename.ToString().Split("-".ToCharArray()) + + + + + Dim objEdoc As New ClsEdocumentacion + objEdoc.IniciaTransacSQL() + + If CveDocumentacionElectronica = -1 Then + + CveDocumentacionElectronica = objEdoc.DocumentacionElectronicaAdd(CveDocumentacion, -1, -1, CveProveedor, 1, ObservacionDocumentacion, "-1", UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) + + If CveDocumentacionElectronica > 0 Then + + + If Not objEdoc.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, -1, -1, CveProveedor, 1, ObservacionDocumentacion, CveDocumentacionElectronica & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) Then + ErrorProceso = True + End If + End If + + + Else + If Not objEdoc.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, -1, -1, CveProveedor, 1, ObservacionDocumentacion, CveDocumentacionElectronica & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) Then + ErrorProceso = True + End If + End If + + + + If Not ErrorProceso = True Then + + Dim rutaDestino As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & CveDocumentacionElectronica & "." & FileExtension + Dim rutaAdjuntoAnterior As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & AdjuntoDocumentacion + + + + Try + If Not System.IO.Directory.Exists(UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\") Then + System.IO.Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\") + End If + + If File.Exists(rutaAdjuntoAnterior) And AdjuntoDocumentacion.Trim.Length > 0 Then + File.Delete(rutaAdjuntoAnterior) + End If + + If System.IO.File.Exists(rutaDestino) Then + System.IO.File.Delete(rutaDestino) + End If + + System.IO.File.Move(fileItem.FileUrl, rutaDestino) + Catch ex As Exception + GuardaLog($"Error al gaurdar documento (moviendo archivo digital) --> Error{ ex.StackTrace}") + ErrorProceso = True + End Try + End If + + + If Not ErrorProceso Then + objEdoc.Commit() + Alert("Documento cargado correctamente") + Else + objEdoc.RollBack() + Alert("Error al cargar archivo", TipoMensaje.MsgError) + End If + objEdoc.Dispose() + + CargaDocs() + + + TxtFileDocumentacion.Text = "" + UPModalUploadDoc.Update() + + Catch ex As Exception + OnError("Error al cargar archivo", ex) + End Try + + Next + + RegistraScript("$('#ModalUploadDoc').modal('hide')", "hidemodal3") + + + + + End Sub + + + Protected Sub LnkGVEliminar_Click(sender As Object, e As EventArgs) Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) - Dim activo As Boolean = False - - Dim _CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion").ToEntero - Dim _Adjunto As String = GvRow.DataKey("Adjunto").ToString - Dim _fechaLimite As Date = GvRow.FCTextBox("TxtFechaLimite").Text.ToDate - - Dim observaciones As String = GvRow.FCTextBox("TxtObservaciones").Text ' DirectCast(GvRow.FindControl("TxtObservaciones"), TextBox).Text - 'Dim DDLEstatus As DropDownList = DirectCast(GvRow.FindControl("DDLEstatus"), DropDownList) - Dim chkCompleto As CheckBox = DirectCast(GvRow.FindControl("chkEstatus"), CheckBox) - Dim _Estatus As Integer - - If chkCompleto.Checked Then _Estatus = 1 Else _Estatus = 0 - - - Dim objRH As New ClsEdocumentacion - - If Not GvRow.DataKey("CveDocumentacionElectronica").ToEntero = -1 Then - If objRH.DocumentacionElectronicaUpdate(GvRow.DataKey("CveDocumentacionElectronica").ToEntero, _CveDocumentacion, -1, -1, CveProveedor, _Estatus, observaciones, _Adjunto, UsuarioActual.CveUsuario, GvRow.FCTextBox("TxtFechaLimite").Text.ToDate) Then - Alert("Documento actualizado correctamente.", TipoMensaje.MsgInformacion) - End If - Else - If objRH.DocumentacionElectronicaAdd(_CveDocumentacion, -1, -1, CveProveedor, _Estatus, observaciones, _Adjunto, UsuarioActual.CveUsuario, GvRow.FCTextBox("TxtFechaLimite").Text.ToDate) > 0 Then - Alert("Documento actualizado correctamente.", TipoMensaje.MsgInformacion) - End If - End If - - objRH.Dispose() End Sub @@ -5778,6 +6147,8 @@ Partial Class Compras_Proveedores End If End Sub #End Region + + End Class diff --git a/General/CatDocumentacionTipo.aspx b/General/CatDocumentacionTipo.aspx index dba6be481..e2bcf3270 100644 --- a/General/CatDocumentacionTipo.aspx +++ b/General/CatDocumentacionTipo.aspx @@ -101,7 +101,7 @@ Catalogo Documentacion Tipo Seleccione uno Recursos Humanos Clientes - Proveedor + Proveedor <%-- Nota: EL tipo Tres es tipo Auditoria de documentos de proveedor usadon el portal prveedor y --%> diff --git a/vwd.webinfo b/vwd.webinfo index a280964b8..3f67b239f 100644 --- a/vwd.webinfo +++ b/vwd.webinfo @@ -19,6 +19,12 @@ + + + + + + From 7085c7147f14b3a17c3de8aeb8932e9182fb47dd Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 4 Mar 2020 09:27:01 -0700 Subject: [PATCH 32/34] Marcas en kardex horizontal --- App_Code/ClsInventarios.vb | 3 +- Inventarios/KardexAlmacenHorizontal.aspx | 446 +++++++++++--------- Inventarios/KardexAlmacenHorizontal.aspx.vb | 19 +- 3 files changed, 249 insertions(+), 219 deletions(-) diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 393e72e95..e574d4783 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -1472,7 +1472,7 @@ Public Class ClsInventarios Return Retorno End Function - Public Function GetKardexAlmacenHorizontal(CvePS As Integer, FechaFin As Date, CveAlmacen As Integer, CveUnidadMedida As Integer, CveProveedor As Integer, CveTipoAlmacen As Integer, IncluyeTransitorios As Integer, CveClasificacion As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional CondicionExistencias As Integer = 0) As Boolean + Public Function GetKardexAlmacenHorizontal(CvePS As Integer, FechaFin As Date, CveAlmacen As Integer, CveUnidadMedida As Integer, CveProveedor As Integer, CveTipoAlmacen As Integer, IncluyeTransitorios As Integer, CveClasificacion As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional CondicionExistencias As Integer = 0, Optional CveMarca As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_KardexAlmacenHorizontalGet") @@ -1490,6 +1490,7 @@ Public Class ClsInventarios .Add("@CveProveedorCompra", SqlDbType.Int).Value = CveProveedor .Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen .Add("@ExistenciasCondicion", SqlDbType.Int).Value = CondicionExistencias + .Add("@CveMarca", SqlDbType.Int).Value = CveMarca End With Try diff --git a/Inventarios/KardexAlmacenHorizontal.aspx b/Inventarios/KardexAlmacenHorizontal.aspx index 397af66ab..fa4013eb6 100644 --- a/Inventarios/KardexAlmacenHorizontal.aspx +++ b/Inventarios/KardexAlmacenHorizontal.aspx @@ -1,213 +1,241 @@ -<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="KardexAlmacenHorizontal.aspx.vb" Inherits="Inventarios_KardexAlmacen" %> - - - - - - - - - - Kardex Almacén Horizontal - - - - - - -
  • - Generar Excel -
  • -
    - - - - - - - -
    -
    -
    - - "> - -
    -
    -
    -
    Proveedor
    -
    - -
    - -
    - -
    - -
    -
    -
    - - - - -
    - - -
    -
    - -
    - - - - -
    -
    -
    -
    -
    > -
    - -
    - - - -
    - -
    - - - -
    - -
    - -
    - -
    - - - -
    - -
    - - - - - - <%----%> -
    -
    -
    -
    -
    -
    -
    - " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
    - - - - - - + +
    - - - -
    -
    - - - - - - +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="KardexAlmacenHorizontal.aspx.vb" Inherits="Inventarios_KardexAlmacen" %> + + + + + + + + + + Kardex Almacén Horizontal + + + + + + +
  • + Generar Excel +
  • +
    + + + + + + + +
    +
    +
    + + "> + +
    +
    +
    +
    +
    +
    Proveedor
    +
    + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + +
    + + + +
    +
    +
    +
    +
    + +
    +
    +
    + + + + +
    + + +
    +
    +
    +
    +
    +
    + +
    + + + + +
    +
    +
    +
    +
    +
    +
    > +
    + +
    + + + +
    + +
    + + + +
    + +
    + +
    + +
    + + + +
    + +
    + + + + + + <%----%> +
    +
    +
    +
    +
    +
    +
    + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
    + + + + + + - -
    + + + +
    +
    + + + + + + Código - - -
    - -
    -
    -
    - - + + + +
    + +
    +
    +
    + + Producto - - -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    - - - + +
    + +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + diff --git a/Inventarios/KardexAlmacenHorizontal.aspx.vb b/Inventarios/KardexAlmacenHorizontal.aspx.vb index b8c30dfb3..978bba1e9 100644 --- a/Inventarios/KardexAlmacenHorizontal.aspx.vb +++ b/Inventarios/KardexAlmacenHorizontal.aspx.vb @@ -28,7 +28,14 @@ Partial Class Inventarios_KardexAlmacen ddlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1) ddlAlmacen.DataBind() - + Using ObjPS As New ClsProductosServicios + If ObjPS.GetMarcas(UsuarioActual.CveEmpresa) Then + DdlMarca.DataSource = ObjPS.DtResultados.Copy() + End If + End Using + DdlMarca.DataBind() + DdlMarca.Items.Insert(0, New ListItem("Todos", "-1")) + Dim ObjInv As New ClsInventarios() If ObjInv.GetTiposAlmacenes() Then DdlTipoAlmacen.DataSource = ObjInv.DtResultados @@ -112,12 +119,6 @@ Partial Class Inventarios_KardexAlmacen Protected Sub btConsultar_Click(sender As Object, e As EventArgs) Handles btConsultar.Click Dim CveProducto As Integer = ddlProducto2.SelectedValue.ToEntero CargarKardex(CveProducto) - 'If CveProducto > 0 Then - - 'Else - ' Alert("Seleccione un producto.", TipoMensaje.MsgAdvertencia) - 'End If - End Sub Private Sub CargarKardex(CvePS As Integer) Dim dt As DataTable = Nothing @@ -128,7 +129,8 @@ Partial Class Inventarios_KardexAlmacen Dim CveAlmacen As Integer = ddlAlmacen.SelectedValue.ToEntero Dim CveProveedorCompra As Integer = If(DdlProveedor.SelectedValue.ToEntero > 0, DdlProveedor.SelectedValue.ToEntero, -1) - If ObjMovimientos.GetKardexAlmacenHorizontal(CvePS, FechaF, CveAlmacen, DdlUnidadMedida.SelectedValue.ToEntero, CveProveedorCompra, DdlTipoAlmacen.SelectedValue.ToEntero(), DdlIncluyeTransitorios.SelectedValue.ToEntero(), DdlClasificacion.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CondicionExistencias:=DdlExistencia.SelectedValue) Then + If ObjMovimientos.GetKardexAlmacenHorizontal(CvePS, FechaF, CveAlmacen, DdlUnidadMedida.SelectedValue.ToEntero, CveProveedorCompra, DdlTipoAlmacen.SelectedValue.ToEntero(), DdlIncluyeTransitorios.SelectedValue.ToEntero(), DdlClasificacion.SelectedValue.ToEntero, + UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CondicionExistencias:=DdlExistencia.SelectedValue, CveMarca:=DdlMarca.SelectedValue.ToEntero()) Then If ObjMovimientos.DtResultados IsNot Nothing AndAlso ObjMovimientos.DtResultados.Rows.Count > 0 Then dt = ObjMovimientos.DtResultados Dim ListaBorrar As New List(Of DataColumn) @@ -231,7 +233,6 @@ Partial Class Inventarios_KardexAlmacen End Sub Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click - Imprimir("Excel") End Sub Private Sub Imprimir(Optional reporte As String = "PDF") From c2f0f246ba92fbf315a1eebf36dd16609b3588b4 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 4 Mar 2020 09:38:24 -0700 Subject: [PATCH 33/34] Reporte de ventas por producto --- App_Code/ClsPaginas.vb | 1 + App_Code/ClsVentas.vb | 28 +++++++ Ventas/RepPS.aspx | 164 +++++++++++++++++++++++++++++++++++++++++ Ventas/RepPS.aspx.vb | 102 +++++++++++++++++++++++++ 4 files changed, 295 insertions(+) create mode 100644 Ventas/RepPS.aspx create mode 100644 Ventas/RepPS.aspx.vb diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 89892002b..368d96e14 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4595,6 +4595,7 @@ Public Class ClsPaginas PaginaDict.Add("/Ventas/CatPreciosLista.aspx".ToUpper(), 378) PaginaDict.Add("/Ventas/RepProductosServicios.aspx".ToUpper(), 352) PaginaDict.Add("/Ventas/RepProductosServiciosDetalle.aspx".ToUpper(), 352) + PaginaDict.Add("/Ventas/RepPS.aspx".ToUpper(), 701) PaginaDict.Add("/Ventas/RepABT.aspx".ToUpper(), 353) PaginaDict.Add("/Ventas/CatPromociones.aspx".ToUpper(), 123) PaginaDict.Add("/Ventas/Promociones.aspx".ToUpper(), 124) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index cfddc9043..4519bd0b3 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -1536,6 +1536,34 @@ Public Class ClsVentas Return Retorno End Function + Public Function GetRepPSEcono(CveSubProyecto As Integer, CvePS As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer, Optional CveUsuarioConsulta As Integer = -1, Optional GPO As Integer = -1, + Optional CveMoneda As Integer = -1, Optional TipoCambio As Integer = -1, Optional TCEspecifico As Double = 0) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_RepPSEconoGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@FechaI", SqlDbType.Date).Value = FechaI + .Add("@FechaF", SqlDbType.Date).Value = FechaF + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta + .Add("@GPO", SqlDbType.Int).Value = GPO + .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda + .Add("@TipoCambio", SqlDbType.Int).Value = TipoCambio + .Add("@TCEspecifico", SqlDbType.Float).Value = TCEspecifico + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el Reporte de Venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + Public Function GetRepNCxAplicar(CveClienteSucursal As Integer, CveSubProyecto As Integer, CveCliente As Integer, FechaInicio As DateTime, FechaFin As DateTime, ConSaldo As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False diff --git a/Ventas/RepPS.aspx b/Ventas/RepPS.aspx new file mode 100644 index 000000000..85d50862d --- /dev/null +++ b/Ventas/RepPS.aspx @@ -0,0 +1,164 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepPS.aspx.vb" Inherits="Ventas_RepPS" %> + + + + + + + + Reporte de Ventas por Producto + + + + + + + + + + +
    +
    +
    + + +
    +
    +
    + +
    + + + +
    +
    + Fecha Inicio: + +
    +
    +
    + + + + +
    + + + + + + +
    +
    + Fecha Fin: + +
    +
    +
    + + + + +
    + + + + + + +
    + +
    + + + +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + diff --git a/Ventas/RepPS.aspx.vb b/Ventas/RepPS.aspx.vb new file mode 100644 index 000000000..e62b9120d --- /dev/null +++ b/Ventas/RepPS.aspx.vb @@ -0,0 +1,102 @@ +Option Explicit On +Option Strict On + +Imports Extensiones +Imports System.Data +Partial Class Ventas_RepPS + Inherits ClsPaginas + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + If Not IsPostBack Then + CargaDatosIniciales() + CargaCombos() + CargaDatos() + End If + End Sub + Private Sub CargaDatosIniciales() + txtFechaI.Text = $"01/{Now.Month}/{Now.Year}" + txtFechaF.Text = Now.ToString("dd/MM/yyyy") + End Sub + Private Sub CargaCombos() + CargaTipoCentroCosto() + End Sub + + Private Sub CargaTipoCentroCosto() + + If UsuarioActual.Empresa.Tipo_CentroCosto = 1 Then + DdlSubProyecto.Items.Clear() + LblSubProyecto.InnerText = "Sucursal:" + DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) + DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1")) + DdlSubProyecto.DataBind() + + ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 2 Then + DdlSubProyecto.Items.Clear() + + LblSubProyecto.InnerText = "Proyecto:" + DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) + DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1")) + DdlSubProyecto.DataBind() + + ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 3 Then + DdlGrupo.Items.Insert(0, New ListItem("Proyecto", "1")) + DdlGrupo.Items.Insert(1, New ListItem("SubProyecto", "2")) + DdlGrupo.Items.Insert(17, New ListItem("SubProyecto Ejec.", "19")) + DdlGrupo.DataBind() + ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 4 Then + LblSubProyecto.InnerText = "Proyecto:" + DdlGrupo.Items.Insert(0, New ListItem("Proyecto", "1")) + DdlGrupo.Items.Insert(1, New ListItem("SubProyecto", "2")) + DdlGrupo.Items.Insert(17, New ListItem("SubProyecto Ejec.", "19")) + DdlGrupo.DataBind() + ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 5 Then + LblSubProyecto.InnerText = "Sucursal:" + End If + End Sub + + Private Sub CargaDatos() + + Dim CveSubProyecto As Integer = DdlSubProyecto.SelectedValue.ToEntero() + Dim Grupo As Integer = DdlGrupo.SelectedValue.ToEntero() + Dim CvePS As Integer = -1 + Dim CveMoneda As Integer = -1 + Dim TC As Integer = 1 + Dim TCEspecifico As Decimal = -1 + Dim FechaI, FechaF As DateTime + FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.ToDate, MinFecha) + FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.ToDate, MaxFecha) + + Dim ObjVentas As New ClsVentas() + If ObjVentas.GetRepPSEcono(CveSubProyecto, CvePS, FechaI, FechaF, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario, GPO:=Grupo, CveMoneda:=CveMoneda, TipoCambio:=TC, TCEspecifico:=TCEspecifico) Then + GvDatos.DataSource = ObjVentas.DtResultados + Else + GvDatos.DataSource = Nothing + End If + + ObjVentas.Dispose() + GvDatos.DataBind() + + UPDatos.Update() + End Sub + + + Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then + Select Case e.Row.DBCampo("Orden").ToString.ToEntero() + Case 4 + e.Row.CssClass = "Totales" + Case 3 + e.Row.CssClass = "SubTotales2" + Case 2 + e.Row.CssClass = "SubTotales" + Case 1 + e.Row.CssClass = "SubTotalesB" + Case 0 + e.Row.CssClass = "Texto" + End Select + End If + End Sub + Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) + CargaDatos() + End Sub +End Class From 76e6cf615442a26bf8cd230f3cb3033bcbd6ee36 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 4 Mar 2020 09:38:47 -0700 Subject: [PATCH 34/34] Validacion de cotizacion con pagos --- Ventas/Ventas.aspx.vb | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 3c79eea5e..e9235b586 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -9320,7 +9320,7 @@ Partial Class Ventas Kilometraje:=TxtKilometraje.Text.ToDouble, EsAmortizacion:=EsNCAmortizacion) Then ErrorList.Add("Ocurrió un error al Generar la Venta.
    Revise su factura y cualquier detalle comuníquese a Soporte Técnico") Else - If factura.TipoDocto.Contiene("Dev") Or DtVentasNC IsNot Nothing Then + If factura.TipoDocto.Contiene("Dev", "Egs") Or DtVentasNC IsNot Nothing Then If DtVentasNC IsNot Nothing Then For Each row As DataRow In DtVentasNC.Rows If Not ObjVentas.AddVentasRelacionadas(ObjVentas.CveVenta, row("CveVenta").ToString.ToEntero) Then @@ -23905,6 +23905,20 @@ Partial Class Ventas #End Region #Region " EMITIR DOCUMENTO NUEVO " + + Private Function ValidaFacturarCotizacion() As Boolean + Dim Retorno As Boolean = True + + If UsuarioActual.CveEmpresa = 141 Then + If Not PermiteCredito AndAlso (DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0) Then + Alert("Es necesario especificar un pago.", TipoMensaje.MsgAdvertencia) + Retorno = False + Return Retorno + End If + End If + + Return Retorno + End Function Private Sub EmitirDocumentoNuevo(TipoDoctoNuevo As String) If GvPagos.Rows.Count = 0 And UsuarioActual.Empresa.Funcionalidad(558).ToEntero = 1 And RBLPago.SelectedValue.ToEntero = 2 Then Alert("No se puede facturar hasta que se haya especificado detalladamente la forma de pago", TipoMensaje.MsgAdvertencia) @@ -23913,11 +23927,17 @@ Partial Class Ventas 'CARGA LO PENDIENTE POR FACTURAR DE COTIZACION If EraCotizacion = 1 Then + + If Not ValidaFacturarCotizacion() Then + Exit Sub + End If + If Not PreparaFacturarCotizacion() Then EraCotizacion = 0 DdlTipoComprobante.SelectedValue = "Cot" Exit Sub End If + End If 'CARGA LO PENDIENTE POR FACTURAR DE REMISION