Merge branch 'master' of http://jperez@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -13,7 +13,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
||||
End Sub
|
||||
|
||||
Private Sub CargaCombos()
|
||||
Dim DtAlmacenes As DataTable = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacen:=-1).FiltraParametros("CveTipoAlmacen in (1,2,12,14,16, 26)")
|
||||
Dim DtAlmacenes As DataTable = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacen:=-1).FiltraParametros("CveTipoAlmacen in (1,2,12,14,16,19, 26)")
|
||||
|
||||
DdlAlmacen.DataSource = DtAlmacenes
|
||||
DdlAlmacen.DataBind()
|
||||
@@ -616,7 +616,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
||||
'Mostrar Sección
|
||||
GvD.Columns(11).Visible = ChkMostrarSeccion.Checked
|
||||
GvD.Columns(12).Visible = ChkMostrarSeccion.Checked
|
||||
CargaDatos()
|
||||
'CargaDatos()
|
||||
UppD.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -1247,9 +1247,9 @@ Partial Class Inventarios_EntradasSalidas
|
||||
|
||||
|
||||
#Region " AGREGAR - GUARDAR "
|
||||
Private Function GetExistencias(CvePS As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer, CveAlmacen As Integer, Optional CveSeccionAlmacen As Integer = -1, Optional Serie As String = "-1", Optional Lote As String = "-1", Optional FechaCaducidad As Date = MinFecha) As Double
|
||||
Private Function GetExistencias(CvePS As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer, CveAlmacen As Integer, Optional CveSeccionAlmacen As Integer = -1, Optional Serie As String = "-1", Optional Lote As String = "-1", Optional FechaCaducidad As Date = MinFecha) As Decimal
|
||||
Dim Inv As New ClsInventarios
|
||||
Dim Existencia As Double = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, CveEmpresa, CveAlmacen, CveSeccionAlmacen:=CveSeccionAlmacen, FechaMovto:=String.Format("{0} {1}", TxtFecha.Text.ToDate.ToString("yyyy/MM/dd"), TxtHoraInicio.PostedTime), Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad)
|
||||
Dim Existencia As Decimal = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, CveEmpresa, CveAlmacen, CveSeccionAlmacen:=CveSeccionAlmacen, FechaMovto:=String.Format("{0} {1}", TxtFecha.Text.ToDate.ToString("yyyy/MM/dd"), TxtHoraInicio.PostedTime), Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad)
|
||||
Inv.Dispose()
|
||||
Return Existencia
|
||||
End Function
|
||||
@@ -1275,8 +1275,8 @@ Partial Class Inventarios_EntradasSalidas
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
AddNew(DdlProducto2.SelectedValue.ToEntero, DdlProducto2.SelectedText, DdlUnidad.SelectedValue.ToEntero, DdlUnidad.SelectedItem.Text, txtCantidad.Text.ToDouble,
|
||||
txtPrecio.Text.ToDouble, TxtnSerie.Text.Replace(" ", String.Empty), LblCodigo.Text, HdnCodigoAF.Value, HdnCveActivoFijo.Value, TxtObservacionesdetalle.Text,
|
||||
AddNew(DdlProducto2.SelectedValue.ToEntero, DdlProducto2.SelectedText, DdlUnidad.SelectedValue.ToEntero, DdlUnidad.SelectedItem.Text, txtCantidad.Text.ToDecimal,
|
||||
txtPrecio.Text.ToDecimal, TxtnSerie.Text.Replace(" ", String.Empty), LblCodigo.Text, HdnCodigoAF.Value, HdnCveActivoFijo.Value, TxtObservacionesdetalle.Text,
|
||||
TxtnLote.Text.Trim, TxtnFechaCaducidad.Text.ToDate, DdlSeccionAlmacen.SelectedValue.ToEntero, DdlSeccionAlmacen.SelectedItem.Text)
|
||||
LimpiarAgregar()
|
||||
|
||||
@@ -1301,7 +1301,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub AddNew(CvePS As Integer, PS As String, CveUM As Integer, UM As String, Cantidad As Double, PU As Double, Serie As String, CodigoAF As String, Codigo As String, CveAF As String, Observaciones As String, Lote As String, FechaCaducidad As Date, CveSeccionAlmacen As Integer, SeccionAlmacen As String, Optional CargarGV As Boolean = True)
|
||||
Protected Sub AddNew(CvePS As Integer, PS As String, CveUM As Integer, UM As String, Cantidad As Decimal, PU As Decimal, Serie As String, CodigoAF As String, Codigo As String, CveAF As String, Observaciones As String, Lote As String, FechaCaducidad As Date, CveSeccionAlmacen As Integer, SeccionAlmacen As String, Optional CargarGV As Boolean = True)
|
||||
If DdlAlmacen.SelectedValue.ToEntero <= 0 Then Alert("Seleccione un almacen", TipoMensaje.MsgAdvertencia) : RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") : DdlProducto2.SelectedText = "" : Exit Sub
|
||||
|
||||
Dim Valido As Boolean = True
|
||||
@@ -1340,7 +1340,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
'salida
|
||||
If Valido AndAlso DdlConcepto.SelectedValue.Contiene({"3", "5", "7", "8", "11", "12", "13", "15", "16", "17", "20", "21", "30", "31"}) Then ' salida de almacen
|
||||
|
||||
Dim Existencia As Double = GetExistencias(CvePS, CveUM, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, -1, If(Serie = "", "-1", Serie), If(Lote = "", "-1", Lote), FechaCaducidadVal)
|
||||
Dim Existencia As Decimal = GetExistencias(CvePS, CveUM, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, -1, If(Serie = "", "-1", Serie), If(Lote = "", "-1", Lote), FechaCaducidadVal)
|
||||
' LbAgregar.ToolTip = Existencia.ToString
|
||||
If Existencia - Cantidad - DtMovimientos.SUM("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUM} {If(Serie <> "", $" AND Serie = '{Serie}'", "")}") < 0 Then
|
||||
If Existencia <= 0 Then
|
||||
@@ -3199,7 +3199,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
|
||||
End If
|
||||
|
||||
AddNew(Dr("CvePS").ToString.ToEntero, Dr("PSCodigo").ToString, Dr("CveUM").ToString.ToEntero, Dr("UnidadMedida").ToString, 1, Dr("CostoPromedio").ToString.ToDouble, "", "", "", "", "", "", MinFecha, CveSeccionAlmacen, SeccionAlmacen)
|
||||
AddNew(Dr("CvePS").ToString.ToEntero, Dr("PSCodigo").ToString, Dr("CveUM").ToString.ToEntero, Dr("UnidadMedida").ToString, 1, Dr("CostoPromedio").ToString.ToDecimal, "", "", "", "", "", "", MinFecha, CveSeccionAlmacen, SeccionAlmacen)
|
||||
|
||||
TxtCodigoPS.Text = ""
|
||||
TxtCodigoPS.Focus()
|
||||
@@ -4234,7 +4234,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
End If
|
||||
|
||||
If ValorEntrada >= ValorSalida Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ValorEntrada + ValorSalida, "", 260, tConcepto, Fecha, IdCuentaOtrosIngresos, -1, CveMovimientoAlmacen:=CveMovimientoSalida, CveSubProyecto:=tCveSubProyectoSalida, ImporteMX:=ValorEntrada + ValorSalida, Contabilizable:=EsContabilizable) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ValorEntrada + ValorSalida, "", 260, tConcepto, Fecha, IdCuentaOtrosIngresos, -1, CveMovimientoAlmacen:=CveMovimientoSalida, CveSubProyecto:=tCveSubProyectoEntrada, ImporteMX:=ValorEntrada + ValorSalida, Contabilizable:=EsContabilizable) Then
|
||||
ErrorMovInv = True
|
||||
Mensaje = "Ocurrió un error al guardar los movimientos contables de ajuste de ingreso"
|
||||
End If
|
||||
|
||||
@@ -973,8 +973,8 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
If CBool(e.Row.DBCampo("AplicaCaducidad")) Then
|
||||
e.Row.FCTextBox("TxtCaducidad").Visible = True
|
||||
e.Row.FCLinkButton("LnkCaducidad").Visible = True
|
||||
e.Row.FCTextBox("TxtCaducidad").readonly = True
|
||||
CType(e.row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False
|
||||
e.Row.FCTextBox("TxtCaducidad").ReadOnly = True
|
||||
CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False
|
||||
|
||||
'si aplica caducidad y viene vacía (posible por venta anterior), que se active su registro
|
||||
If e.Row.FCTextBox("TxtCaducidad").Text = "" OrElse e.Row.FCTextBox("TxtCaducidad").Text.ToDate <= MinFecha Then
|
||||
@@ -1889,10 +1889,8 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
'BUSCA SI EXISTE YA UN TRASPASO DEL ALMACEN DE APARTADO
|
||||
CveMovimientoSalida = DtTraspasos.FiltroPrimeroValor("CveMovimientoSalida", $"CveAlmacen = {Dr2("CveAlmacen")}").ToEntero()
|
||||
|
||||
If Not CveMovimientoSalida > 0 Then
|
||||
|
||||
|
||||
|
||||
If Not CveMovimientoSalida > 0 Then
|
||||
|
||||
CveMovimientoSalida = ObjInventario.AddMovimiento(Dr2("CveAlmacen").ToString().ToEntero(), CveConceptoSalidaSinCosto, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1,
|
||||
Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, Modulo:="RE/GSC1")
|
||||
FolioSalida = ObjInventario.Folio
|
||||
@@ -1929,60 +1927,8 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
Next
|
||||
End If
|
||||
If ErrorMovInv Then Exit For
|
||||
Next
|
||||
|
||||
ElseIf CBool(Dr("AplicaLote")) Then
|
||||
|
||||
DtDetalle = DtDatosDetalleLote.FiltraParametros(String.Format("ConsecId = {0}", Dr("Consec")))
|
||||
For Each Dr1 As DataRow In DtDetalle.Rows
|
||||
If ObjInventario.GetExistenciasProducto(Dr1("CvePS").ToString().ToEntero(), Dr1("CveUM").ToString().ToEntero(), UsuarioActual.CveEmpresa, -1, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Lote:=Dr1("Lote").ToString(), CveTipoAlmacen:=26, CveSubProyecto:=CveSubProyecto, Caducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString().ToEntero(), -1)) Then
|
||||
|
||||
CantidadSaldoSinCosto = Dr("CantidadGV").ToString().ToDecimal
|
||||
|
||||
For Each Dr2 As DataRow In ObjInventario.DtResultados.FiltraParametros("CveAlmacen > 0 AND ExistenciaFinal > 0").Rows
|
||||
|
||||
'BUSCA SI EXISTE YA UN TRASPASO DEL ALMACEN DE APARTADO
|
||||
CveMovimientoSalida = DtTraspasos.FiltroPrimeroValor("CveMovimientoSalida", $"CveAlmacen = {Dr2("CveAlmacen")}").ToEntero()
|
||||
|
||||
If Not CveMovimientoSalida > 0 Then
|
||||
CveMovimientoSalida = ObjInventario.AddMovimiento(Dr2("CveAlmacen").ToString().ToEntero(), CveConceptoSalidaSinCosto, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim,
|
||||
Guia:=TxtGuia.Text, CveContrato:=CveContrato, Modulo:="RE/GSC2")
|
||||
FolioSalida = ObjInventario.Folio
|
||||
|
||||
If Not CveMovimientoSalida > 0 Then
|
||||
ErrorMovInv = True
|
||||
TextoError.AppendFormat("Ocurrió un error al procesar los movimientos de traspaso de apartado. Por favor vuelva a intentar.")
|
||||
Exit For
|
||||
End If
|
||||
|
||||
Dim DrMovto = DtTraspasos.NewRow
|
||||
DrMovto("Almacen") = Dr2("Almacen").ToString().ToEntero()
|
||||
DrMovto("CveAlmacen") = Dr2("CveAlmacen").ToString().ToEntero()
|
||||
DrMovto("CveMovimientoSalida") = CveMovimientoSalida
|
||||
DrMovto("FolioSalida") = FolioSalida
|
||||
DrMovto("CveTipoAlmacen") = 26
|
||||
DrMovto("CveConceptoMovimientoSalida") = CveConceptoSalidaSinCosto
|
||||
DtTraspasos.Rows.Add(DrMovto)
|
||||
End If
|
||||
|
||||
CantidadPendienteSinCosto = If(Dr1("Cantidad").ToString().ToDecimal > CantidadSaldoSinCosto, CantidadSaldoSinCosto, Dr1("Cantidad").ToString().ToDecimal)
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, CantidadPendienteSinCosto.ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), 0, Lote:=Dr1("Lote").ToString(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString().ToEntero(), -1)) Then
|
||||
ErrorMovInv = True
|
||||
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.")
|
||||
Exit For
|
||||
End If
|
||||
|
||||
DtDatosDetalle.Select($"Consec = {Dr1("Consec")}")(0)("FueTraspaso") = 1
|
||||
DtDatosDetalle.Select($"Consec = {Dr1("Consec")}")(0)("CveVentaDetalle") = Dr("CveVentaDetalle")
|
||||
|
||||
CantidadSaldoSinCosto -= CantidadPendienteSinCosto
|
||||
Dr("CantidadTraspaso") = Dr("CantidadTraspaso").ToString().ToDecimal + CantidadPendienteSinCosto
|
||||
If CantidadSaldoSinCosto <= 0 Then Exit For
|
||||
Next
|
||||
End If
|
||||
Next
|
||||
|
||||
Next
|
||||
|
||||
Else
|
||||
|
||||
If ObjInventario.GetExistenciasProducto(Dr("CvePS").ToString().ToEntero(), Dr("CveUM").ToString().ToEntero(), UsuarioActual.CveEmpresa, -1, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveTipoAlmacen:=26, CveSubProyecto:=CveSubProyecto, Caducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString().ToEntero(), -1)) Then
|
||||
@@ -3275,8 +3221,8 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
'sino es transitorio, los transitorios, ya no se hace otro movimiento
|
||||
|
||||
ConceptoMovimiento = If(ChkTransitorio.Checked, 2, 27)
|
||||
Almacen2 = If(ChkTransitorio.Checked, DdlAlmacenTransitorio.SelectedValue.ToEntero(), CveAlmacenTraspasoDestino)
|
||||
CveMovimientoEntrada = ObjInventario.AddMovimiento(Almacen2, ConceptoMovimiento, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim,
|
||||
Almacen2 = If(ChkTransitorio.Checked, DdlAlmacenTransitorio.SelectedValue.ToEntero(), CveAlmacenTraspasoDestino)
|
||||
CveMovimientoEntrada = ObjInventario.AddMovimiento(Almacen2, ConceptoMovimiento, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim,
|
||||
Guia:="", CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimientoSalida, CveAlmacenDestino:=CveAlmacenTraspasoDestino,
|
||||
Recibio:=If(ChkTransitorio.Checked, TxtResponsable.Text.Trim, ""), Modulo:="RE/GT1", CveOP:=CveOP)
|
||||
FolioEntrada = ObjInventario.Folio
|
||||
|
||||
@@ -366,6 +366,51 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="portlet light xspadding bordered" id="PtlProveedor">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span class="caption-subject bold uppercase">Proveedores</span>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<asp:UpdatePanel ID="UpProveedor" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
<label for="<%= DdlProveedor.ClientID.ToString()%>">Proveedor:</label>
|
||||
<ADS:Dropdownlost ID="DdlProveedor" CssStyle="width: 95%;" runat="server" DataTextField="RazonSocial" DataValueField="CveProveedor" >
|
||||
</ADS:Dropdownlost>
|
||||
</div>
|
||||
<div class="col-md-2" style="margin-top:20px;">
|
||||
<asp:Button for="DdlProveedor" ID="BtnAgregarProveedor" runat="server" CssClass="btn btn-primary btn-sm" Text="+" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:GridView ID="GvProveedor" runat="server" GridLines="None" DataKeyNames="CveProveedor,RazonSocial" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn ADSCroll" Width="100%" AutoGenerateColumns="False" ToolTip="Listado de Clasificaciones" >
|
||||
<Columns>
|
||||
<asp:BoundField DataField="RazonSocial" HeaderText="Proveedor" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Comandos">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" OnClick="DeleteProveedor_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
|
||||
|
||||
@@ -24,6 +24,14 @@ Partial Class Inventarios_InventarioFisico
|
||||
ViewState("tDTClasif") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property tDTProv As DataTable
|
||||
Get
|
||||
Return If(IsNothing(ViewState("tDTProv")), Nothing, CType(ViewState("tDTProv"), DataTable))
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("tDTProv") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property tDTClasifExcluye As DataTable
|
||||
Get
|
||||
Return If(IsNothing(ViewState("tDTClasifExcluye")), Nothing, CType(ViewState("tDTClasifExcluye"), DataTable))
|
||||
@@ -67,11 +75,13 @@ Partial Class Inventarios_InventarioFisico
|
||||
If Not IsPostBack Then
|
||||
CargaDdlSubProyectos()
|
||||
CargaDdlClasificacion()
|
||||
CargDdlProveedor()
|
||||
CargaDdlProductosServicios()
|
||||
CargDdlAlmacen()
|
||||
CreaTmpClasificaciones()
|
||||
CreaTmpProductosServicios()
|
||||
CreaTmpAlmacen()
|
||||
CreaTmpProveedores()
|
||||
CargaDatos(UsuarioActual.CveEmpresa)
|
||||
|
||||
End If
|
||||
@@ -125,6 +135,16 @@ Partial Class Inventarios_InventarioFisico
|
||||
UpProductosServicios.Update()
|
||||
UPPPSExcluye.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaGvProveedores()
|
||||
Dim ObjInventario As New ClsInventarios()
|
||||
If ObjInventario.GetInventarioFisicoDetallesProveedores(HdnID.Value, UsuarioActual.CveEmpresa) Then
|
||||
GvProveedor.DataSource = ObjInventario.DtResultados.FiltraParametros("Incluye = 1")
|
||||
End If
|
||||
ObjInventario.Dispose()
|
||||
GvProveedor.DataBind()
|
||||
UpProveedor.Update()
|
||||
End Sub
|
||||
Private Sub CargaDdlSubProyectos()
|
||||
CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto)
|
||||
CargarCentrosDeCosto(Nothing, DdlFiltroSubProyecto, Nothing, LblFiltroSubProyecto)
|
||||
@@ -153,6 +173,25 @@ Partial Class Inventarios_InventarioFisico
|
||||
DdlAlmacen.DataBind()
|
||||
End Sub
|
||||
|
||||
Private Sub CargDdlProveedor()
|
||||
|
||||
If (UsuarioActual.Empresa.Funcionalidad(105) = "1") Then
|
||||
DdlProveedor.setEsWebService(True)
|
||||
DdlProveedor.Attributes.Add("data-metodo", "getproveedores")
|
||||
DdlProveedor.SelectedText = "Todos"
|
||||
DdlProveedor.SelectedValue = "-1"
|
||||
Else
|
||||
DdlProveedor.setEsWebService(False)
|
||||
DdlProveedor.ddl.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
|
||||
DdlProveedor.ddl.DataBind()
|
||||
DdlProveedor.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "PRODUCTOS SERVICIOS"
|
||||
@@ -287,6 +326,41 @@ Partial Class Inventarios_InventarioFisico
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "PROVEEDORES"
|
||||
Private Sub BtnAgregarProveedor_Click(sender As Object, e As EventArgs) Handles BtnAgregarProveedor.Click
|
||||
If DdlProveedor.SelectedValue = -1 Then
|
||||
Alert("Tienes seleccionada la opcion 'Todos'.", TipoMensaje.MsgInformacion)
|
||||
GvPS.DataSource = Nothing
|
||||
GvPS.DataBind()
|
||||
tDTPS.Rows.Clear()
|
||||
Else
|
||||
Dim Row As DataRow = Nothing
|
||||
Row = tDTProv.NewRow
|
||||
Row("CveProveedor") = DdlProveedor.SelectedValue.ToEntero
|
||||
Row("RazonSocial") = DdlProveedor.SelectedText
|
||||
tDTProv.Rows.Add(Row)
|
||||
GvProveedor.DataSource = tDTProv
|
||||
GvProveedor.DataBind()
|
||||
UpProveedor.Update()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CreaTmpProveedores()
|
||||
tDTProv = New DataTable
|
||||
tDTProv.Columns.Add("CveProveedor", GetType(Integer))
|
||||
tDTProv.Columns.Add("RazonSocial", GetType(String))
|
||||
tDTProv.Columns.Add("Incluye", GetType(Integer))
|
||||
End Sub
|
||||
|
||||
Protected Sub DeleteProveedor_Click(sender As Object, e As EventArgs)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
tDTProv.Rows(GvRow.RowIndex.ToEntero).Delete()
|
||||
GvProveedor.DataSource = tDTProv
|
||||
GvProveedor.DataBind()
|
||||
UpProveedor.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "INVENTARIO FISICO"
|
||||
Public Sub Delete_Click(sender As Object, e As EventArgs)
|
||||
Dim ObjInventario As New ClsInventarios()
|
||||
@@ -304,6 +378,12 @@ Partial Class Inventarios_InventarioFisico
|
||||
|
||||
Public Sub Edit_Click(sender As Object, e As EventArgs)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
DdlProductosServicios.ddl.SelectedValueExist(-1)
|
||||
DdlProveedor.ddl.SelectedValueExist(-1)
|
||||
DdlPSExcluye.ddl.SelectedValueExist(-1)
|
||||
DdlClasificacion.SelectedValueExist(-1)
|
||||
DdlClasificacionExcluida.SelectedValueExist(-1)
|
||||
|
||||
tDTClasif.Rows.Clear()
|
||||
tDTClasifExcluye.Rows.Clear()
|
||||
tDTPS.Rows.Clear()
|
||||
@@ -330,10 +410,12 @@ Partial Class Inventarios_InventarioFisico
|
||||
CargaGvAlmacen()
|
||||
CargaGvClasificacion()
|
||||
CargaGvProductosServicios()
|
||||
CargaGvProveedores()
|
||||
tDTClasif = GvClasificacion.DataSource
|
||||
tDTClasifExcluye = GvClasificacionExcluida.DataSource
|
||||
tDTPS = GvPS.DataSource
|
||||
tDTPSExcluye = GvPSExcluye.DataSource
|
||||
tDTProv = GvProveedor.DataSource
|
||||
tALM = GvAlmacen.DataSource
|
||||
UpAddInventarioFisico.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "divAddInventarioFisico"))
|
||||
@@ -351,8 +433,16 @@ Partial Class Inventarios_InventarioFisico
|
||||
tDTPSExcluye.Rows.Clear()
|
||||
tDTClasifExcluye.Rows.Clear()
|
||||
tALM.Rows.Clear()
|
||||
tDTProv.Rows.Clear()
|
||||
End If
|
||||
|
||||
DdlProductosServicios.ddl.SelectedValueExist(-1)
|
||||
DdlPSExcluye.ddl.SelectedValueExist(-1)
|
||||
DdlProveedor.ddl.SelectedValueExist(-1)
|
||||
|
||||
DdlClasificacion.SelectedValueExist(-1)
|
||||
DdlClasificacionExcluida.SelectedValueExist(-1)
|
||||
|
||||
HdnModalidad.Value = "A"
|
||||
UppInventarioFisico.Update()
|
||||
BtnAgregarInventarioFisico.Text = "Agregar"
|
||||
@@ -369,6 +459,8 @@ Partial Class Inventarios_InventarioFisico
|
||||
GvPS.DataBind()
|
||||
GvPSExcluye.DataSource = Nothing
|
||||
GvPSExcluye.DataBind()
|
||||
GvProveedor.DataSource = Nothing
|
||||
GvProveedor.DataBind()
|
||||
UpAddInventarioFisico.Update()
|
||||
RegistraScript("$('#divAddInventarioFisico').modal('show');")
|
||||
|
||||
@@ -422,6 +514,16 @@ Partial Class Inventarios_InventarioFisico
|
||||
Next
|
||||
End If
|
||||
|
||||
If ErrorClasif = False Then
|
||||
For Each Gvr As GridViewRow In GvProveedor.Rows
|
||||
If Not ObjInventario.AddInventarioFisicoProveedores(HdnID.Value, Gvr.DataKey("CveProveedor").ToEntero, True) Then
|
||||
ErrorClasif = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
If ErrorClasif = False And CveInventarioFisico > 0 Then
|
||||
ObjInventario.Commit()
|
||||
Alert("Agregado Correctamente.", TipoMensaje.MsgInformacion)
|
||||
@@ -450,6 +552,10 @@ Partial Class Inventarios_InventarioFisico
|
||||
ErrorClasif = True
|
||||
End If
|
||||
|
||||
If Not ObjInventario.RemoveInventarioFisicoProveedores(HdnID.Value) Then
|
||||
ErrorClasif = True
|
||||
End If
|
||||
|
||||
If ErrorClasif = False Then
|
||||
For Each Gvr As GridViewRow In GvAlmacen.Rows
|
||||
If Not ObjInventario.AddInventarioFisicoAlmacenes(HdnID.Value, Gvr.DataKey("CveAlmacen").ToEntero) Then
|
||||
@@ -490,6 +596,16 @@ Partial Class Inventarios_InventarioFisico
|
||||
Next
|
||||
End If
|
||||
|
||||
If ErrorClasif = False Then
|
||||
For Each Gvr As GridViewRow In GvProveedor.Rows
|
||||
If Not ObjInventario.AddInventarioFisicoProveedores(HdnID.Value, Gvr.DataKey("CveProveedor").ToEntero, True) Then
|
||||
ErrorClasif = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
|
||||
If ErrorClasif = False And HdnID.Value > 0 Then
|
||||
ObjInventario.Commit()
|
||||
|
||||
@@ -184,6 +184,10 @@
|
||||
<label><b>Productos Excluidos:</b></label> <asp:Label ID="LblProductosExcluidos" runat="server" Text=""></asp:Label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"> <label><b>Proveedores:</b></label> <asp:Label ID="LblProveedores" runat="server" Text="Todos"></asp:Label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
@@ -345,7 +349,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row col-md-12" align="right" id="DivBuscador" runat="server">
|
||||
<div class="row col-md-4" align="left" id="divRegistrados" runat="server">
|
||||
<asp:Label runat="server">Número de registros: <b><asp:Literal ID="LtlTotalRegistros" runat="server"></asp:Literal></b></asp:Label>
|
||||
</div>
|
||||
<div class="row col-md-8" align="right" id="DivBuscador" runat="server">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="return Filtrar(event);" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvIFD.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
<div style="display: inline-block;" id="SumFiltra"></div>
|
||||
|
||||
@@ -32,14 +32,14 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
ViewState("CveInventarioFisico") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property DtDatos As DataTable
|
||||
Get
|
||||
Return DirectCast(ViewState("DtVentas"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtVentas") = value
|
||||
End Set
|
||||
End Property
|
||||
'Private Property DtDatos As DataTable
|
||||
' Get
|
||||
' Return DirectCast(ViewState("DtVentas"), DataTable)
|
||||
' End Get
|
||||
' Set(value As DataTable)
|
||||
' ViewState("DtVentas") = value
|
||||
' End Set
|
||||
'End Property
|
||||
Private Property CveAlmacenes As String
|
||||
Get
|
||||
Return ViewState("CveAlmacenes").ToString
|
||||
@@ -139,6 +139,7 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
LBAvance.Visible = UsuarioActual.TienePermisoProceso(178) ' si tiene permiso de ver el avance, se activa
|
||||
End Select
|
||||
GvIFD.Visible = False
|
||||
divRegistrados.Visible = False
|
||||
DivBuscador.Visible = False
|
||||
|
||||
If ObjInventario.GetInventarioFisicoDetallesAlmacen(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
|
||||
@@ -190,6 +191,20 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
LblProductosExcluidos.Text = str.ToString
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If ObjInventario.GetInventarioFisicoDetallesProveedores(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
|
||||
Dim dt As DataTable = ObjInventario.DtResultados
|
||||
Dim str As New StringBuilder
|
||||
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
||||
|
||||
For Each dr As DataRow In dt.FiltraParametros("Incluye = 1").Rows
|
||||
str.AppendFormat("{0},", dr("RazonSocial"))
|
||||
Next
|
||||
LblProveedores.Text = str.ToString
|
||||
str.Clear()
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If ObjInventario.GetInventarioFisicoDetalle(CveInventarioFisico, CveUsuario) Then
|
||||
@@ -202,7 +217,7 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
Else
|
||||
GvIFDUltimoRegistrado.DataSource = Nothing
|
||||
End If
|
||||
DtDatos = ObjInventario.DtResultados
|
||||
'DtDatos = ObjInventario.DtResultados
|
||||
End If
|
||||
Else
|
||||
GvIFD.Columns(6).Visible = False
|
||||
@@ -236,7 +251,9 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
|
||||
Protected Sub BtnVerRegistrados_Click(sender As Object, e As EventArgs)
|
||||
GvIFD.Visible = True
|
||||
DivBuscador.Visible = True
|
||||
DivBuscador.Visible = True
|
||||
divRegistrados.Visible = True
|
||||
|
||||
Dim Inventario As New ClsInventarios
|
||||
If Inventario.GetInventarioFisicoDetalle(CveInventarioFisico, ddlUsuario.SelectedValue.ToString.ToEntero) Then
|
||||
If Inventario.DtResultados.Rows.Count > 0 Then
|
||||
@@ -247,8 +264,9 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
GvIFD.DataSource = Inventario.DtResultados '.AsEnumerable.OrderByDescending(Function(k) k!CveInventarioFisicoDetalle).Take(500).CopyToDataTable
|
||||
Else
|
||||
GvIFD.DataSource = Nothing
|
||||
End If
|
||||
DtDatos = Inventario.DtResultados
|
||||
End If
|
||||
' DtDatos = Inventario.DtResultados
|
||||
LtlTotalRegistros.Text = Inventario.DtResultados.Rows.Count
|
||||
End If
|
||||
Inventario.Dispose()
|
||||
GvIFD.DataBind()
|
||||
@@ -442,7 +460,9 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
||||
End If
|
||||
GvIFD.Visible = False
|
||||
DivBuscador.Visible = False
|
||||
DivBuscador.Visible = False
|
||||
divRegistrados.Visible = False
|
||||
|
||||
UPPInventario.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -238,12 +238,12 @@ Partial Class Inventarios_Kardex
|
||||
Dim Dr = DtTemp.FiltroUltimo("")
|
||||
Dim TC = If(GlobalTipoCambio(Now) > 0, GlobalTipoCambio(Now), 1)
|
||||
|
||||
LtIndicador_Existencia.Text = Dr("Existencias").ToString.FormatoNumero()
|
||||
LtIndicador_Existencia.Text = Dr("Existencias").ToString.ToDecimal.ToString("#,##0.####")
|
||||
|
||||
LtIndicador_ValorPesos.Text = Dr("ValorInventario").ToString.FormatoNumero()
|
||||
LtIndicador_ValorDolares.Text = (Dr("ValorInventario").ToString.ToDouble / TC).FormatoNumero()
|
||||
|
||||
Dim CostoPromedio = If(Dr("Existencias").ToString.ToDouble > 0, Dr("ValorInventario").ToString.ToDouble / Dr("Existencias").ToString.ToDouble, 0)
|
||||
Dim CostoPromedio As Decimal = If(Dr("Existencias").ToString.ToDecimal.RoundSQL(4) > 0, Dr("ValorInventario").ToString.ToDecimal.RoundSQL(4) / Dr("Existencias").ToString.ToDecimal.RoundSQL(4), 0)
|
||||
LtIndicador_CPPesos.Text = CostoPromedio.FormatoNumero()
|
||||
LtIndicador_CPDolares.Text = (CostoPromedio / TC).FormatoNumero()
|
||||
|
||||
|
||||
@@ -141,12 +141,19 @@
|
||||
</div>
|
||||
</div>
|
||||
<label class="col-md-1 truncate">Producto:</label>
|
||||
<div class="col-md-2">
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlExistencia" runat="server" CssClass="select2me" Width="100%" CssStyle="width: 100%;">
|
||||
<asp:ListItem Text="Con existencia" Value="2" />
|
||||
<asp:ListItem Text="Sin existencia" Value="3" />
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1 truncate">Ver por:</label>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="Ddlgrupo" runat="server" CssClass="select2me" Width="100%" CssStyle="width: 100%;">
|
||||
<asp:ListItem Text="Almacenes" Value="1" />
|
||||
<asp:ListItem Text="Sucursales" Value="2" />
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -225,27 +232,15 @@
|
||||
<input type="text" id="TxtBusqueda2" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<table class="Widthall ScrollAD">
|
||||
<tr style="width: 100%">
|
||||
<td style="padding: 0px;">
|
||||
<table class="table Widthall">
|
||||
<tr>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 0px">
|
||||
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" ShowHeader="true" EmptyDataText="No hay registros." AutoGenerateColumns="True"
|
||||
<asp:GridView ID="GvDatos" runat="server" ShowHeader="true" EmptyDataText="No hay registros." AutoGenerateColumns="True" data-heighterror="275"
|
||||
ShowFooter="True" ShowHeaderWhenEmpty="True" HeaderStyle-CssClass="Texto" CssClass="table table-striped table-hover Widthall ScrollAD" data-sort="true" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<HeaderTemplate>
|
||||
Código
|
||||
|
||||
|
||||
Código
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<div class='truncate' style='width: 200px;'>
|
||||
@@ -269,9 +264,6 @@
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div id="DivProyeccion" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog" style="width: 450px;">
|
||||
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalTiposD" UpdateMode="Conditional">
|
||||
|
||||
@@ -35,7 +35,7 @@ Partial Class Inventarios_KardexAlmacen
|
||||
|
||||
Using ObjPS As New ClsProductosServicios
|
||||
If ObjPS.GetMarcas(UsuarioActual.CveEmpresa) Then
|
||||
DdlMarca.DataSource = ObjPS.DtResultados.Copy()
|
||||
DdlMarca.DataSource = ObjPS.DtResultados.Copy().FiltraParametros("", Orderby:="Marca")
|
||||
End If
|
||||
End Using
|
||||
DdlMarca.DataBind()
|
||||
@@ -139,8 +139,11 @@ Partial Class Inventarios_KardexAlmacen
|
||||
Dim CveAlmacenes As String = ddlAlmacen.GetSelectedValues()
|
||||
Dim CveProveedorCompra As Integer = If(DdlProveedor.SelectedValue.ToEntero > 0, DdlProveedor.SelectedValue.ToEntero, -1)
|
||||
Dim Marcas As String = If(DdlMarca.GetSelectedValuesM = "", "-1", DdlMarca.GetSelectedValuesM)
|
||||
Dim GPO As Integer = Ddlgrupo.SelectedValue.ToEntero
|
||||
|
||||
If ObjMovimientos.GetKardexAlmacenHorizontal(CvePS, FechaF, -1, DdlUnidadMedida.SelectedValue.ToEntero, CveProveedorCompra, DdlTipoAlmacen.SelectedValue.ToEntero(), DdlIncluyeTransitorios.SelectedValue.ToEntero(), DdlClasificacion.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CondicionExistencias:=DdlExistencia.SelectedValue, Orden:=DdlOrden.SelectedValue.ToEntero(), Marcas:=Marcas, IncluyeProyectado:=DdlProyeccionFiltro.SelectedValue.ToEntero, CveAlmacenes:=CveAlmacenes) Then
|
||||
If ObjMovimientos.GetKardexAlmacenHorizontal(CvePS, FechaF, -1, DdlUnidadMedida.SelectedValue.ToEntero, CveProveedorCompra, DdlTipoAlmacen.SelectedValue.ToEntero(), DdlIncluyeTransitorios.SelectedValue.ToEntero(),
|
||||
DdlClasificacion.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CondicionExistencias:=DdlExistencia.SelectedValue,
|
||||
Orden:=DdlOrden.SelectedValue.ToEntero(), Marcas:=Marcas, IncluyeProyectado:=DdlProyeccionFiltro.SelectedValue.ToEntero, CveAlmacenes:=CveAlmacenes, GPO:=GPO) Then
|
||||
If ObjMovimientos.DtResultados IsNot Nothing AndAlso ObjMovimientos.DtResultados.Rows.Count > 0 Then
|
||||
dt = ObjMovimientos.DtResultados
|
||||
Dim ListaBorrar As New List(Of DataColumn)
|
||||
|
||||
@@ -189,11 +189,11 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property TipoCambio As Double
|
||||
Private Property TipoCambio As Decimal
|
||||
Get
|
||||
Return ViewState("TipoCambio").ToString.ToDouble
|
||||
Return ViewState("TipoCambio").ToString.ToDecimal
|
||||
End Get
|
||||
Set(value As Double)
|
||||
Set(value As Decimal)
|
||||
ViewState("TipoCambio") = value
|
||||
End Set
|
||||
End Property
|
||||
@@ -1080,7 +1080,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
DdlMonedaTC.SelectedValueExist("2")
|
||||
DdlMonedaTC_SelectedIndexChanged(DdlMonedaTC, EventArgs.Empty)
|
||||
'TxtTipoCambio.Text = If(TipoCambio <= 0, GlobalTipoCambio(TxtFecha.Text.ToDate).ToString, TipoCambio.ToString)
|
||||
TipoCambio = If(TipoCambio <= 0, GlobalTipoCambio(TxtFecha.Text.ToDate), TipoCambio)
|
||||
TipoCambio = If(TipoCambio <= 0, GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal, TipoCambio)
|
||||
LtAdvertencia.Text = "El cambio de moneda se aplicara al guardar el movimiento con el tipo de cambio indicado."
|
||||
DivAdvertencia.Visible = True
|
||||
End If
|
||||
@@ -1139,7 +1139,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
|
||||
End If
|
||||
|
||||
Dim CantidadFaltante As Double = DtRecepcion.SUM("CantidadC", "CantidadF > 0")
|
||||
Dim CantidadFaltante As Decimal = DtRecepcion.SUMD("CantidadC", "CantidadF > 0")
|
||||
|
||||
If UsuarioActual.Empresa.UsaAC AndAlso CantidadFaltante > 0 Then
|
||||
PnlAC.Visible = True
|
||||
@@ -1300,24 +1300,24 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
#Region " GVINV "
|
||||
Private Sub CreaDTInv(TmDT As DataTable)
|
||||
TmDT.Columns.Add("CveAlmacen", GetType(Integer))
|
||||
TmDT.Columns.Add("PUExtranjero", GetType(Double))
|
||||
TmDT.Columns.Add("CostoIndirectoExtranjero", GetType(Double))
|
||||
TmDT.Columns.Add("PUExtranjero", GetType(Decimal))
|
||||
TmDT.Columns.Add("CostoIndirectoExtranjero", GetType(Decimal))
|
||||
TmDT.Columns.Add("Consec", GetType(Integer))
|
||||
TmDT.Columns.Add("CantidadSurtidaPantalla", GetType(Double))
|
||||
TmDT.Columns.Add("CantidadSurtidaPantalla", GetType(Decimal))
|
||||
If Not TmDT.Columns.Contains("AplicaSeccion") Then
|
||||
TmDT.Columns.Add("AplicaSeccion", GetType(Double))
|
||||
TmDT.Columns.Add("AplicaSeccion", GetType(Decimal))
|
||||
End If
|
||||
If Not TmDT.Columns.Contains("AplicaSerie") Then
|
||||
TmDT.Columns.Add("AplicaSerie", GetType(Double))
|
||||
TmDT.Columns.Add("AplicaSerie", GetType(Decimal))
|
||||
End If
|
||||
If Not TmDT.Columns.Contains("AplicaLote") Then
|
||||
TmDT.Columns.Add("AplicaLote", GetType(Double))
|
||||
TmDT.Columns.Add("AplicaLote", GetType(Decimal))
|
||||
End If
|
||||
If Not TmDT.Columns.Contains("AplicaCaducidad") Then
|
||||
TmDT.Columns.Add("AplicaCaducidad", GetType(Double))
|
||||
TmDT.Columns.Add("AplicaCaducidad", GetType(Decimal))
|
||||
End If
|
||||
If Not TmDT.Columns.Contains("CostoIndirecto") Then
|
||||
TmDT.Columns.Add("CostoIndirecto", GetType(Double))
|
||||
TmDT.Columns.Add("CostoIndirecto", GetType(Decimal))
|
||||
End If
|
||||
If Not TmDT.Columns.Contains("Lote") Then
|
||||
TmDT.Columns.Add("Lote", GetType(String))
|
||||
@@ -1332,7 +1332,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
TmDT.Columns.Add("Seleccionado", GetType(Boolean))
|
||||
End If
|
||||
If Not TmDT.Columns.Contains("CantidadSeleccionada") Then
|
||||
TmDT.Columns.Add("CantidadSeleccionada", GetType(Double))
|
||||
TmDT.Columns.Add("CantidadSeleccionada", GetType(Decimal))
|
||||
End If
|
||||
|
||||
|
||||
@@ -1600,7 +1600,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
RegistraScript("playsonidito('beep-07.wav')")
|
||||
UPInv.Update()
|
||||
Dim Dr = DtInv.Select($"Consec = {Gvr.DataKey("Consec")}")(0)
|
||||
Dr("CantidadSurtidaPantalla") = TxtCantidad.Text.ToDouble
|
||||
Dr("CantidadSurtidaPantalla") = TxtCantidad.Text.ToDecimal
|
||||
DtInv.AcceptChanges()
|
||||
Exit Sub
|
||||
End If
|
||||
@@ -1732,7 +1732,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
End If
|
||||
|
||||
Dim Dr = DtInv.Select($"Consec = {Gvr.DataKey("Consec")}")(0)
|
||||
Dr("CantidadSurtidaPantalla") = Gvr.FCTextBox("TbCantidadF").Text.ToDouble
|
||||
Dr("CantidadSurtidaPantalla") = Gvr.FCTextBox("TbCantidadF").Text.ToDecimal
|
||||
DtInv.AcceptChanges()
|
||||
Next
|
||||
|
||||
@@ -1891,7 +1891,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
DtDatosLoteDetalle = New DataTable
|
||||
DtDatosLoteDetalle.Columns.Add("Consec", GetType(Integer))
|
||||
DtDatosLoteDetalle.Columns.Add("ConsecId", GetType(Integer))
|
||||
DtDatosLoteDetalle.Columns.Add("Cantidad", GetType(Double))
|
||||
DtDatosLoteDetalle.Columns.Add("Cantidad", GetType(Decimal))
|
||||
DtDatosLoteDetalle.Columns.Add("CvePS", GetType(Integer))
|
||||
DtDatosLoteDetalle.Columns.Add("CveUM", GetType(Integer))
|
||||
DtDatosLoteDetalle.Columns.Add("PU", GetType(Decimal))
|
||||
@@ -1919,7 +1919,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
GvLote.DataBind()
|
||||
|
||||
'VALIDA QUE SIGA AGREGANDO
|
||||
If Not DtDatosLoteDetalle.SUM("Cantidad", String.Format("ConsecId = {0}", CveConsecSerie)) < LbLoteCantidad2.Text.ToDouble Then
|
||||
If Not DtDatosLoteDetalle.SUM("Cantidad", String.Format("ConsecId = {0}", CveConsecSerie)) < LbLoteCantidad2.Text.ToDecimal Then
|
||||
BtnAddPSLote.Enabled = False
|
||||
If CerrarCompletado Then
|
||||
RegistraScript("$('#DivLote').modal('hide');")
|
||||
@@ -1945,11 +1945,11 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
End If
|
||||
|
||||
Dim Dr = DtInv.Select($"Consec = {Gvr.DataKey("Consec")}")(0)
|
||||
Dr("CantidadSurtidaPantalla") = Gvr.FCTextBox("TbCantidadF").Text.ToDouble
|
||||
Dr("CantidadSurtidaPantalla") = Gvr.FCTextBox("TbCantidadF").Text.ToDecimal
|
||||
DtInv.AcceptChanges()
|
||||
Next
|
||||
|
||||
RVCantidadLote.MaximumValue = (If((LbLoteCantidad2.Text.ToDouble - Contador) = 0, 0.02, LbLoteCantidad2.Text.ToDouble - Contador)).ToString.FormatoNumero
|
||||
RVCantidadLote.MaximumValue = (If((LbLoteCantidad2.Text.ToDecimal - Contador) = 0, 0.02, LbLoteCantidad2.Text.ToDecimal - Contador)).ToString.FormatoNumero
|
||||
|
||||
TxtCantidadLote.Text = "1"
|
||||
TxtLote.Text = ""
|
||||
@@ -1990,7 +1990,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
End If
|
||||
|
||||
Dim Row = DtDatosLoteDetalle.NewRow
|
||||
Dim CantidadLote = TxtCantidadLote.Text.ToDouble
|
||||
Dim CantidadLote = TxtCantidadLote.Text.ToDecimal
|
||||
|
||||
Dim MensajeSinExistencias As New StringBuilder
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
@@ -2055,7 +2055,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
#Region " GUARDAR "
|
||||
Private Function ValidaGuardar() As Boolean
|
||||
|
||||
Dim TotalCantidad As Double = GvInv.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.FCTextBox("TbCantidadF").Text.ToDouble)
|
||||
Dim TotalCantidad As Decimal = GvInv.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.FCTextBox("TbCantidadF").Text.ToDecimal)
|
||||
If TotalCantidad <= 0 Then
|
||||
Alert("No se seleccionó ninguna cantidad de productos a guardar. Por favor verifique e intente nuevamente.", TipoMensaje.MsgAdvertencia)
|
||||
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
||||
@@ -2084,9 +2084,9 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
End If
|
||||
|
||||
|
||||
Dim TotalPorDevengar As Double = 0.0
|
||||
Dim TotalPorDevengar As Decimal = 0
|
||||
If UsuarioActual.Empresa.UsaAC Then
|
||||
TotalPorDevengar += GvAC.Rows.Cast(Of GridViewRow)().Sum(Function(Gvr) Gvr.FCTextBox("TxtImporte").Text.ToDouble)
|
||||
TotalPorDevengar += GvAC.Rows.Cast(Of GridViewRow)().Sum(Function(Gvr) Gvr.FCTextBox("TxtImporte").Text.ToDecimal)
|
||||
If TotalPorDevengar <= 0 Then
|
||||
Alert("Especifique el importe del presupuesto", TipoMensaje.MsgAdvertencia)
|
||||
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
||||
@@ -2112,7 +2112,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
If ObjComprasDif.RecepcionAlmacenGet(CveCompraSurtir, BuscaEntregaDirecta, UsuarioActual.CveEmpresa) Then
|
||||
DtDatosCompra = ObjComprasDif.DtResultados
|
||||
End If
|
||||
Dim CantidadGV = GvInv.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.DataKey("CantidadF").ToDouble)
|
||||
Dim CantidadGV = GvInv.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.DataKey("CantidadF").ToDecimal)
|
||||
Dim CantConsulta = DtDatosCompra.SUM(VariableCampo)
|
||||
If Math.Abs(CantidadGV - CantConsulta) > 0.01 Then
|
||||
CargaCompra(CveCompraSurtir, -1)
|
||||
@@ -2132,7 +2132,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
If ObjComprasDif.RecepcionAlmacenOCGet(CveOCSurtir, UsuarioActual.CveEmpresa) Then
|
||||
DtDatosOC = ObjComprasDif.DtResultados.FiltraParametros("CantidadCompra = 0")
|
||||
End If
|
||||
Dim CantidadGV = GvInv.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.DataKey("CantidadF").ToDouble)
|
||||
Dim CantidadGV = GvInv.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.DataKey("CantidadF").ToDecimal)
|
||||
Dim CantConsulta = DtDatosOC.SUM(VariableCampo)
|
||||
If Math.Abs(CantidadGV - CantConsulta) > 0.1 Then
|
||||
CargaOCPorSurtir(CveOCSurtir)
|
||||
@@ -2151,7 +2151,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
If ObjComprasDif.RecepcionAlmacenImportacionGet(CveImportacionSurtir, CveImportacionCompra, CveImportacionProveedor, UsuarioActual.CveEmpresa) Then
|
||||
DtDatosImportacion = ObjComprasDif.DtResultados
|
||||
End If
|
||||
Dim CantidadGV = GvInv.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.DataKey("CantidadF").ToDouble)
|
||||
Dim CantidadGV = GvInv.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.DataKey("CantidadF").ToDecimal)
|
||||
Dim CantConsulta = DtDatosImportacion.SUM(VariableCampo)
|
||||
If CantidadGV <> CantConsulta Then
|
||||
CargaImportacionSurtir(CveImportacionSurtir)
|
||||
@@ -2170,7 +2170,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
If ObjComprasDif.RecepcionAlmacenFleteGet(CveFleteSurtir, CveFleteOrdenCompra, CveFleteCompra, UsuarioActual.CveEmpresa) Then
|
||||
DtDatosImportacion = ObjComprasDif.DtResultados
|
||||
End If
|
||||
Dim CantidadGV = GvInv.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.DataKey("CantidadF").ToDouble)
|
||||
Dim CantidadGV = GvInv.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.DataKey("CantidadF").ToDecimal)
|
||||
Dim CantConsulta = DtDatosImportacion.SUM(VariableCampo)
|
||||
If CantidadGV <> CantConsulta Then
|
||||
CargaFleteSurtir(CveFleteSurtir)
|
||||
@@ -2441,7 +2441,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
Try
|
||||
'RECARGA TC CUANDO ES RECEPCION CON OC Y DOLARES
|
||||
If CveOCSurtir > 0 And CveMoneda <> 1 Then
|
||||
TipoCambio = GlobalTipoCambio(TxtFecha.Text.ToDate)
|
||||
TipoCambio = GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal
|
||||
End If
|
||||
|
||||
If HdnTipoDocto.Value <> "Fac" Then RecibidaCompleta = False
|
||||
@@ -2513,7 +2513,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
SumaTotal += PU + CostoIndirecto
|
||||
If RecibidaCompleta AndAlso Cont + 1 = GvInv.Rows.Count AndAlso ContDt + 1 = DtDetalle.Rows.Count AndAlso Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2) <> SumaTotal Then
|
||||
If Not UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
PU = Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2).ToDecimal - (SumaTotal - (PU))
|
||||
PU = Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2) - (SumaTotal - (PU))
|
||||
End If
|
||||
End If
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaTraspaso, 1, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), Serie:=Dr("Serie").ToString, CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario, FechaCaducidad:=If(CBool(gvr.DataKey("AplicaCaducidad")), gvr.FCTextBox("TxtCaducidad").Text.ToDate, MinFecha), Lote:=If(CBool(gvr.DataKey("AplicaLote")), gvr.FCTextBox("TxtLote").Text, ""), CveSeccionAlmacen:=If(CBool(gvr.DataKey("AplicaSeccion")), gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, -1)) Then
|
||||
@@ -2530,7 +2530,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
SumaTotal += Dr("Cantidad").ToString.ToDecimal * (PU + CostoIndirecto)
|
||||
If RecibidaCompleta AndAlso Cont + 1 = GvInv.Rows.Count AndAlso ContDt + 1 = DtDetalleLote.Rows.Count AndAlso Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2) <> SumaTotal Then
|
||||
If Not UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
PU = (Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2).ToDecimal - (SumaTotal - (Dr("Cantidad").ToString.ToDecimal * (PU)))) / Dr("Cantidad").ToString.ToDecimal
|
||||
PU = (Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2) - (SumaTotal - (Dr("Cantidad").ToString.ToDecimal * (PU)))) / Dr("Cantidad").ToString.ToDecimal
|
||||
End If
|
||||
End If
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaTraspaso, Dr("Cantidad").ToString.ToDouble, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario, CveSeccionAlmacen:=If(CBool(gvr.DataKey("AplicaSeccion")), gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, -1)) Then
|
||||
@@ -2548,7 +2548,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
If RecibidaCompleta AndAlso Cont + 1 = GvInv.Rows.Count AndAlso Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2) <> Math.Round(SumaTotal, 2) Then
|
||||
Dim tTotal As Decimal = gvr.FCTextBox("TbCantidadF").Text.ToDecimal * (PU)
|
||||
If Not UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
PU = (Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2).ToDecimal - (SumaTotal - tTotal)) / gvr.FCTextBox("TbCantidadF").Text.ToDecimal
|
||||
PU = (Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2) - (SumaTotal - tTotal)) / gvr.FCTextBox("TbCantidadF").Text.ToDecimal
|
||||
End If
|
||||
End If
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaTraspaso, gvr.FCTextBox("TbCantidadF").Text.ToDouble, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario, FechaCaducidad:=If(CBool(gvr.DataKey("AplicaCaducidad")), gvr.FCTextBox("TxtCaducidad").Text.ToDate, MinFecha), Lote:=If(CBool(gvr.DataKey("AplicaLote")), gvr.FCTextBox("TxtLote").Text, ""), CveSeccionAlmacen:=If(CBool(gvr.DataKey("AplicaSeccion")), gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, -1)) Then
|
||||
@@ -2614,7 +2614,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
SumaTotal += PU.RoundAD + CostoIndirecto ' se redondea a dos decimales. por la unidad es uno
|
||||
If RecibidaCompleta AndAlso Cont + 1 = GvInv.Rows.Count AndAlso ContDt + 1 = DtDetalle.Rows.Count AndAlso Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2) <> SumaTotal Then
|
||||
If Not UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
PU = Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2).ToDecimal - (SumaTotal - (PU))
|
||||
PU = Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2) - (SumaTotal - (PU))
|
||||
End If
|
||||
End If
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, 1, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), Serie:=Dr("Serie").ToString, CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario, FechaCaducidad:=If(CBool(gvr.DataKey("AplicaCaducidad")), gvr.FCTextBox("TxtCaducidad").Text.ToDate, MinFecha), Lote:=If(CBool(gvr.DataKey("AplicaLote")), gvr.FCTextBox("TxtLote").Text, ""), CveSeccionAlmacen:=If(CBool(gvr.DataKey("AplicaSeccion")), gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, -1)) Then
|
||||
@@ -2631,7 +2631,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
SumaTotal += Dr("Cantidad").ToString.ToDecimal * (PU + CostoIndirecto)
|
||||
If RecibidaCompleta AndAlso Cont + 1 = GvInv.Rows.Count AndAlso ContDt + 1 = DtDetalleLote.Rows.Count AndAlso Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2) <> SumaTotal Then
|
||||
If Not UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
PU = (Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2).ToDecimal - (SumaTotal - (Dr("Cantidad").ToString.ToDecimal * (PU)))) / Dr("Cantidad").ToString.ToDecimal
|
||||
PU = (Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2) - (SumaTotal - (Dr("Cantidad").ToString.ToDecimal * (PU)))) / Dr("Cantidad").ToString.ToDecimal
|
||||
End If
|
||||
End If
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario, CveSeccionAlmacen:=If(CBool(gvr.DataKey("AplicaSeccion")), gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, -1)) Then
|
||||
@@ -2648,7 +2648,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
If RecibidaCompleta AndAlso Cont + 1 = GvInv.Rows.Count AndAlso Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2) <> Math.Round(SumaTotal, 2) Then
|
||||
Dim tTotal As Decimal = gvr.FCTextBox("TbCantidadF").Text.ToDecimal * (PU)
|
||||
If Not UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
PU = (Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2).ToDecimal - (SumaTotal - tTotal)) / gvr.FCTextBox("TbCantidadF").Text.ToDecimal
|
||||
PU = (Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2) - (SumaTotal - tTotal)) / gvr.FCTextBox("TbCantidadF").Text.ToDecimal
|
||||
End If
|
||||
End If
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, gvr.FCTextBox("TbCantidadF").Text.ToDouble, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario, FechaCaducidad:=If(CBool(gvr.DataKey("AplicaCaducidad")), gvr.FCTextBox("TxtCaducidad").Text.ToDate, MinFecha), Lote:=If(CBool(gvr.DataKey("AplicaLote")), gvr.FCTextBox("TxtLote").Text, ""), CveSeccionAlmacen:=If(CBool(gvr.DataKey("AplicaSeccion")), gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, -1)) Then
|
||||
@@ -2680,7 +2680,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
If CveTipoCompra = 8 Then 'entrada almacen con costo indirecto cargado en la misma compra
|
||||
tTotalInsertado = dtt.SUMD("Total") ' está incluido el costo indirecto en la factura
|
||||
End If
|
||||
If (TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)).RoundAD <> tTotalInsertado.RoundAD Then
|
||||
If (TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)).RoundSQL <> tTotalInsertado.RoundSQL Then
|
||||
ErrorMovInv = True
|
||||
Alert("La Entrada no coincide con el valor del documento." & Math.Round(TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1), 2) & " -" & tTotalInsertado, TipoMensaje.MsgError)
|
||||
GuardaLog("La Entrada no coincide con el valor del documento." & Math.Round(TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1), 2) & " -" & tTotalInsertado)
|
||||
@@ -3107,7 +3107,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
If CveTipoCompra = 8 Then 'entrada almacen con costo indirecto cargado en la misma compra
|
||||
tTotalInsertado = dtt.SUMD("Total") + ImporteIngresoAdicional ' está incluido el costo indirecto en la factura
|
||||
End If
|
||||
If Math.Round(TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1), 2) <> Math.Round(tTotalInsertado, 2) Then
|
||||
If (TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)).RoundSQL <> tTotalInsertado.RoundSQL Then
|
||||
ErrorMovInv = True
|
||||
Alert("La Entrada no coincide con el valor del documento." & Math.Round(TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1), 2) & " -" & tTotalInsertado.RoundSQL.ToString, TipoMensaje.MsgError)
|
||||
GuardaLog("La Entrada no coincide con el valor del documento." & Math.Round(TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1), 2) & " -" & tTotalInsertado.RoundSQL.ToString)
|
||||
@@ -3249,8 +3249,8 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
|
||||
If CveMoneda <> 1 AndAlso UsaComplementariaFleteImportaciones Then
|
||||
'COMPLEMENTARIA
|
||||
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCostoExtranjero, SerieFolio, CveConceptoContableCostoME, SerieFolio, Fecha, IdCtaContableRecepcionME, -1, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveSubProyecto:=CveSubProyecto, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCostoExtranjero, ImporteME:=TotalCostoExtranjero, TipoCambio:=TipoCambio.ToDecimal, CveOCDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero, Contabilizable:=EsContabilizable) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCostoDetalle - TotalCostoExtranjero, SerieFolio, CveConceptoContableCostoComplementaria, SerieFolio, Fecha, IdCtaContableRecepcionComplementaria, -1, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveProveedor:=CveProveedor, CveSubProyecto:=CveSubProyecto, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCostoDetalle - TotalCostoExtranjero, ImporteME:=TotalCostoExtranjero, TipoCambio:=TipoCambio.ToDecimal, CveOCDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero, Contabilizable:=EsContabilizable) Then
|
||||
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCostoExtranjero, SerieFolio, CveConceptoContableCostoME, SerieFolio, Fecha, IdCtaContableRecepcionME, -1, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveSubProyecto:=CveSubProyecto, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCostoExtranjero, ImporteME:=TotalCostoExtranjero, TipoCambio:=TipoCambio, CveOCDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero, Contabilizable:=EsContabilizable) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCostoDetalle - TotalCostoExtranjero, SerieFolio, CveConceptoContableCostoComplementaria, SerieFolio, Fecha, IdCtaContableRecepcionComplementaria, -1, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveProveedor:=CveProveedor, CveSubProyecto:=CveSubProyecto, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCostoDetalle - TotalCostoExtranjero, ImporteME:=TotalCostoExtranjero, TipoCambio:=TipoCambio, CveOCDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero, Contabilizable:=EsContabilizable) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -3273,8 +3273,8 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
|
||||
If CveMoneda <> 1 AndAlso UsaComplementariaFleteImportaciones Then
|
||||
'COMPLEMENTARIA
|
||||
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCostoExtranjero, SerieFolio, CveConceptoContableCostoME, SerieFolio, Fecha, IdCtaContableRecepcionME, -1, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCostoExtranjero, ImporteME:=TotalCostoExtranjero, TipoCambio:=TipoCambio.ToDecimal, Contabilizable:=EsContabilizable) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCosto - TotalCostoExtranjero, SerieFolio, CveConceptoContableCostoComplementaria, SerieFolio, Fecha, IdCtaContableRecepcionComplementaria, -1, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto - TotalCostoExtranjero, ImporteME:=TotalCostoExtranjero, TipoCambio:=TipoCambio.ToDecimal, Contabilizable:=EsContabilizable) Then
|
||||
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCostoExtranjero, SerieFolio, CveConceptoContableCostoME, SerieFolio, Fecha, IdCtaContableRecepcionME, -1, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCostoExtranjero, ImporteME:=TotalCostoExtranjero, TipoCambio:=TipoCambio, Contabilizable:=EsContabilizable) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCosto - TotalCostoExtranjero, SerieFolio, CveConceptoContableCostoComplementaria, SerieFolio, Fecha, IdCtaContableRecepcionComplementaria, -1, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto - TotalCostoExtranjero, ImporteME:=TotalCostoExtranjero, TipoCambio:=TipoCambio, Contabilizable:=EsContabilizable) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
Else
|
||||
@@ -3355,7 +3355,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
Dim TotalNC As Decimal = 0
|
||||
Dim CveClasificacionDifCostoNC = -1
|
||||
Dim tTipoCambio As Decimal = 1
|
||||
If CveMoneda <> 1 Then tTipoCambio = TipoCambio.ToDecimal
|
||||
If CveMoneda <> 1 Then tTipoCambio = TipoCambio
|
||||
|
||||
For Each gvr As GridViewRow In GvInv.Rows
|
||||
TotalNC += gvr.FCTextBox("TbCantidadF").Text.ToDecimal * gvr.DataKey("PU").ToDecimal * tTipoCambio
|
||||
@@ -4128,7 +4128,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
DdlMonedaTC.SelectedValueExist("2")
|
||||
DdlMonedaTC_SelectedIndexChanged(DdlMonedaTC, EventArgs.Empty)
|
||||
'TxtTipoCambio.Text = If(TipoCambio <= 0, GlobalTipoCambio(TxtFecha.Text.ToDate).ToString, TipoCambio.ToString)
|
||||
TipoCambio = If(TipoCambio <= 0, GlobalTipoCambio(TxtFecha.Text.ToDate), TipoCambio)
|
||||
TipoCambio = If(TipoCambio <= 0, GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal, TipoCambio)
|
||||
If TipoCambio > 0 Then
|
||||
LtAdvertencia.Text = "El cambio de moneda se aplicara al guardar el movimiento con el tipo de cambio indicado."
|
||||
DivAdvertencia.Visible = True
|
||||
@@ -4210,7 +4210,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
'TipoCambio = TxtTipoCambio.Text.ToDouble
|
||||
|
||||
If CveOCSurtir > 0 Then
|
||||
TipoCambio = GlobalTipoCambio(TxtFecha.Text.ToDate)
|
||||
TipoCambio = GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal
|
||||
End If
|
||||
|
||||
For Each Dr As DataRow In DtInv.Rows
|
||||
|
||||
@@ -22,22 +22,12 @@ Partial Class Inventarios_Remanufactura
|
||||
Return ViewState("IdCtaContRetIVA").ToString.ToEntero
|
||||
End Get
|
||||
End Property
|
||||
Private ReadOnly Property CveCuentaRetIVA As Integer
|
||||
Get
|
||||
Return ViewState("CveCuentaRetIVA").ToString.ToEntero
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private ReadOnly Property IdCtaContRetISR As Integer
|
||||
Get
|
||||
Return ViewState("IdCtaContRetISR").ToString.ToEntero
|
||||
End Get
|
||||
End Property
|
||||
Private ReadOnly Property CveCuentaRetISR As Integer
|
||||
Get
|
||||
Return ViewState("CveCuentaRetISR").ToString.ToEntero
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private Property MensajeAlert As StringBuilder
|
||||
Get
|
||||
Return CType(ViewState("MensajeAlert"), StringBuilder)
|
||||
@@ -539,9 +529,7 @@ Partial Class Inventarios_Remanufactura
|
||||
ObjFactura.ClaveUsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", $"CveUsoCFDI = {ObjCliente.CveUsoCFDI}")
|
||||
|
||||
ViewState("IdCtaContRetIVA") = ObjCliente.IdCtaContRetIVA
|
||||
ViewState("CveCuentaRetIVA") = ObjCliente.CveCuentaRetIVA
|
||||
ViewState("IdCtaContRetISR") = ObjCliente.IdCtaContRetISR
|
||||
ViewState("CveCuentaRetISR") = ObjCliente.CveCuentaRetISR
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -774,7 +762,6 @@ Partial Class Inventarios_Remanufactura
|
||||
Dim importeMovimiento As Decimal
|
||||
Dim FechaMovimiento As Date = Date.Today
|
||||
Dim IdCtaContable As Integer
|
||||
Dim CveCuenta As Integer
|
||||
Dim IdCtaContableCliente As Integer
|
||||
Dim Concepto As String = ViewState("VentaFolio").ToString
|
||||
Dim Referencia As String = ViewState("VentaFolio").ToString
|
||||
@@ -790,7 +777,6 @@ Partial Class Inventarios_Remanufactura
|
||||
TipoMovimiento = If(Row("TipoMovto").ToString = "True", True, False)
|
||||
importeMovimiento = 0
|
||||
IdCtaContable = 0
|
||||
CveCuenta = 0
|
||||
Multiplicador = (Row("Multiplicador").ToString.ToEntero)
|
||||
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", "")
|
||||
|
||||
@@ -891,16 +877,6 @@ Partial Class Inventarios_Remanufactura
|
||||
End If
|
||||
End If
|
||||
|
||||
'Contabilidad SIG
|
||||
If CveCuentaRetIVA > 0 Then
|
||||
CveCuenta = CveCuentaRetIVA
|
||||
Else
|
||||
If ObjConta.GetRetCuenta(ConceptoContable, ObjFactura.CveEmpresa) Then
|
||||
If ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
CveCuenta = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacionSIG").ToString.ToEntero
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
Case 9 'Ret ISR por Trasladar
|
||||
@@ -921,16 +897,6 @@ Partial Class Inventarios_Remanufactura
|
||||
End If
|
||||
End If
|
||||
|
||||
'Contabilidad SIG
|
||||
If CveCuentaRetISR > 0 Then
|
||||
CveCuenta = CveCuentaRetISR
|
||||
Else
|
||||
If ObjConta.GetRetCuenta(ConceptoContable, ObjFactura.CveEmpresa) Then
|
||||
If ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
CveCuenta = ObjConta.DtResultados.Rows(0)("IdCuentaRetISRCirculacionSIG").ToString.ToEntero
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
@@ -950,7 +916,6 @@ Partial Class Inventarios_Remanufactura
|
||||
If importeMovimiento > 0 AndAlso ObjConta.GetRetCuenta(ConceptoContable, ObjFactura.CveEmpresa) Then
|
||||
If ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSxTrasladar").ToString.ToEntero
|
||||
CveCuenta = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSxTrasladarSIG").ToString.ToEntero
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -167,6 +167,9 @@
|
||||
<label><b>Productos Excluidos:</b></label> <asp:Label ID="LblProductosExcluidos" runat="server" Text=""></asp:Label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"> <label><b>Proveedores:</b></label> <asp:Label ID="LblProveedores" runat="server" Text="Todos"></asp:Label></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@@ -201,7 +204,7 @@
|
||||
<asp:BoundField HeaderText="Sección Almacén" DataField="SeccionAlmacen"/>
|
||||
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="FechaCaducidad" DataField="FechaCaducidad" ItemStyle-HorizontalAlign="Left" DataFormatString="{0:d}" />
|
||||
<asp:BoundField HeaderText="Fecha Caducidad" DataField="FechaCaducidad" ItemStyle-HorizontalAlign="Left" DataFormatString="{0:d}" />
|
||||
<asp:BoundField HeaderText="Existencia" DataField="CantidadAlmacen" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Inv. Físico" DataField="CantidadInventarioFisico" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Diferencia" DataField="Diferencia" DataFormatString="{0:#,###.##}" ItemStyle-Font-Bold="true" />
|
||||
@@ -236,7 +239,7 @@
|
||||
<asp:BoundField HeaderText="Sección Almacén" DataField="SeccionAlmacen"/>
|
||||
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="FechaCaducidad" DataField="FechaCaducidad" ItemStyle-HorizontalAlign="Left" DataFormatString="{0:d}" />
|
||||
<asp:BoundField HeaderText="Fecha Caducidad" DataField="FechaCaducidad" ItemStyle-HorizontalAlign="Left" DataFormatString="{0:d}" />
|
||||
<asp:BoundField HeaderText="Existencia" DataField="CantidadAlmacen" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Inv. Físico" DataField="CantidadInventarioFisico" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Diferencia" DataField="Diferencia" DataFormatString="{0:#,###.##}" ItemStyle-Font-Bold="true" />
|
||||
|
||||
@@ -132,9 +132,26 @@ Partial Class Inventarios_RepAnomalias
|
||||
End If
|
||||
|
||||
End If
|
||||
If Inventario.GetInventarioFisicoDetallesProveedores(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
|
||||
Dim dta As DataTable = Inventario.DtResultados
|
||||
Dim str As New StringBuilder
|
||||
If dta IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
||||
|
||||
For Each dr As DataRow In dta.FiltraParametros("Incluye = 1").Rows
|
||||
str.AppendFormat("{0},", dr("RazonSocial"))
|
||||
Next
|
||||
LblProveedores.Text = str.ToString
|
||||
str.Clear()
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
Inventario.Dispose()
|
||||
|
||||
If Not String.IsNullOrWhiteSpace(UsuarioActual.Empresa.Funcionalidad(147)) Then GvS.Columns(7).HeaderText = UsuarioActual.Empresa.Funcionalidad(147)
|
||||
If Not String.IsNullOrWhiteSpace(UsuarioActual.Empresa.Funcionalidad(147)) Then GvF.Columns(7).HeaderText = UsuarioActual.Empresa.Funcionalidad(147)
|
||||
|
||||
|
||||
GvS.DataSource = dt.FiltraParametros("Diferencia < 0")
|
||||
Dim DtS As DataTable = dt.FiltraParametros("Diferencia < 0")
|
||||
GvS.DataBind()
|
||||
@@ -158,6 +175,7 @@ Partial Class Inventarios_RepAnomalias
|
||||
Script += "OrdenarGVS();"
|
||||
End If
|
||||
|
||||
|
||||
RegistraScript(Script)
|
||||
|
||||
UPAnomalias.Update()
|
||||
|
||||
@@ -537,13 +537,19 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
End If
|
||||
|
||||
'codigo provisional.
|
||||
Dim CveSubP As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenOrigen.selectedvalue.toentero).FiltroPrimeroValor("CveSubProyecto", "").ToEntero
|
||||
Dim CveSubP As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenOrigen.SelectedValue.ToEntero).FiltroPrimeroValor("CveSubProyecto", "").ToEntero
|
||||
|
||||
If DrPS("AplicaCaducidad").ToString = "True" AndAlso CveSubP.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347)) Then
|
||||
If Not ChkSugiereFechaCaducidad.Checked AndAlso (TxtnFechaCaducidad.Text = "" OrElse TxtnLote.Text = "") Then
|
||||
Alert("Falta Especificar lote/Fecha del producto", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
If DrPS("AplicaCaducidad").ToString = "True" AndAlso ChkSugiereFechaCaducidad.checked And CveSubP.Contiene(10276) Then
|
||||
If DrPS("AplicaCaducidad").ToString = "True" AndAlso ChkSugiereFechaCaducidad.Checked And CveSubP.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347)) Then
|
||||
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
If ObjInventarios.GetExistenciasCaducidad(CveProducto, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.selectedvalue) Then
|
||||
If ObjInventarios.GetExistenciasCaducidad(CveProducto, DdlAlmacenOrigen.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue) Then
|
||||
Dim dtt As DataTable = ObjInventarios.DtResultados
|
||||
|
||||
If Cantidad > dtt.SUMD("Cantidad") Then
|
||||
@@ -577,22 +583,20 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
tLote = If(TxtnLote.Visible, TxtnLote.Text, "-1")
|
||||
tCaducidad = If(TxtnFechaCaducidad.Visible, TxtnFechaCaducidad.Text.ToDate, MinFecha)
|
||||
|
||||
If CveSubP <> 10276 Then
|
||||
If Not CveSubP.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347)) Then
|
||||
tLote = "-1"
|
||||
tCaducidad = MinFecha
|
||||
End If
|
||||
|
||||
|
||||
Dim Valido = ValidaExistencia(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, DdlSeccionAlmacen.SelectedValue.ToEntero, If(TxtnSerie.Visible, TxtnSerie.Text, "-1"), tLote, tCaducidad)
|
||||
|
||||
If Valido Then
|
||||
If Valido Then
|
||||
AgregarPS(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, TxtnObservaciones.Text, CveSeccionAlmacen:=DdlSeccionAlmacen.SelectedValue.ToEntero, SeccionAlmacen:=DdlSeccionAlmacen.SelectedItem.Text, Serie:=If(TxtnSerie.Visible, TxtnSerie.Text, ""), Lote:=If(tLote = "-1", "", tLote), FechaCaducidad:=tCaducidad, CveSeccionAlmacenDestino:=DdlSeccionAlmacenDestino.SelectedValue.ToEntero, Limpia:=FuncionalidadSinSerie)
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
@@ -601,21 +605,29 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
|
||||
Dim ExistenciaEspecificada As Decimal
|
||||
Dim CantidadEnGrid As Decimal = DtMovimientos.SUMD("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUnidadMedida} {If(Serie <> "-1", $" AND Serie = '{Serie}'", "")}")
|
||||
Dim Existencia As Decimal
|
||||
|
||||
Dim Inv As New ClsInventarios
|
||||
Dim Existencia As Decimal = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), PendientePorSurtir:=1)
|
||||
If Inv.GetExistenciasProducto(CvePS, CveUnidadMedida, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm")) Then
|
||||
'si hay existencia en almacen costeado, lo tengo que sacar
|
||||
Existencia = Inv.DtResultados.FiltroPrimeroValor("ExistenciaFinal", String.Format("CVeAlmacen = {0}", DdlAlmacenOrigen.SelectedValue)).ToDecimal
|
||||
End If
|
||||
'Existencia= Inv.GetExistenciasPS(CvePS, CveUnidadMedida, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), PendientePorSurtir:=1)
|
||||
|
||||
If Existencia > 0 Then
|
||||
'la primera vez valida, que la existencia global, cumpla, considerando lo pendiente por surtir
|
||||
'las segunda consulta, que tenga existencia, ya con los parametros especificos
|
||||
If (FechaCaducidad > MinFecha OrElse Not Serie.Contiene("", "-1") OrElse Not Lote.Contiene("", "-1")) Then
|
||||
ExistenciaEspecificada = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, PendientePorSurtir:=-1)
|
||||
Dim StrB As New stringbuilder
|
||||
StrB.appendformat("CvePS = {0} AND CveUM = {1} ", CvePS, CveUnidadMedida)
|
||||
If Not Serie.Contiene("", "-1") Then StrB.appendformat(" AND Serie = '{0}' ", Serie)
|
||||
If Not Lote.Contiene("", "-1") Then StrB.appendformat(" AND Lote = '{0}' ", Lote)
|
||||
If FechaCaducidad.ToDate > MinFecha Then StrB.appendformat(" AND FechaCaducidad = '{0}' ", FechaCaducidad.ToShortDateString)
|
||||
Dim CantidadEspecificaEnGrid As Decimal = DtMovimientos.SUMD("Cantidad", StrB.tostring)
|
||||
If Inv.GetExistenciasProducto(CvePS, CveUnidadMedida, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, Caducidad:=FechaCaducidad) Then
|
||||
ExistenciaEspecificada = Inv.DtResultados.FiltroPrimeroValor("ExistenciaFinal", String.Format("CVeAlmacen = {0}", DdlAlmacenOrigen.SelectedValue)).ToDecimal
|
||||
End If
|
||||
'ExistenciaEspecificada = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, PendientePorSurtir:=-1)
|
||||
Dim StrB As New StringBuilder
|
||||
StrB.AppendFormat("CvePS = {0} AND CveUM = {1} ", CvePS, CveUnidadMedida)
|
||||
If Not Serie.Contiene("", "-1") Then StrB.AppendFormat(" AND Serie = '{0}' ", Serie)
|
||||
If Not Lote.Contiene("", "-1") Then StrB.AppendFormat(" AND Lote = '{0}' ", Lote)
|
||||
If FechaCaducidad.ToDate > MinFecha Then StrB.AppendFormat(" AND FechaCaducidad = '{0}' ", FechaCaducidad.ToShortDateString)
|
||||
Dim CantidadEspecificaEnGrid As Decimal = DtMovimientos.SUMD("Cantidad", StrB.ToString)
|
||||
|
||||
If ExistenciaEspecificada - Cantidad - CantidadEspecificaEnGrid < 0 Then
|
||||
Alert(String.Format("Solo hay en existencia: {0:#,###.##}", ExistenciaEspecificada), TipoMensaje.MsgAdvertencia)
|
||||
@@ -837,13 +849,22 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
|
||||
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))
|
||||
Existencia = ObjInventario.GetExistenciasPS(dr("CvePS").ToString.ToEntero, dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, PendientePorSurtir:=1)
|
||||
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
|
||||
'si hay existencia en almacen costeado, lo tengo que sacar
|
||||
Existencia = ObjInventario.DtResultados.FiltroPrimeroValor("ExistenciaFinal", String.Format("CVeAlmacen = {0}", DdlAlmacenOrigen.SelectedValue)).ToDecimal
|
||||
End If
|
||||
|
||||
'Existencia = ObjInventario.GetExistenciasPS(dr("CvePS").ToString.ToEntero, dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, PendientePorSurtir:=1)
|
||||
Existencia -= CantidadenGrid
|
||||
'DtMovimientos.SUM("Cantidad", String.Format("CvePS = {0}", dr("CvePS").ToString.ToEntero))
|
||||
'la primera vez valida, que la existencia global, cumpla, considerando lo pendiente por surtir
|
||||
'las segunda consulta, que tenga existencia, ya con los parametros especificos
|
||||
If FechaCaducidad > MinFecha OrElse (Lote <> "-1" AndAlso Lote <> "") Then
|
||||
ExistenciaEspecificada = ObjInventario.GetExistenciasPS(dr("CvePS").ToString.ToEntero, dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, PendientePorSurtir:=-1)
|
||||
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
|
||||
ExistenciaEspecificada = ObjInventario.DtResultados.FiltroPrimeroValor("ExistenciaFinal", String.Format("CVeAlmacen = {0}", DdlAlmacenOrigen.SelectedValue)).ToDecimal
|
||||
End If
|
||||
|
||||
'ExistenciaEspecificada = ObjInventario.GetExistenciasPS(dr("CvePS").ToString.ToEntero, dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, PendientePorSurtir:=-1)
|
||||
Existencia = ExistenciaEspecificada - CantidadenGrid
|
||||
End If
|
||||
|
||||
@@ -865,7 +886,11 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Lote = If(gvr.DataKey("Lote") = "", "-1", gvr.DataKey("Lote"))
|
||||
FechaCaducidad = If(gvr.DataKey("FechaCaducidad") = "", MinFecha, gvr.DataKey("FechaCaducidad").ToDate)
|
||||
|
||||
Existencia = ObjInventario.GetExistenciasPS(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, FechaCaducidad:=FechaCaducidad, PendientePorSurtir:=1)
|
||||
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
|
||||
'si hay existencia en almacen costeado, lo tengo que sacar
|
||||
Existencia = ObjInventario.DtResultados.FiltroPrimeroValor("ExistenciaFinal", String.Format("CVeAlmacen = {0}", DdlAlmacenOrigen.SelectedValue)).ToDecimal
|
||||
End If
|
||||
'Existencia = ObjInventario.GetExistenciasPS(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, FechaCaducidad:=FechaCaducidad, PendientePorSurtir:=1)
|
||||
Existencia -= gvr.FCTextBox("TxtCantidad2").Text.ToEntero
|
||||
If Existencia < 0 Then
|
||||
ErrorExistencia = True
|
||||
@@ -1042,11 +1067,9 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
|
||||
Dim resultado As DataTable = ObjInventario.DtResultados
|
||||
Dim importe As Decimal = resultado.SUMD("Total").RoundAD
|
||||
'Dim IdCtaContableSalida As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenOrigen.SelectedValue.ToEntero)).ToEntero
|
||||
'Dim IdCtaContableEntrada As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenDestino.SelectedValue.ToEntero)).ToEntero
|
||||
Dim Contabilizable As Boolean = True
|
||||
Dim Contabilizable As Boolean = False
|
||||
|
||||
If IdCtaContableOrigen = IdCtaContableDestino And TipoAlmacenDestino <> 26 Then Contabilizable = False
|
||||
If TipoAlmacenOrigen = 26 AndAlso TipoAlmacenDestino <> 26 Then Contabilizable = True 'IdCtaContableOrigen = IdCtaContableDestino AndAlso
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContableOrigen, -1, CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=Contabilizable, ImporteMX:=importe) Then
|
||||
ErrorMovInv = True
|
||||
@@ -1553,8 +1576,8 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
|
||||
Protected Sub ChkSugiereFechaCaducidad_CheckedChanged(sender As Object, e As EventArgs)
|
||||
|
||||
TxtnFechaCaducidad.visible = Not ChkSugiereFechaCaducidad.checked
|
||||
TxtnLote.visible = Not ChkSugiereFechaCaducidad.checked
|
||||
TxtnFechaCaducidad.Visible = Not ChkSugiereFechaCaducidad.Checked
|
||||
TxtnLote.Visible = Not ChkSugiereFechaCaducidad.Checked
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -1687,11 +1710,11 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("AplicaLote").ToString.Trim = "1" Then
|
||||
e.Row.FCTextBox("TxtLote").visible = True
|
||||
e.Row.FCTextBox("TxtLote").Visible = True
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("AplicaCaducidad").ToString.Trim = "1" Then
|
||||
e.Row.FCTextBox("TxtCaducidad").visible = True
|
||||
e.Row.FCTextBox("TxtCaducidad").Visible = True
|
||||
End If
|
||||
|
||||
End If
|
||||
@@ -1704,10 +1727,10 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
|
||||
'FUNCIONALIDAD PISTOLA DE CODIGOS
|
||||
If UsuarioActual.Empresa.Funcionalidad(132) = "1" And e.Row.DBCampo("CodigoBarras").Trim <> "" Then
|
||||
e.Row.FCTextBox("TxtCantidad").Enabled = False
|
||||
End If
|
||||
|
||||
e.Row.FCTextBox("TxtCantidad").Enabled = False
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnCancelarTraspaso_Click(sender As Object, e As EventArgs)
|
||||
@@ -1989,9 +2012,9 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Dim tLote As String = gvr.DataKey("Lote").ToString
|
||||
Dim tFechaCaducidad As Date = gvr.DataKey("FechaCaducidad").ToDate
|
||||
|
||||
If CveSubProyectoRecibe = 10276 Then
|
||||
tLote = gvr.FCTextBox("TxtLote").text
|
||||
tFechaCaducidad = gvr.FCTextBox("TxtCaducidad").text.todate
|
||||
If CveSubProyectoRecibe.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347)) Then
|
||||
tLote = gvr.FCTextBox("TxtLote").Text
|
||||
tFechaCaducidad = gvr.FCTextBox("TxtCaducidad").Text.ToDate
|
||||
End If
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal, gvr.DataKey("CveUM").ToString.ToEntero, gvr.DataKey("CvePS").ToString.ToEntero, PrecioEntrada, CveAF:=gvr.DataKey("CveAF").ToString.ToEntero, CveSeccionAlmacen:=gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, Serie:=gvr.DataKey("Serie").ToString, Lote:=tLote, FechaCaducidad:=tFechaCaducidad, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada) Then
|
||||
@@ -2974,7 +2997,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
|
||||
Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable
|
||||
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
|
||||
Dim excelFile As ExcelFile = excelFile.Load(flatFilePath)
|
||||
Dim excelFile As ExcelFile = ExcelFile.Load(flatFilePath)
|
||||
|
||||
Dim unnamed As Integer = 0
|
||||
Dim cols As Integer
|
||||
|
||||
Reference in New Issue
Block a user