diff --git a/Acumuladores/RepRecolecciones.aspx b/Acumuladores/RepRecolecciones.aspx index b32a3beae..fe1de6735 100644 --- a/Acumuladores/RepRecolecciones.aspx +++ b/Acumuladores/RepRecolecciones.aspx @@ -178,8 +178,25 @@
P + +
+
+
+
+ A. Origen +
+
+ +
+
+ A. Destino +
+
+ +
+

@@ -225,7 +242,7 @@
- +
@@ -246,6 +263,7 @@
+
diff --git a/Acumuladores/RepRecolecciones.aspx.vb b/Acumuladores/RepRecolecciones.aspx.vb index 8c50eb36d..44e8fccab 100644 --- a/Acumuladores/RepRecolecciones.aspx.vb +++ b/Acumuladores/RepRecolecciones.aspx.vb @@ -1,6 +1,7 @@ Imports System.Data Imports CrystalDecisions.Shared.Json Imports Extensiones +Imports Modelos Partial Class Acumuladores_RepRecolecciones @@ -59,25 +60,27 @@ Partial Class Acumuladores_RepRecolecciones Private Sub InicializaCombos() CargaPS() - TxtFechaI.Text = NowADS().AddDays(-1).ToShortDateString - TxtFechaF.Text = NowADS().AddDays(3).ToShortDateString + TxtFechaI.Text = NowADS().AddMonths(-1).ToShortDateString + TxtFechaF.Text = NowADS().AddMonths(1).ToShortDateString CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto) + DdlAlmacenOrigen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (4)") + DdlAlmacenOrigen.DataBind() + DdlAlmacenDestino.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (21) and Almacen like '%sado%'") + DdlAlmacenDestino.DataBind() + End Sub Private Sub CargaDatos() Dim ObjGeneral As New ClsGenerales - - If (ObjGeneral.GetInvEntregaAlmacenRuta(-1, Now.AddMonths(-1), Now.AddMonths(1), UsuarioActual.CveEmpresa, 2, -1)) Then + If (ObjGeneral.GetInvEntregaAlmacenRuta(-1, TxtFechaI.Text.ToDate, TxtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, 2, -1)) Then GvR.DataSource = ObjGeneral.DtResultados End If - ObjGeneral.Dispose() UPGv.DataBind() UpGral.Update() - End Sub Protected Sub gvR_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) @@ -128,16 +131,18 @@ Partial Class Acumuladores_RepRecolecciones Private Sub CargaDatosRecoleccionDetallePS() Dim ObjGenerales As New ClsGenerales() - Dim Str As New StringBuilder - Str.Append("Productos Definidos
") - If ObjGenerales.GetEntregaAlmacenRutaDetalle(CveEntregaAlmacen) Then - For Each dr As DataRow In ObjGenerales.DtResultados.Rows - Str.AppendFormat(" {0} - {1}
", dr("Cantidad"), dr("CodigoPS")) - Next - LblProductosCargados.Text = Str.ToString - End If + Dim Str As New StringBuilder + Str.Append("Productos Definidos
") + If ObjGenerales.GetEntregaAlmacenRutaDetalle(CveEntregaAlmacen) Then + For Each dr As DataRow In ObjGenerales.DtResultados.Rows + Str.AppendFormat(" {0} - {1}
", dr("Cantidad"), dr("CodigoPS")) + HdnPSRecoleccion.Value = dr("CvePS").ToString + HdnCantidadRecoleccion.Value = dr("Cantidad").ToString + Next + LblProductosCargados.Text = Str.ToString + End If - ObjGenerales.Dispose() + ObjGenerales.Dispose() GvModalPSRecoleccion.DataSource = DTRecoleccion GvModalPSRecoleccion.DataBind() @@ -158,43 +163,38 @@ Partial Class Acumuladores_RepRecolecciones End Function Private Sub CargaPS() - Dim ObjAcum As New ClsAcumuladores + Dim lista As New List(Of String) Dim Filtro As String = "" For Each drow As DataRow In GlobalDTAcumTamaños(UsuarioActual.CveEmpresa).Rows - If drow("CvePSCargo").ToString.ToEntero > 0 Then lista.Add(drow("CvePSCargo").ToString) End If Next If lista.Count > 0 Then - Filtro = "CvePS in(" & String.Join(",", lista) & ")" - DdlProducto2.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltraParametros(Filtro) DdlProducto2.DataBind() DdlProducto2.Items.Insert(0, New ListItem("Seleccione", "-1")) End If - ObjAcum.Dispose() End Sub Protected Sub LnkModalAgregarPS_Click(ByVal sender As Object, ByVal e As EventArgs) Dim dRow As DataRow = DTRecoleccion.NewRow() - dRow("CveEntregaAlmacenDetalle") = -1 - dRow("CveEntregaAlmacen") = CveEntregaAlmacen - dRow("CvePS") = DdlProducto2.SelectedValue.ToEntero() - dRow("Cantidad") = TxtModalRecoleccionCantidad.Text.ToEntero() - dRow("CveUnidadMedida") = DdlModalRecoleccionUnidad.SelectedValue.ToEntero() - dRow("CveUsuario") = UsuarioActual.CveUsuario - dRow("FechaIng") = NowADS() - dRow("CodigoPS") = DdlProducto2.SelectedItem.Text - dRow("Abreviatura") = DdlModalRecoleccionUnidad.SelectedItem.Text - DTRecoleccion.Rows.Add(dRow) - + dRow("CveEntregaAlmacenDetalle") = -1 + dRow("CveEntregaAlmacen") = CveEntregaAlmacen + dRow("CvePS") = DdlProducto2.SelectedValue.ToEntero() + dRow("Cantidad") = TxtModalRecoleccionCantidad.Text.ToEntero() + dRow("CveUnidadMedida") = DdlModalRecoleccionUnidad.SelectedValue.ToEntero() + dRow("CveUsuario") = UsuarioActual.CveUsuario + dRow("FechaIng") = NowADS() + dRow("CodigoPS") = DdlProducto2.SelectedItem.Text + dRow("Abreviatura") = DdlModalRecoleccionUnidad.SelectedItem.Text + DTRecoleccion.Rows.Add(dRow) LimpiarControlesPS() CargaDatosRecoleccionDetallePS() @@ -208,5 +208,73 @@ Partial Class Acumuladores_RepRecolecciones UpModalRecoleccion.Update() End Sub + Private Sub BtnModalRecoleccionGuardar_Click(sender As Object, e As EventArgs) Handles BtnModalRecoleccionGuardar.Click + Dim ObjInventario As New ClsInventarios + Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL) + Dim ErrorMovInv As Boolean = False + Dim Fecha As DateTime = NowADS() + Dim Concepto As String = "Traspaso Recolección" + Dim CveMovimientoSalida As Integer = ObjInventario.AddMovimiento(DdlAlmacenOrigen.SelectedValue.ToEntero, 26, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1) + Dim FolioSalida As Integer = ObjInventario.Folio + Dim CveMovimientoEntrada As Integer = ObjInventario.AddMovimiento(DdlAlmacenDestino.SelectedValue.ToEntero, 27, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveMovimientoRelacionado:=CveMovimientoSalida) + Dim CveUM As Integer = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=HdnPSRecoleccion.Value.ToEntero).FiltroPrimeroValor("CveUnidadMedida", "").ToEntero + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, HdnCantidadRecoleccion.Value.ToDecimal, CveUM, HdnPSRecoleccion.Value.ToEntero, 0) Then + ErrorMovInv = True + End If + 'HdnPSRecoleccion + For Each gvr As GridViewRow In GvModalPSRecoleccion.Rows + Dim CveMovtoDetalle As Integer + If ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, gvr.DataKey("Cantidad").ToDecimal, gvr.DataKey("CveUnidadMedida").ToEntero, gvr.DataKey("CvePS").ToEntero, 0) Then + CveMovtoDetalle = ObjInventario.CveMovimientoDetalle + Else + ErrorMovInv = True + End If + Next + If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then + Dim Cont As Integer = 0 + Dim dttSalida As DataTable = ObjInventario.DtResultados + + If Not ErrorMovInv Then + Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/TraspasoAlmacen", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + Dim importe As Decimal = dttSalida.SUMD("Total").RoundSQL + Dim Contabilizable As Boolean = False + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, importe, 68, Concepto, Concepto, CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=Contabilizable) Then + ErrorMovInv = True + End If + + If Not ErrorMovInv AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, importe, 68, Concepto, Concepto, CveMovimientoAlmacen:=CveMovimientoEntrada, Contabilizable:=Contabilizable) Then + ErrorMovInv = True + End If + + If Not ErrorMovInv Then + If ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual) Then + If ObjConta.ValorPolizaDescuadre > 0 Then + 'MsgError = ObjMov.MensajePolizaDescuadre + ErrorMovInv = True + 'GuardaLogAD($"Bancos/Transferencias | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") + End If + Else + ErrorMovInv = True + End If + End If + End If + End If + + If Not ErrorMovInv Then + ObjInventario.Commit() + + Dim MensajeAlert As New StringBuilder + + MensajeAlert.Append("Se realizó con éxito el traspaso.") + + MensajeAlert.AppendFormat("
Folio de Salida: {0}", FolioSalida, CveMovimientoSalida) + 'MensajeAlert.AppendFormat("
Imprimir Reporte", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoSalida))) + Alert(MensajeAlert.ToString) + Else + ObjInventario.RollBack() + End If + + End Sub End Class diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index e2d59310b..be580aea7 100644 --- a/App_Code/ClsBancos.vb +++ b/App_Code/ClsBancos.vb @@ -977,12 +977,10 @@ Public Class ClsBancos Public Function GeneraTimbrePago(CveIE As Integer, CveVenta As Integer, UsuarioActual As Usuario, Optional CveCliente As Integer = -1, Optional CFDIRelacionado As String = "-1", Optional EsRegeneracion As Boolean = False, Optional CvePrePoliza As Integer = -1, Optional FechaTimbrado As DateTime = MinFecha) As Boolean - Dim Serie As String = "Pag" Dim Folio As Integer = -1 Dim Retorno As Boolean = False Dim Estatus As Integer = 1 - Dim dttpagos As DataTable = Nothing Dim dttpagosimpuestos As DataTable = Nothing Dim dr As Data.DataRow = Nothing @@ -996,7 +994,6 @@ Public Class ClsBancos If FechaTimbrado = MinFecha Then Dim RowFiltro As DataRow = Nothing - RowFiltro = dttpagos.FiltroPrimero("") If RowFiltro IsNot Nothing Then @@ -1018,10 +1015,8 @@ Public Class ClsBancos Else FechaTimbrado = ClsPaginas.NowADS() End If - End If - Dim tCveComplementoPago As Integer = AddComplementoPago(If(CvePrePoliza > 0, CveIE, dr("CveIE").ToString.ToEntero), -1, Serie, Folio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CvePrePoliza:=CvePrePoliza, Estatus:=Estatus) If tCveComplementoPago > 0 Then 'Dim drr As Data.DataRow = dtt.Rows(0) @@ -1042,7 +1037,6 @@ Public Class ClsBancos If Cuentapago <> "" AndAlso Not Cuentapago.Length.Contiene(11, 18) Then Mensaje = $"La cuenta ordenante {Cuentapago} no cumple con el formato esperado 11, 18 caracteres." End If - If CuentaBeneficiario <> "" AndAlso Not (CuentaBeneficiario.Length.Contiene(10, 11, 15, 16, 18, 50)) Then Mensaje = $"{Mensaje} La Cuenta Beneficiario {CuentaBeneficiario} no cumple con el formato esperado 10, 11, 15, 16, 18, 50 caracteres." End If @@ -1058,7 +1052,6 @@ Public Class ClsBancos If Cuentapago <> "" AndAlso Not Cuentapago.Length.Contiene(16) Then Mensaje = $"La cuenta ordenante {Cuentapago} no cumple con el formato esperado 16 caracteres." End If - If CuentaBeneficiario <> "" AndAlso Not (CuentaBeneficiario.Length.Contiene(10, 11, 15, 16, 18, 50)) Then Mensaje = $"{Mensaje} La Cuenta Beneficiario {CuentaBeneficiario} no cumple con el formato esperado 10, 11, 15, 16, 18, 50 caracteres." End If @@ -1067,7 +1060,6 @@ Public Class ClsBancos If Cuentapago <> "" AndAlso Not Cuentapago.Length.Contiene(10, 11, 15, 16, 18, 50) Then Mensaje = $"La cuenta ordenante {Cuentapago} no cumple con el formato esperado 10, 11, 15, 16, 18, 50 caracteres." End If - If CuentaBeneficiario <> "" AndAlso Not (CuentaBeneficiario.Length.Contiene(10, 11, 15, 16, 18, 50)) Then Mensaje = $"{Mensaje} La Cuenta Beneficiario {CuentaBeneficiario} no cumple con el formato esperado 10, 11, 15, 16, 18, 50 caracteres." End If @@ -1075,13 +1067,11 @@ Public Class ClsBancos If Cuentapago <> "" AndAlso Not Cuentapago.Length.Contiene(10) Then Mensaje = $"La cuenta ordenante {Cuentapago} no cumple con el formato esperado 10 caracteres." End If - CuentaBeneficiario = "" Case "28" If Cuentapago <> "" AndAlso Not Cuentapago.Length.Contiene(16) Then Mensaje = $"La cuenta ordenante {Cuentapago} no cumple con el formato esperado 16 caracteres." End If - If CuentaBeneficiario <> "" AndAlso Not (CuentaBeneficiario.Length.Contiene(10, 11, 15, 16, 18, 50)) Then Mensaje = $"{Mensaje} La Cuenta Beneficiario {CuentaBeneficiario} no cumple con el formato esperado 10, 11, 15, 16, 18, 50 caracteres." End If @@ -1089,13 +1079,10 @@ Public Class ClsBancos If Cuentapago <> "" AndAlso Not Cuentapago.Length.Contiene(15, 16) Then Mensaje = $"La cuenta ordenante {Cuentapago} no cumple con el formato esperado 15, 16 caracteres." End If - If CuentaBeneficiario <> "" AndAlso Not (CuentaBeneficiario.Length.Contiene(10, 11, 15, 16, 18, 50)) Then Mensaje = $"{Mensaje} La Cuenta Beneficiario {CuentaBeneficiario} no cumple con el formato esperado 10, 11, 15, 16, 18, 50 caracteres." End If - Case Else - CuentaBeneficiario = "" Cuentapago = "" 'RFCCliente = "" @@ -1103,10 +1090,6 @@ Public Class ClsBancos End Select - 'If EsCancelacion AndAlso (CFDIRelacionado = "-1" OrElse CFDIRelacionado = "") Then - ' Mensaje += " La cancelación debe de tener documento relacionado" - 'End If - If Not Mensaje.Length = 0 Then GuardaLog(Mensaje) Return False diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index dbba3a3cd..332020f3c 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -9327,17 +9327,17 @@ Public Class ClsPaginas Pago.AplicaTraslado = False Contabilizable = False - If Pago.CveMonedaPago > 1 Then + If VentaActual.CveMoneda > 1 Then 'Agregamos la Extranjera - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, Pago.ImportePago, 295, Pago.Referencia, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True - ImporteMN = (Pago.ImportePago * TCValuacionPago - Pago.ImportePago).RoundSQL - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, ImporteMN, 227, Pago.Referencia, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, Pago.ImportePago, 295, Pago.Referencia, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionVenta, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True + ImporteMN = (Pago.ImportePago * TCValuacionVenta - Pago.ImportePago).RoundSQL + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, ImporteMN, 227, Pago.Referencia, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionVenta, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True Else 'Agregamos Nacional If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, Pago.ImportePago, 3, Pago.Referencia, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambioPago:=Pago.TCPago) Then ErrorMovtos = True End If - If Not ErrorMovtos AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, (Pago.ImportePago * TCValuacionPago).RoundSQL, 95, VentaActual.SerieFolio, VentaActual.SerieFolio, CveIE:=Pago.CveIE, CveVenta:=VentaActual.CveVenta, CveSubProyecto:=VentaActual.CveSubProyecto, CveCliente:=VentaActual.CveCliente, TipoCambio:=TCValuacionVenta, TipoCambioPago:=Pago.TCPago, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, Contabilizable:=False) Then + If Not ErrorMovtos AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, (Pago.ImportePago * TCValuacionVenta).RoundSQL, 95, VentaActual.SerieFolio, VentaActual.SerieFolio, CveIE:=Pago.CveIE, CveVenta:=VentaActual.CveVenta, CveSubProyecto:=VentaActual.CveSubProyecto, CveCliente:=VentaActual.CveCliente, TipoCambio:=TCValuacionVenta, TipoCambioPago:=Pago.TCPago, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, Contabilizable:=False) Then ErrorMovtos = True End If End If diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb index 3841c4f79..899d3d43a 100644 --- a/App_Code/Timbrado.vb +++ b/App_Code/Timbrado.vb @@ -654,134 +654,131 @@ Public Class Timbrado Return retorno End Function - Public Function PreparaTimbrePago(EmisorRFC As String, EmisorNombre As String, EmisorRegimenFiscal As String, - ReceptorRFC As String, ReceptorNombre As String, Serie As String, Folio As String, FechaTimbrado As DateTime, - CuentaPago As String, FechaPago As DateTime, FormaPago As String, MonedaPago As String, Monto As Decimal, LugarExpedicion As String, - CuentaBeneficiario As String, TipoCambioP As Decimal, dttpagos As Data.DataTable, - Optional UsoCFDI As String = "P01", Optional CFDIRelacionado As String = "", Optional EsCancelacion As Boolean = False) As CFDITimbre - ' validación extra para cuando es cancelación requiere el folio relacionado - If EsCancelacion AndAlso CFDIRelacionado = "" Then - Return Nothing - End If + 'Public Function PreparaTimbrePago(EmisorRFC As String, EmisorNombre As String, EmisorRegimenFiscal As String, + ' ReceptorRFC As String, ReceptorNombre As String, Serie As String, Folio As String, FechaTimbrado As DateTime, + ' CuentaPago As String, FechaPago As DateTime, FormaPago As String, MonedaPago As String, Monto As Decimal, LugarExpedicion As String, + ' CuentaBeneficiario As String, TipoCambioP As Decimal, dttpagos As Data.DataTable, + ' Optional UsoCFDI As String = "P01", Optional CFDIRelacionado As String = "", Optional EsCancelacion As Boolean = False) As CFDITimbre + ' ' validación extra para cuando es cancelación requiere el folio relacionado + ' If EsCancelacion AndAlso CFDIRelacionado = "" Then + ' Return Nothing + ' End If - Dim Timbre As New CFDITimbre + ' Dim Timbre As New CFDITimbre - Timbre.Comprobante.TipoComprobante = "P" - Timbre.Comprobante.Folio = Folio - Timbre.Comprobante.Serie = Serie - Timbre.Comprobante.Fecha = FechaTimbrado - Timbre.Comprobante.FormadePago = "" - Timbre.Comprobante.CondicionesdePago = "" - Timbre.Comprobante.MetodoPago = "" - Timbre.Comprobante.SubTotal = 0 - Timbre.Comprobante.Descuentos = 0 - Timbre.Comprobante.Moneda = "XXX" - Timbre.Comprobante.TipoCambio = "" - Timbre.Comprobante.Total = 0 + ' Timbre.Comprobante.TipoComprobante = "P" + ' Timbre.Comprobante.Folio = Folio + ' Timbre.Comprobante.Serie = Serie + ' Timbre.Comprobante.Fecha = FechaTimbrado + ' Timbre.Comprobante.FormadePago = "" + ' Timbre.Comprobante.CondicionesdePago = "" + ' Timbre.Comprobante.MetodoPago = "" + ' Timbre.Comprobante.SubTotal = 0 + ' Timbre.Comprobante.Descuentos = 0 + ' Timbre.Comprobante.Moneda = "XXX" + ' Timbre.Comprobante.TipoCambio = "" + ' Timbre.Comprobante.Total = 0 - Timbre.Comprobante.LugarExpedicion = LugarExpedicion + ' Timbre.Comprobante.LugarExpedicion = LugarExpedicion + ' Timbre.Emisor.RegimenFiscal = EmisorRegimenFiscal + ' Timbre.Emisor.Nombre = EmisorNombre + ' Timbre.Emisor.RFC = EmisorRFC - Timbre.Emisor.RegimenFiscal = EmisorRegimenFiscal - Timbre.Emisor.Nombre = EmisorNombre - Timbre.Emisor.RFC = EmisorRFC + ' Timbre.Receptor.RFC = ReceptorRFC + ' Timbre.Receptor.Nombre = ReceptorNombre + ' Timbre.Receptor.UsoCFDI = UsoCFDI - Timbre.Receptor.RFC = ReceptorRFC - Timbre.Receptor.Nombre = ReceptorNombre - Timbre.Receptor.UsoCFDI = UsoCFDI + ' If CFDIRelacionado <> "-1" And CFDIRelacionado <> "" Then + ' Timbre.CFDIRelacionados.TipoRelacion = "04" + ' Timbre.CFDIRelacionados.UUID.Add(CFDIRelacionado) + ' End If - If CFDIRelacionado <> "-1" And CFDIRelacionado <> "" Then - Timbre.CFDIRelacionados.TipoRelacion = "04" - Timbre.CFDIRelacionados.UUID.Add(CFDIRelacionado) - End If + ' 'detalles + ' Dim concepto As New CFDIConceptos With {.Cantidad = 1, + ' .Descripcion = "Pago", + ' .ValorUnitario = 0, + ' .Importe = 0, + ' .Unidad = "", + ' .ClaveUnidad = "ACT", + ' .ClaveProdServ = "84111506", + ' .Noidentificacion = ""} + ' Timbre.Conceptos.Add(concepto) - 'detalles + ' Select Case FormaPago + ' Case "01" + ' CuentaPago = "" + ' CuentaBeneficiario = "" + ' End Select - Dim concepto As New CFDIConceptos With {.Cantidad = 1, - .Descripcion = "Pago", - .ValorUnitario = 0, - .Importe = 0, - .Unidad = "", - .ClaveUnidad = "ACT", - .ClaveProdServ = "84111506", - .Noidentificacion = ""} - Timbre.Conceptos.Add(concepto) - - Select Case FormaPago - Case "01" - CuentaPago = "" - CuentaBeneficiario = "" - - End Select - - Dim ImporteCancelacion As Decimal = 1 - Dim MonedaCancelacion As String = "MXN" - Dim TipoCambioCancelacion As Decimal = 1 - If EsCancelacion Then MonedaPago = MonedaCancelacion - 'como registra un peso por cada fatura que se cancele, se tiene que multiplicar por el numero de facturas, para que se pueda emitir el timbre - If dttpagos IsNot Nothing AndAlso dttpagos.Rows.Count > 0 Then ImporteCancelacion = ImporteCancelacion * dttpagos.Rows.Count - Timbre.ComplementoPagos.CtaOrdenante = CuentaPago - Timbre.ComplementoPagos.CtaBeneficiario = CuentaBeneficiario - Timbre.ComplementoPagos.FechaPago = FechaPago - Timbre.ComplementoPagos.FormaDePagoP = FormaPago - Timbre.ComplementoPagos.MonedaP = MonedaPago - Timbre.ComplementoPagos.Monto = If(EsCancelacion, ImporteCancelacion, Monto).RoundSQL - Timbre.ComplementoPagos.TipoCambioP = If(EsCancelacion, TipoCambioCancelacion, TipoCambioP) + ' Dim ImporteCancelacion As Decimal = 1 + ' Dim MonedaCancelacion As String = "MXN" + ' Dim TipoCambioCancelacion As Decimal = 1 + ' If EsCancelacion Then MonedaPago = MonedaCancelacion + ' 'como registra un peso por cada fatura que se cancele, se tiene que multiplicar por el numero de facturas, para que se pueda emitir el timbre + ' If dttpagos IsNot Nothing AndAlso dttpagos.Rows.Count > 0 Then ImporteCancelacion = ImporteCancelacion * dttpagos.Rows.Count + ' Timbre.ComplementoPagos.CtaOrdenante = CuentaPago + ' Timbre.ComplementoPagos.CtaBeneficiario = CuentaBeneficiario + ' Timbre.ComplementoPagos.FechaPago = FechaPago + ' Timbre.ComplementoPagos.FormaDePagoP = FormaPago + ' Timbre.ComplementoPagos.MonedaP = MonedaPago + ' Timbre.ComplementoPagos.Monto = If(EsCancelacion, ImporteCancelacion, Monto).RoundSQL + ' Timbre.ComplementoPagos.TipoCambioP = If(EsCancelacion, TipoCambioCancelacion, TipoCambioP) - Dim VentaFolioFiscal, VentaSerie, VentaFolio, VentaAbreviaturaSAT, VentaMetodoPago As String - Dim VentaImportePago, VentaImporteSaldoInsoluto, VentaImporteSaldoAnterior, VentaTipoCambio, PorcentajeIVA, PorcentajeIEPS As Decimal - Dim VentaNumParcialidad As Integer + ' Dim VentaFolioFiscal, VentaSerie, VentaFolio, VentaAbreviaturaSAT, VentaMetodoPago As String + ' Dim VentaImportePago, VentaImporteSaldoInsoluto, VentaImporteSaldoAnterior, VentaTipoCambio, PorcentajeIVA, PorcentajeIEPS As Decimal + ' Dim VentaNumParcialidad As Integer - If dttpagos IsNot Nothing AndAlso dttpagos.Rows.Count > 0 Then + ' If dttpagos IsNot Nothing AndAlso dttpagos.Rows.Count > 0 Then - For Each dr As Data.DataRow In dttpagos.Rows - VentaFolioFiscal = dr("FolioFiscal").ToString - VentaSerie = dr("VentaSerie").ToString - VentaFolio = dr("VentaFolio").ToString - VentaAbreviaturaSAT = dr("VentaAbreviaturaSAT").ToString - VentaMetodoPago = dr("MetodoPago").ToString - VentaImportePago = dr("VentaImportePagado").ToString.ToDecimal - VentaImporteSaldoInsoluto = dr("ImpSaldoInsoluto").ToString.ToDecimal - VentaImporteSaldoAnterior = dr("ImpSaldoAnterior").ToString.ToDecimal - VentaTipoCambio = dr("TipoCambio").ToString.ToDecimal - VentaNumParcialidad = dr("NumParcialidad").ToString.ToEntero - PorcentajeIVA = dr("PorcentajeIVA").ToString.ToDecimal - PorcentajeIEPS = dr("PorcentajeIEPS").ToString.ToDecimal - ' si la moneda es igual, se omite el tipo de cambio de la venta - If MonedaPago = VentaAbreviaturaSAT Then VentaTipoCambio = 0 + ' For Each dr As Data.DataRow In dttpagos.Rows + ' VentaFolioFiscal = dr("FolioFiscal").ToString + ' VentaSerie = dr("VentaSerie").ToString + ' VentaFolio = dr("VentaFolio").ToString + ' VentaAbreviaturaSAT = dr("VentaAbreviaturaSAT").ToString + ' VentaMetodoPago = dr("MetodoPago").ToString + ' VentaImportePago = dr("VentaImportePagado").ToString.ToDecimal + ' VentaImporteSaldoInsoluto = dr("ImpSaldoInsoluto").ToString.ToDecimal + ' VentaImporteSaldoAnterior = dr("ImpSaldoAnterior").ToString.ToDecimal + ' VentaTipoCambio = dr("TipoCambio").ToString.ToDecimal + ' VentaNumParcialidad = dr("NumParcialidad").ToString.ToEntero + ' PorcentajeIVA = dr("PorcentajeIVA").ToString.ToDecimal + ' PorcentajeIEPS = dr("PorcentajeIEPS").ToString.ToDecimal + ' ' si la moneda es igual, se omite el tipo de cambio de la venta + ' If MonedaPago = VentaAbreviaturaSAT Then VentaTipoCambio = 0 - 'condiciones especiales para el pago en pesos, facturas en moneda extranjera - If MonedaPago = "MXN" AndAlso VentaAbreviaturaSAT <> "MXN" Then - VentaTipoCambio = 1 / VentaTipoCambio - End If + ' 'condiciones especiales para el pago en pesos, facturas en moneda extranjera + ' If MonedaPago = "MXN" AndAlso VentaAbreviaturaSAT <> "MXN" Then + ' VentaTipoCambio = 1 / VentaTipoCambio + ' End If - ' For Each drr As Data.DataRow In DtFacturasPagadas.Rows - Dim doc As New CFDIComplementoPagosDocsRelacionados With {.IdDocumento = VentaFolioFiscal, - .Serie = VentaSerie, - .Folio = VentaFolio, - .MonedaDR = VentaAbreviaturaSAT, - .MetodoDePagoDR = VentaMetodoPago, - .ImpPagado = If(EsCancelacion, 1, VentaImportePago), - .ImpSaldoInsoluto = If(EsCancelacion, VentaImporteSaldoAnterior - 1, VentaImporteSaldoInsoluto), - .ImpSaldoAnt = VentaImporteSaldoAnterior, - .TipoCambioDR = VentaTipoCambio, - .NumParcialidad = VentaNumParcialidad} 'If(drr("MetodoPago").ToString = "PUE", 0, drr("NumParcialidad").ToString.ToEntero)} - Timbre.ComplementoPagos.DocumentosRelacionados.Add(doc) + ' ' For Each drr As Data.DataRow In DtFacturasPagadas.Rows + ' Dim doc As New CFDIComplementoPagosDocsRelacionados With {.IdDocumento = VentaFolioFiscal, + ' .Serie = VentaSerie, + ' .Folio = VentaFolio, + ' .MonedaDR = VentaAbreviaturaSAT, + ' .MetodoDePagoDR = VentaMetodoPago, + ' .ImpPagado = If(EsCancelacion, 1, VentaImportePago), + ' .ImpSaldoInsoluto = If(EsCancelacion, VentaImporteSaldoAnterior - 1, VentaImporteSaldoInsoluto), + ' .ImpSaldoAnt = VentaImporteSaldoAnterior, + ' .TipoCambioDR = VentaTipoCambio, + ' .NumParcialidad = VentaNumParcialidad} 'If(drr("MetodoPago").ToString = "PUE", 0, drr("NumParcialidad").ToString.ToEntero)} + ' Timbre.ComplementoPagos.DocumentosRelacionados.Add(doc) - Next - End If - 'If drr("IVA").ToString.ToDouble > 0 Then - If PorcentajeIVA > 0 Then Timbre.ComplementoPagos.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = VentaImportePago * PorcentajeIVA, .TasaOCuota = PorcentajeIVA, .Impuesto = "002"}) - 'Timbre.ComplementoPagos.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = 0, .TasaOCuota = 0, .Impuesto = "002"}) + ' Next + ' End If + ' 'If drr("IVA").ToString.ToDouble > 0 Then + ' If PorcentajeIVA > 0 Then Timbre.ComplementoPagos.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = VentaImportePago * PorcentajeIVA, .TasaOCuota = PorcentajeIVA, .Impuesto = "002"}) + ' 'Timbre.ComplementoPagos.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = 0, .TasaOCuota = 0, .Impuesto = "002"}) - If PorcentajeIEPS > 0 Then Timbre.ComplementoPagos.Impuestos.Add(New CFDIConceptosImpuestos With {.Base = VentaImportePago * PorcentajeIEPS, .TasaOCuota = PorcentajeIEPS, .Impuesto = "003"}) + ' If PorcentajeIEPS > 0 Then Timbre.ComplementoPagos.Impuestos.Add(New CFDIConceptosImpuestos With {.Base = VentaImportePago * PorcentajeIEPS, .TasaOCuota = PorcentajeIEPS, .Impuesto = "003"}) - 'Next + ' 'Next - Return Timbre + ' Return Timbre - End Function + 'End Function Public Function PreparaTimbrePago40(EmisorRFC As String, EmisorNombre As String, EmisorRegimenFiscal As String, ReceptorRFC As String, ReceptorNombre As String, ReceptorDomicilioFiscal As String, ReceptorRegimenFiscal As String, @@ -2732,8 +2729,8 @@ Public Class Timbrado doc.ImpPagado, doc.ImpSaldoInsoluto, doc.ObjetoImpuesto) - If doc.Impuestos IsNot Nothing Then + If doc.Impuestos IsNot Nothing Then ''retenciones If (doc.Impuestos).Where(Function(x) x.TrasladooRetencion = "R").Count > 0 Then Dim j As Integer = 0 @@ -2744,7 +2741,6 @@ Public Class Timbrado j += 1 Next End If - ''traslados If (doc.Impuestos).Where(Function(x) x.TrasladooRetencion = "T").Count > 0 Then Dim j As Integer = 0 @@ -2756,7 +2752,6 @@ Public Class Timbrado Next End If End If - Next If (docp.Retenciones).Count > 0 Then @@ -2974,8 +2969,6 @@ Public Class Timbrado Alert($"Error al leer la llave privada: {ex.Message}", TipoMensaje.MsgError) Return "Error al leer la llave privada" End Try - - Try certByte = System.IO.File.ReadAllBytes(ArchivoCertificado) certBase64 = Convert.ToBase64String(certByte) @@ -2986,13 +2979,11 @@ Public Class Timbrado End Try #End Region - sw.Stop() swTiempo.AppendFormat("Verificado : ({0}) {1} ", sw.ElapsedMilliseconds - swmili, sw.ElapsedMilliseconds) swmili = sw.ElapsedMilliseconds sw.Start() - Dim RespGeneracionXML As String = GenerarXMLGoCFDIv40(cfdi, EmisorRFC, ArchivoCertificado, llaveBase64, Clave, Ventas, UsuarioActual, CvePACEspecial) sw.Stop() @@ -3012,7 +3003,6 @@ Public Class Timbrado 'Verifica el error If cfdi.Mensaje = "" Then Dim SelloCfdi As String - UUID = cfdi.CfdiInfo.UUID SelloCfdi = cfdi.CfdiInfo.SelloCfdi diff --git a/Bin/GoCfdi.dll b/Bin/GoCfdi.dll index 37c940d76..12e6171e5 100644 Binary files a/Bin/GoCfdi.dll and b/Bin/GoCfdi.dll differ diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index 23e2e03a7..3eff34079 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -83,7 +83,7 @@ Partial Class Inventarios_EntradasSalidas End Property Public Property CveConcepto() As Integer Get - Return ViewState("CveConcepto").ToString.ToEntero + Return IfNull(ViewState("CveConcepto"), "").ToString.ToEntero End Get Set(value As Integer) ViewState("CveConcepto") = value @@ -1249,6 +1249,8 @@ Partial Class Inventarios_EntradasSalidas DdlAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlAlmacen.DataBind() DdlAlmacen.SelectedIndex = 1 'toma el primer renglón + DdlConcepto.Items.Insert(0, New ListItem("Entrada Usados", "42")) + DdlConcepto.SelectedValue = "42" Dim ObjGenerales As New ClsGenerales() diff --git a/Inventarios/PaquetesArmadoDesarmado.aspx b/Inventarios/PaquetesArmadoDesarmado.aspx index d623ae77c..8cdfba283 100644 --- a/Inventarios/PaquetesArmadoDesarmado.aspx +++ b/Inventarios/PaquetesArmadoDesarmado.aspx @@ -3,6 +3,16 @@ + + + Paquetes | Armado - Desarmado @@ -186,7 +196,9 @@
- + @@ -210,7 +222,8 @@ -
+ +<%--
@@ -220,7 +233,24 @@ -
+
--%> + +
+ + + + + + + + + + +
+ + +
@@ -477,7 +507,22 @@ -
+ +
+ + + + + + + + + + +
+ + <%--
@@ -487,7 +532,8 @@ -
+
--%> +
@@ -679,5 +725,7 @@ } + + diff --git a/Inventarios/PaquetesArmadoDesarmado.aspx.vb b/Inventarios/PaquetesArmadoDesarmado.aspx.vb index 5c31e2e4e..3c43cfe9d 100644 --- a/Inventarios/PaquetesArmadoDesarmado.aspx.vb +++ b/Inventarios/PaquetesArmadoDesarmado.aspx.vb @@ -490,6 +490,91 @@ Partial Class Inventarios_PaquetesArmadoDesarmado End If + Dim TextoError As New StringBuilder + If Tipo = 1 Then + Dim ObjInventarioVal As New ClsInventarios + Dim StrXML As New StringBuilder + StrXML.Append("") + Dim FechaCaducidad As Date + Dim Lote As String = "" + + Dim TieneErrorExistencia As Boolean = False + + For Each GvRow As GridViewRow In GvDatosArmado.Rows + + FechaCaducidad = If(CBool(GvRow.DataKey("AplicaCaducidad")) AndAlso GvRow.FCTextBox("TxtCaducidad").ToString().ToDate > MinFecha, GvRow.FCTextBox("TxtCaducidad").Text.ToDate, MinFecha) + Lote = If(CBool(GvRow.DataKey("AplicaLote")), GvRow.FCTextBox("TxtLote").Text.Trim, "-1") + + Dim Existencia As Decimal = ObjInventarioVal.GetExistenciasPS(GvRow.DataKey("CvePS").ToEntero, GvRow.DataKey("CveUM").ToEntero, UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenArmado.SelectedValue.ToEntero(), FechaMovto:=TxtFechaArmado.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:="-1", Lote:=Lote, FechaCaducidad:=FechaCaducidad) + + + If GvRow.DataKey("Cantidad").ToDecimal > Existencia Then + TieneErrorExistencia = True + + TextoError.AppendFormat(" - {0} Existencia: {1:#,##0.##}
", GvRow.DataKey("CodigoPS"), Existencia) + + End If + + ''If Dr("CantidadGV").ToString().ToDecimal > 0 Then + 'If CBool(GvRow.DataKey("AplicaSerie")) Then + ' Alert("Aplica serie ") + ' TieneErrorExistencia = True + ' ' StrXML.AppendFormat("", GvRow.DataKey("CvePS"), GvRow.DataKey("CveUM"), 1, IfNull(Dr("CveSeccion"), -1), Dr1("Serie"), Lote, FechaCaducidad.ToString("yyyy/MM/dd")) + + 'Else + ' StrXML.AppendFormat("", GvRow.DataKey("CvePS"), GvRow.DataKey("CveUM"), GvRow.DataKey("Cantidad"), -1, "-1", Lote, FechaCaducidad.ToString("yyyy/MM/dd")) + 'End If + + 'End If + Next + + 'For Each Dr As DataRow In DtDatos.Rows + ' FechaCaducidad = If(CBool(Dr("AplicaCaducidad")) AndAlso Dr("FechaCaducidad").ToString() <> "", Dr("FechaCaducidad").ToString().ToDate, MinFecha) + ' Lote = If(CBool(Dr("AplicaLote")), Dr("Lote").ToString().Trim, "-1") + + ' If Dr("CantidadGV").ToString().ToDecimal > 0 Then + ' If CBool(Dr("AplicaSerie")) Then + ' DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Dr("Consec"))) + ' For Each Dr1 As DataRow In DtDetalle.Rows + ' StrXML.AppendFormat("", Dr1("CvePS"), Dr1("CveUM"), 1, IfNull(Dr("CveSeccion"), -1), Dr1("Serie"), Lote, FechaCaducidad.ToString("yyyy/MM/dd")) + ' Next + ' Else + ' StrXML.AppendFormat("", Dr("CvePS"), Dr("CveUM"), Dr("CantidadGV"), IfNull(Dr("CveSeccion"), -1), "-1", Lote, FechaCaducidad.ToString("yyyy/MM/dd")) + ' End If + ' End If + 'Next + + 'StrXML.Append("
") + + + 'If ObjInventarioVal.GetExistenciasPSXML(StrXML.ToString(), DdlAlmacenArmado.SelectedValue.ToEntero(), TxtFechaArmado.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), -1, CveVendedor, If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), If(Tipo = 2, 1, -1), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + ' If ObjInventarioVal.DtResultados.Rows.Count > 0 Then + ' TieneErrorExistencia = True + ' For Each Dr As DataRow In ObjInventarioVal.DtResultados.Rows + ' TextoError.AppendFormat(" - {0} Existencia: {1:#,##0.##}
", Dr("CodigoPS"), Dr("Existencia")) + ' Next + ' End If + 'Else + ' TieneErrorExistencia = True + 'End If + + If TieneErrorExistencia Then + 'ObjInventarioVal.RollBack() + ObjInventarioVal.Dispose() + + If TextoError.Length > 0 Then + Alert($" Lo(s) siguiente(s) Productos no tienen existencia suficiente:

{TextoError}", TipoMensaje.MsgAdvertencia) + End If + RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") + Exit Sub + End If + + End If + + + Exit Sub + + Dim ObjInventario As New ClsInventarios Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL()) @@ -864,20 +949,25 @@ Partial Class Inventarios_PaquetesArmadoDesarmado CargaSeccionesAlmacen(e.Row.FCDropDownList("DdlSeccionAlmacen"), DdlAlmacenArmado.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero, UsuarioActual.CveEmpresa) End If + + Dim DvFechaCaducidad As HtmlGenericControl = TryCast(e.Row.FindControl("DvFechaCaducidad"), HtmlGenericControl) + If e.Row.DataKey("AplicaCaducidad") = "True" Then - e.Row.FCTextBox("TxtCaducidad").Visible = True - e.Row.FCLinkButton("LnkCaducidad").Visible = True + 'e.Row.FCTextBox("TxtCaducidad").Visible = True + 'e.Row.FCLinkButton("LnkCaducidad").Visible = True - e.Row.FCTextBox("TxtCaducidad").ReadOnly = False - CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = True - e.Row.FCTextBox("TxtCaducidad").Enabled = True + 'e.Row.FCTextBox("TxtCaducidad").ReadOnly = False + ''CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = True + 'e.Row.FCTextBox("TxtCaducidad").Enabled = True + DvFechaCaducidad.Visible = True Else - e.Row.FCTextBox("TxtCaducidad").Visible = False - e.Row.FCLinkButton("LnkCaducidad").Visible = False - e.Row.FCTextBox("TxtCaducidad").Enabled = True + 'e.Row.FCTextBox("TxtCaducidad").Visible = False + 'e.Row.FCLinkButton("LnkCaducidad").Visible = False + 'e.Row.FCTextBox("TxtCaducidad").Enabled = True - e.Row.FCTextBox("TxtCaducidad").ReadOnly = True - CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False + 'e.Row.FCTextBox("TxtCaducidad").ReadOnly = True + ''CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False + DvFechaCaducidad.Visible = False End If e.Row.FCTextBox("TxtLote").Visible = e.Row.DataKey("AplicaLote") = "True" @@ -1019,21 +1109,44 @@ Partial Class Inventarios_PaquetesArmadoDesarmado CargaSeccionesAlmacen(e.Row.FCDropDownList("DdlSeccionAlmacen"), DdlAlmacenDesarmado.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero, UsuarioActual.CveEmpresa) End If + Dim DvFechaCaducidad As HtmlGenericControl = TryCast(e.Row.FindControl("DvFechaCaducidad"), HtmlGenericControl) + If e.Row.DataKey("AplicaCaducidad") = "True" Then - e.Row.FCTextBox("TxtCaducidad").Visible = True - e.Row.FCLinkButton("LnkCaducidad").Visible = True + 'e.Row.FCTextBox("TxtCaducidad").Visible = True + 'e.Row.FCLinkButton("LnkCaducidad").Visible = True - e.Row.FCTextBox("TxtCaducidad").ReadOnly = False - CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = True - e.Row.FCTextBox("TxtCaducidad").Enabled = True + 'e.Row.FCTextBox("TxtCaducidad").ReadOnly = False + ''CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = True + 'e.Row.FCTextBox("TxtCaducidad").Enabled = True + DvFechaCaducidad.Visible = True Else - e.Row.FCTextBox("TxtCaducidad").Visible = False - e.Row.FCLinkButton("LnkCaducidad").Visible = False - e.Row.FCTextBox("TxtCaducidad").Enabled = True + 'e.Row.FCTextBox("TxtCaducidad").Visible = False + 'e.Row.FCLinkButton("LnkCaducidad").Visible = False + 'e.Row.FCTextBox("TxtCaducidad").Enabled = True - e.Row.FCTextBox("TxtCaducidad").ReadOnly = True - CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False + 'e.Row.FCTextBox("TxtCaducidad").ReadOnly = True + ''CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False + DvFechaCaducidad.Visible = False End If + + + + 'If e.Row.DataKey("AplicaCaducidad") = "True" Then + ' e.Row.FCTextBox("TxtCaducidad").Visible = True + ' e.Row.FCLinkButton("LnkCaducidad").Visible = True + + ' e.Row.FCTextBox("TxtCaducidad").ReadOnly = False + ' CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = True + ' e.Row.FCTextBox("TxtCaducidad").Enabled = True + 'Else + ' e.Row.FCTextBox("TxtCaducidad").Visible = False + ' e.Row.FCLinkButton("LnkCaducidad").Visible = False + ' e.Row.FCTextBox("TxtCaducidad").Enabled = True + + ' e.Row.FCTextBox("TxtCaducidad").ReadOnly = True + ' CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False + 'End If + e.Row.FCTextBox("TxtLote").Visible = e.Row.DataKey("AplicaLote") = "True" e.Row.FCTextBox("TxtCosto").Attributes.Add("onkeyup", "SumaValores();") diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index 544982725..2bb004a3f 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -3330,6 +3330,7 @@ Partial Class Inventarios_RecepcionAlmacen Dim CveConceptoContableCostoME As Integer = -1 Dim CveConceptoContableCostoComplementaria As Integer = -1 Dim UsaComplementariaFleteImportaciones As Boolean = True + If UsuarioActual.CveEmpresa = 119 Then UsaComplementariaFleteImportaciones = False If DtCostos.Rows.Count > 0 Then If CveCompraSurtir > 0 Then @@ -3356,7 +3357,6 @@ Partial Class Inventarios_RecepcionAlmacen CveConceptoContableCosto = 176 CveConceptoContableCostoME = 228 CveConceptoContableCostoComplementaria = 229 - UsaComplementariaFleteImportaciones = True Else @@ -3456,7 +3456,7 @@ Partial Class Inventarios_RecepcionAlmacen If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then - MensajeContabilidad = $"
Movimiento contabilizado en el folio: {ObjConta.ContaFolio}
" + MensajeContabilidad = $"
Movimiento contabilizado en el folio: {ObjConta.ContaFolio}
" Else ErrorMovInv = True MensajeError = "Error al contabilizar los conceptos contables" diff --git a/OS/OrdenesServicios.aspx.vb b/OS/OrdenesServicios.aspx.vb index 31d94fb18..cfb0e1c7d 100644 --- a/OS/OrdenesServicios.aspx.vb +++ b/OS/OrdenesServicios.aspx.vb @@ -2933,7 +2933,7 @@ Partial Class OS_OrdenesServicios If DtOSSubProyectos IsNot Nothing Then If ObjOS.GetSubProyectosEstatusInicial(-1, 3, UsuarioActual.CveEmpresa) Then - TecnicosSubProyectos = ObjOS.DtResultados + TecnicosSubProyectos = ObjOS.DtResultados.FiltraParametros("Estatus = True") 'solo usuario activos End If For Each SubProyecto As DataRow In DtOSSubProyectos.Rows @@ -2946,8 +2946,6 @@ Partial Class OS_OrdenesServicios End If Next End If - - ObjOS.Dispose() DdlUsuarioAtendio.DataSource = TecnicosResultado.FiltraParametros("", "Nombre") diff --git a/Sistemas/DefinicionEmpresa.aspx b/Sistemas/DefinicionEmpresa.aspx index f020e0434..741dd2086 100644 --- a/Sistemas/DefinicionEmpresa.aspx +++ b/Sistemas/DefinicionEmpresa.aspx @@ -1025,15 +1025,18 @@
diff --git a/Transportes/RepContratos.aspx.vb b/Transportes/RepContratos.aspx.vb index 3f08f8f72..6c72990ad 100644 --- a/Transportes/RepContratos.aspx.vb +++ b/Transportes/RepContratos.aspx.vb @@ -31,7 +31,7 @@ Partial Class ListadoContratos DdlTipoAF.DataBind() DdlTipoAF.Items.Insert(0, New ListItem("-", "")) 'Lista Chofer' - DdlChofer.DataSource = GlobalDTRHPersonal(185) + DdlChofer.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa) 'solo puesto operador.y activos DdlChofer.DataBind() DdlChofer.Items.Insert(0, New ListItem("-", "")) UpModal.Update() diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index 6f61c20e7..6542dd47e 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -2193,6 +2193,8 @@ Partial Class Clientes Cuerpo = Cuerpo.Replace("{""Vigencia""}", Dr("Vigencia").ToString()) Cuerpo = Cuerpo.Replace("{""AtencionA""}", Dr("AtencionA").ToString()) Cuerpo = Cuerpo.Replace("{""Sucursal""}", Dr("SubProyecto").ToString()) + Cuerpo = Cuerpo.Replace("{""DescripcionVenta""}", Dr("DescripcionVenta").ToString()) + Cuerpo = Cuerpo.Replace("{""AtencionA""}", Dr("AtencionA").ToString()) End If @@ -2212,6 +2214,8 @@ Partial Class Clientes Asunto = Asunto.Replace("{""Vigencia""}", Dr("Vigencia").ToString()) Asunto = Asunto.Replace("{""AtencionA""}", Dr("AtencionA").ToString()) Asunto = Asunto.Replace("{""Sucursal""}", Dr("SubProyecto").ToString()) + Asunto = Asunto.Replace("{""DescripcionVenta""}", Dr("DescripcionVenta").ToString()) + Asunto = Asunto.Replace("{""AtencionA""}", Dr("AtencionA").ToString()) End If End If @@ -2231,6 +2235,8 @@ Partial Class Clientes Cuerpo = Cuerpo.Replace("{""Vigencia""}", Dr("Vigencia").ToString()) Cuerpo = Cuerpo.Replace("{""AtencionA""}", Dr("AtencionA").ToString()) Cuerpo = Cuerpo.Replace("{""Sucursal""}", Dr("SubProyecto").ToString()) + Cuerpo = Cuerpo.Replace("{""DescripcionVenta""}", Dr("DescripcionVenta").ToString()) + Cuerpo = Cuerpo.Replace("{""AtencionA""}", Dr("AtencionA").ToString()) End If End If @@ -2247,6 +2253,9 @@ Partial Class Clientes Asunto = Asunto.Replace("{""Vigencia""}", Dr("Vigencia").ToString()) Asunto = Asunto.Replace("{""AtencionA""}", Dr("AtencionA").ToString()) Asunto = Asunto.Replace("{""Sucursal""}", Dr("SubProyecto").ToString()) + Asunto = Asunto.Replace("{""DescripcionVenta""}", Dr("DescripcionVenta").ToString()) + Asunto = Asunto.Replace("{""AtencionA""}", Dr("AtencionA").ToString()) + End If End If End If @@ -5614,6 +5623,10 @@ Partial Class Clientes Cuerpo = Cuerpo.Replace("{""Vigencia""}", Dr("Vigencia").ToString()) Cuerpo = Cuerpo.Replace("{""AtencionA""}", Dr("AtencionA").ToString()) Cuerpo = Cuerpo.Replace("{""Sucursal""}", Dr("SubProyecto").ToString()) + Cuerpo = Cuerpo.Replace("{""DescripcionVenta""}", Dr("DescripcionVenta").ToString()) + Cuerpo = Cuerpo.Replace("{""AtencionA""}", Dr("AtencionA").ToString()) + + End If End If @@ -5632,6 +5645,8 @@ Partial Class Clientes Asunto = Asunto.Replace("{""Vigencia""}", Dr("Vigencia").ToString()) Asunto = Asunto.Replace("{""AtencionA""}", Dr("AtencionA").ToString()) Asunto = Asunto.Replace("{""Sucursal""}", Dr("SubProyecto").ToString()) + Asunto = Asunto.Replace("{""DescripcionVenta""}", Dr("DescripcionVenta").ToString()) + Asunto = Asunto.Replace("{""AtencionA""}", Dr("AtencionA").ToString()) End If End If @@ -5650,6 +5665,8 @@ Partial Class Clientes Cuerpo = Cuerpo.Replace("{""Vigencia""}", Dr("Vigencia").ToString()) Cuerpo = Cuerpo.Replace("{""AtencionA""}", Dr("AtencionA").ToString()) Cuerpo = Cuerpo.Replace("{""Sucursal""}", Dr("SubProyecto").ToString()) + Cuerpo = Cuerpo.Replace("{""DescripcionVenta""}", Dr("DescripcionVenta").ToString()) + Cuerpo = Cuerpo.Replace("{""AtencionA""}", Dr("AtencionA").ToString()) End If End If @@ -5667,6 +5684,9 @@ Partial Class Clientes Asunto = Asunto.Replace("{""Vigencia""}", Dr("Vigencia").ToString()) Asunto = Asunto.Replace("{""AtencionA""}", Dr("AtencionA").ToString()) Asunto = Asunto.Replace("{""Sucursal""}", Dr("SubProyecto").ToString()) + Asunto = Asunto.Replace("{""DescripcionVenta""}", Dr("DescripcionVenta").ToString()) + Asunto = Asunto.Replace("{""AtencionA""}", Dr("AtencionA").ToString()) + End If End If diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index a17c40d89..df7f915bc 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -21095,6 +21095,7 @@ Partial Class Ventas Cuerpo = Cuerpo.Replace("{""Vigencia""}", TxtFechaVencimientoCotizacion.Text) Cuerpo = Cuerpo.Replace("{""AtencionA""}", TxtAtencionA.Text) Cuerpo = Cuerpo.Replace("{""Sucursal""}", DdlSubProyectoDatos.SelectedItem.Text) + Cuerpo = Cuerpo.Replace("{""DescripcionVenta""}", TxtDescripcionVenta.Text) End If If UsuarioActual.Empresa.AsuntoPlantillaMailVentaCotizacion.Trim.Length > 0 Then @@ -21109,6 +21110,7 @@ Partial Class Ventas Asunto = Asunto.Replace("{""Vigencia""}", TxtFechaVencimientoCotizacion.Text) Asunto = Asunto.Replace("{""AtencionA""}", TxtAtencionA.Text) Asunto = Asunto.Replace("{""Sucursal""}", DdlSubProyectoDatos.SelectedItem.Text) + Asunto = Asunto.Replace("{""DescripcionVenta""}", TxtDescripcionVenta.Text) End If Else @@ -21123,6 +21125,7 @@ Partial Class Ventas Cuerpo = Cuerpo.Replace("{""SerieFolio""}", SerieFolio) Cuerpo = Cuerpo.Replace("{""AtencionA""}", TxtAtencionA.Text) Cuerpo = Cuerpo.Replace("{""Sucursal""}", DdlSubProyectoDatos.SelectedItem.Text) + Cuerpo = Cuerpo.Replace("{""DescripcionVenta""}", TxtDescripcionVenta.Text) End If If UsuarioActual.Empresa.AsuntoPlantillaMailVenta.Trim.Length > 0 Then @@ -21136,6 +21139,7 @@ Partial Class Ventas Asunto = Asunto.Replace("{""SerieFolio""}", SerieFolio) Asunto = Asunto.Replace("{""AtencionA""}", TxtAtencionA.Text) Asunto = Asunto.Replace("{""Sucursal""}", DdlSubProyectoDatos.SelectedItem.Text) + Asunto = Asunto.Replace("{""DescripcionVenta""}", TxtDescripcionVenta.Text) End If End If @@ -36312,6 +36316,10 @@ Partial Class Ventas RegistraScript("$('#DvModalTipoVenta').modal('hide');") End Select + + LblDvModalTipoVentaTitulo.Text = RBLTipoVenta.SelectedItem.Text + + End If UpDvModalTipoVenta.Update() End Sub @@ -36402,6 +36410,9 @@ Partial Class Ventas GvProductosProcedimiento.DataBind() DVGvProductosProcedimiento.Visible = False + + LblDvModalTipoVentaTitulo.Text = "Tipo de Venta" + UpDvModalTipoVenta.Update() End Sub