Merge branch 'master' of http://oirigoyen@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -29,6 +29,24 @@ Partial Class Compras_Compras
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Private Property EstaAsociadoACajaChica() As Boolean
|
||||||
|
Get
|
||||||
|
Return If(IsNothing(ViewState("EstaAsociadoACajaChica")), False, CBool(ViewState("EstaAsociadoACajaChica")))
|
||||||
|
End Get
|
||||||
|
Set
|
||||||
|
ViewState("EstaAsociadoACajaChica") = Value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private Property EstaAsociadoAPersonal() As Boolean
|
||||||
|
Get
|
||||||
|
Return If(IsNothing(ViewState("EstaAsociadoAPersonal")), False, CBool(ViewState("EstaAsociadoAPersonal")))
|
||||||
|
End Get
|
||||||
|
Set
|
||||||
|
ViewState("EstaAsociadoAPersonal") = Value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
Private Property CveUsuarioEvaluador() As Integer
|
Private Property CveUsuarioEvaluador() As Integer
|
||||||
Get
|
Get
|
||||||
Return If(IsNothing(ViewState("CveUsuarioEvaluador")), -1, CInt(ViewState("CveUsuarioEvaluador")))
|
Return If(IsNothing(ViewState("CveUsuarioEvaluador")), -1, CInt(ViewState("CveUsuarioEvaluador")))
|
||||||
@@ -848,6 +866,14 @@ Partial Class Compras_Compras
|
|||||||
ViewState("PopUpOC") = value
|
ViewState("PopUpOC") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
Private Property CompraEstaVinculadaOC As Boolean
|
||||||
|
Get
|
||||||
|
Return CBool(ViewState("CompraEstaVinculadaOC"))
|
||||||
|
End Get
|
||||||
|
Set(value As Boolean)
|
||||||
|
ViewState("CompraEstaVinculadaOC") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "PROPIEDADES ALMACEN" 'Charlie
|
#Region "PROPIEDADES ALMACEN" 'Charlie
|
||||||
@@ -1307,6 +1333,9 @@ Partial Class Compras_Compras
|
|||||||
ViewState("CveFactura") = Request("CveFactura").ToEntero
|
ViewState("CveFactura") = Request("CveFactura").ToEntero
|
||||||
|
|
||||||
Dim RFC As String = CargaFactura(CveFactura)
|
Dim RFC As String = CargaFactura(CveFactura)
|
||||||
|
If Not VerificarProductosSATPS() Then
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
If RFC.Trim <> String.Empty Then
|
If RFC.Trim <> String.Empty Then
|
||||||
DdlProveedor.Visible = False
|
DdlProveedor.Visible = False
|
||||||
HplProveedor.Visible = True
|
HplProveedor.Visible = True
|
||||||
@@ -1734,6 +1763,7 @@ Partial Class Compras_Compras
|
|||||||
'TmpDT.Columns.Add("IEPSPSIVAPorcentaje")
|
'TmpDT.Columns.Add("IEPSPSIVAPorcentaje")
|
||||||
SubTotalConceptos = Math.Round(TmpDT.SUM("Total"), 2).ToDecimal
|
SubTotalConceptos = Math.Round(TmpDT.SUM("Total"), 2).ToDecimal
|
||||||
AddPS2(False)
|
AddPS2(False)
|
||||||
|
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
CargaConceptosXML(XMLDoc)
|
CargaConceptosXML(XMLDoc)
|
||||||
@@ -3971,6 +4001,17 @@ Partial Class Compras_Compras
|
|||||||
DtNoEncontrados.Dispose()
|
DtNoEncontrados.Dispose()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'Verifica funcionalidad 702 "Require orden de compra para factura de compra"
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(702) = "1" Then
|
||||||
|
If Not EstaAsociadoACajaChica And Not EstaAsociadoAPersonal Then
|
||||||
|
If Not CompraEstaVinculadaOC Then
|
||||||
|
Alert("Debe de vincular una orden de compra para realizar esta factura")
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
'Si se marcó No Deducible en el encabezado mínimo se debe registrar un No Deducible en el Detalle
|
'Si se marcó No Deducible en el encabezado mínimo se debe registrar un No Deducible en el Detalle
|
||||||
Dim GuardaNoDeducibles As Boolean = False
|
Dim GuardaNoDeducibles As Boolean = False
|
||||||
If ChkEsNoDeducible.Checked Then
|
If ChkEsNoDeducible.Checked Then
|
||||||
@@ -12712,6 +12753,7 @@ Partial Class Compras_Compras
|
|||||||
CveMoneda = dr("CveMoneda").ToString.ToEntero
|
CveMoneda = dr("CveMoneda").ToString.ToEntero
|
||||||
IdCuentaBancaria = dr("IdCtaContable").ToString.ToEntero
|
IdCuentaBancaria = dr("IdCtaContable").ToString.ToEntero
|
||||||
CveCuentaBancaria = dr("IdCtaContableSIG").ToString.ToEntero
|
CveCuentaBancaria = dr("IdCtaContableSIG").ToString.ToEntero
|
||||||
|
EstaAsociadoACajaChica = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(505) <> "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(505) <> "1" Then
|
||||||
@@ -12740,7 +12782,7 @@ Partial Class Compras_Compras
|
|||||||
|
|
||||||
ObjMovtos.Dispose()
|
ObjMovtos.Dispose()
|
||||||
DDlCheques.DataBind()
|
DDlCheques.DataBind()
|
||||||
|
EstaAsociadoAPersonal = True
|
||||||
|
|
||||||
DDlCheques_SelectedIndexChanged(DDlCheques, EventArgs.Empty)
|
DDlCheques_SelectedIndexChanged(DDlCheques, EventArgs.Empty)
|
||||||
Else
|
Else
|
||||||
@@ -13751,6 +13793,9 @@ Partial Class Compras_Compras
|
|||||||
#Region " REEMBOLSOS NO USA AC "
|
#Region " REEMBOLSOS NO USA AC "
|
||||||
Protected Sub DdlPersonal2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPersonalReembolso.SelectedIndexChanged
|
Protected Sub DdlPersonal2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPersonalReembolso.SelectedIndexChanged
|
||||||
ViewState("CvePersonal") = DdlPersonalReembolso.SelectedValue
|
ViewState("CvePersonal") = DdlPersonalReembolso.SelectedValue
|
||||||
|
If DdlPersonalReembolso.SelectedValue.ToEntero > 0 Then
|
||||||
|
EstaAsociadoAPersonal = True
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
Protected Sub DdlCajaChica2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuentaCajaChicaReembolso.SelectedIndexChanged
|
Protected Sub DdlCajaChica2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuentaCajaChicaReembolso.SelectedIndexChanged
|
||||||
Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuentaCajaChicaReembolso.SelectedValue)
|
Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuentaCajaChicaReembolso.SelectedValue)
|
||||||
@@ -13759,6 +13804,7 @@ Partial Class Compras_Compras
|
|||||||
CveMoneda = dr("CveMoneda").ToString.ToEntero
|
CveMoneda = dr("CveMoneda").ToString.ToEntero
|
||||||
IdCuentaBancaria = dr("IdCtaContable").ToString.ToEntero
|
IdCuentaBancaria = dr("IdCtaContable").ToString.ToEntero
|
||||||
CveCuentaBancaria = dr("IdCtaContableSIG").ToString.ToEntero
|
CveCuentaBancaria = dr("IdCtaContableSIG").ToString.ToEntero
|
||||||
|
EstaAsociadoACajaChica = True
|
||||||
End If
|
End If
|
||||||
ViewState("CveCajaChica") = DdlCuentaCajaChicaReembolso.SelectedValue
|
ViewState("CveCajaChica") = DdlCuentaCajaChicaReembolso.SelectedValue
|
||||||
End Sub
|
End Sub
|
||||||
@@ -15381,27 +15427,27 @@ Partial Class Compras_Compras
|
|||||||
Dim SubTotalCompra As Decimal = Amortizacion
|
Dim SubTotalCompra As Decimal = Amortizacion
|
||||||
Dim DiferenciaPermitida = 1
|
Dim DiferenciaPermitida = 1
|
||||||
Dim Cont = 0
|
Dim Cont = 0
|
||||||
Dim ProductosCodigoSATNoPermitidos As New StringBuilder("")
|
'Dim ProductosCodigoSATNoPermitidos As New StringBuilder("")
|
||||||
For Each gvr As GridViewRow In GvOC1.Rows
|
'For Each gvr As GridViewRow In GvOC1.Rows
|
||||||
SubTotalGV += gvr.FCTextBox("TxtTotalOC1").Text.ToDecimal
|
' SubTotalGV += gvr.FCTextBox("TxtTotalOC1").Text.ToDecimal
|
||||||
If Cont = 0 Then DdlProveedorSucursal.SelectedValueExist(gvr.DataKey("CveProveedorSucursal").ToEntero())
|
' If Cont = 0 Then DdlProveedorSucursal.SelectedValueExist(gvr.DataKey("CveProveedorSucursal").ToEntero())
|
||||||
Cont = 1
|
' Cont = 1
|
||||||
If GvOC1.Columns(6).Visible Then
|
' If GvOC1.Columns(6).Visible Then
|
||||||
Dim SatPS As String = gvr.FCDropDownLost("DdlSATPS").SelectedText()
|
' Dim SatPS As String = gvr.FCDropDownLost("DdlSATPS").SelectedText()
|
||||||
Dim NombreProducto As String = gvr.FCLabel("LbProductoServicio").Text
|
' Dim NombreProducto As String = gvr.FCLabel("LbProductoServicio").Text
|
||||||
If SatPS.Contains("01010101") Then
|
' If SatPS.Contains("01010101") Then
|
||||||
ProductosCodigoSATNoPermitidos.AppendFormat("{0}</br>", NombreProducto)
|
' ProductosCodigoSATNoPermitidos.AppendFormat("{0}</br>", NombreProducto)
|
||||||
'Dim mensajeAdvertencia As String = String.Format("Al vincular una Orden de Compra no se permiten productos con Producto/Servicio SAT igual a '{0}', revise el producto '{1}' en Orden(es) de Compra Vinculada(s)", SatPS, NombreProducto)
|
' 'Dim mensajeAdvertencia As String = String.Format("Al vincular una Orden de Compra no se permiten productos con Producto/Servicio SAT igual a '{0}', revise el producto '{1}' en Orden(es) de Compra Vinculada(s)", SatPS, NombreProducto)
|
||||||
'Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia)
|
' 'Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia)
|
||||||
|
|
||||||
End If
|
' End If
|
||||||
End If
|
' End If
|
||||||
Next
|
'Next
|
||||||
If ProductosCodigoSATNoPermitidos.ToString.Length > 0 Then
|
'If ProductosCodigoSATNoPermitidos.ToString.Length > 0 Then
|
||||||
Dim mensajeAdvertencia As String = String.Format("No se permite vinculación de productos con código SAT '01010101', revise los productos:</br></br>{0}", ProductosCodigoSATNoPermitidos.ToString)
|
' Dim mensajeAdvertencia As String = String.Format("No se permite vinculación de productos con código SAT '01010101', revise los productos:</br></br>{0}", ProductosCodigoSATNoPermitidos.ToString)
|
||||||
Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia)
|
' Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia)
|
||||||
Exit Sub
|
' Exit Sub
|
||||||
End If
|
'End If
|
||||||
|
|
||||||
If Math.Abs(SubTotalGV - SubTotalCompra) < DiferenciaPermitida Then
|
If Math.Abs(SubTotalGV - SubTotalCompra) < DiferenciaPermitida Then
|
||||||
LbSubTotalDif.Visible = False
|
LbSubTotalDif.Visible = False
|
||||||
@@ -15639,6 +15685,7 @@ Partial Class Compras_Compras
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
CalculaTotales()
|
CalculaTotales()
|
||||||
|
CompraEstaVinculadaOC = True
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -20156,7 +20203,35 @@ Partial Class Compras_Compras
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Function VerificarProductosSATPS() As Boolean
|
||||||
|
Dim CvePSGRuposAux As New StringBuilder("")
|
||||||
|
For Each gvr As GridViewRow In GvPS.Rows
|
||||||
|
Dim CvePSIndividual As String = gvr.DataKey("CvePS")
|
||||||
|
CvePSGRuposAux.AppendFormat("{0},", CvePSIndividual)
|
||||||
|
Next
|
||||||
|
|
||||||
|
Dim CvePSGRupos As String = Left(CvePSGRuposAux.ToString, CvePSGRuposAux.Length - 1)
|
||||||
|
|
||||||
|
Dim PSSat As DataTable = GlobalDTPS(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CvePS IN ({0})", CvePSGRuposAux))
|
||||||
|
|
||||||
|
Dim ProductosCodigoSATNoPermitidos As New StringBuilder("")
|
||||||
|
For Each PS As GridViewRow In GvPS.Rows
|
||||||
|
Dim PSIndividual As String = PS.DataKey("PS")
|
||||||
|
Dim ClavePSSAT As String = PSSat.FiltroPrimeroValor("CveSATPS", String.Format("PS = '{0}'", PSIndividual))
|
||||||
|
If ClavePSSAT = "46920" Then
|
||||||
|
ProductosCodigoSATNoPermitidos.AppendFormat("{0}</br>", PSIndividual)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
If ProductosCodigoSATNoPermitidos.ToString.Length > 0 Then
|
||||||
|
Dim mensajeAdvertencia As String = String.Format("No se permite vinculación de productos con código SAT '01010101', revise los productos:</br></br>{0}", ProductosCodigoSATNoPermitidos.ToString)
|
||||||
|
Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia)
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
|
||||||
|
Return True
|
||||||
|
|
||||||
|
End Function
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user