diff --git a/Inventarios/RecepcionUsados.aspx b/Inventarios/RecepcionUsados.aspx index 5ba45d41c..e985f6960 100644 --- a/Inventarios/RecepcionUsados.aspx +++ b/Inventarios/RecepcionUsados.aspx @@ -808,7 +808,7 @@ + AutoGenerateColumns="False" AllowPaging="False" ShowFooter="True" ShowHeaderWhenEmpty="True" OnRowDataBound="GvM_RowDataBound" > diff --git a/Inventarios/RecepcionUsados.aspx.vb b/Inventarios/RecepcionUsados.aspx.vb index 1053d3317..ee0c1f8f5 100644 --- a/Inventarios/RecepcionUsados.aspx.vb +++ b/Inventarios/RecepcionUsados.aspx.vb @@ -33,14 +33,6 @@ Partial Class Inventarios_RecepcionUsados ViewState("DtMovimientos") = value End Set End Property - Private Property ConsecutivoVenta As Integer - Get - Return ViewState("ConsecutivoVenta").ToString.ToEntero - End Get - Set(value As Integer) - ViewState("ConsecutivoVenta") = value - End Set - End Property Public Property DtTamaños() As DataTable Get Return CType(ViewState("DtTamaños"), DataTable) @@ -366,7 +358,6 @@ Partial Class Inventarios_RecepcionUsados End Sub Private Sub CargaInicial() - ConsecutivoVenta = 0 CveMovimiento = -1 CveMovimientoRelacionado = -1 TieneRelacionado = -1 @@ -1070,11 +1061,32 @@ Partial Class Inventarios_RecepcionUsados txtCantidad.Focus() End Sub - - Protected Sub AddNew(CvePS As Integer, PS As String, CveUM As Integer, UM As String, Cantidad As Double, PU As Double, Serie As String, CodigoAF As String, Codigo As String, + ''' + ''' Regeresa el id temporal del registro en el tmpdt + ''' + ''' + ''' + ''' + ''' + ''' + ''' + ''' + ''' + ''' + ''' + ''' + ''' + ''' + ''' + ''' + ''' + ''' + ''' + Protected Function AddNew(CvePS As Integer, PS As String, CveUM As Integer, UM As String, Cantidad As Double, PU As Double, Serie As String, CodigoAF As String, Codigo As String, CveAF As String, Observaciones As String, Lote As String, CveSeccionAlmacen As Integer, SeccionAlmacen As String, Tamaño As String, CveTamaño As Integer, - Optional CveVentaDetalle As Integer = -1) + Optional CveVentaDetalle As Integer = -1) As Integer + Dim Retorno As Integer = -1 'If DdlAlmacen.SelectedValue.ToEntero <= 0 Then Alert("Seleccione un almacen", TipoMensaje.MsgAdvertencia) : RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") : DdlProducto2.SelectedText = "" : Exit Sub Dim Valido As Boolean = True @@ -1101,7 +1113,7 @@ Partial Class Inventarios_RecepcionUsados If Cantidad > CantidadPermitida Then Alert($"La cantidad es mayor a la permitida", TipoMensaje.MsgAdvertencia) - Exit Sub + Return -1 End If 'Else @@ -1113,7 +1125,7 @@ Partial Class Inventarios_RecepcionUsados 'VALIDA QUE LA SERIE NO SEA IGUAL AL CODIGO O CODIGOBARRAS If Serie <> "" And (Serie.ToUpper = dr("Codigo").ToString.ToUpper Or Serie.ToUpper = dr("CodigoBarras").ToString.ToUpper) Then Alert($"La serie indicada {Serie} coincide con el codigo o codigo de barras del producto. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) - Exit Sub + Return -1 End If Dim registro As DataRow = DtMovimientos.NewRow @@ -1151,8 +1163,10 @@ Partial Class Inventarios_RecepcionUsados If Not ChkSeguirAgregando.Checked Then RegistraScript("$('#DivModalAgregar').modal('hide')", "hidemodal") End If - Else + Retorno = DtMovimientos.FiltroPrimeroValor("No", Orderby:="No DESC").ToEntero() + + Else DtMovimientos.Rows(IndexDTUsado)("Cantidad") = Cantidad DtMovimientos.Rows(IndexDTUsado)("CveUM") = CveUM @@ -1182,6 +1196,8 @@ Partial Class Inventarios_RecepcionUsados DtMovimientos.AcceptChanges() + Retorno = DtMovimientos.Rows(IndexDTUsado)("No").ToString().ToEntero() + CargaGVM(DtMovimientos.FiltraParametros("Estatus <> 'E' ")) If Not ChkSeguirAgregando.Checked Then @@ -1189,7 +1205,8 @@ Partial Class Inventarios_RecepcionUsados End If End If - End Sub + Return Retorno + End Function Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click If DdlClientes.SelectedValue.ToEntero <= 0 Then @@ -1676,10 +1693,6 @@ Partial Class Inventarios_RecepcionUsados TxtTotal.Text = Total.FormatoNumero(2) End If - End Sub - Protected Sub GvM_RowDataBound(sender As Object, e As GridViewRowEventArgs) - - End Sub Protected Sub GvM_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GvM.RowEditing GvM.EditIndex = e.NewEditIndex @@ -1734,6 +1747,14 @@ Partial Class Inventarios_RecepcionUsados End If DtMovimientos.AcceptChanges() + + If TmpDTAjustes IsNot Nothing Then + Dim DrAjustes As DataRow() = TmpDTAjustes.Select(String.Format("ConsecutivoVenta = {0}", i)) + If DrAjustes.Count > 0 Then + DrAjustes(0).Delete() + End If + TmpDTAjustes.AcceptChanges() + End If End If GvM.EditIndex = -1 @@ -2830,7 +2851,6 @@ Partial Class Inventarios_RecepcionUsados If AddPSRNC(ObjRemisionNC.DtDetalle, 1, CveUnidadMedida, "", CveClasificacion, "", CvePS, "", Obs, PU, 0, -1, "", ObjRemisionNC.CveSubProyecto, ObjRemisionNC.SubProyecto.SubProyecto, PorcentajeIVA:=PorcentajeIVA) Then - ConsecutivoVenta += 1 End If Else @@ -3260,16 +3280,23 @@ Partial Class Inventarios_RecepcionUsados UpAjuste.Update() End Sub - Private Sub GuardaAjuste() + Private Sub GuardaAjuste(ConsecutivoVenta As Integer) Dim CargoAnterior As Double = 0 Dim CargoActual As Double = 0 Dim Row As DataRow = Nothing + Dim EsNuevo As Boolean = true - ConsecutivoVenta += 1 + Dim RowsAjustes = TmpDTAjustes.Select($"ConsecutivoVenta = {ConsecutivoVenta}") + + If RowsAjustes IsNot Nothing AndAlso RowsAjustes.Length > 0 Then + Row = RowsAjustes(0) + EsNuevo = False + Else + Row = TmpDTAjustes.NewRow + End If - Row = TmpDTAjustes.NewRow Row("CveFolioGarantia") = DdlFolioGarantia.SelectedValue.ToEntero Row("CveTipoUso") = DdlTipoUso.SelectedValue.ToEntero Row("CveTipoDefecto") = DdlTipoDefecto.SelectedValue.ToEntero @@ -3305,8 +3332,12 @@ Partial Class Inventarios_RecepcionUsados Row("CveClienteDistribuidor") = -1 Row("CveModeloAuto") = -1 Row("Año") = "" - TmpDTAjustes.Rows.Add(Row) + If EsNuevo Then + TmpDTAjustes.Rows.Add(Row) + Else + TmpDTAjustes.AcceptChanges() + End If End Sub Protected Sub BtnCalculaMesesUso_Click(sender As Object, e As EventArgs) @@ -3352,7 +3383,7 @@ Partial Class Inventarios_RecepcionUsados Alert("Ya existe un consecutivo vigente en este folio", TipoMensaje.MsgAdvertencia) Exit Sub End If - + Dim IdConsecutivo As Integer = -1 Dim ObjPS As New ClsProductosServicios Try Dim CveTamaño As Integer = -1 @@ -3364,6 +3395,7 @@ Partial Class Inventarios_RecepcionUsados Dim Importe As Decimal = 0 Dim drTamañoPS As DataRow = Nothing + TmpDTAjustes.Rows.Clear() DtMovimientos.Rows.Clear() ' USADOS @@ -3385,7 +3417,7 @@ Partial Class Inventarios_RecepcionUsados If ObjPS.GetPS(CvePS, -1, UsuarioActual.CveEmpresa) Then drTamañoPS = ObjPS.DtResultados.FiltroPrimero("") 'CveTamaño = -1 'limpio esta variable para que no se registre dos veces en la clase Modelos - AddNew(drTamañoPS.Item("CvePS").ToString.ToEntero, drTamañoPS.Item("PSCodigo").ToString, drTamañoPS.Item("CveUM").ToString.ToEntero, drTamañoPS.Item("UnidadMedida").ToString, 1.0, Importe, + IdConsecutivo = AddNew(drTamañoPS.Item("CvePS").ToString.ToEntero, drTamañoPS.Item("PSCodigo").ToString, drTamañoPS.Item("CveUM").ToString.ToEntero, drTamañoPS.Item("UnidadMedida").ToString, 1.0, Importe, "", "-1", "-1", "-1", "", "", -1, "", "", CveTamaño) End If Else @@ -3400,7 +3432,7 @@ Partial Class Inventarios_RecepcionUsados ObjPS.Dispose() If Not ErrorAjuste Then - GuardaAjuste() + GuardaAjuste(IdConsecutivo) End If @@ -3714,4 +3746,12 @@ Partial Class Inventarios_RecepcionUsados End Function #End Region + Protected Sub GvM_RowDataBound(sender As Object, e As GridViewRowEventArgs) + If e.Row.RowType = DataControlRowType.DataRow Then + 'SI ES GARANTIA, NO DEBE PERMTIR ELIMINAR + If RblUsadosAjuste.SelectedValue = "1" Then + e.Row.FCLinkButton("LnkActuallizarUsado").Visible = False + End If + End If + End Sub End Class diff --git a/Nomina/Nomina.aspx.cs b/Nomina/Nomina.aspx.cs index 4e6ec4ee9..a1d7eb776 100644 --- a/Nomina/Nomina.aspx.cs +++ b/Nomina/Nomina.aspx.cs @@ -3936,9 +3936,12 @@ public partial class Nomina_Nomina2 : ClsPaginas if (continuar) { cargaDatos(CvePersonal: SRCvePersonal); - cargaBitacora(); + if (PnlConceptoPersonal.Visible) + { + cargaBitacora(); + cargasobrericiboconceptos(SRMostrarFormulas); - cargasobrericiboconceptos(SRMostrarFormulas); + } UpGvConceptos.Update(); RegistraScript("$('#ModalUpConcepto').modal('hide');"); @@ -7114,7 +7117,7 @@ public partial class Nomina_Nomina2 : ClsPaginas CcveMovtoPermanente = gvRow.DataKey("CveMovtoPermanente").ToEntero(); int cveConcepto = gvRow.DataKey("CveConcepto").ToEntero(); int cvePersonal = gvRow.DataKey("CvePersonal").ToEntero(); - int CveCuenta = gvRow.DataKey("CveCuenta").ToEntero(); + int CveCuenta = gvRow.DataKey("CveCuenta").ToEntero(); string descripcion = gvRow.DataKey("Descripcion"); int tipoDescuento = gvRow.DataKey("TipoDescuento").ToEntero(); double valor = gvRow.DataKey("Valor").ToDouble(); @@ -7141,7 +7144,7 @@ public partial class Nomina_Nomina2 : ClsPaginas TxtVecesAplicar.Text = vecesAplicar.ToString(); TxtMontoLimite.Text = montoLimite.ToString(); TxtFechaAplicacion.Text = $"{fechaInicioAplicacion:dd/MM/yyyy}"; - DdlCtaContable.SelectedValueExist("-1"); + DdlCtaContable.SelectedValueExist("-1"); ChkEstatus.Checked = estatus; RegistraScript("$('#ModalMovtoPermanente').modal()"); @@ -10168,7 +10171,7 @@ public partial class Nomina_Nomina2 : ClsPaginas } if (essua) { - System.IO.Stream fs=(new CedulaSuaPDF()).writexls(dirPDF); + System.IO.Stream fs = (new CedulaSuaPDF()).writexls(dirPDF); fs.Position = 0; System.IO.MemoryStream memoryStream = new System.IO.MemoryStream(); using (System.IO.Stream input = fs) @@ -10187,8 +10190,8 @@ public partial class Nomina_Nomina2 : ClsPaginas } else { - System.IO.Stream fs =(new CedulaEBAPDF()).writexls(dirPDF); - + System.IO.Stream fs = (new CedulaEBAPDF()).writexls(dirPDF); + fs.Position = 0; System.IO.MemoryStream memoryStream = new System.IO.MemoryStream(); using (System.IO.Stream input = fs) @@ -10655,8 +10658,8 @@ public partial class Nomina_Nomina2 : ClsPaginas } } - libro.Range(2, 7, row, dataEBAPDF.ContieneLic ?15:16).Style.Alignment.Horizontal = ClosedXML.Excel.XLAlignmentHorizontalValues.Right; - libro.Range(2, dataEBAPDF.ContieneLic ? 17:18, row, dataEBAPDF.ContieneLic ? 20:21).Style.Alignment.Horizontal = ClosedXML.Excel.XLAlignmentHorizontalValues.Right; + libro.Range(2, 7, row, dataEBAPDF.ContieneLic ? 15 : 16).Style.Alignment.Horizontal = ClosedXML.Excel.XLAlignmentHorizontalValues.Right; + libro.Range(2, dataEBAPDF.ContieneLic ? 17 : 18, row, dataEBAPDF.ContieneLic ? 20 : 21).Style.Alignment.Horizontal = ClosedXML.Excel.XLAlignmentHorizontalValues.Right; //libro.Range(2, 7, row, 15).Style.NumberFormat.Format = "$ #,##0.00"; //libro.Range(2, 17, row, 20).Style.NumberFormat.Format = "$ #,##0.00"; libro.Columns().AdjustToContents(); @@ -10681,7 +10684,7 @@ public partial class Nomina_Nomina2 : ClsPaginas if (!isTitulo) { text = text.Replace(strtitulo.ToString(), ""); - } + } cedulaSUAEmpleados cempleado = null; string[] lines = text.Split('\n'); int pasoCaptura = 0; @@ -10789,11 +10792,11 @@ public partial class Nomina_Nomina2 : ClsPaginas strb.AppendLine("/*NEWPAGE*/"); } } - + objSUA.txtTodo = strb.ToString(); return objSUA; } - public cedulaSUAEmpleados procesapaso4(string line, cedulaSUAEmpleados empleado,bool ContieneLic) + public cedulaSUAEmpleados procesapaso4(string line, cedulaSUAEmpleados empleado, bool ContieneLic) { if (line.ToUpper().Contains("Página".ToUpper())) { @@ -10855,7 +10858,7 @@ public partial class Nomina_Nomina2 : ClsPaginas } if (col < l && !ismsfsd) { dtos.SDI = splitedline[col++]; } if (col < l && splitedline[col] == "") { col++; } - if(ContieneLic && col < l && !ismsfsd) { dtos.Lic = splitedline[col++]; } + if (ContieneLic && col < l && !ismsfsd) { dtos.Lic = splitedline[col++]; } if (col < l && splitedline[col] == "") { col++; } if (col < l && !ismsfsd) { dtos.Inc = splitedline[col++]; } if (col < l && splitedline[col] == "") { col++; } diff --git a/Nomina/ReportedeAcumulados.aspx b/Nomina/ReportedeAcumulados.aspx index 0236e30d8..f846f0ce2 100644 --- a/Nomina/ReportedeAcumulados.aspx +++ b/Nomina/ReportedeAcumulados.aspx @@ -337,6 +337,20 @@ + + Días IMSS + + + + + + + Salario IMSS + + + + + diff --git a/Nomina/ReportedeAcumulados.aspx.cs b/Nomina/ReportedeAcumulados.aspx.cs index 2494996c2..19d87654d 100644 --- a/Nomina/ReportedeAcumulados.aspx.cs +++ b/Nomina/ReportedeAcumulados.aspx.cs @@ -196,7 +196,7 @@ public partial class Nomina_ReportedeAcumulados : ClsPaginas //string ctipo = "P"; - int CurrentColumn = 5; + int CurrentColumn = 7; BoundField bf; foreach (DataRow row in dtConceptos.FiltraParametros("Tipo IN ('P') AND EsPadre = 1 ").Rows) { @@ -428,6 +428,18 @@ public partial class Nomina_ReportedeAcumulados : ClsPaginas libro.Cell(3, column).Value = " "; libro.Column(column).Width = 35; + column++; + libro.Cell(1, column).Value = " "; + libro.Cell(2, column).Value = "Días IMSS"; + libro.Cell(3, column).Value = " "; + libro.Column(column).Width = 35; + + column++; + libro.Cell(1, column).Value = " "; + libro.Cell(2, column).Value = "Salario IMSS"; + libro.Cell(3, column).Value = " "; + libro.Column(column).Width = 35; + int iniciotipe = column; foreach (DataRow row in dtConceptos.FiltraParametros("Tipo ='P' AND EsPadre = 1 ").Rows) { @@ -545,6 +557,10 @@ public partial class Nomina_ReportedeAcumulados : ClsPaginas libro.Cell(Fila, column).Value = string.Format("'{0}", erow["NumeroSS"]); column++; libro.Cell(Fila, column).Value = erow["RegistroPatronal"]; + column++; + libro.Cell(Fila, column).Value = erow["DiasAsistio"]; + column++; + libro.Cell(Fila, column).Value = erow["SBC"]; foreach (DataRow row in dtConceptos.FiltraParametros("Tipo = 'P' AND EsPadre = 1 ").Rows) { column++; diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 075d053db..30124e4dd 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -29763,7 +29763,7 @@ Partial Class Ventas Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1), PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(), CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, - TipoDocto:=DdlTipoComprobante.SelectedValue, Kilometraje:=TxtKilometraje.Text.ToDouble, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero()) Then + TipoDocto:=DdlTipoComprobante.SelectedValue, Kilometraje:=TxtKilometraje.Text.ToDouble, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero()) Then MensajeError = "Ocurrió un error al actualizar la información de la cotización" OcurrioError = True End If