From 08da5d27e5cec57ec7bdc049b5d9feea5de7ae87 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 10 Apr 2025 07:19:37 -0700 Subject: [PATCH 1/8] - colorear celda de vencimiento, sino cuadra con el vencimiento del proveedor --- Bancos/ProveedoresAbonar.aspx.vb | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index a74d504d2..580c82fb1 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -94,6 +94,14 @@ Partial Class Bancos_ProveedoresAbonar ViewState("CveAplicaNC") = value End Set End Property + Private Property ProveedorPlazoPago As Integer + Get + Return ViewState("ProveedorPlazoPago").ToString.ToEntero + End Get + Set(value As Integer) + ViewState("ProveedorPlazoPago") = value + End Set + End Property Private Property CveMoneda As Integer Get @@ -468,6 +476,7 @@ Partial Class Bancos_ProveedoresAbonar TxtImporte.Attributes.Add("disabled", "disabled") If DdlTipoTransaccion.SelectedValue = "1" Then RFVFolio.Enabled = True Else RFVFolio.Enabled = False TxtNotificarA.Text = $"{ObjProveedor.NotificarA.Trim}" + ProveedorPlazoPago = ObjProveedor.PlazoPago If ObjProveedor.CorreoCobranza.Trim <> "" Then TxtNotificarA.Text = $"{TxtNotificarA.Text};{ObjProveedor.CorreoCobranza.Trim}" 'Sección de pago a proveedor @@ -525,6 +534,11 @@ Partial Class Bancos_ProveedoresAbonar e.Row.FCTextBox("TxtAbonar").Attributes.Add("onblur", String.Format(" RNCAutocheck = true; FnCambia({0},this,{1},1,'{2}',1);", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo"), "El Importe no debe de exceder el saldo")) e.Row.FCTextBox("TxtComision").Attributes.Add("onblur", String.Format(" RNCAutocheck = true;FnCambia({0},this,{1},2,'{2}',2);", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo"), "El Importe no debe de exceder el saldo")) End If + 'si el vencimiento es diferente al configurado en el proveedor, se pone en rojo + If DateDiff(DateInterval.Day, e.Row.DBCampo("Fecha").ToDate, e.Row.DBCampo("FechaVencimiento").ToDate) <> ProveedorPlazoPago Then + e.Row.Cells(6).ForeColor = Drawing.Color.Red + e.Row.Cells(6).ToolTip = $"Dias de Vencimiento ({DateDiff(DateInterval.Day, e.Row.DBCampo("Fecha").ToDate, e.Row.DBCampo("FechaVencimiento").ToDate)}) diferente al configurado en el proveedor ({ProveedorPlazoPago})" + End If If e.Row.DBCampo("Saldo").ToDouble < 0 Then e.Row.Cells(7).ForeColor = Drawing.Color.Red If e.Row.DBCampo("DiasVencidos").ToDouble > 0 AndAlso CType(sender, GridView).ID = "GvCxC" Then e.Row.Cells(4).ForeColor = Drawing.Color.Red @@ -581,15 +595,10 @@ Partial Class Bancos_ProveedoresAbonar e.Row.FCTextBox("TxtAbonar").Enabled = True End If End If - End If - - e.Row.FCLiteral("LtlAux").Text = String.Format("Ir", e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveCompra")) e.Row.FCTextBox("TxtAbonar").Attributes.Add("onblur", String.Format(" RNCAutocheck = true; FnCambia({0},this,{1},1,'{2}',1);{3}", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo"), "El Importe no debe de exceder el saldo", FiltroInv)) - - If Not PermiteModificarImporte Then e.Row.FCTextBox("TxtAbonar").Enabled = False If e.Row.DBCampo("CveCompraNC").ToEntero > 0 Then e.Row.FCHyperLink("HplNC").Visible = True @@ -622,11 +631,9 @@ Partial Class Bancos_ProveedoresAbonar If UsuarioActual.Empresa.Funcionalidad(306) = "1" And e.Row.DBCampo("AplicaNotaCredito").ToString = "True" Then e.Row.FCCheckBox("Chk").Enabled = False End If - e.Row.FCTextBox("TxtDescuento").Attributes.Add("onkeyup", $" calculaDescuentoEscalonado({e.Row.DBCampo("Saldo")},'{e.Row.FCTextBox("TxtDescuento").ClientID}',{e.Row.FCTextBox("TxtAbonar").ClientID},{e.Row.FCCheckBox("Chk").ClientID},'El Importe no debe de exceder el saldo',1)") Else e.Row.FCTextBox("TxtDescuento").Visible = False - End If End If End Sub From 27c4ffb4e2e6b214a1d825aa30abb7529c4ec247 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Thu, 10 Apr 2025 10:01:18 -0700 Subject: [PATCH 2/8] Compras CveUsuario ala ctualizr fecha vencimiento, ajustes Nom043 --- Agropecuaria/RepPreciosVentaManifiesto.aspx | 40 +- .../RepPreciosVentaManifiesto.aspx.vb | 6 +- App_Code/ClsCompras.vb | 9 +- App_Code/ClsPaginas.vb | 2 + App_Code/ClsVentas.vb | 28 +- Ashx/E158.ashx | 26 +- Compras/Compras.aspx.vb | 11 +- Compras/eFacturas.aspx.vb | 11 + .../Grales/Formatos/CartaPorteTimbrado.rdlc | 1329 ++++++++++++++++- 9 files changed, 1353 insertions(+), 109 deletions(-) diff --git a/Agropecuaria/RepPreciosVentaManifiesto.aspx b/Agropecuaria/RepPreciosVentaManifiesto.aspx index ff5db5faa..4d439724d 100644 --- a/Agropecuaria/RepPreciosVentaManifiesto.aspx +++ b/Agropecuaria/RepPreciosVentaManifiesto.aspx @@ -176,13 +176,13 @@ font-size: 12px;
-
+
Fecha Inicio:
-
- +
+ @@ -191,13 +191,13 @@ font-size: 12px;
-
+
Fecha Fin:
-
- +
+ @@ -206,13 +206,10 @@ font-size: 12px;
-
-
+
+
Consultar -
-
- Agregar -
+
@@ -224,6 +221,21 @@ font-size: 12px;
+
+
+ +
+
+ +
+
+
+ " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
+ +
+
@@ -335,8 +347,8 @@ font-size: 12px;
-
- +
+ diff --git a/Agropecuaria/RepPreciosVentaManifiesto.aspx.vb b/Agropecuaria/RepPreciosVentaManifiesto.aspx.vb index 4de8fd0db..e413df747 100644 --- a/Agropecuaria/RepPreciosVentaManifiesto.aspx.vb +++ b/Agropecuaria/RepPreciosVentaManifiesto.aspx.vb @@ -142,7 +142,7 @@ Partial Class Agrupecuaria_RepPreciosVentaManifiesto Dim ObjVentas As New ClsVentas If ObjVentas.GetCultivos(-1, UsuarioActual.CveEmpresa) Then - DdlModalCultivo.DataSource = ObjVentas.DtResultados + DdlModalCultivo.DataSource = ObjVentas.DtResultados.FiltraParametros("", "Cultivo") Else DdlModalCultivo.DataSource = Nothing End If @@ -163,7 +163,7 @@ Partial Class Agrupecuaria_RepPreciosVentaManifiesto Dim objVentas As New ClsVentas If objVentas.GetCultivosVariedad(CveCultivo, -1, UsuarioActual.CveEmpresa) Then - DdlModalCultivoVariedad.DataSource = objVentas.DtResultados + DdlModalCultivoVariedad.DataSource = objVentas.DtResultados.FiltraParametros("", "CultivoVariedad") End If objVentas.Dispose() @@ -182,7 +182,7 @@ Partial Class Agrupecuaria_RepPreciosVentaManifiesto Dim objVentas As New ClsVentas If objVentas.GetEmbarqueTamaño(-1, -1, UsuarioActual.CveEmpresa) Then - DdlModalTamaño.DataSource = objVentas.DtResultados + DdlModalTamaño.DataSource = objVentas.DtResultados.FiltraParametros("", "Tamaño") End If objVentas.Dispose() diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index ae6256b6b..ca454e46a 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -4,7 +4,7 @@ Option Strict On Imports System.Data Imports System.Data.SqlClient Imports Extensiones -Imports iText.StyledXmlParser.Css.Resolve.Shorthand.Impl + Public Class ClsCompras Implements IDisposable @@ -200,7 +200,7 @@ Public Class ClsCompras Optional AplicoPromocion As Boolean = False, Optional PorcentajeIVA As Decimal = 0, Optional CveMetodoPago As Integer = -1, Optional CveRetIVAConcepto As Integer = -1, Optional CveConceptoContableAlmacen As Integer = -1, Optional CveRetISRConcepto As Integer = -1, Optional NoDeducible As Integer = 0, Optional CveTipoCompra As Integer = -1, Optional TotalOriginal As Decimal = 0, Optional CveTipoConcepto As Integer = 1, Optional CveFactura As Integer = -1, Optional CveContrato As Integer = -1, Optional EsImportacion As Boolean = False, Optional CveSubProyecto As Integer = -1, Optional DoctosRelacionados As String = "-1", Optional CveFolioGarantia As Integer = -1, - Optional CveCompraRelacionada As Integer = -1) As Boolean + Optional CveCompraRelacionada As Integer = -1) As Boolean Dim Retorno As Boolean = False @@ -256,7 +256,7 @@ Public Class ClsCompras .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@DoctosRelacionados", SqlDbType.VarChar).Value = DoctosRelacionados .Add("@CveFolioGarantia", SqlDbType.Int).Value = CveFolioGarantia - .Add("@CveCompraRelacionada", SqlDbType.Int).Value = CveCompraRelacionada + .Add("@CveCompraRelacionada", SqlDbType.Int).Value = CveCompraRelacionada End With Try @@ -3250,13 +3250,14 @@ Public Class ClsCompras Return Retorno End Function - Public Function UpdateFechaVencimientoCompra(CveCompra As Integer, FechaVencimiento As Date, CveEmpresa As Integer) As Boolean + Public Function UpdateFechaVencimientoCompra(CveCompra As Integer, FechaVencimiento As Date, CveEmpresa As Integer, CveUsuario As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Comp_ComprasFechaVencimientoUpdate") With SqlAdapter.SelectCommand.Parameters .Add("@CveCompra", SqlDbType.Int).Value = CveCompra .Add("@FechaVencimiento", SqlDbType.Date).Value = FechaVencimiento .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 8e1b2afe6..2f9873a89 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -6269,6 +6269,7 @@ Public Class ClsPaginas DtMercancias.Columns.Add(New DataColumn("PesoEnKg", GetType(String))) DtMercancias.Columns.Add(New DataColumn("CveMaterialPeligroso", GetType(String))) + DtMercancias.Columns.Add(New DataColumn("MaterialPeligroso", GetType(String))) DtMercancias.Columns.Add(New DataColumn("Embalaje", GetType(String))) DtMercancias.Columns.Add(New DataColumn("SectorCOFEPRIS", GetType(String))) @@ -6461,6 +6462,7 @@ Public Class ClsPaginas Row("PesoEnKg") = ValorXML(node, "PesoEnKg", "") Row("CveMaterialPeligroso") = ValorXML(node, "CveMaterialPeligroso", "") + Row("MaterialPeligroso") = If(ValorXML(node, "MaterialPeligroso", "").ToUpper() = "SÍ", "Sí", "No") Row("Embalaje") = ValorXML(node, "Embalaje", "") Row("SectorCOFEPRIS") = ValorXML(node, "SectorCOFEPRIS", "") diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index dee1cabf4..52f588e8d 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -7717,6 +7717,32 @@ Public Class ClsVentas Return Retorno End Function + Public Function AddPreciosVentaManifiesto(CveCultivo As Integer, CveTamaño As Integer, CveCultivoVariedad As Integer, Referencia As String, LdDate As Date, InvDate As Date, PDDate As Date, CantidadVendida As Decimal, PUVenta As Decimal, Observaciones As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Agro_PreciosVentaManifiestoAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCultivo", SqlDbType.Int).Value = CveCultivo + .Add("@CveTamaño", SqlDbType.Int).Value = CveTamaño + .Add("@CveCultivoVariedad", SqlDbType.Int).Value = CveCultivoVariedad + .Add("@Referencia", SqlDbType.VarChar).Value = Referencia + .Add("@LdDate", SqlDbType.Date).Value = LdDate + .Add("@InvDate", SqlDbType.Date).Value = InvDate + .Add("@PDDate", SqlDbType.Date).Value = PDDate + .Add("@CantidadVendida", SqlDbType.Money).Value = CantidadVendida + .Add("@PUVenta", SqlDbType.Money).Value = PUVenta + .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones + .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 datos de manifiesto de ventaa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + 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 @@ -7733,7 +7759,7 @@ Public Class ClsVentas SqlAdapter.Fill(Data) Retorno = True Catch ex As Exception - OnError("Ocurrió un error al obtener los indicadores de venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + OnError("Ocurrió un error al obtener los datos de manifiesto de venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try Return Retorno diff --git a/Ashx/E158.ashx b/Ashx/E158.ashx index 9ca13d1cc..84e067e77 100644 --- a/Ashx/E158.ashx +++ b/Ashx/E158.ashx @@ -23,6 +23,7 @@ Imports System.Xml Imports System.Diagnostics Imports System.Drawing Imports System.Drawing.Imaging +Imports System.ComponentModel @@ -93,9 +94,28 @@ Public Class E158 : Implements IHttpHandler, IReadOnlySessionState Dim Parametro6 As Integer = 0 Dim Parametro6Date As Date = Now.AddDays(-3) - 'Dim DTresp As DataTable = wsservice.GetSales(Parametro1, Parametro2, Parametro3, Parametro4, Parametro5, Parametro6) + Dim DTresp As DataTable = wsservice.GetSales(Parametro1, Parametro2, Parametro3, Parametro4, Parametro5, Parametro6) + DTresp.WriteXml("C:\temp\GrowerService\Sales.xml", XmlWriteMode.WriteSchema) + DTresp.FiltraParametros("", "", {"CommodityDesc"}).WriteXml("C:\temp\GrowerService\CommodityDesc.xml", XmlWriteMode.WriteSchema) + DTresp.FiltraParametros("", "", {"VarietyDesc"}).WriteXml("C:\temp\GrowerService\VarietyDesc.xml", XmlWriteMode.WriteSchema) + DTresp.FiltraParametros("", "", {"SizeDesc"}).WriteXml("C:\temp\GrowerService\SizeDesc.xml", XmlWriteMode.WriteSchema) + + + + 'For Each dRow As DataRow In DTresp.Rows + + 'Next + + 'Dim ObjVentas As New ClsVentas + + 'If ObjVentas.AddPreciosVentaManifiesto() Then + + 'End If + + 'ObjVentas.Dispose() '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) @@ -107,8 +127,8 @@ Public Class E158 : Implements IHttpHandler, IReadOnlySessionState '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 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 diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index a948d5b24..da286e2b8 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -15136,11 +15136,6 @@ Partial Class Compras_Compras End If - Dim DiasCreditoOCActual As Integer = DTOCTemp.FiltroPrimeroValor("DiasCreditoOC").ToEntero - - If DiasCreditoOCActual > DiasCredito Then - DiasCredito = DiasCreditoOCActual - End If IvaAcumulado += ObjOC.DtResultados.Rows(0)("IVA").ToString.ToDouble @@ -15263,10 +15258,6 @@ Partial Class Compras_Compras DivOCPromocion.Visible = True End If - If DiasCredito > 0 Then - TxtFechaPago.Text = Now.AddDays(DiasCredito).ToString("dd/MM/yyyy") - UPCondicionesPago.Update() - End If 'CARGA DATOS DE OC CargaVinculacionOC(True) @@ -21048,7 +21039,7 @@ Partial Class Compras_Compras Exit Sub End If - If ObjComp.UpdateFechaVencimientoCompra(CveCompra, TxtFechaPago.Text.ToDate, UsuarioActual.CveEmpresa) Then + If ObjComp.UpdateFechaVencimientoCompra(CveCompra, TxtFechaPago.Text.ToDate, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then Alert("Fecha de pago actualizada correctamente.") End If diff --git a/Compras/eFacturas.aspx.vb b/Compras/eFacturas.aspx.vb index 55db2884b..95591bce5 100644 --- a/Compras/eFacturas.aspx.vb +++ b/Compras/eFacturas.aspx.vb @@ -1167,6 +1167,17 @@ Partial Class Compras_eFacturas ' End If 'End If + Dim Funcionalidad123 As Integer = UsuarioActual.Empresa.Funcionalidad(123).ToEntero + If Funcionalidad123 > 0 Then + If NowADS().Day >= Funcionalidad123 Then + Dim FechaLimite As Date = New Date(NowADS().Year, NowADS().Month, 1) + If e.Row.DBCampo("FechaFactura").ToDate < FechaLimite Then + e.Row.FCHyperLink("HplAgregar").Visible = False + End If + End If + End If + + e.Row.FCCheckBox("chkRegistraFactura").Attributes.Add("onclick", "ChkRegsitraFacturas()") End If diff --git a/Empresas/Grales/Formatos/CartaPorteTimbrado.rdlc b/Empresas/Grales/Formatos/CartaPorteTimbrado.rdlc index c12514aa1..1d74af708 100644 --- a/Empresas/Grales/Formatos/CartaPorteTimbrado.rdlc +++ b/Empresas/Grales/Formatos/CartaPorteTimbrado.rdlc @@ -105,6 +105,10 @@ CveMaterialPeligroso System.String + + MaterialPeligroso + System.String + Embalaje System.String @@ -301,13 +305,16 @@ 8.04092cm - 2.60983cm + 2.00481cm 1.90464cm - 2.35479cm + 1.59235cm + + + 1.38195cm @@ -526,6 +533,48 @@ + + + + true + true + + + + + =Fields!MaterialPeligroso.Value + + + + + + + MaterialPeligroso + + + + + 1pt + + + + + 2pt + 2pt + 2pt + 2pt + + + + @@ -732,6 +781,46 @@ + + + 0.52062cm + + + true + true + + + + + Peligroso + + + + + + + Textbox53 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + + @@ -795,9 +884,9 @@ true DataSet3 8.7754cm - 0.38395cm + 0.40259cm 1.12062cm - 19.15904cm + 19.17353cm @@ -4957,7 +5046,7 @@ - transporte + transporte @@ -5387,7 +5476,7 @@ Textbox57 - 12.60522cm + 12.57347cm 5.80743cm 1.99491cm 4.05859cm @@ -5558,7 +5647,6 @@ CERTIFICADO DE ARRUMAZÓN DEL CONTENEDOR/VEHÍCULO Declaro que las mercancías descritas más arriba han sido arrumadas/cargadas en el contenedor/vehículo de conformidad con el IMDG. - POR CADA CARGA DEL CONTENEDOR/VEHÍCULO LA PERSONA RESPONSABLE DE LA ARRUMAZÓN/CARGA HA DE LLENAR Y FIRMAR ESTA SECCIÓN. + + + + + + + + + + + + + + + + + ___________________________ + + + + + + + + + + + + + + Textbox57 14.60013cm 1.35021cm - 2.92513cm + 3.54602cm 8.52539cm 27 + + + + + + + + + + + + + + + + + + + + ___________________________ + + + + + + + + + + + + + + Textbox57 14.60013cm 9.86956cm - 2.92513cm + 3.54602cm 9.31662cm 28 - 21.86398cm + 22.49898cm 1.5cm 0cm 3.90544cm @@ -6156,7 +6374,7 @@ Se ha recibido el número arriba indicado de bultos/contenedores/remolques/autot - 21.86398cm + 22.49898cm 9.94339cm 0cm 3.90544cm @@ -6168,8 +6386,8 @@ Se ha recibido el número arriba indicado de bultos/contenedores/remolques/autot - 21.86398cm - 14.68568cm + 22.49898cm + 14.71743cm 0cm 3.90544cm 43 @@ -6197,7 +6415,7 @@ Se ha recibido el número arriba indicado de bultos/contenedores/remolques/autot Textbox120 - 22.10051cm + 22.67201cm 1.36431cm 0.45969cm 10.17692cm @@ -6212,11 +6430,85 @@ Se ha recibido el número arriba indicado de bultos/contenedores/remolques/autot 2pt + + true + true + + + + + =Parameters!SerieFolio.Value + + + + + + + SerieFolio + 0.67478cm + 15.20438cm + 0.6cm + 3.97474cm + 45 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + + =Parameters!FechaCertificacion.Value + + + + + + + SerieFolio + 1.45117cm + 15.20438cm + 0.6cm + 3.97474cm + 46 + + + 2pt + 2pt + 2pt + 2pt + + true 23.161cm - 0.02115cm - 22.5602cm + 0.03979cm + 23.1317cm 19.53633cm 29 @@ -6437,7 +6729,7 @@ Se ha recibido el número arriba indicado de bultos/contenedores/remolques/autot true 19.47094cm - 0.10398cm + 0.12262cm 3.556cm 19.66645cm 30 @@ -6447,11 +6739,900 @@ Se ha recibido el número arriba indicado de bultos/contenedores/remolques/autot + + + + + End + + true + 0.46378cm + 0.10353cm + 18.12737cm + + + + + + External + =Parameters!LogoPath.Value + FitProportional + 0.20936cm + 0.19973in + 0.76284in + 1.18285in + 1 + + + + + + true + true + + + + + Transporte de mercancías peligrosas + + + + + + + + + NOM-043-SCT-SEMAR-ARTF-2023 + + + + + + + Textbox2 + 0.20936cm + 5.26408cm + 0.94606cm + 9.73471cm + 2 + + + + true + + + + + 1. Expedidor + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + 2. Número del documento de transporte + + + + =Parameters!SerieFolio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + 3. Página 2 de 2 Páginas + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Referencia del expedidor + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Referencia del expedidor de la carga + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + 7. Porteador/Transportista (debe llenarlo el porteador/transportista) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + 6. Destinatario + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + 1.94544cm + + + 9.84993cm + + + 2.13881cm + + + 1.84139cm + + + 2.05903cm + + + + + 0.66035cm + + + + + true + true + + + + + 14 Marcas de + + + + + + + + + transporte + + + + + + + Textbox84 + + + + + + + + + + true + true + + + + + *Número y tipo de bultos: + + + + + + + + + Descripción de la mercancia + + + + + + + Textbox86 + + + + + + + + + + true + true + + + + + Peso Bruto (kg) + + + + + + + Textbox88 + + + + + + + + + + true + true + + + + + PesoNeto(Kg) + + + + + + + Textbox90 + + + + + + + + + + true + true + + + + + Volumen (m3) + + + + + + + Textbox92 + + + + + + + + + + 0.33965cm + + + + + true + true + + + + + Si + + + + + + + + + + + + + true + true + + + + + =Fields!Descripcion.Value + + + + + + + + + + + + + true + true + + + + + =Fields!PesoEnKg.Value + + + + + + + + + + + PesoEnKg1 + + + + + + + + + + true + true + + + + + =Fields!PesoEnKg.Value + + + + + + + + + + + PesoEnKg3 + + + + + + + + + + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + After + + + + + + + DataSet3 + 0.06703cm + 1cm + 17.8346cm + + + + + + true + 4.45047cm + 1.33863cm + 1.06703cm + 17.8346cm + 11 + + + + + + true + true + + + + + =Parameters!SerieFolio.Value + + + + + + + SerieFolio + 0.67478cm + 15.20438cm + 0.6cm + 3.97474cm + 12 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + + =Parameters!FechaCertificacion.Value + + + + + + + SerieFolio + 1.45117cm + 15.20438cm + 0.6cm + 3.97474cm + 13 + + + 2pt + 2pt + 2pt + 2pt + + + + true + 47.03985cm + 5.54925cm + 19.53633cm + 31 + + =Microsoft.VisualBasic.Interaction.IIF(Parameters!imprmirNom043.Value = "1", False, True) + + + + + - 18.0263in + 20.70437in @@ -129,6 +135,7 @@ font-size: 12px; + @@ -253,12 +260,12 @@ font-size: 12px; - + - + diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 52f588e8d..ba52a899c 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -7717,10 +7717,11 @@ Public Class ClsVentas Return Retorno End Function - Public Function AddPreciosVentaManifiesto(CveCultivo As Integer, CveTamaño As Integer, CveCultivoVariedad As Integer, Referencia As String, LdDate As Date, InvDate As Date, PDDate As Date, CantidadVendida As Decimal, PUVenta As Decimal, Observaciones As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Public Function AddPreciosVentaManifiesto(PalletNum As String, CveCultivo As Integer, CveTamaño As Integer, CveCultivoVariedad As Integer, Referencia As String, LdDate As Date, InvDate As Date, PDDate As Date, CantidadVendida As Decimal, PUVenta As Decimal, Observaciones As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Agro_PreciosVentaManifiestoAdd") With SqlAdapter.SelectCommand.Parameters + .Add("@PalletNum", SqlDbType.VarChar).Value = PalletNum .Add("@CveCultivo", SqlDbType.Int).Value = CveCultivo .Add("@CveTamaño", SqlDbType.Int).Value = CveTamaño .Add("@CveCultivoVariedad", SqlDbType.Int).Value = CveCultivoVariedad @@ -7770,7 +7771,6 @@ Public Class ClsVentas 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 diff --git a/Ashx/E158.ashx b/Ashx/E158.ashx index 84e067e77..cc6b92bc6 100644 --- a/Ashx/E158.ashx +++ b/Ashx/E158.ashx @@ -77,8 +77,8 @@ Public Class E158 : Implements IHttpHandler, IReadOnlySessionState 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) + Dim Respuesta As Boolean = True + Dim UsuarioActual As Usuario = ValidaUsuarioSistema(100, CveEmpresa) ' Crear una instancia del servicio web Dim wsservice As New GrowerService.Service() @@ -94,13 +94,120 @@ Public Class E158 : Implements IHttpHandler, IReadOnlySessionState 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) - DTresp.FiltraParametros("", "", {"CommodityDesc"}).WriteXml("C:\temp\GrowerService\CommodityDesc.xml", XmlWriteMode.WriteSchema) - DTresp.FiltraParametros("", "", {"VarietyDesc"}).WriteXml("C:\temp\GrowerService\VarietyDesc.xml", XmlWriteMode.WriteSchema) - DTresp.FiltraParametros("", "", {"SizeDesc"}).WriteXml("C:\temp\GrowerService\SizeDesc.xml", XmlWriteMode.WriteSchema) + Dim DTresp As DataTable = wsservice.GetSales(Parametro1, Parametro2, Parametro3, Parametro4, Parametro5, Parametro6) + 'DTresp.WriteXml("C:\temp\GrowerService\Sales.xml", XmlWriteMode.WriteSchema) + 'DTresp.FiltraParametros("", "", {"CommodityDesc"}).WriteXml("C:\temp\GrowerService\CommodityDesc.xml", XmlWriteMode.WriteSchema) + 'DTresp.FiltraParametros("", "", {"VarietyDesc"}).WriteXml("C:\temp\GrowerService\VarietyDesc.xml", XmlWriteMode.WriteSchema) + 'DTresp.FiltraParametros("", "", {"SizeDesc"}).WriteXml("C:\temp\GrowerService\SizeDesc.xml", XmlWriteMode.WriteSchema) + + + DTresp.Columns.Add("InvoiceDateReal", GetType(DateTime)) + + For Each row As DataRow In DTresp.Rows + Dim fechaTexto As String = row("InvoiceDate").ToString().Trim() + + If DateTime.TryParseExact(fechaTexto, "MM/dd/yy", System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, Nothing) Then + row("InvoiceDateReal") = DateTime.ParseExact(fechaTexto, "MM/dd/yy", System.Globalization.CultureInfo.InvariantCulture) + Else + row("InvoiceDateReal") = DBNull.Value + End If + Next + + DTresp = DTresp.FiltraParametros(" InvoiceDateReal >= #01/01/2025# ") + + + Dim ObjVentas As New ClsVentas + Dim DTCultivo As New DataTable + Dim DTCultivoVariedad As New DataTable + Dim DTTamaño As New DataTable + + If ObjVentas.GetCultivos(-1, CveEmpresa) Then + DTCultivo = ObjVentas.DtResultados + Else + Respuesta = False + End If + + If ObjVentas.GetCultivosVariedad(-1, -1, CveEmpresa) Then + DTCultivoVariedad = ObjVentas.DtResultados + Else + Respuesta = False + End If + + If ObjVentas.GetEmbarqueTamaño(-1, -1, CveEmpresa) Then + DTTamaño = ObjVentas.DtResultados + Else + Respuesta = False + End If + + If Respuesta Then + ObjVentas.IniciaTransacSQL() + + For Each dRow As DataRow In DTresp.Rows + + Dim PalletNum As String = dRow("PalletNum").ToString + + Try + Dim CveCultivo As Integer = DTCultivo.FiltroPrimeroValor("CveCultivo", $" Alias = '{dRow("CommodityDesc").ToString}' ").ToEntero + If Not CveCultivo > 0 Then + GuardaLog($"No se encontro el cultivo {dRow("CommodityDesc").ToString}") + Exit For + End If + + Dim CveCultivoVariedad As Integer = DTCultivoVariedad.FiltroPrimeroValor("CveCultivoVariedad", $" Alias = '{dRow("VarietyDesc").ToString}' ").ToEntero + If Not CveCultivoVariedad > 0 Then + GuardaLog($"No se encontro la variedad {dRow("VarietyDesc").ToString}") + Exit For + End If + + Dim CveTamaño As Integer = DTTamaño.FiltroPrimeroValor("CveTamaño", $" Alias = '{dRow("SizeDesc").ToString.Replace("'", "''")}' ").ToEntero + If Not CveTamaño > 0 Then + GuardaLog($"No se encontro el tamaño {dRow("SizeDesc").ToString}") + Exit For + End If + + Dim LoadDate As Date = DateTime.ParseExact(dRow("LoadDate").ToString, "MM/dd/yy", System.Globalization.CultureInfo.InvariantCulture) + Dim InvoiceDate As Date = DateTime.ParseExact(dRow("InvoiceDate").ToString, "MM/dd/yy", System.Globalization.CultureInfo.InvariantCulture) + + Dim PaidDate As Date = MinFecha + If dRow("PaidDate").ToString.Trim.Length > 0 Then + PaidDate = DateTime.ParseExact(dRow("PaidDate").ToString, "MM/dd/yy", System.Globalization.CultureInfo.InvariantCulture) + End If + + + + If Not ObjVentas.AddPreciosVentaManifiesto(dRow("PalletNum").ToString, CveCultivo, CveTamaño, CveCultivoVariedad, dRow("GroReference").ToString, + LoadDate, InvoiceDate, PaidDate, + dRow("InvPkgs").ToString.ToDecimal, dRow("NetProdPrice").ToString.ToDecimal, dRow("ProductDesc").ToString, + UsuarioActual.CveUsuario, CveEmpresa) Then + Respuesta = False + Exit For + End If + + Catch ex As Exception + + GuardaLog($"Error PalletNum: {PalletNum} {ex.Message} --> {ex.StackTrace}") + Respuesta = False + + End Try + + + + Next + + + If Respuesta Then + ObjVentas.Commit() + Else + ObjVentas.RollBack() + End If + End If + + + + ObjVentas.Dispose() + 'For Each dRow As DataRow In DTresp.Rows diff --git a/Empresas/Grales/Formatos/CartaPorteTimbrado.rdlc b/Empresas/Grales/Formatos/CartaPorteTimbrado.rdlc index 1d74af708..38000e5c8 100644 --- a/Empresas/Grales/Formatos/CartaPorteTimbrado.rdlc +++ b/Empresas/Grales/Formatos/CartaPorteTimbrado.rdlc @@ -522,7 +522,7 @@ 1pt - + 1pt 2pt @@ -7356,6 +7356,9 @@ Se ha recibido el número arriba indicado de bultos/contenedores/remolques/autot Textbox85 + + =IIF(Fields!MaterialPeligroso.Value = "No",true,false) +