From 370f610af6c1686d09cbb75ecfe9615bd8b0f5a4 Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 9 Mar 2022 15:17:41 -0700 Subject: [PATCH 01/13] -- valor predeterminado --- App_Code/Modelos.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index af1e4838d..9ea478a33 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -6859,7 +6859,7 @@ Namespace Modelos Public Property TiempoEntrega As String = "" Public Property Vigencia As Date Public Property TipoEstatus As Integer - Public Property CveCondicionEntrega As Integer + Public Property CveCondicionEntrega As Integer = -1 Public Property CondicionEntrega As String = "" Public Property TipoRelacion As String From 45b554605e09b77d17d72ccb51930b15beedf208 Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 9 Mar 2022 15:17:49 -0700 Subject: [PATCH 02/13] mejora en espacio --- Ventas/Clientes.aspx | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/Ventas/Clientes.aspx b/Ventas/Clientes.aspx index 3f7fde58b..858b765b7 100644 --- a/Ventas/Clientes.aspx +++ b/Ventas/Clientes.aspx @@ -4440,11 +4440,15 @@ - - + + + +
<%# Eval("CodigoPS") %>
+
+
- + @@ -4452,25 +4456,27 @@ <%-- --%> - + - - + + +
<%# Eval("Usuario") %>
+
+
+ - - - + From 41feda0f9e58568b57e90d394cd98dfcbea2a8db Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 9 Mar 2022 15:18:15 -0700 Subject: [PATCH 03/13] =?UTF-8?q?prepoliza=20de=20garant=C3=ADa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inventarios/EntregaAlmacen.aspx.vb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index 4a3ee3bdf..db6535764 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -1805,6 +1805,7 @@ Partial Class Inventarios_EntregaAlmacen ObjConta.Dispose() ObjVentas.Dispose() ObjEventos.Dispose() + '' identificar que productos no están completos. CargaVentaPorSurtir(CveVentaSurtir) CargaPendientes() Alert("Ha sido cambiada la informacion de existencias de la venta actual, se han recargado la información.", TipoMensaje.MsgAdvertencia) @@ -2331,6 +2332,11 @@ Partial Class Inventarios_EntregaAlmacen End If TotalGarantia += (RowGarantia("Cantidad").ToString().ToDecimal() * PU) Next + + 'se registra + If ContabilizaMovimientoAlmacen(ObjConta, TxtFecha.Text.ToDate, HLFolio.Text, "EntregaAlmacen", CveMovimiento, CveMovimientoEntrada, TotalGarantia, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, True) <= 0 Then + ErrorMovInv = True + End If End If End If ' TERMINA: GARANTIAS From 68e7bf1080e1b461b957b6e6a19c1bef14f26ef1 Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 11 Mar 2022 12:45:49 -0700 Subject: [PATCH 04/13] -* mejoras en columnas --- Acumuladores/RepPolizasVirtuales.aspx | 63 +++++++++++++----------- Acumuladores/RepPolizasVirtuales.aspx.vb | 7 +-- 2 files changed, 34 insertions(+), 36 deletions(-) diff --git a/Acumuladores/RepPolizasVirtuales.aspx b/Acumuladores/RepPolizasVirtuales.aspx index 12906ffc6..b4e6a77ca 100644 --- a/Acumuladores/RepPolizasVirtuales.aspx +++ b/Acumuladores/RepPolizasVirtuales.aspx @@ -44,10 +44,7 @@
- - - - + SubProyecto:
@@ -120,35 +117,41 @@
- + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - diff --git a/Acumuladores/RepPolizasVirtuales.aspx.vb b/Acumuladores/RepPolizasVirtuales.aspx.vb index bcc51a9dd..4ce6c4895 100644 --- a/Acumuladores/RepPolizasVirtuales.aspx.vb +++ b/Acumuladores/RepPolizasVirtuales.aspx.vb @@ -3,8 +3,6 @@ Imports Extensiones Partial Class Acumuladores_RepPolizasVirtuales Inherits ClsPaginas - - Private Sub Acumuladores_RepPolizasVirtuales_Load(sender As Object, e As EventArgs) Handles Me.Load If Not Page.IsPostBack Then CargaCombos() @@ -15,7 +13,7 @@ Partial Class Acumuladores_RepPolizasVirtuales Private Sub CargaCombos() CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto:=LblSubProyecto) - + txtFechaI.Text = DateTime.Now.FirstDayOfMonth.ToShortDateString() End Sub @@ -47,9 +45,6 @@ Partial Class Acumuladores_RepPolizasVirtuales End Sub - - - Protected Sub BtnBuscar_Click(sender As Object, e As EventArgs) CargaDatos() End Sub From 73785e50513529c86340598498c5943303ce52eb Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 12 Mar 2022 14:56:23 -0700 Subject: [PATCH 05/13] - mejoras de tipogasto --- Contabilidad2/CatCuentasAsignaciones.aspx | 13 ++++++++---- Contabilidad2/CatCuentasAsignaciones.aspx.vb | 22 ++++++++++++++------ 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/Contabilidad2/CatCuentasAsignaciones.aspx b/Contabilidad2/CatCuentasAsignaciones.aspx index c48771d03..b1aac2ea4 100644 --- a/Contabilidad2/CatCuentasAsignaciones.aspx +++ b/Contabilidad2/CatCuentasAsignaciones.aspx @@ -69,15 +69,16 @@ - - - + + + + @@ -182,6 +183,10 @@
+
+ + +
diff --git a/Contabilidad2/CatCuentasAsignaciones.aspx.vb b/Contabilidad2/CatCuentasAsignaciones.aspx.vb index 8acd80a65..31c0d54c0 100644 --- a/Contabilidad2/CatCuentasAsignaciones.aspx.vb +++ b/Contabilidad2/CatCuentasAsignaciones.aspx.vb @@ -41,8 +41,10 @@ Partial Class Contabilidad2_CatCuentasAsignaciones GvDatos.DataSource = ObjConta.DtResultados End If GvDatos.Columns(4).Visible = ObjConta.DtResultados.MAX("CveSubProyecto").ToEntero > 0 - GvDatos.Columns(5).Visible = ObjConta.DtResultados.MAX("PorcentajeIVA").ToDecimal > 0 - + GvDatos.Columns(5).Visible = ObjConta.DtResultados.MAX("PorcentajeIVA").ToDecimal > 0 + GvDatos.Columns(6).Visible = ObjConta.DtResultados.MAX("TipoGasto") <> "" + + If ObjConta.GetCuentasGlobales(UsuarioActual.CveEmpresa) Then GvGlobal.DataSource = ObjConta.DtResultados End If @@ -125,6 +127,8 @@ Partial Class Contabilidad2_CatCuentasAsignaciones DdlSubProyectos.Enabled = False DdlClasificacion.Enabled = False DdlPersonal.Enabled = False + RecargaConcepto(CveConceptoContable) + CveConceptoAsignacion = GvRow.DataKey("CveCuentaAsignacion").ToEntero DdlCconceptosContables.SelectedValueExist(GvRow.DataKey("CveConceptoContable")) DdlCuenta.SelectedValueExist(GvRow.DataKey("CveCuenta")) @@ -136,12 +140,11 @@ Partial Class Contabilidad2_CatCuentasAsignaciones TxtPorcentajeIVA.Text = GvRow.DataKey("PorcentajeIVA") DdlCuentaBancaria.SelectedValueExist(GvRow.DataKey("CveBancoCuenta")) DdlSubProyectos.SelectedValueExist(GvRow.DataKey("CveSubProyecto").ToEntero) + DdlTipoGasto.SelectedValueExist(GvRow.DataKey("CveTipoGasto").ToEntero) Dim CveCliente As Integer = GvRow.DataKey("CveCliente").ToEntero Dim CvePersonal As Integer = GvRow.DataKey("CvePersonal").ToEntero - RecargaConcepto(CveConceptoContable) - DdlClientes.ddl.SelectedValueExist(CveCliente) DdlPersonal.ddl.SelectedValueExist(CvePersonal) @@ -183,6 +186,13 @@ Partial Class Contabilidad2_CatCuentasAsignaciones End If divConceptoNomina.Visible = Dr("AplicaNomina").ToString = "True" + + If CveConceptoContable = 51 Then + divTipoGasto.Visible = True + DdlTipoGasto.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa) + DdlTipoGasto.DataBind() + ' DdlActivoFijo.SelectedValueExist(GvRow.DataKey("CveActivoFijo")) + End If End If End Sub @@ -253,14 +263,14 @@ Partial Class Contabilidad2_CatCuentasAsignaciones If Not ObjConta.AddCuentasAsignaciones(DdlCconceptosContables.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlCuenta.SelectedValue.ToEntero, TxtIdCuentaContable.Text.ToEntero, DdlProveedor.SelectedValue.ToEntero, DdlClientes.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero(), - CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero(), CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, CveActivoFijo:=DdlActivoFijo.SelectedValue.ToEntero) Then + CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero(), CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, CveActivoFijo:=DdlActivoFijo.SelectedValue.ToEntero, CveTipoGasto:=DdlTipoGasto.SelectedValue.ToEntero) Then ErrorString = "Error al agregar" End If ElseIf HdnCveCuentaAsignacion.Value.ToEntero > 0 Then If Not ObjConta.UpdateCuentasAsignaciones(CveConceptoAsignacion, DdlCconceptosContables.SelectedValue.ToEntero, DdlCuenta.SelectedValue.ToEntero, TxtIdCuentaContable.Text.ToEntero, DdlProveedor.SelectedValue.ToEntero, DdlClientes.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero(), - CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero(), CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, CveActivoFijo:=DdlActivoFijo.SelectedValue.ToEntero) Then + CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero(), CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, CveActivoFijo:=DdlActivoFijo.SelectedValue.ToEntero, CveTipoGasto:=DdlTipoGasto.SelectedValue.ToEntero) Then ErrorString = "Error al actualizar" End If End If From 90db169f18b254fd8af17888697cd66c33930181 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 12 Mar 2022 14:56:32 -0700 Subject: [PATCH 06/13] -- acomodo de columnas --- Acumuladores/RepPolizasVirtuales.aspx | 30 ++++++++++++++------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/Acumuladores/RepPolizasVirtuales.aspx b/Acumuladores/RepPolizasVirtuales.aspx index b4e6a77ca..845677f19 100644 --- a/Acumuladores/RepPolizasVirtuales.aspx +++ b/Acumuladores/RepPolizasVirtuales.aspx @@ -124,35 +124,37 @@ - - + + - - - - - - - - + + + + + + + + - + - - - + + + + +
From dbc38f70a963108ad185177798ae86219290c733 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 12 Mar 2022 14:56:49 -0700 Subject: [PATCH 07/13] -- mejora en visibilidad de ver por meses --- Compras/RepCxP.aspx | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Compras/RepCxP.aspx b/Compras/RepCxP.aspx index 666f8cd15..bb70141e5 100644 --- a/Compras/RepCxP.aspx +++ b/Compras/RepCxP.aspx @@ -253,13 +253,6 @@ -
-
Ver por meses:
-
- -
-
-
@@ -269,11 +262,16 @@
-
- Moneda: +
+
Ver por meses:
+
+ +
- -
+
+ Moneda: +
+
From 108d45c57268c16cf7bcb03d9ba15ecf058e79c9 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 12 Mar 2022 14:57:06 -0700 Subject: [PATCH 08/13] =?UTF-8?q?--=20liquidaci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ventas/ClientesAbonar.aspx | 80 ++++--- Ventas/ClientesAbonar.aspx.vb | 381 ++++++++++++++-------------------- 2 files changed, 196 insertions(+), 265 deletions(-) diff --git a/Ventas/ClientesAbonar.aspx b/Ventas/ClientesAbonar.aspx index 531702304..5c4f6f4bc 100644 --- a/Ventas/ClientesAbonar.aspx +++ b/Ventas/ClientesAbonar.aspx @@ -241,10 +241,10 @@ - -
+ +
@@ -311,7 +311,7 @@ <%--5--%> - Días
Vencidos
+ Días
Vencidos
@@ -332,13 +332,13 @@
<%--8--%> - Monto
Compra
+ Monto
Venta
 
<%--9--%> - +   @@ -352,7 +352,7 @@ <%--11--%> - + Saldo   @@ -362,7 +362,7 @@ Abonar - + @@ -388,82 +388,80 @@ - - - <%--16--%> + <%--16--%> - Col. 1 - + + - <%--17--%> - - Col. 2 + + <%--17--%> + - + <%--18--%> - Col. 3 - + <%--19--%> - Col. 4 - + <%--20--%> - Col. 5 - + <%--21--%> - Col. 6 - + <%--22--%> - Col. 7 - + <%--23--%> - - Total
Liquidación
+ - + + + + <%--24--%> + + + + + + <%--25--%> + + + - <%--24--%> - + <%--26--%> + Auxiliar - - <%--25--%> - - CveVenta - - - - - <%--26--%> + + + <%--27--%> - Complemento
Pago
+ Comp
Pago
diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb index 4ed6c3790..c83c43171 100644 --- a/Ventas/ClientesAbonar.aspx.vb +++ b/Ventas/ClientesAbonar.aspx.vb @@ -292,8 +292,25 @@ Partial Class Ventas_ClientesAbonar RVTxtFechaDocumento.MaximumValue = Now.ToString("dd/MM/yyyy") - If UsuarioActual.Empresa.Funcionalidad(590) = "1" Then + + 'Dim CveClasificacionCol1 As Integer = 21514 + 'Dim CveClasificacionCol2 As Integer = 21916 + 'Dim CveClasificacionCol3 As Integer = 21520 + 'Dim CveClasificacionCol4 As Integer = 21519 + 'Dim CveClasificacionCol5 As Integer = 21547 + 'Dim CveClasificacionCol6 As Integer = 21572 + 'Dim CveClasificacionCol7 As Integer = 21571 + + GvCxC.Columns(17).HeaderText = "Comisión
Venta" 'GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionCol1).FiltroPrimeroValor("Clasificacion").Substring(0, 10) + GvCxC.Columns(18).HeaderText = "Gastos
Manejo" 'GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionCol2).FiltroPrimeroValor("Clasificacion").Substring(0, 12) + GvCxC.Columns(19).HeaderText = "Servicio
Inspección" 'GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionCol3).FiltroPrimeroValor("Clasificacion").Substring(0, 12) + GvCxC.Columns(20).HeaderText = "Seguro" 'GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionCol4).FiltroPrimeroValor("Clasificacion").Substring(0, 12) + GvCxC.Columns(21).HeaderText = "Aduana
Mex" 'GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionCol5).FiltroPrimeroValor("Clasificacion").Substring(0, 12) + GvCxC.Columns(22).HeaderText = "Diversos" 'GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionCol6).FiltroPrimeroValor("Clasificacion").Substring(0, 12) + GvCxC.Columns(23).HeaderText = "Aduana
USA" 'GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionCol7).FiltroPrimeroValor("Clasificacion").Substring(0, 12) + 'GvCxC.Columns(24).HeaderText = "Material
Empaque" 'GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionCol7).FiltroPrimeroValor("Clasificacion").Substring(0, 12) + DvLiquidacion1.Visible = True DvLiquidacion2.Visible = True End If @@ -393,10 +410,12 @@ Partial Class Ventas_ClientesAbonar SumDescuentoProntoPago = TmpCxCAux.SUM("DescuentoProntoPago") GvCxC.DataSource = Mov.DtResultados.FiltraParametros("Saldo > 0", "Fecha,SerieFolio") - GvCxC.DataBind() + CveMoneda = pCveMoneda End If + Mov.Dispose() + GvCxC.DataBind() TxtImporte.Text = "" TxtObservaciones.Text = "" @@ -407,7 +426,6 @@ Partial Class Ventas_ClientesAbonar End If End If - Mov.Dispose() UPVentas.Update() End Sub @@ -507,25 +525,24 @@ Partial Class Ventas_ClientesAbonar If e.Row.RowType = DataControlRowType.DataRow Then Dim moneda As Integer = 0 If e.Row.RowIndex = 0 Then - e.Row.Cells(0).ColumnSpan = 5 - e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Right - e.Row.Cells(1).Visible = False - e.Row.Cells(2).Visible = False - e.Row.Cells(3).Visible = False - e.Row.Cells(4).Visible = False + ' e.Row.Cells(0).ColumnSpan = 5 + ' e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Right + ' e.Row.Cells(1).Visible = False + ' e.Row.Cells(2).Visible = False + ' e.Row.Cells(3).Visible = False + ' e.Row.Cells(4).Visible = False + e.Row.BackColor = Drawing.Color.LightGray - - e.Row.FCTextBox("TxtLiquidacionCol1").Visible = False - e.Row.FCTextBox("TxtLiquidacionCol2").Visible = False - e.Row.FCTextBox("TxtLiquidacionCol3").Visible = False - e.Row.FCTextBox("TxtLiquidacionCol4").Visible = False - e.Row.FCTextBox("TxtLiquidacionCol5").Visible = False - e.Row.FCTextBox("TxtLiquidacionCol6").Visible = False - e.Row.FCTextBox("TxtLiquidacionCol7").Visible = False - e.Row.FCTextBox("TxtLiquidacionCol8").Visible = False - - + e.Row.FCDropDownList("DdlTG").Visible = False + e.Row.FCTextBox("TxtLiqCol1").Visible = False + e.Row.FCTextBox("TxtLiqCol2").Visible = False + e.Row.FCTextBox("TxtLiqCol3").Visible = False + e.Row.FCTextBox("TxtLiqCol4").Visible = False + e.Row.FCTextBox("TxtLiqCol5").Visible = False + e.Row.FCTextBox("TxtLiqCol6").Visible = False + e.Row.FCTextBox("TxtLiqCol7").Visible = False + e.Row.FCTextBox("TxtLiqCol8").Visible = False End If If e.Row.RowIndex = 1 Then @@ -541,10 +558,6 @@ Partial Class Ventas_ClientesAbonar e.Row.Cells(11).Width = Unit.Pixel(60) End If - ' e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Right - ' e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Right - ' e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Right - e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Right e.Row.Cells(9).HorizontalAlign = HorizontalAlign.Right e.Row.Cells(10).HorizontalAlign = HorizontalAlign.Right @@ -601,27 +614,31 @@ Partial Class Ventas_ClientesAbonar e.Row.FCCheckBox("ChkGenerarNC").Attributes.Add("onclick", String.Format("FnSuma(this,{0},{1},{5}); FnCambia({2},this,{1},0,{3},{4}); FnEditarImporte({2}, {0});", e.Row.FCTextBox("TxtAbonar").ClientID, e.Row.DBCampo("Saldo").ToDecimal - e.Row.DBCampo("DescuentoProntoPago").ToDecimal, e.Row.FCCheckBox("ChkGenerarNC").ClientID, CveMonedaFiltro, moneda, e.Row.DBCampo("CveVenta"))) End If - e.Row.FCTextBox("TxtLiquidacionCol1").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}") - e.Row.FCTextBox("TxtLiquidacionCol2").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}") - e.Row.FCTextBox("TxtLiquidacionCol3").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}") - e.Row.FCTextBox("TxtLiquidacionCol4").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}") - e.Row.FCTextBox("TxtLiquidacionCol5").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}") - e.Row.FCTextBox("TxtLiquidacionCol6").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}") - e.Row.FCTextBox("TxtLiquidacionCol7").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}") - e.Row.FCTextBox("TxtLiquidacionCol8").Attributes.Add("class", $"ClsSelLiquidacionVentaTotal{e.Row.DBCampo("CveVenta").ToEntero}") + If UsuarioActual.Empresa.Funcionalidad(590) = "1" Then '' si es empresa agrícola - e.Row.FCTextBox("TxtLiquidacionCol1").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})") - e.Row.FCTextBox("TxtLiquidacionCol2").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})") - e.Row.FCTextBox("TxtLiquidacionCol3").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})") - e.Row.FCTextBox("TxtLiquidacionCol4").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})") - e.Row.FCTextBox("TxtLiquidacionCol5").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})") - e.Row.FCTextBox("TxtLiquidacionCol6").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})") - e.Row.FCTextBox("TxtLiquidacionCol7").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})") + e.Row.FCDropDownList("DdlTG").DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa) + e.Row.FCDropDownList("DdlTG").DataBind() + e.Row.FCTextBox("TxtLiqCol1").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}") + e.Row.FCTextBox("TxtLiqCol2").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}") + e.Row.FCTextBox("TxtLiqCol3").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}") + e.Row.FCTextBox("TxtLiqCol4").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}") + e.Row.FCTextBox("TxtLiqCol5").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}") + e.Row.FCTextBox("TxtLiqCol6").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}") + e.Row.FCTextBox("TxtLiqCol7").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}") + e.Row.FCTextBox("TxtLiqCol8").Attributes.Add("class", $"ClsSelLiquidacionVentaTotal{e.Row.DBCampo("CveVenta").ToEntero}") + e.Row.FCTextBox("TxtLiqCol1").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})") + e.Row.FCTextBox("TxtLiqCol2").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})") + e.Row.FCTextBox("TxtLiqCol3").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})") + e.Row.FCTextBox("TxtLiqCol4").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})") + e.Row.FCTextBox("TxtLiqCol5").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})") + e.Row.FCTextBox("TxtLiqCol6").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})") + e.Row.FCTextBox("TxtLiqCol7").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})") + End If Else @@ -713,7 +730,7 @@ Partial Class Ventas_ClientesAbonar End If 'valida que no exceda lo seleccionado. con el valor del ie - If (RblTipoPago.SelectedValue = "3" AndAlso HdnIngresoImporte.value.todecimal < txttotal.text.todecimal) Then + If (RblTipoPago.SelectedValue = "3" AndAlso HdnIngresoImporte.Value.ToDecimal < TxtTotal.Text.ToDecimal) Then Alert("Importe excedido para la aplicación", TipoMensaje.MsgAdvertencia) Exit Sub End If @@ -951,7 +968,7 @@ Partial Class Ventas_ClientesAbonar IdCtaContable = If(EsAnticipoEspecial, IdCtaContMonedaComplementariaAnticipo, IdCtaContComplementaria) If ImporteMovimiento <> 0 Then importeMX = ImporteMovimiento - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Referencia, If(gvr.DataKey("TipoDocto") = "Ant" AndAlso UsuarioActual.CveEmpresa.Contiene(119, 158), 226, 207), ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, gvr.FCHyperLink("HplF2").Text.ToEntero, -1, CveSubProyectoContabilizar, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=(ImporteMovimiento * tipoCambioVentaValuacion - ImporteMovimiento).RoundSQL, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioVentaValuacion) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Referencia, If(gvr.DataKey("TipoDocto") = "Ant" AndAlso UsuarioActual.CveEmpresa.Contiene(119, 158), 226, 207), ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, -1, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoContabilizar, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=(ImporteMovimiento * tipoCambioVentaValuacion - ImporteMovimiento).RoundSQL, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioVentaValuacion) Then MsgError = "No se pudo insertar la póliza" End If End If @@ -960,8 +977,8 @@ Partial Class Ventas_ClientesAbonar End If If EsAnticipoEspecial Then - If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, Referencia, 2, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, gvr.FCHyperLink("HplF2").Text.ToEntero, -1, CveSubProyectoContabilizar, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=importeMX, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=PorcentajeImpuesto, Contabilizable:=False) Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, Referencia, 95, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, gvr.FCHyperLink("HplF2").Text.ToEntero, -1, CveSubProyectoContabilizar, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=importeMX, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=PorcentajeImpuesto, Contabilizable:=False) Then + If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, Referencia, 2, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoContabilizar, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=importeMX, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=PorcentajeImpuesto, Contabilizable:=False) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, Referencia, 95, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoContabilizar, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=importeMX, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=PorcentajeImpuesto, Contabilizable:=False) Then MsgError = "No se pudo insertar la póliza" End If Else @@ -1311,8 +1328,6 @@ Partial Class Ventas_ClientesAbonar tipoCambioVentaDiferenciaCambiaria = If(gvr.DataKey("Fecha").ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, gvr.DataKey("TipoCambio").ToDecimal) - - If CveMonedaVenta = 1 And CveMoneda <> 1 Then 'factura pesos, pago en dolares tImporteVenta = gvr.FCTextBox("TxtAbonar").Text.ToDecimal.RoundSQL @@ -1356,77 +1371,12 @@ Partial Class Ventas_ClientesAbonar ImporteMovimiento = Math.Abs(Diferencia) importeMX = ImporteMovimiento - 'Dim Diferencia As Decimal = ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * tipoCambioVentaValuacion) - ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * tipoCambioPago) 'Añadimos la diferencia de perdida en la venta - 'Diferencia -= ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambioVenta) - ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IVA - 'Diferencia += ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * tipoCambioVenta) - ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetIVA - 'Diferencia += ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambioVenta) - ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetISR - 'Diferencia -= ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * tipoCambioVenta) - ((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 CveSubProyectoContabilizar = CveSubProyecto Else ImporteMovimiento = 0 End If - 'Case 65 'Perdida - ' If CveMoneda <> 1 OrElse gvr.DataKey("CveMoneda").ToEntero <> 1 Then - ' 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, tipoCambioVenta) - - ' Dim Diferencia As Decimal = ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * tipoCambioVentaValuacion) - ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * tipoCambioPago) 'Añadimos la diferencia de perdida en la venta - ' Diferencia -= ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambioVenta) - ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IVA - ' Diferencia += ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * tipoCambioVenta) - ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetIVA - ' Diferencia += ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambioVenta) - ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetISR - ' Diferencia -= ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * tipoCambioVenta) - ((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 - - ' '' 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 * tipoCambioVentaDiferenciaCambiaria) - (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioPago) 'Añadimos la diferencia de perdida en la venta - ' ' ImporteMovimiento -= ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambioVentaDiferenciaCambiaria) - ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IVA - ' ' ImporteMovimiento += ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * tipoCambioVentaDiferenciaCambiaria) - ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * TCImpuestos) - ' ' ImporteMovimiento += ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambioVentaDiferenciaCambiaria) - ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetISR - ' ' ImporteMovimiento -= ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * tipoCambioVentaDiferenciaCambiaria) - ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IEPS - ' ' ImporteMovimiento = Math.Abs(Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)) - ' ' importeMX = ImporteMovimiento - ' ' 'ElseIf tipoCambioPago > tipoCambioVenta AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then - ' ' ' ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal - (Math.Abs(Math.Round(gvr.FCTextBox("TxtAbonar").Text.ToDecimal / tipoCambioPago, 2)) * tipoCambioPago) - ' ' ' 'ImporteMovimiento -= Math.Abs(Math.Round(((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambioVenta))) 'Añadimos la diferencia de ganancia en el IVA - ' ' ' 'ImporteMovimiento += Math.Abs(Math.Round(((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * tipoCambioVenta))) 'Añadimos la diferencia de ganancia en el RetIVA - ' ' ' 'ImporteMovimiento += Math.Abs(Math.Round(((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambioVenta))) 'Añadimos la diferencia de ganancia en el RetISR - ' ' ' 'ImporteMovimiento -= Math.Abs(Math.Round(((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * tipoCambioVenta))) 'Añadimos la diferencia de ganancia en el IEPS - ' ' ' ImporteMovimiento = ImporteMovimiento - ' ' ' importeMX = ImporteMovimiento - ' 'End If - ' CveSubProyectoContabilizar = CveSubProyecto - ' Else - ' ImporteMovimiento = 0 - ' End If Case 78 'Otros Ingresos If ChkAjusteOI.Checked Then @@ -1465,42 +1415,7 @@ Partial Class Ventas_ClientesAbonar If tipoCambioVenta > 1 Then ConceptoMovimiento += $" TC:{tipoCambioVenta} ${ImporteMovimiento.FormatoNumero(2)}" End If - 'Case 92 - ' If RblTipoPago.SelectedValue = "3" Then ' cuando es ingreso por comprobar - ' ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal - ' importeMX = Math.Round(ImporteMovimiento * tipoCambioPago, 2) - ' CveSubProyectoContabilizar = CveSubProyecto - ' If tipoCambioVenta > 1 Then ConceptoMovimiento += $" TC:{tipoCambioVenta} ${ImporteMovimiento.FormatoNumero(2)}" - - ' 'si la factura es en dólares y trae complementaria, el importemn debe ser igual al importe - ' If gvr.DataKey("CveMoneda").ToEntero <> 1 AndAlso (IdCtaContComplementaria > 0 Or UsuarioActual.CveEmpresa = 119) Then - ' importeMX = ImporteMovimiento - ' IdCtaContable = IdCtaContMonedaExtranjera - ' Else - ' IdCtaContable = IdCuentaCliente - ' CveCuenta = CveCuentaCliente - ' End If - - ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, Referencia, ConceptoContable, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE:=DdlIngreso.SelectedValue.ToEntero, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveCliente:=CveCliente, ImporteMX:=importeMX, CveSubProyecto:=CveSubProyectoContabilizar) Then - ' MsgError = "No se pudo insertar la póliza" - ' End If - - ' If gvr.DataKey("CveMoneda").ToEntero = 2 Then - ' IdCtaContable = IdCtaContComplementaria - ' CveCuenta = CveCuentaComplementaria - ' If ImporteMovimiento <> 0 AndAlso (IdCtaContable > 0 Or UsuarioActual.CveEmpresa = 119) Then - ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, TxtObservaciones.Text, 227, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE:=DdlIngreso.SelectedValue.ToEntero, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveCliente:=CveCliente, ImporteMX:=ImporteMovimiento * tipoCambioPago - ImporteMovimiento, , ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioPago) Then - ' MsgError = "No se pudo insertar la póliza" - ' End If - ' importeMX = ImporteMovimiento - ' IdCtaContable = IdCtaContMonedaExtranjera - ' CveCuenta = CveCuentaMonedaExtranjera - ' End If - ' End If - - ' End If - ' ImporteMovimiento = 0 Case 134 'Pago Intermediario If RblTipoPago.SelectedValue = "2" Then ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal - gvr.FCTextBox("TxtComision").Text.ToDecimal @@ -1509,7 +1424,7 @@ Partial Class Ventas_ClientesAbonar If tipoCambioVenta > 1 Then ConceptoMovimiento += $" TC:{tipoCambioVenta} ${ImporteMovimiento.FormatoNumero(2)}" - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, ConceptoMovimiento, ConceptoContable, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, -1, gvr.FCHyperLink("HplF2").Text.ToEntero, -1, CveSubProyectoContabilizar, CveProveedor:=DdlProveedorPagoInt.SelectedValue.ToEntero, ImporteMX:=importeMX) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, ConceptoMovimiento, ConceptoContable, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, -1, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoContabilizar, CveProveedor:=DdlProveedorPagoInt.SelectedValue.ToEntero, ImporteMX:=importeMX) Then MsgError = "No se pudo insertar la póliza" End If End If @@ -1520,6 +1435,10 @@ Partial Class Ventas_ClientesAbonar ImporteMovimiento = 0 End Select + If MsgError <> "" Then + Exit For + End If + If ImporteMovimiento <> 0 AndAlso MsgError = "" Then 'Conta ContPAQ If (IdCtaContable < 1 Or IdCuentaBancaria < 1) Then @@ -1527,7 +1446,7 @@ Partial Class Ventas_ClientesAbonar idCuentaContabilizacion = 0 End If - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, Referencia, ConceptoContable, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, gvr.FCHyperLink("HplF2").Text.ToEntero, -1, CveSubProyectoContabilizar, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=importeMX, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=PorcentajeImpuesto) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, Referencia, ConceptoContable, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoContabilizar, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=importeMX, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=PorcentajeImpuesto) Then MsgError = "No se pudo insertar la póliza" Exit For End If @@ -1536,91 +1455,96 @@ Partial Class Ventas_ClientesAbonar Next + If UsuarioActual.Empresa.Funcionalidad(590) = "1" AndAlso MsgError = "" Then '' si es empresa agrícola - Dim ImporteLiquidacion1 As Decimal = gvr.FCTextBox("TxtLiquidacionCol1").Text.ToDecimal - Dim ImporteLiquidacion2 As Decimal = gvr.FCTextBox("TxtLiquidacionCol2").Text.ToDecimal - Dim ImporteLiquidacion3 As Decimal = gvr.FCTextBox("TxtLiquidacionCol3").Text.ToDecimal - Dim ImporteLiquidacion4 As Decimal = gvr.FCTextBox("TxtLiquidacionCol4").Text.ToDecimal - Dim ImporteLiquidacion5 As Decimal = gvr.FCTextBox("TxtLiquidacionCol5").Text.ToDecimal - Dim ImporteLiquidacion6 As Decimal = gvr.FCTextBox("TxtLiquidacionCol6").Text.ToDecimal - Dim ImporteLiquidacion7 As Decimal = gvr.FCTextBox("TxtLiquidacionCol7").Text.ToDecimal + Dim ImporteLiq1 As Decimal = gvr.FCTextBox("TxtLiqCol1").Text.ToDecimal + Dim ImporteLiq2 As Decimal = gvr.FCTextBox("TxtLiqCol2").Text.ToDecimal + Dim ImporteLiq3 As Decimal = gvr.FCTextBox("TxtLiqCol3").Text.ToDecimal + Dim ImporteLiq4 As Decimal = gvr.FCTextBox("TxtLiqCol4").Text.ToDecimal + Dim ImporteLiq5 As Decimal = gvr.FCTextBox("TxtLiqCol5").Text.ToDecimal + Dim ImporteLiq6 As Decimal = gvr.FCTextBox("TxtLiqCol6").Text.ToDecimal + Dim ImporteLiq7 As Decimal = gvr.FCTextBox("TxtLiqCol7").Text.ToDecimal + Dim ImporteLiq8 As Decimal = gvr.FCTextBox("TxtLiqCol8").Text.ToDecimal - Dim CveClasificacionCol1 As Integer = 21267 - Dim CveClasificacionCol2 As Integer = 21229 - Dim CveClasificacionCol3 As Integer = 21520 - Dim CveClasificacionCol4 As Integer = 21519 - Dim CveClasificacionCol5 As Integer = 21547 - Dim CveClasificacionCol6 As Integer = 21572 - Dim CveClasificacionCol7 As Integer = 21571 + Dim CveClasificacionCol1 As Integer = 21514 'comisiones sobre venta + Dim CveClasificacionCol2 As Integer = 21916 ' manejo + Dim CveClasificacionCol3 As Integer = 21917 'servicios de inspección + Dim CveClasificacionCol4 As Integer = 21918 ' seguro liquidación + Dim CveClasificacionCol5 As Integer = 21561 ' gastos aduanales mex + Dim CveClasificacionCol6 As Integer = 21920 ' diveros + Dim CveClasificacionCol7 As Integer = 21919 'gastos aduanales usa + Dim CveClasificacionCol8 As Integer = 21211 'material Empaque - Dim CveSubProyectoLiquidacion As Integer = gvr.DataKey("CveSubProyecto").ToEntero + Dim CveSubProyectoLiquidacion As Integer = gvr.DataKey("CveSubProyecto").ToEntero + Dim CveConceptoLiquidacion As Integer = 51 + Dim ConceptoPartida As String = gvr.DataKey("SerieFolio") & " " & gvr.FCDropDownList("DdlTG").SelectedItem.Text - Dim CveConceptoLiquidacion As Integer = 51 - - If ImporteLiquidacion1 <> 0 Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiquidacion1, "Liquidacion Col 1", CveConceptoLiquidacion, "Liquidacion Col 1", Now, -1, -1, CveIE, gvr.FCHyperLink("HplF2").Text.ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiquidacion1 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol1, ImporteME:=If(CveMoneda > 1, ImporteLiquidacion1, 0)) Then - MsgError = "No se pudo insertar la póliza" - Exit For + If ImporteLiq1 <> 0 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq1, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq1 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol1, ImporteME:=If(CveMoneda > 1, ImporteLiq1, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then + MsgError = "No se pudo insertar la póliza" + Exit For + End If End If - End If - If ImporteLiquidacion2 <> 0 Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiquidacion2, "Liquidacion Col 2", CveConceptoLiquidacion, "Liquidacion Col 2", Now, -1, -1, CveIE, gvr.FCHyperLink("HplF2").Text.ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiquidacion2 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol2, ImporteME:=If(CveMoneda > 1, ImporteLiquidacion1, 0)) Then - MsgError = "No se pudo insertar la póliza" - Exit For + If ImporteLiq2 <> 0 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq2, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq2 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol2, ImporteME:=If(CveMoneda > 1, ImporteLiq2, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then + MsgError = "No se pudo insertar la póliza" + Exit For + End If End If - End If - If ImporteLiquidacion3 <> 0 Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiquidacion3, "Liquidacion Col 4", CveConceptoLiquidacion, "Liquidacion Col 3", Now, -1, -1, CveIE, gvr.FCHyperLink("HplF2").Text.ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiquidacion3 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol3, ImporteME:=If(CveMoneda > 1, ImporteLiquidacion1, 0)) Then - MsgError = "No se pudo insertar la póliza" - Exit For + If ImporteLiq3 <> 0 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq3, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq3 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol3, ImporteME:=If(CveMoneda > 1, ImporteLiq3, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then + MsgError = "No se pudo insertar la póliza" + Exit For + End If End If - End If - - If ImporteLiquidacion4 <> 0 Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiquidacion4, "Liquidacion Col 4", CveConceptoLiquidacion, "Liquidacion Col 4", Now, -1, -1, CveIE, gvr.FCHyperLink("HplF2").Text.ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiquidacion4 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol4, ImporteME:=If(CveMoneda > 1, ImporteLiquidacion1, 0)) Then - MsgError = "No se pudo insertar la póliza" - Exit For + If ImporteLiq4 <> 0 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq4, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq4 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol4, ImporteME:=If(CveMoneda > 1, ImporteLiq4, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then + MsgError = "No se pudo insertar la póliza" + Exit For + End If End If - End If - - - If ImporteLiquidacion5 <> 0 Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiquidacion5, "Liquidacion Col 5", CveConceptoLiquidacion, "Liquidacion Col 5", Now, -1, -1, CveIE, gvr.FCHyperLink("HplF2").Text.ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiquidacion5 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol5, ImporteME:=If(CveMoneda > 1, ImporteLiquidacion1, 0)) Then - MsgError = "No se pudo insertar la póliza" - Exit For + If ImporteLiq5 <> 0 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq5, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq5 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol5, ImporteME:=If(CveMoneda > 1, ImporteLiq5, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then + MsgError = "No se pudo insertar la póliza" + Exit For + End If End If - End If - If ImporteLiquidacion6 <> 0 Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiquidacion6, "Liquidacion Col 6", CveConceptoLiquidacion, "Liquidacion Col 6", Now, -1, -1, CveIE, gvr.FCHyperLink("HplF2").Text.ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiquidacion6 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol6, ImporteME:=If(CveMoneda > 1, ImporteLiquidacion1, 0)) Then - MsgError = "No se pudo insertar la póliza" - Exit For + If ImporteLiq6 <> 0 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq6, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq6 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol6, ImporteME:=If(CveMoneda > 1, ImporteLiq6, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then + MsgError = "No se pudo insertar la póliza" + Exit For + End If End If - End If - If ImporteLiquidacion7 <> 0 Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiquidacion7, "Liquidacion Col 7", CveConceptoLiquidacion, "Liquidacion Col 7", Now, -1, -1, CveIE, gvr.FCHyperLink("HplF2").Text.ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiquidacion7 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol7, ImporteME:=If(CveMoneda > 1, ImporteLiquidacion1, 0)) Then - MsgError = "No se pudo insertar la póliza" - Exit For + If ImporteLiq7 <> 0 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq7, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq7 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol7, ImporteME:=If(CveMoneda > 1, ImporteLiq7, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then + MsgError = "No se pudo insertar la póliza" + Exit For + End If End If + + 'If ImporteLiq8 <> 0 Then + ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq8, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq8 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol8, ImporteME:=If(CveMoneda > 1, ImporteLiq8, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then + ' MsgError = "No se pudo insertar la póliza" + ' Exit For + ' End If + 'End If + End If + If gvr.FCCheckBox("ChkGenerarNC").Checked AndAlso ObjFactura IsNot Nothing Then + ObjFactura.DescuentoProntoPago = gvr.DataKey("DescuentoProntoPago").ToDecimal() + ListaFacturasGenerarNC.Add(ObjFactura) End If - - - - End If - If gvr.FCCheckBox("ChkGenerarNC").Checked AndAlso ObjFactura IsNot Nothing Then - ObjFactura.DescuentoProntoPago = gvr.DataKey("DescuentoProntoPago").ToDecimal() - ListaFacturasGenerarNC.Add(ObjFactura) End If End If Next - If RblTipoPago.SelectedValue = "1" Then + If RblTipoPago.SelectedValue = "1" AndAlso MsgError = "" Then CveSubProyectoContabilizar = CveSubProyectoMaximo @@ -1639,17 +1563,7 @@ Partial Class Ventas_ClientesAbonar If MsgError = "" AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, If(CveMoneda = 1 AndAlso TxtTC.Visible, TxtImporte.Text.ToDecimal / TxtTC.Text.ToDecimal, TxtImporte.Text.ToDecimal), TxtObservaciones.Text, 204, TxtObservaciones.Text + If(CveMoneda = 2, $" TC:{tipoCambioPago}", ""), TxtFechaDocumento.Text, IdCuentaBancariaComplementaria, -1, CveIE, -1, -1, CveSubProyectoContabilizar, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=If(CveMoneda = 2, (TxtImporte.Text.Trim.ToDecimal * tipoCambioPago) - TxtImporte.Text.Trim.ToDecimal, TxtImporte.Text.Trim.ToDecimal), ImporteME:=If(CveMoneda = 2, TxtImporte.Text.Trim.ToDecimal, 0), TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then MsgError = "No se pudo insertar la póliza" End If - 'Else - ' If CveMoneda = 2 AndAlso CveMonedaFiltro = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES - ' tipoCambioPago = TxtTCDolares.Text.ToDecimal - ' ElseIf CveMoneda = 2 AndAlso CveMonedaFiltro = 2 Then - ' tipoCambioPago = TxtTCDolaresDolares.Text.ToDecimal - ' End If - ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtImporte.Text.ToDecimal, ObjIE.Folio, 30, TxtObservaciones.Text + If(CveMoneda = 2, $" TC:{tipoCambioPago}", ""), TxtFechaDocumento.Text, IdCuentaBancaria, -1, CveIE, -1, -1, CveSubProyectoContabilizar, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=If(CveMoneda = 2, TxtImporte.Text.Trim.ToDecimal * tipoCambioPago, TxtImporte.Text.Trim.ToDecimal), ImporteME:=If(CveMoneda = 2, TxtImporte.Text.ToDecimal, 0), TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then - ' MsgError = "No se pudo insertar la póliza" - ' End If - 'End If Else If CveMoneda = 2 AndAlso CveMonedaFiltro = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES tipoCambioPago = TxtTCDolares.Text.ToDecimal @@ -1663,7 +1577,7 @@ Partial Class Ventas_ClientesAbonar End If End If - If RblTipoPago.SelectedValue = "3" Then + If RblTipoPago.SelectedValue = "3" AndAlso MsgError = "" Then If CveMonedaPago = 2 Then 'rmf faltan las cuentas If IdCtaContMonedaComplementariaAnticipo > 0 Then @@ -1739,7 +1653,7 @@ Partial Class Ventas_ClientesAbonar MsgError = "No se insertó el encabezado" End If - If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso MsgError = "" Then If MsgError = "" Then If ListaFacturasGenerarNC.Count > 0 Then For Each Fac As Modelos.Factura In ListaFacturasGenerarNC @@ -1888,10 +1802,12 @@ Partial Class Ventas_ClientesAbonar If ObjConta IsNot Nothing Then ObjConta.Dispose() ObjEvento.Dispose() - LimpiaCampos() - UPVentas.Update() + If MsgError = "" Then + LimpiaCampos() + End If + End Sub #Region " N O T A - D E - C R E D I T O" @@ -3267,7 +3183,13 @@ Partial Class Ventas_ClientesAbonar If ChkLiquidacion.Checked Then - '16-23 + + GvCxC.Columns(4).Visible = False + GvCxC.Columns(5).Visible = False + GvCxC.Columns(6).Visible = False + GvCxC.Columns(7).Visible = False + + '16-24 GvCxC.Columns(16).Visible = True GvCxC.Columns(17).Visible = True GvCxC.Columns(18).Visible = True @@ -3276,10 +3198,18 @@ Partial Class Ventas_ClientesAbonar GvCxC.Columns(21).Visible = True GvCxC.Columns(22).Visible = True GvCxC.Columns(23).Visible = True + GvCxC.Columns(24).Visible = True + 'GvCxC.Columns(25).Visible = True GvCxC.Columns(26).Visible = False + GvCxC.Columns(27).Visible = False Else + GvCxC.Columns(4).Visible = True + GvCxC.Columns(5).Visible = True + GvCxC.Columns(6).Visible = True + GvCxC.Columns(7).Visible = True + GvCxC.Columns(16).Visible = False GvCxC.Columns(17).Visible = False GvCxC.Columns(18).Visible = False @@ -3288,8 +3218,11 @@ Partial Class Ventas_ClientesAbonar GvCxC.Columns(21).Visible = False GvCxC.Columns(22).Visible = False GvCxC.Columns(23).Visible = False + GvCxC.Columns(24).Visible = False + GvCxC.Columns(25).Visible = False GvCxC.Columns(26).Visible = True + GvCxC.Columns(27).Visible = True End If From 6fa5ad3633e97d486219bdf14c3e91120c8f05ea Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 12 Mar 2022 14:57:48 -0700 Subject: [PATCH 09/13] -- mejora visual --- Contabilidad/RegPrePolizaS.aspx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Contabilidad/RegPrePolizaS.aspx b/Contabilidad/RegPrePolizaS.aspx index 218ddd031..f53ec254c 100644 --- a/Contabilidad/RegPrePolizaS.aspx +++ b/Contabilidad/RegPrePolizaS.aspx @@ -606,8 +606,7 @@
<%----%> <%--
--%> - - +
TipoGasto From ef83e55fbc133069c5bf06c2db55dbad3386948c Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 12 Mar 2022 14:59:01 -0700 Subject: [PATCH 10/13] =?UTF-8?q?--=20prepoliza=20de=20garant=C3=ADa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inventarios/EntregaAlmacen.aspx.vb | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index db6535764..90a42351d 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -2333,8 +2333,23 @@ Partial Class Inventarios_EntregaAlmacen TotalGarantia += (RowGarantia("Cantidad").ToString().ToDecimal() * PU) Next - 'se registra - If ContabilizaMovimientoAlmacen(ObjConta, TxtFecha.Text.ToDate, HLFolio.Text, "EntregaAlmacen", CveMovimiento, CveMovimientoEntrada, TotalGarantia, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, True) <= 0 Then + ''se registra + 'If ContabilizaMovimientoAlmacen(ObjConta, TxtFecha.Text.ToDate, HLFolio.Text, "EntregaAlmacen", -1, CveMovimientoGarantia, TotalGarantia, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, True) <= 0 Then + ' ErrorMovInv = True + 'End If + + Dim CvePrePolizaTraspaso As Integer = ObjConta.AddPrePolizas("EA/Gar", 53, 0, 0, 1, TxtFecha.Text.ToDate, "Entrada Garantía", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + If CvePrePolizaTraspaso > 0 Then + + + If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaTraspaso, False, TotalGarantia, TxtObservaciones.Text, 68, TxtObservaciones.Text, TxtFecha.Text.ToDate, -1, -1, CveMovimientoAlmacen:=CveMovimientoGarantia, Contabilizable:=True, ImporteMX:=TotalGarantia) Then + ErrorMovInv = True + End If + + If Not ErrorMovInv AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePolizaTraspaso, True, TotalGarantia, TxtObservaciones.Text, 95, TxtObservaciones.Text, TxtFecha.Text.ToDate, -1, -1, CveMovimientoAlmacen:=CveMovimientoGarantia, Contabilizable:=True, ImporteMX:=TotalGarantia) Then + ErrorMovInv = True + End If + Else ErrorMovInv = True End If End If From cc3c29d17e792909155e628facfb39a566a3baeb Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 12 Mar 2022 14:59:24 -0700 Subject: [PATCH 11/13] -- mejoras --- Inventarios/RecepcionUsados.aspx.vb | 38 ++++++++++------------------- 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/Inventarios/RecepcionUsados.aspx.vb b/Inventarios/RecepcionUsados.aspx.vb index 69f7d02cf..7de97217d 100644 --- a/Inventarios/RecepcionUsados.aspx.vb +++ b/Inventarios/RecepcionUsados.aspx.vb @@ -1242,7 +1242,6 @@ Partial Class Inventarios_RecepcionUsados CveVenta = -1 End If - If Not ErrorMovInv AndAlso GenerarRNC AndAlso ObjRemisionNC IsNot Nothing Then CargaDTDetalleRNC() @@ -1255,6 +1254,12 @@ Partial Class Inventarios_RecepcionUsados 'Alert(Msg.ToString, If(Resp.CveVenta > 0, TipoMensaje.MsgInformacion, TipoMensaje.MsgAdvertencia)) CveVenta = Resp.CveVenta + If Resp.CveMovimientoUsado <= 0 Then + Msg.Append("Error al guardar los movimientos de usados") + ErrorMovInv = True + End If + + End If Dim Mensaje As String = "" @@ -1334,10 +1339,10 @@ Partial Class Inventarios_RecepcionUsados ' End If 'End If - 'GENERA LA PREPOLIZA DE ALMACEN VS EL CONCEPTO DE RNC - 'If Not ErrorMovInv Then - ' ErrorMovInv = Not GeneraPrePoliza(CveMovimiento, ObjInventario, ObjConta, True) - 'End If + ''GENERA LA PREPOLIZA DE ALMACEN VS EL CONCEPTO DE RNC + If Not ErrorMovInv Then + ErrorMovInv = Not GeneraPrePoliza(CveMovimiento, ObjInventario, ObjConta, True) + End If End If @@ -1433,12 +1438,12 @@ Partial Class Inventarios_RecepcionUsados If tmpCostos.Rows.Count > 0 Then Dim Concepto As String = ConceptoPoliza - Dim CvePrePoliza = ObjConta.AddPrePolizas("Inv_EntradaSalida", 74, DtCostos.SUM("Total"), DtCostos.SUM("Total"), 1, TxtFecha.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + Dim CvePrePoliza = ObjConta.AddPrePolizas("Inv_EntradaSalidaUsados", 74, DtCostos.SUMD("Total"), DtCostos.SUMD("Total"), 1, TxtFecha.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}").ToEntero Dim tCveConcepto As Integer = 278 For Each RowInv As DataRow In tmpCostos.Rows - ValorInventario = DtCostos.SUM("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").ToString.ToDecimal.RoundSQL + ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").ToString.ToDecimal.RoundSQL If tCveConcepto = 69 Then IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero End If @@ -2414,33 +2419,20 @@ Partial Class Inventarios_RecepcionUsados Me.ObjRemisionNC.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", String.Format("CveMoneda = {0} ", CveMoneda)) Me.ObjRemisionNC.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", String.Format("CveMoneda = {0} ", CveMoneda)) Me.ObjRemisionNC.TipoDocto = "RNC" - Me.ObjRemisionNC.RefDocto = "" - Me.ObjRemisionNC.CveMesa = -1 Dim Fecha As DateTime = TxtFecha.Text.ToDateTime() Me.ObjRemisionNC.Fecha = Fecha Me.ObjRemisionNC.CvePrePoliza = -1 Me.ObjRemisionNC.FechaPago = Fecha - Me.ObjRemisionNC.MotivoDescuento = "" Me.ObjRemisionNC.FechaEjecucion = Fecha Me.ObjRemisionNC.UsuarioCreo = UsuarioActual.Usuario - Me.ObjRemisionNC.CveCondicionEntrega = -1 - Me.ObjRemisionNC.CondicionEntrega = "" - Me.ObjRemisionNC.NumeroCuenta = "" Me.ObjRemisionNC.CondicionesPago = 0 Me.ObjRemisionNC.FormaPago = 0 - Me.ObjRemisionNC.PedidoContrato = "" - Me.ObjRemisionNC.NumeroContrato = "" - Me.ObjRemisionNC.DescripcionContrato = "" - Me.ObjRemisionNC.CveCorte = -1 Me.ObjRemisionNC.TipoDocumento = "Remisión" 'NUM 1- CARGO 2- BONIFICACION Me.ObjRemisionNC.Num1 = 1 'NUM 0- USADO 1- AJUSTE/GARANTIA Me.ObjRemisionNC.Num2 = RblUsadosAjuste.SelectedValue.ToEntero() - Me.ObjRemisionNC.Alfa1 = "" - Me.ObjRemisionNC.Alfa2 = "" - Me.ObjRemisionNC.Alfa3 = "" - Me.ObjRemisionNC.CveContrato = -1 + Me.ObjRemisionNC.ConvertirPesos = False Me.ObjRemisionNC.CveSubProyecto = CveSubProyecto Me.ObjRemisionNC.CveSubProyectoCobranza = CveSubProyecto @@ -2551,7 +2543,6 @@ Partial Class Inventarios_RecepcionUsados Return False End If - Dim Row As DataRow = Nothing Dim TotalCalculableImpuestos As Decimal = 0 PU = Math.Round(PU, 6) ' el precio unitario puede llevar hasta 6 decimales permitidos @@ -2572,8 +2563,6 @@ Partial Class Inventarios_RecepcionUsados Row("CvePS") = CvePS Row("Obs") = Obs - - Dim DrPS As DataRow = Nothing DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("") ' Estado = -1 @@ -2583,7 +2572,6 @@ Partial Class Inventarios_RecepcionUsados Return False End If - DrPS("IEPSPorcentaje") = 0 'verifica si tiene ventaminima From 1415bee60025a78f323fc1e4f85e1ad2e3376f6e Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 12 Mar 2022 15:00:07 -0700 Subject: [PATCH 12/13] - --- Bancos/PagoDeudor.aspx.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Bancos/PagoDeudor.aspx.cs b/Bancos/PagoDeudor.aspx.cs index abd9ee76f..382ffee0f 100644 --- a/Bancos/PagoDeudor.aspx.cs +++ b/Bancos/PagoDeudor.aspx.cs @@ -385,7 +385,7 @@ public partial class Bancos_PagoDeudor : ClsPaginas } } - // DEUDORES - DEUDORES COMPLEMENTARIA + // DEUDORES - DEUDORES COMPLEMENTARIAIDCtaContableDeudorPrestamo if (UsaComplementaria) //(IDCtaContableDeudorCompPrestamo > 0) { // DEUDOR COMPLEMENTARIA @@ -403,7 +403,7 @@ public partial class Bancos_PagoDeudor : ClsPaginas else { // DEUDOR - if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, false, TxtImportePrestamo.Text.ToDecimal(), Ref, CveConceptoContablePrestamo, Conc, DateTime.Now, IDCtaContableDeudorPrestamo, -1, CveIE, CveProveedor: DdlProveedorPrestamo.SelectedValue.ToEntero(), ImporteMX: TxtImportePrestamo.Text.ToDecimal() * tipoCambio, ImporteME: TxtImportePrestamo.Text.ToDecimal(), TipoCambio: tipoCambio, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) + if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, false, TxtImportePrestamo.Text.ToDecimal(), Ref, CveConceptoContablePrestamo, Conc, DateTime.Now, , -1, CveIE, CveProveedor: DdlProveedorPrestamo.SelectedValue.ToEntero(), ImporteMX: TxtImportePrestamo.Text.ToDecimal() * tipoCambio, ImporteME: TxtImportePrestamo.Text.ToDecimal(), TipoCambio: tipoCambio, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) { MsgError = "No se pudo insertar concepto de deudor"; } From 2a2b366d38eec4644163753710107c649bd7250c Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 12 Mar 2022 15:01:17 -0700 Subject: [PATCH 13/13] =?UTF-8?q?--=20mejora=20para=20agrupar=20en=20la=20?= =?UTF-8?q?p=C3=B3liza=20e141?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Compras/ReembolsosComprobaciones.aspx.vb | 228 ++++------------------- 1 file changed, 40 insertions(+), 188 deletions(-) diff --git a/Compras/ReembolsosComprobaciones.aspx.vb b/Compras/ReembolsosComprobaciones.aspx.vb index 552e6d08b..5aa158fa7 100644 --- a/Compras/ReembolsosComprobaciones.aspx.vb +++ b/Compras/ReembolsosComprobaciones.aspx.vb @@ -25,6 +25,15 @@ Partial Class Compras_ReembolsosComprobaciones ViewState("CveMoneda") = value End Set End Property + + Private Property CvePrePolizaComprobacion As Integer + Get + Return ViewState("CvePrePolizaComprobacion").ToString.ToEntero + End Get + Set(value As Integer) + ViewState("CvePrePolizaComprobacion") = value + End Set + End Property Private Property IdCuentaBancaria As Integer Get Return ViewState("IdCuentaBancaria").ToString.ToEntero @@ -316,7 +325,6 @@ Partial Class Compras_ReembolsosComprobaciones If dr IsNot Nothing Then CveMoneda = dr("CveMoneda").ToString.ToEntero IdCuentaBancaria = dr("IdCtaContable").ToString.ToEntero - If UsuarioActual.Empresa.UsaContabilidadSIG Then CveCuentaBancaria = dr("IdCtaContableSIG").ToString.ToEntero End If If HdnTipoTransaccion.Value = "Egs" Then @@ -383,9 +391,6 @@ Partial Class Compras_ReembolsosComprobaciones Protected Sub BtnIEGuardar_Click(sender As Object, e As EventArgs) Handles BtnIEGuardar.Click - - - Dim ValFechaDocumento As Boolean = False Dim FoliosFechasValFechaDocumento As New StringBuilder @@ -408,16 +413,11 @@ Partial Class Compras_ReembolsosComprobaciones FechaDocumento = TxtFechaPrePoliza.Text.ToDate End If - - Dim AnioFactura As Integer = FechaFactura.Year Dim MesFactura As Integer = FechaFactura.Month - - Dim AnioDocumento As Integer = FechaDocumento.Year Dim MesDocumento As Integer = FechaDocumento.Month - If AnioFactura > AnioDocumento Then FoliosFechasValFechaDocumento.AppendLine($"Folio: { gvRowVal.DataKey("SerieFolio") } fecha: {gvRowVal.DataKey("FechaCompra").ToDate.ToString("dd/MM/yyyy") }
") @@ -441,8 +441,6 @@ Partial Class Compras_ReembolsosComprobaciones Exit Sub End If - - If HdnCheque.Value.ToEntero > 0 And ChkChequeExcedente.Checked And TxtImporte.Text.ToDecimal = 0 Then Alert("El importe del cheque excedente debe ser mayor a cero", TipoMensaje.MsgAdvertencia) Exit Sub @@ -488,8 +486,6 @@ Partial Class Compras_ReembolsosComprobaciones Dim UsaSimplificacionCajaChica As Boolean = False If UsuarioActual.CveEmpresa.Contiene(119, 158) Then UsaSimplificacionCajaChica = True - - Dim concepto As String = "Compras: " For Each Gvr As GridViewRow In GvCxP.Rows @@ -502,7 +498,6 @@ Partial Class Compras_ReembolsosComprobaciones Next - If HdnCheque.Value.ToEntero > 0 AndAlso Not ChkReembolsarSinBancos.Checked Then CveIERegistrado = DDlCheques.SelectedValue.ToEntero @@ -514,7 +509,6 @@ Partial Class Compras_ReembolsosComprobaciones If ObjMov.GetRetCuenta(30, CveCajaChica) Then If ObjMov.DtResultados.Rows.Count > 0 Then IdCuentaBancaria = ObjMov.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero - If UsuarioActual.Empresa.UsaContabilidadSIG Then CveCuentaBancaria = ObjMov.DtResultados.Rows(0)("IdCtaContableSIG").ToString.ToEntero End If End If Dim FolioIENew = ObjIE.GetNextFolio(If(CveCajaChica > 0, CveCajaChica, CvePersonal), 8).ToString @@ -535,7 +529,11 @@ Partial Class Compras_ReembolsosComprobaciones CvePrePolizaIERegistrado = ObjMov.AddPrePolizas("Compras/Comprobaciones2", 9, TxtImporteVinculado.Text.ToDecimal, TxtImporteVinculado.Text.ToDecimal, CveMoneda, TxtFechaPrePoliza.Text.ToDate, If(TxtObservaciones.Text.Trim = "", concepto, TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) IdPoliza = drp("IdPoliza").ToString.ToEntero Else - CvePrePolizaIERegistrado = drp("CvePrePoliza").ToString.ToEntero + If UsuarioActual.CveEmpresa = 141 Then + CvePrePolizaIERegistrado = CvePrePolizaComprobacion + Else + CvePrePolizaIERegistrado = drp("CvePrePoliza").ToString.ToEntero + End If End If End If End If @@ -544,7 +542,6 @@ Partial Class Compras_ReembolsosComprobaciones If dr IsNot Nothing Then CveMoneda = dr("CveMoneda").ToString.ToEntero IdCuentaBancaria = dr("IdCtaContable").ToString.ToEntero - If UsuarioActual.Empresa.UsaContabilidadSIG Then CveCuentaBancaria = dr("IdCtaContableSIG").ToString.ToEntero End If If ChkChequeExcedente.Checked Then @@ -568,7 +565,6 @@ Partial Class Compras_ReembolsosComprobaciones If ObjMov.GetRetCuenta(30, CveCajaChica) Then If ObjMov.DtResultados.Rows.Count > 0 Then IdCuentaBancaria = ObjMov.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero - If UsuarioActual.Empresa.UsaContabilidadSIG Then CveCuentaBancaria = ObjMov.DtResultados.Rows(0)("IdCtaContableSIG").ToString.ToEntero End If End If Dim FolioIENew = ObjIE.GetNextFolio(If(CveCajaChica > 0, CveCajaChica, CvePersonal), 8).ToString @@ -597,7 +593,6 @@ Partial Class Compras_ReembolsosComprobaciones If ObjMov.GetRetCuenta(30, CveCajaChica) Then If ObjMov.DtResultados.Rows.Count > 0 Then IdCuentaBancaria = ObjMov.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero - If UsuarioActual.Empresa.UsaContabilidadSIG Then CveCuentaBancaria = ObjMov.DtResultados.Rows(0)("IdCtaContableSIG").ToString.ToEntero End If End If Dim FolioIENew = ObjIE.GetNextFolio(If(CveCajaChica > 0, CveCajaChica, CvePersonal), 8).ToString @@ -646,14 +641,12 @@ Partial Class Compras_ReembolsosComprobaciones If ObjMov.GetRetCuenta(30, CveCajaChica) Then If ObjMov.DtResultados.Rows.Count > 0 Then IdCuentaBancaria = ObjMov.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero - If UsuarioActual.Empresa.UsaContabilidadSIG Then CveCuentaBancaria = ObjMov.DtResultados.Rows(0)("IdCtaContableSIG").ToString.ToEntero End If End If Else If ObjMov.GetRetCuenta(29, CvePersonal) Then If ObjMov.DtResultados.Rows.Count > 0 Then IdCtaPersonal = ObjMov.DtResultados.Rows(0)("IdCtaContPersonal").ToString.ToEntero - If UsuarioActual.Empresa.UsaContabilidadSIG Then CveCuentaPersonal = ObjMov.DtResultados.Rows(0)("IdCtaContableSIG").ToString.ToEntero End If End If End If @@ -933,6 +926,31 @@ Partial Class Compras_ReembolsosComprobaciones End If End If End If + Case 5 + ConceptoContableRetIVAXAcreditar = 285 + ConceptoContableRetIVAAcreditable = 286 + If IdCtaRetIVA > 0 Then + IdCtaContableRetIVAXAcreditar = IdCtaRetIVA + ElseIf UsuarioActual.Empresa.Funcionalidad(577).ToEntero > 0 Then + IdCtaContableRetIVAXAcreditar = UsuarioActual.Empresa.Funcionalidad(577).ToEntero + Else + If ObjMov.GetRetCuenta(ConceptoContableRetIVAXAcreditar, UsuarioActual.CveEmpresa) Then + If ObjMov.DtResultados.Rows.Count > 0 Then + IdCtaContableRetIVAXAcreditar = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero + End If + End If + End If + If IdCtaRetIVA > 0 Then + IdCtaContableRetIVAAcreditable = IdCtaRetIVA + ElseIf UsuarioActual.Empresa.Funcionalidad(578).ToEntero > 0 Then + IdCtaContableRetIVAAcreditable = UsuarioActual.Empresa.Funcionalidad(578).ToEntero + Else + If ObjMov.GetRetCuenta(ConceptoContableRetIVAAcreditable, UsuarioActual.CveEmpresa) Then + If ObjMov.DtResultados.Rows.Count > 0 Then + IdCtaContableRetIVAAcreditable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero + End If + End If + End If End Select If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then If ImporteMovto = gvr.FCLiteral("LtlSaldo").Text.ToDouble Then @@ -959,84 +977,7 @@ Partial Class Compras_ReembolsosComprobaciones End If End If - 'If MsgError = "" AndAlso gvr.DataKey("RetISR").ToDecimal > 0 Then - ' Dim ConceptoContableRetISRXAcreditar = 0, ConceptoContableRetISRAcreditable = 0, IdCtaContableRetISRXAcreditar = 0, IdCtaContableRetISRAcreditable = 0 - ' Select Case gvr.DataKey("CveRetISRConcepto").ToEntero - ' Case 1 - ' ConceptoContableRetISRXAcreditar = 16 - ' ConceptoContableRetISRAcreditable = 23 - ' If IdCtaRetISR > 0 Then - ' IdCtaContableRetISRXAcreditar = IdCtaRetISR - ' ElseIf UsuarioActual.Empresa.Funcionalidad(315).ToEntero > 0 Then - ' IdCtaContableRetISRXAcreditar = UsuarioActual.Empresa.Funcionalidad(315).ToEntero - ' Else - ' If ObjMov.GetRetCuenta(ConceptoContableRetISRXAcreditar, UsuarioActual.CveEmpresa) Then - ' If ObjMov.DtResultados.Rows.Count > 0 Then - ' IdCtaContableRetISRXAcreditar = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero - ' End If - ' End If - ' End If - ' If IdCtaRetISR > 0 Then - ' IdCtaContableRetISRAcreditable = IdCtaRetISR - ' ElseIf UsuarioActual.Empresa.Funcionalidad(316).ToEntero > 0 Then - ' IdCtaContableRetISRAcreditable = UsuarioActual.Empresa.Funcionalidad(308).ToEntero - ' Else - ' If ObjMov.GetRetCuenta(ConceptoContableRetISRAcreditable, UsuarioActual.CveEmpresa) Then - ' If ObjMov.DtResultados.Rows.Count > 0 Then - ' IdCtaContableRetISRAcreditable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero - ' End If - ' End If - ' End If - ' Case 2 - ' ConceptoContableRetISRXAcreditar = 243 - ' ConceptoContableRetISRAcreditable = 244 - ' If IdCtaRetISR > 0 Then - ' IdCtaContableRetISRXAcreditar = IdCtaRetISR - ' ElseIf UsuarioActual.Empresa.Funcionalidad(317).ToEntero > 0 Then - ' IdCtaContableRetISRXAcreditar = UsuarioActual.Empresa.Funcionalidad(317).ToEntero - ' Else - ' If ObjMov.GetRetCuenta(ConceptoContableRetISRXAcreditar, UsuarioActual.CveEmpresa) Then - ' If ObjMov.DtResultados.Rows.Count > 0 Then - ' IdCtaContableRetISRXAcreditar = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero - ' End If - ' End If - ' End If - ' If IdCtaRetISR > 0 Then - ' IdCtaContableRetISRAcreditable = IdCtaRetISR - ' ElseIf UsuarioActual.Empresa.Funcionalidad(318).ToEntero > 0 Then - ' IdCtaContableRetISRAcreditable = UsuarioActual.Empresa.Funcionalidad(318).ToEntero - ' Else - ' If ObjMov.GetRetCuenta(ConceptoContableRetISRAcreditable, UsuarioActual.CveEmpresa) Then - ' If ObjMov.DtResultados.Rows.Count > 0 Then - ' IdCtaContableRetISRAcreditable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero - ' End If - ' End If - ' End If - ' End Select - ' If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then - ' If ImporteMovto = gvr.FCLiteral("LtlSaldo").Text.ToDouble Then - ' 'Agrego el RetISR - ' If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, gvr.DataKey("RetISR").ToDecimal, Referencia, ConceptoContableRetISRXAcreditar, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaContableRetISRXAcreditar, -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("RetISR").ToDecimal), ImporteMX:=(gvr.DataKey("RetISR").ToDecimal) * tipoCambio, CveCuenta:=CveCuentaIVAxAcreditar, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal) Then - ' MsgError = "Detalle" - ' End If - ' 'Agrego el RetISR - ' If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, gvr.DataKey("RetISR").ToDecimal, Referencia, ConceptoContableRetISRAcreditable, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaContableRetISRAcreditable, -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("RetISR").ToDecimal), ImporteMX:=(gvr.DataKey("RetISR").ToDecimal) * tipoCambio, CveCuenta:=CveCuentaIVAAcreditable, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal) Then - ' MsgError = "Detalle" - ' End If - ' End If - ' Else - ' 'Agrego el RetISR - ' If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, gvr.DataKey("RetISR").ToDecimal * PorcentajePago, Referencia, ConceptoContableRetISRXAcreditar, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaContableRetISRXAcreditar, -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("RetISR").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambio, CveCuenta:=CveCuentaIVAxAcreditar, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal) Then - ' MsgError = "Detalle" - ' End If - - ' 'Agrego el RetISR - ' If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, gvr.DataKey("RetISR").ToDecimal * PorcentajePago, Referencia, ConceptoContableRetISRAcreditable, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaContableRetISRAcreditable, -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("RetISR").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambio, CveCuenta:=CveCuentaIVAAcreditable, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal) Then - ' MsgError = "Detalle" - ' End If - ' End If - 'End If Dim SaldoExcedente As Double = gvr.FCTextBox("TxtSaldoExcedente").Text.ToDecimal @@ -1282,71 +1223,6 @@ Partial Class Compras_ReembolsosComprobaciones End If End If - 'If MsgError = "" AndAlso gvr.DataKey("RetISR").ToDecimal > 0 Then - ' Dim ConceptoContableRetISRXAcreditar = 0, ConceptoContableRetISRAcreditable = 0, IdCtaContableRetISRXAcreditar = 0, IdCtaContableRetISRAcreditable = 0 - ' Select Case gvr.DataKey("CveRetISRConcepto").ToEntero - ' Case 1 - ' ConceptoContableRetISRXAcreditar = 16 - ' ConceptoContableRetISRAcreditable = 23 - ' If IdCtaRetISR > 0 Then - ' IdCtaContableRetISRXAcreditar = IdCtaRetISR - ' ElseIf UsuarioActual.Empresa.Funcionalidad(315).ToEntero > 0 Then - ' IdCtaContableRetISRXAcreditar = UsuarioActual.Empresa.Funcionalidad(315).ToEntero - ' Else - ' If ObjMov.GetRetCuenta(ConceptoContableRetISRXAcreditar, UsuarioActual.CveEmpresa) Then - ' If ObjMov.DtResultados.Rows.Count > 0 Then - ' IdCtaContableRetISRXAcreditar = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero - ' End If - ' End If - ' End If - ' If IdCtaRetISR > 0 Then - ' IdCtaContableRetISRAcreditable = IdCtaRetISR - ' ElseIf UsuarioActual.Empresa.Funcionalidad(316).ToEntero > 0 Then - ' IdCtaContableRetISRAcreditable = UsuarioActual.Empresa.Funcionalidad(308).ToEntero - ' Else - ' If ObjMov.GetRetCuenta(ConceptoContableRetISRAcreditable, UsuarioActual.CveEmpresa) Then - ' If ObjMov.DtResultados.Rows.Count > 0 Then - ' IdCtaContableRetISRAcreditable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero - ' End If - ' End If - ' End If - ' Case 2 - ' ConceptoContableRetISRXAcreditar = 243 - ' ConceptoContableRetISRAcreditable = 244 - ' If IdCtaRetISR > 0 Then - ' IdCtaContableRetISRXAcreditar = IdCtaRetISR - ' ElseIf UsuarioActual.Empresa.Funcionalidad(317).ToEntero > 0 Then - ' IdCtaContableRetISRXAcreditar = UsuarioActual.Empresa.Funcionalidad(317).ToEntero - ' Else - ' If ObjMov.GetRetCuenta(ConceptoContableRetISRXAcreditar, UsuarioActual.CveEmpresa) Then - ' If ObjMov.DtResultados.Rows.Count > 0 Then - ' IdCtaContableRetISRXAcreditar = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero - ' End If - ' End If - ' End If - ' If IdCtaRetISR > 0 Then - ' IdCtaContableRetISRAcreditable = IdCtaRetISR - ' ElseIf UsuarioActual.Empresa.Funcionalidad(318).ToEntero > 0 Then - ' IdCtaContableRetISRAcreditable = UsuarioActual.Empresa.Funcionalidad(318).ToEntero - ' Else - ' If ObjMov.GetRetCuenta(ConceptoContableRetISRAcreditable, UsuarioActual.CveEmpresa) Then - ' If ObjMov.DtResultados.Rows.Count > 0 Then - ' IdCtaContableRetISRAcreditable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero - ' End If - ' End If - ' End If - ' End Select - - ' 'Agrego el RetISR - ' If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaExcedente, False, gvr.DataKey("RetISR").ToDecimal * PorcentajePago, Referencia, ConceptoContableRetISRXAcreditar, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaContableRetISRXAcreditar, -1, CveIE:=CveIEExcedente, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("RetISR").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambio, CveCuenta:=CveCuentaIVAxAcreditar, CvePrePolizaOriginal:=CvePrePolizaExcedente, CvePersonal:=CvePersonal) Then - ' MsgError = "Detalle" - ' End If - - ' 'Agrego el RetISR - ' If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaExcedente, True, gvr.DataKey("RetISR").ToDecimal * PorcentajePago, Referencia, ConceptoContableRetISRAcreditable, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaContableRetISRAcreditable, -1, CveIE:=CveIEExcedente, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("RetISR").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambio, CveCuenta:=CveCuentaIVAAcreditable, CvePrePolizaOriginal:=CvePrePolizaExcedente, CvePersonal:=CvePersonal) Then - ' MsgError = "Detalle" - ' End If - 'End If End If @@ -1408,31 +1284,6 @@ Partial Class Compras_ReembolsosComprobaciones AutoConta = False End If - If AutoConta And MsgError.Trim = "" AndAlso UsuarioActual.Empresa.UsaContabilidadSIG Then - If CvePrePolizaIERegistrado > 0 Then - If UsuarioActual.Empresa.UsaContabilidadSIG AndAlso CveCuentaPersonal > 0 Then - If UsuarioActual.Empresa.UsaContabilidadSIG AndAlso CveCuentaProveedor > 0 Then - - Else - MsgError = "No tiene cuenta contable SIG de proveedor" - End If - Else - MsgError = "No tiene cuenta contable SIG de personal" - End If - End If - - If ChkChequeExcedente.Checked Then - If UsuarioActual.Empresa.UsaContabilidadSIG AndAlso CveCuentaBancaria > 0 Then - If UsuarioActual.Empresa.UsaContabilidadSIG AndAlso CveCuentaProveedor > 0 Then - - Else - MsgError = "No tiene cuenta contable SIG de proveedor" - End If - Else - MsgError = "No tiene Cuenta contable SIG Bancaria" - End If - End If - End If 'Conta ContPAQ AUTOMATICA If UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError.Trim = "" Then @@ -1626,6 +1477,7 @@ Partial Class Compras_ReembolsosComprobaciones ObjMovtos.GetCxPPersonalCajaChica(UsuarioActual.CveEmpresa, CvePersonal, CveCajaChica, If(TxtNumeroReembolso.Text.Trim = "", "-1", TxtNumeroReembolso.Text.Trim)) DtDatos = ObjMovtos.DtResultados.FiltraParametros("Saldo > 0") GvCxP.DataSource = DtDatos + CvePrePolizaComprobacion = DtDatos.MAX("CvePrePolizaComprobacion").ToEntero 'Limpia Ddl Chequesventas DDlCheques.Items.Clear()