From 092d9d20cdc8496a88de2eb59a227a14764bd0ca Mon Sep 17 00:00:00 2001 From: Rene Molina Date: Thu, 16 Jan 2020 21:28:51 -0700 Subject: [PATCH 1/3] - --- Bancos/FluctuacionCambiaria.aspx | 239 ++++++++++++++++++++++- Bancos/FluctuacionCambiaria.aspx.vb | 33 ++++ Compras/ReembolsosComprobaciones.aspx.vb | 2 +- Inventarios/RecepcionUsados.aspx.vb | 2 +- Ventas/ProductosServicios.aspx | 4 +- Ventas/Ventas.aspx.vb | 59 ++++-- 6 files changed, 304 insertions(+), 35 deletions(-) diff --git a/Bancos/FluctuacionCambiaria.aspx b/Bancos/FluctuacionCambiaria.aspx index 92a134d6d..91114d43c 100644 --- a/Bancos/FluctuacionCambiaria.aspx +++ b/Bancos/FluctuacionCambiaria.aspx @@ -3,6 +3,112 @@ + @@ -40,7 +146,7 @@
TC:
- +
@@ -59,6 +165,62 @@ + + +
+
+
+

PÉRDIDA

+
+ +
+ MXN + + + +
+
+
+
+
+
+

GANANCIA

+
+ +
+
+
+ MXN + + + +
+
+
+
+
+
+
+
+

PÉRDIDA O GANANCIA

+
+ +
+
+
+ MXN + + + +
+
+
+
+
+
+
+
+
@@ -81,6 +243,62 @@
+ + +
+
+
+

PÉRDIDA

+
+ +
+ MXN + + + +
+
+
+
+
+
+

GANANCIA

+
+ +
+
+
+ MXN + + + +
+
+
+
+
+
+
+
+

+
+ +
+
+
+ MXN + + + +
+
+
+
+
+
+
+
+
@@ -95,8 +313,9 @@ - - + + + @@ -115,9 +334,9 @@ EmptyDataText="No se Encontraron Cuentas Bancarias." ToolTip="Listado de Cuentas Bancarias" CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None"> - - - + + + @@ -140,10 +359,10 @@ + CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None"> - + @@ -152,7 +371,7 @@
-
+
@@ -187,7 +406,7 @@ CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None"> - + diff --git a/Bancos/FluctuacionCambiaria.aspx.vb b/Bancos/FluctuacionCambiaria.aspx.vb index ad9f24a9d..33e2ed15a 100644 --- a/Bancos/FluctuacionCambiaria.aspx.vb +++ b/Bancos/FluctuacionCambiaria.aspx.vb @@ -71,6 +71,20 @@ Partial Class Bancos_FluctuacionCambiaria If ObjBancos.GetFluctuaciones(TxtFecha.Text.ToDate, 1, UsuarioActual.CveEmpresa) Then GvCompras.DataSource = ObjBancos.DtResultados 'LblTotalCompras.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero + Dim Perdida As DataTable = ObjBancos.DtResultados.FiltraParametros("GananciaPerdida = 'PERDIDA' AND TipoRow = 2") + Dim Ganancias As DataTable = ObjBancos.DtResultados.FiltraParametros("GananciaPerdida = 'GANANCIA' AND TipoRow = 2") + + Dim PerdidaAux As Double = Perdida.SUM("Fluctuacion").Abs + Dim GanaciaAux As Double = Ganancias.SUM("Fluctuacion") + + Dim Final As Double = GanaciaAux - PerdidaAux + + IImagenResultado.Attributes("class") = If(Final > 0, "widget-thumb-icon bg-green-jungle fa fa-usd", "widget-thumb-icon bg-red fa fa-usd") + + LtIndicador_ExistenciaPerdida.Text = PerdidaAux.ToString.FormatoNumero + LtIndicador_ValorPesosGanancia.Text = GanaciaAux.ToString.FormatoNumero + LtIndicador_CPPesosFinal.Text = Final.Abs.ToString.FormatoNumero + LblTotal = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero Else GvCompras.DataSource = Nothing @@ -78,6 +92,7 @@ Partial Class Bancos_FluctuacionCambiaria End If ObjBancos.Dispose() GvCompras.DataBind() + UpIndicadores.Visible = True If GvCompras.Rows.Count > 0 Then GvCompras.Rows(GvCompras.Rows.Count - 1).CssClass = "SubTotales2" End If @@ -88,7 +103,25 @@ Partial Class Bancos_FluctuacionCambiaria LblTotalVentas.Text = "0.00" If ObjBancos.GetFluctuaciones(TxtFecha.Text.ToDate, 2, UsuarioActual.CveEmpresa) Then GvVentas.DataSource = ObjBancos.DtResultados + + Dim Perdida As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion < 0") + Dim Ganancias As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion > 0") + + Dim PerdidaAux As Double = Perdida.SUM("Fluctuacion").Abs + Dim GanaciaAux As Double = Ganancias.SUM("Fluctuacion") + + Dim Final As Double = GanaciaAux - PerdidaAux + + IImagenFinalVentas.Attributes("class") = If(Final > 0, "widget-thumb-icon bg-green-jungle fa fa-usd", "widget-thumb-icon bg-red fa fa-usd") + + LtIndicador_PerdidasVentas.Text = PerdidaAux.ToString.FormatoNumero + LtIndicador_GanaciaVentas.Text = GanaciaAux.ToString.FormatoNumero + LtIndicador_FinalVentas.Text = Final.ToString.FormatoNumero + LblVentasPerdidaGanancia.Text = If(Final < 0, "Pérdida", "Ganancia") + LblTotalVentas.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero + + UpIndicadoresVentas.Visible = True Else GvVentas.DataSource = Nothing Alert("Ocurrio un error al cargar las compras", TipoMensaje.MsgAdvertencia) diff --git a/Compras/ReembolsosComprobaciones.aspx.vb b/Compras/ReembolsosComprobaciones.aspx.vb index 6d89b4c77..bde535395 100644 --- a/Compras/ReembolsosComprobaciones.aspx.vb +++ b/Compras/ReembolsosComprobaciones.aspx.vb @@ -517,7 +517,7 @@ Partial Class Compras_ReembolsosComprobaciones End If End If Dim FolioIENew = ObjIE.GetNextFolio(If(CveCajaChica > 0, CveCajaChica, CvePersonal), 8).ToString - CveIECajaChica = ObjIE.AddBancos_IE(CveCajaChica, 8, TxtFechaDocumento.Text.Trim.ToDate, FolioIENew, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), TxtImporte.Text.ToDecimal, CveMoneda, 0, TxtObservaciones.Text.Trim, "", False, False, -1, CvePrePolizaIERegistrado, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked Or CveCajaChica > 0, True, False)) + CveIECajaChica = ObjIE.AddBancos_IE(CveCajaChica, 8, If(ChkReembolsarSinBancos.Checked, TxtFechaPrePoliza.Text.ToDate, TxtFechaDocumento.Text.Trim.ToDate), FolioIENew, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), TxtImporte.Text.ToDecimal, CveMoneda, 0, TxtObservaciones.Text.Trim, "", False, False, -1, CvePrePolizaIERegistrado, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked Or CveCajaChica > 0, True, False)) 'AGREGO PREPOLIZA IE BANCOS If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaIERegistrado, True, TxtImporte.Text.ToDecimal, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), 30, TxtObservaciones.Text, TxtFechaDocumento.Text.ToDate, IdCuentaBancaria, -1, CveIE:=CveIECajaChica, ImporteME:=If(tipoCambio = 1, 0, TxtImporte.Text.ToDecimal), ImporteMX:=TxtImporte.Text.ToDecimal * tipoCambio) Then MsgError = "Error al registrar detalle de concepto bancario" diff --git a/Inventarios/RecepcionUsados.aspx.vb b/Inventarios/RecepcionUsados.aspx.vb index e85f433a3..e33286260 100644 --- a/Inventarios/RecepcionUsados.aspx.vb +++ b/Inventarios/RecepcionUsados.aspx.vb @@ -2646,7 +2646,7 @@ Partial Class Inventarios_RecepcionUsados Dim ObjAcum As New ClsAcumuladores If ObjAcum.GarantiasMesesGet(-1, UsuarioActual.CveEmpresa, CveMarca, DdlTipoUso.SelectedValue.ToEntero, TxtMesesUso.Text.ToEntero) Then If ObjAcum.DtResultados.Rows.Count > 0 Then - TxtPorcentajeAjuste.Text = (ObjAcum.DtResultados.Rows(0)("Valor").ToString.ToDouble / 100).ToString + TxtPorcentajeAjuste.Text = (ObjAcum.DtResultados.Rows(0)("Valor").ToString.ToDouble / 100.0).FormatoNumero TxtImporteAjuste.Text = (TxtPorcentajeAjuste.Text.ToDecimal * TxtPUFactura.Text.ToDecimal).FormatoNumero diff --git a/Ventas/ProductosServicios.aspx b/Ventas/ProductosServicios.aspx index bdb588b42..960263d11 100644 --- a/Ventas/ProductosServicios.aspx +++ b/Ventas/ProductosServicios.aspx @@ -568,8 +568,8 @@
-
- +
+
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index c0505bbe8..f4cac066a 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -4701,7 +4701,12 @@ Partial Class Ventas LblTelefono.Text = ObjCliente.Telefono LblRetIVA.Text = ObjCliente.RetIVA.ToString.FormatoNumero(5) LblRetISR.Text = ObjCliente.RetISR.ToString.FormatoNumero(5) - If UsuarioActual.Empresa.MostrarRetISR AndAlso ObjCliente.RetISR > 0 Then TrRetISR.Style.Add("display", "none") + If UsuarioActual.Empresa.MostrarRetISR AndAlso ObjCliente.RetISR > 0 Then + ' TrRetISR.Style.Add("display", "none") + TrRetISR.Visible = True + Else + TrRetISR.Visible = False + End If ViewState("ClienteRetIVA") = ObjCliente.RetIVA / 100 ViewState("ClienteRetISR") = ObjCliente.RetISR / 100 @@ -5935,7 +5940,7 @@ Partial Class Ventas If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then ClienteRetIVA = 0.0D If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then - ClienteRetIVA = 0.1D + ClienteRetIVA = 0.106667D ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then ClienteRetIVA = 0.04D ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso CBool(TmpDT.Rows(e.RowIndex)("EsOutSourcing").ToString()) Then @@ -6908,7 +6913,8 @@ Partial Class Ventas 'ENVIAR POLIZA VIRTUAL If ErrorList.Count = 0 Then If UsuarioActual.Empresa.Funcionalidad(576) = "1" Then - GeneraPolizaVentaWS(ObjFactura) + Dim TipoPoliza As Integer = 1 + GeneraPolizaVentaWS(ObjFactura, TipoPoliza) End If End If @@ -14255,7 +14261,7 @@ Partial Class Ventas If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then ClienteRetIVA = 0.0D If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then - ClienteRetIVA = 0.1D + ClienteRetIVA = 0.106667D ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then ClienteRetIVA = 0.04D ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso CBool(DrPS("EsOutSourcing").ToString()) Then @@ -15472,7 +15478,7 @@ Partial Class Ventas If ConSalida AndAlso Not OcurrioError Then If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then - OcurrioError = Not GenerarMovimientoAlmacenVirtual(CveRemision, ObjInventario, ObjFactura) + OcurrioError = GenerarMovimientoAlmacenVirtual(CveRemision, ObjInventario, ObjFactura) End If If Not OcurrioError Then @@ -15739,30 +15745,40 @@ Partial Class Ventas Try Dim CveMovimientoVirtual As Integer = -1 Dim CveAlmacenVirtual As Integer = -1 - Dim CveConceptoMovimientoVirtual As Integer = 3 + Dim CveConceptoMovimientoVirtual As Integer = 36 Dim DtPSVirtual As DataTable = Nothing Dim DtTamanios As DataTable = Nothing Dim CveMovimientoEntradaDev As Integer = -1 If ObjInventario.GetInv_Mov(CveRemision, UsuarioActual.CveEmpresa) Then - Dim RowMovimiento As DataRow = ObjInventario.DtResultados.FiltroPrimero("CvePS IS NULL AND CveTipoAlmacen = 24 AND CveConcepto = 2 AND CveVenta > 0") + Dim RowMovimiento As DataRow = ObjInventario.DtResultados.FiltroPrimero("CvePS IS NULL AND ((CveTipoAlmacen = 24 AND CveConcepto = 2) OR (CveTipoAlmacen = 1 AND CveConcepto = 8)) AND CveVenta > 0") + + If RowMovimiento IsNot Nothing Then + CveMovimientoEntradaDev = RowMovimiento("CveMovimiento").ToString().ToEntero() + CveAlmacenVirtual = RowMovimiento("CveAlmacen").ToString().ToEntero() + Else + OcurrioError = True + End If - CveMovimientoEntradaDev = RowMovimiento("CveMovimiento").ToString().ToEntero() - CveAlmacenVirtual = RowMovimiento("CveAlmacen").ToString().ToEntero() Else OcurrioError = True End If - - 'CARGA CONCEPTOS DEVUELTOS EN LA VENTA - If ObjInventario.GetMovimientosDetalle(CveMovimientoEntradaDev, UsuarioActual.CveEmpresa) Then + If ObjInventario.GetMovimientosDetalleVirtual(CveMovimientoEntradaDev, UsuarioActual.CveEmpresa) Then DtPSVirtual = ObjInventario.DtResultados.Copy() Else OcurrioError = True End If + 'CARGA CONCEPTOS DEVUELTOS EN LA VENTA + 'If ObjInventario.GetMovimientosDetalle(CveMovimientoEntradaDev, UsuarioActual.CveEmpresa) Then + ' DtPSVirtual = ObjInventario.DtResultados.Copy() + 'Else + ' OcurrioError = True + 'End If + If Not OcurrioError AndAlso DtPSVirtual.Rows.Count > 0 Then - CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, CveConceptoMovimientoVirtual, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, ObjFactura.CveVenta, -1, -1, Modulo:="Vta/V") + CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, CveConceptoMovimientoVirtual, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, ObjFactura.CveVenta, -1, -1, Modulo:="Vta/V", CveMovimientoRelacionado:=CveMovimientoEntradaDev) If CveMovimientoVirtual > 0 Then For Each RowUsado As DataRow In DtPSVirtual.Rows @@ -15787,7 +15803,7 @@ Partial Class Ventas OcurrioError = True End Try - Return Not OcurrioError + Return OcurrioError End Function Private Function SalidaAlmacenMateriales(ByRef ObjInventario As ClsInventarios, CveOS As Integer, ByRef ObjConta As ClsContabilidad, ConSalida As Boolean, ConceptoMovimiento As Integer) As Boolean @@ -23921,22 +23937,23 @@ Partial Class Ventas GvCodigosUnicos.DataBind() End If End Sub - Protected Sub GeneraPolizaVentaWS(ObjFactura As Modelos.Factura) + Protected Sub GeneraPolizaVentaWS(ObjFactura As Modelos.Factura, TipoPoliza As Integer) + 'TipoPoliza: 01 Venta, 02 Ajuste, 03 Garantía Try For Each Row As GridViewRow In GvCodigosUnicos.Rows If Row.RowType = DataControlRowType.DataRow Then Dim obj As New Modelos.MPolizaVentaWS 'DATOS DEL CLIENTE obj.customer_name = ObjFactura.Cliente.Nombre - obj.customer_last_name1 = "" + obj.customer_last_name1 = "." obj.customer_last_name2 = "" obj.customer_birthday = Nothing obj.customer_phone = ObjFactura.Cliente.Telefono obj.customer_email = ObjFactura.Cliente.Mail obj.customer_gender = "03" 'OTRO GENERO obj.customer_advertising = False - obj.customer_car_brand = "00" - obj.customer_car_model = "00" + obj.customer_car_brand = "01" + obj.customer_car_model = "01" obj.customer_car_year = ObjFactura.Fecha.Year 'DATOS DE VENTA @@ -23946,12 +23963,12 @@ Partial Class Ventas obj.sale_type_service = "02" 'COMERCIAL obj.sale_total = ObjFactura.Total obj.sale_discount = ObjFactura.Descuento - obj.sale_id = String.Format("{0}{1}{2}", ObjFactura.Serie, ObjFactura.Folio, ObjFactura.CveVenta) + obj.sale_id = ObjFactura.CveVenta.ToString 'DATOS DEL PRODUCTO obj.product_code = Row.DataKey("IdProductoPolizaVirtual").ToString() obj.product_unique_code = Row.FCTextBox("TxtCodigoUnico").Text 'se indique el código único de la batería. (SERIE LOTE) - obj.product_sale_type = "01 " 'VENTA + obj.product_sale_type = "0" & TipoPoliza 'VENTA Dim FechaUsado As DateTime = Row.DataKey("FechaAjuste").ToString().ToDateTime() @@ -24052,7 +24069,7 @@ Partial Class Ventas For Each RowServicio As DataRow In TmpDT.Rows Dim ClienteRetIVA = 0.0D If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then - ClienteRetIVA = 0.1D + ClienteRetIVA = 0.106667D ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then ClienteRetIVA = 0.04D ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso CBool(RowServicio("EsOutSourcing").ToString()) Then From bb1444967824151ec90bacaaf5c070e7e5e2efc4 Mon Sep 17 00:00:00 2001 From: Rene Molina Date: Sat, 18 Jan 2020 14:13:58 -0700 Subject: [PATCH 2/3] - cmabios fluctuaci[on - cxc, guarde sesion sucursal --- Bancos/FluctuacionCambiaria.aspx | 12 ++++--- Bancos/FluctuacionCambiaria.aspx.vb | 35 ++++++++++++--------- Bancos/RepCxCCliente.aspx.vb | 2 ++ Inventarios/PopUpExistenciasAlmacen.aspx.vb | 8 ++++- Ventas/ClientesAbonar.aspx.vb | 3 +- 5 files changed, 40 insertions(+), 20 deletions(-) diff --git a/Bancos/FluctuacionCambiaria.aspx b/Bancos/FluctuacionCambiaria.aspx index 91114d43c..47d0375be 100644 --- a/Bancos/FluctuacionCambiaria.aspx +++ b/Bancos/FluctuacionCambiaria.aspx @@ -202,7 +202,7 @@
-

PÉRDIDA O GANANCIA

+

@@ -227,15 +227,16 @@

+ - + <%----%> @@ -313,7 +314,7 @@ - + @@ -364,6 +365,7 @@ + @@ -386,8 +388,10 @@ + + diff --git a/Bancos/FluctuacionCambiaria.aspx.vb b/Bancos/FluctuacionCambiaria.aspx.vb index 33e2ed15a..1855b24b4 100644 --- a/Bancos/FluctuacionCambiaria.aspx.vb +++ b/Bancos/FluctuacionCambiaria.aspx.vb @@ -71,8 +71,8 @@ Partial Class Bancos_FluctuacionCambiaria If ObjBancos.GetFluctuaciones(TxtFecha.Text.ToDate, 1, UsuarioActual.CveEmpresa) Then GvCompras.DataSource = ObjBancos.DtResultados 'LblTotalCompras.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero - Dim Perdida As DataTable = ObjBancos.DtResultados.FiltraParametros("GananciaPerdida = 'PERDIDA' AND TipoRow = 2") - Dim Ganancias As DataTable = ObjBancos.DtResultados.FiltraParametros("GananciaPerdida = 'GANANCIA' AND TipoRow = 2") + Dim Perdida As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion < 0 ") + Dim Ganancias As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion > 0 ") Dim PerdidaAux As Double = Perdida.SUM("Fluctuacion").Abs Dim GanaciaAux As Double = Ganancias.SUM("Fluctuacion") @@ -84,6 +84,7 @@ Partial Class Bancos_FluctuacionCambiaria LtIndicador_ExistenciaPerdida.Text = PerdidaAux.ToString.FormatoNumero LtIndicador_ValorPesosGanancia.Text = GanaciaAux.ToString.FormatoNumero LtIndicador_CPPesosFinal.Text = Final.Abs.ToString.FormatoNumero + LblComprasPerdidaGanancia.Text = If(Final > 0, "Ganancia", "Pérdida") LblTotal = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero Else @@ -107,8 +108,8 @@ Partial Class Bancos_FluctuacionCambiaria Dim Perdida As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion < 0") Dim Ganancias As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion > 0") - Dim PerdidaAux As Double = Perdida.SUM("Fluctuacion").Abs - Dim GanaciaAux As Double = Ganancias.SUM("Fluctuacion") + Dim PerdidaAux As Double = Perdida.SUM("Fluctuacion", "Fluctuacion < 0").Abs + Dim GanaciaAux As Double = Ganancias.SUM("Fluctuacion", "Fluctuacion > 0") Dim Final As Double = GanaciaAux - PerdidaAux @@ -250,10 +251,12 @@ Partial Class Bancos_FluctuacionCambiaria CveConceptoContable = 64 CveCuenta = CveCuentaGanancia idCta = IdCtaGanancia + TipoMovto = True Else CveConceptoContable = 65 CveCuenta = CveCuentaPerdida idCta = idCtaPerdida + TipoMovto = False End If If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta) Then ErrorRegistrar = True @@ -267,7 +270,7 @@ Partial Class Bancos_FluctuacionCambiaria 'movimiento de complementaria - If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), 201, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total, CveCuenta:=CveCuentaComplementaria) Then + If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), 201, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total, CveCuenta:=CveCuentaComplementaria) Then ErrorRegistrar = True Exit For End If @@ -275,7 +278,8 @@ Partial Class Bancos_FluctuacionCambiaria If Not ErrorRegistrar Then Conta.Commit() - Alert("La Fluctuación se ha generado", TipoMensaje.MsgInformacion) + Alert(String.Format("La Fluctuación se ha generado
Ver PrePóliza", CvePrePoliza), TipoMensaje.MsgInformacion) + Else Conta.RollBack() End If @@ -308,7 +312,7 @@ Partial Class Bancos_FluctuacionCambiaria Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias Total = LblTotalVentas.Text.ToDecimal - If Total < 0 Then + If Total > 0 Then CveConceptoContable = 64 CveCuenta = CveCuentaGanancia TipoMovto = True @@ -327,7 +331,7 @@ Partial Class Bancos_FluctuacionCambiaria 'saco las cuentas de pérdida y ganancia For Each gvr As GridViewRow In GvVentas.Rows - Total = gvr.DataKey("Fluctuacion").ToDecimal + Total = -gvr.DataKey("Fluctuacion").ToDecimal If gvr.DataKey("CveIE").ToEntero > 0 AndAlso gvr.DataKey("CveVenta").ToEntero < 0 Then CveConconceptoCliente = 226 @@ -336,7 +340,7 @@ Partial Class Bancos_FluctuacionCambiaria End If 'movimiento de complementaria - If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), CveConconceptoCliente, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveVenta:=gvr.DataKey("CveVenta").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total, CveCuenta:=CveCuentaComplementaria, CveIE:=gvr.DataKey("CveIE").ToEntero) Then + If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), CveConconceptoCliente, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveVenta:=gvr.DataKey("CveVenta").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total, CveCuenta:=CveCuentaComplementaria, CveIE:=gvr.DataKey("CveIE").ToEntero) Then ErrorRegistrar = True Exit For End If @@ -344,7 +348,8 @@ Partial Class Bancos_FluctuacionCambiaria If Not ErrorRegistrar Then Conta.Commit() - Alert("La Fluctuación se ha generado", TipoMensaje.MsgInformacion) + Alert(String.Format("La Fluctuación se ha generado
Ver PrePóliza", CvePrePoliza), TipoMensaje.MsgInformacion) + Else Conta.RollBack() End If @@ -432,7 +437,7 @@ Partial Class Bancos_FluctuacionCambiaria If Not ErrorRegistrar And SeContabilizo Then Conta.Commit() - Alert(String.Format("La Fluctuación se ha generado
Ver Póliza", CvePrePoliza), TipoMensaje.MsgInformacion) + Alert(String.Format("La Fluctuación se ha generado
Ver PrePóliza", CvePrePoliza), TipoMensaje.MsgInformacion) CargaDatosCuentas() Else Conta.RollBack() @@ -624,8 +629,8 @@ Partial Class Bancos_FluctuacionCambiaria Dim idCtaPerdida, IdCtaGanancia As Integer Dim TipoMovto As Boolean = False Dim CveConceptoContable As Integer = 0 - Dim CveCuentaComplementaria As Integer = 0 - Dim IdCtaComplementaria As Integer = 0 + Dim CveCuentaComplementaria As Integer = 55206 + Dim IdCtaComplementaria As Integer = 1081 Dim ErrorRegistrar As Boolean = False CveCuentaPerdida = 0 '55379 @@ -640,10 +645,12 @@ Partial Class Bancos_FluctuacionCambiaria CveConceptoContable = 64 CveCuenta = CveCuentaGanancia idCta = IdCtaGanancia + TipoMovto = True Else CveConceptoContable = 65 CveCuenta = CveCuentaPerdida idCta = idCtaPerdida + TipoMovto = False End If If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta) Then ErrorRegistrar = True @@ -657,7 +664,7 @@ Partial Class Bancos_FluctuacionCambiaria 'movimiento de complementaria - If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), 202, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total, CveCuenta:=CveCuentaComplementaria) Then + If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), 202, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total, CveCuenta:=CveCuentaComplementaria) Then ErrorRegistrar = True Exit For End If diff --git a/Bancos/RepCxCCliente.aspx.vb b/Bancos/RepCxCCliente.aspx.vb index 7539c52c7..c10e276d1 100644 --- a/Bancos/RepCxCCliente.aspx.vb +++ b/Bancos/RepCxCCliente.aspx.vb @@ -34,6 +34,7 @@ Partial Class Bancos_RepCxCCliente 'DdlSubProyecto.SelectedValueExist(UsuarioActual.CveSucursal.ToString) '[IPP] 8 Enero 2018 - Se quito por que sera reemplazado al cargar solo los subproyectos del usuario 'If UsuarioActual.TienePermisoProceso(152) Then DdlSubProyecto.Enabled = False + If UsuarioActual.Sesion("CobroCliente-Sucursal").ToString <> "" Then DdlSubProyecto.SelectedValueExist(UsuarioActual.Sesion("CobroCliente-Sucursal").ToString.Trim) InicializaPersonalizarColumnas() @@ -57,6 +58,7 @@ Partial Class Bancos_RepCxCCliente If Mov.GetCxCCliente(CveCliente, FechaI, FechaF, DdlMoneda.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa, DdlAgrupador.SelectedValue.ToEntero, UsuarioActual.CveUsuario) Then GvCxC.DataSource = Mov.DtResultados End If + UsuarioActual.Sesion("CobroCliente-Sucursal") = DdlSubProyecto.SelectedValue Mov.Dispose() GvCxC.DataBind() diff --git a/Inventarios/PopUpExistenciasAlmacen.aspx.vb b/Inventarios/PopUpExistenciasAlmacen.aspx.vb index c2f15499c..a3b1a02d3 100644 --- a/Inventarios/PopUpExistenciasAlmacen.aspx.vb +++ b/Inventarios/PopUpExistenciasAlmacen.aspx.vb @@ -89,11 +89,17 @@ Partial Class Inventarios_Default If dr IsNot Nothing Then LtPs.Text = $"Producto: {dr("PSCodigo").ToString}" + Dim CvePrecioLista As Integer = -1 + If Not UsuarioActual.Empresa.Funcionalidad(404).ToString = "1" Then 'sino manneja precios de lista + CvePrecioLista = -2 + End If + Dim ObjVta As New ClsVentas Dim objPS As New ClsProductosServicios If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then If ObjVta.DtResultados.Rows.Count > 0 Then - If objPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, ObjVta.DtResultados.Rows(0)("CvePrecioLista").ToString.ToEntero, -1, DDlPS.SelectedValue.ToEntero) Then + If CvePrecioLista = -1 Then CvePrecioLista = ObjVta.DtResultados.Rows(0)("CvePrecioLista").ToString.ToEntero + If objPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioLista, -1, DDlPS.SelectedValue.ToEntero) Then If objPS.DtResultados.Rows.Count > 0 Then LtPrecioPS.Text = $"Precio de venta: $: {objPS.DtResultados.Rows(0)("PrecioLista").ToString.FormatoNumero} {dr("Abreviatura").ToString}" End If diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb index f32552f6c..500f775dc 100644 --- a/Ventas/ClientesAbonar.aspx.vb +++ b/Ventas/ClientesAbonar.aspx.vb @@ -2152,7 +2152,8 @@ Partial Class Ventas_ClientesAbonar ObjConta.Commit() CargaDatos(CveMonedaFiltro) RegistraScript("$('#ModalSaldarCuentaIncobrable').modal('hide')") - Alert("Los movimientos se saldaron correctamente.") + Alert(String.Format("Los movimientos se saldaron correctamente.
Ver PrePóliza", CvePrePoliza), TipoMensaje.MsgInformacion) + Else ObjConta.RollBack() Alert(MsgError, TipoMensaje.MsgError) From ef9727f4de6c00ffc1d92d85ad8f99ed96db21ac Mon Sep 17 00:00:00 2001 From: Rene Molina Date: Mon, 20 Jan 2020 10:14:58 -0700 Subject: [PATCH 3/3] -usados remision --- 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 6df87817e..fecdfa152 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -1792,7 +1792,7 @@ Namespace Modelos Private Function GuardarUsados(SqlTransaccion As SqlClient.SqlTransaction, CveVenta As Integer, ByRef ObjVentas As ClsVentas, TipoDocto As String) As Boolean Dim Resultado As Boolean = True - If UsuarioActual.Empresa.Funcionalidad(533).ToEntero > 0 AndAlso TipoDocto.Contiene("Ing", "Ant") Then + If UsuarioActual.Empresa.Funcionalidad(533).ToEntero > 0 AndAlso TipoDocto.Contiene("Ing", "Ant", "Rem") Then Dim CvePSPSA As Integer = UsuarioActual.Empresa.Funcionalidad(533).ToEntero Dim ObjAcum As New ClsAcumuladores(SqlTransaccion)