From 40a0c008fb11241dd3d4d57294476ebf5dd5cc92 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 26 Aug 2021 07:48:57 -0700 Subject: [PATCH 01/30] =?UTF-8?q?--parametros=20descuento=20al=20editar=20?= =?UTF-8?q?remisi=C3=B3n=20--=20parametro=20%=20impuesto=20local.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsVentas.vb | 11 ++++++----- Ventas/CatImpuestosLocales.aspx.vb | 6 +++--- Ventas/PV.aspx.vb | 2 +- Ventas/Ventas.aspx.vb | 5 +---- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index c0ca015c2..c8a9c42e7 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -1273,7 +1273,7 @@ Public Class ClsVentas Return Retorno End Function - Public Function UpdateVentaDetalleRemision(CveVenta As Integer, CvePS As Integer, Cantidad As Decimal, PU As Decimal, IEPS As Decimal, PorcentajeIEPS As Decimal, IVA As Decimal, PorcentajeIVA As Decimal, Observaciones As String, Optional CveUsuarioModifico As Integer = -1) As Boolean + Public Function UpdateVentaDetalleRemision(CveVenta As Integer, CvePS As Integer, Cantidad As Decimal, PU As Decimal, IEPS As Decimal, PorcentajeIEPS As Decimal, IVA As Decimal, PorcentajeIVA As Decimal, Descuento As Decimal, Observaciones As String, Optional CveUsuarioModifico As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_VentasDetalleRemisionUpdate") @@ -1286,6 +1286,7 @@ Public Class ClsVentas .Add("@PorcentajeIEPS", SqlDbType.Decimal).Value = PorcentajeIEPS .Add("@IVA", SqlDbType.Decimal).Value = IVA .Add("@PorcentajeIVA", SqlDbType.Decimal).Value = PorcentajeIVA + .Add("@Descuento", SqlDbType.Decimal).Value = Descuento .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones .Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico End With @@ -2561,13 +2562,13 @@ Public Class ClsVentas #End Region #Region " I M P U E S T O S L O C A L E S" - Public Function AddImpuestosLocales(ImpuestoLocal As String, Porcentaje As Double, Orden As Integer, TipoImpuesto As Integer, Estatus As Integer, IdCtaContable As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Public Function AddImpuestosLocales(ImpuestoLocal As String, Porcentaje As Decimal, Orden As Integer, TipoImpuesto As Integer, Estatus As Integer, IdCtaContable As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_ImpuestosLocalesAdd") With SqlAdapter.SelectCommand.Parameters .Add("@ImpuestoLocal", SqlDbType.VarChar).Value = ImpuestoLocal - .Add("@Porcentaje", SqlDbType.SmallMoney).Value = Porcentaje + .Add("@Porcentaje", SqlDbType.Decimal).Value = Porcentaje .Add("@Orden", SqlDbType.Int).Value = Orden .Add("@TipoImpuesto", SqlDbType.Int).Value = TipoImpuesto .Add("@Estatus", SqlDbType.Bit).Value = Estatus @@ -2603,14 +2604,14 @@ Public Class ClsVentas Return Retorno End Function - Public Function UpdateImpuestosLocales(CveImpuestoLocal As Integer, ImpuestoLocal As String, Porcentaje As Double, Orden As Integer, TipoImpuesto As Integer, Estatus As Integer, IdCtaContable As Integer) As Boolean + Public Function UpdateImpuestosLocales(CveImpuestoLocal As Integer, ImpuestoLocal As String, Porcentaje As Decimal, Orden As Integer, TipoImpuesto As Integer, Estatus As Integer, IdCtaContable As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_ImpuestosLocalesUpdate") With SqlAdapter.SelectCommand.Parameters .Add("@CveImpuestoLocal", SqlDbType.Int).Value = CveImpuestoLocal .Add("@ImpuestoLocal", SqlDbType.VarChar).Value = ImpuestoLocal - .Add("@Porcentaje", SqlDbType.SmallMoney).Value = Porcentaje + .Add("@Porcentaje", SqlDbType.Decimal).Value = Porcentaje .Add("@TipoImpuesto", SqlDbType.Int).Value = TipoImpuesto .Add("@Orden", SqlDbType.Int).Value = Orden .Add("@Estatus", SqlDbType.Bit).Value = Estatus diff --git a/Ventas/CatImpuestosLocales.aspx.vb b/Ventas/CatImpuestosLocales.aspx.vb index 88fafced9..b03199507 100644 --- a/Ventas/CatImpuestosLocales.aspx.vb +++ b/Ventas/CatImpuestosLocales.aspx.vb @@ -85,7 +85,7 @@ Partial Class Ventas_CatImpuestosLocales Dim TieneError = False Dim CveImpuestoLocal As Integer = GvImpuestos.Rows(e.RowIndex).DataKey("CveImpuestoLocal").ToEntero Dim Impuesto As String = GvImpuestos.Rows(e.RowIndex).FCTextBox("TxtImpuestoLocal").Text.Trim - Dim Porcentaje As Double = GvImpuestos.Rows(e.RowIndex).FCTextBox("TxtVentaPorcentaje").Text.ToDouble + Dim Porcentaje As Decimal = GvImpuestos.Rows(e.RowIndex).FCTextBox("TxtVentaPorcentaje").Text.ToDecimal Dim Orden = GvImpuestos.Rows(e.RowIndex).FCTextBox("TxtOrdenImpuesto").Text.ToEntero Dim TipoImpuesto = GvImpuestos.Rows(e.RowIndex).FCDropDownList("DdlTipoImpuestoEdit").SelectedValue.ToEntero Dim IdCtaContable = GvImpuestos.Rows(e.RowIndex).FCDropDownList("DdlCuentasContables").SelectedValue.ToEntero @@ -199,7 +199,7 @@ Partial Class Ventas_CatImpuestosLocales If CveImpuestoLocal = -1 Then If ChkEstatus.Checked Then Estatus = 1 - If ObjVentas.AddImpuestosLocales(TxtImpuesto.Text.Trim, TxtPorcentaje.Text.ToDouble, TxtOrden.Text.ToEntero, DdlTipoImpuesto.SelectedValue.ToEntero, Estatus, DdlCuentasContables.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + If ObjVentas.AddImpuestosLocales(TxtImpuesto.Text.Trim, TxtPorcentaje.Text.ToDecimal, TxtOrden.Text.ToEntero, DdlTipoImpuesto.SelectedValue.ToEntero, Estatus, DdlCuentasContables.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then CargaDatos() End If TxtImpuesto.Text = "" @@ -210,7 +210,7 @@ Partial Class Ventas_CatImpuestosLocales If CveImpuestoLocal <> -1 Then Dim TieneError = False Dim Impuesto As String = TxtImpuesto.Text.Trim - Dim Porcentaje As Double = TxtPorcentaje.Text.ToDouble + Dim Porcentaje As Decimal = TxtPorcentaje.Text.ToDecimal Dim Orden = TxtOrden.Text.ToEntero Dim TipoImpuesto = DdlTipoImpuesto.SelectedValue.ToEntero Dim IdCtaContable = DdlCuentasContables.SelectedValue.ToEntero diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index 39a95f414..2d19b88f7 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -1922,7 +1922,7 @@ Partial Class PV For Each Row As DataRow In TmpDT.FiltraParametros("EliminarDB = False").Rows Dim CveVentaDetalle As Integer = Row("CveVentaDetalle").ToString.ToEntero() If CveVentaDetalle > 0 Then - If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalle").ToString.ToEntero, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDecimal, Row("PU").ToString.ToDecimal(), Row("ImporteIEPS").ToString.ToDecimal(), Row("PorcentajeIEPS").ToString().ToDecimal(), Row("ImporteIVA").ToString.ToDecimal(), Row("PorcentajeIVA").ToString().ToDecimal(), Row("Obs").ToString, UsuarioActual.CveUsuario) Then + If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalle").ToString.ToEntero, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDecimal, Row("PU").ToString.ToDecimal(), Row("ImporteIEPS").ToString.ToDecimal(), Row("PorcentajeIEPS").ToString().ToDecimal(), Row("ImporteIVA").ToString.ToDecimal(), Row("PorcentajeIVA").ToString().ToDecimal(), Row("Descuento").ToString().ToDecimal(), Row("Obs").ToString, UsuarioActual.CveUsuario) Then OcurrioError = True Exit For End If diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index e0de4aa79..f64750c45 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -13212,9 +13212,6 @@ Partial Class Ventas End If Dim ModalidadRefacturacion As Integer = UsuarioActual.Empresa.Funcionalidad(586).ToEntero() - If UsuarioActual.CveUsuario.Contiene(100, 1719) Then - ModalidadRefacturacion = 2 - End If 'REFACTURACION CON PAGOS, DEBE CANCELAR SALDOS DEL DOCUMENTO ANTERIOR Y TRASPASAR PAGOS AL NUEVO If ModalidadRefacturacion = 2 AndAlso ObjFactura.TipoDocto.Contiene("Ing", "Ant") AndAlso ObjFactura.NuevaFactura = 1 Then @@ -20144,7 +20141,7 @@ Partial Class Ventas For Each Row As DataRow In TmpDT.Rows Dim CveVentaDetalle As Integer = Row("CveVentaDetalle").ToString().ToEntero() If CveVentaDetalle > 0 Then - If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalle").ToString().ToEntero(), Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDecimal, Row("PU").ToString().ToDecimal(), Row("ImporteIEPS").ToString().ToDecimal(), Row("PorcentajeIEPS").ToString().ToDecimal(), Row("ImporteIVA").ToString().ToDecimal(), Row("PorcentajeIVA").ToString().ToDecimal(), Row("Obs").ToString(), UsuarioActual.CveUsuario) Then + If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalle").ToString().ToEntero(), Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDecimal, Row("PU").ToString().ToDecimal(), Row("ImporteIEPS").ToString().ToDecimal(), Row("PorcentajeIEPS").ToString().ToDecimal(), Row("ImporteIVA").ToString().ToDecimal(), Row("PorcentajeIVA").ToString().ToDecimal(), Row("Descuento").ToString().ToDecimal(), Row("Obs").ToString(), UsuarioActual.CveUsuario) Then OcurrioError = True Exit For End If From 9f0b9b204ce485aff7f81e7179eb529b5e59ef8b Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 26 Aug 2021 07:49:54 -0700 Subject: [PATCH 02/30] parametro empresa en resultados inventario --- App_Code/ClsInventarios.vb | 3 ++- Inventarios/InventarioFisicoDetalle.aspx.vb | 2 +- Inventarios/RepAnomalias.aspx.vb | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index a15ada6c8..4bba5cb11 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -2877,12 +2877,13 @@ Public Class ClsInventarios #End Region #Region "I N V E N T A R I O - F I S I C O - R E S U L T A D O" - Public Function AddInventarioFisicoResultados(CveInventarioFisico As Integer, CveUsuario As Integer) As Boolean + Public Function AddInventarioFisicoResultados(CveInventarioFisico As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_InventarioFisicoResultadoAdd") With SqlAdapter.SelectCommand.Parameters .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With Try SqlAdapter.Fill(Data) diff --git a/Inventarios/InventarioFisicoDetalle.aspx.vb b/Inventarios/InventarioFisicoDetalle.aspx.vb index cdd2c7edb..986636b35 100644 --- a/Inventarios/InventarioFisicoDetalle.aspx.vb +++ b/Inventarios/InventarioFisicoDetalle.aspx.vb @@ -569,7 +569,7 @@ Partial Class Inventarios_InventarioFisicoDetalle Dim Inventarios As New ClsInventarios Inventarios.IniciaTransacSQL() - If Inventarios.AddInventarioFisicoResultados(CveInventarioFisico, UsuarioActual.CveUsuario) Then + If Inventarios.AddInventarioFisicoResultados(CveInventarioFisico, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then If Inventarios.UpdateInventarioFisicoEstatus(CveInventarioFisico, 3, UsuarioActual.CveEmpresa) Then Dim url As String = ("/Inventarios/RepAnomalias.aspx?CveInventarioFisico=" + CveInventarioFisico.ToString) Alert("Ha finalizado el Inventario Físico. Sera enviado al reporte de anomalías", TipoMensaje.MsgInformacion, " window.location=""" + url + """") diff --git a/Inventarios/RepAnomalias.aspx.vb b/Inventarios/RepAnomalias.aspx.vb index 64302463c..12a19714f 100644 --- a/Inventarios/RepAnomalias.aspx.vb +++ b/Inventarios/RepAnomalias.aspx.vb @@ -198,7 +198,7 @@ Partial Class Inventarios_RepAnomalias If (GvF.Rows.Count > 0) Then GvF.UseAccessibleHeader = True GvF.HeaderRow.TableSection = TableRowSection.TableHeader - Script = "OrdenarGVF();" + divRegistradosFaltan.Visible = True LtlTotalRegistrosFaltan.Text = GvF.Rows.Count.ToString End If @@ -206,7 +206,7 @@ Partial Class Inventarios_RepAnomalias If (GvS.Rows.Count > 0) Then GvS.UseAccessibleHeader = True GvS.HeaderRow.TableSection = TableRowSection.TableHeader - Script += "OrdenarGVS();" + divRegistradosSobran.Visible = True LtlTotalRegistrosSobran.Text = GvS.Rows.Count.ToString End If @@ -214,7 +214,7 @@ Partial Class Inventarios_RepAnomalias If (GvC.Rows.Count > 0) Then GvC.UseAccessibleHeader = True GvC.HeaderRow.TableSection = TableRowSection.TableHeader - Script += "OrdenarGVS();" + divRegistradosCoinciden.Visible = True LtlCoincidentes.Text = GvC.Rows.Count.ToString End If @@ -233,7 +233,7 @@ Partial Class Inventarios_RepAnomalias Protected Sub btnFin_Click(sender As Object, e As EventArgs) Handles btnFin.Click Dim Inventarios As New ClsInventarios Inventarios.IniciaTransacSQL() - If Inventarios.AddInventarioFisicoResultados(CveInventarioFisico, UsuarioActual.CveUsuario) Then + If Inventarios.AddInventarioFisicoResultados(CveInventarioFisico, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then If Inventarios.UpdateInventarioFisicoEstatus(CveInventarioFisico, 3, UsuarioActual.CveEmpresa) Then Dim url As String = ("/Inventarios/RepAnomalias.aspx?CveInventarioFisico=" + CveInventarioFisico.ToString) Alert("Ha finalizado el Inventario Físico. Sera enviado al reporte de anomalías", TipoMensaje.MsgInformacion, " window.location=""" + url + """") From 19ff8671ad491a61b37fbde5ee5aaebc22b0aa58 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 28 Aug 2021 13:23:30 -0700 Subject: [PATCH 03/30] - --- Inventarios/RecepcionAlmacen.aspx.vb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index d93ba5ca0..7c9e2fa5b 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -2322,7 +2322,7 @@ Partial Class Inventarios_RecepcionAlmacen Dim tCveConcepto As Integer = 69 For Each RowInv As DataRow In tmpCostos.Rows - ValorInventario = DtCostos.SUM("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").ToString.ToDecimal.RoundSQL + ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundSQL If tCveConcepto = 69 Then IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero End If @@ -2532,7 +2532,7 @@ Partial Class Inventarios_RecepcionAlmacen ElseIf DtDetalleLote.Rows.Count > 0 Then Dim ContDt As Integer = 0 ' por redondeo - If gvr.FCTextBox("TbCantidadF").Text.ToDouble = 1 Then PU = PU.RoundAD + If gvr.FCTextBox("TbCantidadF").Text.ToDouble = 1 Then PU = PU.RoundSQL For Each Dr As DataRow In DtDetalleLote.Rows SumaTotal += Dr("Cantidad").ToString.ToDecimal * (PU + CostoIndirecto) If RecibidaCompleta AndAlso Cont + 1 = GvInv.Rows.Count AndAlso ContDt + 1 = DtDetalleLote.Rows.Count AndAlso (TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)).RoundSQL <> SumaTotal Then @@ -2633,7 +2633,7 @@ Partial Class Inventarios_RecepcionAlmacen ElseIf DtDetalleLote.Rows.Count > 0 Then Dim ContDt As Integer = 0 ' por redondeo - If gvr.FCTextBox("TbCantidadF").Text.ToDouble = 1 Then PU = PU.RoundAD + If gvr.FCTextBox("TbCantidadF").Text.ToDouble = 1 Then PU = PU.RoundSQL For Each Dr As DataRow In DtDetalleLote.Rows SumaTotal += Dr("Cantidad").ToString.ToDecimal * (PU + CostoIndirecto) If RecibidaCompleta AndAlso Cont + 1 = GvInv.Rows.Count AndAlso ContDt + 1 = DtDetalleLote.Rows.Count AndAlso (TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)).RoundSQL <> SumaTotal Then @@ -2650,7 +2650,7 @@ Partial Class Inventarios_RecepcionAlmacen Next Else ' por redondeo - If gvr.FCTextBox("TbCantidadF").Text.ToDouble = 1 Then PU = PU.RoundAD + If gvr.FCTextBox("TbCantidadF").Text.ToDouble = 1 Then PU = PU.RoundSQL SumaTotal += gvr.FCTextBox("TbCantidadF").Text.ToDecimal * (PU + CostoIndirecto) ' considerar el costo indirecto para el ajuste If RecibidaCompleta AndAlso Cont + 1 = GvInv.Rows.Count AndAlso (TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)).RoundSQL <> SumaTotal.RoundSQL Then Dim tTotal As Decimal = gvr.FCTextBox("TbCantidadF").Text.ToDecimal * (PU) @@ -3159,7 +3159,7 @@ Partial Class Inventarios_RecepcionAlmacen Dim ValorInventario As Decimal = 0 DtCostos = ObjInventario.DtResultados Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundSQL - Dim TotalCostoExtranjero As Decimal = DtCostos.SUM("TotalExtranjero").ToDecimal + Dim TotalCostoExtranjero As Decimal = DtCostos.SUMD("TotalExtranjero") 'VARIABLES Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero @@ -4195,7 +4195,7 @@ Partial Class Inventarios_RecepcionAlmacen For Each Dr As DataRow In DtInv.Rows Dr("PU") = Dr("PUExtranjero") - Dr("Total") = Dr("PU").ToString.ToDouble * Dr("Cantidad").ToString.ToDouble + Dr("Total") = Dr("PU").ToString.ToDecimal * Dr("Cantidad").ToString.ToDecimal Dr("CostoIndirecto") = Dr("CostoIndirectoExtranjero") Next @@ -4222,9 +4222,9 @@ Partial Class Inventarios_RecepcionAlmacen End If For Each Dr As DataRow In DtInv.Rows - Dr("PU") = Dr("PUExtranjero").ToString.ToDouble * TipoCambio - Dr("Total") = Dr("PU").ToString.ToDouble * Dr("CantidadC").ToString.ToDouble - Dr("CostoIndirecto") = Dr("CostoIndirectoExtranjero").ToString.ToDouble * TipoCambio + Dr("PU") = Dr("PUExtranjero").ToString.ToDecimal * TipoCambio + Dr("Total") = Dr("PU").ToString.ToDecimal * Dr("CantidadC").ToString.ToDecimal + Dr("CostoIndirecto") = Dr("CostoIndirectoExtranjero").ToString.ToDecimal * TipoCambio Next DtInv.AcceptChanges() End Sub From 74982aafe8ad7378a5a0f6b4ef87d87b95eb5412 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 28 Aug 2021 13:23:41 -0700 Subject: [PATCH 04/30] =?UTF-8?q?-quita=20validaci=C3=B3n=20datos=20erquer?= =?UTF-8?q?idos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ventas/PopUpBuscarFolio.aspx.vb | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Ventas/PopUpBuscarFolio.aspx.vb b/Ventas/PopUpBuscarFolio.aspx.vb index f6ecdce33..e0d9c2fb0 100644 --- a/Ventas/PopUpBuscarFolio.aspx.vb +++ b/Ventas/PopUpBuscarFolio.aspx.vb @@ -280,19 +280,19 @@ Partial Class PopUpBuscarFolio End Sub Private Function ValidarUnFiltroSeleccionado() As Boolean - If DdlClasificacion.SelectedValue.ToEntero > 0 Then Return True - If DdlTipoDocto.SelectedValue <> "-1" Then Return True - If DdlSubProyecto.SelectedValue.ToEntero > 0 Then Return True - If DdlEstatusFactura.SelectedValue.ToEntero > 0 Then Return True - If DdlUsuario.SelectedValue.ToEntero > 0 Then Return True - If DdlPS.SelectedValue.ToEntero > 0 Then Return True - If TxtFolio.Text.Trim.Length > 0 Then Return True - If DdlNombre.SelectedValue.ToEntero > 0 Then Return True - If TxtFolioFiscal.Text.Trim.Length > 0 Then Return True - If TxtPedidoContrato.Text.Length > 0 Then Return True - If TxtOrdenCompra.Text.Length > 0 Then Return True + 'If DdlClasificacion.SelectedValue.ToEntero > 0 Then Return True + 'If DdlTipoDocto.SelectedValue <> "-1" Then Return True + 'If DdlSubProyecto.SelectedValue.ToEntero > 0 Then Return True + 'If DdlEstatusFactura.SelectedValue.ToEntero > 0 Then Return True + 'If DdlUsuario.SelectedValue.ToEntero > 0 Then Return True + 'If DdlPS.SelectedValue.ToEntero > 0 Then Return True + 'If TxtFolio.Text.Trim.Length > 0 Then Return True + 'If DdlNombre.SelectedValue.ToEntero > 0 Then Return True + 'If TxtFolioFiscal.Text.Trim.Length > 0 Then Return True + 'If TxtPedidoContrato.Text.Length > 0 Then Return True + 'If TxtOrdenCompra.Text.Length > 0 Then Return True - Return False + Return True End Function End Class From cabf90b82a1364d9a9baa6206ed4ac1eb755d9bf Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 28 Aug 2021 13:24:13 -0700 Subject: [PATCH 05/30] recalculo el ieps, al dividir --- Compras/Compras.aspx.vb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 8f680c62e..0e6f3e581 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -12408,8 +12408,9 @@ Partial Class Compras_Compras dr1("Cantidad") = (dr1("Cantidad").ToString.ToDouble - Cantidad.ToDouble) dr1("Total") = dr1("PU").ToString.ToDouble * dr1("Cantidad").ToString.ToDecimal - dr1("Importe") = dr1("Total") + dr1("IVA") = Math.Round(dr1("IVAPorcentaje").ToString.ToDecimal * dr1("Total").ToString.ToDecimal, 6) + dr1("IEPSPS") = Math.Round(dr1("IEPSPSPorcentaje").ToString.ToDecimal * dr1("Total").ToString.ToDecimal, 6) TmpDT.AcceptChanges() @@ -12418,8 +12419,9 @@ Partial Class Compras_Compras dr("CodAF") = "" dr("Cantidad") = Cantidad.ToDecimal dr("Total") = dr("PU").ToString.ToDecimal * Cantidad.ToDecimal - dr("Importe") = dr("Total") + 'dr("Importe") = dr("Total") dr("IVA") = Math.Round(dr("IVAPorcentaje").ToString.ToDecimal * dr("Total").ToString.ToDecimal, 6) + dr("IEPSPS") = Math.Round(dr("IEPSPSPorcentaje").ToString.ToDecimal * dr("Total").ToString.ToDecimal, 6) TmpDT.Rows.InsertAt(dr, Index + 1) From aed1e4ec794782ca4b0acd5b82f9b4a0f600c50c Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 28 Aug 2021 13:24:44 -0700 Subject: [PATCH 06/30] =?UTF-8?q?--=20validaci=C3=B3n=20para=20refacturaci?= =?UTF-8?q?=C3=B3n=20de=20JAM=20-FRomo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/Modelos.vb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index b36f28a44..ceaa3e102 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -4615,10 +4615,6 @@ Namespace Modelos '1 NORMAL, 2 CON PAGOS Dim ModalidadRefacturacion As Integer = UsuarioActual.Empresa.Funcionalidad(586).ToEntero() - If UsuarioActual.CveUsuario = 1719 Then - ModalidadRefacturacion = 2 - End If - If EsRefacturacion AndAlso ModalidadRefacturacion <= 0 Then Retorno.Mensaje = "La factura no se puede refacturar debido a que la empresa no tiene asignada una modalidad de refacturación." Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia From 9a54fc24c25f3afb6cf0aceb35bdb3d42172223d Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 28 Aug 2021 13:25:01 -0700 Subject: [PATCH 07/30] filtrado de marcas --- Ventas/RepVentasUtilidadDetalle.aspx.vb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Ventas/RepVentasUtilidadDetalle.aspx.vb b/Ventas/RepVentasUtilidadDetalle.aspx.vb index e09ed1d94..d1db922ca 100644 --- a/Ventas/RepVentasUtilidadDetalle.aspx.vb +++ b/Ventas/RepVentasUtilidadDetalle.aspx.vb @@ -154,6 +154,10 @@ Partial Class Ventas_RepVentasUtilidadDetalle DdlPS.ddl.Items.Insert(0, New ListItem("Todos", "-1")) End If + DdlMarcas.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa) + DdlMarcas.DataBind() + DdlMarcas.Items.Insert(0, New ListItem("Todas", "-1")) + 'Cargo Clasificaciones DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) DdlClasificacion.DataBind() From 5992f79e09d7b47a0d99d5d8ba4e5a2f03864a7c Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 28 Aug 2021 13:25:25 -0700 Subject: [PATCH 08/30] =?UTF-8?q?-validaci=C3=B3n=20de=20contro,=20que=20n?= =?UTF-8?q?o=20valide=20por=20la=20fecha=20del=20contrato?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ventas/Ventas.aspx.vb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index f64750c45..6ad12601f 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -3246,7 +3246,12 @@ Partial Class Ventas If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, CveCliente, -1, 1) Then If ObjContratos.DtResultados.FiltraParametros("Estatus = True").Rows.Count > 0 AndAlso (DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ped") Or DdlTipoComprobante.SelectedValue.Contiene("Egs", "Dev")) Then - DtContratos = ObjContratos.DtResultados.FiltraParametros($"Estatus = True AND FechaFinal >= '{Now.ToShortDateString}' AND FechaInicial <= '{Now.ToShortDateString}'") + If UsuarioActual.CveEmpresa.Contiene(72, 80) Then + DtContratos = ObjContratos.DtResultados.FiltraParametros($"Estatus = True AND FechaFinal >= '{Now.ToShortDateString}' AND FechaInicial <= '{Now.ToShortDateString}'") + Else + DtContratos = ObjContratos.DtResultados.FiltraParametros($"Estatus = True ") + End If + If AfterPageLoad Then RegistraScript("window.onload = function MuestraContratos() { document.getElementById(""C_BtnMostrarContrato"").click(); }") @@ -31426,7 +31431,7 @@ Partial Class Ventas Dim Respuesta As Boolean = False - If EscontratoObra Then + If EscontratoObra AndAlso PorAmortizacionAnticipo > 0 Then ' si es contrato de obra y tiene amortización de anticipo If DdlTipoComprobante.SelectedValue = "Ing" Then @@ -31447,7 +31452,7 @@ Partial Class Ventas Respuesta = True Else Respuesta = False - Alert("Debe de seleccioanr un importe de amortización.", TipoMensaje.MsgAdvertencia) + Alert("Debe de seleccionar un importe de amortización.", TipoMensaje.MsgAdvertencia) End If Else From 21fc9ab99e2c3e578ccc9875f1dd7d9d1a640ff9 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 28 Aug 2021 13:25:49 -0700 Subject: [PATCH 09/30] -- tipo mensaje al validar --- Bancos/PopIEVentas.aspx.vb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Bancos/PopIEVentas.aspx.vb b/Bancos/PopIEVentas.aspx.vb index c0ec85953..330068893 100644 --- a/Bancos/PopIEVentas.aspx.vb +++ b/Bancos/PopIEVentas.aspx.vb @@ -709,9 +709,10 @@ Partial Class Bancos_PopIEVentas End If Else 'no se pudo validar, pero ya tuvo la primera vuelta de validacion - Alert("La factura no se pudo validar.") + Alert("La factura no se pudo validar.", TipoMensaje.MsgAdvertencia) Validada = False - BtnGuardar.Visible = False + BtnGuardar.Enabled = False + BtnGuardar.ToolTip = "La factura no se pudo validar" End If Valida.Dispose() Else From 6c2d6d99ce9a276005383bd7a3c32cc947ccfa08 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 28 Aug 2021 13:28:00 -0700 Subject: [PATCH 10/30] nuevo permiso para lbierar el cambio de PU --- OC/OC.aspx.vb | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index 92af42596..9e52fbaf9 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -579,7 +579,7 @@ Partial Class OC If Not Page.IsPostBack Then - + GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa) = Nothing CargaDatosAgregarPS() CveProveedorOriginal = -1 'MODALIDAD MULTIEMPRESA @@ -813,7 +813,7 @@ Partial Class OC If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 Then DVCultivosCuadro.Visible = True DdlSubProyecto.AutoPostBack = True - DdlCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyecto.SelectedValue}") + DdlCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyecto.SelectedValue} AND Estatus =1") DdlCultivosCuadro.DataBind() DdlCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1")) @@ -3754,8 +3754,12 @@ Partial Class OC e.Row.FCDropDownList("DdlPS").Enabled = False e.Row.FCDropDownList("DdlClasificacion").Enabled = False e.Row.FCDropDownList("CboUnidadMedidaEdit").Enabled = False - e.Row.FCTextBox("TxtImporteEdit").Enabled = False - e.Row.FCTextBox("TxtDescuentoEdit").Enabled = False + 'que tenga el permiso que no bloquee + If Not UsuarioActual.TienePermisoProceso(329) AndAlso e.Row.DBCampo("CantidadVinculadaCompra").ToDouble = 0 Then 'permite editar pu, aun estando recibida + e.Row.FCTextBox("TxtImporteEdit").Enabled = False + e.Row.FCTextBox("TxtDescuentoEdit").Enabled = False + End If + End If 'DDL PS @@ -3812,7 +3816,7 @@ Partial Class OC If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 Then 'empresa agricola e.Row.FCDropDownList("DdlCultivosCuadroEdit").Visible = True - e.Row.FCDropDownList("DdlCultivosCuadroEdit").DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {e.Row.DBCampo("CveSubProyecto").ToEntero}") + e.Row.FCDropDownList("DdlCultivosCuadroEdit").DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {e.Row.DBCampo("CveSubProyecto").ToEntero} AND Estatus =1") e.Row.FCDropDownList("DdlCultivosCuadroEdit").DataBind() e.Row.FCDropDownList("DdlCultivosCuadroEdit").Items.Insert(0, New ListItem("Seleccione uno", "-1")) @@ -6954,7 +6958,7 @@ Partial Class OC If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 Then DdlCultivosCuadro.Items.Clear() - DdlCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($" CveSubProyecto = {DdlSubProyecto.SelectedValue}") + DdlCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($" CveSubProyecto = {DdlSubProyecto.SelectedValue} AND Estatus =1") DdlCultivosCuadro.DataBind() DdlCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1")) @@ -8530,7 +8534,7 @@ Partial Class OC Dim CveCultivoCuadroDetalle As Integer = GvRow.DataKey("CveCultivoCuadroDetalle").ToString.ToEntero DdlCultivosCuadroEdit.Items.Clear() - DdlCultivosCuadroEdit.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyectoEdit.SelectedValue}") + DdlCultivosCuadroEdit.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyectoEdit.SelectedValue} AND Estatus =1") DdlCultivosCuadroEdit.DataBind() DdlCultivosCuadroEdit.Items.Insert(0, New ListItem("Seleccione uno", "-1")) DdlCultivosCuadroEdit.SelectedValueExist(CveCultivoCuadroDetalle) From b0b4f509dc58ffdf965f72e27c98eb3131a7c4c4 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Mon, 6 Sep 2021 15:38:30 -0700 Subject: [PATCH 11/30] Tareas Programadas Edo Cuenta E119 --- App_Code/Modelos.vb | 1 + Ashx/TareasProgramadas.ashx | 152 ++++++++++++++++++++++++++++-------- 2 files changed, 119 insertions(+), 34 deletions(-) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index b36f28a44..093752da9 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -9902,6 +9902,7 @@ Namespace Modelos Public Property EsDistribuidor As Boolean Public Property CorreoCotizacion As String Public Property ImprimeNombreSucursal As Integer + Public Property CobranzaCorreo As String End Class diff --git a/Ashx/TareasProgramadas.ashx b/Ashx/TareasProgramadas.ashx index e7168ab56..8171b5431 100644 --- a/Ashx/TareasProgramadas.ashx +++ b/Ashx/TareasProgramadas.ashx @@ -20,10 +20,12 @@ Public Class TareasProgramadas : Implements IHttpHandler Dim retorno As String = "no se encontro la variable" Try Dim metodo As String = "" + If context.Request("var") IsNot Nothing Then URLParametros = Parametros(context.Request("var")) metodo = URLParametros("metodo") - ElseIf context.Request.Headers("Content-Type") IsNot Nothing AndAlso context.Request.Headers("Content-Type").Contains("json") AndAlso context.Request.InputStream IsNot Nothing Then + 'SI TRAE UN JSON COMO PARAMETRO + ElseIf context.Request.Headers("Content-Type") IsNot Nothing AndAlso context.Request.Headers("Content-Type").Contains("json") AndAlso context.Request.InputStream IsNot Nothing AndAlso (context.Request("var") Is Nothing AndAlso context.Request("metodo") IsNot Nothing) Then context.Response.ContentType = "application/json" Using reader As New StreamReader(context.Request.InputStream) Dim json = reader.ReadToEnd() @@ -32,6 +34,8 @@ Public Class TareasProgramadas : Implements IHttpHandler metodo = JsonRequest("Metodo").ToString End If End Using + ElseIf context.Request("metodo") IsNot Nothing Then + metodo = context.Request("metodo").ToString() End If Select Case metodo @@ -282,9 +286,13 @@ Public Class TareasProgramadas : Implements IHttpHandler Retorno.Add(obj) Next + + DtEmpresas.Dispose() End If - context.Response.Write(Retorno.ToString()) + GuardaLogEdoCuenta(Retorno.ToString()) + + context.Response.Write("True") End Sub @@ -324,7 +332,8 @@ Public Class TareasProgramadas : Implements IHttpHandler Private Function EjecutarEnvioEstadoCuenta(UsuarioActual As Usuario, Optional pCveCliente As Integer = -1) As JObject - Dim ClientesSinEnviar As New JArray() + Dim ClientesSinEnviar As New JArray() + Dim ClientesEdoEnviado As New JArray() Dim Json As New JObject( New JProperty("Empresa", UsuarioActual.Empresa.Empresa), @@ -333,37 +342,80 @@ Public Class TareasProgramadas : Implements IHttpHandler ) Dim DTClientes As DataTable = Nothing - Using ObjCliente As New ClsClientes - If ObjCliente.GetClientes(pCveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, TipoCliente:=-1, Estatus:=1) Then - If ObjCliente.DtResultados.Rows.Count > 0 Then - DTClientes = ObjCliente.DtResultados.Copy() - End If + 'Using ObjCliente As New ClsClientes + ' If ObjCliente.GetClientes(pCveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, TipoCliente:=-1, Estatus:=1) Then + ' If ObjCliente.DtResultados.Rows.Count > 0 Then + ' DTClientes = ObjCliente.DtResultados.Copy() + ' End If + ' End If + 'End Using + + Using ObjMov As New ClsMovimientos + Dim FechaI As String = "-1" + Dim FechaF As String = "-1" + Dim FechaVI As String = "-1" + Dim FechaVF As String = "-1" + Dim TCEspecifico = -1 + + Dim CveCobranzaEstatus As Integer = -1 + Dim CveClienteClasificacion As Integer = -1 + Dim CveCliente As Integer = -1 + Dim AplicaAnticipos As Integer = 0 + + Dim CveSubProyecto As Integer = -1 + Dim CveVendedor As Integer = -1 + Dim Grupo As Integer = 5 + Dim TipoCambio As Integer = 1 + Dim TipoDocto As String = "-1" + Dim FechaCorte As DateTime = New DateTime(Now.Year, 12, 31) + + If ObjMov.GetCxC(FechaI, FechaF, CveCliente, CveSubProyecto, CveVendedor, -1, -1, "-1", UsuarioActual.CveEmpresa, Grupo, -1, TipoCambio, TCEspecifico, TipoDocto, FechaVI, FechaVF, FechaCorte:=FechaCorte, + EstatusCliente:=1, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveCobranzaEstatus:=CveCobranzaEstatus, CveClienteClasificacion:=-1, TipoCliente:=-1, AplicaAnticiposPagados:=AplicaAnticipos) Then + DTClientes = ObjMov.DtResultados.FiltraParametros("CveCliente > 0", DistinctColumns:={"CveCliente"}) End If + End Using If DTClientes IsNot Nothing Then - For Each RowCliente As DataRow In DTClientes.Rows - Dim CveCliente As Integer = RowCliente("CveCliente").ToString().ToEntero() - Dim Correo As String = RowCliente("CobranzaCorreo").ToString() + 'DTClientes = DTClientes.FiltraParametros("CveCliente IN (227289,227429,227733,227838,228181,228544,229176,229481,230029,230432,230860,230911,230918,231197,231576,232173,232185,233055,233295,233357,233588,236379,236460,237161,237635,238285,238530,238622,238724,239033,239099,239865,239895,239903,240202,240235,240236,240238,240303,240340,262404,262517,264765,264806,264825,264848,264930,265063,265180,265213,265214,265236,265344,265492,265555,265669,265797,265952,265963,266156,266182,268346,268396,268488,268535,268539,268558,268562,268706,268726,268787,268868,268889,268910,268925,269023,269081,269089,272066,272070,272657,273080,273084,275627,276259,276587,281115,283110,284664,285392,287653,288711,291374,292444,295578,296375,296598,302728,303936,306897,307183,311007,320060,320685,320800,323520,323772,325237,326996,327801,330630,331741,332118,337105,340502,341796,342807,343858,355862,358123,365794,371524,375391,377122,377948,378267,380167,381210,381878,383098,383250,383339,383650,384472,385321,385585,386630,387114,388987,396341,396405,396541,401995,404175,408306,416386,416819,420275,438732,447566,447636,450284,464150,464376,468051,475172,475932,476984,477997,478426)") + + For Each RowCliente As DataRow In DTClientes.Rows + + Dim CveCliente As Integer = RowCliente("CveCliente").ToString().ToEntero() Dim Cliente As New Modelos.ClienteModel(CveCliente, UsuarioActual.CveEmpresa) - Dim Envio = EnviarEstadoCuenta(UsuarioActual, Correo, Cliente) + If Cliente IsNot Nothing Then + Dim Correo As String = Cliente.CobranzaCorreo '"japmx95@gmail.com" 'RowCliente("CobranzaCorreo").ToString() - If Envio Then - Using ObjBitacora As New ClsOIEventos - ObjBitacora.AddEventoBitacora("Se envió correo con el estado de cuenta del cliente", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCliente:=Cliente.CveCliente) - End Using - Else - ClientesSinEnviar.Add(New JObject( - New JProperty("CveCliente", Cliente.CveCliente), - New JProperty("Cliente", Cliente.Nombre) - )) - End If + Dim Envio As Boolean = False + If Not String.IsNullOrEmpty(Correo) Then + Envio = EnviarEstadoCuenta(UsuarioActual, Correo, Cliente) + End If + + If Envio Then + + ClientesEdoEnviado.Add(New JObject( + New JProperty("CveCliente", Cliente.CveCliente), + New JProperty("Cliente", Cliente.Nombre) + )) + + Using ObjBitacora As New ClsOIEventos + ObjBitacora.AddEventoBitacora("Se envió correo con el estado de cuenta del cliente", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCliente:=Cliente.CveCliente) + End Using + Else + ClientesSinEnviar.Add(New JObject( + New JProperty("CveCliente", Cliente.CveCliente), + New JProperty("Cliente", Cliente.Nombre) + )) + End If + End If + Next DTClientes.Dispose() End If - Json.Add(New JProperty("ClientesSinEnviar", ClientesSinEnviar)) + Json.Add(New JProperty("ClientesSinEnviar", ClientesSinEnviar)) + Json.Add(New JProperty("ClientesEdoEnviado", ClientesEdoEnviado)) Return Json End Function @@ -616,10 +668,12 @@ Public Class TareasProgramadas : Implements IHttpHandler
ESTE CORREO SE GENERO EN FORMA AUTOMATICA.", Cliente.NombreComercial, UsuarioActual.Empresa.Empresa) - Retorno = MandaCorreo(ArchivoPDF, Correo, $"Estado Actual de Cartera {UsuarioActual.Empresa.Empresa}", Cuerpo) + Dim Hilo As New System.Threading.Thread(Sub() MandaCorreo(ArchivoPDF, Correo, $"Estado Actual de Cartera {UsuarioActual.Empresa.Empresa}", Cuerpo)) + Hilo.Start() + Retorno = True Catch ex As Exception Retorno = False - OnError("Ocurrió un error al enviar el correo", ex) + OnError("Ocurrió error al mandar el correo de estado de cuenta", ex) End Try Else Retorno = False @@ -683,17 +737,47 @@ Public Class TareasProgramadas : Implements IHttpHandler Return Bytes End Function - Private Function MandaCorreo(File As Byte(), Para As String, Asunto As String, Body As String) As Boolean + Private Function MandaCorreo(File As Byte(), Para As String, Asunto As String, Body As String) As Boolean + 'Para = "japmx95@gmail.com" + Try + Dim a As String = String.Format("{0} -- {1} ---- -->", Asunto, Para) + 'a.GuardaLog() + Dim Mail As New ClsSisMail() + + Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail) + LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.ArchivoBinario = File, .NombreArchivo = "EstadoDeCuenta.pdf"}) + + Return Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, Archivos:=LSRutasMail) + Catch ex As Exception + OnError("Ocurrió un error al enviar el correo de edo cuenta", ex) + Return False + End Try - Dim a As String = String.Format("{0} -- {1} ---- -->", Asunto, Para) - 'a.GuardaLog() - Dim Mail As New ClsSisMail() - - Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail) - LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.ArchivoBinario = File, .NombreArchivo = "EstadoDeCuenta.pdf"}) - - Return Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, Archivos:=LSRutasMail) End Function + + Public Sub GuardaLogEdoCuenta(Str As String) + Dim ArchivoW As StreamWriter + Dim strLineaTMP As String + + ' strLineaTMP = Chr(13) & Chr(10) & Day(Now) & "/" & Month(Now) & "/" & Year(Now) & " " & Hour(Now) & ":" & Minuto & ". " & Str & Chr(13) & Chr(10) + strLineaTMP = String.Format("{0}{1}Log: {2}{3}:{4}", Chr(13), Chr(10), Str, DateTime.Now.ToShortDateString, DateTime.Now.ToShortTimeString) + Try + ArchivoW = New StreamWriter(String.Format("{0}\Log\LogEdoCuenta.txt", ModExtensiones.DirectorioBaseEmpresas), True, System.Text.Encoding.UTF8) + Catch ex As UnauthorizedAccessException + 'Alert("No hay permisos para guardar en el Log.", Extensiones.TipoMensaje.MsgError) + Exit Sub + Catch ex As Exception + Exit Sub + End Try + + Try + ArchivoW.WriteLine(strLineaTMP) + Catch + End Try + + ArchivoW.Close() + ArchivoW.Dispose() + End Sub #End Region End Class \ No newline at end of file From 475e32bfedf59b49df9ffd79239f1283d258d906 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Mon, 6 Sep 2021 15:38:51 -0700 Subject: [PATCH 12/30] Impresion de Deposito de caja --- Bancos/DepositosCaja.aspx.vb | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Bancos/DepositosCaja.aspx.vb b/Bancos/DepositosCaja.aspx.vb index 8ad8491f4..a5a1fb0a0 100644 --- a/Bancos/DepositosCaja.aspx.vb +++ b/Bancos/DepositosCaja.aspx.vb @@ -304,17 +304,20 @@ Partial Class Bancos_DepositosCaja End If 'Asignamos la cuenta Deposito - If Not OcurrioError AndAlso Not ObjBancos.UpdateBancos_IECuentaDeposito(CveIEDestino, CveIE) Then + If Not OcurrioError AndAlso Not ObjBancos.UpdateBancos_IECuentaDeposito(CveIEOrigen, CveIE) Then OcurrioError = True Exit For - End If - Dim StrEncript As String = Encripta($"OP=DC&CveIE={CveIEDestino}&CuentaCaja={DdlCajaChica.SelectedItem.Text}&CuentaDepo={DdlCuentaDeposito.SelectedItem.Text}") - - 'documentos += String.Format("Imprimir {1}

", StrEncript, SerieFolio) + End If + + End If - Next - + Next + + Dim StrEncript As String = Encripta($"OP=DC&CveIE={CveIEOrigen}&CuentaCaja={DdlCajaChica.SelectedItem.Text}&CuentaDepo={DdlCuentaDeposito.SelectedItem.Text}") + + + documentos += String.Format("
Imprimir {1}

", StrEncript, "Depósito Bancario") If OcurrioError Then ObjContabilidad.RollBack() From 65235052f56a16ac58447257eecf6d3b53f7e334 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Mon, 6 Sep 2021 15:39:07 -0700 Subject: [PATCH 13/30] Correcion en impresion de movimiento --- Compras/PopUpVerFactura.aspx.vb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 53ad84d4f..7bf565dd8 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -2448,7 +2448,11 @@ Partial Class PopUpVerFactura Dim ClienteNombre = "", EnvioContacto = "", EnvioDireccion = "", EnvioColonia = "", EnvioCiudad = "", EnvioEstado = "", ClientePais = "", EnvioCP = "", Contrato = "", Paqueteria = "", NumContrato = "", Guia = "" - Dim CveContrato As Integer = DtMovimientos(0)("CveContrato").ToString.ToEntero + Dim CveContrato As Integer = 0 + If DtMovimientos IsNot Nothing AndAlso DtMovimientos.Rows.Count > 0 Then + CveContrato = DtMovimientos(0)("CveContrato").ToString.ToEntero + End If + If CveContrato > 0 Then Contrato = GlobalDTContratos(UsuarioActual.CveEmpresa).FiltroPrimeroValor("DescripcionContrato", $"CveContrato={CveContrato} AND CveEmpresa = {UsuarioActual.CveEmpresa}") NumContrato = GlobalDTContratos(UsuarioActual.CveEmpresa).FiltroPrimeroValor("NumeroContrato", $"CveContrato={CveContrato} AND CveEmpresa = {UsuarioActual.CveEmpresa}") From 8b726f41fa9082e46286bfe60df3176e594692fa Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Mon, 6 Sep 2021 15:39:27 -0700 Subject: [PATCH 14/30] Correcion de excel RepUtilidadPadre --- .../Formatos/RepVentasUtilidadPadre.rdlc | 3225 ++++++++--------- 1 file changed, 1588 insertions(+), 1637 deletions(-) diff --git a/Empresas/Grales/Formatos/RepVentasUtilidadPadre.rdlc b/Empresas/Grales/Formatos/RepVentasUtilidadPadre.rdlc index 5e314ec69..49340acb0 100644 --- a/Empresas/Grales/Formatos/RepVentasUtilidadPadre.rdlc +++ b/Empresas/Grales/Formatos/RepVentasUtilidadPadre.rdlc @@ -1,1638 +1,1589 @@ - - - - - - - - - - - - true - true - - - - - Grupo - - - - - - - Textbox28 - - - - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - 1.78756cm - - - 1.7468cm - - - 1.87995cm - - - 1.75936cm - - - 1.99234cm - - - 0.7279cm - - - 2.03612cm - - - 0.67438cm - - - 1.94909cm - - - 0.5862cm - - - 1.38875cm - - - - - 0.46771cm - - - - - true - true - - - - - =Fields!Ventas.Value - - - - - - - Ventas - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Descuento.Value - - - - - - - Descuento - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Bonificacion.Value - - - - - - - Bonificacion - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Costo.Value - - - - - - - Costo - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Utilidad.Value - - - - - - - Utilidad - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PorUtilidad.Value - - - - - - - PorUtilidad - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Perdida.Value - - - - - - - Perdida - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PorPerdida.Value - - - - - - - PorPerdida - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Neto.Value - - - - - - - Neto - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PorNeto.Value - - - - - - - PorNeto - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Rentabilidad.Value - - - - - - - Rentabilidad - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - 0.46771cm - - - true - true - - - - - Ventas - - - - - - - Textbox18 - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.46771cm - - - true - true - - - - - Descuento - - - - - - - Textbox25 - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.46771cm - - - true - true - - - - - Bonificacion - - - - - - - Textbox20 - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.46771cm - - - true - true - - - - - Costo - - - - - - - Textbox17 - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.46771cm - - - true - true - - - - - Utilidad - - - - - - - Textbox6 - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.46771cm - - - true - true - - - - - % - - - - - - - Textbox14 - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.46771cm - - - true - true - - - - - Perdida - - - - - - - Textbox4 - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.46771cm - - - true - true - - - - - % - - - - - - - Textbox16 - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.46771cm - - - true - true - - - - - Neto - - - - - - - Textbox15 - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.46771cm - - - true - true - - - - - % - - - - - - - Textbox19 - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.46771cm - - - true - true - - - - - % Rent. - - - - - - - Textbox21 - - - Gray - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - 3.0587cm - - - true - true - - - - - =iif(Fields!GPO.Value="","Total",Fields!GPO.Value) - - - - - - - GPO - - - =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - DataSet1 - 3.29875cm - 0.06614cm - 0.93542cm - 19.58715cm - - - - - - true - true - - - - - =Parameters!Filtros.Value - HTML - - - - - - - Textbox1 - 0.07056cm - 0.06614cm - 0.58236cm - 19.58715cm - 1 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =iif(CDbl(Parameters!Neto.Value) > 0,"UTILIDAD","PERDIDA") - HTML - - - - - - - Textbox1 - 1.01452cm - 5.03122cm - 1.73771cm - 5.11444cm - 2 - - - =iif(CDbl(Parameters!Neto.Value) > 0,"SeaGreen","Maroon") - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Neto.Value - HTML - - - - - - - Textbox1 - 1.85236cm - 5.34872cm - 0.58236cm - 2.59949cm - 3 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!PorNeto.Value - HTML - - - - - - - Textbox1 - 1.85236cm - 8.14257cm - 0.58236cm - 1.68559cm - 4 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - = "RENTABILIDAD" - HTML - - - - - - - Textbox1 - 1.01452cm - 10.71594cm - 1.73771cm - 5.11444cm - 5 - - - SeaGreen - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Rentabilidad.Value - HTML - - - - - - - Textbox1 - 1.85236cm - 12.93844cm - 0.58236cm - 2.59949cm - 6 - - - 2pt - 2pt - 2pt - 2pt - - - - 1.667in - - - - - - - Textbox1 - 2.43857cm - 0.6cm - 14.68354cm - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - REPORTE DE UTILIDAD O PÉRDIDA SOBRE VENTAS - - - - - - - - - - - - - - - - Textbox2 - 0.6cm - 2.40329cm - 0.52945cm - 14.68354cm - 1 - - - 2pt - 2pt - 2pt - 2pt - - - - External - =Parameters!LogoPath.Value - FitProportional - 0.06614cm - 2.22362cm - 2.33715cm - 2 - - - - - - - - - - - 1.08126cm - true - true - - - true - true - - - - - ="Página " & Globals.PageNumber & " de " & Globals.TotalPages - - - - - - - Textbox3 - 0.40041cm - 16.97887cm - 0.68085cm - 2.06587cm - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =iif(Globals.PageNumber = Globals.TotalPages, "Usuario: ", "") - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =iif(Globals.PageNumber = Globals.TotalPages, Parameters!UsuarioImprimio.Value, "") - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =iif(Globals.PageNumber = Globals.TotalPages, "Fecha Impresión: ", "") - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =iif(Globals.PageNumber = Globals.TotalPages, Parameters!FechaImpresion.Value, "") - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 29.7cm - 21cm - 0.5cm - 0.5cm - 1cm - 1cm - 0.13cm - + + + + + + + + + HTML + + + + + + + + + =Parameters!Rentabilidad.Value + HTML + + + + + + + Textbox1 + 1.01452cm + 10.29851cm + 1.73771cm + 5.43074cm + + + SeaGreen + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + true + true + + + + + Grupo + + + + + + + Textbox28 + + + + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + 1.78756cm + + + 1.7468cm + + + 1.87995cm + + + 1.75936cm + + + 1.99234cm + + + 0.7279cm + + + 2.03612cm + + + 0.67438cm + + + 1.94909cm + + + 0.5862cm + + + 1.38875cm + + + + + 0.46771cm + + + + + true + true + + + + + =Fields!Ventas.Value + + + + + + + Ventas + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Descuento.Value + + + + + + + Descuento + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Bonificacion.Value + + + + + + + Bonificacion + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Costo.Value + + + + + + + Costo + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Utilidad.Value + + + + + + + Utilidad + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PorUtilidad.Value + + + + + + + PorUtilidad + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Perdida.Value + + + + + + + Perdida + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PorPerdida.Value + + + + + + + PorPerdida + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Neto.Value + + + + + + + Neto + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PorNeto.Value + + + + + + + PorNeto + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Rentabilidad.Value + + + + + + + Rentabilidad + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + 0.46771cm + + + true + true + + + + + Ventas + + + + + + + Textbox18 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + Descuento + + + + + + + Textbox25 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + Bonificacion + + + + + + + Textbox20 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + Costo + + + + + + + Textbox17 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + Utilidad + + + + + + + Textbox6 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + % + + + + + + + Textbox14 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + Perdida + + + + + + + Textbox4 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + % + + + + + + + Textbox16 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + Neto + + + + + + + Textbox15 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + % + + + + + + + Textbox19 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + % Rent. + + + + + + + Textbox21 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + 3.0587cm + + + true + true + + + + + =iif(Fields!GPO.Value="","Total",Fields!GPO.Value) + + + + + + + GPO + + + =IIF(Fields!GPO.Value="", "CornflowerBlue", "Transparent") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + DataSet1 + 3.29875cm + 0.06614cm + 0.93542cm + 19.58715cm + 1 + + + + + + true + true + + + + + =Parameters!Filtros.Value + HTML + + + + + + + Textbox1 + 0.07056cm + 0.06614cm + 0.58236cm + 19.58715cm + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + true + + + + + = "UTILIDAD" + HTML + + + + + + + + + + HTML + + + + + + + + + = ("$" + Parameters!Neto.Value + " &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp " + Parameters!PorNeto.Value) + HTML + + + + + + + Textbox1 + 1.01452cm + 3.09309cm + 1.73771cm + 5.43074cm + 3 + + + SeaGreen + 2pt + 2pt + 2pt + 2pt + + + + 1.667in + + + + + + + Textbox1 + 2.43857cm + 0.6cm + 14.68354cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + REPORTE DE UTILIDAD O PÉRDIDA SOBRE VENTAS + + + + + + + + + + + + + + + + Textbox2 + 0.6cm + 2.40329cm + 0.52945cm + 14.68354cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + External + =Parameters!LogoPath.Value + FitProportional + 0.06614cm + 2.22362cm + 2.33715cm + 2 + + + + + + + + + + + 1.08126cm + true + true + + + true + true + + + + + ="Página " & Globals.PageNumber & " de " & Globals.TotalPages + + + + + + + Textbox3 + 0.40041cm + 16.97887cm + 0.68085cm + 2.06587cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =iif(Globals.PageNumber = Globals.TotalPages, "Usuario: ", "") + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =iif(Globals.PageNumber = Globals.TotalPages, Parameters!UsuarioImprimio.Value, "") + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =iif(Globals.PageNumber = Globals.TotalPages, "Fecha Impresión: ", "") + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =iif(Globals.PageNumber = Globals.TotalPages, Parameters!FechaImpresion.Value, "") + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 29.7cm + 21cm + 0.5cm + 0.5cm + 1cm + 1cm + 0.13cm +