merge manual

This commit is contained in:
Antonio Gonzalez
2020-10-02 12:55:11 -07:00
13 changed files with 3429 additions and 3327 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -4588,6 +4588,65 @@ Public Class ClsInventarios
End Function End Function
#End Region #End Region
#Region " FLETES COMPRAS "
Public Function GetFletesCompras(CveFlete As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_FletesComprasGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveFlete", SqlDbType.Int).Value = CveFlete
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al querer obtener las compras relacionadas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function AddFletesCompras(CveFlete As Integer, Optional CveCompra As Integer = -1, Optional CveOC As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_FletesComprasAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveFlete", SqlDbType.Int).Value = CveFlete
.Add("@CveCompra", SqlDbType.Int).Value = CveCompra
.Add("@CveOC", SqlDbType.Int).Value = CveOC
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al querer agregar las compras relacionadas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function PendientesAlmacenFletesComprasGet(CveFlete As Integer, CveProveedor As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_PendientesAlmacenFletesComprasGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveFlete", SqlDbType.Int).Value = CveFlete
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener las Importaciones pendientes de almacen.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
#End Region
#Region " FLETES DETALLE " #Region " FLETES DETALLE "
Public Function AddFleteDetalle(CveFlete As Integer, CveCompra As Integer) As Boolean Public Function AddFleteDetalle(CveFlete As Integer, CveCompra As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False

View File

@@ -403,54 +403,58 @@ Partial Class Bancos_PolizaCheque
CodigoCuenta = "" CodigoCuenta = ""
NombreCuenta = "" NombreCuenta = ""
If drt("IdCtaContable").ToString.ToEntero > 0 Then 'DtCuentasContables If UsuarioActual.Empresa.UsaContabilidad Then
Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", drt("IdCtaContable").ToString)) If drt("IdCtaContable").ToString.ToEntero > 0 Then 'DtCuentasContables
Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", drt("IdCtaContable").ToString))
If drr IsNot Nothing Then
IdCuenta = drt("IdCtaContable").ToString.ToEntero If drr IsNot Nothing Then
CodigoCuenta = drr("CuentaFormato").ToString() IdCuenta = drt("IdCtaContable").ToString.ToEntero
NombreCuenta = drr("Nombre").ToString() CodigoCuenta = drr("CuentaFormato").ToString()
'Cuenta = drr("Nombre").ToString() NombreCuenta = drr("Nombre").ToString()
End If 'Cuenta = drr("Nombre").ToString()
EsComodin = 0 End If
EsComodin = 0
ElseIf drt("CveConcepto").ToString = "30" Then
'saco la clave de la cuenta bancaria seleccionada ElseIf drt("CveConcepto").ToString = "30" Then
If DdlCuenta.SelectedValue.ToEntero > 0 And drt("CveConcepto").ToString = "30" Then 'DtCuentasContables 'saco la clave de la cuenta bancaria seleccionada
Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", IdCuentaBancos(DdlCuenta.SelectedValue.ToEntero))) If DdlCuenta.SelectedValue.ToEntero > 0 And drt("CveConcepto").ToString = "30" Then 'DtCuentasContables
If drr IsNot Nothing Then Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", IdCuentaBancos(DdlCuenta.SelectedValue.ToEntero)))
IdCuenta = drr("Id").ToString.ToEntero If drr IsNot Nothing Then
CodigoCuenta = drr("CuentaFormato").ToString() IdCuenta = drr("Id").ToString.ToEntero
NombreCuenta = drr("Nombre").ToString() CodigoCuenta = drr("CuentaFormato").ToString()
' Cuenta = drr("Nombre").ToString() NombreCuenta = drr("Nombre").ToString()
EsComodin = 1 ' Cuenta = drr("Nombre").ToString()
Else EsComodin = 1
Else
' Rad.Checked = False
If UsuarioActual.CveEmpresa <> 126 Then ' Rad.Checked = False
Alert("La Cuenta Bancaria no se ha vinculado a la cuenta contable", TipoMensaje.MsgAdvertencia) If UsuarioActual.CveEmpresa <> 126 Then
GvMov.DataBind() Alert("La Cuenta Bancaria no se ha vinculado a la cuenta contable", TipoMensaje.MsgAdvertencia)
UPMovs.Update() GvMov.DataBind()
Exit Sub UPMovs.Update()
End If Exit Sub
End If
End If
End If End If
ElseIf drt("CveConcepto").ToString.ToEntero = 135 And IdCtaFondoGarantia > 0 Then End If
ElseIf drt("CveConcepto").ToString.ToEntero = 135 And IdCtaFondoGarantia > 0 Then
Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", IdCtaFondoGarantia))
Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", IdCtaFondoGarantia))
IdCuenta = IdCtaFondoGarantia
CodigoCuenta = drr("CuentaFormato").ToString() IdCuenta = IdCtaFondoGarantia
NombreCuenta = drr("Nombre").ToString() CodigoCuenta = drr("CuentaFormato").ToString()
'Cuenta = drr("Nombre").ToString() NombreCuenta = drr("Nombre").ToString()
'Cuenta = drr("Nombre").ToString()
EsComodin = 0
EsComodin = 0
End If
End If
End If
Dim dr As DataRow = DtMovimientos.NewRow Dim dr As DataRow = DtMovimientos.NewRow
dr("IdCuenta") = IdCuenta dr("IdCuenta") = IdCuenta
dr("CodigoCuenta") = CodigoCuenta & "<br>" & NombreCuenta dr("CodigoCuenta") = CodigoCuenta & "<br>" & NombreCuenta

View File

@@ -4561,19 +4561,13 @@ Partial Class Compras_Compras
Case 237 Case 237
Select Case FleteImportacionOpcion Select Case FleteImportacionOpcion
Case 1 Case 1
Dim Dr As DataRow = Nothing If Not ObjInventario.AddFletesCompras(CveFlete, CveCompra) Then
If ObjInventario.GetFletes(UsuarioActual.CveEmpresa, CveFlete) Then
If ObjInventario.DtResultados.Rows.Count > 0 Then
Dr = ObjInventario.DtResultados.Rows(0)
End If
End If
If Dr IsNot Nothing Then
If Not ObjInventario.UpdateFlete(CveFlete, Dr("Descripcion").ToString, Dr("Fecha").ToString.ToDate, -1, CveCompra, UsuarioActual.CveUsuario) Then
ErrorOC = True
End If
Else
ErrorOC = True ErrorOC = True
End If End If
''actualiza la compra para que no se surta en almacen. sino por el flete o importación
'If Not ObjCompras.UpdateEstatusAlmacen(CveCompra, 2) Then
' ErrorOC = True
'End If
Case 2 Case 2
If Not ObjInventario.AddFleteDetalle(CveFlete, CveCompra) Then If Not ObjInventario.AddFleteDetalle(CveFlete, CveCompra) Then
ErrorOC = True ErrorOC = True
@@ -19272,22 +19266,13 @@ Partial Class Compras_Compras
Case 237 Case 237
Select Case FleteImportacionOpcion Select Case FleteImportacionOpcion
Case 1 Case 1
Dim Dr As DataRow = Nothing If Not ObjInventario.AddFletescompras(CveFlete, CveCompra) Then
If ObjInventario.GetFletes(UsuarioActual.CveEmpresa, CveFlete) Then ErrorTrans = True
If ObjInventario.DtResultados.Rows.Count > 0 Then
Dr = ObjInventario.DtResultados.Rows(0)
End If
End If
If Dr IsNot Nothing Then
If Not ObjInventario.UpdateFlete(CveFlete, Dr("Descripcion").ToString, Dr("Fecha").ToString.ToDate, -1, CveCompra, UsuarioActual.CveUsuario) Then
ErrorTrans = True
End If
If Not ObjCompras.AddFletesCompras(CveFlete, CveCompra:=CveCompra) Then
ErrorTrans = True
End If
Else
ErrorTrans = True
End If End If
'''actualiza la compra para que no se surta en almacen. sino por el flete o importación
''If Not ObjCompras.UpdateEstatusAlmacen(CveCompra, 2) Then
'' ErrorTrans = True
''End If
Case 2 Case 2
If Not ObjInventario.AddFleteDetalle(CveFlete, CveCompra) Then If Not ObjInventario.AddFleteDetalle(CveFlete, CveCompra) Then
ErrorTrans = True ErrorTrans = True

View File

@@ -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>

View File

@@ -111,7 +111,8 @@ Partial Class Ventas_RepPedidosDevolucionesXContrato
e.Row.Attributes.Add("style", "background-color:#B9B5B4 !important;") e.Row.Attributes.Add("style", "background-color:#B9B5B4 !important;")
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>")
@@ -134,7 +135,8 @@ Partial Class Ventas_RepPedidosDevolucionesXContrato
e.Row.Attributes.Add("style", "background-color:#B9B5B4 !important;") e.Row.Attributes.Add("style", "background-color:#B9B5B4 !important;")
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>")

View File

@@ -13,7 +13,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen
End Sub End Sub
Private Sub CargaCombos() Private Sub CargaCombos()
Dim DtAlmacenes As DataTable = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacen:=-1).FiltraParametros("CveTipoAlmacen in (1,14)") Dim DtAlmacenes As DataTable = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacen:=-1).FiltraParametros("CveTipoAlmacen in (1,14,16)")
DdlAlmacen.DataSource = DtAlmacenes DdlAlmacen.DataSource = DtAlmacenes
DdlAlmacen.DataBind() DdlAlmacen.DataBind()
@@ -121,7 +121,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen
For Each Row As DataRow In resultado.Rows For Each Row As DataRow In resultado.Rows
Dim CvePS = Row("CvePS").ToString().ToEntero() Dim CvePS = Row("CvePS").ToString().ToEntero()
'Dim Cantidad As Decimal = Row("Cantidad").ToString().ToDecimal() Dim Cantidad As Decimal = Row("Cantidad").ToString().ToDecimal()
Dim PU As Decimal = Row("PUOriginal").ToString().ToDecimal() Dim PU As Decimal = Row("PUOriginal").ToString().ToDecimal()
Dim CveUM As Integer = Row("CveUM").ToString().ToEntero() Dim CveUM As Integer = Row("CveUM").ToString().ToEntero()
Dim CveSeccionAlmacen As Integer = Lista(Row("CvePS").ToString().ToEntero()) 'GvD.Rows(ind).FCDropDownList("DDlS").SelectedValue.ToEntero ' IfNull(Row("CveSeccionAlmacen"), "-1").ToString().ToEntero() Dim CveSeccionAlmacen As Integer = Lista(Row("CvePS").ToString().ToEntero()) 'GvD.Rows(ind).FCDropDownList("DDlS").SelectedValue.ToEntero ' IfNull(Row("CveSeccionAlmacen"), "-1").ToString().ToEntero()

View File

@@ -99,7 +99,11 @@ Partial Class Compras_Fletes
Else Else
Alert("Ocurrió un error al cargar el detalle del flete", TipoMensaje.MsgError) Alert("Ocurrió un error al cargar el detalle del flete", TipoMensaje.MsgError)
End If End If
CargarComprasRelacionadas()
If ObjInv.GetFletesCompras(CveFlete, UsuarioActual.CveEmpresa) Then
GvComprasVinculadas.DataSource = ObjInv.DtResultados
End If
Else Else
Alert("No se encontró el flete", TipoMensaje.MsgAdvertencia) Alert("No se encontró el flete", TipoMensaje.MsgAdvertencia)
End If End If
@@ -109,6 +113,7 @@ Partial Class Compras_Fletes
ObjInv.Dispose() ObjInv.Dispose()
CargaGrid() CargaGrid()
GvComprasVinculadas.DataBind()
UpRegistro.Update() UpRegistro.Update()
End Sub End Sub
@@ -428,14 +433,5 @@ Partial Class Compras_Fletes
End Sub End Sub
Private Sub CargarComprasRelacionadas()
Dim ObjCompras As New ClsCompras
If ObjCompras.GetFletesCompras(CveFlete, UsuarioActual.CveEmpresa) Then
GvComprasVinculadas.DataSource = ObjCompras.DtResultados
End If
ObjCompras.Dispose()
GvComprasVinculadas.DataBind()
End Sub
End Class End Class

View File

@@ -79,7 +79,13 @@
<label runat="server" visible="false" id="LblFletes" class="col-md-1 truncate" style="text-align: right;">Folio:</label> <label runat="server" visible="false" id="LblFletes" class="col-md-1 truncate" style="text-align: right;">Folio:</label>
<div runat="server" visible="false" id="DivFletes" class="col-md-2" style="display: inline"> <div runat="server" visible="false" id="DivFletes" class="col-md-2" style="display: inline">
<div style="width: 100px; float: left;"> <div style="width: 100px; float: left;">
<asp:DropDownList ID="DdlFletes" runat="server" DataValueField="CveFlete" DataTextField="FolioDescripcion" CssClass="select2me" Style="width: 100px !important;"></asp:DropDownList> <asp:DropDownList ID="DdlFletes" runat="server" DataValueField="CveFlete" DataTextField="FolioDescripcion" OnSelectedIndexChanged="DdlFletes_SelectedIndexChanged" AutoPostBack="true" CssClass="select2me" Style="width: 100px !important;"></asp:DropDownList>
</div>
</div>
<label runat="server" visible="false" id="LblIndirectoFactura" class="col-md-1 truncate" style="text-align: right;">Factura:</label>
<div runat="server" visible="false" id="DivDdlIndirectoFactura" class="col-md-2" style="display: inline">
<div style="width: 100px; float: left;">
<asp:DropDownList ID="DdlIndirectoFactura" runat="server" DataValueField="CveCompra" DataTextField="SerieFolio" CssClass="select2me" Style="width: 100px !important;"></asp:DropDownList>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -613,6 +613,8 @@ Partial Class Inventarios_RecepcionAlmacen
Case 4 Case 4
LblFletes.Visible = True LblFletes.Visible = True
DivFletes.Visible = True DivFletes.Visible = True
LblIndirectoFactura.Visible = True
DivDdlIndirectoFactura.Visible = True
End Select End Select
CargaFoliosRecepcion() CargaFoliosRecepcion()
@@ -711,6 +713,30 @@ Partial Class Inventarios_RecepcionAlmacen
DdlFletes.DataBind() DdlFletes.DataBind()
DdlFletes.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlFletes.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub End Sub
Protected Sub DdlFletes_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaFletesFactura()
End Sub
Private Sub CargaFletesFactura()
DdlIndirectoFactura.Items.Clear()
Dim ObjInventarios As New ClsInventarios
If DdlFletes.SelectedValue.ToEntero > 0 Then
If ObjInventarios.GetFletesCompras(DdlFletes.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
DdlIndirectoFactura.DataSource = ObjInventarios.DtResultados
Else
Alert("Ocurrió un error al obtener las Compras pendientes de recibir del proveedor. Por favor vuelva a intentar", TipoMensaje.MsgError)
End If
End If
ObjInventarios.Dispose()
DdlIndirectoFactura.DataBind()
DdlIndirectoFactura.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
#End Region #End Region
#Region " CARGA POR SURTIR - GV " #Region " CARGA POR SURTIR - GV "
@@ -1119,7 +1145,7 @@ Partial Class Inventarios_RecepcionAlmacen
If ObjInventario.DtResultados.Rows.Count > 0 Then If ObjInventario.DtResultados.Rows.Count > 0 Then
CveFleteSurtir = pCveImportacion CveFleteSurtir = pCveImportacion
CveFleteOrdenCompra = ObjInventario.DtResultados.Rows(0)("CveOC").ToString.ToEntero CveFleteOrdenCompra = ObjInventario.DtResultados.Rows(0)("CveOC").ToString.ToEntero
CveFleteCompra = ObjInventario.DtResultados.Rows(0)("CveCompra").ToString.ToEntero CveFleteCompra = DdlIndirectoFactura.SelectedValue.ToEntero 'ObjInventario.DtResultados.Rows(0)("CveCompra").ToString.ToEntero
CveImportacionCompra = CveFleteCompra ' se iguala para que al guardar el movimiento, se toma esta variable CveImportacionCompra = CveFleteCompra ' se iguala para que al guardar el movimiento, se toma esta variable
LbProveedor.Text = ObjInventario.DtResultados.Rows(0)("RazonSocial").ToString LbProveedor.Text = ObjInventario.DtResultados.Rows(0)("RazonSocial").ToString
HLFolio.Text = ObjInventario.DtResultados.Rows(0)("Folio").ToString HLFolio.Text = ObjInventario.DtResultados.Rows(0)("Folio").ToString

View File

@@ -60,7 +60,7 @@
<asp:DropDownList ID="DdlEstatus" runat="server" CssClass=" form-control input-sm select2me" ValidationGroup="GrpFiltrar" Width="100%"> <asp:DropDownList ID="DdlEstatus" runat="server" CssClass=" form-control input-sm select2me" ValidationGroup="GrpFiltrar" Width="100%">
<asp:ListItem Value="-1">Todos</asp:ListItem> <asp:ListItem Value="-1">Todos</asp:ListItem>
<asp:ListItem Selected="True" Value="1">Activo</asp:ListItem> <asp:ListItem Selected="True" Value="1">Activo</asp:ListItem>
<asp:ListItem Value="2">Inactivo</asp:ListItem> <asp:ListItem Value="0">Inactivo</asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</div> </div>

View File

@@ -1196,15 +1196,14 @@ Partial Class Clientes
End Sub End Sub
Private Sub CargaSubProyectoss() Private Sub CargaSubProyectoss()
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1).FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
DdlSubProyecto.DataBind() 'DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1).FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
'If UsuarioActual.CveSucursal = -1 Then DdlSubProyecto.DataBind()
' DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1"))
'Else
' DdlSubProyecto.SelectedValue = UsuarioActual.CveSucursal.ToString
'End If
End Sub End Sub
Private Sub CargaMetodosPago() Private Sub CargaMetodosPago()
DdlMetodoPago.DataSource = GlobalDTMetodosPago.FiltraParametros("Estatus = 'Activo'", "ClaveSAT") '.FiltraParametros("CveMetodoPago > 0 ") DdlMetodoPago.DataSource = GlobalDTMetodosPago.FiltraParametros("Estatus = 'Activo'", "ClaveSAT") '.FiltraParametros("CveMetodoPago > 0 ")

View File

@@ -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,33 +327,42 @@ 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 Cons = DirectCast(Application("GlobalDTProductosServicios"), EnumerableRowCollection(Of DataRow)) Dim ObjPS As New ClsProductosServicios
Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEmpresa) = CveEmpresa)) If ObjPS.GetPSSimplificado(CveEmpresa) Then Application(AppNombre) = ObjPS.DtResultados.AsEnumerable()
If CveClasificacion >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveClasificacion) = CveClasificacion)) ObjPS.Dispose()
If CveClasificacionCosto >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveClasificacionCosto) = CveClasificacionCosto))
If Estatus >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEstado) = Estatus)) End If
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 CveTipoPS >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveTipoPS) = CveTipoPS)) Dim Cons = DirectCast(Application(AppNombre), EnumerableRowCollection(Of DataRow))
'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 Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEmpresa) = CveEmpresa))
Try If CveClasificacion >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveClasificacion) = CveClasificacion))
GlobalDTProductosServicios = Cons.OrderBy(Function(a) a!PS).CopyToDataTable If PSCodigo <> "-1" Then Cons = Cons.Where((Function(a) Convert.ToString(a!PSCodigo) = PSCodigo))
Catch ex As Exception If Estatus >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEstado) = Estatus))
GlobalDTProductosServicios = New DataTable If AplicaParaVenta >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!AplicaParaVenta) = AplicaParaVenta))
End Try If CvePS >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CvePS) = CvePS))
End If
Try
End Get GlobalDTPSSimplificado = Cons.OrderBy(Function(a) a!PSCodigo).CopyToDataTable
Set(value As DataTable) Catch ex As Exception
Application("GlobalDTProductosServicios") = value GlobalDTPSSimplificado = New DataTable
End Set End Try
Else
GlobalDTPSSimplificado = DirectCast(Application(AppNombre), EnumerableRowCollection(Of DataRow)).CopyToDataTable
End If
End Get
Set(value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTPSSimplificado-{0}", CveEmpresa)
Application(AppNombre) = value
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
Get Get
@@ -715,26 +725,39 @@ Public Class WSApp
End If End If
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
Continuar = (CveTipoPS = 2 AndAlso Existencia > 0) OrElse (CveTipoPS = 1) If ObjPS.DtResultados.Rows.Count > 0 Then
Dim Existencia As Decimal = ObjPS.DtResultados.Rows(0)("Existencia").ToString().ToDecimal()
If Not Continuar Then 'Dim CveTipoPS As Integer = ObjPS.DtResultados.Rows(0)("CveTipoPS").ToString().ToEntero()
Retorno.Mensajes.Add($"El producto/servicio {ObjPS.DtResultados.Rows(0)("PS")} no tiene existencia.")
Exit For Continuar = Existencia > 0
End If
Else If Not Continuar Then
Continuar = False Retorno.Mensajes.Add($"El producto/servicio {ObjPS.DtResultados.Rows(0)("PS")} no tiene existencia.")
Retorno.Mensajes.Add("No se pudo comprobar la existencia.") Exit For
Exit For End If
End If Else
End If Continuar = False
Next Retorno.Mensajes.Add("No se pudo comprobar la existencia.")
Exit For
End If
End If
End If
Else
Continuar = False
Retorno.Mensajes.Add("No se pudo comprobar si es producto o servicio.")
End If
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
@@ -1374,8 +1397,8 @@ Public Class WSApp
Row("Total") = (PS.Cantidad.Value * PS.Precio) Row("Total") = (PS.Cantidad.Value * PS.Precio)
Row("TotalImporte") = Math.Round(PS.Cantidad.Value * PS.Precio, 2) Row("TotalImporte") = Math.Round(PS.Cantidad.Value * PS.Precio, 2)
Row("SATClaveProdServ") = DrPS("SATClavePS") Row("SATClaveProdServ") = DrPS("SATClavePS")
Row("SATClaveUM") = DrPS("SATClaveUnidadMedida") Row("SATClaveUM") = DrPS("SATClaveUnidadMedida")
Row("EntregaDirecta") = EntregaDirecta Row("EntregaDirecta") = EntregaDirecta