Commit inicial Ventas Productivo
This commit is contained in:
471
Inventarios/RepExistenciasCostos.aspx.vb
Normal file
471
Inventarios/RepExistenciasCostos.aspx.vb
Normal file
@@ -0,0 +1,471 @@
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class Inventarios_RepExistenciasCostos
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "PROPIEDADES"
|
||||
|
||||
Public Property DtData As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtData"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtData") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property DtData2 As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtData2"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtData2") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property TmpPS As DataTable
|
||||
Get
|
||||
Return CType(ViewState("TmpPS"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("TmpPS") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property FechaFinal As String
|
||||
Get
|
||||
Return ViewState("FechaFinal").ToString
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("FechaFinal") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property FechaInicial As String
|
||||
Get
|
||||
Return ViewState("FechaInicial").ToString
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("FechaInicial") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
TxtFechaI.Text = New Date(Now.Year, Now.Month, 1).ToShortDateString
|
||||
TxtFechaF.Text = Now.LastDayOfMonth
|
||||
|
||||
If Request("CvePS") IsNot Nothing AndAlso Request("CveProveedor") IsNot Nothing AndAlso
|
||||
Request("CveMoneda") IsNot Nothing AndAlso Request("CveConcepto") IsNot Nothing AndAlso
|
||||
Request("FechaI") IsNot Nothing AndAlso Request("FechaF") IsNot Nothing Then
|
||||
' Alert(Request("CvePS").ToString, TipoMensaje.MsgAdvertencia)
|
||||
Dim CveAlmacen = IfNull(Request("CveAlmacen"), "-1").ToString.ToEntero
|
||||
|
||||
CargaDatos(Request("CvePS").ToString.Trim.ToEntero,
|
||||
Request("CveProveedor").ToString.Trim.ToEntero,
|
||||
Request("CveMoneda").ToString.Trim.ToEntero,
|
||||
Request("CveConcepto").ToString.Trim.ToEntero,
|
||||
If(Request("FechaI").ToString.Trim <> "-1", Request("FechaI").ToString.Trim.ToDate, MinFecha),
|
||||
If(Request("FechaF").ToString.Trim <> "-1", Request("FechaF").ToString.Trim.ToDate, MaxFecha),
|
||||
CveAlmacen,
|
||||
IIf(Request("CVECLASIFICACION") Is Nothing, -1, Request("CveClasificacion").ToEntero),
|
||||
IIf(Request("CvePersonal") Is Nothing, -1, Request("CvePersonal").ToEntero)
|
||||
)
|
||||
Panel1.Visible = False
|
||||
Else
|
||||
Panel1.Visible = True
|
||||
CargaCombos()
|
||||
End If
|
||||
|
||||
'CargaPS()
|
||||
CargaPermisos()
|
||||
End If
|
||||
End Sub
|
||||
Private Sub CargaPermisos()
|
||||
Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201)
|
||||
GvM.Columns(6).Visible = TienePermisoImportes
|
||||
|
||||
GvM.Columns(7).Visible = TienePermisoImportes
|
||||
|
||||
GvM.Columns(9).Visible = TienePermisoImportes
|
||||
GvM.Columns(10).Visible = TienePermisoImportes
|
||||
|
||||
GvM.Columns(12).Visible = TienePermisoImportes
|
||||
End Sub
|
||||
Public Sub CargaCombos()
|
||||
|
||||
DdlMoneda.DataSource = GlobalDTMonedas()
|
||||
DdlMoneda.DataBind()
|
||||
DdlMoneda.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
DdlTipoMovimiento.DataSource = GlobalDTInvConceptos()
|
||||
DdlTipoMovimiento.DataBind()
|
||||
DdlTipoMovimiento.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
|
||||
DdlProveedor.DataBind()
|
||||
DdlProveedor.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa)
|
||||
DdlPersonal.DataBind()
|
||||
DdlPersonal.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
|
||||
'Llenar el dropdownlist de Productosy servicios
|
||||
If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then
|
||||
ddlProducto.Visible = False
|
||||
'DdlProductows.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
Else
|
||||
Dim productos As New ClsProductosServicios
|
||||
|
||||
If productos.GetPS(-1, -1, UsuarioActual.CveEmpresa) Then
|
||||
TmpPS = productos.DtResultados.FiltraParametros("", "PS")
|
||||
ddlProducto.DataSource = TmpPS
|
||||
End If
|
||||
productos.Dispose()
|
||||
ddlProducto.DataBind()
|
||||
DdlProductows.Visible = False
|
||||
End If
|
||||
|
||||
DdlAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
|
||||
|
||||
DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1)
|
||||
DdlAlmacen.DataBind()
|
||||
DdlAlmacen.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
If Not IsNothing(Request("CveAlmacen")) Then
|
||||
If DdlAlmacen.Items.FindByValue(Request("CveAlmacen").ToString) Is Nothing Then
|
||||
Dim CveAlmacen = Request("CveAlmacen").ToString
|
||||
Dim Almacen As String = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros($"CveAlmacen = {Request("CveAlmacen").ToString}").Rows(0)("Almacen").ToString
|
||||
DdlAlmacen.Items.Insert(0, New ListItem(Almacen, CveAlmacen))
|
||||
End If
|
||||
End If
|
||||
|
||||
ddlProducto.Items.Insert(0, New ListItem("----", "-1"))
|
||||
CargaClasificaciones()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaClasificaciones()
|
||||
If isWhitFamily() Then
|
||||
|
||||
DdlClasificacion.DataSource = GlobalDTSubFamilias(UsuarioActual.CveEmpresa).FiltraParametros("", Orderby:="Clasificacion")
|
||||
Else
|
||||
If UsuarioActual.Empresa.UsaAC Then
|
||||
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(" Codigo = '' OR Codigo IS NULL ", Orderby:="Clasificacion")
|
||||
Else
|
||||
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros("", Orderby:="Clasificacion")
|
||||
End If
|
||||
End If
|
||||
|
||||
'DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros("", "Clasificacion")
|
||||
DdlClasificacion.DataBind()
|
||||
End Sub
|
||||
|
||||
Private Function isWhitFamily() As Boolean
|
||||
Return (UsuarioActual.CveEmpresa = 66)
|
||||
End Function
|
||||
|
||||
Protected Sub btConsultar_Click(sender As Object, e As EventArgs) Handles btConsultar.Click
|
||||
Dim CveProveedor As Integer = DdlProveedor.SelectedValue.ToEntero
|
||||
Dim CveMoneda As Integer = DdlMoneda.SelectedValue.ToEntero
|
||||
Dim CveConcepto As Integer = DdlTipoMovimiento.SelectedValue.ToEntero
|
||||
Dim CvePS As Integer = If(HFProducto.Value.ToEntero > 0, HFProducto.Value.ToEntero, -1)
|
||||
Dim CveAlmacen As Integer = DdlAlmacen.SelectedValue.ToEntero
|
||||
Dim CveClasificacion As Integer = DdlClasificacion.SelectedValue.ToEntero
|
||||
|
||||
Dim fechaI As Date = If(TxtFechaI.Text <> "", TxtFechaI.Text.ToDateTime, MinFecha)
|
||||
Dim fechaF As Date = If(TxtFechaF.Text <> "", TxtFechaF.Text.ToDateTime, MaxFecha)
|
||||
CargaDatos(CvePS, CveProveedor, CveMoneda, CveConcepto, fechaI, fechaF, CveAlmacen, CveClasificacion, DdlPersonal.SelectedValue.ToEntero)
|
||||
End Sub
|
||||
|
||||
Protected Sub CargaDatos(CvePS As Integer, CveProveedor As Integer, CveMoneda As Integer, CveConcepto As Integer, FechaI As Date, FechaF As Date, CveAlmacen As Integer, CveClasificacion As Integer, CvePersonal As Integer)
|
||||
If CvePS > 0 Then
|
||||
LnkKardex.Visible = True
|
||||
LnkKardex.NavigateUrl = String.Format("/Inventarios/Kardex.aspx?CvePS={0}", CvePS)
|
||||
End If
|
||||
|
||||
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
If ObjInventarios.RepExistenciasCostos(FechaI, FechaF, CveMoneda, CveProveedor, CveConcepto, CvePS, UsuarioActual.CveEmpresa, CveAlmacen, UsuarioActual.CveUsuario, CveClasificacion, CvePersonal) Then
|
||||
DtData = ObjInventarios.DtResultados
|
||||
GvM.DataSource = DtData
|
||||
FechaInicial = FechaI
|
||||
FechaFinal = FechaF
|
||||
End If
|
||||
ObjInventarios.Dispose()
|
||||
GvM.DataBind()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvM_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvM.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
Dim TienePermisoImportes = UsuarioActual.TienePermisoProceso(201)
|
||||
e.Row.Cells(6).Visible = TienePermisoImportes
|
||||
e.Row.Cells(7).Visible = TienePermisoImportes
|
||||
e.Row.Cells(9).Visible = TienePermisoImportes
|
||||
e.Row.Cells(10).Visible = TienePermisoImportes
|
||||
e.Row.Cells(12).Visible = TienePermisoImportes
|
||||
|
||||
|
||||
Select Case e.Row.DBCampo("Orden").ToEntero
|
||||
Case 10
|
||||
e.Row.CssClass = "SubTotales2"
|
||||
|
||||
e.Row.Cells(0).Text = e.Row.DBCampo("PS")
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
||||
e.Row.Cells(0).ColumnSpan = 3
|
||||
e.Row.Cells(1).Visible = False
|
||||
e.Row.Cells(2).Visible = False
|
||||
|
||||
e.Row.Cells(5).Text = ""
|
||||
e.Row.Cells(6).Text = ""
|
||||
e.Row.Cells(7).Text = ""
|
||||
e.Row.Cells(8).Text = ""
|
||||
e.Row.Cells(9).Text = ""
|
||||
e.Row.Cells(10).Text = ""
|
||||
e.Row.Cells(11).Text = ""
|
||||
e.Row.Cells(12).Text = ""
|
||||
Case 15
|
||||
If e.Row.DBCampo("CveMovimiento").ToString.ToEntero <= 0 Then
|
||||
e.Row.Cells(0).Text = e.Row.DBCampo("FechaMovto")
|
||||
e.Row.Cells(2).Text = ""
|
||||
End If
|
||||
Case 20
|
||||
e.Row.CssClass = "SubTotales"
|
||||
|
||||
e.Row.Cells(0).Text = $"Total: {e.Row.DBCampo("PS")}"
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
||||
e.Row.Cells(0).ColumnSpan = 3
|
||||
e.Row.Cells(1).Visible = False
|
||||
e.Row.Cells(2).Visible = False
|
||||
|
||||
e.Row.Cells(11).Text = e.Row.DBCampo("ExistenciaTotal").ToDouble().ToString("#,####.####")
|
||||
e.Row.Cells(12).Text = e.Row.DBCampo("ValorTotal").FormatoNumero
|
||||
End Select
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs) Handles BtnPersonalizar.Click
|
||||
GvM.Columns(3).Visible = ChkActivoFijo.Checked
|
||||
GvM.Columns(4).Visible = ChkSubProyecto.Checked
|
||||
UPPEquiv.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
#Region " IMPRIMIR "
|
||||
Protected Sub LnkImprimir_Click(sender As Object, e As EventArgs) Handles LnkImprimir.Click
|
||||
impimir("PDF")
|
||||
End Sub
|
||||
Protected Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
|
||||
impimir("EXCEL")
|
||||
End Sub
|
||||
Private Sub impimir(Optional reporte As String = "PDF")
|
||||
|
||||
|
||||
Dim Proveedor = If(DdlProveedor.SelectedValue = "-1", "", $" <b>Proveedor:</b> {DdlProveedor.SelectedItem.Text}")
|
||||
Dim Moneda = If(DdlMoneda.SelectedValue = "-1", "", $" <b>Moneda:</b> {DdlMoneda.SelectedItem.Text}")
|
||||
Dim Concepto = If(DdlTipoMovimiento.SelectedValue = "-1", "", $" <b>Concepto:</b> {DdlTipoMovimiento.SelectedItem.Text}")
|
||||
Dim PS = If(HFProducto.Value.ToEntero > 0, $" <b>Producto/Servicio:</b> {GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=HFProducto.Value.ToEntero).Rows(0)("PSCodigo").ToString}", "")
|
||||
Dim Almacen = If(DdlAlmacen.SelectedValue = " - 1", "", $" <b>Almacen: </b> {DdlAlmacen.SelectedItem.Text}")
|
||||
Dim Clasificacion = If(DdlClasificacion.SelectedValue = "-1", "", $" <b>Clasificacion:</b> {DdlClasificacion.SelectedItem.Text}")
|
||||
Dim FechaIn As String = $" <b>Fecha Inicio:</b> {TxtFechaI.Text}"
|
||||
Dim FechaFn As String = $" <b>Fecha Fin:</b> {TxtFechaF.Text}"
|
||||
If TxtFechaI.Text = "" Then FechaIn = ""
|
||||
If TxtFechaF.Text = "" Then FechaFn = ""
|
||||
|
||||
If DtData IsNot Nothing Then
|
||||
|
||||
|
||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
|
||||
Dim params As New List(Of ReportParameter)
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("FechaInicio", FechaIn))
|
||||
params.Add(New ReportParameter("FechaFin", FechaFn))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
params.Add(New ReportParameter("Filtros", $"{FechaIn} {FechaFn} {Proveedor} {Concepto} {Almacen} {Clasificacion} {PS} {Moneda}"))
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepExistenciasCostos.rdlc", DtData, params, "ReporteExistenciasCostos", Formato:=reporte)
|
||||
Else
|
||||
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
'#Region "UNIFICAR PS"
|
||||
' Protected Sub BtnCargaPS_Click(sender As Object, e As EventArgs)
|
||||
' CargaPS()
|
||||
' End Sub
|
||||
' Private Sub CargaPS()
|
||||
' Dim DtPS As DataTable = GlobalDTProductosServicios(UsuarioActual.CveEmpresa)
|
||||
|
||||
' DdlPSPrimario.Items.Clear()
|
||||
' DdlPSUnificado.Items.Clear()
|
||||
' DdlPSPrimario.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
' DdlPSUnificado.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
' DdlPSPrimario.DataSource = DtPS
|
||||
' DdlPSUnificado.DataSource = DtPS
|
||||
' DdlPSPrimario.DataBind()
|
||||
' DdlPSUnificado.DataBind()
|
||||
' DtPS.Dispose()
|
||||
' End Sub
|
||||
' Protected Sub BtnUnificarPS_Click(sender As Object, e As EventArgs)
|
||||
' If DdlPSPrimario.SelectedValue = DdlPSUnificado.SelectedValue Then
|
||||
' Alert("El Producto/Servicio a unificar no puede ser el mismo al primario. Por favor verifique y vuelva a intetar.", TipoMensaje.MsgAdvertencia)
|
||||
' Exit Sub
|
||||
' End If
|
||||
|
||||
' 'Dim ObjPS As New ClsProductosServicios()
|
||||
|
||||
' 'If ObjPS.UnificarPS(DdlPSPrimario.SelectedValue.ToEntero, DdlPSUnificado.SelectedValue.ToEntero) Then
|
||||
' ' Alert("El Producto/Servicio Fue unificado correctamente.", TipoMensaje.MsgInformacion)
|
||||
|
||||
' ' RegistraScript("$get('DivUnificarPS').style.display='none';")
|
||||
' ' DdlPSPrimario.SelectedValue = "-1"
|
||||
' ' DdlPSUnificado.SelectedValue = "-1"
|
||||
' ' 'CargaPS()
|
||||
' 'Else
|
||||
' ' Alert("Ocurrió un error al unificar el Producto/Servicio. Por favor vuelta a intentar.", TipoMensaje.MsgError)
|
||||
' 'End If
|
||||
|
||||
' 'ObjPS.Dispose()
|
||||
|
||||
' Dim CveMovimientoSalida = 0
|
||||
' Dim CveMovimientoEntrada = 0
|
||||
' Dim Existencia As Double
|
||||
|
||||
' Dim IDPoliza As Integer = 0
|
||||
' Dim Folio = 0
|
||||
' Dim Fecha As Date = Date.Now 'TxtFecha.Text.ToDate
|
||||
|
||||
' Dim TieneError = False
|
||||
' Dim TextoError = ""
|
||||
' Dim ObjInventario As New ClsInventarios
|
||||
' ObjInventario.IniciaTransacSQL()
|
||||
|
||||
' Dim DtAlmacenes As New DataTable
|
||||
|
||||
' If ObjInventario.GetAlmacenes() Then
|
||||
' DtAlmacenes = ObjInventario.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa))
|
||||
' Else
|
||||
' TieneError = True
|
||||
' End If
|
||||
|
||||
|
||||
|
||||
' If Not TieneError Then
|
||||
' Dim CvePSPrimario = 0
|
||||
' Dim CveUMPrimario = 0
|
||||
' Dim CvePSUnificado = 0
|
||||
' Dim CveUMUnificado = 0
|
||||
' Dim DTPS1 As DataTable = GlobalDTProductosServicios(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CvePS = {0}", DdlPSPrimario.SelectedValue.ToEntero))
|
||||
' Dim DTPS2 As DataTable = GlobalDTProductosServicios(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CvePS = {0}", DdlPSUnificado.SelectedValue.ToEntero))
|
||||
|
||||
' For Each dr As DataRow In DtAlmacenes.Rows
|
||||
' CvePSPrimario = DTPS1.Rows(0)("CvePS").ToString.ToEntero
|
||||
' CveUMPrimario = DTPS1.Rows(0)("CveUM").ToString.ToEntero
|
||||
' CvePSUnificado = DTPS2.Rows(0)("CvePS").ToString.ToEntero
|
||||
' CveUMUnificado = DTPS2.Rows(0)("CveUM").ToString.ToEntero
|
||||
|
||||
|
||||
' 'VALIDA LA EXISTENCIA
|
||||
' Existencia = ObjInventario.GetExistenciasPS(CvePSUnificado, CveUMUnificado, UsuarioActual.CveEmpresa, dr("CveAlmacen").ToString.ToEntero)
|
||||
|
||||
|
||||
' 'REGISTRA LA SALIDA Y ENTRADA (TRASPASO)
|
||||
' If Existencia > 0 Then
|
||||
|
||||
' 'AGREGAMOS LA SALIDA
|
||||
' Folio = ObjInventario.GetFolioSiguiente(3, UsuarioActual.CveEmpresa)
|
||||
' CveMovimientoSalida = ObjInventario.AddMovimiento(dr("CveAlmacen").ToString.ToEntero, 3, 1, Fecha, Folio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1)
|
||||
|
||||
' If CveMovimientoSalida > 0 Then
|
||||
' If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Existencia, CveUMUnificado, CvePSUnificado, 0, -1) Then
|
||||
' TieneError = True
|
||||
' TextoError = "Ocurrió un error al guardar los movimientos de salida"
|
||||
' Exit For
|
||||
' End If
|
||||
' Else
|
||||
' TieneError = True
|
||||
' TextoError = "No se pudo generar el movimiento de salida correctamente"
|
||||
' Exit For
|
||||
' End If
|
||||
|
||||
|
||||
' 'AGREGAMOS LA ENTRADA
|
||||
' Folio = ObjInventario.GetFolioSiguiente(2, UsuarioActual.CveEmpresa)
|
||||
' CveMovimientoEntrada = ObjInventario.AddMovimiento(1, 2, 1, Fecha, Folio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1)
|
||||
|
||||
' If CveMovimientoEntrada > 0 Then
|
||||
|
||||
' If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
' For Each dr2 As DataRow In ObjInventario.DtResultados.Rows
|
||||
' If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, dr2("Cantidad").ToString.ToDouble, dr2("CveUM").ToString.ToEntero, CvePSPrimario, dr2("PU").ToString.ToDouble, -1) Then
|
||||
' TieneError = True
|
||||
' TextoError = "Ocurrió un error al guardar los movimientos de entrada"
|
||||
' Exit For
|
||||
' End If
|
||||
' Next
|
||||
|
||||
' If TieneError Then Exit For
|
||||
' Else
|
||||
' Exit For
|
||||
' TextoError = "Ocurrió un error al guardar los movimientos de entrada"
|
||||
' End If
|
||||
|
||||
' Else
|
||||
' TieneError = True
|
||||
' TextoError = "No se pudo generar el movimiento de entrada correctamente"
|
||||
' Exit For
|
||||
' End If
|
||||
|
||||
' End If
|
||||
|
||||
' Next
|
||||
' DTPS1.Dispose()
|
||||
' DTPS2.Dispose()
|
||||
' End If
|
||||
|
||||
|
||||
' If Not TieneError Then
|
||||
' ObjInventario.Commit()
|
||||
' Alert("El producto se ha unificado correctamente.", TipoMensaje.MsgInformacion)
|
||||
' CargaPS()
|
||||
' Else
|
||||
' ObjInventario.RollBack()
|
||||
' Alert(TextoError, TipoMensaje.MsgError)
|
||||
' End If
|
||||
|
||||
' ObjInventario.Dispose()
|
||||
' End Sub
|
||||
|
||||
' Private Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlClasificacion.SelectedIndexChanged
|
||||
' If DdlClasificacion.SelectedValue = "-1" Then
|
||||
' ddlProducto.DataSource = TmpPS
|
||||
' Else
|
||||
' If isWhitFamily() Then
|
||||
' ddlProducto.DataSource = TmpPS.FiltraParametros(String.Format("CveSubFamilia={0}", DdlClasificacion.SelectedValue), "PS")
|
||||
' Else
|
||||
' ddlProducto.DataSource = TmpPS.FiltraParametros(String.Format("CveClasificacion={0}", DdlClasificacion.SelectedValue), "PS")
|
||||
' End If
|
||||
' End If
|
||||
' ddlProducto.Items.Clear()
|
||||
' ddlProducto.DataBind()
|
||||
' ddlProducto.Items.Insert(0, New ListItem("----", "-1"))
|
||||
' End Sub
|
||||
' #End Region
|
||||
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user