From 88a8a42b377ec93af5b1d6c17d177b199473ea35 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 22 Mar 2024 12:48:14 -0700 Subject: [PATCH 1/5] --Descarga de etiquetas de busqueda de productos --- Ventas/PopUpBuscarPs.aspx | 5 ++ Ventas/PopUpBuscarPs.aspx.vb | 151 ++++++++++++++++++++++++++++++++--- 2 files changed, 145 insertions(+), 11 deletions(-) diff --git a/Ventas/PopUpBuscarPs.aspx b/Ventas/PopUpBuscarPs.aspx index 7a4a5260e..36e5c3ac4 100644 --- a/Ventas/PopUpBuscarPs.aspx +++ b/Ventas/PopUpBuscarPs.aspx @@ -102,6 +102,11 @@ + + + + + diff --git a/Ventas/PopUpBuscarPs.aspx.vb b/Ventas/PopUpBuscarPs.aspx.vb index ba278141d..99bdee9cb 100644 --- a/Ventas/PopUpBuscarPs.aspx.vb +++ b/Ventas/PopUpBuscarPs.aspx.vb @@ -3,7 +3,9 @@ Option Strict On Imports System.Data Imports Extensiones - +Imports Microsoft.Reporting.WebForms +Imports ZXing + Partial Class PopUpBuscarPs Inherits ClsPaginas @@ -24,8 +26,8 @@ Partial Class PopUpBuscarPs End If End If - End Sub - + End Sub + #Region " INICIALIZA VALORES " Private Sub CargaClasificaciones() Ddlclasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) @@ -44,9 +46,9 @@ Partial Class PopUpBuscarPs DdlCompuesto.Items.Insert(0, New ListItem("Todos", "-1")) End If DdlCompuesto.Items.Insert(0, New ListItem("Todos", "-1")) - End Sub + End Sub #End Region - + #Region " CARGA DATOS " Protected Sub BtnFiltrar_Click(sender As Object, e As EventArgs) CargaDatos() @@ -79,24 +81,31 @@ Partial Class PopUpBuscarPs GvDatos.DataBind() GvDatos.UseAccessibleHeader = True + + If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then + GvDatos.Columns(4).Visible = True + End If Else Alert("Asigne un valor a cualquiera de los filtros", TipoMensaje.MsgAdvertencia) End If - End Sub + End Sub #End Region - + #Region " GV DATOS " Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then Try - e.Row.FCLiteral("LnkPs").Text = String.Format("
{0}{1}
", "", e.Row.DBCampo("Ps")) + e.Row.FCLiteral("LnkPs").Text = String.Format("", "", e.Row.DBCampo("Ps")) + If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then + ScriptManager.GetCurrent(Me).RegisterPostBackControl(e.Row.FCLinkButton("LnkGenerarEtiqueta")) + End If Catch ex As Exception Dim exexex As String = ex.Message End Try End If - End Sub + End Sub #End Region - + Private Function ValidarUnFiltroSeleccionado() As Boolean If TxtCodigo.Text.Trim <> String.Empty Then Return True If TxtCodigoBarras.Text.Trim <> String.Empty Then Return True @@ -109,7 +118,127 @@ Partial Class PopUpBuscarPs If DdlCompuesto.SelectedValue.ToEntero > 0 Then Return True Return False + End Function + + Protected Sub LnkGenerarEtiqueta_Click(sender As Object, e As EventArgs) + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + + Dim CvePrecioListaPredeterminada = GlobalDTPrecioListas(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePrecioLista", "Predeterminada = True").ToEntero() + Dim DtPrecios As DataTable = Nothing + + Dim ObjVentas As New ClsProductosServicios + If ObjVentas.GetPSPrecios(CvePrecioListaPredeterminada, GvRow.DataKey("CvePs").ToString()) AndAlso ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then + DtPrecios = ObjVentas.DtResultados.Copy() + End If + ObjVentas.Dispose() + + If DtPrecios IsNot Nothing Then + + DtPrecios.Columns.Add(New DataColumn("CBBase64", GetType(String))) + + For Each Row As DataRow In DtPrecios.Rows + Row("CBBase64") = Convert.ToBase64String(GeneraCodigoQR(Row("CodigoBarras").ToString(), 40, 150, 0, "CODE_39", True)) + Next + + Dim DirectorioArchivo As String = "Empresas/Grales/Formatos/Etiqueta.mrt" + If System.IO.File.Exists(UsuarioActual.Empresa.Ruta + "Formatos/Etiqueta.mrt") Then + DirectorioArchivo = UsuarioActual.Empresa.Ruta + "Formatos/Etiqueta.mrt" + End If + Dim params As New List(Of ReportParameter) + + ImprimirPDFStimul(DirectorioArchivo, DtPrecios, params, "Precios") + End If + + End Sub + + Private Function GeneraCodigoQR(CodigoBarras As String, Alto As Integer, Largo As Integer, Margen As Integer, Formato As String, Optional PureBacode As Boolean = False) As Byte() + + Dim barcodeWriter As New BarcodeWriter + Dim opciones As New ZXing.Common.EncodingOptions + Dim FormatoBar As New BarcodeFormat + 'Dim Respuesta As Byte() + + opciones.Height = Alto + opciones.Width = Largo + opciones.Margin = Margen + opciones.PureBarcode = PureBacode + barcodeWriter.Options = opciones + + Select Case Formato + Case "All_1D" + barcodeWriter.Format = BarcodeFormat.All_1D + Exit Select + Case "AZTEC" + barcodeWriter.Format = BarcodeFormat.AZTEC + Exit Select + Case "CODABAR" + barcodeWriter.Format = BarcodeFormat.CODABAR + Exit Select + Case "CODE_128" + barcodeWriter.Format = BarcodeFormat.CODE_128 + Exit Select + Case "CODE_39" + barcodeWriter.Format = BarcodeFormat.CODE_39 + Exit Select + Case "CODE_93" + barcodeWriter.Format = BarcodeFormat.CODE_93 + Exit Select + Case "DATA_MATRIX" + barcodeWriter.Format = BarcodeFormat.DATA_MATRIX + Exit Select + Case "EAN_13" + barcodeWriter.Format = BarcodeFormat.EAN_13 + Exit Select + Case "EAN_8" + barcodeWriter.Format = BarcodeFormat.EAN_8 + Exit Select + Case "IMB" + barcodeWriter.Format = BarcodeFormat.IMB + Exit Select + Case "ITF" + barcodeWriter.Format = BarcodeFormat.ITF + Exit Select + Case "MAXICODE" + barcodeWriter.Format = BarcodeFormat.MAXICODE + Exit Select + Case "MSI" + barcodeWriter.Format = BarcodeFormat.MSI + Exit Select + Case "PDF_417" + barcodeWriter.Format = BarcodeFormat.PDF_417 + Exit Select + Case "PLESSEY" + barcodeWriter.Format = BarcodeFormat.PLESSEY + Exit Select + Case "QR_CODE" + barcodeWriter.Format = BarcodeFormat.QR_CODE + Exit Select + Case "RSS_14" + barcodeWriter.Format = BarcodeFormat.RSS_14 + Exit Select + Case "RSS_EXPANDED" + barcodeWriter.Format = BarcodeFormat.RSS_EXPANDED + Exit Select + Case "UPC_A" + barcodeWriter.Format = BarcodeFormat.UPC_A + Exit Select + Case "UPC_E" + barcodeWriter.Format = BarcodeFormat.UPC_E + Exit Select + Case "UPC_EAN_EXTENSION" + barcodeWriter.Format = BarcodeFormat.UPC_EAN_EXTENSION + Exit Select + + End Select + + Dim imgCod As Drawing.Bitmap = barcodeWriter.Write(CodigoBarras) + Dim memoriStream As New System.IO.MemoryStream + imgCod.Save(memoriStream, Drawing.Imaging.ImageFormat.Bmp) + + 'Respuesta = Convert.ToBase64String(memoriStream.ToArray()) + + Return memoriStream.ToArray() + End Function - End Class From caaba87c35f8b088e456f3082126baaab9aa2948 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 22 Mar 2024 13:07:25 -0700 Subject: [PATCH 2/5] Ferretera. --Impresion directa de facturas y cotizaciones a credito --Condiciones de entrega e impresion para entrega a domicilio en cajas --- Sistemas/CatSesiones.aspx | 3 ++- Sistemas/CatSesiones.aspx.vb | 7 +++++-- Ventas/PVCobranza.aspx | 4 ++++ Ventas/PVCobranza.aspx.vb | 19 +++++++++++++++++-- Ventas/Ventas.aspx.vb | 20 +++++++++++++++----- 5 files changed, 43 insertions(+), 10 deletions(-) diff --git a/Sistemas/CatSesiones.aspx b/Sistemas/CatSesiones.aspx index 4481f93b4..1bb7ae18c 100644 --- a/Sistemas/CatSesiones.aspx +++ b/Sistemas/CatSesiones.aspx @@ -66,7 +66,8 @@ - + +    diff --git a/Sistemas/CatSesiones.aspx.vb b/Sistemas/CatSesiones.aspx.vb index ef6bbf838..3211d4219 100644 --- a/Sistemas/CatSesiones.aspx.vb +++ b/Sistemas/CatSesiones.aspx.vb @@ -109,7 +109,8 @@ Partial Class Sistemas_CatSesiones cargaAC() ElseIf DdlVariable.SelectedItem.Value = "GlobalDTSATUsosCFDI" Then CargaUsosCFDI() - + ElseIf DdlVariable.SelectedItem.Value = "GlobalDTVtaCondicionesEntrega" Then + CargaCondicionesEntrega() End If @@ -289,7 +290,9 @@ Partial Class Sistemas_CatSesiones 'Fin Carga Usuarios End Sub - + Private Sub CargaCondicionesEntrega() + GlobalDTVtaCondicionesEntrega(UsuarioActual.CveEmpresa) = Nothing + End Sub Private Sub CargaProductosServiciosSimplificado() GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) = Nothing diff --git a/Ventas/PVCobranza.aspx b/Ventas/PVCobranza.aspx index c6e6fc216..b24ece4b9 100644 --- a/Ventas/PVCobranza.aspx +++ b/Ventas/PVCobranza.aspx @@ -300,6 +300,10 @@ + +   diff --git a/Ventas/PVCobranza.aspx.vb b/Ventas/PVCobranza.aspx.vb index 6ac82a56e..0b963feab 100644 --- a/Ventas/PVCobranza.aspx.vb +++ b/Ventas/PVCobranza.aspx.vb @@ -220,8 +220,13 @@ Partial Class Ventas_PVCobranza If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.DBCampo("CveUsuarioCobranza") <> "" Then - e.Row.BackColor = Drawing.ColorTranslator.FromHtml("#3598dc") - 'e.Row.CssClass = "blue-madison" + e.Row.BackColor = Drawing.ColorTranslator.FromHtml("#3598dc") + 'e.Row.CssClass = "blue-madison" + End If + + If e.Row.DBCampo("CveCondicionEntrega").ToEntero() = 9 Then + e.Row.FCLinkButton("LnkImprimir").Visible = True + ScriptManager.GetCurrent(Me).RegisterPostBackControl(e.Row.FCLinkButton("LnkImprimir")) End If End If End Sub @@ -598,4 +603,14 @@ Partial Class Ventas_PVCobranza End If ObjVentas.Dispose() End Sub + Protected Sub LnkImprimir_Click(sender As Object, e As EventArgs) + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + + Dim CveVenta As Integer = GvRow.DataKey("CveVenta").ToEntero() + + If CveVenta > 0 Then + ImpresionDirectaPDF(CveVenta) + End If + + End Sub End Class diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index d027951b0..1e86749e0 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -2644,7 +2644,10 @@ Partial Class Ventas CargaMonedas() CargaVendedores() CargarAlmacenes() - 'CargaFormaEntrega() + If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then + CargaFormaEntrega() + End If + CargaCuentasTerminal() 'CargaDdlNCPS() 'CargarCamiones() @@ -4972,6 +4975,11 @@ Partial Class Ventas ViewState("CveSubProyectoVenta") = DbRowVenta("CveSubProyecto").ToString().ToEntero() + If DbRowVenta("CveCondicionEntrega").ToString().ToEntero() > 0 Then + DdlFormaEntrega.SelectedValueExist(DbRowVenta("CveCondicionEntrega").ToString()) + DdlFormaEntrega.Enabled = False + End If + Me.CveEstatusFacturaPadre = DbRowVenta("CveEstatusFacturaPadre").ToString().ToEntero() If UsuarioActual.Empresa.Funcionalidad(705) = "1" Then @@ -10914,6 +10922,12 @@ Partial Class Ventas MensajeAlert.Clear() Try + If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then + If ObjFactura.TipoDocto.Contiene("Ing", "Cot") AndAlso ObjFactura.CondicionesPago = 1 Then + ImpresionDirectaPDF() + End If + End If + 'LIMPIA CONDICIONES DE PAGO - CONTADO RBLPago.SelectedValue = "1" LimpiaEscondeContado() @@ -10923,10 +10937,6 @@ Partial Class Ventas OnError("Ocurrió un error al limpiar los datos", ex) End Try - 'If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then - ' ImpresionDirectaPDF() - 'End If - Else ObjVentas.RollBack() From b1f6159acc858fc8c2dab2df5492c95bb31cf625 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 22 Mar 2024 15:52:57 -0700 Subject: [PATCH 3/5] --Fix visualizacion de descuentos en ventas guardadas --- Ventas/Ventas.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 1e86749e0..fe6678a34 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -37777,7 +37777,7 @@ Partial Class Ventas End Sub Private Sub RecalculaPrecios() - If TmpDT IsNot Nothing Then + If TmpDT IsNot Nothing AndAlso (CveVenta <= 0 OrElse EsCreaApartirDe OrElse ModalidadEdicion) Then For Each Row As DataRow In TmpDT.Rows Dim Cantidad As Decimal = Row("Cantidad").ToString().ToDecimal() Dim CveClasificacion As Integer = Row("CveClasificacion").ToString().ToEntero From 95abda00e9f7e8b51a336b445677d8252318b97f Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 22 Mar 2024 15:53:16 -0700 Subject: [PATCH 4/5] --Fix asignacion de cuentas, saldos iniciales --- General/SaldosIniciales.aspx.vb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb index dd3da1c97..25f946837 100644 --- a/General/SaldosIniciales.aspx.vb +++ b/General/SaldosIniciales.aspx.vb @@ -3189,13 +3189,13 @@ Partial Class General_SaldosIniciales If Not ErrorProceso Then DTAnticipoCliente.AcceptChanges() End If - End If + If Not AsignacionCuenta(ObjConta, 66, CveCuentaContable, -1, -1, CveCliente, -1, UsuarioActual.CveEmpresa, -1) Then + ErrorProceso = True + Alert("Se presento un error al guardar en asignaciones", TipoMensaje.MsgAdvertencia) + Exit For + End If - If Not AsignacionCuenta(ObjConta, 66, CveCuentaContable, -1, -1, CveCliente, -1, UsuarioActual.CveEmpresa, -1) Then - ErrorProceso = True - Alert("Se presento un error al guardar en asignaciones", TipoMensaje.MsgAdvertencia) - Exit For End If Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Anticipo/Cliente/SaldoInicial", 24, Importe, Importe, CveMoneda, Fecha, FolioStr, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) From 96fb89624f5979c7555ff759e5185881240b4311 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 22 Mar 2024 17:17:37 -0700 Subject: [PATCH 5/5] --Descarga directa de etiquetas --- Ventas/ActualizarPrecios.aspx | 4 + Ventas/ActualizarPrecios.aspx.vb | 133 ++++++++++++++++++++++++++++++ Ventas/PopUpBuscarPs.aspx | 15 ++-- Ventas/PopUpBuscarPs.aspx.vb | 18 +++- Ventas/ProductosServicios.aspx | 6 +- Ventas/ProductosServicios.aspx.vb | 12 ++- 6 files changed, 178 insertions(+), 10 deletions(-) diff --git a/Ventas/ActualizarPrecios.aspx b/Ventas/ActualizarPrecios.aspx index 5eb90535c..16b94cc0f 100644 --- a/Ventas/ActualizarPrecios.aspx +++ b/Ventas/ActualizarPrecios.aspx @@ -766,7 +766,11 @@ + - +