diff --git a/Agropecuaria/RepPreciosVentaManifiesto.aspx b/Agropecuaria/RepPreciosVentaManifiesto.aspx new file mode 100644 index 000000000..ff5db5faa --- /dev/null +++ b/Agropecuaria/RepPreciosVentaManifiesto.aspx @@ -0,0 +1,388 @@ +<%@ Page Title="Precios Ventas" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepPreciosVentaManifiesto.aspx.vb" Inherits="Agrupecuaria_RepPreciosVentaManifiesto" %> + + + + + + + + + + + + + +
  • + + Agregar Precio + +
  • +
    +
    + +
    + + Precios Ventas + + + + + + + + +
    +
    +
    + + +
    +
    +
    +
    + Fecha Inicio: +
    +
    +
    + + + + +
    + + + + + + +
    +
    + Fecha Fin: +
    +
    +
    + + + + +
    + + + + + + +
    + +
    + : +
    +
    + +
    + + +
    + +
    + +
    +
    +
    + +
    +
    +
    + +
    + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
    + + + + +
    +
    + + + + + + + + + + + + + + + + + + + +
    +
    + +
    +
    + + +<%-- POPUP Modal GV Precios Venta Fecha --%> + + + +<%-- POPUP AGREGAR Precios Venta Fecha --%> + + + + + +
    + + diff --git a/Agropecuaria/RepPreciosVentaManifiesto.aspx.vb b/Agropecuaria/RepPreciosVentaManifiesto.aspx.vb new file mode 100644 index 000000000..4de8fd0db --- /dev/null +++ b/Agropecuaria/RepPreciosVentaManifiesto.aspx.vb @@ -0,0 +1,319 @@ +Option Explicit On +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 + + Private Sub CargaManifiesto(CveSubProyecto As Integer) + + DdlManifiesto.ClearSelection() + DdlManifiesto.SelectedValue = Nothing + DdlManifiesto.Items.Clear() + + Dim objNow As New ClsNominas + + If objNow.EmbarqueManifiestoGet(CveSubProyecto, -1, UsuarioActual.CveEmpresa, -1) Then + DdlManifiesto.DataSource = objNow.DtResultados.FiltraParametros("", "", {"CveEmbarqueManifiesto", "NoEmbarque"}) + End If + + objNow.Dispose() + + DdlManifiesto.DataBind() + DdlManifiesto.Items.Insert(0, New ListItem("Todos", "-1")) + + End Sub + Private Sub CargaCultivo(CveSubProyecto As Integer) + + DdlCultivo.ClearSelection() + DdlCultivo.SelectedValue = Nothing + DdlCultivo.Items.Clear() + + Dim ObjVentas As New ClsVentas + + If ObjVentas.GetCultivos(-1, UsuarioActual.CveEmpresa) Then + DdlCultivo.DataSource = ObjVentas.DtResultados + Else + DdlCultivo.DataSource = Nothing + End If + + ObjVentas.Dispose() + + DdlCultivo.DataBind() + DdlCultivo.Items.Insert(0, New ListItem("Todos", "-1")) + + 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 objVenas As New ClsVentas + + 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 + objVenas.Dispose() + + GvDatos.DataBind() + + UpAcciones.Update() + UPDatos.Update() + + End Sub + +#End Region + + +#Region " GV DATOS - ROW DATABOUND " + Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound + End Sub +#End Region + + Protected Sub LnkAddPreciosVentaFecha_Click(sender As Object, e As EventArgs) + + CargaCultivoModal(-1) + CargaPreciosVentaFecha() + CargaTamaños() + + RegistraScript("$('#DVModalGVPreciosVentaFecha').modal('show');") + + End Sub + + Private Sub CargaCultivoModal(CveSubProyecto As Integer) + + DdlModalCultivo.ClearSelection() + DdlModalCultivo.SelectedValue = Nothing + DdlModalCultivo.Items.Clear() + + Dim ObjVentas As New ClsVentas + + If ObjVentas.GetCultivos(-1, UsuarioActual.CveEmpresa) Then + DdlModalCultivo.DataSource = ObjVentas.DtResultados + Else + DdlModalCultivo.DataSource = Nothing + End If + + 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 + GVPrecioVentaFecha.DataSource = Nothing + End If + + 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/ClsPaginas.vb b/App_Code/ClsPaginas.vb index ac4aa3906..8e1b2afe6 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -11138,6 +11138,8 @@ Public Class ClsPaginas PaginaDict.Add("/Contabilidad/OCDetalleAlmacen.aspx".ToUpper(), -1) PaginaDict.Add("/Contabilidad/RepBalanceGeneralHorizontal.aspx".ToUpper(), -1) PaginaDict.Add("/Agropecuaria/CierreCultivo.aspx".ToUpper(), 1326) + PaginaDict.Add("/Agropecuaria/RepPreciosVentaManifiesto.aspx".ToUpper(), -1) + PaginaDict.Add("/Inventarios/RepRSCO.aspx".ToUpper(), 1328) PaginaDict.Add("/testApi.aspx".ToUpper(), -1) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index a4af209d8..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 @@ -826,27 +827,13 @@ Public Class ClsVentas Return Retorno End Function - Public Function UpdateVentaAnticipoAutorizado(CveVenta As Integer, Autorizado As Boolean) As Boolean + Public Function UpdateAnticipoAutorizado(CveVenta As Integer, CveIE As Integer, Tipo As String, Autorizado As Boolean) As Boolean Dim Retorno As Boolean = False - DataAdapter("PA_Vta_VentaAnticipoAutorizadoUpdate") + DataAdapter("PA_Vta_AnticipoAutorizadoUpdate") With SqlAdapter.SelectCommand.Parameters .Add("@CveVenta", SqlDbType.Int).Value = CveVenta - .Add("@Autorizado", SqlDbType.Bit).Value = Autorizado - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al actualizar el estatus del anticipo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - Return Retorno - End Function - - Public Function UpdateIxCAnticipoAutorizado(CveIE As Integer, Autorizado As Boolean) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Vta_IxCAnticipoAutorizadoUpdate") - With SqlAdapter.SelectCommand.Parameters .Add("@CveIE", SqlDbType.Int).Value = CveIE + .Add("@Tipo", SqlDbType.VarChar).Value = Tipo .Add("@Autorizado", SqlDbType.Bit).Value = Autorizado End With Try @@ -6349,7 +6336,7 @@ Public Class ClsVentas End Function - Public Function UpdateVentaLineaAdicional(CveLineaAdicional As Integer, CveVenta As Integer, LineaAdicionalComprobante As String, CveLineaAdicionalEstatus As Integer, CveEmpresa As Integer) As Boolean + Public Function UpdateVentaLineaAdicional(CveLineaAdicional As Integer, CveVenta As Integer, LineaAdicionalComprobante As String, CveLineaAdicionalEstatus As Integer, CveEmpresa As Integer, Optional OrdenCompra As String = "-1") As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_LineasAdicionalesVentaUpdate") @@ -6359,6 +6346,7 @@ Public Class ClsVentas .Add("@LineaAdicionalComprobante", SqlDbType.VarChar).Value = LineaAdicionalComprobante .Add("@CveLineaAdicionalEstatus", SqlDbType.Int).Value = CveLineaAdicionalEstatus .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@OrdenCompra", SqlDbType.VarChar).Value = OrdenCompra End With Try SqlAdapter.Fill(Data) @@ -7370,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") @@ -7383,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 @@ -7719,7 +7708,8 @@ Public Class ClsVentas .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With Try - SqlAdapter.Fill(Data) + Dataset = New DataSet() + SqlAdapter.Fill(Dataset) Retorno = True Catch ex As Exception OnError("Ocurrió un error al obtener los indicadores de venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) @@ -7727,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/App_WebReferences/GrowerService/service.disco b/App_WebReferences/GrowerService/service.disco new file mode 100644 index 000000000..ee543b932 --- /dev/null +++ b/App_WebReferences/GrowerService/service.disco @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/App_WebReferences/GrowerService/service.discomap b/App_WebReferences/GrowerService/service.discomap new file mode 100644 index 000000000..a7281ccc9 --- /dev/null +++ b/App_WebReferences/GrowerService/service.discomap @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/App_WebReferences/GrowerService/service.wsdl b/App_WebReferences/GrowerService/service.wsdl new file mode 100644 index 000000000..487453d24 --- /dev/null +++ b/App_WebReferences/GrowerService/service.wsdl @@ -0,0 +1,350 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Ashx/E158.ashx b/Ashx/E158.ashx new file mode 100644 index 000000000..9ca13d1cc --- /dev/null +++ b/Ashx/E158.ashx @@ -0,0 +1,169 @@ +<%@ WebHandler Language="VB" Class="E158" %> + +Imports System +Imports System.Web +Imports System.Data +Imports Newtonsoft.Json +Imports Newtonsoft.Json.Linq +Imports Extensiones +Imports System.IO +Imports CrystalDecisions.CrystalReports.Engine +Imports CrystalDecisions.Shared +Imports Microsoft.Reporting.WebForms +Imports System.Threading +Imports System.Threading.Tasks +Imports System.Net.Http +Imports System.Net.Http.Headers +Imports SharpCompress.Archive.Rar +Imports SharpCompress.Common +Imports SharpCompress.Reader +Imports System.Xml +'Imports ADSistemaLibrary.SatXml +'Imports ADSistemaLibrary.SatXml.XmlSatCFDI +Imports System.Diagnostics +Imports System.Drawing +Imports System.Drawing.Imaging + + + +Public Class E158 : Implements IHttpHandler, IReadOnlySessionState + + + Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable + Get + Return False + End Get + End Property + + Private currentcontext As HttpContext + Private URLParametros As New Hashtable + Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest + context.Response.ContentType = "text/plain" + currentcontext = context + Dim retorno As String = "no se encontro la variable" + Try + Dim metodo As String = "" + Dim FechaActual As DateTime = ClsPaginas.NowADS() + Dim FechaEnvio As DateTime = FechaActual + + If context.Request("var") IsNot Nothing Then + URLParametros = Parametros(context.Request("var")) + metodo = URLParametros("metodo").ToString + 'SI TRAE UN JSON COMO PARAMETRO + ElseIf context.Request("metodo") IsNot Nothing Then + metodo = context.Request("metodo").ToString() + If context.Request("FechaEnvio") IsNot Nothing Then + FechaEnvio = context.Request("FechaEnvio").ToString().ToDateTime() + End If + End If + + Select Case metodo + Case "PreciosVentaCultivo" + Dim tCveEmpresa As Integer = context.Request("CveEmpresa").ToString.ToEntero + If PreciosVentaCultivo(tCveEmpresa, context) Then + retorno = "OK" + Else + retorno = "Error" + End If + + context.Response.Write(retorno) + End Select + Catch ex As Exception + ex.GuardaLog(ex.ToString()) + context.Response.Write(retorno) + End Try + + End Sub + + Private Function PreciosVentaCultivo(ByVal CveEmpresa As Integer, ByVal context As HttpContext) As Boolean + Dim Respuesta As Boolean = False + Dim Usuario As Usuario = ValidaUsuarioSistema(100, CveEmpresa) + + ' Crear una instancia del servicio web + Dim wsservice As New GrowerService.Service() + wsservice.Url = "http://webservices.optimaproduce.net/GrowerService/service.asmx" + + ' Llamar al método GetSales con los parámetros necesarios + + Dim Parametro1 As Integer = 9 + Dim Parametro2 As Integer = 1 + Dim Parametro3 As Integer = 43 + Dim Parametro4 As Integer = 0 '–batchid de una liquidación – 0 Todos + Dim Parametro5 As Integer = 3 '– Para agropecuaria Jam + Dim Parametro6 As Integer = 0 + Dim Parametro6Date As Date = Now.AddDays(-3) + + 'Dim DTresp As DataTable = wsservice.GetSales(Parametro1, Parametro2, Parametro3, Parametro4, Parametro5, Parametro6) + 'DTresp.WriteXml("C:\temp\GrowerService\Sales.xml", XmlWriteMode.WriteSchema) + + 'Dim DTAdjustements As DataTable = wsservice.GetAdjustements(Parametro1, Parametro2, Parametro4, Parametro5, Parametro6) + 'DTAdjustements.WriteXml("C:\temp\GrowerService\Adjustements.xml", XmlWriteMode.WriteSchema) + + + + 'Dim DTGeneralExpenses As DataTable = wsservice.GetGeneralExpenses(Parametro1, Parametro2, Parametro3, Parametro4, Parametro5, Parametro6, expenseID:=) + 'DTGeneralExpenses.WriteXml("C:\temp\GrowerService\GeneralExpenses.xml", XmlWriteMode.WriteSchema) + + 'Dim DTLotexpenses As DataTable = wsservice.GetLotExpenses(Parametro1, Parametro2, Parametro3, Parametro4, Parametro5, Parametro6, expenseID:=) + 'DTLotexpenses.WriteXml("C:\temp\GrowerService\Lotexpenses.xml", XmlWriteMode.WriteSchema) + + Dim DTTodayInvoices As DataTable = wsservice.GetTodayInvoices(Parametro1, Parametro2, Parametro3, Parametro4, Parametro5, Parametro6Date, ContractFilter:=1) + DTTodayInvoices.WriteXml("C:\temp\GrowerService\TodayInvoices.xml", XmlWriteMode.WriteSchema) + + Dim InvParametro1 As Integer = 9 + Dim InvParametro2 As Integer = 1 + Dim InvParametro3 As Date = Now.AddDays(-3) ' “01/01/2025” '- ldDate + Dim InvParametro4 As Integer = 3 '- PackerID + Dim InvParametro5 As Integer = 0 ' - GrowerID + Dim InvParametro6 As Integer = 0 '- LabelID(0 = Todos) + Dim InvParametro7 As String = ”E” '- Language + + 'Dim DTIntentoryActivity As DataTable = wsservice.GetInventoryActivity(InvParametro1, InvParametro2, InvParametro3, InvParametro4, InvParametro5, InvParametro6, InvParametro7) + 'DTIntentoryActivity.WriteXml("C:\temp\GrowerService\IntentoryActivity.xml", XmlWriteMode.WriteSchema) + + + + + + Return Respuesta + End Function + + + Private Function ValidaUsuarioSistema(CveUsuario As Integer, CveEmpresa As Integer) As Usuario + Dim UsuarioActual As Usuario = Nothing + Dim NombreCadena As String = ClsPaginas.GlobalNombreCadenaConexion(CveEmpresa) + Dim ObjUsuarios As New ClsSisUsuarioAutenticacion(NombreCadena:=NombreCadena) + UsuarioActual = ObjUsuarios.GetUsuarioDetalle(CveUsuario, CveEmpresa) + If UsuarioActual IsNot Nothing Then + HttpContext.Current.Session("UsuarioSIG") = UsuarioActual + 'CreaObjetoEmpresa(UsuarioActual) + End If + ObjUsuarios.Dispose() + + Return UsuarioActual + End Function + + Private Function Parametros(Cadena As String) As Hashtable + Cadena = Decripta(Cadena) + Dim P1() As String = Cadena.Split("&"c) + Dim Tmp As String + Dim P2() As String + + Dim URLParametros As New Hashtable + + For Each Tmp In P1 + P2 = Tmp.Replace("%26%", "&").Split("="c) + URLParametros.Add(P2(0).ToString(), P2(1)) + Next + Return URLParametros + End Function + + +End Class + + + + + + + diff --git a/Ashx/SIGFacturacion.ashx b/Ashx/SIGFacturacion.ashx index f9ff0d3cb..034a71d08 100644 --- a/Ashx/SIGFacturacion.ashx +++ b/Ashx/SIGFacturacion.ashx @@ -280,7 +280,6 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState ObjFactura.Serie = Serie ObjFactura.Folio = Folio.ToEntero() ObjFactura.TipoMensajeRespuesta = TipoMensajeRespuesta.TextoLimpio - ObjFactura.Version = "4.0" ObjFactura.CveUsuario = UsuarioActual.CveUsuario ObjFactura.CveEmpresa = UsuarioActual.CveEmpresa @@ -290,16 +289,11 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState ObjFactura.TipoDocto = "Ing" 'ObjFactura.CveMesa = -1 ObjFactura.Fecha = ClsPaginas.NowADS() - ObjFactura.CvePrePoliza = -1 ObjFactura.FechaPago = ClsPaginas.NowADS() - ObjFactura.MotivoDescuento = "" ObjFactura.FechaEjecucion = ClsPaginas.NowADS() ObjFactura.UsuarioCreo = UsuarioActual.Usuario - ObjFactura.CveCondicionEntrega = -1 - ObjFactura.CondicionesPago = 0 ObjFactura.TipoDocumento = "Ingresos" - ObjFactura.ConvertirPesos = False ObjFactura.CveSubProyecto = CveSubProyecto ObjFactura.CveSubProyectoCobranza = CveSubProyecto ObjFactura.CveSubProyectoEjecucion = CveSubProyecto @@ -309,8 +303,6 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState 'CLIENTE ObjFactura.CveCliente = CveCliente ObjFactura.SetCliente() - ObjFactura.CveAlmacen = -1 - 'DETALLES ObjFactura.DtDetalle = CreaDTDetalle(Resp, UsuarioActual, DTRemisionesPS) @@ -485,89 +477,10 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Next Return Timbre End Function + Private Function CreaDTDetalle(ByRef Retorno As Modelos.Factura.MMensajeFactura, UsuarioActual As Usuario, DtRemisionesPS As DataTable) As DataTable - Dim TmpDT As New DataTable - TmpDT.Columns.Add("CveVenta", GetType(Integer)) - TmpDT.Columns.Add("Consec", GetType(Integer)) - TmpDT.Columns.Add("Cantidad", GetType(Decimal)) - TmpDT.Columns.Add("Codigo", GetType(String)) - TmpDT.Columns.Add("CveUM", GetType(Integer)) - TmpDT.Columns.Add("UM", GetType(String)) - TmpDT.Columns.Add("SATClaveUM", GetType(String)) - TmpDT.Columns.Add("CveClasificacion", GetType(Integer)) - TmpDT.Columns.Add("Clasificacion", GetType(String)) - TmpDT.Columns.Add("CvePS", GetType(Integer)) - TmpDT.Columns.Add("PS", GetType(String)) - TmpDT.Columns.Add("CodigoPS", GetType(String)) - TmpDT.Columns.Add("SATClaveProdServ", GetType(String)) - TmpDT.Columns.Add("NoIdentificacion", GetType(String)) - TmpDT.Columns.Add("CveTipoPS", GetType(Integer)) - TmpDT.Columns.Add("CveTipoInvPS", GetType(Integer)) - TmpDT.Columns.Add("Serie", GetType(String)) - TmpDT.Columns.Add("CuentaPredial", GetType(String)) - TmpDT.Columns.Add("Obs", GetType(String)) - TmpDT.Columns.Add("TiempoEntrega", GetType(String)) - TmpDT.Columns.Add("PU", GetType(Decimal)) - TmpDT.Columns.Add("IVA", GetType(Decimal)) - TmpDT.Columns.Add("ImporteIVA", GetType(Decimal)) - TmpDT.Columns.Add("PorcentajeIVA", GetType(Decimal)) - TmpDT.Columns.Add("ImporteRetIVA", GetType(Decimal)) - TmpDT.Columns.Add("ImporteRetISR", GetType(Decimal)) - TmpDT.Columns.Add("PorcentajeRetIVA", GetType(Decimal)) - TmpDT.Columns.Add("PorcentajeRetISR", GetType(Decimal)) - TmpDT.Columns.Add("ImporteIEPS", GetType(Decimal)) - TmpDT.Columns.Add("IEPS", GetType(Decimal)) - TmpDT.Columns.Add("PorcentajeIEPS", GetType(Decimal)) - TmpDT.Columns.Add("Descuento", GetType(Decimal)) - TmpDT.Columns.Add("TipoDescuento", GetType(Integer)) - TmpDT.Columns.Add("TotalImporte", GetType(Decimal)) - TmpDT.Columns.Add("Total", GetType(Decimal)) - 'Para uso del módulo contable - TmpDT.Columns.Add("AsientoContableVentas", GetType(Integer)) - TmpDT.Columns.Add("AplicaParaConcepto", GetType(Boolean)) - TmpDT.Columns.Add("CveProyecto", GetType(Integer)) - TmpDT.Columns.Add("Proyecto", GetType(String)) - TmpDT.Columns.Add("CveSubProyecto", GetType(Integer)) - TmpDT.Columns.Add("SubProyecto", GetType(String)) - 'TipoDescuento: 1 = Descuento * PU; 2 = Descuento por Total del concepto - TmpDT.Columns.Add("CvePresupuestoIngreso", GetType(Integer)) - TmpDT.Columns.Add("CveFuenteRecaudacion", GetType(Integer)) - 'Contratos - TmpDT.Columns.Add("CveContratoDetalle", GetType(Integer)) - 'Remisiones a Facturas - TmpDT.Columns.Add("CveVentaDetalle", GetType(Integer)) - TmpDT.Columns.Add("CveVentaDetalleRemision", GetType(Integer)) - TmpDT.Columns.Add("CveVentaDetalleCotizacion", GetType(Integer)) - 'Pedido2 a Facturas - TmpDT.Columns.Add("CveVentaDetallePedido2", GetType(Integer)) - - TmpDT.Columns.Add("Origen", GetType(Integer)) - 'Ordenes Servicio - TmpDT.Columns.Add("CveOS", GetType(Integer)) - TmpDT.Columns.Add("CveOSDetalle", GetType(Integer)) - TmpDT.Columns.Add("SeFacturara", GetType(Integer)) - TmpDT.Columns.Add("Folio", GetType(Integer)) - TmpDT.Columns.Add("Estatus", GetType(String)) - 'Ordenamiento - TmpDT.Columns.Add("Orden", GetType(Integer)) - TmpDT.Columns.Add("TipoDocto", GetType(String)) - 'OC - TmpDT.Columns.Add("CveOrdenCompraDetalle", GetType(Integer)) - TmpDT.Columns.Add("EntregaDirecta", GetType(Integer)) - - TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer)) - TmpDT.Columns.Add("CantidadFacturadaRem", GetType(Decimal)) - TmpDT.Columns.Add("CantidadFacturadaCot", GetType(Decimal)) - TmpDT.Columns.Add("CantidadInventario", GetType(Decimal)) - - TmpDT.Columns.Add("ClaveSATFraccionArancelaria", GetType(String)) - TmpDT.Columns.Add("ClaveSATUnidadAduana", GetType(String)) - TmpDT.Columns.Add("ClaveSATFraccionArancelariaDescripcion", GetType(String)) - TmpDT.Columns.Add("ClaveSATUnidadAduanaDescripcion", GetType(String)) - - TmpDT.Columns.Add("CveTamaño", GetType(Integer)) - TmpDT.Columns.Add("CvePromocionDetalle", GetType(Integer)) + Dim TmpDT As DataTable = Modelos.Factura.CreaDTFactura Try For Each Dr As DataRow In DtRemisionesPS.Select() Dim Row As DataRow = AgregarProductoServicio(Retorno, UsuarioActual, TmpDT, Dr("Consec").ToString.ToEntero(), Dr("Cantidad").ToString.ToDecimal(), Dr("CveUM").ToString.ToEntero, Dr("UM").ToString, Dr("CveClasificacion").ToString.ToEntero, Dr("Clasificacion").ToString, 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 @@
    - -
    + +
    diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 1c656dea0..a948d5b24 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -252,6 +252,20 @@ Partial Class Compras_Compras Return ViewState("CveCompra").ToString.ToEntero End Get End Property + + Private Property CveCompraFactura As Integer + Get + If ViewState("CveCompraFactura") Is Nothing Then + ViewState("CveCompraFactura") = -1 + End If + Return ViewState("CveCompraFactura").ToString.ToEntero + End Get + Set(value As Integer) + ViewState("CveCompraFactura") = value + End Set + End Property + + Private ReadOnly Property CveFactura As Integer Get Return ViewState("CveFactura").ToString.ToEntero @@ -1545,7 +1559,7 @@ Partial Class Compras_Compras If UsuarioActual.Empresa.Funcionalidad(562).ToEntero > 0 Then CargaGastosServicios(UsuarioActual.Empresa.Funcionalidad(562).ToEntero) End If - + CargaGvPersonal() ElseIf Request("CveCompra") IsNot Nothing AndAlso IsNumeric(Request("CveCompra")) AndAlso Request("CveCompra").ToEntero > 0 Then 'If UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 Then @@ -1594,6 +1608,7 @@ Partial Class Compras_Compras 'End If LnkAgregarGuia.Visible = False UpLnkPaqueteriaGuias.Update() + CargaGvPersonal() End If If UsuarioActual.TienePermisoProceso(360) AndAlso UsuarioActual.CveEmpresa = 119 Then BtnProrateoDeducible.Visible = True @@ -2973,6 +2988,7 @@ Partial Class Compras_Compras LblRetISR.Text = If(dr("RetISR").ToString.ToDecimal > 0, TmpDT.MAX("RetISRPorcentaje").ToDecimal * 100, 0).ToString.FormatoNumero(4) '(If(SubTotal2 > 0, (RetencionISR / SubTotal2), 0) * 100).FormatoNumero(3) If dr("TipoFactura").ToString <> "CFDi" Then LblTipoFact.Text = dr("TipoFactura").ToString : divTipoFactura.Visible = True ViewState("CveFactura") = dr("CveFactura").ToString.ToEntero + CveCompraFactura = dr("CveFactura").ToString.ToEntero ViewState("IdPoliza") = dr("IdPoliza").ToString.ToEntero DdlMoneda.SelectedValue = dr("CveMoneda").ToString @@ -15611,7 +15627,7 @@ Partial Class Compras_Compras Amortizacion = TmpDT.SUMD("ImporteSinImpuestos") End If Dim SubTotalCompra As Decimal = Amortizacion - Dim DiferenciaPermitida As Decimal = 1 + Dim DiferenciaPermitida As Decimal = 5 Dim Cont As Integer = 0 'Dim ProductosCodigoSATNoPermitidos As New StringBuilder("") For Each gvr As GridViewRow In GvOC1.Rows @@ -17381,7 +17397,11 @@ Partial Class Compras_Compras If TxtIEPS.Text.ToDouble > 0 Then TrIEPS.Visible = True End If If TxtDescuento.Text.ToDouble > 0 Then TrDescuento.Visible = True - If ActualizaTotales And UsuarioActual.CveEmpresa = 72 Then TxtTotal.Text = Total.ToString.FormatoNumero() + + If ActualizaTotales And UsuarioActual.CveEmpresa = 72 Or Not CveCompraFactura > 0 Then + TxtTotal.Text = Total.ToString.FormatoNumero() + End If + Else TxtSubTotal.Text = SubTotal.ToString.FormatoNumero() TxtSubTotal2.Text = SubTotal2.ToString.FormatoNumero() diff --git a/Contabilidad/RepIVA.aspx.cs b/Contabilidad/RepIVA.aspx.cs index a15292e63..ab9ce005e 100644 --- a/Contabilidad/RepIVA.aspx.cs +++ b/Contabilidad/RepIVA.aspx.cs @@ -377,7 +377,7 @@ public partial class Contabilidad_RepIVA : ClsPaginas else { DataTable dtt = new DataTable(); - dtt = Objconta.DtResultados.FiltraParametros("CveCompra is null and CveProveedor > 0 AND ( ActosFN > 0 OR ActosFS > 0 OR Actos16 > 0 OR ActosImp16 > 0 OR ActosImpNotan16 > 0 OR DATasa0 > 0 OR DANoObjetoTN > 0 OR DANoObjetoNoTN > 0)"); + dtt = Objconta.DtResultados.FiltraParametros("CveCompra is null and CveProveedor > 0 AND ( ActosFN > 0 OR ActosFS > 0 OR Actos16 > 0 OR ActosImp16 > 0 OR ActosImpNotan16 > 0 OR DATasa0 > 0 OR DANoObjetoTN > 0 OR DANoObjetoNoTN > 0 OR NoAcredFN > 0 OR NoAcredNoFN > 0)"); //acumula los prov, globales en un solo registro dtt = AcumularYReemplazar(dtt); @@ -799,7 +799,7 @@ public partial class Contabilidad_RepIVA : ClsPaginas TmpDIOT.Columns.Add("DAManifiesto", typeof(string)); DataTable dtt = new DataTable(); - dtt = Objconta.DtResultados.FiltraParametros("CveCompra is null and CveProveedor > 0 AND ( ActosFN > 0 OR ActosFS > 0 OR Actos16 > 0 OR ActosImp16 > 0 OR ActosImpNotan16 > 0 OR DATasa0 > 0 OR DANoObjetoTN > 0 OR DANoObjetoNoTN > 0)"); + dtt = Objconta.DtResultados.FiltraParametros("CveCompra is null and CveProveedor > 0 AND ( ActosFN > 0 OR ActosFS > 0 OR Actos16 > 0 OR ActosImp16 > 0 OR ActosImpNotan16 > 0 OR DATasa0 > 0 OR DANoObjetoTN > 0 OR DANoObjetoNoTN > 0 OR NoAcredFN > 0 OR NoAcredNoFN > 0)"); //acumula los prov, globales en un solo registro dtt = AcumularYReemplazar(dtt); diff --git a/Empresas/153/Formatos/Factura.rdlc b/Empresas/153/Formatos/Factura.rdlc index e44358833..6803ae6a7 100644 --- a/Empresas/153/Formatos/Factura.rdlc +++ b/Empresas/153/Formatos/Factura.rdlc @@ -1471,7 +1471,7 @@ - CAMELIA 619 LIBERTAD HERMOSILLO + SIMON BLEY 355, COL. OLIVARES @@ -140,13 +497,7 @@ - - - - - - - +
    @@ -175,6 +526,11 @@
    +
    +
    +
    +
    +

    @@ -1617,7 +1973,16 @@ <%----%> - + +<%-- --%> + +<%-- + + + + --%> + + + <%: Scripts.Render("~/Metronic/assets/global/scripts/JS") %> + <%: Scripts.Render("~/bundles/highcharts") %> + +