diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 15411ebe9..0e4c53628 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -638,7 +638,7 @@ Public Class ClsPaginas End Property - Property GlobalDTClasificaciones(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1, Optional UsoClasificacion As Integer = -1, Optional CveClasificacion As Integer = -1) As DataTable + Property GlobalDTClasificaciones(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1, Optional UsoClasificacion As Integer = -1, Optional CveClasificacion As Integer = -1, Optional Estatus As Integer = 1) As DataTable Get Dim AppNombre As String = String.Format("GlobalDTClasificaciones-{0}", CveEmpresa) 'sino existe, recarga los datos @@ -653,6 +653,7 @@ Public Class ClsPaginas If CveCategoria <> -1 Then Str.AppendFormat(" AND CveCategoria = {0}", CveCategoria) If UsoClasificacion <> -1 Then Str.AppendFormat(" AND UsoClasificacion IN ({0},3) ", UsoClasificacion) If CveClasificacion <> -1 Then Str.AppendFormat(" AND CveClasificacion = {0}", CveClasificacion) + If Estatus <> -1 Then Str.AppendFormat(" AND Estatus = '{0}'", If(Estatus = 1, "Activo", "Inactivo")) Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) GlobalDTClasificaciones = Dv.ToTable Dv.Dispose() @@ -3066,8 +3067,6 @@ Public Class ClsPaginas End Set End Property - - Property GlobalDTContaConceptosContables(CvePlantillaPoliza As Integer) As DataTable Get If CvePlantillaPoliza <> -1 Then diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index 3778ebbc2..10bdfd99c 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -150,18 +150,6 @@ Partial Class Bancos_ProveedoresAbonar End Get End Property - Private ReadOnly Property CveCuentaProveedor As Integer - Get - Return ViewState("CveCuentaProveedor").ToString.ToEntero - End Get - End Property - - Private ReadOnly Property CveCuentaProveedorExtranjera As Integer - Get - Return ViewState("CveCuentaProveedorExtranjera").ToString.ToEntero - End Get - End Property - Private Property IdCuenta As Integer Get Return ViewState("IdCuenta").ToString.ToEntero @@ -171,15 +159,6 @@ Partial Class Bancos_ProveedoresAbonar End Set End Property - Private Property CveCuentaB As Integer - Get - Return ViewState("CveCuentaB").ToString.ToEntero - End Get - Set(value As Integer) - ViewState("CveCuentaB") = value - End Set - End Property - Private Property CveProveedorSucursal As Integer Get Return ViewState("CveProveedorSucursal").ToString.ToEntero @@ -198,15 +177,6 @@ Partial Class Bancos_ProveedoresAbonar End Set End Property - Private Property CveCuentaBancariaComplementaria As Integer - Get - Return ViewState("CveCuentaBancariaComplementaria").ToString.ToEntero - End Get - Set(value As Integer) - ViewState("CveCuentaBancariaComplementaria") = value - End Set - End Property - Private Property PermiteModificarImporte As Boolean Get Return CType(ViewState("PermiteModificarImporte").ToString, Boolean) @@ -252,28 +222,7 @@ Partial Class Bancos_ProveedoresAbonar Return ViewState("IdCtaContRetISRAcreditable").ToString.ToEntero End Get End Property - Private ReadOnly Property CveCuentaMonedaExtranjera As Integer - Get - Return ViewState("CveCuentaMonedaExtranjera").ToString.ToEntero - End Get - End Property - Private ReadOnly Property CveCuentaComplementaria As Integer - Get - Return ViewState("CveCuentaComplementaria").ToString.ToEntero - End Get - End Property - - Private ReadOnly Property CveCuentaRetIVA As Integer - Get - Return ViewState("CveCuentaRetIVA").ToString.ToEntero - End Get - End Property - Private ReadOnly Property CveCuentaRetISR As Integer - Get - Return ViewState("CveCuentaRetISR").ToString.ToEntero - End Get - End Property Private Property EmpresaPrueba As Boolean Get Return CBool(ViewState("EmpresaPrueba")) @@ -352,15 +301,10 @@ Partial Class Bancos_ProveedoresAbonar ViewState("IdCtaContComplementaria") = 0 ViewState("IdCtaContRetIVA") = 0 ViewState("IdCtaContRetISR") = 0 - ViewState("CveCuentaMonedaExtranjera") = 0 - ViewState("CveCuentaComplementaria") = 0 - ViewState("CveCuentaRetIVA") = 0 - ViewState("CveCuentaRetISR") = 0 End If IdCuenta = 0 - CveCuentaB = 0 PermiteModificarImporte = True TxtFechaIncobrable.Text = Now.ToShortDateString @@ -959,7 +903,6 @@ Partial Class Bancos_ProveedoresAbonar Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:

" Dim idCuentaContabilizacion As Long = 1 Dim CuentasContablesInvalidas As New StringBuilder - Dim CveCuentaContabilizacion As Long = 1 Dim CuentasContablesInvalidasSIG As New StringBuilder Dim ConceptoContable As Integer Dim TipoMovimiento As Boolean @@ -1090,7 +1033,7 @@ Partial Class Bancos_ProveedoresAbonar IdCtaContable = IdCtaContComplementaria If ImporteMovimiento <> 0 AndAlso (UsaComplementariaProveedores Or IdCtaContable > 0) Then 'Cuando tiene complementaria lo dividimos en dos importeMX = ImporteMovimiento - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0.00D, Referencia, CveConceptoComplementaria, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, CveCompra:=gvr.DataKey("CveCompra").ToEntero, CveProveedor:=CveProveedor, ImporteMX:=Math.Round(ImporteMovimiento * tipoCambioCompraValuacion - ImporteMovimiento, 2, MidpointRounding.AwayFromZero), ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioCompraValuacion, CveCuenta:=CveCuentaComplementaria) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0.00D, Referencia, CveConceptoComplementaria, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, CveCompra:=gvr.DataKey("CveCompra").ToEntero, CveProveedor:=CveProveedor, ImporteMX:=Math.Round(ImporteMovimiento * tipoCambioCompraValuacion - ImporteMovimiento, 2, MidpointRounding.AwayFromZero), ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioCompraValuacion) Then MsgError = "No se pudo insertar la póliza" End If End If @@ -1952,11 +1895,6 @@ Partial Class Bancos_ProveedoresAbonar idCuentaContabilizacion = 0 End If - 'Conta SIG - If CveCuentaB < 1 Then - CuentasContablesInvalidasSIG.Append("
" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString) - CveCuentaContabilizacion = 0 - End If ImporteMovimiento = 0 Case Else ImporteMovimiento = 0 @@ -2004,17 +1942,17 @@ Partial Class Bancos_ProveedoresAbonar If (Not DivTarjeta.Visible Or DdlTarjeta.SelectedValue.ToEntero = -1) Then If TipoCambioPago > 1 AndAlso CveMoneda = 2 Then - If UsaComplementariaBancos Or (CveCuentaBancariaComplementaria > 0 OrElse IdCuentaBancariaComplementaria > 0) Then + If UsaComplementariaBancos Or (IdCuentaBancariaComplementaria > 0) Then 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, True, TxtImporte.Text.ToDecimal, Referencia, 30, ConceptoMovimiento, TxtFechaDocumento.Text.ToDate, IdCuenta, -1, CveIE, CveProveedor:=CveProveedor, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=If(TipoCambioPago = 1, 0, TxtImporte.Text.ToDecimal), CveCuenta:=CveCuentaB, TipoCambio:=TipoCambioPago, CveSubProyecto:=CveSubProyecto) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDecimal, Referencia, 30, ConceptoMovimiento, TxtFechaDocumento.Text.ToDate, IdCuenta, -1, CveIE, CveProveedor:=CveProveedor, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=If(TipoCambioPago = 1, 0, TxtImporte.Text.ToDecimal), TipoCambio:=TipoCambioPago, CveSubProyecto:=CveSubProyecto) Then MsgError = "No se pudo insertar la póliza" End If - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, If(CveMoneda = 1 AndAlso TxtTC.Visible, TxtImporte.Text.ToDecimal / TxtTC.Text.ToDecimal, TxtImporte.Text.ToDecimal), Referencia, 204, ConceptoMovimiento, TxtFechaDocumento.Text.ToDate, IdCuentaBancariaComplementaria, -1, CveIE, CveProveedor:=CveProveedor, ImporteMX:=If(CveMoneda = 2, Math.Round((TxtImporte.Text.Trim.ToDecimal * TipoCambioPago) - TxtImporte.Text.Trim.ToDecimal, 2, MidpointRounding.AwayFromZero), TxtImporte.Text.Trim.ToDecimal), ImporteME:=If(CveMoneda = 1, 0, TxtImporte.Text.ToDecimal), TipoCambio:=TipoCambioPago, CveCuenta:=CveCuentaBancariaComplementaria, CveSubProyecto:=CveSubProyecto) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, If(CveMoneda = 1 AndAlso TxtTC.Visible, TxtImporte.Text.ToDecimal / TxtTC.Text.ToDecimal, TxtImporte.Text.ToDecimal), Referencia, 204, ConceptoMovimiento, TxtFechaDocumento.Text.ToDate, IdCuentaBancariaComplementaria, -1, CveIE, CveProveedor:=CveProveedor, ImporteMX:=If(CveMoneda = 2, Math.Round((TxtImporte.Text.Trim.ToDecimal * TipoCambioPago) - TxtImporte.Text.Trim.ToDecimal, 2, MidpointRounding.AwayFromZero), TxtImporte.Text.Trim.ToDecimal), ImporteME:=If(CveMoneda = 1, 0, TxtImporte.Text.ToDecimal), TipoCambio:=TipoCambioPago, CveSubProyecto:=CveSubProyecto) Then MsgError = "No se pudo insertar la póliza" End If Else @@ -2024,7 +1962,7 @@ Partial Class Bancos_ProveedoresAbonar TipoCambioPago = TxtTCDolaresDolares.Text.ToDecimal End If - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDecimal, Referencia, 30, ConceptoMovimiento, TxtFechaDocumento.Text.ToDate, IdCuenta, -1, CveIE, CveProveedor:=CveProveedor, ImporteMX:=If(CveMoneda = 2, Math.Round(TxtImporte.Text.Trim.ToDecimal * TipoCambioPago, 2, MidpointRounding.AwayFromZero), TxtImporte.Text.Trim.ToDecimal), ImporteME:=If(DivTC.Visible, If(TxtTC.Text.ToDecimal > 0, TxtImporte.Text.ToDecimal / TxtTC.Text.ToDecimal, 0), 0), CveCuenta:=CveCuentaB, TipoCambio:=TipoCambioPago, CveSubProyecto:=CveSubProyecto) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDecimal, Referencia, 30, ConceptoMovimiento, TxtFechaDocumento.Text.ToDate, IdCuenta, -1, CveIE, CveProveedor:=CveProveedor, ImporteMX:=If(CveMoneda = 2, Math.Round(TxtImporte.Text.Trim.ToDecimal * TipoCambioPago, 2, MidpointRounding.AwayFromZero), TxtImporte.Text.Trim.ToDecimal), ImporteME:=If(DivTC.Visible, If(TxtTC.Text.ToDecimal > 0, TxtImporte.Text.ToDecimal / TxtTC.Text.ToDecimal, 0), 0), TipoCambio:=TipoCambioPago, CveSubProyecto:=CveSubProyecto) Then MsgError = "No se pudo insertar la póliza" End If @@ -2036,7 +1974,7 @@ Partial Class Bancos_ProveedoresAbonar TipoCambioPago = GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).ToString.ToDecimal End If - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDecimal, Referencia, 30, ConceptoMovimiento, TxtFechaDocumento.Text.ToDate, IdCuenta, -1, CveIE, CveProveedor:=CveProveedor, ImporteMX:=If(CveMoneda = 2, Math.Round(TxtImporte.Text.Trim.ToDecimal * TipoCambioPago, 2, MidpointRounding.AwayFromZero), TxtImporte.Text.Trim.ToDecimal), ImporteME:=If(DivTC.Visible, If(TxtTC.Text.ToDecimal > 0, TxtImporte.Text.ToDecimal / TxtTC.Text.ToDecimal, 0), 0), CveCuenta:=CveCuentaB, TipoCambio:=TipoCambioPago, CveSubProyecto:=CveSubProyecto) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDecimal, Referencia, 30, ConceptoMovimiento, TxtFechaDocumento.Text.ToDate, IdCuenta, -1, CveIE, CveProveedor:=CveProveedor, ImporteMX:=If(CveMoneda = 2, Math.Round(TxtImporte.Text.Trim.ToDecimal * TipoCambioPago, 2, MidpointRounding.AwayFromZero), TxtImporte.Text.Trim.ToDecimal), ImporteME:=If(DivTC.Visible, If(TxtTC.Text.ToDecimal > 0, TxtImporte.Text.ToDecimal / TxtTC.Text.ToDecimal, 0), 0), TipoCambio:=TipoCambioPago, CveSubProyecto:=CveSubProyecto) Then MsgError = "No se pudo insertar la póliza" End If @@ -2500,9 +2438,7 @@ Partial Class Bancos_ProveedoresAbonar End If IdCuenta = dr("IdCtaContable").ToString.ToEntero - CveCuentaB = dr("IdCtaContableSIG").ToString.ToEntero IdCuentaBancariaComplementaria = dr("IdCtaContableComplementaria").ToString.ToEntero - CveCuentaBancariaComplementaria = dr("IdCtaContableComplementariaSIG").ToString.ToEntero End If ' si no tiene CveMoneda, o es -1, cuando cambia de cuenta filtra las facturas @@ -3099,7 +3035,6 @@ Partial Class Bancos_ProveedoresAbonar For Each gr As GridViewRow In GvCxP.Rows If gr.FCCheckBox("Chk").Checked Then Dim IdCtaContable As Integer = CtaProveedor - Dim CveCuenta As Integer = CveCuentaProveedor Dim Saldo As Decimal = gr.DataKey("Saldo").ToDecimal Dim TCCompra As Decimal = gr.DataKey("TipoCambio").ToDecimal Dim TCPago As Decimal = GlobalTipoCambio(TxtFechaIncobrable.Text.ToDate).ToDecimal @@ -3129,30 +3064,23 @@ Partial Class Bancos_ProveedoresAbonar If CveMoneda > 1 AndAlso (IdCtaContComplementaria > 0 Or UsaComplementariaProveedores) Then IdCtaContable = IdCtaContComplementaria - CveCuenta = CveCuentaProveedorExtranjera - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, 0.00D, gr.DataKey("SerieFolio").ToString, CveConceptoContableComplementaria, ConceptoPartida, Now, IdCtaContable:=IdCtaContable, CveIE:=-1, IdSegmentoNegocio:=-1, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=Math.Round(Saldo * TCCompra - Saldo, 2, MidpointRounding.AwayFromZero), ImporteME:=Saldo, TipoCambio:=TCCompra, CveCuenta:=CveCuentaComplementaria) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, 0.00D, gr.DataKey("SerieFolio").ToString, CveConceptoContableComplementaria, ConceptoPartida, Now, IdCtaContable:=IdCtaContable, CveIE:=-1, IdSegmentoNegocio:=-1, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=Math.Round(Saldo * TCCompra - Saldo, 2, MidpointRounding.AwayFromZero), ImporteME:=Saldo, TipoCambio:=TCCompra) Then MsgError = "No se pudo insertar la póliza" End If IdCtaContable = IdCtaProveedorExtranjera - CveCuenta = CveCuentaProveedorExtranjera - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Saldo, gr.DataKey("SerieFolio").ToString, CveConceptoContablePago, ConceptoPartida, Now, IdCtaContable:=IdCtaContable, CveIE:=-1, IdSegmentoNegocio:=-1, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=Saldo, ImporteME:=If(CveMoneda > 1, Saldo, 0), TipoCambio:=TCCompra, CveCuenta:=CveCuenta) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Saldo, gr.DataKey("SerieFolio").ToString, CveConceptoContablePago, ConceptoPartida, Now, IdCtaContable:=IdCtaContable, CveIE:=-1, IdSegmentoNegocio:=-1, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=Saldo, ImporteME:=If(CveMoneda > 1, Saldo, 0), TipoCambio:=TCCompra) Then MsgError = "Ocurrio un error al saldar el movimiento" End If Else If CveMoneda > 1 Then IdCtaContable = IdCtaProveedorExtranjera - CveCuenta = CveCuentaProveedorExtranjera End If - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Saldo, gr.DataKey("SerieFolio").ToString, CveConceptoContablePago, ConceptoPartida, Now, IdCtaContable:=IdCtaContable, CveIE:=-1, IdSegmentoNegocio:=-1, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=If(CveMoneda = 1, Saldo, Saldo * TCCompra), ImporteME:=If(CveMoneda > 1, Saldo, 0), TipoCambio:=TCCompra, CveCuenta:=CveCuenta) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Saldo, gr.DataKey("SerieFolio").ToString, CveConceptoContablePago, ConceptoPartida, Now, IdCtaContable:=IdCtaContable, CveIE:=-1, IdSegmentoNegocio:=-1, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=If(CveMoneda = 1, Saldo, Saldo * TCCompra), ImporteME:=If(CveMoneda > 1, Saldo, 0), TipoCambio:=TCCompra) Then MsgError = "Ocurrio un error al saldar el movimiento" End If End If - - - - Dim PorcentajePago As Decimal = gr.DataKey("Saldo").ToDecimal / gr.DataKey("Original").ToDecimal If MsgError = "" AndAlso gr.DataKey("IVA").ToDecimal > 0 Then @@ -3181,11 +3109,10 @@ Partial Class Bancos_ProveedoresAbonar If ObjConta.GetRetCuenta(25, UsuarioActual.CveEmpresa) Then If ObjConta.DtResultados.Rows.Count > 0 Then IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSxAcreditar").ToString.ToEntero - CveCuenta = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSxAcreditarSIG").ToString.ToEntero End If End If - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IEPS, gr.DataKey("SerieFolio").ToString, 25, ConceptoPartida, Now, IdCtaContable:=IdCtaContable, CveIE:=-1, IdSegmentoNegocio:=-1, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=If(CveMoneda = 1, IEPS, IEPS * If(FuncionalidadFluctuacionImpuestos, TCPago, TCCompra)), CveCuenta:=CveCuenta) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IEPS, gr.DataKey("SerieFolio").ToString, 25, ConceptoPartida, Now, IdCtaContable:=IdCtaContable, CveIE:=-1, IdSegmentoNegocio:=-1, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=If(CveMoneda = 1, IEPS, IEPS * If(FuncionalidadFluctuacionImpuestos, TCPago, TCCompra))) Then MsgError = "Ocurrio un error al saldar el movimiento" End If @@ -3194,7 +3121,7 @@ Partial Class Bancos_ProveedoresAbonar End If ' se manda al ot ingresos, los impuestos por acreditar - If MsgError = "" AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Saldo, gr.DataKey("SerieFolio").ToString, 78, ConceptoPartida, Now, IdCtaContable:=UsuarioActual.Empresa.IdCuentaOtrosIngresos, CveIE:=-1, IdSegmentoNegocio:=-1, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=If(CveMoneda = 1, Saldo, Saldo * TCPago), TipoCambio:=TCCompra, TipoCambioPago:=TCPago, CveCuenta:=-1, CveSubProyecto:=CveSubProyecto) Then + If MsgError = "" AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Saldo, gr.DataKey("SerieFolio").ToString, 78, ConceptoPartida, Now, IdCtaContable:=UsuarioActual.Empresa.IdCuentaOtrosIngresos, CveIE:=-1, IdSegmentoNegocio:=-1, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=If(CveMoneda = 1, Saldo, Saldo * TCPago), TipoCambio:=TCCompra, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then MsgError = "Ocurrio un error al saldar el movimiento" End If @@ -3321,7 +3248,7 @@ Partial Class Bancos_ProveedoresAbonar Private Sub RVTxtFechaDocumento_Init(sender As Object, e As EventArgs) Handles RVTxtFechaDocumento.Init RVTxtFechaDocumento.MaximumValue = DateTime.Now.ToShortDateString - RVTxtFechaDocumentoMenor.MinimumValue = DateTime.Now.AddMonths(-4).ToShortDateString + RVTxtFechaDocumentoMenor.MinimumValue = DateTime.Now.AddMonths(-12).ToShortDateString RVTxtFechaDocumentoMenor.MaximumValue = DateTime.Now.ToShortDateString Calendario.EndDate = DateTime.Now diff --git a/Compras/eFacturas.aspx.vb b/Compras/eFacturas.aspx.vb index 4511742f4..2ee5e8db2 100644 --- a/Compras/eFacturas.aspx.vb +++ b/Compras/eFacturas.aspx.vb @@ -996,6 +996,7 @@ Partial Class Compras_eFacturas End If If e.Row.DBCampo("CveCompra") <> "" Then e.Row.FCLiteral("LtlFolio").Text = String.Format("{1}", e.Row.DBCampo("CveCompra"), e.Row.DBCampo("SerieFolio")) '1\Compras\GAPC480413QL3\A-69.xml + e.Row.FCLinkButton("imgD").Visible = False End If If e.Row.DBCampo("CveProveedor") = "" Then diff --git a/Contabilidad2/RepEstadoActividades.aspx b/Contabilidad2/RepEstadoActividades.aspx index a88aa879a..4e6ff6bdf 100644 --- a/Contabilidad2/RepEstadoActividades.aspx +++ b/Contabilidad2/RepEstadoActividades.aspx @@ -13,79 +13,14 @@
  • Exporta Excel - <%--  -  --%>
  • Imprimir - <%--   -  --%>
  • - - <%-- - -
    -
    -
    -
      - <
    • FechaInicio: - -   - - - - -
    • -
    • FechaFin: - -   - - - - -
    • -
    • Ejercicio: - - - - -
    • -
    • Periodo: - - - - - - - - - - - - - - -
    • -
    • Firma: - -
    • -
    -
    -
    - - - - - -
    -
    -
    -
    -
    --%> - +
    @@ -95,31 +30,28 @@
    -
      -
    • Ejercicio: -
    • -
    • - - -
    • -
    • Periodo: -
    • -
    • - - - - - - - - - - - - - - -
    • + +
      + + +
      + +
      + + + + + + + + + + + + + + +
      @@ -128,7 +60,7 @@
    • Tipo: - + diff --git a/Contabilidad2/RepEstadoActividades.aspx.vb b/Contabilidad2/RepEstadoActividades.aspx.vb index 22b3119c2..0141383de 100644 --- a/Contabilidad2/RepEstadoActividades.aspx.vb +++ b/Contabilidad2/RepEstadoActividades.aspx.vb @@ -85,8 +85,8 @@ Partial Class AC_RepEstadoActividades If UsuarioActual.Empresa.UsaAC Then ReporteComplementario = False Else - ReporteComplementario = True - liTipoReporte.Visible = True + ReporteComplementario = False + liTipoReporte.Visible = False LtTitulo.Text = "Estado de Resultados" End If diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb index de3e1b78e..2590c9fb1 100644 --- a/General/SaldosIniciales.aspx.vb +++ b/General/SaldosIniciales.aspx.vb @@ -1109,6 +1109,7 @@ Partial Class General_SaldosIniciales Dim CveMoneda As Integer = 1 Dim CveProveedorSucursal As Integer = Row("CveProveedorSucursal").ToString.ToEntero Dim PorcentajeIVA As String = Row("PorcentajeIVA").ToString + Dim ImpuestosLocales As Decimal = If(dt.Columns.Contains("ImpuestosLocalesl"), Row("ImpuestosLocales").ToString, "0").ToDecimal If Not CvePS > 0 Then Alert(String.Format("No se encontró el Producto Servicio"), TipoMensaje.MsgError) : ErrorCompras = True @@ -1171,10 +1172,9 @@ Partial Class General_SaldosIniciales If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, IVA, Folio, 14, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=IVA, CveSubProyecto:=Sucursal.ToEntero) Then ErrorCompras = True : Exit For If IEPS > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, IEPS, Folio, 25, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=IEPS, CveSubProyecto:=Sucursal.ToEntero) Then ErrorCompras = True : Exit For - If RetIVA > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, RetIVA, Folio, 15, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=RetIVA, CveSubProyecto:=Sucursal.ToEntero) Then ErrorCompras = True : Exit For If RetISR > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, RetISR, Folio, 16, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=RetISR, CveSubProyecto:=Sucursal.ToEntero) Then ErrorCompras = True : Exit For - + If ImpuestosLocales > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImpuestosLocales, Folio, 27, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=ImpuestosLocales, CveSubProyecto:=Sucursal.ToEntero) Then ErrorCompras = True : Exit For 'Saldo If Saldo < Total Then diff --git a/Inventarios/EntradasSalidas.aspx b/Inventarios/EntradasSalidas.aspx index 07fbf137c..f71da7eea 100644 --- a/Inventarios/EntradasSalidas.aspx +++ b/Inventarios/EntradasSalidas.aspx @@ -81,11 +81,7 @@
    • Ver PrePóliza -
    • -
    • - -
    • +
    • @@ -104,6 +100,10 @@
    • +
    • + +
    • diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index 41c8f6873..397f87575 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -1312,7 +1312,8 @@ Partial Class Inventarios_EntradasSalidas Dim FechaCaducidadVal As Date = If(RowPS("AplicaCaducidad").ToString = "True", FechaCaducidad, MinFecha) - If CveMetodoInventario = 5 And (String.IsNullOrEmpty(Serie.Trim()) OrElse Serie = "-1") Then + + If RowPS("AplicaSerie").ToString = "True" And (String.IsNullOrEmpty(Serie.Trim()) OrElse Serie = "-1") Then Valido = False Alert("El producto requiere Serie", TipoMensaje.MsgAdvertencia) End If @@ -1324,6 +1325,18 @@ Partial Class Inventarios_EntradasSalidas End If End If + Dim tCveSubProyecto As Integer + Dim drA2 As DataRow = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveAlmacen = {0}", DdlAlmacen.SelectedValue)) + If drA2 IsNot Nothing Then + tCveSubProyecto = drA2("CveSubProyecto").ToString.ToEntero + End If + + If UsuarioActual.CveEmpresa = 119 AndAlso Not tCveSubProyecto.Contiene(10276) Then + FechaCaducidadVal = MinFecha + FechaCaducidad = MinFecha + Lote = "" + End If + 'salida If Valido AndAlso DdlConcepto.SelectedValue.Contiene({"3", "5", "7", "8", "11", "12", "13", "15", "16", "17", "20", "21", "30", "31"}) Then ' salida de almacen @@ -1762,7 +1775,7 @@ Partial Class Inventarios_EntradasSalidas If UsuarioActual.Empresa.UsaAC AndAlso (DdlConcepto.SelectedValue = "3") AndAlso EsContabilizable Then Dim DtII As DataTable = Nothing Dim TotalDetalle As Double = 0.0 - Dim Importe As Decimal = DtMovimientos.SUM("Total", "Estatus IN ('','U')") + Dim Importe As Decimal = DtMovimientos.SUMD("Total", "Estatus IN ('','U')") 'NOTA. CUANDO ES SALIDA, EN AUTOMATICO NO TENEMOS LOS VALORES DE LA SALIDA TODAVIA, Y POR ESO IMPORTE ES CERO, ES RECARGAR CON LOS DATOS YA INSERTADOS If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb index 194969e9c..1f4d659d8 100644 --- a/Ventas/ClientesAbonar.aspx.vb +++ b/Ventas/ClientesAbonar.aspx.vb @@ -793,6 +793,8 @@ Partial Class Ventas_ClientesAbonar Dim tipoCambioPago As Decimal Dim tipoCambioVentaValuacion As Decimal = 1 Dim TipoCambioGeneral As Decimal = 1 + Dim CveSubProyectoContabilizar As Integer = -1 + Dim CveSubProyectoMaximo As Integer = -1 Dim CuentasContablesInvalidas As New StringBuilder Dim CuentasContablesInvalidasSIG As New StringBuilder Dim FuncionalidadFluctuacionImpuestos As Boolean = If(UsuarioActual.Empresa.Funcionalidad(159) = "1", True, False) @@ -867,8 +869,9 @@ Partial Class Ventas_ClientesAbonar Dim ConceptoMovimiento As String = ObjMov.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, NombreComercial, gvr.DataKey("SerieFolio").ToString, TxtFolio.Text.Trim) Dim Referencia As String = gvr.DataKey("SerieFolio").ToString Dim CveSubProyecto As Integer = gvr.DataKey("CveSubProyecto").ToEntero - Dim CveSubProyectoContabilizar As Integer = -1 + CveSubProyectoContabilizar = -1 Dim PorcentajeImpuesto As Decimal = 0 + If CveSubProyecto > 0 Then CveSubProyectoMaximo = CveSubProyecto Select Case ConceptoContable Case 2 'Pago Cliente @@ -1492,6 +1495,9 @@ Partial Class Ventas_ClientesAbonar Next If RblTipoPago.SelectedValue = "1" Then + + CveSubProyectoContabilizar = CveSubProyectoMaximo + If tipoCambioPago > 1 AndAlso CveMoneda = 2 Then If IdCuentaBancariaComplementaria > 0 Then If CveMoneda = 2 AndAlso CveMonedaFiltro = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES @@ -1500,11 +1506,11 @@ Partial Class Ventas_ClientesAbonar 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, -1, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=TxtImporte.Text.Trim.ToDecimal, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then + 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:=TxtImporte.Text.Trim.ToDecimal, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then MsgError = "No se pudo insertar la póliza" End If - 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, -1, 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 + 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 @@ -1514,7 +1520,7 @@ Partial Class Ventas_ClientesAbonar 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, -1, 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 + 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 @@ -1525,7 +1531,7 @@ Partial Class Ventas_ClientesAbonar 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, -1, 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 + 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 diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 91e5df9dd..638985289 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -8520,10 +8520,11 @@ } //Suma Totales - function FnSuma() { - $get('TxtSubTotal2').value = FormatoNumero(ToDouble($get('TxtSubTotal').value) - ToDouble($get('LblDescuentos').innerHTML) - ToDouble($get('LblAmortizacion').innerHTML), 2); - var totalVenta = ToDouble($get('TxtSubTotal2').value) + ToDouble($get('TxtIVA').value) + ToDouble($get('TxtIEPS') ? ToDouble($get('TxtIEPS').value) : 0) - ToDouble($get('TxtRetIVA').value) - ToDouble($get('TxtRetISR').value); + function FnSuma() { debugger; + $get('TxtSubTotal2').value = FormatoNumero(ToDouble($get('TxtSubTotal').value) - ToDouble($get('LblDescuentos').innerHTML) - ToDouble($get('LblAmortizacion').innerHTML), 2); + var totalVenta = ToDouble($get('TxtSubTotal2').value) + ToDouble($get('TxtIVA').value) + ToDouble($get('TxtIEPS') ? ToDouble($get('TxtIEPS').value) : 0) - ToDouble($get('TxtRetIVA') ? $get('TxtRetIVA').value : 0) - ToDouble($get('TxtRetISR') ? $get('TxtRetISR').value:0); + $("#<%=GvImpuestosLocales2.ClientID%> input[type='text']").each(function () { if ($(this).attr("class") == '5') // cuando es traslado de impuesto local, se suma diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 4b9eb526c..8df4b4fdf 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -9895,9 +9895,9 @@ Partial Class Ventas 'RMF. faltan impuestos locales - If TmpDTImpuestos IsNot Nothing AndAlso TmpDTImpuestos.FiltraParametros("TipoImpuesto = 1").Rows.Count > 0 Then + If TmpDTImpuestos IsNot Nothing AndAlso TmpDTImpuestos.FiltraParametros("TipoImpuesto IN (1,3) ").Rows.Count > 0 Then - For Each DrImpuestosLocales As DataRow In TmpDTImpuestos.FiltraParametros("TipoImpuesto = 1").Rows + For Each DrImpuestosLocales As DataRow In TmpDTImpuestos.FiltraParametros("TipoImpuesto IN (1,3) ").Rows If DrImpuestosLocales("Importe").ToString().ToDecimal > 0 Then Dim ret As New CFDIRetencionesLocales With {