diff --git a/App_Code/CFDITimbre.vb b/App_Code/CFDITimbre.vb index 71e8e6a3a..68086bdba 100644 --- a/App_Code/CFDITimbre.vb +++ b/App_Code/CFDITimbre.vb @@ -590,7 +590,7 @@ End Class Public Class CFDICartaPorteAutoTransporte - Public Property PermSCT As String = "" + Public Property PermisoSCT As String = "" Public Property NumPermisoSCT As String = "" Public Property NombreSeguroResponsabilidadCivil As String = "" Public Property PolizaSeguroResponsabilidadCivil As String = "" diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index 6649955fd..3f019b83f 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -3770,7 +3770,8 @@ Public Class ClsGenerales End Function - Public Function AddInvEntregaAlmacenRuta(CveSubProyecto As Integer, CveDireccionOrigen As Integer, CveDireccionDestino As Integer, CveMovimientoAlmacen As Integer, CveChofer As Integer, CveCamion As Integer, FechaEntrega As Date, FechaLlegada As DateTime, Tipo As String, Orden As Integer, Estatus As Integer, Distancia As Integer) As Integer + Public Function AddInvEntregaAlmacenRuta(CveSubProyecto As Integer, CveDireccionOrigen As Integer, CveDireccionDestino As Integer, CveMovimientoAlmacen As Integer, CveChofer As Integer, CveCamion As Integer, FechaEntrega As Date, FechaLlegada As DateTime, Tipo As String, + FolioReferencia As String, Referencia As String, FechaLimite As Date, Orden As Integer, Estatus As Integer, Distancia As Integer) As Integer Dim Retorno As Integer = -1 DataAdapter("PA_Inv_EntregaAlmacenRutaAdd") @@ -3784,6 +3785,9 @@ Public Class ClsGenerales .Add("@CveCamion", SqlDbType.Int).Value = CveCamion .Add("@FechaEntrega", SqlDbType.DateTime).Value = FechaEntrega .Add("@FechaLlegada", SqlDbType.DateTime).Value = FechaLlegada + .Add("@FolioReferencia", SqlDbType.VarChar).Value = FolioReferencia + .Add("@Referencia", SqlDbType.VarChar).Value = Referencia + .Add("@FechaLimite", SqlDbType.DateTime).Value = FechaLimite .Add("@Orden", SqlDbType.Int).Value = Orden .Add("@Tipo", SqlDbType.VarChar).Value = Tipo .Add("@Estatus", SqlDbType.VarChar).Value = Estatus @@ -3826,6 +3830,28 @@ Public Class ClsGenerales Return Retorno End Function + Public Function AsignaEntregaAlmacenRuta(CveCamion As Integer, CveChofer As Integer, FechaEntrega As Date, CveEntregaAlmacen As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_EntregaAlmacenRutaAsignar") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCamion", SqlDbType.Int).Value = CveCamion + .Add("@CveChofer", SqlDbType.Int).Value = CveChofer + .Add("@FechaEntrega", SqlDbType.DateTime).Value = FechaEntrega + .Add("@CveEntregaAlmacen", SqlDbType.Int).Value = CveEntregaAlmacen + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar la entrega almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + Public Function GetInvEntregaAlmacenRuta(CveSubProyecto As Integer, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Opcion As Integer, Optional Estatus As Integer = -1) As Boolean Dim Retorno As Boolean = False diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb index 19d241d77..c075709d5 100644 --- a/App_Code/Timbrado.vb +++ b/App_Code/Timbrado.vb @@ -2171,7 +2171,7 @@ Public Class Timbrado If Carta.FiguraTransporte.AutoTransporte IsNot Nothing Then - cfdi.CartaPorteAutotransporte(Carta.FiguraTransporte.AutoTransporte.PermSCT, Carta.FiguraTransporte.AutoTransporte.NumPermisoSCT) + cfdi.CartaPorteAutotransporte(Carta.FiguraTransporte.AutoTransporte.PermisoSCT, Carta.FiguraTransporte.AutoTransporte.NumPermisoSCT) cfdi.CartaPorteIdentificacionVehicular(Carta.FiguraTransporte.AutoTransporte.Vehiculo.ConfigVehicular, Carta.FiguraTransporte.AutoTransporte.Vehiculo.PlacaVM, Carta.FiguraTransporte.AutoTransporte.Vehiculo.AnioModeloVM) @@ -3918,8 +3918,8 @@ Public Class Timbrado ComCartaPorte.FiguraTransporte.CveTransporte = ProfactCartaPorte.c_CveTransporte.Item02 ComCartaPorte.Mercancias.AutotransporteFederal = New ProfactCartaPorte.CartaPorteMercanciasAutotransporteFederal - If Carta.FiguraTransporte.AutoTransporte.PermSCT <> "" Then - ComCartaPorte.Mercancias.AutotransporteFederal.PermSCT = CType([Enum].Parse(GetType(ProfactCartaPorte.c_TipoPermiso), Carta.FiguraTransporte.AutoTransporte.PermSCT), ProfactCartaPorte.c_TipoPermiso) + If Carta.FiguraTransporte.AutoTransporte.PermisoSCT <> "" Then + ComCartaPorte.Mercancias.AutotransporteFederal.PermSCT = CType([Enum].Parse(GetType(ProfactCartaPorte.c_TipoPermiso), Carta.FiguraTransporte.AutoTransporte.PermisoSCT), ProfactCartaPorte.c_TipoPermiso) End If ComCartaPorte.Mercancias.AutotransporteFederal.NumPermisoSCT = Carta.FiguraTransporte.AutoTransporte.NumPermisoSCT 'pendiente RMF diff --git a/App_Code/Timbres.vb b/App_Code/Timbres.vb index e77192c72..a8263dfde 100644 --- a/App_Code/Timbres.vb +++ b/App_Code/Timbres.vb @@ -136,25 +136,32 @@ Public Class Timbres Timbre.Comprobante.Serie = Obj.Serie Timbre.Comprobante.Folio = Obj.Folio.ToString - If ObjGrales.GetGralMovimientosDetalleTimbre(CveTimbre, UsuarioActual.CveEmpresa) Then - DtMovimientos = ObjGrales.DtResultados - Else - TieneError = True - _MsgError.AppendLine("Error al obtener Movimientos") + If drT("FolioFiscalRelacionado").ToString <> "" Then + + Timbre.CFDIRelacionados.TipoRelacion = "05" + Timbre.CFDIRelacionados.UUID.Add(drT("FolioFiscalRelacionado").ToString) + End If - ObjFactura.DtDetalle = DtMovimientos + If ObjGrales.GetGralMovimientosDetalleTimbre(CveTimbre, UsuarioActual.CveEmpresa) Then + DtMovimientos = ObjGrales.DtResultados + Else + TieneError = True + _MsgError.AppendLine("Error al obtener Movimientos") + End If - AplicaCP = Boolean.Parse(drT("AplicaCP").ToString) + ObjFactura.DtDetalle = DtMovimientos - ObjFactura.CveSubProyecto = drT("CveSubProyecto").ToString.ToEntero + AplicaCP = Boolean.Parse(drT("AplicaCP").ToString) - ObjFactura.SetSubProyecto() - ObjFactura.SetSubProyectoMatriz() + ObjFactura.CveSubProyecto = drT("CveSubProyecto").ToString.ToEntero + + ObjFactura.SetSubProyecto() + ObjFactura.SetSubProyectoMatriz() If AplicaCP Then - CartaPorte.FiguraTransporte.AutoTransporte.PermSCT = drT("TipoPermisoSCT").ToString '"TPAF01" + CartaPorte.FiguraTransporte.AutoTransporte.PermisoSCT = drT("ClaveTipoPermisoSCT").ToString '"TPAF01" CartaPorte.FiguraTransporte.AutoTransporte.NumPermisoSCT = drT("NumPermisoSCT").ToString CartaPorte.FiguraTransporte.AutoTransporte.NombreSeguroResponsabilidadCivil = drT("NombreAseguradora").ToString CartaPorte.FiguraTransporte.AutoTransporte.PolizaSeguroResponsabilidadCivil = drT("NumPolizaSeguro").ToString @@ -166,8 +173,6 @@ Public Class Timbres CartaPorte.FiguraTransporte.AutoTransporte.Vehiculo.PlacaVM = drT("Placa").ToString CartaPorte.FiguraTransporte.AutoTransporte.Vehiculo.AnioModeloVM = drT("Anio").ToString.ToEntero - CPCliente = drT("CPCliente").ToString.ToEntero - Dim DomOrigen As CFDICartaPorteDomicilio = Nothing DomOrigen = New CFDICartaPorteDomicilio With {.Calle = drT("DirOriCalle").ToString, @@ -192,14 +197,14 @@ Public Class Timbres Dim Ubica As New CFDICartaPorteUbicacion Ubica.TipoEstacion = "" - Ubica = New CFDICartaPorteUbicacion With {.TipoUbicacion = "Origen", .IDUbicacion = "OR000001", .RFCRemitenteDestinatario = UsuarioActual.Empresa.RFC,'UsuarioActual.Empresa.RFC, + Ubica = New CFDICartaPorteUbicacion With {.TipoUbicacion = "Origen", .IDUbicacion = "OR000001", .RFCRemitenteDestinatario = drT("RemitenteRFC").ToString, .FechaHoraSalidaLlegada = FechaSalida.ToString("yyyy-MM-ddTHH:mm:ss"),' "2021-08-23T11:13:01", - .NombreRemitenteDestinatario = UsuarioActual.Empresa.Empresa, + .NombreRemitenteDestinatario = drT("RemitenteNombre").ToString, .Domicilio = DomOrigen} CartaPorte.Ubicaciones.Add(Ubica) - Ubica = New CFDICartaPorteUbicacion With {.TipoUbicacion = "Destino", .IDUbicacion = "DE000001", .RFCRemitenteDestinatario = UsuarioActual.Empresa.RFC,'UsuarioActual.Empresa.RFC,'"CAMJ841219I33", + Ubica = New CFDICartaPorteUbicacion With {.TipoUbicacion = "Destino", .IDUbicacion = "DE000001", .RFCRemitenteDestinatario = drT("DestinatarioRFC").ToString, .FechaHoraSalidaLlegada = FechaLlegada.ToString("yyyy-MM-ddTHH:mm:ss"), - .NombreRemitenteDestinatario = UsuarioActual.Empresa.Empresa, + .NombreRemitenteDestinatario = drT("DestinatarioNombre").ToString, .Domicilio = DomDestino, .DistanciaRecorrida = Distancia} @@ -303,33 +308,33 @@ Public Class Timbres If UsuarioActual.CveEmpresa = 15 Then drr("UM") = "" 'LES COMENTAN QUE NO DEBE IR LA ETIQUETA DE LA UNIDAD EN EL PRODUCTO Dim concepto As New CFDIConceptos With {.Cantidad = drr("Cantidad").ToString.ToDecimal, - .Descripcion = tPS, - .ValorUnitario = drr("PU").ToString.ToDecimal, - .Importe = drr("TotalImporte").ToString.ToDecimal, - .Descuento = drr("Descuento").ToString.ToDecimal, - .Unidad = drr("UM").ToString, - .ClaveUnidad = drr("SATClaveUM").ToString, - .ClaveProdServ = drr("SATClaveProdServ").ToString, - .Noidentificacion = drr("Noidentificacion").ToString, - .CuentaPredial = drr("CuentaPredial").ToString} + .Descripcion = tPS, + .ValorUnitario = drr("PU").ToString.ToDecimal, + .Importe = drr("TotalImporte").ToString.ToDecimal, + .Descuento = drr("Descuento").ToString.ToDecimal, + .Unidad = drr("UM").ToString, + .ClaveUnidad = drr("SATClaveUM").ToString, + .ClaveProdServ = drr("SATClaveProdServ").ToString, + .Noidentificacion = drr("Noidentificacion").ToString, + .CuentaPredial = ""} 'VERIFICA SUMA SUBTOTALES If i = Obj.DtDetalle.Rows.Count AndAlso totSubTotal <> concepto.Importe Then 'PROCESO DE AJUSTA DE DECIMALES concepto.Importe = totSubTotal End If totSubTotal = totSubTotal - concepto.Importe - 'SIEMPRE ESTAMOS AGREGANDO EL IVA - 'concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeIVA").ToString.ToDecimal, .Impuesto = "002", .Importe = drr("ImporteIVA").ToString.ToDecimal}) - Timbre.Conceptos.Add(concepto) i += 1 Next + Else + TieneError = True + _MsgError.AppendLine("timbrado son detalle de productos") End If - End If + End If - Else - TieneError = True + Else + TieneError = True _MsgError.AppendLine("Consultar datos de timbrado") End If diff --git a/Bancos/PopIECompras.aspx.vb b/Bancos/PopIECompras.aspx.vb index 719648f77..051bce60d 100644 --- a/Bancos/PopIECompras.aspx.vb +++ b/Bancos/PopIECompras.aspx.vb @@ -1797,7 +1797,7 @@ Partial Class Bancos_PopIECompras Funcionalidad = 313 ConceptoContable = 248 ElseIf MovimientoPagar.ConceptoRetIVA = 5 Then - Funcionalidad = 578 + Funcionalidad = 577 ConceptoContable = 285 End If diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index 8e950e3fc..b7a2fad40 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -1055,7 +1055,7 @@ Partial Class Bancos_ProveedoresAbonar Funcionalidad = 313 ConceptoContable = 248 ElseIf gvr.DataKey("CveRetIVAConcepto").ToEntero = 5 Then - Funcionalidad = 578 + Funcionalidad = 577 ConceptoContable = 285 End If diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index eb9ccbd04..fdb758268 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -1386,7 +1386,7 @@ Partial Class PopUpVerFactura DescargarArchivoPDFTraslado(Archivo, Path) Else If Exten = "pdf" Then - Dim ObjTimbres As New Timbres("Rec", cvetimbre, UsuarioActual) + Dim ObjTimbres As New Timbres(Parametros("TIPODOCTO").ToString, cvetimbre, UsuarioActual) GeneraPDFFactura(ObjTimbres.ObjFactura) Archivo = New System.IO.FileInfo(Path) diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb index 16a094279..4917f0a79 100644 --- a/General/SaldosIniciales.aspx.vb +++ b/General/SaldosIniciales.aspx.vb @@ -2467,7 +2467,7 @@ Partial Class General_SaldosIniciales Catalogos.Cell(crow, ccol).Value = "Estado" For Each row As DataRow In GlobalDTGralEstados("MEX").Rows crow = crow + 1 - Catalogos.Cell(crow, ccol).Value = String.Format("{0}: {1}", row("CveEstado"), row("Estado")) + Catalogos.Cell(crow, ccol).Value = String.Format("{0}: {1}", row("CveEstado"), row("NombreEstado")) Next colEstado = ccol rowEstado = crow diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index 3dff39843..d6556f4de 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -666,6 +666,7 @@ Partial Class Inventarios_EntradasSalidas TxtHoraInicio.SelectedTime = Mov.Fecha EstatusAlmacenCompra = Mov.EstatusAlmacenCompra Folio = Mov.Folio + Dim drM As DataRow = DtMov.Rows(0) If DtMov.Rows(0)("CveConcepto").ToString.ToEntero = 2 Then @@ -773,13 +774,13 @@ Partial Class Inventarios_EntradasSalidas CveCompra = Mov.CveCompra CveConcepto = Mov.CveConcepto - If DtMov.Rows(0)("CveEstatusTimbrado").ToString.ToEntero > 0 Then + If drM("CveEstatusTimbrado").ToString.ToEntero > 0 Then HplDescargaXml.Visible = True - HplDescargaXml.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=DesXmlTra&CVEMOVIMIENTO={0}&EXT={1}&FOLIO={2}&TIPODOCTO={3}", CveMovimiento, "XML", $"Tra-{Folio}", "Tra"))) + HplDescargaXml.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=DesXmlTra&CVEMOVIMIENTO={0}&EXT={1}&FOLIO={2}&TIPODOCTO={3}", CveMovimiento, "XML", drM("TimbreSerieFolio"), "Tra"))) HplDescargaPdf.Visible = True - HplDescargaPdf.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=DesPdfTra&CVEMOVIMIENTO={0}&EXT={1}&FOLIO={2}&TIPODOCTO={3}", CveMovimiento, "PDF", $"Tra-{Folio}", "Tra"))) + HplDescargaPdf.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=DesPdfTra&CVEMOVIMIENTO={0}&EXT={1}&FOLIO={2}&TIPODOCTO={3}", CveMovimiento, "PDF", drM("TimbreSerieFolio"), "Tra"))) - If UsuarioActual.Empresa.Funcionalidad(161) = "1" Then + If drM("AplicaCP").ToString = "True" Then HplCartaPorteTimbre.Visible = True HplCartaPorteTimbre.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=CARPOTIMBRE&CVEMOV={0}", CveMovimiento))) Else diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index 605de65fd..a71cb65b7 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -2536,7 +2536,7 @@ Partial Class Inventarios_EntregaAlmacen ErrorMovInv = True Else If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then - ImporteAlmacen = ObjInventario.DtResultados.SUMD("Total") + ImporteAlmacen = ObjInventario.DtResultados.SUMD("Total").RoundSQL For Each Dr As DataRow In ObjInventario.DtResultados.Rows If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString().ToDouble, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), CveSeccionAlmacen:=-3, Serie:=Dr("Serie").ToString(), Lote:=Dr("Lote").ToString(), FechaCaducidad:=Dr("FechaCaducidad").ToString().ToDate, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), EsInterno:=EsInterno, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero()) Then @@ -2954,7 +2954,7 @@ Partial Class Inventarios_EntregaAlmacen Dim TotalCostoAcumulado As Decimal = 0 Dim cont As Integer = 1 - Dim ValorMultiplicador = 1 + Dim ValorMultiplicador As Decimal = 1 If TipoMovimiento = 1 Then ValorMultiplicador = 1 diff --git a/Inventarios/EntregaAlmacenRuta.aspx b/Inventarios/EntregaAlmacenRuta.aspx index e356f8e91..85f2ffb50 100644 --- a/Inventarios/EntregaAlmacenRuta.aspx +++ b/Inventarios/EntregaAlmacenRuta.aspx @@ -170,7 +170,7 @@ - - Recoleccion + +
+ +
+ + + + + + +
+ +
+ + + + + +
+ +
+
+ + + + + + + + + + +
+
+
+ + + +
+
+
+ Recoleccion + + +
@@ -314,7 +357,12 @@ <%----%> -   +   + + + + +   @@ -441,6 +489,44 @@
+
+
+ + +
+
+ + + + +
+ + + + + + + +
+
+
+ + +
+
+
+ + + +
+
+
+
+ + + +
+
diff --git a/Inventarios/EntregaAlmacenRuta.aspx.cs b/Inventarios/EntregaAlmacenRuta.aspx.cs index f1f8567ac..8cb0d13db 100644 --- a/Inventarios/EntregaAlmacenRuta.aspx.cs +++ b/Inventarios/EntregaAlmacenRuta.aspx.cs @@ -155,7 +155,7 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas break; } DateTime fechallegada = (TxtFechaEntrega.Text + " 23:59").ToDate(); - int CveEntregaAlmacen = ObjGeneral.AddInvEntregaAlmacenRuta(row.DataKey("CveSubProyectoOrigen").ToEntero(), CveDireccionOrigen, CveDireccionDestino, row.DataKey("CveMovimiento").ToEntero(), DdlChofer.SelectedValue.ToEntero(), DdlUnidadCamion.SelectedValue.ToEntero(), TxtFechaEntrega.Text.ToDate(), fechallegada, "E",Orden,0,1); + int CveEntregaAlmacen = ObjGeneral.AddInvEntregaAlmacenRuta(row.DataKey("CveSubProyectoOrigen").ToEntero(), CveDireccionOrigen, CveDireccionDestino, row.DataKey("CveMovimiento").ToEntero(), DdlChofer.SelectedValue.ToEntero(), DdlUnidadCamion.SelectedValue.ToEntero(), TxtFechaEntrega.Text.ToDate(), fechallegada, "E", "","", "1900-01-01".ToDate(), Orden,0, 1); CveDireccionOrigen = row.DataKey("CveDireccionEnvio").ToEntero(); if (CveEntregaAlmacen > 0) @@ -249,13 +249,13 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas { - if (DdlChofer.SelectedValue.ToEntero() <= 0) + if (DdlChoferRec.SelectedValue.ToEntero() <= 0) { Alert("Debe seleccionar un chofer.", ModExtensiones.TipoMensaje.MsgAdvertencia); return; } - if (DdlUnidadCamion.SelectedValue.ToEntero() <= 0) + if (DdlUnidadRec.SelectedValue.ToEntero() <= 0) { Alert("Debe seleccionar una unidad", ModExtensiones.TipoMensaje.MsgAdvertencia); return; @@ -284,22 +284,32 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas if (CveEntregaAlmacen > 0) { - int CveTimbre = ObjGeneral.AddGralTimbre("Rec", row.DataKey("CveSubProyecto").ToEntero(), TxtFechaEntrega.Text.ToDate(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen:CveEntregaAlmacen , AplicaCP: ChkEmitirCartaPorte.Checked); - - if (CveTimbre <= 0) + // se actualizan los datos de unidad, chofer, fechas y Carta porte + if (ObjGeneral.AsignaEntregaAlmacenRuta(DdlUnidadRec.SelectedValue.ToEntero(), DdlChoferRec.SelectedValue.ToEntero(), TxtFechaRec.Text.ToDate(), CveEntregaAlmacen, UsuarioActual.CveEmpresa)) { - SBError.AppendLine($"Factura {row.DataKey("SerieFolio")} error al agregar timbre. "); - TieneError = true; - break; + int CveTimbre = ObjGeneral.AddGralTimbre("Rec", row.DataKey("CveSubProyecto").ToEntero(), TxtFechaEntrega.Text.ToDate(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen: CveEntregaAlmacen, AplicaCP: ChkEmitirPorteRec.Checked); + + if (CveTimbre <= 0) + { + SBError.AppendLine($"Factura {row.DataKey("SerieFolio")} error al agregar timbre. "); + TieneError = true; + break; + } + else + { + ListaTimbres.Add(CveTimbre); + } } else { - ListaTimbres.Add(CveTimbre); + SBError.AppendLine($"Factura {row.DataKey("SerieFolio")} error al aplicar condiciones de entrega. "); + TieneError = true; + break; } } else { - SBError.AppendLine($"Factura {row.DataKey("SerieFolio")} error al agregar entrega alamcen. "); + SBError.AppendLine($"Factura {row.DataKey("SerieFolio")} error al agregar entrega almacen. "); TieneError = true; break; } @@ -405,10 +415,12 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas private void CargaCombos() { - DdlUnidadCamion.DataSource = get_GlobalDTInvCamiones(UsuarioActual.CveEmpresa); - + DdlUnidadCamion.DataSource = get_GlobalDTInvCamiones(UsuarioActual.CveEmpresa); DdlUnidadCamion.Items.Insert(0, new ListItem("Seleccione", "-1")); DdlUnidadCamion.DataBind(); + DdlUnidadRec.DataSource = get_GlobalDTInvCamiones(UsuarioActual.CveEmpresa); + DdlUnidadRec.Items.Insert(0, new ListItem("Seleccione", "-1")); + DdlUnidadRec.DataBind(); TxtFechaI.Text = DateTime.Now.AddDays(-1).ToShortDateString(); TxtFechaF.Text = DateTime.Now.ToShortDateString(); @@ -416,6 +428,9 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas DdlChofer.DataSource = get_GlobalDTChoferes(UsuarioActual.CveEmpresa); DdlChofer.DataBind(); DdlChofer.Items.Insert(0, new ListItem("Seleccione", "-1")); + DdlChoferRec.DataSource = get_GlobalDTChoferes(UsuarioActual.CveEmpresa); + DdlChoferRec.DataBind(); + DdlChoferRec.Items.Insert(0, new ListItem("Seleccione", "-1")); TxtFechaEntrega.Text = DateTime.Now.ToShortDateString(); @@ -799,7 +814,7 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas if( CveEntregaAlmacen == -1) { DateTime fechallegada = (TxtFechaEntrega.Text + " 23:59").ToDate(); - CveEntregaAlmacen = ObjGenerales.AddInvEntregaAlmacenRuta(DdlSubProyectoRecoleccion.SelectedValue.ToEntero(), DdlmodalRecoleccionDireccion.SelectedValue.ToEntero(), -1,-1, DdlChofer.SelectedValue.ToEntero(), DdlUnidadCamion.SelectedValue.ToEntero(), TxtFechaEntrega.Text.ToDate(), fechallegada , "R", 1,0,1); + CveEntregaAlmacen = ObjGenerales.AddInvEntregaAlmacenRuta(DdlSubProyectoRecoleccion.SelectedValue.ToEntero(), DdlmodalRecoleccionDireccion.SelectedValue.ToEntero(), -1,-1, DdlChofer.SelectedValue.ToEntero(), DdlUnidadCamion.SelectedValue.ToEntero(), TxtFechaEntrega.Text.ToDate(), fechallegada, "R",TxtFolioReferencia.Text, TxtReferencia.Text, TxtFechaLimite.Text.ToDate(), 1,0,1) ; if (CveEntregaAlmacen > 0) { //CveTimbrenuevo = ObjGenerales.AddGralTimbre("Rec", "-1", -1, "-1", TxtFechaEntrega.Text.ToDate(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0, -1, ChkEmitirCartaPorte.Checked, CveEntregaAlmacen, -1); diff --git a/Inventarios/RepEntregaAlmacenRuta.aspx.cs b/Inventarios/RepEntregaAlmacenRuta.aspx.cs index 9815daaf8..d36145e06 100644 --- a/Inventarios/RepEntregaAlmacenRuta.aspx.cs +++ b/Inventarios/RepEntregaAlmacenRuta.aspx.cs @@ -339,7 +339,7 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas Timbres ObjTimbres = new Timbres("Tra", cvetimbre, UsuarioActual); StringBuilder MensajeAlert = new StringBuilder(); MensajeAlert.AppendFormat("Folio: {0}  ", ObjTimbres.ObjFactura.SerieFolio); - if (ObjTimbres.Timbrar()) + if (ObjTimbres.MsgError =="" && ObjTimbres.Timbrar()) { MensajeAlert.AppendFormat("XML    ", ModExtensiones.Encripta(String.Format("OP=DesXmlTra&CveTimbre={0}&EXT={1}&FOLIO={2}&TIPODOCTO={3}", cvetimbre, "XML", ObjTimbres.ObjFactura.SerieFolio, ObjTimbres.ObjFactura.TipoDocto))); Alert(MensajeAlert.ToString(), ModExtensiones.TipoMensaje.MsgInformacion); diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index eba6867e5..3f7215698 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -1154,8 +1154,9 @@ Partial Class Inventarios_TraspasoAlmacen Dim ObjGral As New ClsGenerales(ObjInventario.IniciaTransacSQL) Dim CveSubProyectoTimbre As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros($"CveAlmacen = {DdlAlmacenOrigen.SelectedValue}").Rows(0)("CveSubProyecto").ToString.ToEntero + Dim Fechallegada As DateTime = (TxtFechaLlegada.Text & " 23:59:59").ToDateTime - Dim CveEntregaAlmacen As Integer = ObjGral.AddInvEntregaAlmacenRuta(CveSubProyectoTimbre, -1, -1, CveMovimientoSalida, DdlChofer.SelectedValue.ToEntero, DdlUnidadCamion.SelectedValue.ToEntero, TxtFechaEntrega.Text.ToDate, TxtFechaLlegada.Text.ToDatetime, "T", 1, 1, 1) + Dim CveEntregaAlmacen As Integer = ObjGral.AddInvEntregaAlmacenRuta(CveSubProyectoTimbre, -1, -1, CveMovimientoSalida, DdlChofer.SelectedValue.ToEntero, DdlUnidadCamion.SelectedValue.ToEntero, TxtFechaEntrega.Text.ToDate, Fechallegada, "T", 1, 1, 1) If CveEntregaAlmacen > 0 Then CveTimbre = ObjGral.AddGralTimbre("Tra", CveSubProyectoTimbre, TxtFechaEntrega.Text.ToDate, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen:=CveEntregaAlmacen, AplicaCP:=ChkEmitirCartaPorte.Checked) diff --git a/RH/CatPersonal.aspx.vb b/RH/CatPersonal.aspx.vb index cfce5c5d2..952096265 100644 --- a/RH/CatPersonal.aspx.vb +++ b/RH/CatPersonal.aspx.vb @@ -904,7 +904,7 @@ Partial Class RH_CatPersonal Catalogos.Cell(crow, ccol).Value = "Estado" For Each row As DataRow In GlobalDTGralEstados("MEX").Rows crow = crow + 1 - Catalogos.Cell(crow, ccol).Value = String.Format("{0}: {1}", row("CveEstado"), row("Estado")) + Catalogos.Cell(crow, ccol).Value = String.Format("{0}: {1}", row("CveEstado"), row("NombreEstado")) Next colEstado = ccol rowEstado = crow