Merge branch 'master' of http://oirigoyen@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -19,6 +19,14 @@ Partial Class OC
|
|||||||
ViewState("CveEmpresaActual") = value
|
ViewState("CveEmpresaActual") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
Private Property EmpresaActualOC As Empresa
|
||||||
|
Get
|
||||||
|
EmpresaActualOC = If(IsNothing(ViewState("EmpresaActualOC")), Nothing, DirectCast(ViewState("EmpresaActualOC"), Empresa))
|
||||||
|
End Get
|
||||||
|
Set(value As Empresa)
|
||||||
|
ViewState("EmpresaActualOC") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
Private Property CveUsuarioAsignado As Integer
|
Private Property CveUsuarioAsignado As Integer
|
||||||
Get
|
Get
|
||||||
Return If(IsNothing(ViewState("CveUsuarioAsignado")), -1, ViewState("CveUsuarioAsignado").ToString.ToEntero)
|
Return If(IsNothing(ViewState("CveUsuarioAsignado")), -1, ViewState("CveUsuarioAsignado").ToString.ToEntero)
|
||||||
@@ -584,6 +592,9 @@ Partial Class OC
|
|||||||
CveProveedorOriginal = -1
|
CveProveedorOriginal = -1
|
||||||
'MODALIDAD MULTIEMPRESA
|
'MODALIDAD MULTIEMPRESA
|
||||||
CveEmpresaActual = UsuarioActual.CveEmpresa
|
CveEmpresaActual = UsuarioActual.CveEmpresa
|
||||||
|
If CveEmpresaActual > 0 Then
|
||||||
|
EmpresaActualOC = UsuarioActual.Empresa
|
||||||
|
End If
|
||||||
CargaEstatusUsuariosClasificaciones()
|
CargaEstatusUsuariosClasificaciones()
|
||||||
|
|
||||||
TxtObsPS.Attributes.Add("maxlength", "750")
|
TxtObsPS.Attributes.Add("maxlength", "750")
|
||||||
@@ -1275,6 +1286,9 @@ Partial Class OC
|
|||||||
|
|
||||||
If objOC.GetOC(pCveOrdenCompra, CveEmpresaActual, CveUsuario:=UsuarioActual.CveUsuario) AndAlso objOC.DtResultados.Rows.Count > 0 Then
|
If objOC.GetOC(pCveOrdenCompra, CveEmpresaActual, CveUsuario:=UsuarioActual.CveUsuario) AndAlso objOC.DtResultados.Rows.Count > 0 Then
|
||||||
CveEmpresaActual = objOC.CveEmpresa
|
CveEmpresaActual = objOC.CveEmpresa
|
||||||
|
If CveEmpresaActual > 0 Then
|
||||||
|
EmpresaActualOC = CreaObjetoEmpresa(CveEmpresaActual)
|
||||||
|
End If
|
||||||
InicializarValores()
|
InicializarValores()
|
||||||
|
|
||||||
ViewState("CveOrdenCompra") = pCveOrdenCompra
|
ViewState("CveOrdenCompra") = pCveOrdenCompra
|
||||||
@@ -4956,6 +4970,27 @@ Partial Class OC
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Function CreaObjetoEmpresa(CveEmpresa As Integer) As Empresa
|
||||||
|
Dim Retorno As Empresa = Nothing
|
||||||
|
|
||||||
|
Dim ObjEmpresa As New ClsSisEmpresas()
|
||||||
|
If ObjEmpresa.GetEmpresas(CveEmpresa, "-1", "-1", "-1", "-1") Then
|
||||||
|
If ObjEmpresa.GetEmpresasFuncionalidades(CveEmpresa) Then
|
||||||
|
Dim dttmp As Data.DataTable = ObjEmpresa.DtResultados
|
||||||
|
|
||||||
|
Dim EmpresasFuncionalidades As New HybridDictionary
|
||||||
|
For Each Row As Data.DataRow In dttmp.Rows
|
||||||
|
EmpresasFuncionalidades.Add(Convert.ToInt32(Row("CveFuncionalidad")), Row("Valor").ToString)
|
||||||
|
Next
|
||||||
|
ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades)
|
||||||
|
End If
|
||||||
|
|
||||||
|
Retorno = ObjEmpresa.Empresa
|
||||||
|
End If
|
||||||
|
ObjEmpresa.Dispose()
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
#Region " GUARDA DIRECTO "
|
#Region " GUARDA DIRECTO "
|
||||||
Private Sub GuardaBitacora(Optional EsCotizacion As Boolean = False)
|
Private Sub GuardaBitacora(Optional EsCotizacion As Boolean = False)
|
||||||
@@ -4974,7 +5009,12 @@ Partial Class OC
|
|||||||
If ObjEventoBitacora.AddEventoBitacora(descripcion, String.Format("{0}", FileExtension), UsuarioActual.CveUsuario, CveEmpresaActual, CveOC:=CveOrdenCompra, Prioridad:=Prioridad) Then
|
If ObjEventoBitacora.AddEventoBitacora(descripcion, String.Format("{0}", FileExtension), UsuarioActual.CveUsuario, CveEmpresaActual, CveOC:=CveOrdenCompra, Prioridad:=Prioridad) Then
|
||||||
|
|
||||||
If Filename <> "" Then
|
If Filename <> "" Then
|
||||||
Filename.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("Empresas\{0}\OI", CveEmpresaActual))
|
If EmpresaActualOC IsNot Nothing Then
|
||||||
|
Filename.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("{0}\OI", EmpresaActualOC.Ruta), ConcatenarDirectorioBase:=False)
|
||||||
|
Else
|
||||||
|
Filename.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("Empresas\{0}\OI", CveEmpresaActual))
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
GvEB.DataSource = ObjEventoBitacora.DtResultados
|
GvEB.DataSource = ObjEventoBitacora.DtResultados
|
||||||
@@ -5061,7 +5101,11 @@ Partial Class OC
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If Filename <> "" Then
|
If Filename <> "" Then
|
||||||
Filename.FilesMove(String.Format("OI{0}{1}", UsuarioActual.CveUsuario, DtDetalle.Rows.Count), String.Format("Empresas\{0}\OI\Temp", CveEmpresaActual))
|
If EmpresaActualOC IsNot Nothing Then
|
||||||
|
Filename.FilesMove(String.Format("OI{0}{1}", UsuarioActual.CveUsuario, DtDetalle.Rows.Count), String.Format("{0}OI\Temp", EmpresaActualOC.Ruta), ConcatenarDirectorioBase:=False)
|
||||||
|
Else
|
||||||
|
Filename.FilesMove(String.Format("OI{0}{1}", UsuarioActual.CveUsuario, DtDetalle.Rows.Count), String.Format("Empresas\{0}\OI\Temp", CveEmpresaActual))
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4434,7 +4434,7 @@
|
|||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
|
|
||||||
<asp:GridView ID="GvAcum" Width="100%" runat="server" GridLines="None"
|
<asp:GridView ID="GvAcum" Width="100%" runat="server" GridLines="None"
|
||||||
DataKeyNames="CveMovto, CveCliente,Cantidad,CvePSCargo,CveTamaño,Puntos,ImporteCargo,ImporteBonificacion,Cargo,Bonificacion,ImporteCompra,CveConcepto,CveVenta,Observaciones,CveUsuario,FechaIng,FacturadoCargo,FacturadoBonificacion,CveSubProyecto"
|
DataKeyNames="CveMovto, CveCliente,Cantidad,CvePSCargo,CveTamaño,Puntos,ImporteCargo,ImporteBonificacion,Cargo,Bonificacion,ImporteCompra,CveConcepto,CveVenta,Observaciones,CveUsuario,FechaIng,FacturadoCargo,FacturadoBonificacion,CveSubProyecto,TipoEstatus"
|
||||||
CssClass="table table-striped table-advance table-hover ScrollAD " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
|
CssClass="table table-striped table-advance table-hover ScrollAD " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
|
||||||
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
|
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
|
||||||
<Columns>
|
<Columns>
|
||||||
|
|||||||
@@ -9420,7 +9420,7 @@ Partial Class Clientes
|
|||||||
|
|
||||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||||
|
|
||||||
If e.Row.DataKey("CveConcepto").ToEntero() = 1 Then
|
If e.Row.DataKey("CveConcepto").ToEntero() = 1 AndAlso e.Row.DataKey("TipoEstatus").ToEntero() <> 5 Then
|
||||||
|
|
||||||
Dim FacturadoCargo As Boolean = Boolean.Parse(e.Row.DataKey("FacturadoCargo"))
|
Dim FacturadoCargo As Boolean = Boolean.Parse(e.Row.DataKey("FacturadoCargo"))
|
||||||
Dim FacturadoBonificacion As Boolean = Boolean.Parse(e.Row.DataKey("FacturadoBonificacion"))
|
Dim FacturadoBonificacion As Boolean = Boolean.Parse(e.Row.DataKey("FacturadoBonificacion"))
|
||||||
|
|||||||
@@ -1286,6 +1286,7 @@ Partial Class PV
|
|||||||
If UsuarioActual.Empresa.Funcionalidad(569) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(569) = "1" Then
|
||||||
DdlTipoComprobante.Items.Add(New ListItem("Remisión", "Rem"))
|
DdlTipoComprobante.Items.Add(New ListItem("Remisión", "Rem"))
|
||||||
DdlTipoComprobante.SelectedValueExist("Rem")
|
DdlTipoComprobante.SelectedValueExist("Rem")
|
||||||
|
DdlTipoComprobante_SelectedIndexChanged(DdlTipoComprobante, EventArgs.Empty)
|
||||||
End If
|
End If
|
||||||
DdlTipoDefecto.Width = New Unit(260%)
|
DdlTipoDefecto.Width = New Unit(260%)
|
||||||
|
|
||||||
@@ -5964,7 +5965,7 @@ Partial Class PV
|
|||||||
Case 1 'CREDITO
|
Case 1 'CREDITO
|
||||||
TxtFechaPago.Text = Now.AddDays(PlazoCobranza).ToShortDateString
|
TxtFechaPago.Text = Now.AddDays(PlazoCobranza).ToShortDateString
|
||||||
Case 2 'CONTADO
|
Case 2 'CONTADO
|
||||||
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem") Then
|
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant") Then
|
||||||
DivContado.Visible = True
|
DivContado.Visible = True
|
||||||
TxtImporteContado.Text = TxtTotal.Text
|
TxtImporteContado.Text = TxtTotal.Text
|
||||||
End If
|
End If
|
||||||
@@ -6165,6 +6166,11 @@ Partial Class PV
|
|||||||
Retorno = True
|
Retorno = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If DtPagos IsNot Nothing AndAlso DtPagos.SUM("Importe").ToString.ToDecimal() > 0 AndAlso DdlTipoComprobante.SelectedValue = "Rem" Then
|
||||||
|
Alert("Los pagos no deben ser aplicados a una remisión.", TipoMensaje.MsgAdvertencia)
|
||||||
|
Retorno = True
|
||||||
|
End If
|
||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
@@ -7315,12 +7321,10 @@ Partial Class PV
|
|||||||
TxtPrecio.Text = TxtPrecio.Text
|
TxtPrecio.Text = TxtPrecio.Text
|
||||||
TxtObsPS.Text = "Descuento por garantía"
|
TxtObsPS.Text = "Descuento por garantía"
|
||||||
Else
|
Else
|
||||||
'For Each Gvr As GridViewRow In GvRecepcionUsados.Rows
|
If TmpDTAjustes IsNot Nothing Then
|
||||||
' If Gvr.RowType = DataControlRowType.DataRow Then
|
TmpDTAjustes.Clear()
|
||||||
' Gvr.FCTextBox("TxtCantidad").Text = ""
|
End If
|
||||||
' Gvr.FCTextBox("TxtCantidad").Enabled = True
|
TxtObsPS.Text = TxtObsPS.Text.Replace("Descuento por garantía", "")
|
||||||
' End If
|
|
||||||
'Next
|
|
||||||
|
|
||||||
DdlRecepcionUsados.SelectedValueExist("-1")
|
DdlRecepcionUsados.SelectedValueExist("-1")
|
||||||
DdlRecepcionUsados.Enabled = True
|
DdlRecepcionUsados.Enabled = True
|
||||||
|
|||||||
@@ -6602,6 +6602,30 @@ Partial Class Ventas
|
|||||||
LnkOCs.Visible = False
|
LnkOCs.Visible = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||||
|
Dim Autorizacion As Integer = 0
|
||||||
|
|
||||||
|
Dim ObjVentas As New ClsVentas
|
||||||
|
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero, "Ing", CveEstatus:=1) Then
|
||||||
|
Dim RowAutorizacion As DataRow = Nothing
|
||||||
|
'SI TIENE DIAS VENCIDOS BUSCAR POR TIPO VENCIMIENTO
|
||||||
|
If TieneDiasVencidos Then
|
||||||
|
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion IN(1,2) AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC")
|
||||||
|
Else
|
||||||
|
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion = 1 AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC")
|
||||||
|
End If
|
||||||
|
|
||||||
|
If RowAutorizacion IsNot Nothing Then
|
||||||
|
Autorizacion = RowAutorizacion("CveAutorizacion").ToString().ToEntero()
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
ObjVentas.Dispose()
|
||||||
|
|
||||||
|
'SI NO TIENE AUTORIZACION, MANTIENE EL BLOQUEO POR CONDICIONES DE CREDITO
|
||||||
|
If Autorizacion > 0 Then
|
||||||
|
BtnsFacturar.Visible = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
Else
|
Else
|
||||||
@@ -6620,6 +6644,32 @@ Partial Class Ventas
|
|||||||
DdlTipoComprobante.SelectedValueExistInsert("Cot", "Cotización")
|
DdlTipoComprobante.SelectedValueExistInsert("Cot", "Cotización")
|
||||||
End If
|
End If
|
||||||
TxtFechaPago.Text = If(DdlTipoComprobante.SelectedValue = "Rem", Now.AddDays(PlazoCobranzaRemision), Now.AddDays(PlazoCobranza)).ToShortDateString
|
TxtFechaPago.Text = If(DdlTipoComprobante.SelectedValue = "Rem", Now.AddDays(PlazoCobranzaRemision), Now.AddDays(PlazoCobranza)).ToShortDateString
|
||||||
|
|
||||||
|
If EsCotizacion AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||||
|
Dim Autorizacion As Integer = 0
|
||||||
|
|
||||||
|
Dim ObjVentas As New ClsVentas
|
||||||
|
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero, "Ing", CveEstatus:=1) Then
|
||||||
|
Dim RowAutorizacion As DataRow = Nothing
|
||||||
|
'SI TIENE DIAS VENCIDOS BUSCAR POR TIPO VENCIMIENTO
|
||||||
|
If TieneDiasVencidos Then
|
||||||
|
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion IN(1,2) AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC")
|
||||||
|
Else
|
||||||
|
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion = 1 AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC")
|
||||||
|
End If
|
||||||
|
|
||||||
|
If RowAutorizacion IsNot Nothing Then
|
||||||
|
Autorizacion = RowAutorizacion("CveAutorizacion").ToString().ToEntero()
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
ObjVentas.Dispose()
|
||||||
|
|
||||||
|
'SI NO TIENE AUTORIZACION, MANTIENE EL BLOQUEO POR CONDICIONES DE CREDITO
|
||||||
|
If Autorizacion > 0 Then
|
||||||
|
BtnsFacturar.Visible = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
@@ -6753,10 +6803,39 @@ Partial Class Ventas
|
|||||||
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)
|
||||||
Vta.Dispose()
|
Vta.Dispose()
|
||||||
If Opcion > 0 Then
|
|
||||||
Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
|
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||||
BtnsFacturar.Visible = False
|
Dim Autorizacion As Integer = 0
|
||||||
BtnGenerarRemision.Visible = False
|
|
||||||
|
Dim ObjVentas As New ClsVentas
|
||||||
|
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero, "Ing", CveEstatus:=1) Then
|
||||||
|
Dim RowAutorizacion As DataRow = Nothing
|
||||||
|
'SI TIENE DIAS VENCIDOS BUSCAR POR TIPO VENCIMIENTO
|
||||||
|
If TieneDiasVencidos Then
|
||||||
|
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion IN(1,2) AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC")
|
||||||
|
Else
|
||||||
|
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion = 1 AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC")
|
||||||
|
End If
|
||||||
|
|
||||||
|
If RowAutorizacion IsNot Nothing Then
|
||||||
|
Autorizacion = RowAutorizacion("CveAutorizacion").ToString().ToEntero()
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
ObjVentas.Dispose()
|
||||||
|
|
||||||
|
'SI NO TIENE AUTORIZACION, MANTIENE EL BLOQUEO POR CONDICIONES DE CREDITO
|
||||||
|
If Opcion > 0 AndAlso Autorizacion <= 0 Then
|
||||||
|
Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
|
||||||
|
BtnsFacturar.Visible = False
|
||||||
|
BtnGenerarRemision.Visible = False
|
||||||
|
End If
|
||||||
|
|
||||||
|
Else
|
||||||
|
If Opcion > 0 Then
|
||||||
|
Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
|
||||||
|
BtnsFacturar.Visible = False
|
||||||
|
BtnGenerarRemision.Visible = False
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|||||||
Reference in New Issue
Block a user