cambio en contabilizacion cuado es UsaAC
-- mejora en visualizacion de series
This commit is contained in:
@@ -2246,7 +2246,7 @@ Partial Class Ventas
|
||||
DivPenalizacion.Visible = True
|
||||
End If
|
||||
|
||||
If UsuarioActual.CveRol = 1 Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
LnkSolicitarCredito.Visible = True
|
||||
End If
|
||||
|
||||
@@ -6506,7 +6506,7 @@ Partial Class Ventas
|
||||
ObjVentas.Dispose()
|
||||
Case Else 'SI NO TIENE NINGUN TIPO DE AUTORIZACION CONFIGURADO
|
||||
'RMF. codigo temporal para pruebas
|
||||
If Alertas AndAlso UsuarioActual.CveEmpresa = 140 AndAlso UsuarioActual.CveUsuario.Contiene(100, 1937, 2275) AndAlso Now.Hour > 5 AndAlso Now.Hour < 9 Then
|
||||
If Alertas AndAlso UsuarioActual.CveEmpresa = 140 Then
|
||||
Dim Vta As New ClsVentas
|
||||
Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa)
|
||||
Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón: <br> <br> {0}", Vta.SerieVenta)
|
||||
@@ -7534,17 +7534,17 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
'SERIE ALMACEN
|
||||
If e.Row.DBCampo("CveTipoInvPS").ToEntero() = 5 Then
|
||||
If CveVenta > 0 Then
|
||||
e.Row.FCLiteral("LtlSerie").Visible = True
|
||||
Else
|
||||
e.Row.FCTextBox("TxtSerie").Visible = True
|
||||
If CveVenta > 0 AndAlso e.Row.DBCampo("Serie") <> "" Then
|
||||
e.Row.FCLiteral("LtlSerie").Visible = True
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("CveTipoInvPS").ToEntero() = 5 And CveVenta <= 0 Then
|
||||
|
||||
e.Row.FCTextBox("TxtSerie").Visible = True
|
||||
e.Row.FCTextBox("TxtSerie").Attributes.Remove("onkeypress")
|
||||
e.Row.FCTextBox("TxtSerie").Attributes.Add("onkeypress", String.Format("SeriePS(event,{0},this,{1});", e.Row.FCButton("BtnSerie").ClientID, e.Row.FCHiddenField("HdnSerie").ClientID))
|
||||
e.Row.FCTextBox("TxtSerie").Attributes.Remove("onblur")
|
||||
e.Row.FCTextBox("TxtSerie").Attributes.Add("onblur", String.Format("SeriePSBlur({0},this,{1});", e.Row.FCButton("BtnSerie").ClientID, e.Row.FCHiddenField("HdnSerie").ClientID))
|
||||
End If
|
||||
|
||||
|
||||
'e.Row.FCTextBox("TxtSerie").Attributes.Add("onkeyup", String.Format("LimpiaAF(1, '{0}'); EnterAFEdit(event,this,{1},{2});", e.Row.FCHiddenField("HdnCveConcepto").Value, e.Row.FCHiddenField("HdnCveAF").ClientID, e.Row.FCHiddenField("HdnCodAF").ClientID))
|
||||
|
||||
@@ -15998,8 +15998,9 @@ Partial Class Ventas
|
||||
'falta verificar traer el acuse y reenviarlo
|
||||
|
||||
If UsuarioActual.Empresa.UsaAC Then
|
||||
IDPoliza = GenerarPolizaAC(ObjAC, True)
|
||||
If IDPoliza <= 0 Then
|
||||
Dim IDMPoliza As Modelos.RetornoPolizaConta = GenerarPolizaAC(ObjAC, ObjFacturaDevolucion, True)
|
||||
IDPoliza = IDMPoliza.IdPoliza
|
||||
If IDMPoliza.IdPoliza <= 0 Then
|
||||
Mensaje = "No se pudo generar la poliza"
|
||||
ErrorCancelar = True
|
||||
End If
|
||||
@@ -16088,8 +16089,9 @@ Partial Class Ventas
|
||||
ElseIf Respuesta.NoCertificadoSAT <> String.Empty Then
|
||||
|
||||
If UsuarioActual.Empresa.UsaAC Then
|
||||
IDPoliza = GenerarPolizaAC(ObjAC, True)
|
||||
If IDPoliza <= 0 Then
|
||||
Dim IDMPoliza As Modelos.RetornoPolizaConta = GenerarPolizaAC(ObjAC, ObjFacturaDevolucion, True)
|
||||
IDPoliza = IDMPoliza.IdPoliza
|
||||
If IDMPoliza.IdPoliza <= 0 Then
|
||||
Mensaje = "No se pudo generar la poliza"
|
||||
ErrorCancelar = True
|
||||
End If
|
||||
@@ -18311,125 +18313,124 @@ Partial Class Ventas
|
||||
End Function
|
||||
|
||||
|
||||
Private Function GenerarPolizaAC(ObjAC As ClsContPAQi, Optional CancelacionIngreso As Boolean = False) As Integer
|
||||
Dim Retorno As Integer = 0
|
||||
Dim IDPoliza As Integer = 0
|
||||
'Private Function GenerarPolizaAC(ObjAC As ClsContPAQi, Optional CancelacionIngreso As Boolean = False) As Integer
|
||||
' Dim Retorno As Integer = 0
|
||||
' Dim IDPoliza As Integer = 0
|
||||
|
||||
Dim ErrorAC As Boolean = False
|
||||
'Dim ObjAC As New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL()
|
||||
Dim Fecha As Date = TxtFecha.Text.ToDate
|
||||
Dim Concepto As String = String.Format("GD {0}", NombreCliente)
|
||||
Dim Paridad As Integer = 1
|
||||
Dim TipoMovto As Boolean = False
|
||||
' Dim ErrorAC As Boolean = False
|
||||
' 'Dim ObjAC As New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL()
|
||||
' Dim Fecha As Date = TxtFecha.Text.ToDate
|
||||
' Dim Concepto As String = String.Format("GD {0}", NombreCliente)
|
||||
' Dim Paridad As Integer = 1
|
||||
' Dim TipoMovto As Boolean = False
|
||||
|
||||
If CancelacionIngreso Then
|
||||
Concepto = String.Format("Cancelación GD {0}", NombreCliente)
|
||||
Paridad = -1
|
||||
TipoMovto = True
|
||||
End If
|
||||
' If CancelacionIngreso Then
|
||||
' Concepto = String.Format("Cancelación GD {0}", NombreCliente)
|
||||
' Paridad = -1
|
||||
' TipoMovto = True
|
||||
' End If
|
||||
|
||||
Dim TipoPoliza = If(DdlTipoComprobante.SelectedValue.ToString() = "OP" Or DdlTipoComprobante.SelectedValue.ToString() = "Com", 3, 1)
|
||||
' Dim TipoPoliza = If(DdlTipoComprobante.SelectedValue.ToString() = "OP" Or DdlTipoComprobante.SelectedValue.ToString() = "Com", 3, 1)
|
||||
|
||||
IDPoliza = ObjAC.AddPoliza(TipoPoliza, Concepto, TxtTotal.Text.ToDouble * 2, TxtTotal.Text.ToDouble * 2, UsuarioActual.CveUsuario, Fecha)
|
||||
Dim dr As DataRow ' = DTPresupuestoIngresos.FiltroPrimero(String.Format("CvePresupuestoIngreso = {0}", DdlFuenteRecaudacion.SelectedValue))
|
||||
'Dim Importe As Double = TxtTotal.Text.ToDouble
|
||||
Dim CtaCliente As Integer = ViewState("IdCtaContClientes").ToString().ToEntero()
|
||||
Dim CtaISSSTESON As Integer = 643
|
||||
Dim CtaISPT As Integer = 1745
|
||||
' Dim NombreCliente As String = ViewState("NombreCliente").ToString()
|
||||
' IDPoliza = ObjAC.AddPoliza(TipoPoliza, Concepto, TxtTotal.Text.ToDouble * 2, TxtTotal.Text.ToDouble * 2, UsuarioActual.CveUsuario, Fecha)
|
||||
' Dim dr As DataRow ' = DTPresupuestoIngresos.FiltroPrimero(String.Format("CvePresupuestoIngreso = {0}", DdlFuenteRecaudacion.SelectedValue))
|
||||
' 'Dim Importe As Double = TxtTotal.Text.ToDouble
|
||||
' Dim CtaCliente As Integer = ViewState("IdCtaContClientes").ToString().ToEntero()
|
||||
' Dim CtaISSSTESON As Integer = 643
|
||||
' Dim CtaISPT As Integer = 1745
|
||||
' ' Dim NombreCliente As String = ViewState("NombreCliente").ToString()
|
||||
|
||||
If IDPoliza > 0 Then
|
||||
' If IDPoliza > 0 Then
|
||||
|
||||
'Orden de PAGO
|
||||
If DdlTipoComprobante.SelectedValue.ToString() = "OP" Then
|
||||
' 'Orden de PAGO
|
||||
' If DdlTipoComprobante.SelectedValue.ToString() = "OP" Then
|
||||
|
||||
If DdlOrdenPago.SelectedValue.ToEntero() = 1 Then
|
||||
'ISSSTESON
|
||||
' If DdlOrdenPago.SelectedValue.ToEntero() = 1 Then
|
||||
' 'ISSSTESON
|
||||
|
||||
If ObjAC.AddMovimiento(IDPoliza, CtaCliente, False, Paridad * TxtTotal.Text.ToDecimal, "", Concepto, 0, Fecha, "") Then
|
||||
If Not ObjAC.AddMovimiento(IDPoliza, CtaISSSTESON, True, Paridad * TxtTotal.Text.ToDecimal, "", Concepto, 0, Fecha, "") Then
|
||||
ErrorAC = True
|
||||
End If
|
||||
Else
|
||||
ErrorAC = True
|
||||
End If
|
||||
' If ObjAC.AddMovimiento(IDPoliza, CtaCliente, False, Paridad * TxtTotal.Text.ToDecimal, "", Concepto, 0, Fecha, "V||" & CveVenta) Then
|
||||
' If Not ObjAC.AddMovimiento(IDPoliza, CtaISSSTESON, True, Paridad * TxtTotal.Text.ToDecimal, "", Concepto, 0, Fecha, "V||" & CveVenta) Then
|
||||
' ErrorAC = True
|
||||
' End If
|
||||
' Else
|
||||
' ErrorAC = True
|
||||
' End If
|
||||
|
||||
Else
|
||||
'ISPT
|
||||
' Else
|
||||
' 'ISPT
|
||||
|
||||
If ObjAC.AddMovimiento(IDPoliza, CtaCliente, False, Paridad * TxtTotal.Text.ToDecimal, "", Concepto, 0, Fecha, "") Then
|
||||
If Not ObjAC.AddMovimiento(IDPoliza, CtaISPT, True, Paridad * TxtTotal.Text.ToDecimal, "", Concepto, 0, Fecha, "") Then
|
||||
ErrorAC = True
|
||||
End If
|
||||
Else
|
||||
ErrorAC = True
|
||||
End If
|
||||
End If
|
||||
' If ObjAC.AddMovimiento(IDPoliza, CtaCliente, False, Paridad * TxtTotal.Text.ToDecimal, "", Concepto, 0, Fecha, "V||" & CveVenta) Then
|
||||
' If Not ObjAC.AddMovimiento(IDPoliza, CtaISPT, True, Paridad * TxtTotal.Text.ToDecimal, "", Concepto, 0, Fecha, "V||" & CveVenta) Then
|
||||
' ErrorAC = True
|
||||
' End If
|
||||
' Else
|
||||
' ErrorAC = True
|
||||
' End If
|
||||
' End If
|
||||
|
||||
' NORMAL
|
||||
Else
|
||||
Dim Detalles = From gvr As GridViewRow In GvPS.Rows.Cast(Of GridViewRow)()
|
||||
Group gvr By Grp = New With {
|
||||
Key .CvePresupuestoIngreso = gvr.FCDropDownList("DdlFR").SelectedValue.ToEntero()
|
||||
} Into Group
|
||||
Select Grp.CvePresupuestoIngreso,
|
||||
TotalImporte = Group.Sum(Function(r) r.FCLiteral("LtlTotal").Text.ToDouble)
|
||||
' ' NORMAL
|
||||
' Else
|
||||
' Dim Detalles = From gvr As GridViewRow In GvPS.Rows.Cast(Of GridViewRow)()
|
||||
' Group gvr By Grp = New With {
|
||||
' Key .CvePresupuestoIngreso = gvr.FCDropDownList("DdlFR").SelectedValue.ToEntero()
|
||||
' } Into Group
|
||||
' Select Grp.CvePresupuestoIngreso,
|
||||
' TotalImporte = Group.Sum(Function(r) r.FCLiteral("LtlTotal").Text.ToDouble)
|
||||
|
||||
|
||||
'Select Case TipoComprobante
|
||||
' Case "Ing", "Egs"
|
||||
For Each grp In Detalles
|
||||
dr = DTPresupuestoIngresos.FiltroPrimero(String.Format("CvePresupuestoIngreso = {0}", grp.CvePresupuestoIngreso))
|
||||
Concepto = String.Format("{0} - {1}: {2}", NombreCliente, DdlTipoComprobante.SelectedItem.Text.ToString(), TxtFolio.Text)
|
||||
' 'Select Case TipoComprobante
|
||||
' ' Case "Ing", "Egs"
|
||||
' For Each grp In Detalles
|
||||
' dr = DTPresupuestoIngresos.FiltroPrimero(String.Format("CvePresupuestoIngreso = {0}", grp.CvePresupuestoIngreso))
|
||||
' Concepto = String.Format("{0} - {1}: {2}", NombreCliente, DdlTipoComprobante.SelectedItem.Text.ToString(), TxtFolio.Text)
|
||||
|
||||
If ObjAC.AddMovimiento(IDPoliza, dr("IdCuentaPorEjecutar").ToString().ToEntero(), False, Paridad * grp.TotalImporte, "", Concepto, 0, Fecha, "") Then
|
||||
If ObjAC.AddMovimiento(IDPoliza, dr("IdCuentaDevengado").ToString().ToEntero(), True, Paridad * grp.TotalImporte, "", Concepto, 0, Fecha, "") Then
|
||||
'CARGO la deuda del cliente
|
||||
If ObjAC.AddMovimiento(IDPoliza, CtaCliente, TipoMovto, grp.TotalImporte, "", Concepto, 0, Fecha, "") Then
|
||||
'abono,
|
||||
If Not ObjAC.AddMovimiento(IDPoliza, dr("IdCuentaMatriz").ToString().ToEntero(), Not TipoMovto, grp.TotalImporte, "", Concepto, 0, Fecha, "") Then
|
||||
ErrorAC = True
|
||||
End If
|
||||
Else
|
||||
ErrorAC = True
|
||||
End If
|
||||
Else
|
||||
ErrorAC = True
|
||||
End If
|
||||
Else
|
||||
ErrorAC = True
|
||||
End If
|
||||
Next
|
||||
' If ObjAC.AddMovimiento(IDPoliza, dr("IdCuentaPorEjecutar").ToString().ToEntero(), False, Paridad * grp.TotalImporte, "", Concepto, 0, Fecha, "") Then
|
||||
' If ObjAC.AddMovimiento(IDPoliza, dr("IdCuentaDevengado").ToString().ToEntero(), True, Paridad * grp.TotalImporte, "", Concepto, 0, Fecha, "") Then
|
||||
' 'CARGO la deuda del cliente
|
||||
' If ObjAC.AddMovimiento(IDPoliza, CtaCliente, TipoMovto, grp.TotalImporte, "", Concepto, 0, Fecha, "") Then
|
||||
' 'abono,
|
||||
' If Not ObjAC.AddMovimiento(IDPoliza, dr("IdCuentaMatriz").ToString().ToEntero(), Not TipoMovto, grp.TotalImporte, "", Concepto, 0, Fecha, "") Then
|
||||
' ErrorAC = True
|
||||
' End If
|
||||
' Else
|
||||
' ErrorAC = True
|
||||
' End If
|
||||
' Else
|
||||
' ErrorAC = True
|
||||
' End If
|
||||
' Else
|
||||
' ErrorAC = True
|
||||
' End If
|
||||
' Next
|
||||
|
||||
'Case "OP", "Com"
|
||||
' Dim Importe As Decimal = 0
|
||||
' If ObjAC.AddMovimiento(123456, IDPoliza, CtaCliente, False, Importe, "", Concepto, 0, Fecha, "") Then
|
||||
' If ObjAC.AddMovimiento(123456, IDPoliza, CtaCliente, True, Importe, "", Concepto, 0, Fecha, "") Then
|
||||
' 'Case "OP", "Com"
|
||||
' ' Dim Importe As Decimal = 0
|
||||
' ' If ObjAC.AddMovimiento(123456, IDPoliza, CtaCliente, False, Importe, "", Concepto, 0, Fecha, "") Then
|
||||
' ' If ObjAC.AddMovimiento(123456, IDPoliza, CtaCliente, True, Importe, "", Concepto, 0, Fecha, "") Then
|
||||
|
||||
' End If
|
||||
' End If
|
||||
'End Select
|
||||
End If
|
||||
' ' End If
|
||||
' ' End If
|
||||
' 'End Select
|
||||
' End If
|
||||
|
||||
Else
|
||||
ErrorAC = True
|
||||
' Else
|
||||
' ErrorAC = True
|
||||
|
||||
End If
|
||||
' End If
|
||||
|
||||
If Not ErrorAC Then
|
||||
ObjAC.AjustaPoliza(IDPoliza)
|
||||
' If Not ErrorAC Then
|
||||
' ObjAC.AjustaPoliza(IDPoliza)
|
||||
' Retorno = IDPoliza
|
||||
' Else
|
||||
' Retorno = -1
|
||||
' Alert("Error al agregar la Póliza de AC.", TipoMensaje.MsgError)
|
||||
' End If
|
||||
|
||||
Retorno = IDPoliza
|
||||
Else
|
||||
' ' ObjAC.Dispose()
|
||||
|
||||
Alert("Error al Agregar la Póliza de AC.", TipoMensaje.MsgError)
|
||||
End If
|
||||
' Return Retorno
|
||||
|
||||
' ObjAC.Dispose()
|
||||
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
'End Function
|
||||
Private Sub SetValues()
|
||||
ViewState("TipoCambio") = 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user