merge -- Ventas

This commit is contained in:
2022-01-26 12:17:41 -07:00
31 changed files with 692 additions and 462 deletions

View File

@@ -1137,8 +1137,7 @@
<div class="modal-footer">
<div class="row">
<div class="col-md-2" style="text-align: left">
<asp:LinkButton ID="LbDescargarExcelConceptos" runat="server" CssClass="btn btn-warning" Text="Descargar Plantilla" />
<asp:LinkButton ID="LbDescargarExcelConceptos" OnClick="LbDescargarExcelConceptos_Click" runat="server" CssClass="btn btn-warning" Text="Descargar Plantilla" />
</div>
<div class="col-md-10" style="text-align: center">

View File

@@ -4934,6 +4934,41 @@ Partial Class Inventarios_RecepcionAlmacen
End If
End Sub
Protected Sub LbDescargarExcelConceptos_Click(sender As Object, e As EventArgs)
DescargarFormato()
End Sub
Public Sub DescargarFormato()
Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\Formatos\FormatoRecepcionAlmacen.xlsx"
Dim dtt As New DataTable
dtt = DtInv.Copy()
dtt.Columns.Remove("Cantidad")
dtt.Columns("CantidadF").ColumnName = "Cantidad"
dtt.Columns("PS").ColumnName = "Producto"
dtt.Columns("Codigo").ColumnName = "Código"
Dim existingcol As New List(Of String) '= {"Cantidad", "Producto", "Código"}
For Each col As DataColumn In dtt.Columns
If Not col.ColumnName.Contiene("Cantidad", "Producto", "Código") Then
existingcol.Add(col.ColumnName)
End If
Next
For Each colName As String In existingcol
dtt.Columns.Remove(colName)
Next
dtt.Columns("Cantidad").SetOrdinal(0)
dtt.Columns("Código").SetOrdinal(1)
dtt.Columns("Producto").SetOrdinal(2)
dtt.Columns.Add("Serie", GetType(String))
dtt.ExportToExcel("FormatoRecepcionAlmacen.xlsx")
End Sub
#End Region
'Protected Sub BtnGuardarDocumento_Click(sender As Object, e As EventArgs)
@@ -5041,4 +5076,5 @@ Partial Class Inventarios_RecepcionAlmacen
End Class
End Class

View File

@@ -570,11 +570,13 @@ Partial Class Inventarios_RecepcionUsados
DdlMoneda.DataSource = GlobalDTMonedas
DdlMoneda.DataBind()
'Llenar el dropdownlist de almacén
DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (22)") 'GlobalDTAlmacen(UsuarioActual.CveEmpresa)
Dim dtt As DataTable = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (22)") 'GlobalDTAlmacen(UsuarioActual.CveEmpresa)
DdlAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlAlmacen.SelectedValue = "-1"
'Llenar el dropdownlist de almacén
DdlAlmacen.DataSource = dtt
'DdlAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
'DdlAlmacen.SelectedValue = "-1"
DdlAlmacen.DataBind()
If IsNothing(Request("CveMovimiento")) Then
@@ -2919,6 +2921,11 @@ Partial Class Inventarios_RecepcionUsados
'CvePrecioLista = CvePrecioListaPS
End If
DdlTipoUso.Items.Clear()
DdlTipoUso.DataSource = GlobalDTAcumGarantiasMesesTipoUso(UsuarioActual.CveEmpresa, CveMarca)
DdlTipoUso.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlTipoUso.DataBind()
Dim MarcaPorcentaje As DataRow = DtPorcentajeMarcas.FiltroPrimero(String.Format("CveMarca = {0}", drPS("CveMarca").ToString))
If MarcaPorcentaje IsNot Nothing Then
Dim PorcentajeProducto As Decimal = MarcaPorcentaje("PorcentajeProducto").ToString.ToDecimal / 100

View File

@@ -339,13 +339,15 @@ Partial Class Inventarios_RepAnomalias
ImgExcelProdcutosCoinciden.Visible = False
LnkDescarExcelGrupos.Visible = True
GvGrupos.DataSource = dt.FiltraParametros("CvePS > 0")
GvGrupos.DataBind()
LtlGrupos1.Text = dt.FiltraParametros("Orden = 1 and CvePS > 0").Rows.Count.ToString
LtlGrupos2.Text = dt.FiltraParametros("Orden = 2 and CvePS > 0").Rows.Count.ToString
LtlGrupos3.Text = dt.FiltraParametros("Orden = 3 and CvePS > 0").Rows.Count.ToString
If dt IsNot Nothing Then
GvGrupos.DataSource = dt.FiltraParametros("CvePS > 0")
LtlGrupos1.Text = dt.FiltraParametros("Orden = 1 and CvePS > 0").Rows.Count.ToString
LtlGrupos2.Text = dt.FiltraParametros("Orden = 2 and CvePS > 0").Rows.Count.ToString
LtlGrupos3.Text = dt.FiltraParametros("Orden = 3 and CvePS > 0").Rows.Count.ToString
End If
GvGrupos.DataBind()
If DdlGPO.SelectedValue.ToEntero = 1 Then
PSIguales()
End If

View File

@@ -460,7 +460,7 @@
</table>
<div style="max-height: 300px; overflow-y: auto;">
<asp:GridView ID="GvDatos" DataKeyNames="No,PS,CvePS,CveUM,Serie,CveSeccionAlmacen,Cantidad" runat="server" ShowHeader="false" AutoGenerateColumns="False" EmptyDataText="" ToolTip="Listado de Movimientos" CssClass="Widthall table table-striped table-hover" GridLines="None">
<asp:GridView ID="GvDatos" DataKeyNames="No,PS,CvePS,CveUM,Serie,CveSeccionAlmacen,Lote,FechaCaducidad,Cantidad" runat="server" ShowHeader="false" AutoGenerateColumns="False" EmptyDataText="" ToolTip="Listado de Movimientos" CssClass="Widthall table table-striped table-hover" GridLines="None">
<Columns>
<asp:BoundField HeaderText="#" DataField="No" ItemStyle-Width="23px" />
<asp:TemplateField ItemStyle-Width="93px" ItemStyle-HorizontalAlign ="Right">

View File

@@ -28,7 +28,6 @@ Partial Class Inventarios_TraspasoAlmacen
End Set
End Property
Private Property CveAlmacenTransitorio As Integer
Get
Return CType(ViewState("CveAlmacenTransitorio"), Integer)
@@ -198,6 +197,10 @@ Partial Class Inventarios_TraspasoAlmacen
CargaMovimiento(Request("CveEntrada").ToString.ToEntero)
End If
If Request("CveFolioGarantia") IsNot Nothing AndAlso Request("CveFolioGarantia").ToString.ToEntero > 0 Then
CargaMovimientoGarantia(Request("CveFolioGarantia").ToString.ToEntero)
End If
If UsuarioActual.Empresa.Funcionalidad(132) = "1" Then
DivCodigoSeriePS.Visible = True
Else
@@ -221,7 +224,7 @@ Partial Class Inventarios_TraspasoAlmacen
End If
CantidadTotal = 0
CvePS = 0
CvePS = 0
TipoSeccionAlmacen = 0
If UsuarioActual.Empresa.Funcionalidad(281).ToEntero = 1 Then
@@ -358,6 +361,59 @@ Partial Class Inventarios_TraspasoAlmacen
UpMov.Update()
End Sub
Private Sub CargaMovimientoGarantia(CveFolioGarantia As Integer)
Using ObjAcum As New ClsAcumuladores
If ObjAcum.GetFoliosGarantiasDetalle(CveFolioGarantia) Then
''carga
Dim dra As DataRow = ObjAcum.DtResultados(0)
DivMov.Visible = True
ltlFolio.Text = dra("FolioGarantia").ToString
Dim CveSub As Integer = dra("CveSubProyecto").ToString.ToEntero
lblCompraRef.Visible = False
hplRef.Visible = False
TxtObservaciones.Text = "Folio Garantia: " & dra("FolioGarantia").ToString
'If Mov.CveCompra > 0 Then
' hplRef.NavigateUrl = $"/Compras/Compras.aspx?CveCompra={Mov.CveCompra}"
' lblCompraRef.Visible = True
' hplRef.Visible = True
'Else
' hplRef.Visible = False
' lblCompraRef.Visible = False
'End If
ChkTransitorio.Enabled = False
DdlAlmacenOrigen.Enabled = True
DdlAlmacenOrigen.Items.Clear()
DdlAlmacenOrigen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 6).FiltraParametros(String.Format("CveSubProyecto={0}", CveSub))
DdlAlmacenOrigen.DataBind()
DdlAlmacenDestino.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa, 21).FiltraParametros(String.Format("CveSubProyecto={0}", CveSub))
DdlAlmacenDestino.DataBind()
CargadoDeMov = True
Dim dtt As DataTable = ObjAcum.DtResultados.FiltraParametros("", DistinctColumns:={"CvePS", "PS", "CveUM", "UnidadMedida", "Codigo"})
For Each drr As DataRow In dtt.Rows
Dim dr As DataRow = DtMovimientos.NewRow
dr("CvePS") = drr("CvePS")
dr("PS") = String.Format("{0} - {1}", drr("Codigo"), drr("PS"))
dr("CveUM") = drr("CveUM")
dr("UnidadMedida") = drr("UnidadMedida")
dr("Cantidad") = ObjAcum.DtResultados.COUNT("CvePS", "CvePS = " & drr("CvePS").ToString)
DtMovimientos.Rows.Add(dr)
Next
CargaGvDatos()
End If
End Using
UpMov.Update()
End Sub
Private Sub AlmacenTransitorioDefaults()
ChkTransitorio.Checked = UsuarioActual.Empresa.Funcionalidad(154).ToString.ToEntero > 0
ChkTransitorio.Enabled = Not UsuarioActual.Empresa.Funcionalidad(154).ToString.ToEntero > 0
@@ -898,16 +954,6 @@ Partial Class Inventarios_TraspasoAlmacen
Dim tLote As String = If(Lote <> "-1", String.Format("AND Lote = '{0}' ", Lote), "")
Dim tFechaCaducidad As String = If(FechaCaducidad > MinFecha, String.Format("AND FechaCaducidad = '{0}' ", FechaCaducidad), "")
'If UsuarioActual.CveEmpresa = 140 Then
' Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen = {DdlAlmacenOrigen.SelectedValue}").ToEntero
' If Not CveSubProyecto.Contiene(11791, 11793, 11993, 11994, 11794, 11797, 11795, 12010, 12011) Then
' Serie = "-1"
' End If
'End If
Dim ExistenciaEspecificada As Decimal = 0
CantidadenGrid = DtMovimientos.SUMD("Cantidad", String.Format("CvePS = {0} AND CveUM = {1} {2} {3} {4} ", dr("CvePS"), dr("CveUM"), If(Not dr("Serie").ToString.Contiene("-1", ""), $" AND Serie = '{dr("Serie")}'", ""), tLote, tFechaCaducidad))
If ObjInventario.GetExistenciasProducto(dr("CvePS").ToString.ToEntero, dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, Caducidad:=FechaCaducidad) Then
@@ -945,7 +991,7 @@ Partial Class Inventarios_TraspasoAlmacen
Lote = If(gvr.DataKey("Lote") = "", "-1", gvr.DataKey("Lote"))
FechaCaducidad = If(gvr.DataKey("FechaCaducidad") = "", MinFecha, gvr.DataKey("FechaCaducidad").ToDate)
If ObjInventario.GetExistenciasProducto(gvr.DataKey("CvePS").ToString.ToEntero, gvr.DataKey("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, Caducidad:=FechaCaducidad) Then
If ObjInventario.GetExistenciasProducto(gvr.DataKey("CvePS").ToEntero, gvr.DataKey("CveUM").ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, Caducidad:=FechaCaducidad) Then
'si hay existencia en almacen costeado, lo tengo que sacar
Existencia = ObjInventario.DtResultados.FiltroPrimeroValor("ExistenciaFinal", String.Format("CVeAlmacen = {0}", DdlAlmacenOrigen.SelectedValue)).ToDecimal
End If
@@ -1249,12 +1295,12 @@ Partial Class Inventarios_TraspasoAlmacen
RegistraScript(String.Format("AbrirVentana('/General/PopUpPaqueteriasGuias.aspx?CveMovimiento={0}',800,620);", CveMovimientoSalida))
End If
If UsuarioActual.CveEmpresa.Contiene(72, 80) Then
Dim Correo As String = "jorgegonzalez@compuproveedores.com"
If GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {DdlAlmacenDestino.SelectedValue.ToEntero}").ToEntero = 16 Then
MandaCorreo(CveMovimientoSalida, Correo)
End If
End If
'If UsuarioActual.CveEmpresa.Contiene(72, 80) Then
' Dim Correo As String = "jorgegonzalez@compuproveedores.com"
' If GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {DdlAlmacenDestino.SelectedValue.ToEntero}").ToEntero = 16 Then
' MandaCorreo(CveMovimientoSalida, Correo)
' End If
'End If
LimpiaMovimiento()
@@ -1769,7 +1815,7 @@ Partial Class Inventarios_TraspasoAlmacen
End If
If UsuarioActual.Empresa.Funcionalidad(132) = "1" Then
If UsuarioActual.Empresa.Funcionalidad(132) = "1" OrElse UsuarioActual.CveEmpresa = 140 Then
DivCodigoSeriePSRecepcion.Visible = True
Else
DivCodigoSeriePSRecepcion.Visible = False
@@ -3330,7 +3376,7 @@ Partial Class Inventarios_TraspasoAlmacen
If SATClaveUnidadMedida.Length = 0 Then SBMensaje.AppendLine("-Producto sin unidad de medida SAT asignada. ")
SBMensaje.AppendLine($"<br><br> <strong><a class='texto' target='_blank' href='../Ventas/ProductosServicios.aspx?CvePS={DrPS("CvePS").ToString}' > Corregir Producto </a></strong>")
SBMensaje.AppendLine($"<br><strong><a class='texto' target='_blank' href='/Ventas/ProductosServicios.aspx?CvePS={DrPS("CvePS").ToString}' > Editar Producto </a></strong>")
Alert(SBMensaje.ToString, TipoMensaje.MsgAdvertencia)