This commit is contained in:
janeth arvizu
2019-11-26 09:27:25 -07:00
6 changed files with 169 additions and 103 deletions

View File

@@ -145,13 +145,14 @@ Public Class ClsGralFolios
End Function End Function
Public Function AddFolios(CveSubProyecto As Integer, TipoDocto As String, FInicial As Integer, FActual As Integer, FFinal As Integer, CBB As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean Public Function AddFolios(CveSubProyecto As Integer, TipoDocto As String, Serie As String, FInicial As Integer, FActual As Integer, FFinal As Integer, CBB As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Gral_FoliosAdd") DataAdapter("PA_Gral_FoliosAdd")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto .Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto
.Add("@Serie", SqlDbType.VarChar).Value = Serie
.Add("@FInicial", SqlDbType.Int).Value = FInicial .Add("@FInicial", SqlDbType.Int).Value = FInicial
.Add("@FActual", SqlDbType.Int).Value = FActual .Add("@FActual", SqlDbType.Int).Value = FActual
.Add("@FFinal", SqlDbType.Int).Value = FFinal .Add("@FFinal", SqlDbType.Int).Value = FFinal
@@ -178,13 +179,14 @@ Public Class ClsGralFolios
Return Retorno Return Retorno
End Function End Function
Public Function UpdateFolios(CveSubProyecto As Integer, TipoDocto As String, FInicial As Integer, FActual As Integer, FFinal As Integer, CBB As String, Estado As Boolean, CveUsuario As Integer, CveFolio As Integer) As Boolean Public Function UpdateFolios(CveSubProyecto As Integer, TipoDocto As String, Serie As String, FInicial As Integer, FActual As Integer, FFinal As Integer, CBB As String, Estado As Boolean, CveUsuario As Integer, CveFolio As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Gral_FoliosUpdate") DataAdapter("PA_Gral_FoliosUpdate")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto .Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto
.Add("@Serie", SqlDbType.VarChar).Value = Serie
.Add("@FInicial", SqlDbType.Int).Value = FInicial .Add("@FInicial", SqlDbType.Int).Value = FInicial
.Add("@FActual", SqlDbType.Int).Value = FActual .Add("@FActual", SqlDbType.Int).Value = FActual
.Add("@FFinal", SqlDbType.Int).Value = FFinal .Add("@FFinal", SqlDbType.Int).Value = FFinal

View File

@@ -958,7 +958,7 @@ Public Class ClsInventarios
Optional CveMovimientoRelacionado As Integer = -1, Optional TipoCambio As Double = -1, Optional CveVendedor As Integer = -1, Optional CveCliente As Integer = -1, Optional MovimientoFijo As Boolean = False, Optional CveContrato As Integer = -1, Optional CveMovimientoRelacionado As Integer = -1, Optional TipoCambio As Double = -1, Optional CveVendedor As Integer = -1, Optional CveCliente As Integer = -1, Optional MovimientoFijo As Boolean = False, Optional CveContrato As Integer = -1,
Optional CveProveedor As Integer = -1, Optional Remision As String = "", Optional CveClienteSucursal As Integer = -1, Optional DepartamentoEntrega As String = "", Optional PedidoContrato As String = "", Optional GastoIndirecto As Double = -1, Optional CveChofer As Integer = -1, Optional Placa As String = "", Optional CveProveedor As Integer = -1, Optional Remision As String = "", Optional CveClienteSucursal As Integer = -1, Optional DepartamentoEntrega As String = "", Optional PedidoContrato As String = "", Optional GastoIndirecto As Double = -1, Optional CveChofer As Integer = -1, Optional Placa As String = "",
Optional FechaEntrega As String = "", Optional EspecifUnidad As String = "", Optional ResponsableCarga As String = "", Optional ResponsableRecibio As String = "", Optional Identificacion As String = "", Optional Domicilio As String = "", Optional FechaEntrega As String = "", Optional EspecifUnidad As String = "", Optional ResponsableCarga As String = "", Optional ResponsableRecibio As String = "", Optional Identificacion As String = "", Optional Domicilio As String = "",
Optional Telefono As String = "", Optional Ciudad As String = "", Optional Licencia As String = "") As Integer Optional Telefono As String = "", Optional Ciudad As String = "", Optional Licencia As String = "", Optional Modulo As String = "") As Integer
Dim Retorno As Integer = -1 Dim Retorno As Integer = -1
@@ -1011,6 +1011,7 @@ Public Class ClsInventarios
.Add("@Telefono", SqlDbType.VarChar).Value = Telefono .Add("@Telefono", SqlDbType.VarChar).Value = Telefono
.Add("@Ciudad", SqlDbType.VarChar).Value = Ciudad .Add("@Ciudad", SqlDbType.VarChar).Value = Ciudad
.Add("@Licencia", SqlDbType.VarChar).Value = Licencia .Add("@Licencia", SqlDbType.VarChar).Value = Licencia
.Add("@Modulo", SqlDbType.VarChar).Value = Modulo
End With End With
Try Try

View File

@@ -1424,12 +1424,14 @@ Partial Class Bancos_PopIECompras
End If End If
'inserto las compras que voy a pagar 'inserto las compras que voy a pagar
If ObjMov.GetPlantillaConceptos(2, CvePlantillaPoliza) Then If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then
For Each Row As DataRow In ObjMov.DtResultados.Rows For Each Row As DataRow In ObjMov.DtResultados.Rows
Dim ConceptoContable = Row("CveConcepto").ToString.ToEntero Dim ConceptoContable = Row("CveConcepto").ToString.ToEntero
TipoMovimiento = If(Row("TipoMovto").ToString = "True", True, False) TipoMovimiento = If(Row("TipoMovto").ToString = "True", True, False)
Dim ImporteMovimiento As Decimal = 0 Dim ImporteMovimiento As Decimal = 0
Dim ImporteMX As Decimal = 0 Dim ImporteMX As Decimal = 0
Dim ImporteMovimientoNoDeducible As Decimal = 0
Dim ImporteMXNoDeducible As Decimal = 0
Dim IdCtaContable As Integer = 0 Dim IdCtaContable As Integer = 0
Dim CveCuenta As Integer = 0 Dim CveCuenta As Integer = 0
Dim ConceptoMovimiento = ObjMov.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, NombreProveedor, TxtObservaciones.Text, TxtFolio.Text.Trim) Dim ConceptoMovimiento = ObjMov.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, NombreProveedor, TxtObservaciones.Text, TxtFolio.Text.Trim)
@@ -2275,6 +2277,7 @@ Partial Class Bancos_PopIECompras
ImporteMovimiento = 0 ImporteMovimiento = 0
ImporteMX = 0 ImporteMX = 0
End If End If
Else Else
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.IVADeducible * PorcentajePago ImporteMovimiento = MovimientoPagar.IVADeducible * PorcentajePago
@@ -2296,89 +2299,76 @@ Partial Class Bancos_PopIECompras
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
End If End If
PorcentajeImpuesto = MovimientoPagar.PorcentajeIVA If MovimientoPagar.IVANoDeducible.ToString.ToDecimal > 0 Then
Dim IdCtaIVAXAcreditar As Integer = 0 If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then
Dim IdCtaIVAAcreditable As Integer = 0 'funcionalidad que toma el 100% del pago para acreditamiento de iva
Dim TotalImporte As Decimal
If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then
IdCtaIVAXAcreditar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero
IdCtaIVAAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero
End If
IdCtaContable = If(IdCtaIVAAcreditable > 0, IdCtaIVAAcreditable, 0)
If ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditable").ToString.ToEntero
CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditableSIG").ToString.ToEntero
End If
End If
Case 280 'Iva Acreditable No Deducible
If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then
'funcionalidad que toma el 100% del pago para acreditamiento de iva
Dim TotalImporte As Decimal
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
TotalImporte = ImportePagado.ToString.ToDecimal
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal / tipoCambioPago, 2)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal * tipoCambioPago, 2)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
TotalImporte = ImportePagado.ToString.ToDecimal
End If
If TotalImporte = CompraSaldo Then
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.IVANoDeducible TotalImporte = ImportePagado.ToString.ToDecimal
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.IVANoDeducible) TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal / tipoCambioPago, 2)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.IVANoDeducible) TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal * tipoCambioPago, 2)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.IVANoDeducible) TotalImporte = ImportePagado.ToString.ToDecimal
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
End If End If
ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
ImporteMX = Math.Round(ImporteMX, 2) If TotalImporte = CompraSaldo Then
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimientoNoDeducible = MovimientoPagar.IVANoDeducible
ImporteMXNoDeducible = ImporteMovimientoNoDeducible
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimientoNoDeducible = (MovimientoPagar.IVANoDeducible)
ImporteMXNoDeducible = ImporteMovimientoNoDeducible * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimientoNoDeducible = (MovimientoPagar.IVANoDeducible)
ImporteMXNoDeducible = ImporteMovimientoNoDeducible * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimientoNoDeducible = (MovimientoPagar.IVANoDeducible)
ImporteMXNoDeducible = ImporteMovimientoNoDeducible * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
End If
ImporteMovimientoNoDeducible = Math.Round(ImporteMovimientoNoDeducible, 2)
ImporteMXNoDeducible = Math.Round(ImporteMX, 2)
TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimientoNoDeducible.FormatoNumero(2)}"
Else
ImporteMovimientoNoDeducible = 0
ImporteMXNoDeducible = 0
End If
Else
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimientoNoDeducible = MovimientoPagar.IVANoDeducible * PorcentajePago
ImporteMXNoDeducible = ImporteMovimientoNoDeducible
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimientoNoDeducible = (MovimientoPagar.IVANoDeducible * PorcentajePago)
ImporteMXNoDeducible = ImporteMovimientoNoDeducible * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimientoNoDeducible = (MovimientoPagar.IVANoDeducible * PorcentajePago)
ImporteMXNoDeducible = ImporteMovimientoNoDeducible * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimientoNoDeducible = (MovimientoPagar.IVANoDeducible * PorcentajePago)
ImporteMXNoDeducible = ImporteMovimientoNoDeducible * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
End If
ImporteMovimientoNoDeducible = Math.Round(ImporteMovimientoNoDeducible, 2)
ImporteMXNoDeducible = Math.Round(ImporteMXNoDeducible, 2)
TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra) TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}" If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimientoNoDeducible.FormatoNumero(2)}"
Else
ImporteMovimiento = 0
ImporteMX = 0
End If End If
Else
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.IVANoDeducible * PorcentajePago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
ImporteMX = Math.Round(ImporteMX, 2)
TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
End If End If
PorcentajeImpuesto = MovimientoPagar.PorcentajeIVA PorcentajeImpuesto = MovimientoPagar.PorcentajeIVA
Dim IdCtaIVAXAcreditar As Integer = 0 Dim IdCtaIVAXAcreditar As Integer = 0
Dim IdCtaIVAAcreditable As Integer = 0 Dim IdCtaIVAAcreditable As Integer = 0
Dim IdCtaContableNoIVA As Integer = 0
If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then
IdCtaIVAXAcreditar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero IdCtaIVAXAcreditar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero
IdCtaIVAAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero IdCtaIVAAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero
IdCtaContableNoIVA = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVANoAcreditable").ToString.ToEntero
End If End If
IdCtaContable = If(IdCtaIVAAcreditable > 0, IdCtaIVAAcreditable, 0) IdCtaContable = If(IdCtaIVAAcreditable > 0, IdCtaIVAAcreditable, 0)
@@ -2389,6 +2379,89 @@ Partial Class Bancos_PopIECompras
CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditableSIG").ToString.ToEntero CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditableSIG").ToString.ToEntero
End If End If
End If End If
If MovimientoPagar.IVANoDeducible > 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, If(ConceptoContable = 30, TxtFolio.Text.Trim, TxtObservaciones.Text), 280, ConceptoMovimiento, Fecha, IdCtaContableNoIVA, -1, CveIE, -1, CveCompra, -1, CveProveedor:=CveProveedor2, ImporteMX:=ImporteMXNoDeducible, CveCuenta:=CveCuenta, TipoCambio:=TimpocambioGeneral, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeImpuesto) Then
MsgError = "No se pudo insertar la póliza"
End If
End If
'Case 280 'Iva Acreditable No Deducible
' If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then
' 'funcionalidad que toma el 100% del pago para acreditamiento de iva
' Dim TotalImporte As Decimal
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' TotalImporte = ImportePagado.ToString.ToDecimal
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal / tipoCambioPago, 2)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal * tipoCambioPago, 2)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' TotalImporte = ImportePagado.ToString.ToDecimal
' End If
' If TotalImporte = CompraSaldo Then
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = MovimientoPagar.IVANoDeducible
' ImporteMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
' ImporteMX = Math.Round(ImporteMX, 2)
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
' Else
' ImporteMovimiento = 0
' ImporteMX = 0
' End If
' Else
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = MovimientoPagar.IVANoDeducible * PorcentajePago
' ImporteMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
' ImporteMX = Math.Round(ImporteMX, 2)
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
' End If
' PorcentajeImpuesto = MovimientoPagar.PorcentajeIVA
' Dim IdCtaIVAXAcreditar As Integer = 0
' Dim IdCtaIVAAcreditable As Integer = 0
' If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then
' IdCtaIVAXAcreditar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero
' IdCtaIVAAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero
' End If
' IdCtaContable = If(IdCtaIVAAcreditable > 0, IdCtaIVAAcreditable, 0)
' If ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
' If ObjMov.DtResultados.Rows.Count > 0 Then
' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditable").ToString.ToEntero
' CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditableSIG").ToString.ToEntero
' End If
' End If
Case 25 'IEPS por Acreditar Case 25 'IEPS por Acreditar
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.IEPS * PorcentajePago ImporteMovimiento = MovimientoPagar.IEPS * PorcentajePago
@@ -3066,6 +3139,7 @@ Partial Class Bancos_PopIECompras
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, If(ConceptoContable = 30, TxtFolio.Text.Trim, TxtObservaciones.Text), ConceptoContable, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra, -1, CveProveedor:=CveProveedor2, ImporteMX:=ImporteMX, CveCuenta:=CveCuenta, TipoCambio:=TimpocambioGeneral, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeImpuesto) Then If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, If(ConceptoContable = 30, TxtFolio.Text.Trim, TxtObservaciones.Text), ConceptoContable, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra, -1, CveProveedor:=CveProveedor2, ImporteMX:=ImporteMX, CveCuenta:=CveCuenta, TipoCambio:=TimpocambioGeneral, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeImpuesto) Then
MsgError = "No se pudo insertar la póliza" MsgError = "No se pudo insertar la póliza"
End If End If
End If End If
Next Next

View File

@@ -687,23 +687,27 @@ Partial Class Compras_ReembolsosComprobaciones
End If End If
'Agrego el IVA 'Agrego el IVA
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, gvr.DataKey("IVA").ToDecimal, Referencia, 19, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAAcreditable > 0, IdCtaContIVAAcreditable, IdCtaIVAAcreditable), -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVA").ToDecimal), ImporteMX:=(gvr.DataKey("IVA").ToDecimal) * tipoCambio, CveCuenta:=CveCuentaIVAAcreditable, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then If gvr.DataKey("IVADeducible").ToDecimal > 0 Then
MsgError = "Detalle" If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, gvr.DataKey("IVADeducible").ToDecimal, Referencia, 19, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAAcreditable > 0, IdCtaContIVAAcreditable, IdCtaIVAAcreditable), -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVADeducible").ToDecimal), ImporteMX:=(gvr.DataKey("IVADeducible").ToDecimal) * tipoCambio, CveCuenta:=CveCuentaIVAAcreditable, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then
MsgError = "Detalle"
End If
End If End If
End If End If
Else Else
'Agrego el IVA 'Agrego el IVA
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, gvr.DataKey("IVA").ToDecimal * PorcentajePago, Referencia, 14, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAXAcreditar > 0, IdCtaContIVAXAcreditar, IdCtaIVAxAcreditar), -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVA").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambio, CveCuenta:=CveCuentaIVAxAcreditar, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago, Referencia, 14, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAXAcreditar > 0, IdCtaContIVAXAcreditar, IdCtaIVAxAcreditar), -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVA").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambio, CveCuenta:=CveCuentaIVAxAcreditar, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then
MsgError = "Detalle" MsgError = "Detalle"
End If End If
Dim ImporteNOIVA As Decimal = gvr.DataKey("IVA").ToDecimal * PorcentajePago
'Agrego el IVA 'Agrego el IVA
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, gvr.DataKey("IVA").ToDecimal * PorcentajePago, Referencia, 19, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAAcreditable > 0, IdCtaContIVAAcreditable, IdCtaIVAAcreditable), -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVA").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambio, CveCuenta:=CveCuentaIVAAcreditable, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then If gvr.DataKey("IVADeducible").ToDecimal > 0 Then
MsgError = "Detalle" Dim ImporteIVA As Decimal = gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago
If ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, ImporteIVA, Referencia, 19, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAAcreditable > 0, IdCtaContIVAAcreditable, IdCtaIVAAcreditable), -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, ImporteIVA), ImporteMX:=(ImporteIVA) * tipoCambio, CveCuenta:=CveCuentaIVAAcreditable, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then
MsgError = "Detalle"
End If
End If End If
End If End If
If gvr.DataKey("NoDeducible") Then If gvr.DataKey("IVANoDeducible").ToDecimal > 0 Then
Dim ImporteNOIVA As Decimal = gvr.DataKey("IVANoDeducible").ToDecimal * PorcentajePago Dim ImporteNOIVA As Decimal = gvr.DataKey("IVANoDeducible").ToDecimal * PorcentajePago

View File

@@ -296,18 +296,6 @@ Partial Class General_SaldosIniciales
Exit Sub Exit Sub
End If End If
If RblFormato.SelectedValue = "4" Then
If Not dt.Columns(15).ColumnName = "ImpuestoLocal" Then
Alert("El nombre de la diesciseisava columna debe ser 'ImpuestoLocal'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(16).ColumnName = "Amort.Ant" Then
Alert("El nombre de la diescisieteava columna debe ser 'Amort.Ant'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
End If
ElseIf RblFormato.SelectedValue = "5" Then ElseIf RblFormato.SelectedValue = "5" Then
@@ -1321,8 +1309,6 @@ Partial Class General_SaldosIniciales
Dim Folio As Integer = Row("Folio").ToString.ToEntero Dim Folio As Integer = Row("Folio").ToString.ToEntero
Dim Fecha As Date = Row("Fecha").ToString.ToDate Dim Fecha As Date = Row("Fecha").ToString.ToDate
Dim FechaVencimiento As Date = Row("Fecha Vencimiento").ToString.ToDate Dim FechaVencimiento As Date = Row("Fecha Vencimiento").ToString.ToDate
Dim ImpuestoLocal As Double = Row("ImpuestoLocal").ToString.ToDouble
Dim Amortizacion As Double = Row("Amort.Ant").ToString.ToDouble
Dim SubTotal As Decimal = Row("SubTotal").ToString.ToDecimal Dim SubTotal As Decimal = Row("SubTotal").ToString.ToDecimal
Dim IVA As Decimal = Row("IVA").ToString.ToDecimal Dim IVA As Decimal = Row("IVA").ToString.ToDecimal
Dim Total As Decimal = Row("Total").ToString.ToDecimal Dim Total As Decimal = Row("Total").ToString.ToDecimal
@@ -1337,6 +1323,7 @@ Partial Class General_SaldosIniciales
Dim CveVendedor As Integer = 0 Dim CveVendedor As Integer = 0
Dim IEPS As Decimal = Row("IEPS").ToString.ToDecimal Dim IEPS As Decimal = Row("IEPS").ToString.ToDecimal
Dim CveClienteSucursal As Integer = Row("CveClienteSucursal").ToString.ToEntero Dim CveClienteSucursal As Integer = Row("CveClienteSucursal").ToString.ToEntero
Dim ImpuestosLocales As Decimal = Row("ImpuestoLocal").ToString.ToDecimal
GuardaLog(Sucursal + "-" + Row("Sucursal").ToString) GuardaLog(Sucursal + "-" + Row("Sucursal").ToString)
'Temporalmente SE BORRARA 'Temporalmente SE BORRARA
@@ -1373,17 +1360,18 @@ Partial Class General_SaldosIniciales
FechaVencimiento = Fecha FechaVencimiento = Fecha
End If End If
'Venta 'Venta
If CveCliente > 0 Then If CveCliente > 0 Then
If TipoDocto.Contiene("Ing", "Egs", "Rem") Then If TipoDocto.Contiene("Ing", "Egs", "Rem") Then
GuardaLog(Serie & "-" & Folio) GuardaLog(Serie & "-" & Folio)
If Not ObjVentas.AddVenta(TipoDocto, Folio, CveCliente.ToEntero, CveClienteSucursal, SubTotal, 0, Amortizacion, IVA, RetIVA, RetISR, Total, CveMoneda, TipoCambio.ToDouble, If Not ObjVentas.AddVenta(TipoDocto, Folio, CveCliente.ToEntero, CveClienteSucursal, SubTotal, 0, 0, IVA, RetIVA, RetISR, Total, CveMoneda, TipoCambio.ToDouble,
0, 0, 0, FechaVencimiento, Fecha, "", "", Fecha, CveVendedor, Folio2, "", "", 0, 0, 0, "-1".ToDate, "-1".ToDate, "-1".ToDate, -1, -1, 0, CvePrePoliza, 0, 0, 0, FechaVencimiento, Fecha, "", "", Fecha, CveVendedor, Folio2, "", "", 0, 0, 0, "-1".ToDate, "-1".ToDate, "-1".ToDate, -1, -1, 0, CvePrePoliza,
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Serie:=Serie, CveSubProyecto:=Sucursal.ToEntero, CveSubProyectoEjecucion:=Sucursal.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Serie:=Serie, CveSubProyecto:=Sucursal.ToEntero, CveSubProyectoEjecucion:=Sucursal.ToEntero,
CveSubProyectoCobranza:=Sucursal.ToEntero, IEPS:=IEPS, CveSubProyectoCobranza:=Sucursal.ToEntero, IEPS:=IEPS, ImpuestoLocal:=ImpuestosLocales,
ObservacionesAlmacen:=Transaccion, Entrega:=CodCliente, ImpuestoLocal:=ImpuestoLocal) Then ObservacionesAlmacen:=Transaccion, Entrega:=CodCliente) Then
ErrorVentas = True ErrorVentas = True
Exit For Exit For
End If End If

View File

@@ -4193,7 +4193,6 @@ Partial Class Ventas
tdVigencia.Visible = DdlTipoComprobante.SelectedValue.Contiene("Cot") tdVigencia.Visible = DdlTipoComprobante.SelectedValue.Contiene("Cot")
tdFechaVigencia.Visible = DdlTipoComprobante.SelectedValue.Contiene("Cot") tdFechaVigencia.Visible = DdlTipoComprobante.SelectedValue.Contiene("Cot")
If DbRowVenta("TipoDocto").ToString = "Rem" Then If DbRowVenta("TipoDocto").ToString = "Rem" Then
'CANTIDAD FACTURADA 'CANTIDAD FACTURADA
If TmpDT.SUM("CantidadFacturadaRem") > 0 Then If TmpDT.SUM("CantidadFacturadaRem") > 0 Then
@@ -4228,8 +4227,6 @@ Partial Class Ventas
End If End If
End If End If
End If
'Si es Empresa de Acumuladores 'Si es Empresa de Acumuladores
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
'Si ya se surtió y recibió 'Si ya se surtió y recibió
@@ -4242,7 +4239,6 @@ Partial Class Ventas
End If End If
If DbRowVenta("TipoDocto").ToString.Contiene("Cot", "Pd2") Then If DbRowVenta("TipoDocto").ToString.Contiene("Cot", "Pd2") Then
'CANTIDAD FACTURADA 'CANTIDAD FACTURADA
If TmpDT.SUM("CantidadFacturadaCot") > 0 Then If TmpDT.SUM("CantidadFacturadaCot") > 0 Then
@@ -14348,6 +14344,7 @@ Partial Class Ventas
TmpDT.Columns.Add("ClaveSATUnidadAduanaDescripcion", GetType(String)) TmpDT.Columns.Add("ClaveSATUnidadAduanaDescripcion", GetType(String))
TmpDT.Columns.Add("CveTamaño", GetType(Integer)) TmpDT.Columns.Add("CveTamaño", GetType(Integer))
TmpDT.Columns.Add("CveConcepto", GetType(Integer))
End Sub End Sub
Private Sub CreaDTmpC() Private Sub CreaDTmpC()
@@ -15458,7 +15455,7 @@ Partial Class Ventas
Dim ContadorMovtosDetalles = 0 Dim ContadorMovtosDetalles = 0
'Creamos el movimiento 'Creamos el movimiento
Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, ConceptoEntrada, CveMoneda, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, CveMovimientoRelacionado:=CveMovimientoRelacionado) Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, ConceptoEntrada, CveMoneda, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, CveMovimientoRelacionado:=CveMovimientoRelacionado, Modulo:="Ventas/Ventas.aspx")
If CveMovimientoInventario > 0 Then If CveMovimientoInventario > 0 Then