This commit is contained in:
@@ -88,7 +88,7 @@
|
||||
<asp:TemplateField ItemStyle-Width="7%">
|
||||
<ItemTemplate>
|
||||
<%--<asp:Literal ID="LtlExistencia" runat="server" Text='<%# Eval("Existencia").ToString().Split("."c)(0) %>'></asp:Literal>--%>
|
||||
<asp:TextBox ID="TxtCantidad" runat="server" Text='<%# Eval("Existencia").ToString().Split("."c)(0) %>' Width="35px" />
|
||||
<asp:TextBox ID="TxtCantidad" runat="server" Text='<%# Eval("Existencia").ToString().Split("."c)(0) %>' Width="45px" style='text-align:right;' />
|
||||
<asp:RangeValidator ID="RVR" Display="Dynamic" ControlToValidate="TxtCantidad" runat="server" MinimumValue="0" Type="Double" ErrorMessage="No cumple con la cantidad especificada"></asp:RangeValidator>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
@@ -42,7 +42,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
||||
|
||||
If ObjInv.DtResultados.FiltraParametros("Serie <> '' ").Rows.Count = 0 Then GvD.columns(2).visible = False
|
||||
If ObjInv.DtResultados.FiltraParametros("Lote <> ''").Rows.Count = 0 Then GvD.columns(3).visible = False
|
||||
If ObjInv.DtResultados.FiltraParametros("FechaCaducidad <> ''").Rows.Count = 0 Then GvD.columns(4).visible = False
|
||||
If ObjInv.DtResultados.FiltraParametros("FechaCaducidad IS NOT NULL ").Rows.Count = 0 Then GvD.columns(4).visible = False
|
||||
If ObjInv.DtResultados.FiltraParametros("CveSeccionAlmacen > 0").Rows.Count = 0 Then GvD.columns(5).visible = False
|
||||
|
||||
End If
|
||||
@@ -368,6 +368,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
||||
|
||||
Dim ObjInventario As New ClsInventarios()
|
||||
Dim ObjPS As New ClsProductosServicios(ObjInventario.IniciaTransacSQL())
|
||||
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL)
|
||||
|
||||
Try
|
||||
Dim DtExistenciasSecciones As DataTable = Nothing
|
||||
@@ -381,10 +382,11 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
||||
|
||||
'ENTRADA ALMACÉN
|
||||
Dim CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacen, 2, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:="", TipoCambio:=-1,
|
||||
MovimientoFijo:=False, Modulo:="ASA/EA")
|
||||
MovimientoFijo:=False, Modulo:="ASA/EA", CveMovimientoRelacionado:=CveMovimientoSalida)
|
||||
|
||||
Dim dtSecciones As DataTable = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, CveAlmacen)
|
||||
dtSecciones.CaseSensitive = False
|
||||
Dim resultado As DataTable = Nothing
|
||||
|
||||
For Each RowExcel As DataRow In DtExcel.Rows
|
||||
|
||||
@@ -415,9 +417,9 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
||||
|
||||
Dim RowExistencia As DataRow = DtExistenciasSecciones.FiltroPrimero($"CvePS={CvePS} and ISNULL(Serie,'') = '{Serie}'")
|
||||
|
||||
If RowExistencia IsNot Nothing AndAlso CveSeccionAlmacen > 0 Then
|
||||
If RowExistencia IsNot Nothing Then
|
||||
Dim CveSeccionAlmacenSalida As Integer = RowExistencia("CveSeccionAlmacen").ToString().ToEntero()
|
||||
Dim CantidadSalida As Decimal = RowExistencia("Existencia").ToString().ToDecimal()
|
||||
Dim CantidadSalida As Decimal = RowExcel("Cantidad").ToString().ToDecimal()
|
||||
Dim SerieSalida As String = RowExistencia("Serie").ToString()
|
||||
Dim LoteSalida As String = RowExistencia("Lote").ToString()
|
||||
Dim FechaCaducidadSalida As Date = IfNull(RowExistencia("FechaCaducidad"), MinFecha).ToString.ToDate
|
||||
@@ -440,9 +442,11 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
||||
|
||||
ErrorMovInv = CveMovimientoDetalleSalida <= 0
|
||||
|
||||
'GENERA LA ENTRADA DE LOS PRODUCTOS QUE SE DIERON ENTRADA
|
||||
'GENERA LA ENTRADA DE LOS PRODUCTOS QUE SE DIERON SALIDA
|
||||
If Not ErrorMovInv Then
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa, CveMovimientoDetalle:=CveMovimientoDetalleSalida) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
resultado = ObjInventario.DtResultados
|
||||
Dim RowEntrada As DataRow = ObjInventario.DtResultados.Rows(0)
|
||||
|
||||
Dim CvePSEntrada = RowEntrada("CvePS").ToString().ToEntero()
|
||||
@@ -452,9 +456,12 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
||||
Dim CostoIndirecto As Decimal = RowEntrada("CostoIndirecto").ToString().ToDecimal()
|
||||
|
||||
'ACTUALIZAMOS EL PS, PARA QUE TENGA EL APLICA SECCION
|
||||
ErrorMovInv = Not ObjPS.UpdateAplicaSeccionAlmacen(CvePS, UsuarioActual.CveEmpresa, True)
|
||||
If Not ObjInventario.AddProductosServiciosAlmacenSeccion(CvePS, CveAlmacen, CveSeccionAlmacen) Then
|
||||
ErrorMovInv = True
|
||||
|
||||
If CveSeccionAlmacen > 0 Then
|
||||
ErrorMovInv = Not ObjPS.UpdateAplicaSeccionAlmacen(CvePS, UsuarioActual.CveEmpresa, True)
|
||||
If Not ObjInventario.AddProductosServiciosAlmacenSeccion(CvePS, CveAlmacen, CveSeccionAlmacen) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, CantidadEntrada, CveUMEntrada, CvePSEntrada, PUEntrada, -1, CostoIndirecto:=CostoIndirecto, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
@@ -475,7 +482,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
|
||||
If CveSeccionAlmacen <= 0 Then
|
||||
If CveSeccionAlmacen <= 0 And SeccionAlmacen <> "" Then
|
||||
SeccionesNoEncontradas.AppendFormat("{0},", SeccionAlmacen)
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
@@ -489,6 +496,26 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
||||
Next
|
||||
dtSecciones.Dispose()
|
||||
|
||||
'inserto la prepoliza
|
||||
If CveMovimientoEntrada > 0 AndAlso CveMovimientoSalida > 0 Then
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
resultado = ObjInventario.DtResultados
|
||||
|
||||
Dim Concepto As String = "Ajuste Sección"
|
||||
Dim IdCtaContableOrigen As Integer = 0
|
||||
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/AjusteAlmacen", 53, 0, 0, 1, Now, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
Dim importe As Decimal = resultado.SUMD("Total").RoundSQL
|
||||
Dim contabilizable As Boolean = False
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, Concepto, 68, Concepto, Now, IdCtaContableOrigen, -1, CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=contabilizable, ImporteMX:=importe) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, Concepto, 68, Concepto, Now, IdCtaContableOrigen, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, Contabilizable:=contabilizable, ImporteMX:=importe) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
ErrorMovInv = True
|
||||
OnError("Ocurrió un error al agregar el inventario", ex)
|
||||
|
||||
@@ -3001,31 +3001,34 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
|
||||
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacen.SelectedValue.ToEntero()).FiltroPrimeroValor("CveAlmacenVirtual").ToEntero()
|
||||
|
||||
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, 13, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, CveMovimientoRelacionado:=CveMovimientoRef, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="RA/VD")
|
||||
|
||||
If CveMovimientoVirtual > 0 Then
|
||||
FolioVirtual = ObjInventario.Folio
|
||||
|
||||
For Each RowUsado As DataRow In DtPSVirtual.Rows
|
||||
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
|
||||
Dim CantidadUsado As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
|
||||
Dim PU As Decimal = RowUsado("Cargo").ToString().ToDecimal()
|
||||
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
|
||||
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, 13, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, CveMovimientoRelacionado:=CveMovimientoRef, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="RA/VD")
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
If CveMovimientoVirtual > 0 Then
|
||||
FolioVirtual = ObjInventario.Folio
|
||||
|
||||
For Each RowUsado As DataRow In DtPSVirtual.Rows
|
||||
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
|
||||
Dim CantidadUsado As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
|
||||
Dim PU As Decimal = RowUsado("Cargo").ToString().ToDecimal()
|
||||
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
If SumarImporteUsados Then
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoVirtual, UsuarioActual.CveEmpresa) Then
|
||||
ImporteIngresoAdicional = ObjInventario.DtResultados.SUMD("TotalOriginal")
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
If SumarImporteUsados Then
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoVirtual, UsuarioActual.CveEmpresa) Then
|
||||
ImporteIngresoAdicional = ObjInventario.DtResultados.SUMD("TotalOriginal")
|
||||
End If
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
|
||||
Else
|
||||
|
||||
@@ -369,20 +369,26 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlBCIAjuste" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="BCI" DataValueField="CveBCIUsado" Width="100%" AutoPostBack="true">
|
||||
</asp:DropDownList>
|
||||
<label for="<%= DdlBCIAjuste.ClientID.ToString()%>">BCI:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtEtiqueta" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
|
||||
<label for="<%= TxtEtiqueta.ClientID.ToString()%>">Etiqueta:</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlFolioGarantia" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="FolioGarantia" DataValueField="CveFolioGarantia" Width="100%" AutoPostBack="true">
|
||||
</asp:DropDownList>
|
||||
<%-- <asp:RequiredFieldValidator ID="RFVFolioGarantia" runat="server" ControlToValidate="DdlFolioGarantia" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Folio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAjuste"></asp:RequiredFieldValidator>
|
||||
<%-- <asp:RequiredFieldValidator ID="RFVFolioGarantia" runat="server" ControlToValidate="DdlFolioGarantia" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Folio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAjuste"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEFolioGarantia" runat="server" HighlightCssClass="vco" TargetControlID="RFVFolioGarantia"></ajax:ValidatorCalloutExtender>--%>
|
||||
<label for="<%= DdlFolioGarantia.ClientID.ToString()%>">Folio:</label>
|
||||
</div>
|
||||
|
||||
@@ -2656,6 +2656,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
TmpDTAjustes.Columns.Add("CveFolioGarantia", GetType(Integer))
|
||||
TmpDTAjustes.Columns.Add("CveTipoUso", GetType(Integer))
|
||||
TmpDTAjustes.Columns.Add("CveTipoDefecto", GetType(Integer))
|
||||
TmpDTAjustes.Columns.Add("CodigoTD", GetType(String))
|
||||
TmpDTAjustes.Columns.Add("CodigoEnsamble", GetType(String))
|
||||
TmpDTAjustes.Columns.Add("CodigoLinea", GetType(String))
|
||||
TmpDTAjustes.Columns.Add("CodigoInspeccion", GetType(String))
|
||||
@@ -2664,7 +2665,8 @@ Partial Class Inventarios_RecepcionUsados
|
||||
TmpDTAjustes.Columns.Add("FechaAjuste", GetType(Date))
|
||||
TmpDTAjustes.Columns.Add("Meses", GetType(String))
|
||||
TmpDTAjustes.Columns.Add("PorcentajeAjuste", GetType(Double))
|
||||
TmpDTAjustes.Columns.Add("NumPoliza", GetType(String))
|
||||
TmpDTAjustes.Columns.Add("TipoComprobante", GetType(Integer))
|
||||
TmpDTAjustes.Columns.Add("Comprobante", GetType(String))
|
||||
TmpDTAjustes.Columns.Add("Importe", GetType(Double))
|
||||
TmpDTAjustes.Columns.Add("CvePS", GetType(Integer))
|
||||
TmpDTAjustes.Columns.Add("PS", GetType(String))
|
||||
@@ -2673,6 +2675,11 @@ Partial Class Inventarios_RecepcionUsados
|
||||
TmpDTAjustes.Columns.Add("CveVentaDetalle", GetType(Integer))
|
||||
TmpDTAjustes.Columns.Add("CveVenta", GetType(Integer))
|
||||
TmpDTAjustes.Columns.Add("PUFactura", GetType(Double))
|
||||
TmpDTAjustes.Columns.Add("CveBCIAjuste", GetType(Integer))
|
||||
TmpDTAjustes.Columns.Add("Etiqueta", GetType(String))
|
||||
TmpDTAjustes.Columns.Add("CveClienteDistribuidor", GetType(Integer))
|
||||
TmpDTAjustes.Columns.Add("CveModeloAuto", GetType(Integer))
|
||||
TmpDTAjustes.Columns.Add("Año", GetType(String))
|
||||
End Sub
|
||||
Private Sub CargaPSAjuste()
|
||||
DdlPSAjuste.setEsWebService(True)
|
||||
@@ -2963,6 +2970,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
Row("CveFolioGarantia") = DdlFolioGarantia.SelectedValue.ToEntero
|
||||
Row("CveTipoUso") = DdlTipoUso.SelectedValue.ToEntero
|
||||
Row("CveTipoDefecto") = DdlTipoDefecto.SelectedValue.ToEntero
|
||||
Row("CodigoTD") = TxtCodigoTD.Text
|
||||
Row("CodigoEnsamble") = TxtCodEnsamble.Text
|
||||
Row("CodigoLinea") = TxtCodLinea.Text
|
||||
Row("CodigoInspeccion") = TxtCodInspeccion.Text
|
||||
@@ -2970,7 +2978,8 @@ Partial Class Inventarios_RecepcionUsados
|
||||
Row("FechaAjuste") = TxtFechaAjuste.Text.ToDate
|
||||
Row("Meses") = TxtMesesUso.Text.ToEntero
|
||||
Row("PorcentajeAjuste") = TxtPorcentajeAjuste.Text.ToDouble
|
||||
Row("NumPoliza") = TxtPoliza.Text
|
||||
Row("TipoComprobante") = 1
|
||||
Row("Comprobante") = TxtPoliza.Text
|
||||
Row("Importe") = TxtImporteAjuste.Text.ToDouble
|
||||
Row("ConsecutivoVenta") = TxtConsecutivoAjuste.Text.ToEntero()
|
||||
Row("CvePS") = DdlPSAjuste.SelectedValue
|
||||
@@ -2988,6 +2997,11 @@ Partial Class Inventarios_RecepcionUsados
|
||||
End If
|
||||
Row("CveUM") = CveUM
|
||||
Row("CveVentaDetalle") = -1
|
||||
Row("CveBCIAjuste") = DdlBCIAjuste.SelectedValue.ToEntero()
|
||||
Row("Etiqueta") = TxtEtiqueta.Text.TrimStart.TrimEnd
|
||||
Row("CveClienteDistribuidor") = -1
|
||||
Row("CveModeloAuto") = -1
|
||||
Row("Año") = ""
|
||||
TmpDTAjustes.Rows.Add(Row)
|
||||
|
||||
|
||||
|
||||
@@ -864,7 +864,7 @@ Partial Class Inventarios_ResguardoMaterial
|
||||
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
Dim CveSeccionAlmacen As Integer = 0
|
||||
Importe = ObjInventario.DtResultados.SUMD("Total").RoundSQL
|
||||
Importe = ObjInventario.DtResultados.SUMD("Total").RoundAD
|
||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||
If CBool(Dr("AplicaSeccion")) Then
|
||||
CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacenDestino.SelectedValue.ToEntero, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
|
||||
@@ -929,7 +929,7 @@ Partial Class Inventarios_ResguardoMaterial
|
||||
Else
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
Cont = 0
|
||||
Importe = ObjInventario.DtResultados.SUMD("Total").RoundSQL
|
||||
Importe = ObjInventario.DtResultados.SUMD("Total").RoundAD
|
||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||
Dim CveSeccionAlmacen As Integer = DiccionarioSecciones(Dr("CveMovimientoDetalle").ToString.ToEntero).ToString.ToEntero
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Dr("Serie").ToString, Observaciones:=Dr("Observaciones").ToString) Then
|
||||
|
||||
Reference in New Issue
Block a user