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
|
DivPenalizacion.Visible = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If UsuarioActual.CveRol = 1 Then
|
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||||
LnkSolicitarCredito.Visible = True
|
LnkSolicitarCredito.Visible = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -6506,7 +6506,7 @@ Partial Class Ventas
|
|||||||
ObjVentas.Dispose()
|
ObjVentas.Dispose()
|
||||||
Case Else 'SI NO TIENE NINGUN TIPO DE AUTORIZACION CONFIGURADO
|
Case Else 'SI NO TIENE NINGUN TIPO DE AUTORIZACION CONFIGURADO
|
||||||
'RMF. codigo temporal para pruebas
|
'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 Vta As New ClsVentas
|
||||||
Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa)
|
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)
|
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
|
End If
|
||||||
|
|
||||||
'SERIE ALMACEN
|
'SERIE ALMACEN
|
||||||
If e.Row.DBCampo("CveTipoInvPS").ToEntero() = 5 Then
|
If CveVenta > 0 AndAlso e.Row.DBCampo("Serie") <> "" Then
|
||||||
If CveVenta > 0 Then
|
e.Row.FCLiteral("LtlSerie").Visible = True
|
||||||
e.Row.FCLiteral("LtlSerie").Visible = True
|
End If
|
||||||
Else
|
|
||||||
e.Row.FCTextBox("TxtSerie").Visible = True
|
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.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.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.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))
|
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))
|
'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
|
'falta verificar traer el acuse y reenviarlo
|
||||||
|
|
||||||
If UsuarioActual.Empresa.UsaAC Then
|
If UsuarioActual.Empresa.UsaAC Then
|
||||||
IDPoliza = GenerarPolizaAC(ObjAC, True)
|
Dim IDMPoliza As Modelos.RetornoPolizaConta = GenerarPolizaAC(ObjAC, ObjFacturaDevolucion, True)
|
||||||
If IDPoliza <= 0 Then
|
IDPoliza = IDMPoliza.IdPoliza
|
||||||
|
If IDMPoliza.IdPoliza <= 0 Then
|
||||||
Mensaje = "No se pudo generar la poliza"
|
Mensaje = "No se pudo generar la poliza"
|
||||||
ErrorCancelar = True
|
ErrorCancelar = True
|
||||||
End If
|
End If
|
||||||
@@ -16088,8 +16089,9 @@ Partial Class Ventas
|
|||||||
ElseIf Respuesta.NoCertificadoSAT <> String.Empty Then
|
ElseIf Respuesta.NoCertificadoSAT <> String.Empty Then
|
||||||
|
|
||||||
If UsuarioActual.Empresa.UsaAC Then
|
If UsuarioActual.Empresa.UsaAC Then
|
||||||
IDPoliza = GenerarPolizaAC(ObjAC, True)
|
Dim IDMPoliza As Modelos.RetornoPolizaConta = GenerarPolizaAC(ObjAC, ObjFacturaDevolucion, True)
|
||||||
If IDPoliza <= 0 Then
|
IDPoliza = IDMPoliza.IdPoliza
|
||||||
|
If IDMPoliza.IdPoliza <= 0 Then
|
||||||
Mensaje = "No se pudo generar la poliza"
|
Mensaje = "No se pudo generar la poliza"
|
||||||
ErrorCancelar = True
|
ErrorCancelar = True
|
||||||
End If
|
End If
|
||||||
@@ -18311,125 +18313,124 @@ Partial Class Ventas
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
Private Function GenerarPolizaAC(ObjAC As ClsContPAQi, Optional CancelacionIngreso As Boolean = False) As Integer
|
'Private Function GenerarPolizaAC(ObjAC As ClsContPAQi, Optional CancelacionIngreso As Boolean = False) As Integer
|
||||||
Dim Retorno As Integer = 0
|
' Dim Retorno As Integer = 0
|
||||||
Dim IDPoliza As Integer = 0
|
' Dim IDPoliza As Integer = 0
|
||||||
|
|
||||||
Dim ErrorAC As Boolean = False
|
' Dim ErrorAC As Boolean = False
|
||||||
'Dim ObjAC As New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL()
|
' 'Dim ObjAC As New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL()
|
||||||
Dim Fecha As Date = TxtFecha.Text.ToDate
|
' Dim Fecha As Date = TxtFecha.Text.ToDate
|
||||||
Dim Concepto As String = String.Format("GD {0}", NombreCliente)
|
' Dim Concepto As String = String.Format("GD {0}", NombreCliente)
|
||||||
Dim Paridad As Integer = 1
|
' Dim Paridad As Integer = 1
|
||||||
Dim TipoMovto As Boolean = False
|
' Dim TipoMovto As Boolean = False
|
||||||
|
|
||||||
If CancelacionIngreso Then
|
' If CancelacionIngreso Then
|
||||||
Concepto = String.Format("Cancelación GD {0}", NombreCliente)
|
' Concepto = String.Format("Cancelación GD {0}", NombreCliente)
|
||||||
Paridad = -1
|
' Paridad = -1
|
||||||
TipoMovto = True
|
' TipoMovto = True
|
||||||
End If
|
' 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)
|
' 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 dr As DataRow ' = DTPresupuestoIngresos.FiltroPrimero(String.Format("CvePresupuestoIngreso = {0}", DdlFuenteRecaudacion.SelectedValue))
|
||||||
'Dim Importe As Double = TxtTotal.Text.ToDouble
|
' 'Dim Importe As Double = TxtTotal.Text.ToDouble
|
||||||
Dim CtaCliente As Integer = ViewState("IdCtaContClientes").ToString().ToEntero()
|
' Dim CtaCliente As Integer = ViewState("IdCtaContClientes").ToString().ToEntero()
|
||||||
Dim CtaISSSTESON As Integer = 643
|
' Dim CtaISSSTESON As Integer = 643
|
||||||
Dim CtaISPT As Integer = 1745
|
' Dim CtaISPT As Integer = 1745
|
||||||
' Dim NombreCliente As String = ViewState("NombreCliente").ToString()
|
' ' Dim NombreCliente As String = ViewState("NombreCliente").ToString()
|
||||||
|
|
||||||
If IDPoliza > 0 Then
|
' If IDPoliza > 0 Then
|
||||||
|
|
||||||
'Orden de PAGO
|
' 'Orden de PAGO
|
||||||
If DdlTipoComprobante.SelectedValue.ToString() = "OP" Then
|
' If DdlTipoComprobante.SelectedValue.ToString() = "OP" Then
|
||||||
|
|
||||||
If DdlOrdenPago.SelectedValue.ToEntero() = 1 Then
|
' If DdlOrdenPago.SelectedValue.ToEntero() = 1 Then
|
||||||
'ISSSTESON
|
' 'ISSSTESON
|
||||||
|
|
||||||
If ObjAC.AddMovimiento(IDPoliza, CtaCliente, False, Paridad * TxtTotal.Text.ToDecimal, "", Concepto, 0, Fecha, "") Then
|
' 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, "") Then
|
' If Not ObjAC.AddMovimiento(IDPoliza, CtaISSSTESON, True, Paridad * TxtTotal.Text.ToDecimal, "", Concepto, 0, Fecha, "V||" & CveVenta) Then
|
||||||
ErrorAC = True
|
' ErrorAC = True
|
||||||
End If
|
' End If
|
||||||
Else
|
' Else
|
||||||
ErrorAC = True
|
' ErrorAC = True
|
||||||
End If
|
' End If
|
||||||
|
|
||||||
Else
|
' Else
|
||||||
'ISPT
|
' 'ISPT
|
||||||
|
|
||||||
If ObjAC.AddMovimiento(IDPoliza, CtaCliente, False, Paridad * TxtTotal.Text.ToDecimal, "", Concepto, 0, Fecha, "") Then
|
' 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, "") Then
|
' If Not ObjAC.AddMovimiento(IDPoliza, CtaISPT, True, Paridad * TxtTotal.Text.ToDecimal, "", Concepto, 0, Fecha, "V||" & CveVenta) Then
|
||||||
ErrorAC = True
|
' ErrorAC = True
|
||||||
End If
|
' End If
|
||||||
Else
|
' Else
|
||||||
ErrorAC = True
|
' ErrorAC = True
|
||||||
End If
|
' End If
|
||||||
End If
|
' End If
|
||||||
|
|
||||||
' NORMAL
|
' ' NORMAL
|
||||||
Else
|
' Else
|
||||||
Dim Detalles = From gvr As GridViewRow In GvPS.Rows.Cast(Of GridViewRow)()
|
' Dim Detalles = From gvr As GridViewRow In GvPS.Rows.Cast(Of GridViewRow)()
|
||||||
Group gvr By Grp = New With {
|
' Group gvr By Grp = New With {
|
||||||
Key .CvePresupuestoIngreso = gvr.FCDropDownList("DdlFR").SelectedValue.ToEntero()
|
' Key .CvePresupuestoIngreso = gvr.FCDropDownList("DdlFR").SelectedValue.ToEntero()
|
||||||
} Into Group
|
' } Into Group
|
||||||
Select Grp.CvePresupuestoIngreso,
|
' Select Grp.CvePresupuestoIngreso,
|
||||||
TotalImporte = Group.Sum(Function(r) r.FCLiteral("LtlTotal").Text.ToDouble)
|
' TotalImporte = Group.Sum(Function(r) r.FCLiteral("LtlTotal").Text.ToDouble)
|
||||||
|
|
||||||
|
|
||||||
'Select Case TipoComprobante
|
' 'Select Case TipoComprobante
|
||||||
' Case "Ing", "Egs"
|
' ' Case "Ing", "Egs"
|
||||||
For Each grp In Detalles
|
' For Each grp In Detalles
|
||||||
dr = DTPresupuestoIngresos.FiltroPrimero(String.Format("CvePresupuestoIngreso = {0}", grp.CvePresupuestoIngreso))
|
' dr = DTPresupuestoIngresos.FiltroPrimero(String.Format("CvePresupuestoIngreso = {0}", grp.CvePresupuestoIngreso))
|
||||||
Concepto = String.Format("{0} - {1}: {2}", NombreCliente, DdlTipoComprobante.SelectedItem.Text.ToString(), TxtFolio.Text)
|
' 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("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
|
' If ObjAC.AddMovimiento(IDPoliza, dr("IdCuentaDevengado").ToString().ToEntero(), True, Paridad * grp.TotalImporte, "", Concepto, 0, Fecha, "") Then
|
||||||
'CARGO la deuda del cliente
|
' 'CARGO la deuda del cliente
|
||||||
If ObjAC.AddMovimiento(IDPoliza, CtaCliente, TipoMovto, grp.TotalImporte, "", Concepto, 0, Fecha, "") Then
|
' If ObjAC.AddMovimiento(IDPoliza, CtaCliente, TipoMovto, grp.TotalImporte, "", Concepto, 0, Fecha, "") Then
|
||||||
'abono,
|
' 'abono,
|
||||||
If Not ObjAC.AddMovimiento(IDPoliza, dr("IdCuentaMatriz").ToString().ToEntero(), Not TipoMovto, grp.TotalImporte, "", Concepto, 0, Fecha, "") Then
|
' If Not ObjAC.AddMovimiento(IDPoliza, dr("IdCuentaMatriz").ToString().ToEntero(), Not TipoMovto, grp.TotalImporte, "", Concepto, 0, Fecha, "") Then
|
||||||
ErrorAC = True
|
' ErrorAC = True
|
||||||
End If
|
' End If
|
||||||
Else
|
' Else
|
||||||
ErrorAC = True
|
' ErrorAC = True
|
||||||
End If
|
' End If
|
||||||
Else
|
' Else
|
||||||
ErrorAC = True
|
' ErrorAC = True
|
||||||
End If
|
' End If
|
||||||
Else
|
' Else
|
||||||
ErrorAC = True
|
' ErrorAC = True
|
||||||
End If
|
' End If
|
||||||
Next
|
' Next
|
||||||
|
|
||||||
'Case "OP", "Com"
|
' 'Case "OP", "Com"
|
||||||
' Dim Importe As Decimal = 0
|
' ' Dim Importe As Decimal = 0
|
||||||
' If ObjAC.AddMovimiento(123456, IDPoliza, CtaCliente, False, Importe, "", Concepto, 0, Fecha, "") Then
|
' ' If ObjAC.AddMovimiento(123456, IDPoliza, CtaCliente, False, Importe, "", Concepto, 0, Fecha, "") Then
|
||||||
' If ObjAC.AddMovimiento(123456, IDPoliza, CtaCliente, True, Importe, "", Concepto, 0, Fecha, "") Then
|
' ' If ObjAC.AddMovimiento(123456, IDPoliza, CtaCliente, True, Importe, "", Concepto, 0, Fecha, "") Then
|
||||||
|
|
||||||
' End If
|
' ' End If
|
||||||
' End If
|
' ' End If
|
||||||
'End Select
|
' 'End Select
|
||||||
End If
|
' End If
|
||||||
|
|
||||||
Else
|
' Else
|
||||||
ErrorAC = True
|
' ErrorAC = True
|
||||||
|
|
||||||
End If
|
' End If
|
||||||
|
|
||||||
If Not ErrorAC Then
|
' If Not ErrorAC Then
|
||||||
ObjAC.AjustaPoliza(IDPoliza)
|
' ObjAC.AjustaPoliza(IDPoliza)
|
||||||
|
' Retorno = IDPoliza
|
||||||
|
' Else
|
||||||
|
' Retorno = -1
|
||||||
|
' Alert("Error al agregar la Póliza de AC.", TipoMensaje.MsgError)
|
||||||
|
' End If
|
||||||
|
|
||||||
Retorno = IDPoliza
|
' ' ObjAC.Dispose()
|
||||||
Else
|
|
||||||
|
|
||||||
Alert("Error al Agregar la Póliza de AC.", TipoMensaje.MsgError)
|
' Return Retorno
|
||||||
End If
|
|
||||||
|
|
||||||
' ObjAC.Dispose()
|
'End Function
|
||||||
|
|
||||||
Return Retorno
|
|
||||||
|
|
||||||
End Function
|
|
||||||
Private Sub SetValues()
|
Private Sub SetValues()
|
||||||
ViewState("TipoCambio") = 1
|
ViewState("TipoCambio") = 1
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user