Modulo de inventarios,correcion de validacion del IVA,validacion de limites de credito,Facturacion de remisiones con diferentes series
This commit is contained in:
@@ -1075,6 +1075,14 @@ Partial Class Ventas
|
||||
ViewState("DevolucionAlmacen") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property DevolucionAlmacenNC As Integer
|
||||
Get
|
||||
Return IfNull(ViewState("DevolucionAlmacenNC"), 2, ViewState("DevolucionAlmacenNC").ToString().ToString()).ToString().ToEntero()
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("DevolucionAlmacenNC") = value
|
||||
End Set
|
||||
End Property
|
||||
Private ReadOnly Property TipoDoctoDevolucion As String
|
||||
Get
|
||||
Return ViewState("TipoDoctoDevolucion").ToString
|
||||
@@ -1633,6 +1641,14 @@ Partial Class Ventas
|
||||
ViewState("VentaSaldoAlmacen") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property VentaSaldoAlmacenNC As Decimal
|
||||
Get
|
||||
Return IfNull(ViewState("VentaSaldoAlmacenNC"), 0, ViewState("VentaSaldoAlmacenNC").ToString().ToDecimal()).ToString().ToDecimal()
|
||||
End Get
|
||||
Set(value As Decimal)
|
||||
ViewState("VentaSaldoAlmacenNC") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property SeCancelaRemisionProceso As Boolean
|
||||
Get
|
||||
Return CBool(ViewState("SeCancelaRemisionProceso").ToString)
|
||||
@@ -5073,50 +5089,54 @@ Partial Class Ventas
|
||||
LblCreditoDisponible.Text = CreditoDispo.FormatoNumero
|
||||
If PorcentajeCredito > 80 Then TrPorcentajeCredito.Visible = True : LblPorcentajeCredito.Text = $"{PorcentajeCredito.FormatoNumero}%"
|
||||
If UsuarioActual.CveEmpresa = 119 AndAlso Not UsuarioActual.TienePermisoProceso(268) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "PA") Then
|
||||
If LblRFC.Text.Trim <> "XAXX010101000" 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)
|
||||
Vta.Dispose()
|
||||
If Opcion > 0 Then
|
||||
'si la cotización no debe de existir este canddado
|
||||
If Alertas Then Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
|
||||
'RBLPago.SelectedValue = "2"
|
||||
'RBLPago.Items(0).Enabled = False
|
||||
RBLPago_SelectedIndexChanged(Nothing, Nothing)
|
||||
UPCondicionesPago.Update()
|
||||
DdlTipoComprobante.SelectedValueExistInsert("PA", "Autorización")
|
||||
DdlTipoComprobante.SelectedValue = "PA"
|
||||
TxtFechaPago.Text = Now.AddDays(PlazoCobranza).ToShortDateString
|
||||
'si llegó por la opción de cotización no debe de restringuir
|
||||
If IfNull(Request("Op"), "").ToString = "Cot" Then DdlTipoComprobante.SelectedValue = "Cot"
|
||||
'quito remisión y factura
|
||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ing"))
|
||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant"))
|
||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Rem"))
|
||||
If Opcion = 1 Then
|
||||
BtnEmitirImprimir.Visible = False
|
||||
BtnsFacturar.Visible = False
|
||||
BtnGenerarRemision.Visible = False
|
||||
LnkPedido2SinFacturar.Visible = False
|
||||
LnkCotizaciones.Visible = False
|
||||
LnkOCs.Visible = False
|
||||
End If
|
||||
Else
|
||||
' el cliente tiene crédito disponible, no tiene bloqueo
|
||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("PA"))
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(60) Then DdlTipoComprobante.SelectedValueExistInsert("Ing", "Ingresos") 'puede facturar
|
||||
If UsuarioActual.TienePermisoProceso(199) Then DdlTipoComprobante.SelectedValueExistInsert("Rem", "Remisión") ' puede remisionar
|
||||
DdlTipoComprobante.SelectedValueExist(UsuarioActual.CveTipoDocumento)
|
||||
'If LblRFC.Text.Trim <> "XAXX010101000" Then
|
||||
|
||||
TxtFechaPago.Text = If(DdlTipoComprobante.SelectedValue = "Rem", Now.AddDays(PlazoCobranzaRemision), Now.AddDays(PlazoCobranza)).ToShortDateString
|
||||
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)
|
||||
Vta.Dispose()
|
||||
If Opcion > 0 Then
|
||||
'si la cotización no debe de existir este canddado
|
||||
If Alertas Then Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
|
||||
'RBLPago.SelectedValue = "2"
|
||||
'RBLPago.Items(0).Enabled = False
|
||||
RBLPago_SelectedIndexChanged(Nothing, Nothing)
|
||||
UPCondicionesPago.Update()
|
||||
DdlTipoComprobante.SelectedValueExistInsert("PA", "Autorización")
|
||||
DdlTipoComprobante.SelectedValue = "PA"
|
||||
TxtFechaPago.Text = Now.AddDays(PlazoCobranza).ToShortDateString
|
||||
'si llegó por la opción de cotización no debe de restringuir
|
||||
If IfNull(Request("Op"), "").ToString = "Cot" Then DdlTipoComprobante.SelectedValue = "Cot"
|
||||
'quito remisión y factura
|
||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ing"))
|
||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant"))
|
||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Rem"))
|
||||
If Opcion = 1 Then
|
||||
BtnEmitirImprimir.Visible = False
|
||||
BtnsFacturar.Visible = False
|
||||
BtnGenerarRemision.Visible = False
|
||||
LnkPedido2SinFacturar.Visible = False
|
||||
LnkCotizaciones.Visible = False
|
||||
LnkOCs.Visible = False
|
||||
End If
|
||||
Else
|
||||
'que no de crédito, solo contado
|
||||
RBLPago.SelectedValue = "2"
|
||||
RBLPago.Items(0).Enabled = False
|
||||
' el cliente tiene crédito disponible, no tiene bloqueo
|
||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("PA"))
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(60) Then DdlTipoComprobante.SelectedValueExistInsert("Ing", "Ingresos") 'puede facturar
|
||||
If UsuarioActual.TienePermisoProceso(199) Then DdlTipoComprobante.SelectedValueExistInsert("Rem", "Remisión") ' puede remisionar
|
||||
DdlTipoComprobante.SelectedValueExist(UsuarioActual.CveTipoDocumento)
|
||||
|
||||
TxtFechaPago.Text = If(DdlTipoComprobante.SelectedValue = "Rem", Now.AddDays(PlazoCobranzaRemision), Now.AddDays(PlazoCobranza)).ToShortDateString
|
||||
End If
|
||||
|
||||
'Else
|
||||
' 'que no de crédito, solo contado
|
||||
' RBLPago.SelectedValue = "2"
|
||||
' RBLPago.Items(0).Enabled = False
|
||||
'End If
|
||||
|
||||
End If
|
||||
Else
|
||||
|
||||
@@ -5402,6 +5422,8 @@ Partial Class Ventas
|
||||
|
||||
If DTFacNC IsNot Nothing AndAlso DTFacNC.Rows.Count > 0 Then
|
||||
Me.CveEstatusRefacturacion = DTFacNC.Rows(0)("CveEstatusRefacturacion").ToString().ToEntero()
|
||||
Me.DevolucionAlmacenNC = DTFacNC.Rows(0)("EsDevolucionVenta").ToString.ToEntero
|
||||
Me.VentaSaldoAlmacenNC = DTFacNC.Rows(0)("SaldoAlmacen").ToString.ToDecimal
|
||||
HdnRFCVenta.Value = DTFacNC.Rows(0)("ClienteRFC").ToString()
|
||||
End If
|
||||
Else
|
||||
@@ -6657,7 +6679,7 @@ Partial Class Ventas
|
||||
End If
|
||||
'Esquema viejo, evitamos que aparezca por surtir
|
||||
If ErrorList.Count = 0 Then
|
||||
If VentaSaldoAlmacen <> 0 Then
|
||||
If VentaSaldoAlmacenNC <> 0 OrElse DevolucionAlmacenNC = 2 Then
|
||||
If Not ObjInventario.ActualizarEsDevolucionVenta(ObjFactura.CveVenta, 2) Then
|
||||
ErrorList.Add("No se pudo Cancelar el movimiento de almacen de la Factura")
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user