This commit is contained in:
2020-01-22 20:06:48 -07:00
8 changed files with 88 additions and 62 deletions

View File

@@ -1873,7 +1873,7 @@ Public Class ClsVentas
Return Retorno Return Retorno
End Function End Function
Public Function AddPromociones(Promocion As String, FechaInicio As Date, FechaFin As Date, CveVendedor As Integer, CveCliente As Integer, Estatus As Boolean, CveMoneda As Integer, CveUsuario As Integer, CveEmpresa As Integer, CveSubProyecto As Integer) As Integer Public Function AddPromociones(Promocion As String, FechaInicio As Date, FechaFin As Date, CveVendedor As Integer, CveCliente As Integer, Estatus As Boolean, CveMoneda As Integer, CveUsuario As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, TipoAplicacion As String) As Integer
Dim Retorno = -1 Dim Retorno = -1
DataAdapter("PA_Vta_PromocionesAdd") DataAdapter("PA_Vta_PromocionesAdd")
@@ -1889,6 +1889,7 @@ Public Class ClsVentas
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@TipoAplicacion", SqlDbType.VarChar).Value = TipoAplicacion
.Add("@CvePromocion", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@CvePromocion", SqlDbType.Int).Direction = ParameterDirection.Output
End With End With

View File

@@ -890,13 +890,13 @@ Namespace Extensiones
Public Function RoundSQL(Valor As Double, Optional Decimales As Integer = 2) As Double Public Function RoundSQL(Valor As Double, Optional Decimales As Integer = 2) As Double
'Return Math.Round(Valor, Decimales, MidpointRounding.AwayFromZero) 'Return Math.Round(Valor, Decimales, MidpointRounding.AwayFromZero)
'primero, se redondea a 4, para que concuerde al redondeo de sql, si se redondea a 2 decimales por ejemplo 'primero, se redondea a 4, para que concuerde al redondeo de sql, si se redondea a 2 decimales por ejemplo
Return If(Decimales < 4, Math.Round(Math.Round(Valor, 4, MidpointRounding.AwayFromZero), Decimales, MidpointRounding.AwayFromZero), Math.Round(Valor, MidpointRounding.AwayFromZero)) Return If(Decimales < 4, Math.Round(Math.Round(Valor, 4, MidpointRounding.AwayFromZero), Decimales, MidpointRounding.AwayFromZero), Math.Round(Valor, Decimales, MidpointRounding.AwayFromZero))
End Function End Function
<Runtime.CompilerServices.Extension()> <Runtime.CompilerServices.Extension()>
Public Function RoundSQL(Valor As Decimal, Optional Decimales As Integer = 2) As Decimal Public Function RoundSQL(Valor As Decimal, Optional Decimales As Integer = 2) As Decimal
'primero, se redondea a 4, para que concuerde al redondeo de sql 'primero, se redondea a 4, para que concuerde al redondeo de sql
Return If(Decimales < 4, Math.Round(Math.Round(Valor, 4, MidpointRounding.AwayFromZero), Decimales, MidpointRounding.AwayFromZero), Math.Round(Valor, MidpointRounding.AwayFromZero)) Return If(Decimales < 4, Math.Round(Math.Round(Valor, 4, MidpointRounding.AwayFromZero), Decimales, MidpointRounding.AwayFromZero), Math.Round(Valor, Decimales, MidpointRounding.AwayFromZero))
End Function End Function
<Runtime.CompilerServices.Extension()> <Runtime.CompilerServices.Extension()>
Public Function Abs(Valor As Double) As Double Public Function Abs(Valor As Double) As Double

View File

@@ -201,7 +201,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable).FiltraParametros($"CveEmpresa = {CveEmpresa}") Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable).FiltraParametros($"CveEmpresa = {CveEmpresa}")
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
DtRetorno = dt.FiltraParametros($"NombreComercial like '%{Name}%'") DtRetorno = dt.FiltraParametros($"NombreComercial like '%{Name}%' OR Nombre like '%{Name}%' ")
End If End If
End If End If

View File

@@ -2244,7 +2244,7 @@ Partial Class Compras_Compras
TxtDocumentoImporteCaja.Text = TotalTemp.FormatoNumero TxtDocumentoImporteCaja.Text = TotalTemp.FormatoNumero
TxtOtrosImpuestos.Text = OtrosImpuestos.FormatoNumero TxtOtrosImpuestos.Text = OtrosImpuestos.FormatoNumero
If OtrosImpuestos > 0 Then TrOtrosImpuestos.Visible = True If OtrosImpuestos > 0 Then TrOtrosImpuestos.Visible = True
If OtrosImpuestosRetenciones > 0 Then TrOtrosImpuestos.Visible = True : TxtOtrosImpuestos.Text = OtrosImpuestosRetenciones.FormatoNumero If OtrosImpuestosRetenciones > 0 Then TrOtrosImpuestos.Visible = True : TxtOtrosImpuestos.Text = (-OtrosImpuestosRetenciones).FormatoNumero
HFDiferenciaCompra.Value = TxtTotal.Text HFDiferenciaCompra.Value = TxtTotal.Text
HdnCompraSaldo.Value = TotalTemp.ToString HdnCompraSaldo.Value = TotalTemp.ToString
CompraSaldo = TotalTemp CompraSaldo = TotalTemp
@@ -7452,7 +7452,7 @@ Partial Class Compras_Compras
End If End If
End If End If
If TxtOtrosImpuestos.Text.ToDouble > 0 Then If TxtOtrosImpuestos.Text.ToDouble <> 0 Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimientoImpuestos, TxtOtrosImpuestos.Text.ToDecimal, " ", CveConceptoRetOtrosImpuestos, " ", TxtFechaPago.Text.ToDate, 0, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=TxtOtrosImpuestos.Text.ToDecimal) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimientoImpuestos, TxtOtrosImpuestos.Text.ToDecimal, " ", CveConceptoRetOtrosImpuestos, " ", TxtFechaPago.Text.ToDate, 0, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=TxtOtrosImpuestos.Text.ToDecimal) Then
ErrorMovtosRetISR = True ErrorMovtosRetISR = True
End If End If
@@ -11954,7 +11954,7 @@ Partial Class Compras_Compras
SubTotalConceptos = SubTotal SubTotalConceptos = SubTotal
GvPS.DataSource = TmpDT : GvPS.DataBind() GvPS.DataSource = TmpDT : GvPS.DataBind()
If TxtOtrosImpuestos.Text.ToDouble > 0 Then TxtOtrosImpuestos.Text = "" : TrOtrosImpuestos.Visible = False 'If TxtOtrosImpuestos.Text.ToDouble > 0 Then TxtOtrosImpuestos.Text = "" : TrOtrosImpuestos.Visible = False
'EN ESPERA DE ALGUN CASO QUE LO NECESITE - IPP 5 DICIEMBRE 2016 'EN ESPERA DE ALGUN CASO QUE LO NECESITE - IPP 5 DICIEMBRE 2016
'TempSubTotal = TempSubTotal - SubTotal 'TempSubTotal = TempSubTotal - SubTotal
@@ -16467,7 +16467,7 @@ Partial Class Compras_Compras
TempIEPS = TxtIEPS.Text.ToDouble TempIEPS = TxtIEPS.Text.ToDouble
TempRetIVA = TxtRetIVA.Text.ToDouble TempRetIVA = TxtRetIVA.Text.ToDouble
TempRetISR = TxtRetISR.Text.ToDouble TempRetISR = TxtRetISR.Text.ToDouble
TempTotal = Math.Round(TempSubTotal2 + TempIVA + TempIEPS - TempRetIVA - TempRetISR + TxtOtrosImpuestos.Text.ToDouble, 2) TempTotal = Math.Round(TempSubTotal2 + TempIVA + TempIEPS - TempRetIVA - TempRetISR - TxtOtrosImpuestos.Text.ToDouble, 2)
DifTotales = TxtTotal.Text.ToDouble - TempTotal DifTotales = TxtTotal.Text.ToDouble - TempTotal
Dim DiferenciaPermitida = 0.6 Dim DiferenciaPermitida = 0.6

View File

@@ -3,9 +3,9 @@ Imports System.Data
Imports System.Linq Imports System.Linq
Partial Class Ventas_ClientesAbonar Partial Class Ventas_ClientesAbonar
Inherits ClsPaginas Inherits ClsPaginas
#Region "Propiedades" #Region "Propiedades"
Private ReadOnly Property CveCliente As Integer Private ReadOnly Property CveCliente As Integer
Get Get
@@ -273,9 +273,9 @@ Partial Class Ventas_ClientesAbonar
Set(value As Date) Set(value As Date)
ViewState("Fecha") = value ViewState("Fecha") = value
End Set End Set
End Property End Property
#End Region #End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then If Not Page.IsPostBack Then
CveMonedaPago = -1 CveMonedaPago = -1
@@ -641,8 +641,10 @@ Partial Class Ventas_ClientesAbonar
e.Row.FCRangeValidator("RVComision").MaximumValue = e.Row.DBCampo("Saldo") e.Row.FCRangeValidator("RVComision").MaximumValue = e.Row.DBCampo("Saldo")
End If End If
If e.Row.DBCampo("DescuentoProntoPago").ToDecimal() >= 0 Then If e.Row.DBCampo("DescuentoProntoPago").ToDecimal() > 0 Then
e.Row.FCCheckBox("ChkGenerarNC").Visible = True e.Row.FCCheckBox("ChkGenerarNC").Visible = True
e.Row.FCCheckBox("ChkGenerarNC").Attributes.Add("onclick", String.Format("FnSuma(this,{0},{1}); FnCambia({2},this,{1},0,{3},{4});", e.Row.FCTextBox("TxtAbonar").ClientID, e.Row.DBCampo("Saldo").ToDecimal - e.Row.DBCampo("DescuentoProntoPago").ToDecimal, e.Row.FCCheckBox("ChkGenerarNC").ClientID, CveMonedaFiltro, moneda))
End If End If
Else Else
@@ -1876,12 +1878,12 @@ Partial Class Ventas_ClientesAbonar
Dim DtVentasNC = InicializaDTVentasNC() Dim DtVentasNC = InicializaDTVentasNC()
Dim TotalImporte As Decimal = ObjFacturaDevolucion.DtDetalle.SUM("TotalImporte").ToDecimal() Dim TotalImporte As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("TotalImporte")
Dim ImporteIVA As Decimal = ObjFacturaDevolucion.DtDetalle.SUM("ImporteIVA").ToDecimal() Dim ImporteIVA As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("ImporteIVA")
Dim ImporteRetIVA As Decimal = ObjFacturaDevolucion.DtDetalle.SUM("ImporteRetIVA").ToDecimal() Dim ImporteRetIVA As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("ImporteRetIVA")
Dim ImporteRetISR As Decimal = ObjFacturaDevolucion.DtDetalle.SUM("ImporteRetISR").ToDecimal() Dim ImporteRetISR As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("ImporteRetISR")
Dim ImporteIEPS As Decimal = ObjFacturaDevolucion.DtDetalle.SUM("ImporteIEPS").ToDecimal() Dim ImporteIEPS As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("ImporteIEPS")
Dim Descuento As Decimal = ObjFacturaDevolucion.DtDetalle.SUM("Descuento").ToDecimal() Dim Descuento As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("Descuento")
Dim Amortizacion As Decimal = 0 Dim Amortizacion As Decimal = 0
Dim Total As Decimal = (TotalImporte + ImporteIVA + ImporteIEPS) - (ImporteRetIVA + ImporteRetISR + Descuento + Amortizacion) Dim Total As Decimal = (TotalImporte + ImporteIVA + ImporteIEPS) - (ImporteRetIVA + ImporteRetISR + Descuento + Amortizacion)
@@ -1908,7 +1910,7 @@ Partial Class Ventas_ClientesAbonar
DtVentasNC.AcceptChanges() DtVentasNC.AcceptChanges()
ObjFacturaDevolucion.DtVentasNC = DtVentasNC ObjFacturaDevolucion.DtVentasNC = DtVentasNC
ObjFacturaDevolucion.GenerarPDFFactura = True
Dim Resp = ObjFacturaDevolucion.EmitirFactura(False, Trasac:=Trasac, ObjContPaqTransac:=ObjConta) Dim Resp = ObjFacturaDevolucion.EmitirFactura(False, Trasac:=Trasac, ObjContPaqTransac:=ObjConta)
Return Resp Return Resp
@@ -2056,21 +2058,25 @@ Partial Class Ventas_ClientesAbonar
Dim ImporteReferencia As Decimal = Total Dim ImporteReferencia As Decimal = Total
Dim Porcentaje As Decimal = ((Importe * 100) / ImporteReferencia) / 100 Dim Porcentaje As Decimal = ((Importe * 100) / ImporteReferencia) / 100
Dim FiltroStr As String = "" Dim FiltroStr As String = ""
Dim ImporteTotalConcepto As Decimal = 0
For Each Dr As DataRow In DtImpuestosLocal.Rows For Each Dr As DataRow In DtImpuestosLocal.Rows
FiltroStr = String.Format("ISNULL(PorcentajeIVA,0) = {0} AND ISNULL(PorcentajeRetIVA,0) = {1} AND ISNULL(PorcentajeRetISR,0) = {2} AND ISNULL(PorcentajeIEPS,0) = {3} AND ISNULL(CveSubProyecto,0) = {4} ", Dr("PorcentajeIVA").ToString.ToDecimal, Dr("PorcentajeRetIVA").ToString.ToDecimal, Dr("PorcentajeRetISR").ToString.ToDecimal, Dr("PorcentajeIEPS").ToString.ToDecimal, Dr("CveSubProyecto")) FiltroStr = String.Format("ISNULL(PorcentajeIVA,0) = {0} AND ISNULL(PorcentajeRetIVA,0) = {1} AND ISNULL(PorcentajeRetISR,0) = {2} AND ISNULL(PorcentajeIEPS,0) = {3} AND ISNULL(CveSubProyecto,0) = {4} ", Dr("PorcentajeIVA").ToString.ToDecimal, Dr("PorcentajeRetIVA").ToString.ToDecimal, Dr("PorcentajeRetISR").ToString.ToDecimal, Dr("PorcentajeIEPS").ToString.ToDecimal, Dr("CveSubProyecto"))
Dr("ImporteTotal") = Math.Round(Porcentaje * (TmpDT.SUM("TotalImporte", FiltroStr) - TmpDT.SUM("Descuento", FiltroStr)), 2) ImporteTotalConcepto = Porcentaje * (TmpDT.SUMD("TotalImporte", FiltroStr) - TmpDT.SUMD("Descuento", FiltroStr))
Dr("ImporteIVA") = (Dr("ImporteTotal").ToString().ToDecimal() * Dr("PorcentajeIVA").ToString().ToDecimal()).RoundSQL(2) Dr("ImportePU") = ImporteTotalConcepto.RoundSQL(6)
Dr("ImporteRetIVA") = (Dr("ImporteTotal").ToString().ToDecimal() * Dr("PorcentajeRetIVA").ToString().ToDecimal()).RoundSQL(2) Dr("ImporteTotal") = ImporteTotalConcepto.RoundSQL(2)
Dr("ImporteRetISR") = (Dr("ImporteTotal").ToString().ToDecimal() * Dr("PorcentajeRetISR").ToString().ToDecimal()).RoundSQL(2)
Dr("ImporteIEPS") = (Dr("ImporteTotal").ToString().ToDecimal() * Dr("PorcentajeIEPS").ToString().ToDecimal()).RoundSQL(2) Dr("ImporteIVA") = (ImporteTotalConcepto * Dr("PorcentajeIVA").ToString().ToDecimal()).RoundSQL(2)
Dr("ImporteRetIVA") = (ImporteTotalConcepto * Dr("PorcentajeRetIVA").ToString().ToDecimal()).RoundSQL(2)
Dr("ImporteRetISR") = (ImporteTotalConcepto * Dr("PorcentajeRetISR").ToString().ToDecimal()).RoundSQL(2)
Dr("ImporteIEPS") = (ImporteTotalConcepto * Dr("PorcentajeIEPS").ToString().ToDecimal()).RoundSQL(2)
'Dr("ImporteIVA") = Math.Round(Porcentaje * TmpDT.SUM("ImporteIVA", FiltroStr), 2) 'Dr("ImporteIVA") = Math.Round(Porcentaje * TmpDT.SUM("ImporteIVA", FiltroStr), 2)
'Dr("ImporteRetIVA") = Math.Round(Porcentaje * TmpDT.SUM("ImporteRetIVA", FiltroStr), 2) 'Dr("ImporteRetIVA") = Math.Round(Porcentaje * TmpDT.SUM("ImporteRetIVA", FiltroStr), 2)
'Dr("ImporteRetISR") = Math.Round(Porcentaje * TmpDT.SUM("ImporteRetISR", FiltroStr), 2) 'Dr("ImporteRetISR") = Math.Round(Porcentaje * TmpDT.SUM("ImporteRetISR", FiltroStr), 2)
'Dr("ImporteIEPS") = Math.Round(Porcentaje * TmpDT.SUM("ImporteIEPS", FiltroStr), 2) 'Dr("ImporteIEPS") = Math.Round(Porcentaje * TmpDT.SUM("ImporteIEPS", FiltroStr), 2)
Dr("ImportePU") = Dr("ImporteTotal").ToString.ToDecimal '(Dr("ImporteTotal").ToString.ToDecimal - Dr("ImporteIVA").ToString.ToDecimal - Dr("ImporteRetIVA").ToString.ToDecimal - Dr("ImporteRetISR").ToString.ToDecimal - Dr("ImporteIEPS").ToString.ToDecimal) '(Dr("ImporteTotal").ToString.ToDecimal - Dr("ImporteIVA").ToString.ToDecimal - Dr("ImporteRetIVA").ToString.ToDecimal - Dr("ImporteRetISR").ToString.ToDecimal - Dr("ImporteIEPS").ToString.ToDecimal)
Next Next
'codigo para ajuste de centavo, si el importe total no cuadra con los totales 'codigo para ajuste de centavo, si el importe total no cuadra con los totales
Dim difTmp As Decimal = Importe - (DtImpuestosLocal.SUMD("ImporteTotal") + DtImpuestosLocal.SUMD("ImporteIVA") + DtImpuestosLocal.SUMD("ImporteIEPS") - DtImpuestosLocal.SUMD("ImporteRetIVA") - DtImpuestosLocal.SUMD("ImporteRetISR")) Dim difTmp As Decimal = Importe - (DtImpuestosLocal.SUMD("ImporteTotal") + DtImpuestosLocal.SUMD("ImporteIVA") + DtImpuestosLocal.SUMD("ImporteIEPS") - DtImpuestosLocal.SUMD("ImporteRetIVA") - DtImpuestosLocal.SUMD("ImporteRetISR"))
@@ -2308,8 +2314,8 @@ Partial Class Ventas_ClientesAbonar
UpDatos.Update() UpDatos.Update()
UPVentas.Update() UPVentas.Update()
End Sub End Sub
#Region " PAGAR CON PESOS " #Region " PAGAR CON PESOS "
Protected Sub ChkPagarPesos_CheckedChanged(sender As Object, e As EventArgs) Protected Sub ChkPagarPesos_CheckedChanged(sender As Object, e As EventArgs)
If ChkPagarPesos.Checked Then If ChkPagarPesos.Checked Then
@@ -2330,9 +2336,9 @@ Partial Class Ventas_ClientesAbonar
CargaDatos(2) CargaDatos(2)
RegistraScript("CambiaPesosDolares();") RegistraScript("CambiaPesosDolares();")
End Sub End Sub
#End Region #End Region
#Region "PAGAR CON DOLARES" #Region "PAGAR CON DOLARES"
Protected Sub ChkPagarDolares_CheckedChanged(sender As Object, e As EventArgs) Protected Sub ChkPagarDolares_CheckedChanged(sender As Object, e As EventArgs)
If ChkPagarDolares.Checked Then If ChkPagarDolares.Checked Then
@@ -2353,9 +2359,9 @@ Partial Class Ventas_ClientesAbonar
CargaDatos(1) CargaDatos(1)
RegistraScript("CambiaDolaresPesos();") RegistraScript("CambiaDolaresPesos();")
End Sub End Sub
#End Region #End Region
#Region " CUENTAS DEPOSITOS" #Region " CUENTAS DEPOSITOS"
Private Sub CargaCuentasDepositos() Private Sub CargaCuentasDepositos()
DdlCuentaDeposito.Items.Clear() DdlCuentaDeposito.Items.Clear()
@@ -2422,9 +2428,9 @@ Partial Class Ventas_ClientesAbonar
End If End If
Dep.Dispose() Dep.Dispose()
UpCuentaDeposito.Update() UpCuentaDeposito.Update()
End Sub End Sub
#End Region #End Region
#Region " COMPLEMENTOS PAGO " #Region " COMPLEMENTOS PAGO "
Private Function EmitirComplementoPago(CveIE As Integer, CveVentas As List(Of Integer), Series As List(Of String)) As String Private Function EmitirComplementoPago(CveIE As Integer, CveVentas As List(Of Integer), Series As List(Of String)) As String
If Not ChkComplementoPago.Checked Then If Not ChkComplementoPago.Checked Then
@@ -2476,14 +2482,14 @@ Partial Class Ventas_ClientesAbonar
' Next ' Next
Return Retorno.ToString Return Retorno.ToString
End Function End Function
#End Region #End Region
#Region "SALDAR CUENTAS" #Region "SALDAR CUENTAS"
Private Sub BtnSaldarCuentasIncobrables_Click(sender As Object, e As EventArgs) Handles BtnSaldarCuentasIncobrables.Click Private Sub BtnSaldarCuentasIncobrables_Click(sender As Object, e As EventArgs) Handles BtnSaldarCuentasIncobrables.Click
Dim ObjConta As New ClsContabilidad Dim ObjConta As New ClsContabilidad
ObjConta.IniciaTransacSQL() ObjConta.IniciaTransacSQL()
@@ -2507,7 +2513,10 @@ Partial Class Ventas_ClientesAbonar
End If End If
End If End If
ObjIE.Dispose() ObjIE.Dispose()
CvePrePoliza = ObjConta.AddPrePolizas("Bancos/ClientesAbonar/SaldarI", 47, 0, 0, 1, TxtFechaIncobrable.Text.ToDate, TxtObsSaldarIncobrable.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
For Each gr As GridViewRow In GvCxC.Rows For Each gr As GridViewRow In GvCxC.Rows
If gr.FCCheckBox("Chk").Checked Then If gr.FCCheckBox("Chk").Checked Then
@@ -2540,6 +2549,7 @@ Partial Class Ventas_ClientesAbonar
Dim ImpuestosMovto As Boolean = False Dim ImpuestosMovto As Boolean = False
Dim IdCuentaContableNoDeducible As Integer = 0 Dim IdCuentaContableNoDeducible As Integer = 0
Dim CveSubProyecto As Integer = gr.DataKey("CveSubProyecto").ToEntero Dim CveSubProyecto As Integer = gr.DataKey("CveSubProyecto").ToEntero
Dim ConceptoPartida As String = TxtObsSaldarIncobrable.Text.Trim & " " & gr.DataKey("SerieFolio").ToString
If CveConceptoDeduccion = 255 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(266).ToEntero If CveConceptoDeduccion = 255 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(266).ToEntero
If CveConceptoDeduccion = 211 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(559).ToEntero If CveConceptoDeduccion = 211 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(559).ToEntero
@@ -2561,9 +2571,8 @@ Partial Class Ventas_ClientesAbonar
UsaComplementaria = True UsaComplementaria = True
End If End If
If MsgError = "" Then If MsgError = "" Then
CvePrePoliza = ObjConta.AddPrePolizas("Bancos/ClientesAbonar/SaldarI", 47, gr.DataKey("Saldo").ToDecimal, gr.DataKey("Saldo").ToDecimal, gr.DataKey("CveMoneda").ToEntero, TxtFechaIncobrable.Text.ToDate, TxtObsSaldarIncobrable.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If tCveMoneda = 2 Then If tCveMoneda = 2 Then
IdCtaContable = IdCtaContMonedaExtranjera IdCtaContable = IdCtaContMonedaExtranjera
Else Else
@@ -2572,16 +2581,16 @@ Partial Class Ventas_ClientesAbonar
If UsaComplementaria AndAlso tCveMoneda = 2 Then If UsaComplementaria AndAlso tCveMoneda = 2 Then
'normal 'normal
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, Saldo, gr.DataKey("SerieFolio").ToString, CveConceptoCliente, TxtObsSaldarIncobrable.Text.Trim, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=IdCtaContable, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, Saldo, Saldo), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, Saldo, gr.DataKey("SerieFolio").ToString, CveConceptoCliente, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=IdCtaContable, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, Saldo, Saldo), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento" MsgError = "Ocurrio un error al saldar el movimiento"
End If End If
'complementaria 'complementaria
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, 0, gr.DataKey("SerieFolio").ToString, 207, TxtObsSaldarIncobrable.Text.Trim, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=IdCtaContComplementaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, Saldo, (Saldo * TCVenta) - Saldo), ImporteME:=Saldo, CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, 0, gr.DataKey("SerieFolio").ToString, 207, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=IdCtaContComplementaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, Saldo, (Saldo * TCVenta) - Saldo), ImporteME:=Saldo, CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento" MsgError = "Ocurrio un error al saldar el movimiento"
End If End If
Else Else
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, Saldo, gr.DataKey("SerieFolio").ToString, CveConceptoCliente, TxtObsSaldarIncobrable.Text.Trim, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=IdCtaContable, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, Saldo, Saldo * TCVenta), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, Saldo, gr.DataKey("SerieFolio").ToString, CveConceptoCliente, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=IdCtaContable, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, Saldo, Saldo * TCVenta), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento" MsgError = "Ocurrio un error al saldar el movimiento"
End If End If
@@ -2592,11 +2601,11 @@ Partial Class Ventas_ClientesAbonar
Dim ImporteFluctuacion As Decimal = 0 Dim ImporteFluctuacion As Decimal = 0
ImporteFluctuacion = Saldo * (TCPago - TCVenta) ImporteFluctuacion = Saldo * (TCPago - TCVenta)
If TCPago > TCVenta Then If TCPago > TCVenta Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 64, TxtObsSaldarIncobrable.Text.Trim, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaGananciaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 64, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaGananciaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento" MsgError = "Ocurrio un error al saldar el movimiento"
End If End If
Else Else
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 65, TxtObsSaldarIncobrable.Text.Trim, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 65, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento" MsgError = "Ocurrio un error al saldar el movimiento"
End If End If
End If End If
@@ -2620,18 +2629,18 @@ Partial Class Ventas_ClientesAbonar
IdCtaContable = If(IdCtaIVAXTrasladar > 0, IdCtaIVAXTrasladar, UsuarioActual.Empresa.IdCuentaIVAxTrasladar) IdCtaContable = If(IdCtaIVAXTrasladar > 0, IdCtaIVAXTrasladar, UsuarioActual.Empresa.IdCuentaIVAxTrasladar)
CveCuenta = If(CveCuentaIVAxTrasladar > 0, CveCuentaIVAxTrasladar, UsuarioActual.Empresa.CveCuentaIVAxTrasladar) CveCuenta = If(CveCuentaIVAxTrasladar > 0, CveCuentaIVAxTrasladar, UsuarioActual.Empresa.CveCuentaIVAxTrasladar)
If IVA > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IVA, gr.DataKey("SerieFolio").ToString, 13, TxtObsSaldarIncobrable.Text.Trim, TxtFechaIncobrable.Text.ToDate, IdCtaContable, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, IVA, IVA * TCVenta), CveCuenta:=CveCuenta, PorcentajeImpuesto:=PorcentajeImpuesto, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then If IVA > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IVA, gr.DataKey("SerieFolio").ToString, 13, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, IVA, IVA * TCVenta), CveCuenta:=CveCuenta, PorcentajeImpuesto:=PorcentajeImpuesto, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento" MsgError = "Ocurrio un error al saldar el movimiento"
End If End If
IdCtaContable = UsuarioActual.Empresa.IdCuentaIEPSxTrasladar IdCtaContable = UsuarioActual.Empresa.IdCuentaIEPSxTrasladar
CveCuenta = UsuarioActual.Empresa.CveCuentaIEPSxTrasladar CveCuenta = UsuarioActual.Empresa.CveCuentaIEPSxTrasladar
If IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IEPS, gr.DataKey("SerieFolio").ToString, 38, TxtObsSaldarIncobrable.Text.Trim, TxtFechaIncobrable.Text.ToDate, IdCtaContable, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, IEPS, IEPS * TCVenta), CveCuenta:=CveCuenta, PorcentajeImpuesto:=PorcentajeImpuesto, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then If IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IEPS, gr.DataKey("SerieFolio").ToString, 38, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, IEPS, IEPS * TCVenta), CveCuenta:=CveCuenta, PorcentajeImpuesto:=PorcentajeImpuesto, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento" MsgError = "Ocurrio un error al saldar el movimiento"
End If End If
'al gasto,Subtotal 'al gasto,Subtotal
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, SubtotalMovto, SubTotal, gr.DataKey("SerieFolio").ToString, CveConceptoDeduccion, TxtObsSaldarIncobrable.Text.Trim, TxtFechaIncobrable.Text.ToDate, IdCuentaContableNoDeducible, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=SubTotal, CveCuenta:=-1, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, SubtotalMovto, SubTotal, gr.DataKey("SerieFolio").ToString, CveConceptoDeduccion, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCuentaContableNoDeducible, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=SubTotal, CveCuenta:=-1, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento" MsgError = "Ocurrio un error al saldar el movimiento"
End If End If
@@ -2772,10 +2781,10 @@ Partial Class Ventas_ClientesAbonar
UpGuardar.Update() UpGuardar.Update()
End Sub End Sub
#End Region #End Region
#Region "COMPLEMENTO DE PAGO - ELIMINAR POR SUSTITUCION" #Region "COMPLEMENTO DE PAGO - ELIMINAR POR SUSTITUCION"
Protected Sub CargaIESustituir() Protected Sub CargaIESustituir()
Dim ObjIE As New ClsBancos() Dim ObjIE As New ClsBancos()
@@ -2952,10 +2961,10 @@ Partial Class Ventas_ClientesAbonar
Private Sub BtnVincularIntermediario_Click(sender As Object, e As EventArgs) Handles BtnVincularIntermediario.Click Private Sub BtnVincularIntermediario_Click(sender As Object, e As EventArgs) Handles BtnVincularIntermediario.Click
RegistraScript("$('#ModalVincularIntermediario').modal('hide')", "hidemodal") RegistraScript("$('#ModalVincularIntermediario').modal('hide')", "hidemodal")
End Sub End Sub
#End Region #End Region
Protected Sub BtnCambiaTipoMoneda_Click(sender As Object, e As EventArgs) Protected Sub BtnCambiaTipoMoneda_Click(sender As Object, e As EventArgs)
CambiaTipoMoneda() CambiaTipoMoneda()
End Sub End Sub

View File

@@ -128,6 +128,17 @@
<asp:CheckBox ID="ChkEstatus" runat="server" /> <asp:CheckBox ID="ChkEstatus" runat="server" />
</div> </div>
</div> </div>
<div class="row">
<label class="col-md-2 truncate">Tipo Aplicacion:</label>
<div class="col-md-4">
<asp:DropDownList ID="DdlTipoAplicacion" DataTextField="Moneda" DataValueField="CveMoneda" CssClass="select2me" runat="server" Width="350px">
<asp:ListItem Value ="-1">Seleccione</asp:ListItem>
<asp:ListItem Value ="Descuento">Descuento</asp:ListItem>
<asp:ListItem Value ="PU">PU</asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -380,7 +380,9 @@ Partial Class Ventas_Promociones
Dim ObjVentas As New ClsVentas Dim ObjVentas As New ClsVentas
Dim TieneError = False Dim TieneError = False
ObjVentas.IniciaTransacSQL() ObjVentas.IniciaTransacSQL()
CvePromocion = ObjVentas.AddPromociones(TxtPromocion.Text.Trim, If(IsDate(TxtFechaI.Text), TxtFechaI.Text.ToDate, MinFecha), If(IsDate(TxtFechaF.Text), TxtFechaF.Text.ToDate, MaxFecha), DdlVendedor.SelectedValue.ToEntero, DdlCliente.SelectedValue.ToEntero, ChkEstatus.Checked, DdlMoneda.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero) CvePromocion = ObjVentas.AddPromociones(TxtPromocion.Text.Trim, If(IsDate(TxtFechaI.Text), TxtFechaI.Text.ToDate, MinFecha), If(IsDate(TxtFechaF.Text), TxtFechaF.Text.ToDate, MaxFecha),
DdlVendedor.SelectedValue.ToEntero, DdlCliente.SelectedValue.ToEntero, ChkEstatus.Checked, DdlMoneda.SelectedValue.ToEntero, UsuarioActual.CveUsuario,
UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero, DdlTipoAplicacion.SelectedValue.ToString)
If CvePromocion > 0 Then If CvePromocion > 0 Then
For Each Dr As DataRow In TempDT.Rows For Each Dr As DataRow In TempDT.Rows

View File

@@ -4174,7 +4174,10 @@ Partial Class Ventas
End If End If
If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Dev", "Ant") Then If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Dev", "Ant") Then
If ObjVentas.GetVentasAntNC(-1, CveVenta) Then Dim AplicaAmortizacion As Boolean = False
If DdlTipoComprobante.SelectedValue.Contiene("Ant") Then AplicaAmortizacion = True
If ObjVentas.GetVentasAntNC(-1, CveVenta, AplicaAmortizacion) Then
GvNC.DataSource = ObjVentas.DtResultados GvNC.DataSource = ObjVentas.DtResultados
TmpDTNCVinculadas = ObjVentas.DtResultados TmpDTNCVinculadas = ObjVentas.DtResultados
GvNC.Caption = " <table width='100%'><tr><td style='text-align:center'>Ventas Aplicadas</td></tr></table>" GvNC.Caption = " <table width='100%'><tr><td style='text-align:center'>Ventas Aplicadas</td></tr></table>"
@@ -4187,7 +4190,7 @@ Partial Class Ventas
Next Next
End If End If
End If End If
End If End If
If GvNC.Rows.Count > 0 Then If GvNC.Rows.Count > 0 Then
ImgAntiPend.Visible = False ImgAntiPend.Visible = False