From ff80f9f7b5c73012b1dd402aeeffe9590556f045 Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 24 Jan 2025 23:08:51 -0700 Subject: [PATCH 01/12] =?UTF-8?q?--=20cambio=20de=20m=C3=A9todo=20de=20pag?= =?UTF-8?q?o=20a=20forma=20de=20pago?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsRH.vb | 23 ++++++++++++----------- RH/Personal.aspx | 10 +++++++++- RH/Personal.aspx.vb | 10 +++++++--- 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index 7617ad869..241ce2730 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -1555,8 +1555,8 @@ Public Class ClsRH Public Property SalarioDiarioSS As Decimal Public Property NumDiasAguinaldo As Integer Public Property PorPrimaVacacional As Decimal - 'Public Property Bono As Double Public Property CveMetodoPago As Integer + Public Property CveFormaPago As Integer Public Property MetodoPago As String Public Property MetodoPagoSAT As String Public Property CLABE As String @@ -1603,7 +1603,7 @@ Public Class ClsRH Public Function GetPersonal(CvePersonal As Integer, Codigo As String, Nombre As String, NSS As String, RFC As String, CveTurno As Integer, CvePuesto As Integer, CveDepartamento As Integer, CveRuta As Integer, CveEscolaridad As Integer, CveEstadoCivil As Integer, CveGenero As Integer, CveEstatusPersonal As Integer, CveSubProyecto As Integer, CveClienteAsignado As Integer, HorarioTrabajo As String, CveSupervisor As Integer, - CveTipoPeriodo As Integer, CveMetodoPago As Integer, CveTipoContrato As Integer, CveMotivoBaja As Integer, CveProyecto As Integer, + CveTipoPeriodo As Integer, CveFormaPago As Integer, CveTipoContrato As Integer, CveMotivoBaja As Integer, CveProyecto As Integer, FechaIFinContrato As String, FechaFFinContrato As String, FechaIIngreso As String, FechaFIngreso As String, CveEmpresa As Integer, Optional EsReserva As Integer = -1) As Boolean Dim Retorno As Boolean = False @@ -1628,7 +1628,7 @@ Public Class ClsRH .Add("@HorarioTrabajo", SqlDbType.VarChar).Value = HorarioTrabajo .Add("@CveSupervisor", SqlDbType.Int).Value = CveSupervisor .Add("@CveTipoPeriodo", SqlDbType.Int).Value = CveTipoPeriodo - .Add("@CveMetodoPago", SqlDbType.Int).Value = CveMetodoPago + .Add("@CveFormaPago", SqlDbType.Int).Value = CveFormaPago .Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato .Add("@CveMotivoBaja", SqlDbType.Int).Value = CveMotivoBaja .Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto @@ -1668,8 +1668,9 @@ Public Class ClsRH 'Me.Bono = Data.Rows(0)("Bono").ToString.ToDouble Me.SalarioDiarioSS = Data.Rows(0)("SalarioDiarioSS").ToString.ToDecimal Me.NumDiasAguinaldo = Data.Rows(0)("NumDiasAguinaldo").ToString.ToEntero - Me.PorPrimaVacacional = Data.Rows(0)("PorPrimaVacacional").ToString.ToDecimal + Me.PorPrimaVacacional = Data.Rows(0)("PorPrimaVacacional").ToString.ToDecimal Me.CveMetodoPago = Data.Rows(0)("CveMetodoPago").ToString.ToEntero + Me.CveFormaPago = Data.Rows(0)("CveFormaPago").ToString.ToEntero Me.MetodoPago = Data.Rows(0)("MetodoPago").ToString Me.MetodoPagoSAT = Data.Rows(0)("MetodoPagoSAT").ToString @@ -1780,7 +1781,7 @@ Public Class ClsRH Public Function GetPersonal2(CvePersonal As Integer, Codigo As String, Nombre As String, NSS As String, RFC As String, CveTurno As Integer, CvePuesto As Integer, CveDepartamento As Integer, CveRuta As Integer, CveEscolaridad As Integer, CveEstadoCivil As Integer, CveGenero As Integer, CveEstatusPersonal As Integer, CveSubProyecto As Integer, CveClienteAsignado As Integer, HorarioTrabajo As String, CveSupervisor As Integer, - CveTipoPeriodo As Integer, CveMetodoPago As Integer, CveTipoContrato As Integer, CveMotivoBaja As Integer, CveProyecto As Integer, + CveTipoPeriodo As Integer, CveFormaPago As Integer, CveTipoContrato As Integer, CveMotivoBaja As Integer, CveProyecto As Integer, FechaIFinContrato As String, FechaFFinContrato As String, FechaIIngreso As String, FechaFIngreso As String, SqlStr As String, NCaracteristicas As Integer, CveEmpresa As Integer, Optional TopSelect As Integer = 10000, Optional EsReserva As Integer = -1) As Boolean @@ -1806,7 +1807,7 @@ Public Class ClsRH .Add("@HorarioTrabajo", SqlDbType.VarChar).Value = HorarioTrabajo .Add("@CveSupervisor", SqlDbType.Int).Value = CveSupervisor .Add("@CveTipoPeriodo", SqlDbType.Int).Value = CveTipoPeriodo - .Add("@CveMetodoPago", SqlDbType.Int).Value = CveMetodoPago + .Add("@CveFormaPago", SqlDbType.Int).Value = CveFormaPago .Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato .Add("@CveMotivoBaja", SqlDbType.Int).Value = CveMotivoBaja .Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto @@ -1846,7 +1847,7 @@ Public Class ClsRH Me.SalarioDiarioSS = Data.Rows(0)("SalarioDiarioSS").ToString.ToDecimal Me.NumDiasAguinaldo = Data.Rows(0)("NumDiasAguinaldo").ToString.ToEntero Me.PorPrimaVacacional = Data.Rows(0)("PorPrimaVacacional").ToString.ToDecimal - Me.CveMetodoPago = Data.Rows(0)("CveMetodoPago").ToString.ToEntero + Me.CveFormaPago = Data.Rows(0)("CveFormaPago").ToString.ToEntero Me.MetodoPago = Data.Rows(0)("MetodoPago").ToString Me.MetodoPagoSAT = Data.Rows(0)("MetodoPagoSAT").ToString @@ -1975,7 +1976,7 @@ Public Class ClsRH Return Retorno End Function Public Function AddPersonal(Codigo As String, APaterno As String, AMaterno As String, Nombres As String, Correo As String, FechaIngreso As Date, CveTipoPeriodo As Integer, NumeroSS As String, SeInscribioSS As Boolean, SalarioDiarioPago As Double, SalarioDiario As Double, SDI As Double, - SalarioDiarioSS As Double, Bono As Double, NumDiasAguinaldo As Integer, PorPrimaVacacional As Double, CveMetodoPago As Integer, FechaInicioContrato As Date, FechaFinContrato As String, + SalarioDiarioSS As Double, Bono As Double, NumDiasAguinaldo As Integer, PorPrimaVacacional As Double, CveFormaPago As Integer, FechaInicioContrato As Date, FechaFinContrato As String, CveTipoContrato As Integer, Ubicacion As String, CveTurno As Integer, CvePuesto As Integer, CveDepartamento As Integer, CveRuta As Integer, CveEscolaridad As Integer, CveEstadoCivil As Integer, CveGenero As Integer, CveMotivoBaja As Integer, FechaBaja As String, CveEstatusPersonal As Integer, FechaNacimiento As Date, LugarNacimiento As String, Calle As String, NumExt As String, NumInt As String, Colonia As String, CP As String, Ciudad As String, CveEstado As Integer, Telefono As String, TelefonoEmergencia As String, Celular As String, RFC As String, CURP As String, CredencialElector As String, @@ -2008,7 +2009,7 @@ Public Class ClsRH .Add("@Bono", SqlDbType.Money).Value = Bono .Add("@NumDiasAguinaldo", SqlDbType.Int).Value = NumDiasAguinaldo .Add("@PorPrimaVacacional", SqlDbType.Float).Value = PorPrimaVacacional - .Add("@CveMetodoPago", SqlDbType.Int).Value = CveMetodoPago + .Add("@CveFormaPago", SqlDbType.Int).Value = CveFormaPago .Add("@FechaInicioContrato", SqlDbType.Date).Value = FechaInicioContrato .Add("@FechaFinContrato", SqlDbType.VarChar).Value = FechaFinContrato .Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato @@ -2130,7 +2131,7 @@ Public Class ClsRH Public Function UpdatePersonal(Codigo As String, APaterno As String, AMaterno As String, Nombres As String, Correo As String, FechaIngreso As Date, CveTipoPeriodo As Integer, NumeroSS As String, SeInscribioSS As Boolean, SalarioDiarioPago As Double, SalarioDiario As Double, SDI As Double, - SalarioDiarioSS As Double, Bono As Double, NumDiasAguinaldo As Integer, PorPrimaVacacional As Double, CveMetodoPago As Integer, FechaInicioContrato As Date, FechaFinContrato As String, + SalarioDiarioSS As Double, Bono As Double, NumDiasAguinaldo As Integer, PorPrimaVacacional As Double, CveFormaPago As Integer, FechaInicioContrato As Date, FechaFinContrato As String, CveTipoContrato As Integer, Ubicacion As String, CveTurno As Integer, CvePuesto As Integer, CveDepartamento As Integer, CveRuta As Integer, CveEscolaridad As Integer, CveEstadoCivil As Integer, CveGenero As Integer, CveMotivoBaja As Integer, FechaBaja As String, CveEstatusPersonal As Integer, FechaNacimiento As Date, LugarNacimiento As String, Calle As String, NumExt As String, NumInt As String, Colonia As String, CP As String, Ciudad As String, CveEstado As Integer, Telefono As String, TelefonoEmergencia As String, Celular As String, RFC As String, CURP As String, CredencialElector As String, @@ -2165,7 +2166,7 @@ Public Class ClsRH .Add("@Bono", SqlDbType.Money).Value = Bono .Add("@NumDiasAguinaldo", SqlDbType.Int).Value = NumDiasAguinaldo .Add("@PorPrimaVacacional", SqlDbType.Float).Value = PorPrimaVacacional - .Add("@CveMetodoPago", SqlDbType.Int).Value = CveMetodoPago + .Add("@CveFormaPago", SqlDbType.Int).Value = CveFormaPago .Add("@FechaInicioContrato", SqlDbType.Date).Value = FechaInicioContrato .Add("@FechaFinContrato", SqlDbType.VarChar).Value = FechaFinContrato .Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato diff --git a/RH/Personal.aspx b/RH/Personal.aspx index 489ecb236..32e1ab0a1 100644 --- a/RH/Personal.aspx +++ b/RH/Personal.aspx @@ -1643,7 +1643,7 @@ -
+
@@ -1651,6 +1651,14 @@
+
+ + + + + + +
diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb index abd96ff48..0135cf003 100644 --- a/RH/Personal.aspx.vb +++ b/RH/Personal.aspx.vb @@ -1418,6 +1418,9 @@ Partial Class RH_Personal Private Sub CargaMetodosPago() DdlMetodoPago.DataSource = GlobalDTVtaMetodoPago DdlMetodoPago.DataBind() + + DdlFormaPago.DataSource = GlobalDTVtaFormaPago + DdlFormaPago.DataBind() End Sub Private Sub CargaTipoRegimen() @@ -1863,7 +1866,8 @@ Partial Class RH_Personal TxtPorPrimaVacacional.Text = ObjPersonal.PorPrimaVacacional.ToString() TxtFIPrimaVacacional.Text = ObjPersonal.PorPrimaVacacional.ToString() - DdlMetodoPago.SelectedValue = ObjPersonal.CveMetodoPago.ToString() + 'DdlMetodoPago.SelectedValue = ObjPersonal.CveMetodoPago.ToString() + DdlFormaPago.SelectedValue = ObjPersonal.CveFormaPago.ToString() TxtBancoNumCuenta.Text = ObjPersonal.BancoNumCuenta TxtCLABE.Text = ObjPersonal.CLABE DdlSupervisorOrganigrama.SelectedValueExist(If(ObjPersonal.CvePersonalPadre = ObjPersonal.CvePersonal, "0", If(ObjPersonal.CvePersonalPadre.ToString() = "0", "-1", ObjPersonal.CvePersonalPadre.ToString()))) @@ -2036,7 +2040,7 @@ Partial Class RH_Personal If ObjPersonal.AddPersonal(TxtCodigo.Text.Trim, TxtAPaterno.Text.Trim, TxtAMaterno.Text.Trim, TxtNombres.Text.Trim, TxtCorreo.Text.Trim, TxtFechaIngreso.Text.ToDate, DdlTipoPeriodo.SelectedValue.ToEntero(), TxtNumeroSS.Text.Trim, ChkSeInscribioSS.Checked, TxtSalarioDiarioPago.Text.Trim.ToDouble, TxtSalarioDiario.Text.Trim.ToDouble, TxtSDI.Text.Trim.ToDouble, TxtSalarioCotizado.Text.Trim.ToDouble, TxtBono.Text.Trim.ToDouble, TxtNumDiasAguinaldo.Text.Trim.ToEntero(), - TxtPorPrimaVacacional.Text.Trim.ToDouble, DdlMetodoPago.SelectedValue.ToEntero(), TxtFechaInicioContrato.Text.Trim.ToDate, If(IsDate(TxtFechaFinContrato.Text.Trim()), TxtFechaFinContrato.Text.Trim(), "-1"), + TxtPorPrimaVacacional.Text.Trim.ToDouble, DdlFormaPago.SelectedValue.ToEntero(), TxtFechaInicioContrato.Text.Trim.ToDate, If(IsDate(TxtFechaFinContrato.Text.Trim()), TxtFechaFinContrato.Text.Trim(), "-1"), DdlTipoContrato.SelectedValue.ToEntero(), TxtUbicacion.Text.Trim, DdlTurno.SelectedValue.ToEntero(), DdlPuesto.SelectedValue.ToEntero(), DdlDepartamento.SelectedValue.ToEntero(), @@ -2121,7 +2125,7 @@ Partial Class RH_Personal If ObjPersonal.UpdatePersonal(TxtCodigo.Text.Trim, TxtAPaterno.Text.Trim, TxtAMaterno.Text.Trim, TxtNombres.Text.Trim, TxtCorreo.Text.Trim, TxtFechaIngreso.Text.ToDate, DdlTipoPeriodo.SelectedValue.ToEntero(), TxtNumeroSS.Text.Trim, ChkSeInscribioSS.Checked, TxtSalarioDiarioPago.Text.Trim.ToDouble, TxtSalarioDiario.Text.Trim.ToDouble, TxtSDI.Text.Trim.ToDouble, TxtSalarioCotizado.Text.Trim.ToDouble, TxtBono.Text.Trim.ToDouble, TxtNumDiasAguinaldo.Text.Trim.ToEntero(), - TxtPorPrimaVacacional.Text.Trim.ToDouble, DdlMetodoPago.SelectedValue.ToEntero(), TxtFechaInicioContrato.Text.Trim.ToDate, If(IsDate(TxtFechaFinContrato.Text.Trim()), TxtFechaFinContrato.Text.Trim(), "-1"), + TxtPorPrimaVacacional.Text.Trim.ToDouble, DdlFormaPago.SelectedValue.ToEntero(), TxtFechaInicioContrato.Text.Trim.ToDate, If(IsDate(TxtFechaFinContrato.Text.Trim()), TxtFechaFinContrato.Text.Trim(), "-1"), DdlTipoContrato.SelectedValue.ToEntero(), TxtUbicacion.Text.Trim, DdlTurno.SelectedValue.ToEntero(), DdlPuesto.SelectedValue.ToEntero(), DdlDepartamento.SelectedValue.ToEntero(), From 5da45e3567440cdef11df4addbc380ccaf614d28 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 25 Jan 2025 10:02:53 -0700 Subject: [PATCH 02/12] =?UTF-8?q?-=20permiso=20para=20editar=20precio=20de?= =?UTF-8?q?=20PU=20en=20la=20vinculaci=C3=B3n=20de=20la=20OC=20proceso=202?= =?UTF-8?q?42?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Compras/Compras.aspx | 14 +++++++------- Compras/Compras.aspx.vb | 25 ++++++++++++++++++++++--- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index 991711e94..347c97878 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -1783,6 +1783,7 @@ <%----%> + @@ -1945,8 +1946,8 @@ - - + + <%-- --%> @@ -6674,7 +6675,7 @@ - function CalculaTotalOCEdit(PS, CantidadOriginal, TxtCantidad, TxtPU, TxtTotal, IEPSOriginal, HdnIEPS, IVAOriginal, HdnIVA, RetIVAOriginal, HdnRetIVA, RetISROriginal, HdnRetISR, IEPSIVAOriginal, HdnIEPSIVA, DescuentoOriginal, HdnDescuento, IVAPorcentaje, RetIVAPorcentaje, RetISRPorcentaje, IEPSPSPorcentaje, IEPSPSIVAPorcentaje) { + function CalculaTotalOCEdit(PS, CantidadOriginal, PUOriginal, TxtCantidad, TxtPU, TxtTotal, IEPSOriginal, HdnIEPS, IVAOriginal, HdnIVA, RetIVAOriginal, HdnRetIVA, RetISROriginal, HdnRetISR, IEPSIVAOriginal, HdnIEPSIVA, DescuentoOriginal, HdnDescuento, IVAPorcentaje, RetIVAPorcentaje, RetISRPorcentaje, IEPSPSPorcentaje, IEPSPSIVAPorcentaje) { //var Proporcional = ((ToDouble(TxtCantidad.value) * 100) / CantidadOriginal) / 100; @@ -6702,8 +6703,7 @@ TxtTotal.value = FormatoNumero(Total - ToDouble(HdnDescuento.value), 2); //RECALCULA IMPORTES GENERALES - CalculaTotalesOC(); - + CalculaTotalesOC(); } function ValidaImporteCero(PS, TxtCantidad, TxtPU) { @@ -6749,7 +6749,7 @@ }); //Amortizacion = ToDouble($get('C_Tab_TabGenerales_LblAmortizacion').innerText); - + debugger; SumaTotal = SumaSubTotal + SumaIVA + SumaIEPS - SumaRetIVA - SumaRetISR; if ($get("C_Tab_TabOC_LbSubTotalOC1")) { @@ -6780,7 +6780,7 @@ $get("C_Tab_TabOC_LblRetISROC1").innerText = FormatoNumero(SumaRetISR, 2); } if ($get("C_Tab_TabOC_LbTotalOC1")) { - $get("C_Tab_TabOC_LbTotalOC1").innerText = FormatoNumero(SumaTotal, 2); + $get("C_Tab_TabOC_LbTotalOC1").value = FormatoNumero(SumaTotal, 2); } } diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index d8c2d3080..bee5af74b 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -13,7 +13,6 @@ Imports MoreLinq Imports System.Data.SqlClient Imports ClsPaginas Imports Microsoft.Reporting.WebForms -Imports DocumentFormat.OpenXml.Math Partial Class Compras_Compras Inherits ClsPaginas @@ -283,6 +282,15 @@ Partial Class Compras_Compras End Set End Property + Private Property PermisoVinculacionImporteDiferente As Boolean + Get + Return CType(ViewState("PermisoVinculacionImporteDiferente"), Boolean) + End Get + Set(value As Boolean) + ViewState("PermisoVinculacionImporteDiferente") = value + End Set + End Property + Private Property NuevaValidacionXML As Integer Get Return ViewState("NuevaValidacionXML").ToString.ToEntero @@ -1260,6 +1268,7 @@ Partial Class Compras_Compras 'ImgBtnBuscarOC.Attributes.Add("data-placement", "top") EsGrupoDiaz = If(UsuarioActual.Empresa.Funcionalidad(382) = "1", True, False) TienePermisoKardex = If(UsuarioActual.TienePermisoPagina(224), True, False) + LbTotalOC1.Attributes.Add(“readonly”, “readonly”) CargaDatosAgregarPS() TieneAnticiposXML = False @@ -2090,6 +2099,10 @@ Partial Class Compras_Compras If TxtFolio.Text.Trim = "" Then TxtFolio.Enabled = True : TxtSerie.Enabled = True + If UsuarioActual.TienePermisoProceso(242) Then + PermisoVinculacionImporteDiferente = True + End If + If UsuarioActual.TienePermisoProceso(112) Then PermisoEdicionManual = True TxtSubTotal.Enabled = True @@ -15233,15 +15246,21 @@ Partial Class Compras_Compras Protected Sub GvOC1_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvOC1.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - Dim JSCambiaScript As String = $"CalculaTotalOCEdit('{e.Row.DBCampo("PS").Replace("'", "").Replace(vbLf, " ").Replace(vbCrLf, " ")}', {e.Row.DBCampo("Cantidad").ToString.ToDouble}, {e.Row.FCTextBox("TxtCantidad").ClientID}, {e.Row.FCTextBox("TxtPU").ClientID}, {e.Row.FCTextBox("TxtTotalOC1").ClientID}, {e.Row.DBCampo("IEPSPS").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1IEPSImporte").ClientID}, {e.Row.DBCampo("IVA").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1IVA").ClientID},{e.Row.DBCampo("RetIVA").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1RetIVA").ClientID},{e.Row.DBCampo("RetISR").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1RetISR").ClientID},{e.Row.DBCampo("IEPSPS").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1IEPSIVA").ClientID},{e.Row.DBCampo("Descuento")},{e.Row.FCHiddenField("HdnOC1Descuento").ClientID},{e.Row.DBCampo("IVAPorcentaje").ToString.ToDouble},{e.Row.DBCampo("RetIVAPorcentaje").ToString.ToDouble},{e.Row.DBCampo("RetISRPorcentaje").ToString.ToDouble},{e.Row.DBCampo("IEPSPSPorcentaje").ToString.ToDouble},{e.Row.DBCampo("IEPSPSIVAPorcentaje").ToString.ToDouble});" + Dim JSCambiaScript As String = $"CalculaTotalOCEdit('{e.Row.DBCampo("PS").Replace("'", "").Replace(vbLf, " ").Replace(vbCrLf, " ")}', {e.Row.DBCampo("Cantidad").ToDouble},{e.Row.DBCampo("PU").ToDouble}, {e.Row.FCTextBox("TxtCantidad").ClientID}, {e.Row.FCTextBox("TxtPU").ClientID}, {e.Row.FCTextBox("TxtTotalOC1").ClientID}, {e.Row.DBCampo("IEPSPS").ToDouble},{e.Row.FCHiddenField("HdnOC1IEPSImporte").ClientID}, {e.Row.DBCampo("IVA").ToDouble},{e.Row.FCHiddenField("HdnOC1IVA").ClientID},{e.Row.DBCampo("RetIVA").ToDouble},{e.Row.FCHiddenField("HdnOC1RetIVA").ClientID},{e.Row.DBCampo("RetISR").ToDouble},{e.Row.FCHiddenField("HdnOC1RetISR").ClientID},{e.Row.DBCampo("IEPSPS").ToDouble},{e.Row.FCHiddenField("HdnOC1IEPSIVA").ClientID},{e.Row.DBCampo("Descuento")},{e.Row.FCHiddenField("HdnOC1Descuento").ClientID},{e.Row.DBCampo("IVAPorcentaje").ToDouble},{e.Row.DBCampo("RetIVAPorcentaje").ToString.ToDouble},{e.Row.DBCampo("RetISRPorcentaje").ToDouble},{e.Row.DBCampo("IEPSPSPorcentaje").ToDouble},{e.Row.DBCampo("IEPSPSIVAPorcentaje").ToDouble});" e.Row.FCTextBox("TxtCantidad").Attributes.Add("onkeyup", $"LimitaCantidadOC({e.Row.DBCampo("CantidadPendienteVincular")}, this);{JSCambiaScript}") e.Row.FCTextBox("TxtPU").Attributes.Add("onkeyup", JSCambiaScript) e.Row.FCTextBox("TxtCantidad").Attributes.Add("onblur", $"ValidaImporteCero('{e.Row.DBCampo("PS").Replace("'", "")}',{e.Row.FCTextBox("TxtCantidad").ClientID}, {e.Row.FCTextBox("TxtPU").ClientID});") e.Row.FCTextBox("TxtPU").Attributes.Add("onblur", $"ValidaImporteCero('{e.Row.DBCampo("PS").Replace("'", "")}',{e.Row.FCTextBox("TxtCantidad").ClientID}, {e.Row.FCTextBox("TxtPU").ClientID});") - RegistraScript(JSCambiaScript) + 'activo el rangevalidator para cambios Proc.242 + If Not PermisoVinculacionImporteDiferente Then + Dim tdif As Decimal = 10D ' solo 10 permitido a nivel total + e.Row.FCRangeValidator("RValPU").MinimumValue = ((e.Row.DBCampo("Total").ToDecimal - tdif) / e.Row.DBCampo("Cantidad").ToDecimal).ToString("N6") + e.Row.FCRangeValidator("RValPU").MaximumValue = ((e.Row.DBCampo("Total").ToDecimal + tdif) / e.Row.DBCampo("Cantidad").ToDecimal).ToString("N6") + End If + If e.Row.DataKey("FolioREQ").ToString.Trim.Length > 0 Then Dim LblOC As Label = e.Row.FCLabel("LblOC") LblOC.Attributes.Add("data-toggle", "tooltip") From 16a78bc2798aeafe73c2b15c1075585e623ee5d2 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 25 Jan 2025 10:03:09 -0700 Subject: [PATCH 03/12] =?UTF-8?q?cmabio=20de=20filtro=20de=20m=C3=A9todo?= =?UTF-8?q?=20de=20pago=20por=20forma=20de=20pago?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RH/CatPersonal.aspx | 16 +++++++--------- RH/CatPersonal.aspx.vb | 20 ++++++++++---------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/RH/CatPersonal.aspx b/RH/CatPersonal.aspx index 7508c99b0..4836d2e41 100644 --- a/RH/CatPersonal.aspx +++ b/RH/CatPersonal.aspx @@ -141,13 +141,11 @@ + + + +
+ + + + diff --git a/OP/CatConfiguracionProducto.aspx.vb b/OP/CatConfiguracionProducto.aspx.vb new file mode 100644 index 000000000..01c47c04f --- /dev/null +++ b/OP/CatConfiguracionProducto.aspx.vb @@ -0,0 +1,602 @@ +Imports System.Data +Imports Extensiones + +Partial Class OP_CatConfiguracionProducto + Inherits ClsPaginas + +#Region "PROPIEDADES" + + Private Property CvePS As Integer + Get + If Not ViewState("CvePS") Is Nothing Then + Return ViewState("CvePS").ToString.ToEntero + Else + Return -1 + End If + End Get + Set(value As Integer) + ViewState("CvePS") = value + End Set + End Property + + Private Property CveUM As Integer + Get + If Not ViewState("CveUM") Is Nothing Then + Return ViewState("CveUM").ToString.ToEntero + Else + Return -1 + End If + End Get + Set(value As Integer) + ViewState("CveUM") = value + End Set + End Property + + Private Property DtMP As DataTable + Get + Return CType(ViewState("DtMP"), DataTable) + End Get + Set(value As DataTable) + ViewState("DtMP") = value + End Set + End Property + + Private Property DtMO As DataTable + Get + Return CType(ViewState("DtMO"), DataTable) + End Get + Set(value As DataTable) + ViewState("DtMO") = value + End Set + End Property + + Private Property DtCI As DataTable + Get + Return CType(ViewState("DtCI"), DataTable) + End Get + Set(value As DataTable) + ViewState("DtCI") = value + End Set + End Property + + Private Property DtEliminados As DataTable + Get + Return CType(ViewState("DtEliminados"), DataTable) + End Get + Set(value As DataTable) + ViewState("DtEliminados") = value + End Set + End Property + +#End Region + + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + CreaDtEliminados() + CargarListadoPrincipal() + CargarCombos() + End If + End Sub + +#Region "CARGAS" + + Private Sub CargarListadoPrincipal() + Using clsOp As New ClsOP() + If clsOp.GetConfiguracionProducto(-1, UsuarioActual.CveEmpresa) Then + GvProductos.DataSource = clsOp.DtResultados + GvProductos.DataBind() + End If + clsOp.Dispose() + UpDatos.Update() + End Using + End Sub + + Private Sub CreaDtEliminados() + DtEliminados = New DataTable + DtEliminados.Columns.Add("Cve", GetType(Integer)) + End Sub + + Private Sub CargarCombos() + + DdlPuesto.DataSource = GlobalDTRHPuestos(UsuarioActual.CveEmpresa) + DdlPuesto.DataBind() + DdlPuesto.Items.Insert(0, New ListItem("Seleccione", "-1")) + + DdlProductoConfigurar.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1") + + If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then + DdlProductoConfigurar.SelectedText = "Seleccione" + DdlProductoConfigurar.SelectedValue = "-1" + Else + DdlProductoConfigurar.ddl.Items.Clear() + DdlProductoConfigurar.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) + DdlProductoConfigurar.ddl.DataBind() + DdlProductoConfigurar.ddl.Items.Insert(0, New ListItem("Seleccione", "-1")) + End If + + DdlMateriaPrima.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1") + + If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then + DdlMateriaPrima.SelectedText = "Seleccione" + DdlMateriaPrima.SelectedValue = "-1" + Else + DdlMateriaPrima.ddl.Items.Clear() + DdlMateriaPrima.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) + DdlMateriaPrima.ddl.DataBind() + DdlMateriaPrima.ddl.Items.Insert(0, New ListItem("Seleccione", "-1")) + End If + + DdlProducto.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1") + + If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then + DdlProducto.SelectedText = "Seleccione" + DdlProducto.SelectedValue = "-1" + Else + DdlProducto.ddl.Items.Clear() + DdlProducto.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) + DdlProducto.ddl.DataBind() + DdlProducto.ddl.Items.Insert(0, New ListItem("Seleccione", "-1")) + End If + + UpMateriaPrima.Update() + UpManoObra.Update() + UpCostoIndirecto.Update() + End Sub + + Protected Sub DdlPS_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DdlMateriaPrima.selectedindexchange + DdlPSChange() + End Sub + + Private Sub DdlPSChange() + If DdlMateriaPrima.SelectedValue.ToEntero > 0 Then + Dim PS As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=DdlMateriaPrima.SelectedValue.ToEntero).FiltroPrimero("") + + If PS IsNot Nothing Then + DdlUM.Items.Clear() + DdlUM.DataSource = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa) + DdlUM.Items.Insert(0, New ListItem("Seleccione", "-1")) + DdlUM.DataBind() + DdlUM.SelectedValueExist(PS("CveUnidadMedida").ToString) + End If + Else + DdlUM.Items.Clear() + DdlUM.Items.Insert(0, New ListItem("Seleccione", "-1")) + DdlUM.SelectedValue = "-1" + End If + UpMateriaPrima.Update() + End Sub + + Protected Sub DdlPSConfigurar_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DdlProductoConfigurar.selectedindexchange + DdlPSConfigurarChange() + End Sub + + Private Sub DdlPSConfigurarChange() + If DdlProductoConfigurar.SelectedValue.ToEntero > 0 Then + Dim PS As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=DdlProductoConfigurar.SelectedValue.ToEntero).FiltroPrimero("") + + If PS IsNot Nothing Then + DdlUMConfigurar.Items.Clear() + DdlUMConfigurar.DataSource = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa) + DdlUMConfigurar.Items.Insert(0, New ListItem("Seleccione", "-1")) + DdlUMConfigurar.DataBind() + DdlUMConfigurar.SelectedValueExist(PS("CveUnidadMedida").ToString) + End If + Else + DdlUMConfigurar.Items.Clear() + DdlUMConfigurar.Items.Insert(0, New ListItem("Seleccione", "-1")) + DdlUMConfigurar.SelectedValue = "-1" + End If + UpMateriaPrima.Update() + End Sub + +#End Region + +#Region "MATERIA PRIMA" + + Protected Sub BtnMateriaPrima_Click(ByVal sender As Object, ByVal e As EventArgs) + + DdlProductoConfigurar.SelectedText = "Seleccione" + DdlProductoConfigurar.SelectedValue = "-1" + + DdlMateriaPrima.SelectedText = "Seleccione" + DdlMateriaPrima.SelectedValue = "-1" + + DdlUMConfigurar.SelectedValueExist("-1") + DdlUM.SelectedValueExist("-1") + + TxtCantidadMateriaPrima.Text = String.Empty + + DtEliminados.Rows.Clear() + + DivProductoConfigurar.Visible = False + DivUMConfigurar.Visible = False + + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + CvePS = GvRow.DataKey("CvePS").ToEntero() + CveUM = GvRow.DataKey("CveUM").ToEntero() + Using clsOp As New ClsOP() + If clsOp.GetMPReceta(CvePS, CveUM, UsuarioActual.CveEmpresa) Then + DtMP = clsOp.DtResultados.FiltraParametros("ISNULL(CveOPPS,0) > 0").Copy() + GvMateriaPrima.DataSource = DtMP + GvMateriaPrima.DataBind() + End If + clsOp.Dispose() + UpMateriaPrima.Update() + End Using + RegistraScript(String.Format("$('#{0}').modal('show');", "divAddMateriaPrima")) + End Sub + + Protected Sub BtnEliminarMateriaPrima_Click(ByVal sender As Object, ByVal e As EventArgs) + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + Dim CveOPPS = GvRow.DataKey("CveOPPS").ToEntero + Dim Index = GvRow.RowIndex + DtMP.Rows.RemoveAt(Index) + + If CveOPPS > 0 Then + Dim dr As DataRow = DtEliminados.NewRow + dr("Cve") = CveOPPS + DtEliminados.Rows.Add(dr) + End If + + GvMateriaPrima.DataSource = DtMP + GvMateriaPrima.DataBind() + + UpMateriaPrima.Update() + End Sub + + Protected Sub BtnAgregarMateriaPrima_Click(ByVal sender As Object, ByVal e As EventArgs) + + If Not DdlMateriaPrima.SelectedValue.ToEntero() > 0 Then + Alert("Es necesario seleccionar una materia prima.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + If Not DdlUM.SelectedValue.ToEntero() > 0 Then + Alert("Es necesario seleccionar una unidad de medida.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + If String.IsNullOrEmpty(TxtCantidadMateriaPrima.Text) Or Not TxtCantidadMateriaPrima.Text.ToDecimal() > 0 Then + Alert("Es necesario ingresar una cantidad mayor a 0.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + Dim dr As DataRow = DtMP.NewRow + dr("CveOPPS") = -1 + dr("CvePSMateriaPrima") = DdlMateriaPrima.SelectedValue.ToEntero() + dr("CveUMMateriaPrima") = DdlUM.SelectedValue.ToEntero() + dr("productoMateriaPrima") = DdlMateriaPrima.SelectedText + dr("UnidadMedidaMateriaPrima") = DdlUM.SelectedItem.Text + dr("Cantidad") = TxtCantidadMateriaPrima.Text.ToDecimal() + dr("CvePS") = CvePS + dr("CveUM") = CveUM + + DtMP.Rows.Add(dr) + + GvMateriaPrima.DataSource = DtMP + GvMateriaPrima.DataBind() + + DdlProductoConfigurar.SelectedText = "Seleccione" + DdlProductoConfigurar.SelectedValue = "-1" + + DdlMateriaPrima.SelectedText = "Seleccione" + DdlMateriaPrima.SelectedValue = "-1" + + DdlUMConfigurar.SelectedValueExist("-1") + DdlUM.SelectedValueExist("-1") + + TxtCantidadMateriaPrima.Text = String.Empty + + UpMateriaPrima.Update() + + End Sub + + Protected Sub BtnAgregarProducto_Click(ByVal sender As Object, ByVal e As EventArgs) + + DdlProductoConfigurar.SelectedText = "Seleccione" + DdlProductoConfigurar.SelectedValue = "-1" + + DdlMateriaPrima.SelectedText = "Seleccione" + DdlMateriaPrima.SelectedValue = "-1" + + DdlUMConfigurar.SelectedValueExist("-1") + DdlUM.SelectedValueExist("-1") + + TxtCantidadMateriaPrima.Text = String.Empty + + DtEliminados.Rows.Clear() + + CvePS = -1 + CveUM = -1 + + Using clsOp As New ClsOP() + If clsOp.GetMPReceta(CvePS, CveUM, UsuarioActual.CveEmpresa) Then + DtMP = clsOp.DtResultados.FiltraParametros("ISNULL(CveOPPS,0) = 0").Copy() + DtMP.Rows.Clear() + GvMateriaPrima.DataSource = DtMP + GvMateriaPrima.DataBind() + End If + clsOp.Dispose() + End Using + + DivProductoConfigurar.Visible = True + DivUMConfigurar.Visible = True + RegistraScript(String.Format("$('#{0}').modal('show');", "divAddMateriaPrima")) + UpMateriaPrima.Update() + End Sub + +#End Region + +#Region "MANO OBRA" + + Protected Sub BtnManoObra_Click(ByVal sender As Object, ByVal e As EventArgs) + + DdlPuesto.SelectedValueExist("-1") + + TxtHoras.Text = String.Empty + + DtEliminados.Rows.Clear() + + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + CvePS = GvRow.DataKey("CvePS").ToEntero + CveUM = GvRow.DataKey("CveUM").ToEntero + Using clsOp As New ClsOP() + If clsOp.GetMOReceta(CvePS, CveUM, UsuarioActual.CveEmpresa) Then + DtMO = clsOp.DtResultados.FiltraParametros("ISNULL(CveOPManoObra,0) > 0").Copy() + GvManoObra.DataSource = DtMO + GvManoObra.DataBind() + End If + clsOp.Dispose() + UpManoObra.Update() + End Using + RegistraScript(String.Format("$('#{0}').modal('show');", "divAddManoObra")) + End Sub + + Protected Sub BtnEliminarManoObra_Click(ByVal sender As Object, ByVal e As EventArgs) + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + Dim CveOPManoObra = GvRow.DataKey("CveOPManoObra").ToEntero + Dim Index = GvRow.RowIndex + DtMO.Rows.RemoveAt(Index) + + If CveOPManoObra > 0 Then + Dim dr As DataRow = DtEliminados.NewRow + dr("Cve") = CveOPManoObra + DtEliminados.Rows.Add(dr) + End If + + GvManoObra.DataSource = DtMO + GvManoObra.DataBind() + + UpManoObra.Update() + End Sub + + Protected Sub BtnAgregarManoObra_Click(ByVal sender As Object, ByVal e As EventArgs) + If Not DdlPuesto.SelectedValue.ToEntero() > 0 Then + Alert("Es necesario seleccionar un puesto.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + If String.IsNullOrEmpty(TxtHoras.Text) Or Not TxtHoras.Text.ToDecimal() > 0 Then + Alert("Es necesario ingresar una cantidad mayor a 0.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + Dim dr As DataRow = DtMO.NewRow + dr("CveOPManoObra") = -1 + dr("CvePuesto") = DdlPuesto.SelectedValue.ToEntero() + dr("Puesto") = DdlPuesto.SelectedItem.Text + dr("Cantidad") = TxtHoras.Text.ToDecimal() + dr("CvePS") = CvePS + dr("CveUM") = CveUM + + DtMO.Rows.Add(dr) + + GvManoObra.DataSource = DtMO + GvManoObra.DataBind() + + DdlPuesto.SelectedValueExist("-1") + + TxtHoras.Text = String.Empty + + UpManoObra.Update() + End Sub + +#End Region + +#Region "COSTO INDIRECTO" + + Protected Sub BtnCostoIndirecto_Click(ByVal sender As Object, ByVal e As EventArgs) + + DdlProducto.SelectedText = "Seleccione" + DdlProducto.SelectedValue = "-1" + + TxtCosto.Text = String.Empty + + DtEliminados.Rows.Clear() + + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + CvePS = GvRow.DataKey("CvePS").ToEntero + CveUM = GvRow.DataKey("CveUM").ToEntero + Using clsOp As New ClsOP() + If clsOp.GetCIReceta(CvePS, CveUM, UsuarioActual.CveEmpresa) Then + DtCI = clsOp.DtResultados.FiltraParametros("ISNULL(CveOPPS,0) > 0").Copy() + GvCostoIndirecto.DataSource = DtCI + GvCostoIndirecto.DataBind() + End If + clsOp.Dispose() + UpCostoIndirecto.Update() + End Using + RegistraScript(String.Format("$('#{0}').modal('show');", "divAddCostoIndirecto")) + End Sub + + Protected Sub BtnEliminarCostoIndirecto_Click(ByVal sender As Object, ByVal e As EventArgs) + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + Dim CveOPPS = GvRow.DataKey("CveOPPS").ToEntero + Dim Index = GvRow.RowIndex + DtCI.Rows.RemoveAt(Index) + + If CveOPPS > 0 Then + Dim dr As DataRow = DtEliminados.NewRow + dr("Cve") = CveOPPS + DtEliminados.Rows.Add(dr) + End If + + GvCostoIndirecto.DataSource = DtCI + GvCostoIndirecto.DataBind() + + UpCostoIndirecto.Update() + End Sub + + Protected Sub BtnAgregarCostoIndirecto_Click(ByVal sender As Object, ByVal e As EventArgs) + If Not DdlProducto.SelectedValue.ToEntero() > 0 Then + Alert("Es necesario seleccionar un producto.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + If String.IsNullOrEmpty(TxtCosto.Text) Or Not TxtCosto.Text.ToDecimal() > 0 Then + Alert("Es necesario ingresar un costo mayor a 0.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + Dim dr As DataRow = DtCI.NewRow + dr("CveOPPS") = -1 + dr("CvePSMateriaPrima") = DdlProducto.SelectedValue.ToEntero() + dr("productoMateriaPrima") = DdlProducto.SelectedText + dr("Cantidad") = TxtCosto.Text.ToDecimal() + dr("CvePS") = CvePS + dr("CveUM") = CveUM + + DtCI.Rows.Add(dr) + + GvCostoIndirecto.DataSource = DtCI + GvCostoIndirecto.DataBind() + + DdlProducto.SelectedText = "Seleccione" + DdlProducto.SelectedValue = "-1" + + TxtCosto.Text = String.Empty + + UpCostoIndirecto.Update() + End Sub + +#End Region + +#Region "GUARDADOS" + + Protected Sub BtnGuardarMP_Click(sender As Object, e As EventArgs) + + If Not DtMP.Rows.Count > 0 Then + Alert("Es necesario que agregue al menos una materia prima.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + Dim GuardadoCorrecto As Boolean = True + Dim clsOp As New ClsOP() + clsOp.IniciaTransacSQL() + + If DivProductoConfigurar.Visible Then + + For Each Dr As DataRow In DtMP.Rows + If Not Dr("CveOPPS").ToString().ToEntero() > 0 Then + If Not clsOp.AddMP(Dr("Cantidad").ToString().ToDecimal(), DdlProductoConfigurar.SelectedValue.ToEntero(), Dr("CvePSMateriaPrima").ToString().ToEntero(), DdlUM.SelectedValue.ToEntero(), Dr("CveUMMateriaPrima").ToString().ToEntero()) Then + GuardadoCorrecto = False + End If + End If + Next + + Else + For Each Dr As DataRow In DtMP.Rows + If Not Dr("CveOPPS").ToString().ToEntero() > 0 Then + If Not clsOp.AddMP(Dr("Cantidad").ToString().ToDecimal(), Dr("CvePS").ToString().ToEntero(), Dr("CvePSMateriaPrima").ToString().ToEntero(), Dr("CveUM").ToString().ToEntero(), Dr("CveUMMateriaPrima").ToString().ToEntero()) Then + GuardadoCorrecto = False + End If + End If + Next + + For Each Dr As DataRow In DtEliminados.Rows + If Not clsOp.RemoveMP(Dr("Cve").ToString().ToEntero()) Then + GuardadoCorrecto = False + End If + Next + End If + + If GuardadoCorrecto Then + clsOp.Commit() + Alert("Materia Prima Guardada Correctamente", TipoMensaje.MsgInformacion) + CargarListadoPrincipal() + RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddMateriaPrima"), "jsHideModalMP") + Else + clsOp.RollBack() + Alert("Ocurrió un error al guardar la Materia Prima", TipoMensaje.MsgError) + End If + + End Sub + + Protected Sub BtnGuardarMO_Click(sender As Object, e As EventArgs) + + Dim GuardadoCorrecto As Boolean = True + + Dim clsOp As New ClsOP() + clsOp.IniciaTransacSQL() + + For Each Dr As DataRow In DtMO.Rows + If Not Dr("CveOPManoObra").ToString().ToEntero() > 0 Then + If Not clsOp.AddMO(Dr("Cantidad").ToString().ToDecimal(), Dr("CvePS").ToString().ToEntero(), Dr("CvePuesto").ToString().ToEntero(), Dr("CveUM").ToString().ToEntero()) Then + GuardadoCorrecto = False + End If + End If + Next + + For Each Dr As DataRow In DtEliminados.Rows + If Not clsOp.RemoveMO(Dr("Cve").ToString().ToEntero()) Then + GuardadoCorrecto = False + End If + Next + + If GuardadoCorrecto Then + clsOp.Commit() + Alert("Mano de Obra Guardada Correctamente", TipoMensaje.MsgInformacion) + RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddManoObra"), "jsHideModalMO") + Else + clsOp.RollBack() + Alert("Ocurrió un error al guardar la Mano de Obra", TipoMensaje.MsgError) + End If + + End Sub + + Protected Sub BtnGuardarCI_Click(sender As Object, e As EventArgs) + + Dim GuardadoCorrecto As Boolean = True + + Dim clsOp As New ClsOP() + clsOp.IniciaTransacSQL() + + For Each Dr As DataRow In DtCI.Rows + If Not Dr("CveOPPS").ToString().ToEntero() > 0 Then + If Not clsOp.AddCI(Dr("Cantidad").ToString().ToDecimal(), Dr("CvePS").ToString().ToEntero(), Dr("CvePSMateriaPrima").ToString().ToEntero(), Dr("CveUM").ToString().ToEntero(), Dr("CveUMMateriaPrima").ToString().ToEntero()) Then + GuardadoCorrecto = False + End If + End If + Next + + For Each Dr As DataRow In DtEliminados.Rows + If Not clsOp.RemoveCI(Dr("Cve").ToString().ToEntero()) Then + GuardadoCorrecto = False + End If + Next + + If GuardadoCorrecto Then + clsOp.Commit() + Alert("Costo Indirecto Guardado Correctamente", TipoMensaje.MsgInformacion) + RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddCostoIndirecto"), "jsHideModalCI") + Else + clsOp.RollBack() + Alert("Ocurrió un error al guardar el Costo Indirecto", TipoMensaje.MsgError) + End If + + End Sub + +#End Region + +End Class From ed7a8c882050409a7bd51f57e0f4f247fbd12513 Mon Sep 17 00:00:00 2001 From: RPimienta Date: Sun, 26 Jan 2025 20:41:44 -0600 Subject: [PATCH 10/12] Se agrego el catalogo de configuracion de productos pt.2 --- OP/CatConfiguracionProducto.aspx.vb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/OP/CatConfiguracionProducto.aspx.vb b/OP/CatConfiguracionProducto.aspx.vb index 01c47c04f..5a9d5c678 100644 --- a/OP/CatConfiguracionProducto.aspx.vb +++ b/OP/CatConfiguracionProducto.aspx.vb @@ -491,6 +491,16 @@ Partial Class OP_CatConfiguracionProducto Exit Sub End If + If Not DdlProductoConfigurar.SelectedValue.ToEntero() > 0 Then + Alert("Es necesario seleccionar el producto a configurar.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + If Not DdlUM.SelectedValue.ToEntero() > 0 Then + Alert("Es necesario seleccionar la unidad de medida a configurar.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + Dim GuardadoCorrecto As Boolean = True Dim clsOp As New ClsOP() clsOp.IniciaTransacSQL() From 8d6691b83e4bb2f1b4dac9cd88cd697d3cd9907a Mon Sep 17 00:00:00 2001 From: rakcsle Date: Mon, 27 Jan 2025 10:11:45 -0700 Subject: [PATCH 11/12] 8 Validaciones de corte --- Ventas/PVCobranza.aspx | 11 +++--- Ventas/PVCobranza.aspx.vb | 81 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 86 insertions(+), 6 deletions(-) diff --git a/Ventas/PVCobranza.aspx b/Ventas/PVCobranza.aspx index 730699f32..b68299bfd 100644 --- a/Ventas/PVCobranza.aspx +++ b/Ventas/PVCobranza.aspx @@ -1349,9 +1349,10 @@
- + DataKeyNames="CveCuenta"> @@ -1362,8 +1363,8 @@
@@ -1417,7 +1418,7 @@

- diff --git a/Ventas/PVCobranza.aspx.vb b/Ventas/PVCobranza.aspx.vb index 319ce9a5e..9f9cff59e 100644 --- a/Ventas/PVCobranza.aspx.vb +++ b/Ventas/PVCobranza.aspx.vb @@ -167,6 +167,10 @@ Partial Class Ventas_PVCobranza DivNoTimbradas.Visible = True End If + If UsuarioActual.TienePermisoProceso(407) Then + LnkEstadosCaja.Visible = True + End If + End If End Sub @@ -3015,8 +3019,83 @@ Partial Class Ventas_PVCobranza TxtImporteContado.Text = (LtlSaldo.Text.ToDecimal + SaldoCxC).FormatoNumero RegistraScript("$('#divCxC').hide();", "AE21") UPPCobranza.Update() - UPPTotalesContado.update + UPPTotalesContado.Update() + End Sub + + + Private Property DTEstadosCaja As DataTable + Get + If ViewState("DTEstadosCaja") Is Nothing Then + ViewState("DTEstadosCaja") = New DataTable + End If + Return DirectCast(ViewState("DTEstadosCaja"), DataTable) + End Get + Set(value As DataTable) + ViewState("DTEstadosCaja") = value + End Set + End Property + + Protected Sub LnkEstadosCaja_Click(sender As Object, e As EventArgs) + GvEstadoCajas.DataSource = Nothing + DTEstadosCaja = New DataTable + Dim objPuntoVenta As New ClsPuntoVenta + Dim FechaInicio As Date = New Date(txtFechaI.Text.ToDate.Year, 1, 1) + Dim FechaFin As Date = New Date(FechaInicio.Year, 12, 31) + Dim CveCuenta As Integer = 197107 + + If objPuntoVenta.GetVta_EstadoCajas(CveCuenta, UsuarioActual.CveEmpresa, FechaInicio, FechaFin) Then + GvEstadoCajas.DataSource = objPuntoVenta.DtResultados + DTEstadosCaja = objPuntoVenta.DtResultados + End If + + objPuntoVenta.Dispose() + + GvEstadoCajas.DataBind() + + + + UpDVEstadoCaja.Update() + RegistraScript("$('#DVEstadoCaja').modal()") + + End Sub + + + Protected Sub GvEstadoCajas_RowDataBound(sender As Object, e As GridViewRowEventArgs) + + If DTEstadosCaja.Rows.Count > 0 Then + + If e.Row.RowType = DataControlRowType.Header Then + e.Row.Cells(0).Visible = False + e.Row.Cells(1).Width = 300 + End If + + If e.Row.RowType = DataControlRowType.DataRow Then + e.Row.Cells(0).Visible = False + e.Row.Cells(1).Width = 300 + e.Row.Cells(1).Attributes.Add("style", "white-space: nowrap;") + Dim IndexRow As Integer = e.Row.RowIndex + Dim CveCuenta As Integer = e.Row.DataKey("CveCuenta").ToEntero + + For x = 2 To DTEstadosCaja.Columns.Count - 1 + + Dim Fecha As Date = DTEstadosCaja.Columns(x).ColumnName.ToString.ToDate + Dim Liga As String = $"../Contabilidad/RepMovimientosAuxiliaresCatalogo.aspx?CveCuenta={CveCuenta}&FI={Fecha.ToString("dd/MM/yyyy")}&FF={Fecha.ToString("dd/MM/yyyy")}&CveProyecto=-1&CveSubProyecto=-1&TP=1" + Dim Importe As Decimal = DTEstadosCaja.Rows(IndexRow)(x).ToString.ToDecimal + + If Importe <> 0 Then + e.Row.Cells(x).Text = $"{Importe.ToString("###,###,###.00")}" + Else + e.Row.Cells(x).Text = "" + End If + + Next + + End If + End If + + End Sub + End Class Public Class MRespuestaSAT From d2ff180d676a488eb477672d1aa1835bd81c8524 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Mon, 27 Jan 2025 15:44:28 -0700 Subject: [PATCH 12/12] =?UTF-8?q?0=20Proveedores=20Abonar=20Generacion=20R?= =?UTF-8?q?emision=20nota=20de=20credtito=20,=20importe=20con=20base=20en?= =?UTF-8?q?=20descuento=20(descuento=20=3D=20total=20RNC)=20--=20generar?= =?UTF-8?q?=20reconstrucci=C3=B3n=20de=20saldos=20pendientes.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Compras/Compras.aspx.vb | 156 ++++++++++++++++++++++++++++++++-------- Ventas/PVCobranza.aspx | 4 +- 2 files changed, 127 insertions(+), 33 deletions(-) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 6b0e594dc..13cfbd3eb 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1679,6 +1679,14 @@ Partial Class Compras_Compras InicializaDTProrrateoGasolina() End If + + If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then + If Request("SaldarRNC") IsNot Nothing AndAlso Request("SaldarRNC").ToString.ToEntero = 1 Then + SaldaConRNC() + End If + + End If + End If 'SE OCUPAN AFUERA DEL POSTBACK ?? @@ -1711,6 +1719,79 @@ Partial Class Compras_Compras End Sub + + Private Sub SaldaConRNC() + + If CompraSaldo > 0 Then + ImporteRNC = CompraSaldo.ToDecimal + Dim ErrorSaldoRNC As Boolean = False + Dim ObjCompras As New ClsCompras + Dim ObjConta As New ClsContabilidad(ObjCompras.IniciaTransacSQL) + ObjCompras.IniciaTransacSQL() + ObjCompras.IniciaTransacSQL() + + If UsuarioActual.Empresa.Funcionalidad(574) = "1" AndAlso (ImporteRNC > 0 Or ImporteRNCProntoPago > 0) Then + + + Dim PorcentajeIVA As Decimal = TmpDT.MAX("IVAPorcentaje").ToDecimal + + Dim CompraSaldar As New Compra + CompraSaldar.CveCompra = CveCompra + CompraSaldar.CveTipoConceptoProveedor = CveTipoConcepto + CompraSaldar.CveProveedor = CveProveedor + CompraSaldar.CveMoneda = DdlMoneda.SelectedValue.ToEntero + CompraSaldar.Fecha = TxtFecha.Text.ToDate + CompraSaldar.SerieFolio = TxtSerie.Text.Trim & "-" & TxtFolio.Text.Trim + CompraSaldar.ProveedorNombre = HplProveedor.Text + CompraSaldar.TC = TipoCambio + CompraSaldar.Total = TxtTotal.Text.ToDecimal + CompraSaldar.IVA = TxtIVA.Text.ToDecimal + CompraSaldar.IVADeducible = TxtIVA.Text.ToDecimal + CompraSaldar.IEPS = TxtIEPS.Text.ToDecimal + CompraSaldar.RetIVA = TxtRetIVA.Text.ToDecimal + CompraSaldar.RetISR = TxtRetISR.Text.ToDecimal + CompraSaldar.CveConceptoRetISR = DdlRetISRConcepto.SelectedValue.ToEntero + CompraSaldar.CveConceptoRetIVA = DdlRetIVAConcepto.SelectedValue.ToEntero + CompraSaldar.PorcentajeIVA = PorcentajeIVA + CompraSaldar.UsuarioActual = UsuarioActual + CompraSaldar.CveSubProyecto = TmpDT.FiltroPrimeroValor("CveSubProyecto", " CveSubProyecto > 0").ToEntero + CompraSaldar.EsImportacion = chkImportacion.Checked + + Dim FolioFijo As Integer = 0 + 'cheque + If DdlTipoTransaccion.SelectedValue = "1" AndAlso UsuarioActual.CveEmpresa <> 119 Then FolioFijo = TxtFolio.Text.ToEntero + Dim ConceptoPoliza As String = String.Format("{0} - {1}{2} - {3}", NombreProveedor, TxtSerie.Text, TxtFolio.Text, TxtDescripcion.Text.Trim) + + Dim CvePrePolizaSaldar = ObjConta.AddPrePolizas("Compras/SaldarRNC", 53, ImporteRNC.RoundSQL(2), ImporteRNC.RoundSQL(2), DdlMoneda.SelectedValue.ToEntero, TxtFecha.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjCompras.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, DdlTipoTransaccionCaja.SelectedValue, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjConta.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, DdlTipoTransaccionCaja.SelectedValue, UsuarioActual.CveEmpresa)) + + If CvePrePolizaSaldar > 0 Then + ImporteRNC = ImporteRNC.RoundSQL(2) + If PorcentajeIVA > 0 Then + ImporteRNC = ((ImporteRNC) / (1 + PorcentajeIVA)) + End If + + If Not GeneraRNC(ObjCompras.IniciaTransacSQL, CveCompra, CompraSaldar, ObjConta, CvePrePolizaSaldar, DdlProveedor.SelectedValue.ToEntero, DdlProveedor.SelectedItem.Text, TxtFecha.Text.ToDate, $"Remisión Nota de Crédito {TxtDescripcion.Text}", DdlMoneda.SelectedValue.ToEntero, TxtTC.Text.ToDecimal, + TxtSerie.Text, TxtFolio.Text, RedondearSaldado:=True) Then + ErrorSaldoRNC = True + End If + End If + + + End If + + If ErrorSaldoRNC Then + ObjCompras.RollBack() + Else + ObjCompras.Commit() + End If + + ObjCompras.Dispose() + ObjConta.Dispose() + End If + + + End Sub + Private Sub ConfiguraseleccionRemisionNotaCredito() Dim AutoSelRNC As Boolean = False @@ -21944,7 +22025,8 @@ Partial Class Compras_Compras #Region "PRONTO PAGO" Public Function GeneraRNC(ByRef sqltransaccion As SqlTransaction, CveCompraRegistrada As Integer, ByRef CompraActual As Compra, ByRef ObjConta As ClsContabilidad, CvePrePoliza As Integer, - CveProveedor As Integer, NombreProveedor As String, Fecha As Date, Descripcion As String, CveMoneda As Integer, TipoCambio As Decimal, Serie As String, Folio As String, Optional EsDRMN As Boolean = False, Optional TmpListadoPS As DataTable = Nothing) As Boolean + CveProveedor As Integer, NombreProveedor As String, Fecha As Date, Descripcion As String, CveMoneda As Integer, TipoCambio As Decimal, Serie As String, Folio As String, + Optional EsDRMN As Boolean = False, Optional TmpListadoPS As DataTable = Nothing, Optional RedondearSaldado As Boolean = False) As Boolean CveCompraDRMC = -1 Dim respuesta As Boolean = True Dim PorcentajeIVA As Decimal = TmpDT.MAX("IVAPorcentaje").ToDecimal @@ -21969,19 +22051,20 @@ Partial Class Compras_Compras If PSRow IsNot Nothing Then Dim CompraRNC As New ClsCompraManagerCompras(UsuarioActual) With { - .TipoDocto = "RNC", - .CveProveedor = CveProveedor, - .CveTipoProveedor = CveTipoProveedor, - .CveTipoConceptoProveedor = CveTipoConcepto, - .Descripcion = Descripcion, - .NombreProveedor = NombreProveedor, - .Fecha = Fecha, - .CveMoneda = CveMoneda, - .TipoCambio = If(CveMoneda = 1, 1, TipoCambio), - .Serie = $"D-{Serie}", - .Folio = Folio, - .CveCompraAmortizacion = CveCompraRegistrada - } + .TipoDocto = "RNC", + .CveProveedor = CveProveedor, + .CveTipoProveedor = CveTipoProveedor, + .CveTipoConceptoProveedor = CveTipoConcepto, + .Descripcion = Descripcion, + .NombreProveedor = NombreProveedor, + .Fecha = Fecha, + .CveMoneda = CveMoneda, + .TipoCambio = If(CveMoneda = 1, 1, TipoCambio), + .Serie = $"D-{Serie}", + .Folio = Folio, + .CveCompraAmortizacion = CveCompraRegistrada, + .CveCompraRelacionada = CveCompraRegistrada + } 'Dim CveTipoPS As Integer = PSRow("CveTipoPS").ToString.ToEntero 'If PSRow("CvePSCargo").ToString <> "" Then @@ -21993,11 +22076,13 @@ Partial Class Compras_Compras Dim PS As String = PSRow("PSCodigo").ToString Dim CveUM As Integer = PSRow("CveUnidadMedida").ToString.ToEntero Dim UM As String = PSRow("UnidadMedida").ToString - Dim IVARNC As Decimal = (ImporteRNC * PorcentajeIVA).RoundSQL(2) - CompraRNC.ConfiguraRegistroRapido(CvePS_RNC, CveUM, UM, CveClasificacion, Clasificacion, PS, CveSubProyectoPrincipal, SubProyecto, ImporteRNC, IVARNC, (ImporteRNC + IVARNC), PorcentajeIVA) + Dim IVARNC As Decimal = (ImporteRNC * PorcentajeIVA).RoundSQL(2) + Dim TotalRNC As Decimal = If(RedondearSaldado, (ImporteRNC + IVARNC).RoundSQL(2), (ImporteRNC + IVARNC)) + + CompraRNC.ConfiguraRegistroRapido(CvePS_RNC, CveUM, UM, CveClasificacion, Clasificacion, PS, CveSubProyectoPrincipal, SubProyecto, ImporteRNC, IVARNC, TotalRNC, PorcentajeIVA) If CompraRNC.AddCompra(sqltransaccion) Then - Dim tImporteRNC = ImporteRNC + IVARNC ' le agrego el importe del iva + Dim tImporteRNC = TotalRNC ' le agrego el importe del iva Dim Pago As New CompraPago Pago.ImportePago = tImporteRNC Pago.CveMonedaPago = CompraActual.CveMoneda @@ -22016,19 +22101,20 @@ Partial Class Compras_Compras If respuesta AndAlso ImporteRNCProntoPago > 0 Then Dim CompraRNCProntoPago As New ClsCompraManagerCompras(UsuarioActual) With { - .TipoDocto = "RNC", - .CveProveedor = CveProveedor, - .CveTipoProveedor = CveTipoProveedor, - .CveTipoConceptoProveedor = CveTipoConcepto, - .Descripcion = Descripcion, - .NombreProveedor = NombreProveedor, - .Fecha = Fecha, - .CveMoneda = CveMoneda, - .TipoCambio = If(CveMoneda = 1, 1, TipoCambio), - .Serie = $"PP-{Serie}", - .Folio = $"{Folio}", - .CveCompraAmortizacion = CveCompraRegistrada - } + .TipoDocto = "RNC", + .CveProveedor = CveProveedor, + .CveTipoProveedor = CveTipoProveedor, + .CveTipoConceptoProveedor = CveTipoConcepto, + .Descripcion = Descripcion, + .NombreProveedor = NombreProveedor, + .Fecha = Fecha, + .CveMoneda = CveMoneda, + .TipoCambio = If(CveMoneda = 1, 1, TipoCambio), + .Serie = $"PP-{Serie}", + .Folio = $"{Folio}", + .CveCompraAmortizacion = CveCompraRegistrada, + .CveCompraRelacionada = CveCompraRegistrada + } Dim IVARNCProntoPago As Decimal = (ImporteRNCProntoPago * PorcentajeIVA).RoundSQL(2) CompraRNCProntoPago.ConfiguraRegistroRapido(CvePS_RNC, CveUM, UM, CveClasificacion, Clasificacion, PS, CveSubProyectoPrincipal, SubProyecto, ImporteRNCProntoPago, (ImporteRNCProntoPago + IVARNCProntoPago), IVARNCProntoPago, PorcentajeIVA) @@ -22050,6 +22136,11 @@ Partial Class Compras_Compras End If End If + If RedondearSaldado And respuesta Then + Alert("Saldado correctamente") + End If + + Return respuesta End Function @@ -22865,6 +22956,8 @@ Public Class ClsCompraManagerCompras Public Property CveIE As Integer = -1 Public Property CveCompraAmortizacion As Integer = -1 + Public Property CveCompraRelacionada As Integer = -1 + Public Sub New(UsuarioActual As Usuario) Errores = New StringBuilder @@ -24503,7 +24596,8 @@ Public Class ClsCompraManagerCompras AplicoPromocion:=Me.AplicoPromocion, PorcentajeIVA:=Me.PorcentajeIVA, CveMetodoPago:=Me.CveMetodoPago, CveRetIVAConcepto:=Me.CveRetIVAConcepto, CveConceptoContableAlmacen:=Me.CveConceptoContableAlmacen, CveRetISRConcepto:=Me.CveRetISRConcepto, NoDeducible:=Me.NoDeducible, CveTipoCompra:=Me.CveTipoCompra, TotalOriginal:=Me.TotalOriginal, CveTipoConcepto:=Me.CveTipoConcepto, - EsImportacion:=Me.EsImportacion, CveFactura:=Me.CveFactura, CveSubProyecto:=Me.CveSubProyectoPrincipal, DoctosRelacionados:=Me.DocumentosRelacionadosUUIDSString, CveFolioGarantia:=Me.CveFolioGarantia) Then + EsImportacion:=Me.EsImportacion, CveFactura:=Me.CveFactura, CveSubProyecto:=Me.CveSubProyectoPrincipal, DoctosRelacionados:=Me.DocumentosRelacionadosUUIDSString, CveFolioGarantia:=Me.CveFolioGarantia, + CveCompraRelacionada:=CveCompraRelacionada) Then Me.CveCompra = ObjCompras.CveCompra Else respuesta = False diff --git a/Ventas/PVCobranza.aspx b/Ventas/PVCobranza.aspx index b68299bfd..925eb9c62 100644 --- a/Ventas/PVCobranza.aspx +++ b/Ventas/PVCobranza.aspx @@ -1349,9 +1349,9 @@
-