diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index 9adce918b..8793a64d3 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -1178,13 +1178,14 @@ Public Class ClsContabilidad End Function - Public Function ContabilizaDesContabilizaPrePoliza(CvePrePoliza As Integer, Contabilizar As Boolean, CveEmpresa As Integer) As Boolean + Public Function ContabilizaDesContabilizaPrePoliza(CvePrePoliza As Integer, Contabilizar As Boolean, CveEmpresa As Integer, Optional Folio As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Conta_PrePolizasContabilizarDescontabilizar") With SqlAdapter.SelectCommand.Parameters .Add("@CvePrePoliza", SqlDbType.Int).Value = CvePrePoliza .Add("@Contabilizar", SqlDbType.Bit).Value = Contabilizar .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Folio", SqlDbType.Int).Value = Folio .Add("@FolioPoliza", SqlDbType.Int).Direction = ParameterDirection.Output End With Try diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index aa5b2d3d0..3f2ff3384 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -3243,7 +3243,7 @@ Public Class ClsNominas Public Function GetLayoutAltaBanorte(CvePeriodo As Integer, CveEmpresa As Integer) As Boolean Dim retorno As Boolean = False - DataAdapter("PA_Nom_Dispersionnomina", CommandType.StoredProcedure) + DataAdapter("PA_Nom_LayoutAltaBanorteGet", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters .Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa @@ -3258,6 +3258,22 @@ Public Class ClsNominas End Function + Public Function GetDispersionNominaBanorte(CvePeriodo As Integer, CveEmpresa As Integer) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Nom_DispersionNominaBanorteGet", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el layout de nominas Banorte.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + #Region "IDisposable Support" ' IDisposable diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 928349284..e89ff7969 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -6356,16 +6356,34 @@ Public Class ClsPaginas Try bytes = bytes + + + 'Response.Clear() + 'Response.ContentType = "application/pdf" + 'Response.Cache.SetCacheability(HttpCacheability.Private) + 'Response.Expires = -1 + 'Response.Buffer = True + ''Uncomment to handle the file as attachment + 'Response.AddHeader("Content-Disposition", String.Format("inline; filename={0}.{1}", NombreArchivo, If(Formato = "PDF", "pdf", "xls"))) + ''Response.BinaryWrite(bytes) + 'bytes = Nothing + 'Response.End() + + Response.Buffer = True Response.Clear() - Response.ContentType = mimeType + If Formato = "PDF" Then + Response.ContentType = "application/pdf" + Else + Response.ContentType = mimeType + End If Response.AddHeader("content-disposition", String.Format("{0}; filename={1}.{2}", Content_Disposition, NombreArchivo, If(Formato = "PDF", "pdf", "xls"))) Response.BinaryWrite(bytes) ' create the file Response.Flush() ' send it to the client to download HttpContext.Current.Response.SuppressContent = True HttpContext.Current.ApplicationInstance.CompleteRequest() - HttpContext.Current.Response.End() bytes = Nothing + 'HttpContext.Current.Response.End() Catch ex As Exception If UsuarioActual.CveRol = 1 Then diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index eb50c7db8..92b0c29b6 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -4559,15 +4559,24 @@ Partial Class Bancos_IE Dim TipoMovimiento As Integer = 1 + Dim CveTipoTransaccionCancelacion As Integer = DdlTipoTransaccionCancelacion.SelectedValue.ToEntero + If ChkGeneraCancelacion.Checked AndAlso GeneraCancelacionEnCero Then GeneraCancelacionEnCero = False TipoMovimiento = 2 + + If DdlTipoTransaccionCancelacion.SelectedValue.ToEntero = -1 Then + CveTipoTransaccionCancelacion = 16 'Validacion manual para solo enviar el correcto + End If + End If + Dim CvePrePolizaCancelacion As Integer = 0 If Not GeneraCancelacionEnCero Then 'CANCELA IE MES ANTERIOR - CvePrePolizaCancelacion = Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, TipoMovimiento:=TipoMovimiento, CveTipoTransaccionCancelacion:=DdlTipoTransaccionCancelacion.SelectedValue.ToEntero) + CvePrePolizaCancelacion = Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, TipoMovimiento:=TipoMovimiento, + CveTipoTransaccionCancelacion:=CveTipoTransaccionCancelacion) If CvePrePolizaCancelacion <= 0 Then ErrorCancelar = True MensajeError = "Error al cancelar IE MES ANTERIOR" @@ -4582,7 +4591,8 @@ Partial Class Bancos_IE MensajeError = "Error al desbloquear prepoliza." Else 'CANCELA IE MES ACTUAL - CvePrePolizaCancelacion = Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, CveTipoTransaccionCancelacion:=DdlTipoTransaccionCancelacion.SelectedValue.ToEntero) + CvePrePolizaCancelacion = Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, + CveTipoTransaccionCancelacion:=CveTipoTransaccionCancelacion) If CvePrePolizaCancelacion <= 0 Then ErrorCancelar = True MensajeError = "Error al cancelar IE MES ACTUAL" @@ -4797,7 +4807,7 @@ Partial Class Bancos_IE Else 'siempre se hace una cancelación - If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaDevuelto.Text.ToDate, 2) <= 0 Then + If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaDevuelto.Text.ToDate, 2, 16) <= 0 Then ErrorCancelar = True End If diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 96d491d7a..276ae8b3c 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -4041,9 +4041,7 @@ Partial Class Compras_Compras Protected Sub BtnGuardar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnGuardar.Click - 'If Not AjustaCombustibles() Then - ' Exit Sub - 'End If + '------------------ INICIA VALIDACIONES ------------------ @@ -4465,6 +4463,10 @@ Partial Class Compras_Compras '------------------TERMINA VALIDACIONES------------------ + + + + 'si hay necesidad de actualizar el globaldtps If RegeneraPS Then 'Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDT) @@ -5922,7 +5924,10 @@ Partial Class Compras_Compras Dim IdCtaContable As Integer = 0 Dim Concepto As String = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, NombreProveedor, $"{TxtSerie.Text}-{TxtFolio.Text}", If(TxtDocumentoFolio.Visible, TxtDocumentoFolio.Text, If(TxtDocumentoFolioCaja.Visible, TxtDocumentoFolioCaja.Text, ConceptoPersonal))) Dim importeMN As Decimal = 0 - Dim Multiplicador As Integer = If(Row("Multiplicador").ToString.ToEntero = 1, 1, -1) + + Dim Multiplicador As Integer = If(Row("Multiplicador").ToString.ToEntero = 1, -1, 1) + + Dim Referencia As String = $"{TxtSerie.Text}-{TxtFolio.Text}" ' concatenation interpolation Dim PorcentajeImpuesto As Decimal = 0 CveConceptoOriginal = ConceptoContable @@ -8967,7 +8972,7 @@ Partial Class Compras_Compras IdCtaContable = 0 Dim Concepto As String = String.Format("{0}-{1}", TxtSerie.Text, TxtFolio.Text) Dim importeMN As Decimal = 0 - Dim Multiplicador As Integer = If(Row("Multiplicador").ToString.ToEntero = 1, 1, -1) + Dim Multiplicador As Integer = If(Row("Multiplicador").ToString.ToEntero = 1, -1, 1) Dim PorcentajeImpuesto As Decimal = 0 Dim ConceptoPartida As String = String.Format("{0}-{1}", TxtSerie.Text, TxtFolio.Text) @@ -10586,7 +10591,7 @@ Partial Class Compras_Compras Dim importeMovimiento As Decimal = 0 Dim IdCtaContable As Integer = 0 Dim importeMN As Decimal = 0 - Dim Multiplicador As Integer = If(Row("Multiplicador").ToString.ToEntero = 1, 1, -1) + Dim Multiplicador As Integer = If(Row("Multiplicador").ToString.ToEntero = 1, -1, 1) Dim Referencia As String = $"{TxtSerie.Text}-{TxtFolio.Text}" ' concatenation interpolation Select Case ConceptoContable diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index e18d8db03..27a2772a3 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -212,11 +212,15 @@ Partial Class PopUpVerFactura If Request("onlyPrint").ToString() = "manifiestoRemision" Then imprimirManifiestoRemision(Request("cveEmbarqueManifiesto").ToString.ToEntero()) End If + If Request("onlyPrint").ToString() = "manifiestoCartaPorte" Then + imprimirManifiestoCartaPorte(Request("cveEmbarqueManifiesto").ToString.ToEntero()) + End If End If End If End Sub + Private Sub imprimirManifiesto(cveEmbarqueManifiesto As Integer) Dim NoEmbarque As String = "" Dim Fecha As String = "" @@ -235,6 +239,8 @@ Partial Class PopUpVerFactura Dim NoKgManifiesto As String = "" Dim Mercado As String = "" Dim NoFactura As String = "" + Dim Cliente As String = "" + Dim Direccion As String = "" Dim LongitudCaja As String = "" Dim LineaTransportacion As String = "" @@ -254,6 +260,8 @@ Partial Class PopUpVerFactura If objnom.PA_AGRO_Embarque_ManifiestoGet(-1, -1, -1, cveEmbarqueManifiesto) And objnom.DtResultados.Rows.Count > 0 Then Dim row As DataRow = objnom.DtResultados.Rows(0) NoEmbarque = row("NoEmbarque").ToString() + Cliente = row("Cliente").ToString() + Direccion = row("Direccion").ToString() Fecha = String.Format("{0:dd/MM/yyyy}", row("Fecha")) SubProyecto = row("SubProyecto").ToString() AgenciaAduanalUSA = row("AgenciaAduanalUSA").ToString() @@ -288,6 +296,7 @@ Partial Class PopUpVerFactura NoPallets = objnom.DtResultados.Rows.Count.ToString() NoKgManifiesto = objnom.DtResultados.SUM("Peso").ToString("N2") NoBultos = objnom.DtResultados.SUM("NoCajas").ToString("N0") + tablaReporte = objnom.DtResultados End If End If @@ -295,6 +304,8 @@ Partial Class PopUpVerFactura End Using Dim params As New List(Of ReportParameter) params.Add(New ReportParameter("NoEmbarque", NoEmbarque)) + params.Add(New ReportParameter("Cliente", Cliente)) + params.Add(New ReportParameter("Direccion", Direccion)) params.Add(New ReportParameter("Fecha", Fecha)) params.Add(New ReportParameter("SubProyecto", SubProyecto)) params.Add(New ReportParameter("AgenciaAduanalUSA", AgenciaAduanalUSA)) @@ -335,8 +346,7 @@ Partial Class PopUpVerFactura ImprimirPDF("GPS/EmbarqueManifiesto.rdlc", lrds, params, "Manifesto") End Sub - - Private Sub imprimirManifiestoRemisionRemision(cveEmbarqueManifiesto As Integer) + Private Sub imprimirManifiestoRemision(cveEmbarqueManifiesto As Integer) Dim NoEmbarque As String = "" Dim Fecha As String = "" Dim SubProyecto As String = "" @@ -361,6 +371,8 @@ Partial Class PopUpVerFactura Dim RPC As String = "" Dim BINSDECARTON As String = "" Dim TotalDlls As String = "" + Dim Cliente As String = "" + Dim Direccion As String = "" @@ -382,6 +394,8 @@ Partial Class PopUpVerFactura If objnom.PA_AGRO_Embarque_ManifiestoGet(-1, -1, -1, cveEmbarqueManifiesto) And objnom.DtResultados.Rows.Count > 0 Then Dim row As DataRow = objnom.DtResultados.Rows(0) NoEmbarque = row("NoEmbarque").ToString() + Cliente = row("Cliente").ToString() + Direccion = row("Direccion").ToString() Fecha = String.Format("{0:dd/MM/yyyy}", row("Fecha")) DivisoresdeCarton = String.Format("{0:N0}", row("DivisoresdeCarton")) BolsasdePlastico = String.Format("{0:N0}", row("BolsasdePlastico")) @@ -389,6 +403,7 @@ Partial Class PopUpVerFactura CAJASDECARTON = String.Format("{0:N0}", row("CAJASDECARTON")) RPC = String.Format("{0:N0}", row("RPC")) BINSDECARTON = String.Format("{0:N0}", row("BINSDECARTON")) + TotalDlls = String.Format("{0:N0}", row("TotalDlls")) @@ -402,7 +417,7 @@ Partial Class PopUpVerFactura Camion = String.Format("{0} {1}", row("CamEspecificacion"), row("CamAnio")) Rem1Placa = row("Rem1Placa").ToString() NoFactura = row("NoFactura").ToString() - Remolque1 = String.Format("{0} ", row("NumeroTrailer"), row("Rem1Anio")) + Remolque1 = String.Format("{0} ", row("NumeroTrailer")) Mercado = If(row("CveDestino").ToString() = "2", "Extranjero", "Nacional") NumeroTrailer = String.Format("No. {0}", row("NumeroTrailer").ToString()) @@ -432,6 +447,8 @@ Partial Class PopUpVerFactura End Using Dim params As New List(Of ReportParameter) params.Add(New ReportParameter("NoEmbarque", NoEmbarque)) + params.Add(New ReportParameter("Cliente", Cliente)) + params.Add(New ReportParameter("Direccion", Direccion)) params.Add(New ReportParameter("Fecha", Fecha)) params.Add(New ReportParameter("SubProyecto", SubProyecto)) params.Add(New ReportParameter("AgenciaAduanalUSA", AgenciaAduanalUSA)) @@ -476,8 +493,178 @@ Partial Class PopUpVerFactura lrds.Add(rds) '"Empresas/Grales/Formatos/EquiposGPS.rdlc" '"D:\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc" - ImprimirPDF("GPS/EmbarqueManifiestoRemision.rdlc", lrds, params, "Manifesto") + ImprimirPDF("GPS/EmbarqueManifiestoRemision.rdlc", lrds, params, "Remisión") End Sub + + + Private Sub imprimirManifiestoCartaPorte(cveEmbarqueManifiesto As Integer) + Dim NoEmbarque As String = "" + Dim Fecha As String = "" + Dim SubProyecto As String = "" + Dim AgenciaAduanalUSA As String = "" + Dim AgenciaAduanalMEX As String = "" + Dim Temperatura As String = "" + Dim Hora As String = "" + Dim Chofer As String = "" + Dim CamPlaca As String = "" + Dim Camion As String = "" + Dim Rem1Placa As String = "" + Dim Remolque1 As String = "" + Dim NoPallets As String = "" + Dim NoBultos As String = "" + Dim NoKgManifiesto As String = "" + Dim Mercado As String = "" + Dim NoFactura As String = "" + Dim DivisoresdeCarton As String = "" + Dim BolsasdePlastico As String = "" + Dim TapaderasdeCarton As String = "" + Dim CAJASDECARTON As String = "" + Dim RPC As String = "" + Dim BINSDECARTON As String = "" + Dim TotalDlls As String = "" + Dim Cliente As String = "" + Dim Direccion As String = "" + Dim Correo As String = "" + + + Dim LongitudCaja As String = "" + Dim LineaTransportacion As String = "" + Dim SCAC As String = "" + Dim CAAT As String = "" + Dim NumeroTrailer As String = "" + + + Dim tablaReporte As New DataTable + + 'Envase = "1 1/9" + 'Tamano = "Small" + 'Cultivo = "Tomate" + 'noPallet = "000001" + 'Variedad = "Golden" + Using objnom As New ClsNominas + If objnom.PA_AGRO_Embarque_ManifiestoGet(-1, -1, -1, cveEmbarqueManifiesto) And objnom.DtResultados.Rows.Count > 0 Then + Dim row As DataRow = objnom.DtResultados.Rows(0) + NoEmbarque = row("NoEmbarque").ToString() + Cliente = row("Cliente").ToString() + Direccion = row("Direccion").ToString() + Correo = row("Correo").ToString() + Fecha = String.Format("{0:dd/MM/yyyy}", row("Fecha")) + DivisoresdeCarton = String.Format("{0:N0}", row("DivisoresdeCarton")) + BolsasdePlastico = String.Format("{0:N0}", row("BolsasdePlastico")) + TapaderasdeCarton = String.Format("{0:N0}", row("TapaderasdeCarton")) + CAJASDECARTON = String.Format("{0:N0}", row("CAJASDECARTON")) + RPC = String.Format("{0:N0}", row("RPC")) + BINSDECARTON = String.Format("{0:N0}", row("BINSDECARTON")) + TotalDlls = String.Format("{0:N0}", row("TotalDlls")) + + + + SubProyecto = row("SubProyecto").ToString() + AgenciaAduanalUSA = row("AgenciaAduanalUSA").ToString() + AgenciaAduanalMEX = row("AgenciaAduanalMEX").ToString() + Temperatura = row("Temperatura").ToString() + Hora = String.Format("{0:hh }:{0:mm }:{0:ss tt}:", row("FechaIng")) + Chofer = row("Chofer").ToString() + CamPlaca = row("CamPlaca").ToString() + Camion = String.Format("{0} {1}", row("CamEspecificacion"), row("CamAnio")) + Rem1Placa = row("Rem1Placa").ToString() + NoFactura = row("NoFactura").ToString() + Remolque1 = String.Format("{0} ", row("NumeroTrailer")) + Mercado = If(row("CveDestino").ToString() = "2", "Extranjero", "Nacional") + + NumeroTrailer = String.Format("No. {0}", row("NumeroTrailer").ToString()) + + LongitudCaja = row("LongitudCaja").ToString() + LineaTransportacion = row("LineaTransportacion").ToString() + SCAC = row("SCAC").ToString() + CAAT = row("CAAT").ToString() + + 'If row("CveCamionRemolque1").ToString() = "1" Then + ' Rem1Placa = "12-TF-5E" + ' Remolque1 = "Remolque 1" + 'Else + ' Rem1Placa = "15-TF-7f" + ' Remolque1 = "Remolque 2" + + 'End If + + If objnom.PA_Agro_Embarque_PalletGet(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, cveEmbarqueManifiesto, -1) And objnom.DtResultados.Rows.Count > 0 Then + NoPallets = objnom.DtResultados.Rows.Count.ToString() + NoKgManifiesto = objnom.DtResultados.SUM("Peso").ToString("N2") + NoBultos = objnom.DtResultados.SUM("NoCajas").ToString("N0") + tablaReporte = objnom.DtResultados + End If + End If + 'Remolque 1 12-TF-5E' }, { cveCamion: 2, placa: 'Remolque 2 15-TF-7f + End Using + Dim params As New List(Of ReportParameter) + params.Add(New ReportParameter("NoEmbarque", NoEmbarque)) + params.Add(New ReportParameter("Cliente", Cliente)) + params.Add(New ReportParameter("Direccion", Direccion)) + params.Add(New ReportParameter("Fecha", Fecha)) + params.Add(New ReportParameter("SubProyecto", SubProyecto)) + params.Add(New ReportParameter("AgenciaAduanalUSA", AgenciaAduanalUSA)) + params.Add(New ReportParameter("AgenciaAduanalMEX", AgenciaAduanalMEX)) + params.Add(New ReportParameter("Temperatura", Temperatura)) + params.Add(New ReportParameter("Hora", Hora)) + params.Add(New ReportParameter("Chofer", Chofer)) + params.Add(New ReportParameter("CamPlaca", CamPlaca)) + params.Add(New ReportParameter("Camion", Camion)) + params.Add(New ReportParameter("Rem1Placa", Rem1Placa)) + params.Add(New ReportParameter("Remolque1", Remolque1)) + + + params.Add(New ReportParameter("LongitudCaja", LongitudCaja)) + params.Add(New ReportParameter("LineaTransportacion", LineaTransportacion)) + params.Add(New ReportParameter("SCAC", SCAC)) + params.Add(New ReportParameter("CAAT", CAAT)) + params.Add(New ReportParameter("NumeroTrailer", NumeroTrailer)) + + + params.Add(New ReportParameter("NoFactura", NoFactura)) + params.Add(New ReportParameter("Mercado", Mercado)) + params.Add(New ReportParameter("NoBultos", NoBultos)) + params.Add(New ReportParameter("NoPallets", NoPallets)) + params.Add(New ReportParameter("NoKgManifiesto", NoKgManifiesto)) + + + 'params.Add(New ReportParameter("DivisoresdeCarton", DivisoresdeCarton)) + 'params.Add(New ReportParameter("BolsasdePlastico", BolsasdePlastico)) + 'params.Add(New ReportParameter("TapaderasdeCarton", TapaderasdeCarton)) + 'params.Add(New ReportParameter("CAJASDECARTON", CAJASDECARTON)) + 'params.Add(New ReportParameter("RPC", RPC)) + 'params.Add(New ReportParameter("BINSDECARTON", BINSDECARTON)) + 'params.Add(New ReportParameter("TotalDlls", TotalDlls)) + + + + + + Dim lrds As New List(Of ReportDataSource) + Dim rds As New ReportDataSource With {.Name = "DataSet1", .Value = tablaReporte} + lrds.Add(rds) + '"Empresas/Grales/Formatos/EquiposGPS.rdlc" + '"D:\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc" + Dim pdf = StreamPDF("GPS/EmbarqueManifiestoCartaPorte.rdlc", lrds, params, "DatosCartaPorte") + + Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail) + LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.ArchivoBinario = pdf, .NombreArchivo = String.Format("{0}.pdf", "DatosCartaPorte")}) + + Dim ObjMail As New ClsSisMail() + + If ObjMail.SendMail(UsuarioActual.Empresa, Correo, "Datos carta porte", "", "", LSRutasMail) Then + 'ResultadoMail = 1 + Else + 'GuardaLogFacturacion($"No se envio el correo {Mail}, {Asunto}, {Cuerpo}, {MailCC},") + 'GuardaLogFacturacion($"Ruta XML {ArchivoXML}") + 'ResultadoMail = 3 + End If + ImprimirPDF("GPS/EmbarqueManifiestoCartaPorte.rdlc", lrds, params, "DatosCartaPorte", Content_Disposition:="inline") + + + End Sub + + Private Sub imprimirpallet2(cvePallet As Integer) Dim Envase As String = "" Dim Tamano As String = "" diff --git a/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb index 06170b6ba..d8176bb72 100644 --- a/Compras/Proveedores.aspx.vb +++ b/Compras/Proveedores.aspx.vb @@ -713,18 +713,36 @@ Partial Class Compras_Proveedores Dim Prefijo As String = If(XMLDoc.DocumentElement.Prefix = "", "cfd", XMLDoc.DocumentElement.Prefix) Dim cfdVer As String = "http://www.sat.gob.mx/cfd/3" Dim namespaces As New XmlNamespaceManager(XMLDoc.NameTable) - Dim nodo As XmlNode = XMLDoc.DocumentElement - If Prefijo.ToLower <> "cfdi" Then cfdVer = "http://www.sat.gob.mx/cfd/2" - namespaces.AddNamespace(Prefijo, cfdVer) + Dim nodo As XmlNode = XMLDoc.DocumentElement Dim Version As String = ValorXml(nodo, "Version") + + If Version = "3.2" Then + Prefijo = "cfd" + cfdVer = "http://www.sat.gob.mx/cfd/2" + ElseIf Version = "3.3" Then + cfdVer = "http://www.sat.gob.mx/cfd/3" + + Else ' se considera que es la version 4.0 + cfdVer = "http://www.sat.gob.mx/cfd/4" + End If + + + + 'If Prefijo.ToLower <> "cfdi" Then cfdVer = "http://www.sat.gob.mx/cfd/2" + namespaces.AddNamespace(Prefijo, cfdVer) + + + + + Dim node As XmlNode node = XMLDoc.SelectSingleNode(String.Format("//{0}:Emisor", Prefijo), namespaces) If node IsNot Nothing Then TxtRFC.Text = ValorXml(node, "rfc") - If Version = "3.3" Then + If Version = "3.3" Or Version = "4.0" Then TxtRazonSocial.Text = HttpUtility.HtmlDecode(ValorXml(node, "Nombre")) TxtNombreComercial.Text = HttpUtility.HtmlDecode(ValorXml(node, "Nombre")) ChkEstado.Checked = True diff --git a/Compras/eFacturas.aspx.vb b/Compras/eFacturas.aspx.vb index ca77c2250..c73ff32d0 100644 --- a/Compras/eFacturas.aspx.vb +++ b/Compras/eFacturas.aspx.vb @@ -1700,7 +1700,7 @@ Partial Class Compras_eFacturas RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalFacturas")) - asdasd + 'Alert(String.Format("Se cargaron {0} Facturas", Arreglo.Count), TipoMensaje.MsgInformacion) End Sub diff --git a/Contabilidad/RegPrePolizaS.aspx b/Contabilidad/RegPrePolizaS.aspx index 7fca6a232..b3c7a652c 100644 --- a/Contabilidad/RegPrePolizaS.aspx +++ b/Contabilidad/RegPrePolizaS.aspx @@ -88,9 +88,9 @@ Agregar Concepto -
  • - Crear a partir de -
  • +
  • + Crear a partir de +
  • @@ -156,8 +156,14 @@
    -
    - +
    + + + + + + +
    @@ -711,6 +717,8 @@ + diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index edc51400d..299004330 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -277,6 +277,21 @@ Partial Class ContabilidadC_RegPrePolizaS ValidaCrearAPartirDe() DvPlantilla.Visible = False UPPDocumento.Visible = False + + If UsuarioActual.Empresa.TipoContabilidad = 1 Then + + If Folio.ToEntero > 0 Then + BtnDescontabilizar.Visible = True + LnkFolioManual.Visible = False + Else + BtnDescontabilizar.Visible = False + LnkFolioManual.Visible = True + End If + + End If + + + Exit Sub ElseIf Request("CvePrePolizaOrigen") IsNot Nothing AndAlso IsNumeric(Request("CvePrePolizaOrigen")) AndAlso Request("CvePrePolizaOrigen").ToEntero > 0 Then @@ -2707,22 +2722,51 @@ Partial Class ContabilidadC_RegPrePolizaS Dim ObjConta As New ClsContabilidad - If IdPoliza > 0 Then 'si está bloqueada, lo desbloqueaprimero - ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) - End If + If UsuarioActual.Empresa.TipoContabilidad = 1 Then + + If Folio.ToEntero = 0 Then + + Dim FolioManual As Integer = If(TxtFolio.Text.ToEntero > 0, TxtFolio.Text.ToEntero, -1) + + + + If ObjConta.ContabilizaDesContabilizaPrePoliza(CvePrePoliza, True, UsuarioActual.CveEmpresa, Folio:=FolioManual) Then + + Alert($"Contabilizado Correctamente Folio { ObjConta.ContaFolio.ToString()}.", TipoMensaje.MsgInformacion) + + TxtFolio.Text = ObjConta.ContaFolio.ToString() + LnkFolioManual.Visible = False + UpPoliza.Update() + + End If - If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, pIDPoliza:=If(IdPoliza > 0, IdPoliza, -1), Concepto:=TxtConcepto.Text, Fecha:=TxtFechaDocumento.Text.ToDateTime()) Then - If UsuarioActual.Empresa.TipoContabilizacion = 1 Then - Alert(String.Format("Prepóliza contabilizada.

    Folio: {0} ", ObjConta.FolioPoliza), ModExtensiones.TipoMensaje.MsgInformacion) - Else - Alert(String.Format("Prepóliza contabilizada.

    Folio:Ver Póliza", ObjConta.ContaIdPoliza), ModExtensiones.TipoMensaje.MsgInformacion) End If Else - Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia) + + If IdPoliza > 0 Then 'si está bloqueada, lo desbloqueaprimero + ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) + End If + + If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, pIDPoliza:=If(IdPoliza > 0, IdPoliza, -1), Concepto:=TxtConcepto.Text, Fecha:=TxtFechaDocumento.Text.ToDateTime()) Then + If UsuarioActual.Empresa.TipoContabilizacion = 1 Then + Alert(String.Format("Prepóliza contabilizada.

    Folio: {0} ", ObjConta.FolioPoliza), ModExtensiones.TipoMensaje.MsgInformacion) + Else + Alert(String.Format("Prepóliza contabilizada.

    Folio:Ver Póliza", ObjConta.ContaIdPoliza), ModExtensiones.TipoMensaje.MsgInformacion) + End If + + Else + + Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia) + End If + End If + + + + ObjConta.Dispose() End Sub @@ -3171,13 +3215,38 @@ Partial Class ContabilidadC_RegPrePolizaS End Sub + + #End Region + Private Sub BtnDescontabilizar_Click(sender As Object, e As EventArgs) Handles BtnDescontabilizar.Click + + Dim ObjConta As New ClsContabilidad + + + If ObjConta.ContabilizaDesContabilizaPrePoliza(CvePrePoliza, False, UsuarioActual.CveEmpresa) Then + Alert("Descontabilizado Correctamente.", TipoMensaje.MsgInformacion) + TxtFolio.Text = "" + LnkFolioManual.Visible = True + End If + + ObjConta.Dispose() + + UpPoliza.Update() + End Sub + + Private Sub LnkFolioManual_Click(sender As Object, e As EventArgs) Handles LnkFolioManual.Click + + TxtFolio.Enabled = True + TxtFolio.Focus() + UpPoliza.Update() + + End Sub End Class diff --git a/CxC/RepCxCDetalle.aspx.vb b/CxC/RepCxCDetalle.aspx.vb index 12c5b1dec..dc9a65081 100644 --- a/CxC/RepCxCDetalle.aspx.vb +++ b/CxC/RepCxCDetalle.aspx.vb @@ -910,8 +910,13 @@ Partial Class RepCxCDetalle 'End If Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + Dim logouri As String = "" + If Imagen.Exists Then + logouri = String.Format("file://{0}", Imagen.FullName) + End If + + Dim params As New List(Of ReportParameter) params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("FechaInicio", FechaI)) diff --git a/GPS/EmbarqueManifiesto.rdlc b/GPS/EmbarqueManifiesto.rdlc index 8f17b1a9f..0a2aa63f6 100644 --- a/GPS/EmbarqueManifiesto.rdlc +++ b/GPS/EmbarqueManifiesto.rdlc @@ -41,6 +41,10 @@ Cultivo System.String + + Manifiesto + System.String + CultivoVariedad System.String @@ -1497,7 +1501,7 @@ - GROWER ALLIANCE + =Parameters!Cliente.Value @@ -1688,7 +1692,7 @@ - 947 E. FRONTAGE RD. + =Parameters!Direccion.Value @@ -1879,7 +1883,7 @@ - RIO RICO + @@ -6833,13 +6837,13 @@ - 2.5cm + 1.73271cm - 2.5cm + 1.68042cm - 5.74021cm + 7.32708cm 3.69064cm @@ -7122,7 +7126,9 @@ =Fields!NoPallets.Value - + true @@ -7152,7 +7159,9 @@ =Fields!NoCajas.Value - + true - + true true - =Fields!Cultivo.Value & " " & Fields!CultivoVariedad.Value - + true @@ -7212,7 +7225,9 @@ =Fields!Etiqueta.Value - + true @@ -7242,7 +7258,9 @@ =Fields!Envase.Value - + true @@ -7447,6 +7466,18 @@ true ReportParameter1 + + String + true + true + ReportParameter1 + + + String + true + true + ReportParameter1 + diff --git a/GPS/EmbarqueManifiestoCartaPorte.rdlc b/GPS/EmbarqueManifiestoCartaPorte.rdlc new file mode 100644 index 000000000..0f6bd25e6 --- /dev/null +++ b/GPS/EmbarqueManifiestoCartaPorte.rdlc @@ -0,0 +1,2489 @@ + + + 0 + + + + System.Data.DataSet + /* Local Connection */ + + 74f8a171-24f1-4404-809e-ec2e098f1907 + + + + + + DataSet3 + /* Local Query */ + + + + NoPallets + System.Int + + + NoCajas + System.Int + + + Peso + System.Decimal + + + Etiqueta + System.String + + + Envase + System.String + + + Cultivo + System.String + + + SATClavePS + System.String + + + Embalaje + System.String + + + EsMaterialPeligroso + System.String + + + Manifiesto + System.String + + + CultivoVariedad + System.String + + + + DataSet3 + C:\Users\jesus\Documents\Visual Studio 2015\WebSites\WebSite2\App_Code\DataSet3.xsd + DataTable1 + + + + + + + + + + + + + + + 2.45401cm + + + 2.30818cm + + + 1.99068cm + + + 2.2288cm + + + + + 0.6cm + + + + + true + true + + + + + Información para carta porte + + + + Textbox11 + + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + 4 + + + + + + + + + 0.6cm + + + + + true + true + + + + + Manifiesto N° + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!NoEmbarque.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!SubProyecto.Value + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + 0.6cm + + + + + true + true + + + + + Fecha Embarque: + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + Hora Salida: + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + 0.6cm + + + + + true + true + + + + + =Parameters!Fecha.Value + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + true + true + + + + + =Parameters!Hora.Value + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + 2 + + + + + + + + + + + + + + + + + + + + + + + + 0.3175cm + 10.3553cm + 2.4cm + 8.98167cm + + + + + + Embedded + logojam + FitProportional + 0.20354cm + 0.19717cm + 2.79646cm + 4.89479cm + 1 + + + + + + + + + 2.60646cm + + + 2.39354cm + + + 2.07667cm + + + 2.07667cm + + + 0.38333cm + + + 2.92334cm + + + 1.97084cm + + + 2.31479cm + + + 2.34125cm + + + + + 0.6cm + + + + + true + true + + + + + ORIGEN / SHIPPER + + + + + + + Textbox264 + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + 4 + + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + DESTINO / CONSIGNE + + + + + + + Textbox269 + + 1.5pt + + + Black + + 1.5pt + + + Black + + 1.5pt + + + Black + + 1.5pt + + + Black + + 1.5pt + + 2pt + 2pt + 2pt + 2pt + + + 4 + + + + + + + + + 0.6cm + + + + + true + true + + + + + Embarcador: + + + + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + AGROPECUARIA JAM, S.A. DE C.V. + + + + + + + Textbox256 + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + true + true + + + + + + + + + + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Distribuidor: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!Cliente.Value + + + + + + + Textbox261 + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + 0.6cm + + + + + true + true + + + + + Direccion: + + + + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + CARR. A BAHIA DE KINO KM12 + + + + + + + Textbox247 + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + true + true + + + + + + + + + + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Domic.: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!Direccion.Value + + + + + + + Textbox252 + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + 0.6cm + + + + + true + true + + + + + Ciudad: + + + + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + HERMOSILLO, SONORA + + + + + + + Textbox238 + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + true + true + + + + + + + + + + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Lugar: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox243 + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + 0.6cm + + + + + true + true + + + + + Reg. Fed. Con.: + + + + + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + AJA9809264V2 + + + + + + + Textbox229 + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + true + true + + + + + + + + + + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Reg. Fed. Con.: + + + + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Textbox234 + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Mercado: + + + + + + + Textbox55 + + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Parameters!Mercado.Value + + + + + + + Textbox60 + + + + Black + + 2pt + + + Black + + 2pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.2825cm + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3.49239cm + 0.25008cm + 3.2825cm + 19.08689cm + 2 + + + + + + + + + 4.11396cm + + + 5.86084cm + + + 4.94552cm + + + 4.21948cm + + + + + 0.6cm + + + + + true + true + + + + + CULTIVO + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + CODIGO SAT DEL PRODUCTO + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + ¿ES MATERIAL PELIGROSO? + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + ¿ES MATERIAL PELIGROSO? + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + + Black + + 2pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + =Fields!Cultivo.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SATClavePS.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!EsMaterialPeligroso.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Embalaje.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + After + + + + + + + DataSet1 + 7.08766cm + 0.19717cm + 1.2cm + 19.1398cm + 3 + + + + + + 3.43808in + + =Parameters!Cliente.Value + - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - Black - - 2pt - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.6cm - - - - - true - true - - - - - - - - - Black - - 2pt - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - + true true @@ -597,7 +466,7 @@ Rio Rico, AZ 85648 - + true true @@ -672,6 +541,7 @@ Rio Rico, AZ 85648 2 + true @@ -739,12 +609,11 @@ Rio Rico, AZ 85648 - - 4.15396cm - 2.00862cm - 3.6cm + 3.38667cm + 1.98216cm + 3cm 14.9871cm - 8.9547in + 5.96512in