-- proceso de simplificacion y validacion
This commit is contained in:
@@ -189,14 +189,6 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Private Property EmpresaPrueba As Boolean
|
|
||||||
Get
|
|
||||||
Return CBool(ViewState("EmpresaPrueba"))
|
|
||||||
End Get
|
|
||||||
Set(value As Boolean)
|
|
||||||
ViewState("EmpresaPrueba") = value
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Private Property Mail As String
|
Private Property Mail As String
|
||||||
Get
|
Get
|
||||||
@@ -313,14 +305,8 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
|
|
||||||
TxtOtrosImportes.Attributes.Add("onKeyUp", String.Format("FnSuma(this,{0},{1});", "TxtTotal", 0))
|
TxtOtrosImportes.Attributes.Add("onKeyUp", String.Format("FnSuma(this,{0},{1});", "TxtTotal", 0))
|
||||||
|
|
||||||
|
|
||||||
If Not UsuarioActual.Empresa.UsaAC Then
|
|
||||||
EmpresaPrueba = True
|
|
||||||
End If
|
|
||||||
|
|
||||||
If CveMoneda > 0 Then LbTipoMoneda.Text = String.Format("Pago en {0}", GlobalDTMonedas.FiltraParametros(String.Format("CveMoneda = {0}", CveMoneda)).Rows(0)("Moneda"))
|
If CveMoneda > 0 Then LbTipoMoneda.Text = String.Format("Pago en {0}", GlobalDTMonedas.FiltraParametros(String.Format("CveMoneda = {0}", CveMoneda)).Rows(0)("Moneda"))
|
||||||
|
|
||||||
|
|
||||||
If CveMoneda = 2 Then
|
If CveMoneda = 2 Then
|
||||||
ChkPagarPesos.Visible = True
|
ChkPagarPesos.Visible = True
|
||||||
TxtTC.Text = GlobalTipoCambio(Fecha).FormatoNumero(4)
|
TxtTC.Text = GlobalTipoCambio(Fecha).FormatoNumero(4)
|
||||||
@@ -814,8 +800,12 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
'inserto las ventas que voy a pagar
|
'inserto las ventas que voy a pagar
|
||||||
For Each gvr As GridViewRow In GvCxC.Rows
|
For Each gvr As GridViewRow In GvCxC.Rows
|
||||||
If gvr.FCCheckBox("Chk").Checked Then
|
If gvr.FCCheckBox("Chk").Checked Then
|
||||||
|
Dim ObjFactura As Modelos.Factura
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||||
|
ObjFactura = New Modelos.Factura(UsuarioActual, gvr.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa)
|
||||||
|
End If
|
||||||
|
|
||||||
Dim ObjFactura As New Modelos.Factura(UsuarioActual, gvr.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa)
|
|
||||||
|
|
||||||
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then 'Si la venta viene en Pesos y se va a pagar en Pesos
|
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then 'Si la venta viene en Pesos y se va a pagar en Pesos
|
||||||
tipoCambioPago = 1
|
tipoCambioPago = 1
|
||||||
@@ -915,7 +905,7 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
|
|
||||||
Case 8 'Ret IVA x Trasladar
|
Case 8 'Ret IVA x Trasladar
|
||||||
If EsAnticipoEspecial Then Exit Select
|
If EsAnticipoEspecial Then Exit Select
|
||||||
If ObjFactura.CveTipoRetencion = 4 Then
|
If ObjFactura IsNot Nothing AndAlso ObjFactura.CveTipoRetencion = 4 Then
|
||||||
Exit Select
|
Exit Select
|
||||||
End If
|
End If
|
||||||
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
|
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
|
||||||
@@ -964,7 +954,7 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
|
|
||||||
Case 313 'Ret Iva Servicios
|
Case 313 'Ret Iva Servicios
|
||||||
If EsAnticipoEspecial Then Exit Select
|
If EsAnticipoEspecial Then Exit Select
|
||||||
If ObjFactura.CveTipoRetencion = 4 Then
|
If ObjFactura IsNot Nothing AndAlso ObjFactura.CveTipoRetencion = 4 Then
|
||||||
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
|
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
|
||||||
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
|
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
|
||||||
importeMX = ImporteMovimiento
|
importeMX = ImporteMovimiento
|
||||||
@@ -1079,7 +1069,7 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
If tipoCambioVenta > 1 Then ConceptoMovimiento += $" TC:{tipoCambioVenta} ${ImporteMovimiento.FormatoNumero(2)}"
|
If tipoCambioVenta > 1 Then ConceptoMovimiento += $" TC:{tipoCambioVenta} ${ImporteMovimiento.FormatoNumero(2)}"
|
||||||
Case 62 'Ret IVA Trasladado
|
Case 62 'Ret IVA Trasladado
|
||||||
If EsAnticipoEspecial Then Exit Select
|
If EsAnticipoEspecial Then Exit Select
|
||||||
If ObjFactura.CveTipoRetencion = 4 Then
|
If ObjFactura IsNot Nothing AndAlso ObjFactura.CveTipoRetencion = 4 Then
|
||||||
Exit Select
|
Exit Select
|
||||||
End If
|
End If
|
||||||
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
|
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
|
||||||
@@ -1129,7 +1119,7 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
|
|
||||||
Case 314 'Ret Iva Servicios Traslado
|
Case 314 'Ret Iva Servicios Traslado
|
||||||
If EsAnticipoEspecial Then Exit Select
|
If EsAnticipoEspecial Then Exit Select
|
||||||
If ObjFactura.CveTipoRetencion = 4 Then
|
If ObjFactura IsNot Nothing AndAlso ObjFactura.CveTipoRetencion = 4 Then
|
||||||
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
|
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
|
||||||
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
|
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
|
||||||
importeMX = ImporteMovimiento
|
importeMX = ImporteMovimiento
|
||||||
@@ -1482,7 +1472,7 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
If gvr.FCCheckBox("ChkGenerarNC").Checked Then
|
If gvr.FCCheckBox("ChkGenerarNC").Checked AndAlso ObjFactura IsNot Nothing Then
|
||||||
ObjFactura.DescuentoProntoPago = gvr.DataKey("DescuentoProntoPago").ToDecimal()
|
ObjFactura.DescuentoProntoPago = gvr.DataKey("DescuentoProntoPago").ToDecimal()
|
||||||
ListaFacturasGenerarNC.Add(ObjFactura)
|
ListaFacturasGenerarNC.Add(ObjFactura)
|
||||||
End If
|
End If
|
||||||
@@ -1571,42 +1561,34 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If MsgError = "" AndAlso UsuarioActual.Empresa.Funcionalidad(220) <> "" Then
|
||||||
|
If Not ObjMov.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then
|
||||||
|
MsgError = "No se pudo simplificar los movimientos"
|
||||||
|
Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
If ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 3) Then
|
If ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 3) Then
|
||||||
If ObjMov.ValorPolizaDescuadre > 0 Then
|
If ObjMov.ValorPolizaDescuadre > 0 Then
|
||||||
MsgError = ObjMov.MensajePolizaDescuadre + " La diferencia es de: " + ObjMov.ValorDiferencia
|
MsgError = ObjMov.MensajePolizaDescuadre + " La diferencia es de: " + ObjMov.ValorDiferencia
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If EmpresaPrueba Then 'Empresa Prueba
|
'Conta ContPAQ
|
||||||
'El movimiento 2 es el de Pago
|
If UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError = "" Then
|
||||||
'Conta SIG
|
If idCuentaContabilizacion > 0 Then
|
||||||
If UsuarioActual.Empresa.Funcionalidad(200) = "1" And MsgError = "" AndAlso UsuarioActual.Empresa.UsaContabilidadSIG Then
|
If ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
|
||||||
If CveCuentaContabilizacion > 0 Then
|
IDPoliza = ObjMov.ContaIdPoliza
|
||||||
If ObjMov.ContabilizarPrePolizaSIG(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
|
FolioPoliza = ObjMov.ContaFolio
|
||||||
IDPoliza = ObjMov.ContaIdPoliza
|
|
||||||
FolioPoliza = ObjMov.ContaFolio
|
|
||||||
Else
|
|
||||||
Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico")
|
|
||||||
End If
|
|
||||||
Else
|
Else
|
||||||
Alert(String.Format("No se puede contabilizar la Prepoliza debido a que las siguientes cuentas son invalidas: {0}", CuentasContablesInvalidasSIG))
|
Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico")
|
||||||
|
MsgError = "Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico"
|
||||||
End If
|
End If
|
||||||
|
Else
|
||||||
|
Alert(String.Format("No se puede contabilizar la Prepoliza debido a que las siguientes cuentas son invalidas: {0}", CuentasContablesInvalidas))
|
||||||
End If
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
'Conta ContPAQ
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError = "" Then
|
|
||||||
If idCuentaContabilizacion > 0 Then
|
|
||||||
If ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
|
|
||||||
IDPoliza = ObjMov.ContaIdPoliza
|
|
||||||
FolioPoliza = ObjMov.ContaFolio
|
|
||||||
Else
|
|
||||||
Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico")
|
|
||||||
End If
|
|
||||||
Else
|
|
||||||
Alert(String.Format("No se puede contabilizar la Prepoliza debido a que las siguientes cuentas son invalidas: {0}", CuentasContablesInvalidas))
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
End If 'Empresa Prueba
|
|
||||||
Else
|
Else
|
||||||
MsgError = "No se pudo insertar la póliza"
|
MsgError = "No se pudo insertar la póliza"
|
||||||
End If
|
End If
|
||||||
|
|||||||
Reference in New Issue
Block a user