|
|
|
|
@@ -3,9 +3,9 @@ Imports System.Data
|
|
|
|
|
Imports System.Linq
|
|
|
|
|
|
|
|
|
|
Partial Class Ventas_ClientesAbonar
|
|
|
|
|
Inherits ClsPaginas
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Inherits ClsPaginas
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#Region "Propiedades"
|
|
|
|
|
Private ReadOnly Property CveCliente As Integer
|
|
|
|
|
Get
|
|
|
|
|
@@ -273,9 +273,9 @@ Partial Class Ventas_ClientesAbonar
|
|
|
|
|
Set(value As Date)
|
|
|
|
|
ViewState("Fecha") = value
|
|
|
|
|
End Set
|
|
|
|
|
End Property
|
|
|
|
|
End Property
|
|
|
|
|
#End Region
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
|
|
|
|
If Not Page.IsPostBack Then
|
|
|
|
|
CveMonedaPago = -1
|
|
|
|
|
@@ -641,8 +641,10 @@ Partial Class Ventas_ClientesAbonar
|
|
|
|
|
e.Row.FCRangeValidator("RVComision").MaximumValue = e.Row.DBCampo("Saldo")
|
|
|
|
|
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").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
|
|
|
|
|
|
|
|
|
|
Else
|
|
|
|
|
@@ -1876,12 +1878,12 @@ Partial Class Ventas_ClientesAbonar
|
|
|
|
|
|
|
|
|
|
Dim DtVentasNC = InicializaDTVentasNC()
|
|
|
|
|
|
|
|
|
|
Dim TotalImporte As Decimal = ObjFacturaDevolucion.DtDetalle.SUM("TotalImporte").ToDecimal()
|
|
|
|
|
Dim ImporteIVA As Decimal = ObjFacturaDevolucion.DtDetalle.SUM("ImporteIVA").ToDecimal()
|
|
|
|
|
Dim ImporteRetIVA As Decimal = ObjFacturaDevolucion.DtDetalle.SUM("ImporteRetIVA").ToDecimal()
|
|
|
|
|
Dim ImporteRetISR As Decimal = ObjFacturaDevolucion.DtDetalle.SUM("ImporteRetISR").ToDecimal()
|
|
|
|
|
Dim ImporteIEPS As Decimal = ObjFacturaDevolucion.DtDetalle.SUM("ImporteIEPS").ToDecimal()
|
|
|
|
|
Dim Descuento As Decimal = ObjFacturaDevolucion.DtDetalle.SUM("Descuento").ToDecimal()
|
|
|
|
|
Dim TotalImporte As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("TotalImporte")
|
|
|
|
|
Dim ImporteIVA As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("ImporteIVA")
|
|
|
|
|
Dim ImporteRetIVA As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("ImporteRetIVA")
|
|
|
|
|
Dim ImporteRetISR As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("ImporteRetISR")
|
|
|
|
|
Dim ImporteIEPS As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("ImporteIEPS")
|
|
|
|
|
Dim Descuento As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("Descuento")
|
|
|
|
|
Dim Amortizacion As Decimal = 0
|
|
|
|
|
|
|
|
|
|
Dim Total As Decimal = (TotalImporte + ImporteIVA + ImporteIEPS) - (ImporteRetIVA + ImporteRetISR + Descuento + Amortizacion)
|
|
|
|
|
@@ -1908,7 +1910,7 @@ Partial Class Ventas_ClientesAbonar
|
|
|
|
|
DtVentasNC.AcceptChanges()
|
|
|
|
|
|
|
|
|
|
ObjFacturaDevolucion.DtVentasNC = DtVentasNC
|
|
|
|
|
|
|
|
|
|
ObjFacturaDevolucion.GenerarPDFFactura = True
|
|
|
|
|
Dim Resp = ObjFacturaDevolucion.EmitirFactura(False, Trasac:=Trasac, ObjContPaqTransac:=ObjConta)
|
|
|
|
|
Return Resp
|
|
|
|
|
|
|
|
|
|
@@ -2056,21 +2058,25 @@ Partial Class Ventas_ClientesAbonar
|
|
|
|
|
Dim ImporteReferencia As Decimal = Total
|
|
|
|
|
Dim Porcentaje As Decimal = ((Importe * 100) / ImporteReferencia) / 100
|
|
|
|
|
Dim FiltroStr As String = ""
|
|
|
|
|
Dim ImporteTotalConcepto As Decimal = 0
|
|
|
|
|
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"))
|
|
|
|
|
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("ImporteRetIVA") = (Dr("ImporteTotal").ToString().ToDecimal() * Dr("PorcentajeRetIVA").ToString().ToDecimal()).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("ImportePU") = ImporteTotalConcepto.RoundSQL(6)
|
|
|
|
|
Dr("ImporteTotal") = ImporteTotalConcepto.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("ImporteRetIVA") = Math.Round(Porcentaje * TmpDT.SUM("ImporteRetIVA", FiltroStr), 2)
|
|
|
|
|
'Dr("ImporteRetISR") = Math.Round(Porcentaje * TmpDT.SUM("ImporteRetISR", 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
|
|
|
|
|
'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"))
|
|
|
|
|
@@ -2308,8 +2314,8 @@ Partial Class Ventas_ClientesAbonar
|
|
|
|
|
|
|
|
|
|
UpDatos.Update()
|
|
|
|
|
UPVentas.Update()
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
#Region " PAGAR CON PESOS "
|
|
|
|
|
Protected Sub ChkPagarPesos_CheckedChanged(sender As Object, e As EventArgs)
|
|
|
|
|
If ChkPagarPesos.Checked Then
|
|
|
|
|
@@ -2330,9 +2336,9 @@ Partial Class Ventas_ClientesAbonar
|
|
|
|
|
|
|
|
|
|
CargaDatos(2)
|
|
|
|
|
RegistraScript("CambiaPesosDolares();")
|
|
|
|
|
End Sub
|
|
|
|
|
End Sub
|
|
|
|
|
#End Region
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#Region "PAGAR CON DOLARES"
|
|
|
|
|
Protected Sub ChkPagarDolares_CheckedChanged(sender As Object, e As EventArgs)
|
|
|
|
|
If ChkPagarDolares.Checked Then
|
|
|
|
|
@@ -2353,9 +2359,9 @@ Partial Class Ventas_ClientesAbonar
|
|
|
|
|
|
|
|
|
|
CargaDatos(1)
|
|
|
|
|
RegistraScript("CambiaDolaresPesos();")
|
|
|
|
|
End Sub
|
|
|
|
|
End Sub
|
|
|
|
|
#End Region
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#Region " CUENTAS DEPOSITOS"
|
|
|
|
|
Private Sub CargaCuentasDepositos()
|
|
|
|
|
DdlCuentaDeposito.Items.Clear()
|
|
|
|
|
@@ -2422,9 +2428,9 @@ Partial Class Ventas_ClientesAbonar
|
|
|
|
|
End If
|
|
|
|
|
Dep.Dispose()
|
|
|
|
|
UpCuentaDeposito.Update()
|
|
|
|
|
End Sub
|
|
|
|
|
End Sub
|
|
|
|
|
#End Region
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#Region " COMPLEMENTOS PAGO "
|
|
|
|
|
Private Function EmitirComplementoPago(CveIE As Integer, CveVentas As List(Of Integer), Series As List(Of String)) As String
|
|
|
|
|
If Not ChkComplementoPago.Checked Then
|
|
|
|
|
@@ -2476,14 +2482,14 @@ Partial Class Ventas_ClientesAbonar
|
|
|
|
|
' Next
|
|
|
|
|
|
|
|
|
|
Return Retorno.ToString
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#End Region
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#Region "SALDAR CUENTAS"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Private Sub BtnSaldarCuentasIncobrables_Click(sender As Object, e As EventArgs) Handles BtnSaldarCuentasIncobrables.Click
|
|
|
|
|
Dim ObjConta As New ClsContabilidad
|
|
|
|
|
ObjConta.IniciaTransacSQL()
|
|
|
|
|
@@ -2507,7 +2513,10 @@ Partial Class Ventas_ClientesAbonar
|
|
|
|
|
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
|
|
|
|
|
If gr.FCCheckBox("Chk").Checked Then
|
|
|
|
|
@@ -2540,6 +2549,7 @@ Partial Class Ventas_ClientesAbonar
|
|
|
|
|
Dim ImpuestosMovto As Boolean = False
|
|
|
|
|
Dim IdCuentaContableNoDeducible As Integer = 0
|
|
|
|
|
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 = 211 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(559).ToEntero
|
|
|
|
|
@@ -2561,9 +2571,8 @@ Partial Class Ventas_ClientesAbonar
|
|
|
|
|
UsaComplementaria = True
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
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 MsgError = "" Then
|
|
|
|
|
|
|
|
|
|
If tCveMoneda = 2 Then
|
|
|
|
|
IdCtaContable = IdCtaContMonedaExtranjera
|
|
|
|
|
Else
|
|
|
|
|
@@ -2572,16 +2581,16 @@ Partial Class Ventas_ClientesAbonar
|
|
|
|
|
|
|
|
|
|
If UsaComplementaria AndAlso tCveMoneda = 2 Then
|
|
|
|
|
'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"
|
|
|
|
|
End If
|
|
|
|
|
'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"
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
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"
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
@@ -2592,11 +2601,11 @@ Partial Class Ventas_ClientesAbonar
|
|
|
|
|
Dim ImporteFluctuacion As Decimal = 0
|
|
|
|
|
ImporteFluctuacion = Saldo * (TCPago - TCVenta)
|
|
|
|
|
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"
|
|
|
|
|
End If
|
|
|
|
|
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"
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
@@ -2620,18 +2629,18 @@ Partial Class Ventas_ClientesAbonar
|
|
|
|
|
|
|
|
|
|
IdCtaContable = If(IdCtaIVAXTrasladar > 0, IdCtaIVAXTrasladar, UsuarioActual.Empresa.IdCuentaIVAxTrasladar)
|
|
|
|
|
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"
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
IdCtaContable = UsuarioActual.Empresa.IdCuentaIEPSxTrasladar
|
|
|
|
|
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"
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
'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"
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
@@ -2772,10 +2781,10 @@ Partial Class Ventas_ClientesAbonar
|
|
|
|
|
|
|
|
|
|
UpGuardar.Update()
|
|
|
|
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
#End Region
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#Region "COMPLEMENTO DE PAGO - ELIMINAR POR SUSTITUCION"
|
|
|
|
|
Protected Sub CargaIESustituir()
|
|
|
|
|
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
|
|
|
|
|
RegistraScript("$('#ModalVincularIntermediario').modal('hide')", "hidemodal")
|
|
|
|
|
End Sub
|
|
|
|
|
End Sub
|
|
|
|
|
#End Region
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Protected Sub BtnCambiaTipoMoneda_Click(sender As Object, e As EventArgs)
|
|
|
|
|
CambiaTipoMoneda()
|
|
|
|
|
End Sub
|
|
|
|
|
|