- Fecha Inicio:
-
+ Fecha Inicio:
-
+
- Fecha Fin:
-
+ Fecha Fin:
-
@@ -110,48 +117,272 @@
-
-
- <%--0--%>
-
- <%----%>
- <%--1--%>
-
- <%--2--%>
-
- <%--3--%>
-
- <%--4--%>
-
- <%--5--%>
-
- <%--6--%>
-
- <%--7--%>
-
- <%--8--%>
-
- <%--9--%>
-
- <%--10--%>
-
- <%--11--%>
-
- <%--12--%>
-
- <%--13--%>
-
- <%--14--%>
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<%-- POPUP Modal GV Precios Venta Fecha --%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Fecha Inicio:
+
+
+
+ Fecha Fin:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<%-- POPUP AGREGAR Precios Venta Fecha --%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <%--
--%>
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Agropecuaria/RepPreciosVentaManifiesto.aspx.vb b/Agropecuaria/RepPreciosVentaManifiesto.aspx.vb
index 53e5f678f..4de8fd0db 100644
--- a/Agropecuaria/RepPreciosVentaManifiesto.aspx.vb
+++ b/Agropecuaria/RepPreciosVentaManifiesto.aspx.vb
@@ -2,260 +2,318 @@
Option Strict On
Imports System.Data
+Imports System.DirectoryServices.ActiveDirectory
Imports Extensiones
Partial Class Agrupecuaria_RepPreciosVentaManifiesto
Inherits ClsPaginas
+ Private Property CvePrecioVentaFecha As Integer
+ Get
+ If ViewState("CvePrecioVentaFecha") Is Nothing Then
+ ViewState("CvePrecioVentaFecha") = -1
+ End If
+ Return ViewState("CvePrecioVentaFecha").ToString.ToEntero
+ End Get
+ Set(value As Integer)
+ ViewState("CvePrecioVentaFecha") = value
+ End Set
+ End Property
+
+
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
If UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario.Contiene(77, 21) Then Response.Redirect("/Inicio.aspx")
+ txtFechaI.Text = $"01/{Now.Month.ToString("0#")}/{Now.Year}"
+ txtFechaF.Text = Now.ToString("dd/MM/yyyy")
+
+ TxtModalFechaInicio.Text = $"01/{Now.Month.ToString("0#")}/{Now.Year}"
+ TxtModalFechaFin.Text = Now.ToString("dd/MM/yyyy")
+
CargaCombos()
CargaDatos()
End If
End Sub
-
#Region " CARGA COMBOS "
-
Private Sub CargaCombos()
+ CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto)
+ CargaManifiesto(-1)
+ CargaCultivo(-1)
+ End Sub
- CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:=DivProyecto)
+ Private Sub CargaManifiesto(CveSubProyecto As Integer)
- CargaCultivo()
+ DdlManifiesto.ClearSelection()
+ DdlManifiesto.SelectedValue = Nothing
+ DdlManifiesto.Items.Clear()
- 'CargaEstatus
- DdlEstatusOS.DataSource = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa)
- DdlEstatusOS.DataBind()
- DdlEstatusOS.Items.Insert(0, New ListItem("Todos", "-1"))
- Dim DTTecnicos As DataTable = Nothing
+ Dim objNow As New ClsNominas
- Dim ObjOS As New ClsOS
- If ObjOS.GetSubProyectosEstatusInicial(-1, 3, UsuarioActual.CveEmpresa) Then
- DTTecnicos = ObjOS.DtResultados
- End If
- ObjOS.Dispose()
-
- DdlTecnico.DataSource = DTTecnicos
- DdlTecnico.DataBind()
- DdlTecnico.Items.Insert(0, New ListItem("Todos", "-1"))
- DdlTecnico.Items.Insert(1, New ListItem("Sin Asignar", "-2"))
-
- '376
- If UsuarioActual.TienePermisoProceso(376) Then
- DdlTecnico.Enabled = False
- DdlTecnico.SelectedValueExist(UsuarioActual.CveUsuario)
+ If objNow.EmbarqueManifiestoGet(CveSubProyecto, -1, UsuarioActual.CveEmpresa, -1) Then
+ DdlManifiesto.DataSource = objNow.DtResultados.FiltraParametros("", "", {"CveEmbarqueManifiesto", "NoEmbarque"})
End If
+ objNow.Dispose()
- If IfNull(Request("CveUsuarioTecnico"), 0).ToString.ToEntero > 0 Then
- DdlTecnico.SelectedValueExist(Request("CveUsuarioTecnico").ToString)
- Else
- ViewState("CveUsuarioTecnico") = -1
- End If
+ DdlManifiesto.DataBind()
+ DdlManifiesto.Items.Insert(0, New ListItem("Todos", "-1"))
- 'CargaClientes
- Dim EsWS As Boolean = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
- 'If EsWS Then
- ' DdlClientes.setEsWebService(True)
- 'Else
- ' DdlClientes.setEsWebService(False)
- ' DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
- ' DdlClientes.DataBind()
- ' DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
- 'End If
+ End Sub
+ Private Sub CargaCultivo(CveSubProyecto As Integer)
- 'Vendedor
- DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa, VendedorTipo:=-1).FiltraParametros("VendedorTipo in (1,4)") 'vendedores y vendedores de piso
- DdlVendedor.DataBind()
- DdlVendedor.Items.Insert(0, New ListItem("Todos", "-1"))
- DdlVendedor.Items.Insert(1, New ListItem("Sin Vendedor", "-2"))
-
- If UsuarioActual.CveVendedor > 0 Then
- DdlVendedor.SelectedValueExist(UsuarioActual.CveVendedor)
- DdlVendedor.Enabled = False
- End If
-
- txtFechaI.Text = NowADS().FirstDayOfMonth.ToShortDateString
- txtFechaF.Text = NowADS().AddDays(2).ToShortDateString
-
-
- DdlMedico.DataSource = If(UsuarioActual.CveVendedor > 0, GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros($" Estatus = 'True' AND CveVendedor = {UsuarioActual.CveVendedor} "), GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' "))
- DdlMedico.DataBind()
-
- DdlProcedimiento.DataSource = GlobalDTProcedimientos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
- DdlProcedimiento.DataBind()
-
- DdlTipoVenta.DataSource = GlobalDTTipoVenta(UsuarioActual.CveEmpresa)
- DdlTipoVenta.DataBind
+ DdlCultivo.ClearSelection()
+ DdlCultivo.SelectedValue = Nothing
+ DdlCultivo.Items.Clear()
Dim ObjVentas As New ClsVentas
- If ObjVentas.GetMedicosEspecialidades(-1, UsuarioActual.CveEmpresa, -1) Then
- DdlEspecialidad.DataSource = ObjVentas.DtResultados
+ If ObjVentas.GetCultivos(-1, UsuarioActual.CveEmpresa) Then
+ DdlCultivo.DataSource = ObjVentas.DtResultados
Else
- DdlEspecialidad.DataSource = Nothing
+ DdlCultivo.DataSource = Nothing
End If
ObjVentas.Dispose()
- DdlEspecialidad.DataBind()
- DdlEspecialidad.Items.Insert(0, New ListItem("Todas", "-1"))
+ DdlCultivo.DataBind()
+ DdlCultivo.Items.Insert(0, New ListItem("Todos", "-1"))
- DdlClienteSucursal.DataSource = GlobalDTClientesTodosSucursales(UsuarioActual.CveEmpresa)
- DdlClienteSucursal.DataBind()
- DdlClienteSucursal.Items.Insert(0, New ListItem("Todos", "-1"))
-
- 'Dim EsWS As Boolean = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
- 'If EsWS Then
- ' DdlCliente.setEsWebService(True)
-
- 'Else
- ' DdlCliente.setEsWebService(False)
- ' DdlCliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
- ' DdlCliente.DataBind()
- ' DdlCliente.ddl.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
- 'End If
-
- End Sub
-
- Private Sub CargaCultivo()
- DdlCultivo.Items.Clear()
- If DdlSubProyecto.GetSelectedValuesM(True) <> "" Then
- DdlCultivo.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveSubProyecto IN ({0})", DdlSubProyecto.GetSelectedValuesM(True)))
- DdlCultivo.DataBind()
- Else
- DdlCultivo.DataSource = Nothing
- DdlCultivo.DataBind()
- End If
End Sub
#End Region
+ Protected Sub DdlSubProyecto_SelectedIndexChanged(sender As Object, e As EventArgs)
+ CargaCultivo(DdlSubProyecto.SelectedValue.ToEntero)
+ CargaManifiesto(DdlSubProyecto.SelectedValue.ToEntero)
+ UPFiltros.Update()
+ End Sub
+
#Region " CARGA DATOS "
Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click
-
CargaDatos()
-
End Sub
Private Sub CargaDatos()
- Dim ObjOS As New ClsOS
- Dim FechaI As Date = If(txtFechaI.Text.Trim = "", MinFecha, txtFechaI.Text.ToDate)
- Dim FechaF As Date = If(txtFechaF.Text.Trim = "", MaxFecha, txtFechaF.Text.ToDate)
- Dim Cvecliente As Integer = DdlClienteSucursalCliente()
- Dim CveClienteSucursal As Integer = DdlClienteSucursalSucursal()
- LnkPersonalizar.Visible = False
+ Dim objVenas As New ClsVentas
- If ObjOS.GetRepOrdenesServicioMedicasRep(FechaI, FechaF, Cvecliente, DdlVendedor.SelectedValue.ToEntero, DdlEstatusOS.SelectedValue.ToEntero, DdlTecnico.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa,
- CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveEspecialidad:=DdlEspecialidad.SelectedValue.ToEntero,
- CveClienteSucursal:=CveClienteSucursal, CveUsuario:=UsuarioActual.CveUsuario, CveTipoVenta:=DdlTipoVenta.SelectedValue.ToEntero) Then
- GvDatos.DataSource = ObjOS.DtResultados
- If ObjOS.DtResultados IsNot Nothing AndAlso ObjOS.DtResultados.Rows.Count > 0 Then
- LnkPersonalizar.Visible = True
- End If
+ If objVenas.GetPreciosVentaManifiesto(txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, DdlManifiesto.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlCultivo.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
+ GvDatos.DataSource = objVenas.DtResultados
Else
GvDatos.DataSource = Nothing
End If
-
- ObjOS.Dispose()
+ objVenas.Dispose()
GvDatos.DataBind()
-
- LnkExportar.Visible = If(GvDatos.Rows.Count > 0, True, False)
UpAcciones.Update()
-
-
UPDatos.Update()
End Sub
-
#End Region
- 'Private Sub CargaClientes()
- ' DdlClientes.ddl.Items.Clear()
- ' DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1) '.FiltraParametros($"CveClienteClasificacion = {DdlClienteClasificacion.SelectedValue.ToEntero} OR {DdlClienteClasificacion.SelectedValue.ToEntero} = -1")
- ' DdlClientes.DataBind()
- ' DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
- 'End Sub
-
- Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyecto.SelectedIndexChanged
- CargarSubProyecto(DdlSubProyecto, DdlProyecto.SelectedValue)
- End Sub
-
-
#Region " GV DATOS - ROW DATABOUND "
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
- If e.Row.RowType = DataControlRowType.DataRow Then
- e.Row.Cells(1).Attributes.Add("data-order", e.Row.DBCampo("FechaCita").ToDateTime.ToString("yyyyMMddHHmm"))
- If e.Row.DBCampo("CveOS") = "" Then
- e.Row.CssClass = "Totales"
- End If
- End If
End Sub
#End Region
- Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
+ Protected Sub LnkAddPreciosVentaFecha_Click(sender As Object, e As EventArgs)
- Dim SubProyecto As String = ""
+ CargaCultivoModal(-1)
+ CargaPreciosVentaFecha()
+ CargaTamaños()
- If DdlSubProyecto.SelectedValue.ToEntero > 0 Then
- SubProyecto = DdlSubProyecto.SelectedItem.Text
- End If
-
- Dim SbFiltros As New StringBuilder()
- SbFiltros.AppendFormat($"Fecha Inicio: {txtFechaI.Text} Fecha Fin: {txtFechaF.Text}|")
- SbFiltros.AppendFormat("SubProyecto: {0}|", SubProyecto)
-
-
- GvDatos.ExportToExcelGembox("OrdenesServicio", UsuarioActual, "Ordenes de Servicio Medicas", DatoTituloExtra:=$"", DatosFiltros:=SbFiltros.ToString())
+ RegistraScript("$('#DVModalGVPreciosVentaFecha').modal('show');")
End Sub
- Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
- End Sub
+ Private Sub CargaCultivoModal(CveSubProyecto As Integer)
- Protected Sub LnkPersonalizar_Click(sender As Object, e As EventArgs)
+ DdlModalCultivo.ClearSelection()
+ DdlModalCultivo.SelectedValue = Nothing
+ DdlModalCultivo.Items.Clear()
- ' ChkGuardarPersonalizacion.Checked = False
- RegistraScript("$('#DivPersonalizar').modal('show')")
+ Dim ObjVentas As New ClsVentas
- End Sub
-
- Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs) Handles BtnPersonalizar.Click
- Personaliza()
- End Sub
-
- Private Sub Personaliza()
- GvDatos.Columns(13).Visible = ChkObservaciones.Checked
- GvDatos.Columns(14).Visible = ChkFolioAdicional.Checked
- CargaDatos()
- End Sub
-
- Private Function DdlClienteSucursalCliente() As Integer
- If DdlClienteSucursal.SelectedValue = "-1" Then
- Return -1
+ If ObjVentas.GetCultivos(-1, UsuarioActual.CveEmpresa) Then
+ DdlModalCultivo.DataSource = ObjVentas.DtResultados
Else
- Dim array As String() = DdlClienteSucursal.SelectedValue.Split("|"c)
- Return If(array(0).ToEntero > 0, array(0).ToEntero, -1)
+ DdlModalCultivo.DataSource = Nothing
End If
- End Function
- Private Function DdlClienteSucursalSucursal() As Integer
- If DdlClienteSucursal.SelectedValue = "-1" Then
- Return -1
+ ObjVentas.Dispose()
+
+ DdlModalCultivo.DataBind()
+ DdlModalCultivo.Items.Insert(0, New ListItem("Seleccione", "-1"))
+
+ End Sub
+
+ Private Sub CargaCultivoVariedadModal(CveCultivo As Integer)
+
+ DdlModalCultivoVariedad.ClearSelection()
+ DdlModalCultivoVariedad.SelectedValue = Nothing
+ DdlModalCultivoVariedad.Items.Clear()
+
+ Dim objVentas As New ClsVentas
+
+ If objVentas.GetCultivosVariedad(CveCultivo, -1, UsuarioActual.CveEmpresa) Then
+ DdlModalCultivoVariedad.DataSource = objVentas.DtResultados
+ End If
+
+ objVentas.Dispose()
+
+ DdlModalCultivoVariedad.DataBind()
+ DdlModalCultivoVariedad.Items.Insert(0, New ListItem("Seleccione", "-1"))
+
+ End Sub
+
+ Private Sub CargaTamaños()
+
+ DdlModalTamaño.ClearSelection()
+ DdlModalTamaño.SelectedValue = Nothing
+ DdlModalTamaño.Items.Clear()
+
+ Dim objVentas As New ClsVentas
+
+ If objVentas.GetEmbarqueTamaño(-1, -1, UsuarioActual.CveEmpresa) Then
+ DdlModalTamaño.DataSource = objVentas.DtResultados
+ End If
+
+ objVentas.Dispose()
+
+ DdlModalTamaño.DataBind()
+ DdlModalTamaño.Items.Insert(0, New ListItem("Seleccione", "-1"))
+
+ End Sub
+ Protected Sub DdlModalCultivo_SelectedIndexChanged(sender As Object, e As EventArgs)
+ CargaCultivoVariedadModal(DdlModalCultivo.SelectedValue.ToEntero)
+ UpModalPreciosVentaFecha.Update()
+ End Sub
+
+
+ Protected Sub LnkModalBuscar_Click(sender As Object, e As EventArgs)
+ CargaPreciosVentaFecha()
+ End Sub
+
+ Private Sub CargaPreciosVentaFecha()
+
+ Dim objVentas As New ClsVentas
+ Dim FechaInicio As Date = If(TxtModalFechaInicio.Text.ToDate > MinFecha, TxtModalFechaInicio.Text.ToDate, MinFecha)
+ Dim FechaFin As Date = If(TxtModalFechaFin.Text.ToDate > MinFecha, TxtModalFechaFin.Text.ToDate, MaxFecha)
+
+ If objVentas.GetPreciosVentaFecha(FechaInicio, FechaFin, -1, -1, -1, UsuarioActual.CveEmpresa) Then
+ GVPrecioVentaFecha.DataSource = objVentas.DtResultados
Else
- Dim array As String() = DdlClienteSucursal.SelectedValue.Split("|"c)
- Return If(array(1).ToEntero > 0, array(1).ToEntero, -1)
+ GVPrecioVentaFecha.DataSource = Nothing
End If
- End Function
+
+ objVentas.Dispose()
+
+ GVPrecioVentaFecha.DataBind()
+
+ UpModalGVPreciosVentaFecha.Update()
+
+ End Sub
+
+ Protected Sub LnkModalGuardarPreciosVentaFecha_Click(sender As Object, e As EventArgs)
+
+ Dim objVentas As New ClsVentas
+ Dim ProcesoOC As Boolean = True
+
+ If CvePrecioVentaFecha > 0 Then
+
+ If Not objVentas.UpdatePreciosVentaFecha(CvePrecioVentaFecha, DdlModalCultivo.SelectedValue.ToEntero, DdlModalTamaño.SelectedValue.ToEntero, TxtModalDescripcion.Text.Trim, TxtModalFecha.Text.ToDate, DdlModalCultivoVariedad.SelectedValue.ToEntero,
+ TxtPrecioVentaFecha.Text.ToDecimal, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
+ ProcesoOC = False
+ End If
+
+ Else
+ If Not objVentas.AddPreciosVentaFecha(DdlModalCultivo.SelectedValue.ToEntero, TxtModalDescripcion.Text.Trim, TxtModalFecha.Text.ToDate, DdlModalCultivoVariedad.SelectedValue.ToEntero,
+ DdlModalTamaño.SelectedValue.ToEntero, TxtPrecioVentaFecha.Text.ToDecimal, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
+ ProcesoOC = False
+ End If
+ End If
+
+ objVentas.Dispose()
+
+ If ProcesoOC Then
+ CargaPreciosVentaFecha()
+ Alert("Precio Guardado correctamente.")
+ RegistraScript("$('#DVModalPreciosVentaFecha').modal('hide');")
+ End If
+
+ End Sub
+
+ Protected Sub LnkEditarPrecioVentaFecha_Click(sender As Object, e As EventArgs)
+
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+ Dim ProcesoOK As Boolean = True
+
+ CvePrecioVentaFecha = GvRow.DataKey("CvePrecioVentaFecha").ToEntero
+
+ DdlModalCultivo.SelectedValueExist(GvRow.DataKey("CveCultivo"))
+ CargaCultivoVariedadModal(DdlModalCultivo.SelectedValue.ToEntero)
+ DdlModalTamaño.SelectedValueExist(GvRow.DataKey("CveTamaño"))
+ TxtModalDescripcion.Text = GvRow.DataKey("Descripcion")
+ TxtPrecioVentaFecha.Text = GvRow.DataKey("PrecioVenta")
+ TxtModalFecha.Text = GvRow.DataKey("Fecha").ToDate.ToString("dd/MM/yyyy")
+ DdlModalCultivoVariedad.SelectedValueExist(GvRow.DataKey("CveCultivoVariedad"))
+
+ 'If ProcesoOK Then
+ ' CargaPreciosVentaFecha()
+ 'End If
+
+ LtlModalTituloPreciosVentaFecha.Text = "Actualziar Precio"
+ UpModalPreciosVentaFecha.Update()
+ RegistraScript("$('#DVModalPreciosVentaFecha').modal('show');")
+
+ End Sub
+
+ Protected Sub LnkEliminarPrecioVentaFecha_Click(sender As Object, e As EventArgs)
+
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+ Dim ProcesoOK As Boolean = True
+ Dim CvePrecioVentaFechaElimianr As Integer = GvRow.DataKey("CvePrecioVentaFecha").ToEntero
+ Dim objVentas As New ClsVentas
+
+ If Not objVentas.DeletePreciosVentaFecha(CvePrecioVentaFechaElimianr, UsuarioActual.CveEmpresa) Then
+ ProcesoOK = False
+ End If
+
+ objVentas.Dispose()
+
+ If ProcesoOK Then
+ CargaPreciosVentaFecha()
+ UpModalPreciosVentaFecha.Update()
+ Alert("Precio eliminado correctamente.")
+ End If
+
+
+
+ End Sub
+
+ Protected Sub LnkModalMuestraAdd_Click(sender As Object, e As EventArgs)
+
+ CvePrecioVentaFecha = -1
+
+ DdlModalCultivo.SelectedValueExist(-1)
+ DdlModalTamaño.SelectedValueExist(-1)
+ TxtModalDescripcion.Text = ""
+ TxtModalFecha.Text = ""
+ DdlModalCultivoVariedad.SelectedValueExist(-1)
+ LtlModalTituloPreciosVentaFecha.Text = "Agregar Precio"
+
+ UpModalPreciosVentaFecha.Update()
+
+ RegistraScript("$('#DVModalPreciosVentaFecha').modal('show');")
+
+ End Sub
End Class
diff --git a/App_Code/BundleConfig.vb b/App_Code/BundleConfig.vb
index d81e59fd1..540abb2ea 100644
--- a/App_Code/BundleConfig.vb
+++ b/App_Code/BundleConfig.vb
@@ -28,13 +28,17 @@ Public Class BundleConfig
"~/Scripts/gridviewScroll.js",
"~/Metronic/Carusel/slick.min.js",
"~/Metronic/assets/global/plugins/fullcalendar/lib/moment.min.js",
- "~/Metronic/assets/global/plugins/fullcalendar/fullcalendar.js",
- "~/Scripts/highcharts.js",
- "~/Scripts/exporting.js",
- "~/Scripts/offline-exporting.js",
- "~/Scripts/export-data.js"
- ))
+ "~/Metronic/assets/global/plugins/fullcalendar/fullcalendar.js"
+ ))
+ bundles.Add(New Bundle("~/bundles/highcharts").Include(
+ "~/Scripts/highcharts/highcharts.js",
+ "~/Scripts/Highcharts/datagrid.js",
+ "~/Scripts/Highcharts/dashboards.js",
+ "~/Scripts/Highcharts/data.js",
+ "~/Scripts/Highcharts/exporting.js",
+ "~/Scripts/Highcharts/accessibility.js"
+ ))
bundles.Add(New ScriptBundle("~/Metronic/assets/global/scripts/JSNoCustom").Include(
"~/Metronic/assets/global/plugins/bootstrap/js/bootstrap.min.js",
"~/Metronic/assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js",
@@ -358,6 +362,12 @@ Public Class BundleConfig
"~/Metronic/assets/global/plugins/codemirror/theme/material.css",
"~/Metronic/assets/global/plugins/codemirror/theme/neo.css",
"~/Metronic/assets/global/plugins/codemirror/addon/hint/show-hint.css"))
+
+
+ '"~/Scripts/Highcharts/layout.js"
+
+
+
End Sub
End Class
\ No newline at end of file
diff --git a/App_Code/ClsContPAQi.vb b/App_Code/ClsContPAQi.vb
index 5e234998a..cfcc0c792 100644
--- a/App_Code/ClsContPAQi.vb
+++ b/App_Code/ClsContPAQi.vb
@@ -472,6 +472,18 @@ Public Class ClsContPAQi
StrSQL.Append(" EXEC PA_UpdateId 'Id_DevolucionIVA';")
+ StrSQL.Append(" SET @IdDevIVA = dbo.FNC_GetCounter ('Id_MovimientoImpuesto');")
+ StrSQL.Append(" INSERT INTO MovimientosImpuestos ")
+ StrSQL.Append(" (Id,RowVersion, IdPoliza, NumMovto, IdPersona, SistOrig, EjercicioAsignado,PeriodoAsignado, IdCuenta,,Captado,AplicaImpuesto,Modificado, ")
+ StrSQL.Append(" Serie, Folio, Referencia, UUID, Origen, OrigenMovto, Computable, TipoMovimiento, TipoFactor, Impuesto, ObjetoImpuesto, NombreImpuestoLocal, TasaOCuota, ImpBase, ")
+ StrSQL.Append(" ImpImpuesto, ImpTotal, Desglosado, IVANoAcred, AcumulaIETU, IdConceptoIETU, IETUDeducible, IETUModificado, IETUAcreditable, GuidMov, GuidMovPadre, Migrado,")
+ StrSQL.Append(" ConceptoIVA,SubconceptoIVA,ClasificadorIVA,ProporcionDIOT,DeducibleDIOT)")
+ StrSQL.Append(" VALUES (@IdDevIVA, @RowVersion, @IdPoliza, ISNULL ((SELECT MAX (NumMovto) FROM MovimientosImpuestos WHERE IdPoliza = @IdPoliza), 0) + 1, @IdPersona, 1,YEAR(@FechaMov), MONTH(@FechaMov), @IdCuenta, 0,1,0,")
+ StrSQL.Append(" @Serie, @Folio, @Referencia, @UUID,2, 0,0,0,1,2,0,'',0.16, @SubTotal, @IVA,@SubTotal + @IVA,0, @IVANoAcred,0,0,0,0,'','',0,1,1,1,1,0,0);")
+ StrSQL.Append(" ")
+
+ StrSQL.Append(" EXEC PA_UpdateId 'Id_MovimientoImpuesto';")
+
StrSQL.Append(" END TRY")
StrSQL.Append(" BEGIN CATCH")
diff --git a/App_Code/ClsOP.vb b/App_Code/ClsOP.vb
index 8688a3969..eb34c60ee 100644
--- a/App_Code/ClsOP.vb
+++ b/App_Code/ClsOP.vb
@@ -408,6 +408,33 @@ Public Class ClsOP
#Region "O R D E N E S D E P R O D U C C I O N"
+
+ Public Function OPAdd(Descripcion As String, CveCliente As Integer, CveEmpresa As Integer, CveUsuario As Integer, Fecha As Date, CveSubProyecto As Integer, xmlproductos As String, ByRef CveOP As Integer, ByRef Folio As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_OP_OrdendeProduccionAdd")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion
+ .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@Fecha", SqlDbType.Date).Value = Fecha
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
+ .Add("@xmlproductos", SqlDbType.Xml).Value = xmlproductos
+ .Add("@CveOP", SqlDbType.Int).Direction = ParameterDirection.Output
+ .Add("@Folio", SqlDbType.Int).Value = ParameterDirection.Output
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ CveOP = CInt(SqlAdapter.SelectCommand.Parameters("@CveOP").Value)
+ Folio = CInt(SqlAdapter.SelectCommand.Parameters("@Folio").Value)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al agregar la Orden de Produccion.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ Retorno = False
+ End Try
+ Return Retorno
+ End Function
+
Public Function GetReportesOP(CveOP As Integer, CveCliente As Integer, CveSubProyecto As Integer, CvePS As Integer, CveEstatus As Integer, Asignado As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OP_OrdendeProduccionGet")
@@ -474,6 +501,27 @@ Public Class ClsOP
Return Retorno
End Function
+ Public Function UpdateEstatusOP(CveOP As Integer, CveEstatusOP As Integer, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_OP_OrdendeProduccionEstatusUp")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveOP", SqlDbType.Int).Value = CveOP
+ .Add("@CveEstatusOP", SqlDbType.Int).Value = CveEstatusOP
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True ' Éxito si no hay excepciones
+ Catch ex As Exception
+ OnError("Error al actualizar estatus de la OP", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ Retorno = False
+ End Try
+
+ Return Retorno
+ End Function
+
Public Function UpdateOP(CveOP As Integer, Descripcion As String, CveCliente As Integer, CvePS As Integer, CveSubProyecto As Integer, Cantidad As Integer, Fecha As Date, CveEmpresa As Integer, CveUsuario As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OP_OrdendeProduccionUp")
diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb
index 81ca7b875..dee1cabf4 100644
--- a/App_Code/ClsVentas.vb
+++ b/App_Code/ClsVentas.vb
@@ -3,6 +3,7 @@ Option Strict On
Imports System.Data
Imports System.Data.SqlClient
+Imports System.Runtime.CompilerServices
Imports Extensiones
Imports Profact.TimbraCFDI40
@@ -7357,7 +7358,7 @@ Public Class ClsVentas
End Function
- Public Function GetComisionesMedicasRep(FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CveSubProyecto As Integer, CveProcedimiento As Integer, CveMedico As Integer, CveVendedor As Integer, CveUsuario As Integer, CveTipoVenta As Integer, FechaInicioPago As Date, FechaFinPago As Date) As Boolean
+ Public Function GetComisionesMedicasRep(FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CveSubProyecto As Integer, CveProcedimiento As Integer, CveMedico As Integer, CveVendedor As Integer, CveUsuarioAtendio As Integer, CveUsuarioConsulta As Integer, CveTipoVenta As Integer, FechaInicioPago As Date, FechaFinPago As Date) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_ComisionesMedicasRepGet")
@@ -7370,9 +7371,10 @@ Public Class ClsVentas
.Add("@CveMedico", SqlDbType.Int).Value = CveMedico
.Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
- .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CveUsuarioAtendio", SqlDbType.Int).Value = CveUsuarioAtendio
.Add("@CveTipoVenta", SqlDbType.Int).Value = CveTipoVenta
.Add("@FechaInicioPago", SqlDbType.Date).Value = FechaInicioPago
+ .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta
.Add("@FechaFinPago", SqlDbType.Date).Value = FechaFinPago
End With
@@ -7715,6 +7717,181 @@ Public Class ClsVentas
Return Retorno
End Function
+
+ Public Function GetPreciosVentaManifiesto(FechaInicio As Date, FechaFin As Date, CveEmbarqueManifiesto As Integer, CveSubProyecto As Integer, CveCultivo As Integer, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Agro_PreciosVentaManifiestoGet")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
+ .Add("@FechaFin", SqlDbType.Date).Value = FechaFin
+ .Add("@CveEmbarqueManifiesto", SqlDbType.Int).Value = CveEmbarqueManifiesto
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
+ .Add("@CveCultivo", SqlDbType.Int).Value = CveCultivo
+ .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 indicadores de venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+ Return Retorno
+
+ End Function
+
+
+ Public Function AddPreciosVentaFecha(CveCultivo As Integer, Descripcion As String, Fecha As Date, CveCultivoVariedad As Integer, CveTamaño As Integer, PrecioVenta As Decimal, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Agro_PreciosVentaFechaAdd")
+ With SqlAdapter.SelectCommand.Parameters
+
+ .Add("@CveCultivo", SqlDbType.Int).Value = CveCultivo
+ .Add("@CveTamaño", SqlDbType.Int).Value = CveTamaño
+ .Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion
+ .Add("@Fecha", SqlDbType.Date).Value = Fecha
+ .Add("@CveCultivoVariedad", SqlDbType.Int).Value = CveCultivoVariedad
+ .Add("@PrecioVenta", SqlDbType.Money).Value = PrecioVenta
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al agregar los precios del día.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+ Return Retorno
+
+ End Function
+
+ Public Function UpdatePreciosVentaFecha(CvePrecioVentaFecha As Integer, CveCultivo As Integer, CveTamaño As Integer, Descripcion As String, Fecha As Date, CveCultivoVariedad As Integer, PrecioVenta As Decimal, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Agro_PreciosVentaFechaUpdate")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePrecioVentaFecha", SqlDbType.Int).Value = CvePrecioVentaFecha
+ .Add("@CveCultivo", SqlDbType.Int).Value = CveCultivo
+ .Add("@CveTamaño", SqlDbType.Int).Value = CveTamaño
+ .Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion
+ .Add("@Fecha", SqlDbType.Date).Value = Fecha
+ .Add("@CveCultivoVariedad", SqlDbType.Int).Value = CveCultivoVariedad
+ .Add("@PrecioVenta", SqlDbType.Money).Value = PrecioVenta
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al actualizar los precios del día.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+ Return Retorno
+
+ End Function
+
+
+ Public Function GetPreciosVentaFecha(FechaInicio As Date, FechaFin As Date, CvePrecioVentaFecha As Integer, CveCultivo As Integer, CveCultivoVariedad As Integer, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Agro_PreciosVentaFechaGet")
+ With SqlAdapter.SelectCommand.Parameters
+
+ .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
+ .Add("@FechaFin", SqlDbType.Date).Value = FechaFin
+ .Add("@CvePrecioVentaFecha", SqlDbType.Int).Value = CvePrecioVentaFecha
+ .Add("@CveCultivo", SqlDbType.Int).Value = CveCultivo
+ .Add("@CveCultivoVariedad", SqlDbType.Int).Value = CveCultivoVariedad
+ .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 precios del día.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+ Return Retorno
+
+ End Function
+
+
+ Public Function DeletePreciosVentaFecha(CvePrecioVentaFecha As Integer, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Agro_PreciosVentaFechaDelete")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePrecioVentaFecha", SqlDbType.Int).Value = CvePrecioVentaFecha
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al eliminar los precios del día.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+ Return Retorno
+
+ End Function
+
+
+
+
+ Public Function GetCultivos(CveCultivo As Integer, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_AgroCultivoGet")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@cveCultivo", SqlDbType.Int).Value = CveCultivo
+ .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 cultivos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+ Return Retorno
+
+ End Function
+
+ Public Function GetCultivosVariedad(CveCultivo As Integer, cveCultivosVariedad As Integer, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Agro_CultivosVariedadGet")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveCultivo", SqlDbType.Int).Value = CveCultivo
+ .Add("@cveCultivosVariedad", SqlDbType.Int).Value = cveCultivosVariedad
+ .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 precios del día.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+ Return Retorno
+
+ End Function
+
+ Public Function GetEmbarqueTamaño(CveTamaño As Integer, Estatus As Integer, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Agro_Embarque_TamañoGet")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveTamaño", SqlDbType.Int).Value = CveTamaño
+ .Add("@Estatus", SqlDbType.Int).Value = Estatus
+ .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 tamaños del día.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+ Return Retorno
+
+ End Function
+
+
+
+
+
+
+
+
#Region "IDisposable Support"
diff --git a/Bancos/IE.aspx b/Bancos/IE.aspx
index 37fce5bfc..edf1b4556 100644
--- a/Bancos/IE.aspx
+++ b/Bancos/IE.aspx
@@ -1257,8 +1257,8 @@