diff --git a/Agropecuaria/CierreCultivo.aspx b/Agropecuaria/CierreCultivo.aspx
new file mode 100644
index 000000000..cfe196643
--- /dev/null
+++ b/Agropecuaria/CierreCultivo.aspx
@@ -0,0 +1,99 @@
+<%@ Page Title="Catálogo de Unidades" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CierreCultivo.aspx.vb" Inherits="Agrupecuaria_CierreCultivo" EnableEventValidation="false" %>
+
+<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
+
+
+
+
+
+
+
+
+ Cierre de Cultivo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Agropecuaria/CierreCultivo.aspx.vb b/Agropecuaria/CierreCultivo.aspx.vb
new file mode 100644
index 000000000..9b6b4f83e
--- /dev/null
+++ b/Agropecuaria/CierreCultivo.aspx.vb
@@ -0,0 +1,78 @@
+Imports Extensiones
+Partial Class Agrupecuaria_CierreCultivo
+ Inherits ClsPaginas
+
+ Private Property CveCamion As Integer
+ Get
+
+ If ViewState("CveCamion") Is Nothing Then
+ Return -1
+ Else
+ Return ViewState("CveCamion").ToString().ToEntero()
+ End If
+ End Get
+ Set(ByVal value As Integer)
+ ViewState("CveCamion") = value
+ End Set
+ End Property
+
+ Private Sub Agrupecuaria_CierreCultivo_Load(sender As Object, e As EventArgs) Handles Me.Load
+ If Not Page.IsPostBack Then
+ CargaCombos()
+
+ End If
+ End Sub
+
+
+ Private Sub CargaCombos()
+
+ Dim ObjGral As New ClsGenerales
+
+ If ObjGral.GetTempordas(-1, UsuarioActual.CveEmpresa) Then
+ DdlTemporada.DataSource = ObjGral.DtResultados
+ End If
+ DdlTemporada.DataBind()
+ DdlTemporada.Items.Insert(0, New ListItem("Seleccione Una", "-1"))
+
+ UpFiltros.Update()
+
+ End Sub
+
+
+
+ Public Sub CargaDatos()
+
+ If Not DdlTemporada.SelectedValue.ToEntero > 0 Then
+ Alert("Debe de seleccionar una temporada", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ Dim ObjGral As New ClsGenerales
+
+ If ObjGral.GetCierreCultivos(DdlTemporada.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
+ GvDatos.DataSource = ObjGral.DtResultados
+ Else
+ GvDatos.DataSource = Nothing
+ End If
+
+ ObjGral.Dispose()
+ GvDatos.DataBind()
+ UpDatos.Update()
+
+
+ End Sub
+
+
+ Private Sub CierraCultivo()
+
+ End Sub
+
+
+
+
+
+
+ Protected Sub btConsultar_Click(sender As Object, e As EventArgs)
+ CargaDatos()
+ End Sub
+End Class
diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb
index 069d43b09..25e840d47 100644
--- a/App_Code/ClsGenerales.vb
+++ b/App_Code/ClsGenerales.vb
@@ -3602,6 +3602,48 @@ Public Class ClsGenerales
+ Public Function GetTempordas(CveTemporada As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_AgroTemporadaGet")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@cveTemporada", SqlDbType.Int).Value = CveTemporada
+ .Add("@cveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError($"Ocurrió un error al obtener los datos de las temporadas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+
+ End Function
+
+
+ Public Function GetCierreCultivos(CveTemporada As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Agro_CierreCultivosGet")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveTemporada", SqlDbType.Int).Value = CveTemporada
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError($"Ocurrió un error al obtener los datos de cultivo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+
+ End Function
+
+
#End Region
@@ -4011,7 +4053,7 @@ Public Class ClsGenerales
- Public Function AddEntregaAlmacenRutaDetalle(CveEntregaAlmacen As Integer, CvePS As Integer, Cantidad As Decimal, CveUnidadMedida As Integer, CveUsuario As Integer) As Boolean
+ Public Function AddEntregaAlmacenRutaDetalle(CveEntregaAlmacen As Integer, CvePS As Integer, Cantidad As Decimal, CveUnidadMedida As Integer, CveUsuario As Integer, Optional PesoKg As Decimal = -1D) As Boolean
Dim Retorno As Boolean = False
@@ -4025,6 +4067,7 @@ Public Class ClsGenerales
.Add("@Cantidad", SqlDbType.Float).Value = Cantidad
.Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@PesoKg", SqlDbType.SmallMoney).Value = CveUsuario
End With
diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index 9a65e56ef..7b7e0e607 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -5602,6 +5602,8 @@ Public Class ClsPaginas
PaginaDict.Add("/Planeacion/Presupuestos.aspx".ToUpper(), -1)
PaginaDict.Add("/Contabilidad/OCDetalleAlmacen.aspx".ToUpper(), -1)
+ PaginaDict.Add("/Agropecuaria/CierreCultivo.aspx".ToUpper(), 1326)
+
PaginaDict.Add("/testApi.aspx".ToUpper(), -1)
diff --git a/Inventarios/CartaPorteManual.aspx b/Inventarios/CartaPorteManual.aspx
index e290b9bca..da661ee9e 100644
--- a/Inventarios/CartaPorteManual.aspx
+++ b/Inventarios/CartaPorteManual.aspx
@@ -456,6 +456,7 @@
Serie |
Lote |
Fecha Caducidad |
+ Peso KG |
Comandos |
@@ -511,14 +512,17 @@
-
+ |
+
+ |
+
|
-
+
@@ -535,12 +539,14 @@
+
-
+
+
diff --git a/Inventarios/CartaPorteManual.aspx.vb b/Inventarios/CartaPorteManual.aspx.vb
index 9bca2d2ec..216757f0a 100644
--- a/Inventarios/CartaPorteManual.aspx.vb
+++ b/Inventarios/CartaPorteManual.aspx.vb
@@ -372,7 +372,7 @@ Partial Class Inventarios_CartaPorteManual
tCaducidad = If(TxtnFechaCaducidad.Visible, TxtnFechaCaducidad.Text.ToDate, MinFecha)
- AgregarPS(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, "", 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)
+ AgregarPS(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, "", 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, PesoKg:=TxtPesoKg.Text.ToDecimal)
End If
@@ -382,7 +382,7 @@ Partial Class Inventarios_CartaPorteManual
- Private Sub AgregarPS(Cantidad As Double, CvePS As Integer, CveUnidadMedida As Integer, Optional Observaciones As String = "", Optional CveSeccionAlmacen As Integer = -1, Optional SeccionAlmacen As String = "", Optional Serie As String = "", Optional Lote As String = "", Optional FechaCaducidad As Date = MinFecha, Optional Limpia As Boolean = True, Optional CveSeccionAlmacenDestino As Integer = -1)
+ Private Sub AgregarPS(Cantidad As Double, CvePS As Integer, CveUnidadMedida As Integer, Optional Observaciones As String = "", Optional CveSeccionAlmacen As Integer = -1, Optional SeccionAlmacen As String = "", Optional Serie As String = "", Optional Lote As String = "", Optional FechaCaducidad As Date = MinFecha, Optional Limpia As Boolean = True, Optional CveSeccionAlmacenDestino As Integer = -1, Optional PesoKg As Decimal = 0D)
If Cantidad <= 0 Then
Alert("La cantidad debe ser mayor a cero (0). Por favor verifique y vuelva a intentar", TipoMensaje.MsgAdvertencia)
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
@@ -426,7 +426,7 @@ Partial Class Inventarios_CartaPorteManual
registro.Item("PorcentajeIVA") = 0
registro("ClaveMaterialPeligroso") = DrPS("ClaveMaterialPeligroso")
registro("ClaveEmbalaje") = DrPS("ClaveEmbalaje")
- registro("PesoKg") = DrPS("PesoKg")
+ registro("PesoKg") = PesoKg
DtMovimientos.Rows.Add(registro)
RegistraScript("playsonidito('beep-07.wav')")
@@ -456,6 +456,8 @@ Partial Class Inventarios_CartaPorteManual
TxtnFechaCaducidad.Text = ""
txtCantidad.Focus()
+ TxtPesoKg.Text = ""
+
'If TxtCodigoPS.Visible Then
' TxtCodigoPS.Focus()
'End If
@@ -567,7 +569,7 @@ Partial Class Inventarios_CartaPorteManual
If CveEntregaAlmacen > 0 Then
For Each GvRowPS As GridViewRow In GvDatos.Rows
- If Not ObjGral.AddEntregaAlmacenRutaDetalle(CveEntregaAlmacen, GvRowPS.DataKey("CvePS").ToEntero, GvRowPS.DataKey("Cantidad").ToEntero, GvRowPS.DataKey("CveUM").ToEntero, UsuarioActual.CveUsuario) Then
+ If Not ObjGral.AddEntregaAlmacenRutaDetalle(CveEntregaAlmacen, GvRowPS.DataKey("CvePS").ToEntero, GvRowPS.DataKey("Cantidad").ToEntero, GvRowPS.DataKey("CveUM").ToEntero, UsuarioActual.CveUsuario, PesoKg:=GvRowPS.DataKey("PesoKg").ToDecimal) Then
ErrorProceso = True
Exit For
End If
@@ -630,31 +632,34 @@ Partial Class Inventarios_CartaPorteManual
Dim drP As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlProducto2.SelectedValue.ToEntero).FiltroPrimero("", "PS")
If drP IsNot Nothing Then
- ThSeccionAlmacen.Visible = CBool(drP("AplicaSeccion"))
- TdSeccionAlmacen.Visible = CBool(drP("AplicaSeccion"))
- DdlSeccionAlmacen.Visible = CBool(drP("AplicaSeccion"))
+ 'ThSeccionAlmacen.Visible = CBool(drP("AplicaSeccion"))
+ 'TdSeccionAlmacen.Visible = CBool(drP("AplicaSeccion"))
+ 'DdlSeccionAlmacen.Visible = CBool(drP("AplicaSeccion"))
'GvDatos.Columns(5).Visible = CBool(drP("AplicaSeccion"))
- ThSerie.Visible = CBool(drP("AplicaSerie"))
- TdSerie.Visible = CBool(drP("AplicaSerie"))
- TxtnSerie.Visible = CBool(drP("AplicaSerie"))
+ 'ThSerie.Visible = CBool(drP("AplicaSerie"))
+ 'TdSerie.Visible = CBool(drP("AplicaSerie"))
+ 'TxtnSerie.Visible = CBool(drP("AplicaSerie"))
'GvDatos.Columns(6).Visible = CBool(drP("AplicaSerie"))
- TxtnLote.Visible = CBool(drP("AplicaLote"))
- ThLote.Visible = CBool(drP("AplicaLote"))
- TdLote.Visible = CBool(drP("AplicaLote"))
+ 'TxtnLote.Visible = CBool(drP("AplicaLote"))
+ 'ThLote.Visible = CBool(drP("AplicaLote"))
+ 'TdLote.Visible = CBool(drP("AplicaLote"))
'GvDatos.Columns(7).Visible = CBool(drP("AplicaLote"))
- TxtnFechaCaducidad.Visible = CBool(drP("AplicaCaducidad"))
- ThFechaCaducidad.Visible = CBool(drP("AplicaCaducidad"))
- If Not String.IsNullOrWhiteSpace(UsuarioActual.Empresa.Funcionalidad(147)) Then ThFechaCaducidad.InnerText = UsuarioActual.Empresa.Funcionalidad(147)
+ 'TxtnFechaCaducidad.Visible = CBool(drP("AplicaCaducidad"))
+ 'ThFechaCaducidad.Visible = CBool(drP("AplicaCaducidad"))
+ 'If Not String.IsNullOrWhiteSpace(UsuarioActual.Empresa.Funcionalidad(147)) Then ThFechaCaducidad.InnerText = UsuarioActual.Empresa.Funcionalidad(147)
'ThFechaCaducidad.InnerText = If(UsuarioActual.Empresa.Funcionalidad(147) = "Fecha Elaboración", "Fecha Elaboración", "Fecha Caducidad")
- TdFechaCaducidad.Visible = CBool(drP("AplicaCaducidad"))
+ 'TdFechaCaducidad.Visible = CBool(drP("AplicaCaducidad"))
'GvDatos.Columns(8).Visible = CBool(drP("AplicaCaducidad"))
+
+ TxtPesoKg.Text = drP("PesoKg").ToString.ToDecimal.ToString("###,###,###.00")
+
End If
End If
@@ -697,11 +702,11 @@ Partial Class Inventarios_CartaPorteManual
Private Sub EscondeColumnasGVM(DtTemp As DataTable)
- GvDatos.Columns(5).Visible = DtTemp.MAX("Serie").ToString <> ""
- GvDatos.Columns(6).Visible = DtTemp.MAX("Lote").ToString <> ""
- GvDatos.Columns(7).HeaderText = If(UsuarioActual.Empresa.Funcionalidad(147) = "Fecha Elaboración", "Fecha Elaboración", "Fecha Caducidad")
- GvDatos.Columns(7).Visible = DtTemp.MAX("FechaCaducidad").ToString.ToDate > MinFecha
- GvDatos.Columns(8).Visible = DtTemp.MAX("CveSeccionAlmacen").ToString.ToEntero > 0
+ 'GvDatos.Columns(5).Visible = DtTemp.MAX("Serie").ToString <> ""
+ 'GvDatos.Columns(6).Visible = DtTemp.MAX("Lote").ToString <> ""
+ 'GvDatos.Columns(7).HeaderText = If(UsuarioActual.Empresa.Funcionalidad(147) = "Fecha Elaboración", "Fecha Elaboración", "Fecha Caducidad")
+ 'GvDatos.Columns(7).Visible = DtTemp.MAX("FechaCaducidad").ToString.ToDate > MinFecha
+ 'GvDatos.Columns(8).Visible = DtTemp.MAX("CveSeccionAlmacen").ToString.ToEntero > 0
End Sub