SOPORTES, ACTIVOS FIJIS (Interno,externo), generar remision del pescadito
This commit is contained in:
@@ -140,7 +140,8 @@
|
|||||||
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:#,##0.##}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="3%" />
|
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:#,##0.##}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="3%" />
|
||||||
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" ItemStyle-Width="40%" />
|
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" ItemStyle-Width="40%" />
|
||||||
<asp:BoundField HeaderText="Contrato Externo" DataField="ContratoExterno" ItemStyle-Width="3%" ItemStyle-HorizontalAlign="Left" />
|
<asp:BoundField HeaderText="Contrato Externo" DataField="ContratoExterno" ItemStyle-Width="3%" ItemStyle-HorizontalAlign="Left" />
|
||||||
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="10%" />
|
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center" />
|
||||||
|
<asp:BoundField HeaderText="Es Interno" DataField="EsInternoTexto" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center" />
|
||||||
</Columns>
|
</Columns>
|
||||||
</asp:GridView>
|
</asp:GridView>
|
||||||
</div>
|
</div>
|
||||||
@@ -180,7 +181,8 @@
|
|||||||
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:#,##0.##}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="3%" />
|
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:#,##0.##}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="3%" />
|
||||||
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" ItemStyle-Width="40%" />
|
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" ItemStyle-Width="40%" />
|
||||||
<asp:BoundField HeaderText="Contrato Externo" DataField="ContratoExterno" ItemStyle-Width="3%" ItemStyle-HorizontalAlign="Left" />
|
<asp:BoundField HeaderText="Contrato Externo" DataField="ContratoExterno" ItemStyle-Width="3%" ItemStyle-HorizontalAlign="Left" />
|
||||||
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="10%" />
|
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center" />
|
||||||
|
<asp:BoundField HeaderText="Es Interno" DataField="EsInternoTexto" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center" />
|
||||||
</Columns>
|
</Columns>
|
||||||
</asp:GridView>
|
</asp:GridView>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -112,6 +112,7 @@ Partial Class Ventas_RepPedidosDevolucionesXContrato
|
|||||||
e.Row.Cells(1).Text = ""
|
e.Row.Cells(1).Text = ""
|
||||||
e.Row.Cells(5).Text = ""
|
e.Row.Cells(5).Text = ""
|
||||||
e.Row.Cells(6).Text = ""
|
e.Row.Cells(6).Text = ""
|
||||||
|
e.Row.Cells(7).Text = ""
|
||||||
|
|
||||||
Dim Texto = $"Pedido: <b><a href='/Ventas/Ventas.aspx?CveVenta={e.Row.DBCampo("CveVenta")}' target='_blank'>{e.Row.DBCampo("SerieFolio")}</a></b> | "
|
Dim Texto = $"Pedido: <b><a href='/Ventas/Ventas.aspx?CveVenta={e.Row.DBCampo("CveVenta")}' target='_blank'>{e.Row.DBCampo("SerieFolio")}</a></b> | "
|
||||||
Texto += If(e.Row.DBCampo("CveMovimiento").ToString = "", " SIN MOVIMIENTO DE ALMACÉN", $"Folio Almacén: <b><a href ='/Inventarios/EntradasSalidas.aspx?CveMovimiento={e.Row.DBCampo("CveMovimiento")}' target='_blank'>{e.Row.DBCampo("Folio")}</a></b>")
|
Texto += If(e.Row.DBCampo("CveMovimiento").ToString = "", " SIN MOVIMIENTO DE ALMACÉN", $"Folio Almacén: <b><a href ='/Inventarios/EntradasSalidas.aspx?CveMovimiento={e.Row.DBCampo("CveMovimiento")}' target='_blank'>{e.Row.DBCampo("Folio")}</a></b>")
|
||||||
@@ -135,6 +136,7 @@ Partial Class Ventas_RepPedidosDevolucionesXContrato
|
|||||||
e.Row.Cells(1).Text = ""
|
e.Row.Cells(1).Text = ""
|
||||||
e.Row.Cells(5).Text = ""
|
e.Row.Cells(5).Text = ""
|
||||||
e.Row.Cells(6).Text = ""
|
e.Row.Cells(6).Text = ""
|
||||||
|
e.Row.Cells(7).Text = ""
|
||||||
|
|
||||||
Dim Texto = $"Devolución: <b><a href='/Ventas/Ventas.aspx?CveVenta={e.Row.DBCampo("CveVenta")}' target='_blank'>{e.Row.DBCampo("SerieFolio")}</a></b> | "
|
Dim Texto = $"Devolución: <b><a href='/Ventas/Ventas.aspx?CveVenta={e.Row.DBCampo("CveVenta")}' target='_blank'>{e.Row.DBCampo("SerieFolio")}</a></b> | "
|
||||||
Texto += If(e.Row.DBCampo("CveMovimiento").ToString = "", " SIN MOVIMIENTO DE ALMACÉN", $"Folio Almacén: <b><a href ='/Inventarios/EntradasSalidas.aspx?CveMovimiento={e.Row.DBCampo("CveMovimiento")}' target='_blank'>{e.Row.DBCampo("Folio")}</a></b>")
|
Texto += If(e.Row.DBCampo("CveMovimiento").ToString = "", " SIN MOVIMIENTO DE ALMACÉN", $"Folio Almacén: <b><a href ='/Inventarios/EntradasSalidas.aspx?CveMovimiento={e.Row.DBCampo("CveMovimiento")}' target='_blank'>{e.Row.DBCampo("Folio")}</a></b>")
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ Public Class WSApp
|
|||||||
ObjPS.Dispose()
|
ObjPS.Dispose()
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Property GlobalDTMonedas() As DataTable
|
Property GlobalDTMonedas() As DataTable
|
||||||
Get
|
Get
|
||||||
GlobalDTMonedas = DirectCast(Application("GlobalDTMonedas"), DataTable)
|
GlobalDTMonedas = DirectCast(Application("GlobalDTMonedas"), DataTable)
|
||||||
@@ -326,32 +327,41 @@ Public Class WSApp
|
|||||||
Application("GlobalDTCompProveedores") = value
|
Application("GlobalDTCompProveedores") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
Property GlobalDTProductosServicios(CveEmpresa As Integer, Optional CveClasificacion As Integer = -1, Optional CveClasificacionCosto As Integer = -1, Optional Estatus As Integer = 1, Optional CvePS As Integer = -1, Optional AplicaParaVenta As Integer = -1, Optional CveTipoPS As Integer = -1) As DataTable
|
Public Property GlobalDTPSSimplificado(CveEmpresa As Integer, Optional CveClasificacion As Integer = -1, Optional PSCodigo As String = "-1", Optional Estatus As Integer = 1, Optional AplicaParaVenta As Integer = -1, Optional CvePS As Integer = -1) As DataTable
|
||||||
Get
|
Get
|
||||||
If CveEmpresa = -1 Then
|
Dim AppNombre As String = String.Format("GlobalDTPSSimplificado-{0}", CveEmpresa)
|
||||||
GlobalDTProductosServicios = DirectCast(Application("GlobalDTProductosServicios"), EnumerableRowCollection(Of DataRow)).CopyToDataTable
|
If CveEmpresa <> -1 Then
|
||||||
Else
|
'sino existe, recarga los datos
|
||||||
|
If Application(AppNombre) Is Nothing Then
|
||||||
|
Dim ObjPS As New ClsProductosServicios
|
||||||
|
If ObjPS.GetPSSimplificado(CveEmpresa) Then Application(AppNombre) = ObjPS.DtResultados.AsEnumerable()
|
||||||
|
ObjPS.Dispose()
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
Dim Cons = DirectCast(Application(AppNombre), EnumerableRowCollection(Of DataRow))
|
||||||
|
|
||||||
Dim Cons = DirectCast(Application("GlobalDTProductosServicios"), EnumerableRowCollection(Of DataRow))
|
|
||||||
Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEmpresa) = CveEmpresa))
|
Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEmpresa) = CveEmpresa))
|
||||||
If CveClasificacion >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveClasificacion) = CveClasificacion))
|
If CveClasificacion >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveClasificacion) = CveClasificacion))
|
||||||
If CveClasificacionCosto >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveClasificacionCosto) = CveClasificacionCosto))
|
If PSCodigo <> "-1" Then Cons = Cons.Where((Function(a) Convert.ToString(a!PSCodigo) = PSCodigo))
|
||||||
If Estatus >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEstado) = Estatus))
|
If Estatus >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEstado) = Estatus))
|
||||||
If CvePS >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CvePS) = CvePS))
|
|
||||||
If AplicaParaVenta >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!AplicaParaVenta) = AplicaParaVenta))
|
If AplicaParaVenta >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!AplicaParaVenta) = AplicaParaVenta))
|
||||||
If CveTipoPS >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveTipoPS) = CveTipoPS))
|
If CvePS >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CvePS) = CvePS))
|
||||||
|
|
||||||
'Try, generado para cuando el resultado no tiene valores(The source contains no DataRows.), no detenga la ejecucion, no se le puso un count previo, porque el costo se duplica, al preguntar y luego ordenar y convertir a datatable
|
|
||||||
Try
|
Try
|
||||||
GlobalDTProductosServicios = Cons.OrderBy(Function(a) a!PS).CopyToDataTable
|
GlobalDTPSSimplificado = Cons.OrderBy(Function(a) a!PSCodigo).CopyToDataTable
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
GlobalDTProductosServicios = New DataTable
|
GlobalDTPSSimplificado = New DataTable
|
||||||
End Try
|
End Try
|
||||||
End If
|
|
||||||
|
|
||||||
|
Else
|
||||||
|
GlobalDTPSSimplificado = DirectCast(Application(AppNombre), EnumerableRowCollection(Of DataRow)).CopyToDataTable
|
||||||
|
End If
|
||||||
End Get
|
End Get
|
||||||
Set(value As DataTable)
|
Set(value As DataTable)
|
||||||
Application("GlobalDTProductosServicios") = value
|
Dim AppNombre As String = String.Format("GlobalDTPSSimplificado-{0}", CveEmpresa)
|
||||||
|
Application(AppNombre) = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
Property GlobalDTClasificaciones(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1) As DataTable
|
Property GlobalDTClasificaciones(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1) As DataTable
|
||||||
@@ -716,25 +726,38 @@ Public Class WSApp
|
|||||||
If ListaPS IsNot Nothing Then
|
If ListaPS IsNot Nothing Then
|
||||||
Dim Continuar As Boolean = False
|
Dim Continuar As Boolean = False
|
||||||
Dim ObjPS As New ClsProductosServicios
|
Dim ObjPS As New ClsProductosServicios
|
||||||
For Each PS In ListaPS
|
Try
|
||||||
If ObjPS.GetPSExistencias(PS.CvePS, -1, -1, CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm")) Then
|
For Each PS In ListaPS
|
||||||
If ObjPS.DtResultados.Rows.Count > 0 Then
|
Dim CveTipoPS As Integer = GlobalDTPSSimplificado(CveEmpresa, CvePS:=PS.CvePS).FiltroPrimeroValor("CveTipoPS").ToEntero()
|
||||||
Dim Existencia As Decimal = ObjPS.DtResultados.Rows(0)("Existencia").ToString().ToDecimal()
|
If CveTipoPS > 0 Then
|
||||||
Dim CveTipoPS As Integer = ObjPS.DtResultados.Rows(0)("CveTipoPS").ToString().ToEntero()
|
If CveTipoPS = 2 Then
|
||||||
|
If ObjPS.GetPSExistencias(PS.CvePS, -1, -1, CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm")) Then
|
||||||
|
If ObjPS.DtResultados.Rows.Count > 0 Then
|
||||||
|
Dim Existencia As Decimal = ObjPS.DtResultados.Rows(0)("Existencia").ToString().ToDecimal()
|
||||||
|
'Dim CveTipoPS As Integer = ObjPS.DtResultados.Rows(0)("CveTipoPS").ToString().ToEntero()
|
||||||
|
|
||||||
Continuar = (CveTipoPS = 2 AndAlso Existencia > 0) OrElse (CveTipoPS = 1)
|
Continuar = Existencia > 0
|
||||||
|
|
||||||
If Not Continuar Then
|
If Not Continuar Then
|
||||||
Retorno.Mensajes.Add($"El producto/servicio {ObjPS.DtResultados.Rows(0)("PS")} no tiene existencia.")
|
Retorno.Mensajes.Add($"El producto/servicio {ObjPS.DtResultados.Rows(0)("PS")} no tiene existencia.")
|
||||||
Exit For
|
Exit For
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
Continuar = False
|
||||||
|
Retorno.Mensajes.Add("No se pudo comprobar la existencia.")
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
Continuar = False
|
Continuar = False
|
||||||
Retorno.Mensajes.Add("No se pudo comprobar la existencia.")
|
Retorno.Mensajes.Add("No se pudo comprobar si es producto o servicio.")
|
||||||
Exit For
|
|
||||||
End If
|
End If
|
||||||
End If
|
Next
|
||||||
Next
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al consultar la existencia", ex)
|
||||||
|
Continuar = False
|
||||||
|
End Try
|
||||||
ObjPS.Dispose()
|
ObjPS.Dispose()
|
||||||
|
|
||||||
If Continuar Then
|
If Continuar Then
|
||||||
|
|||||||
Reference in New Issue
Block a user