This commit is contained in:
Rakcsle Supertramp
2020-12-09 17:21:06 -07:00
13 changed files with 761 additions and 486 deletions

View File

@@ -2206,7 +2206,7 @@ Public Class ClsCompras
Return Retorno
End Function
Public Function UpdateEstatusAlmacenDetalle(CveCompraDetalle As Integer, ValorEstatus As Integer, CveUsuario As Integer) As Boolean
Public Function UpdateEstatusAlmacenDetalle(CveCompraDetalle As Integer, ValorEstatus As Integer, CveUsuario As Integer, Optional CantidadDevolucion As Decimal = 0) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Comp_ComprasDetalleEstatusAlmacenUpdate")
@@ -2214,6 +2214,7 @@ Public Class ClsCompras
.Add("@CveCompraDetalle", SqlDbType.Int).Value = CveCompraDetalle
.Add("@Estatus", SqlDbType.Int).Value = ValorEstatus
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CantidadDevolucion", SqlDbType.Decimal).Value = CantidadDevolucion
End With
Try

View File

@@ -2682,6 +2682,7 @@ Public Class ClsInventarios
DataAdapter("PA_Inv_InventarioFisicoResultadoAvance")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)

View File

@@ -4847,7 +4847,7 @@ Public Class ClsPaginas
PaginaDict.Add("/RH/RepVacaciones.aspx".ToUpper(), 422)
PaginaDict.Add("/RH/CatChecadorTipo.aspx".ToUpper(), 427)
PaginaDict.Add("/RH/CatChecadorHorarios.aspx".ToUpper(), 428)
PaginaDict.Add("/RH/CatChecadorEstaciones.aspx".ToUpper(), 627)
PaginaDict.Add("/RH/RepChecadorPreAsistencia.aspx".ToUpper(), 628)
PaginaDict.Add("/RH/CatCaptaciones.aspx".ToUpper(), 629)
PaginaDict.Add("/RH/RepUniformes.aspx".ToUpper(), 630)

View File

@@ -2886,7 +2886,7 @@ Namespace Modelos
Next
DT = TmpDTDetalle.FiltraParametros($"CvePS <> {ObjFactura.CvePSAmortizacion}", "", {"CveClasificacion", "CveSubProyecto"})
DT = TmpDTDetalle.FiltraParametros($"CvePS <> {ObjFactura.CvePSAmortizacion}", "", {"CveClasificacion", "CveSubProyecto", "PorcentajeIVA"})
If DT.Rows.Count > 0 Then
'Se agrega movimiento separado por la cuenta de ventas (ER)
@@ -2919,7 +2919,7 @@ Namespace Modelos
' CveCuentaContabilizacion = 0
'End If
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContableAplicar, Concepto, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=CveVentaAplicar, CveVentaAmortizacion:=CveVentaAmortizacionAplicar, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, CveClasificacion:=Row2("CveClasificacion").ToString.ToEntero, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), TipoCambio:=tipoCambio, CveCuenta:=CveCuenta) Then
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContableAplicar, Concepto, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=CveVentaAplicar, CveVentaAmortizacion:=CveVentaAmortizacionAplicar, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, CveClasificacion:=Row2("CveClasificacion").ToString.ToEntero, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), TipoCambio:=tipoCambio, PorcentajeImpuesto:=Row2("PorcentajeIVA").ToString().ToDecimal) Then
ErrorPrepoliza = True
Else
ObjFactura.SeGuardoPrePoliza = True
@@ -2961,7 +2961,7 @@ Namespace Modelos
End If
DT = TmpDTDetalle.FiltraParametros($"CvePS <> {ObjFactura.CvePSAmortizacion}", "", {"CveClasificacion", "CveSubProyecto"})
DT = TmpDTDetalle.FiltraParametros($"CvePS <> {ObjFactura.CvePSAmortizacion}", "", {"CveClasificacion", "CveSubProyecto", "PorcentajeIVA"})
If DT.Rows.Count > 0 Then
'Se agrega movimiento separado por la cuenta de ventas (ER)
@@ -3006,7 +3006,7 @@ Namespace Modelos
' CveCuentaContabilizacion = 0
'End If
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContableAplicar, Concepto, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=CveVentaAplicar, CveVentaAmortizacion:=CveVentaAmortizacionAplicar, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, CveClasificacion:=Row2("CveClasificacion").ToString.ToEntero, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), TipoCambio:=tipoCambio, CveCuenta:=CveCuenta) Then
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContableAplicar, Concepto, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=CveVentaAplicar, CveVentaAmortizacion:=CveVentaAmortizacionAplicar, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, CveClasificacion:=Row2("CveClasificacion").ToString.ToEntero, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), TipoCambio:=tipoCambio, PorcentajeImpuesto:=Row2("PorcentajeIVA").ToString().ToDecimal) Then
ErrorPrepoliza = True
Else
ObjFactura.SeGuardoPrePoliza = True

View File

@@ -18798,9 +18798,9 @@ Partial Class Compras_Compras
For Each gvr As GridViewRow In GvSolDev.Rows
If gvr.FCTextBox("TxtCant").Text.ToDecimal > 0 Then
'actualiza el estatus del detalle
ObjCompras.UpdateEstatusAlmacenDetalle(gvr.DataKey("CveCompraDetalle").ToEntero, 0, UsuarioActual.CveUsuario)
ObjCompras.UpdateEstatusAlmacenDetalle(gvr.DataKey("CveCompraDetalle").ToEntero, 0, UsuarioActual.CveUsuario, CantidadDevolucion:=gvr.FCTextBox("TxtCant").Text.ToDecimal)
Else
ObjCompras.UpdateEstatusAlmacenDetalle(gvr.DataKey("CveCompraDetalle").ToEntero, 1, UsuarioActual.CveUsuario)
ObjCompras.UpdateEstatusAlmacenDetalle(gvr.DataKey("CveCompraDetalle").ToEntero, 1, UsuarioActual.CveUsuario, CantidadDevolucion:=0)
End If
Next
End If

View File

@@ -6,7 +6,7 @@ Imports System.Data
Imports Microsoft.Reporting.WebForms
Imports System.Xml
Imports System.IO
Imports iTextSharp.text
Imports iTextSharp.text
Imports iTextSharp.text.pdf
Imports Stimulsoft.Report
@@ -17,8 +17,8 @@ Imports Stimulsoft.Report.Web
Partial Class PopUpVerFactura
Inherits ClsPaginas
Private Shared missing As Object = System.Reflection.Missing.Value
Private Shared missing As Object = System.Reflection.Missing.Value
#Region " PROPIEDADES "
Public Property DtMovimientos() As DataTable
Get
@@ -85,18 +85,18 @@ Partial Class PopUpVerFactura
End If
Return ""
End Get
End Property
'Private Property SessionPorImpresion As Boolean
' Get
' Return CBool(IfNull(ViewState("SessionPorImpresion"), False, ViewState("SessionPorImpresion")))
' End Get
' Set(value As Boolean)
' ViewState("SessionPorImpresion") = value
' End Set
'End Property
End Property
'Private Property SessionPorImpresion As Boolean
' Get
' Return CBool(IfNull(ViewState("SessionPorImpresion"), False, ViewState("SessionPorImpresion")))
' End Get
' Set(value As Boolean)
' ViewState("SessionPorImpresion") = value
' End Set
'End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
'CREA EL OBJECTO USUARIO A PARTIR DEL TOKEN
@@ -201,10 +201,10 @@ Partial Class PopUpVerFactura
End If
End Sub
End Sub
#Region "U S U A R I O - T O K E N"
Private Function ValidaUsuarioSistema(CveEmpresa As Integer, Optional CveUsuario As Integer = 100) As Usuario
Dim UsuarioToken As Usuario = Nothing
@@ -238,9 +238,9 @@ Partial Class PopUpVerFactura
UsuarioToken.Empresa = ObjEmpresa.Empresa
End If
ObjEmpresa.Dispose()
End Sub
End Sub
#End Region
Private Sub SeleccionaReporte(UrlParametros As Hashtable)
'DESCARGA COMPROBANTE
@@ -501,10 +501,10 @@ Partial Class PopUpVerFactura
URLParametros.Add(P2(0).ToString.ToUpper, P2(1))
Next
Return URLParametros
End Function
End Function
#Region "OP = CORT - IMPRIMIR CORTE"
Private Sub ImprimeCorte(CveCorte As Integer, Formato As String)
Dim ObjVenta As New ClsVentas
Dim ObjPuntoVenta As New ClsPuntoVenta
@@ -549,10 +549,10 @@ Partial Class PopUpVerFactura
ImprimirPDF("Empresas/Grales/Formatos/RepCortes.rdlc", lrds, params, "ReporteCortes", Formato)
End If
End Sub
End Sub
#End Region
#Region " OP = FACTURA - IMPRIME COMPRA"
Private Sub DescargaComprobante(Parametros As Hashtable)
If Parametros("COMPROBANTE") IsNot Nothing Then
@@ -591,9 +591,9 @@ Partial Class PopUpVerFactura
End If
Archivo = Nothing
End If
End Sub
End Sub
#End Region
#Region "OP DesXmlVIA- DESCARGAR XML DE VIATICOS"
Private Sub DescargaXMLViaticos(Parametros As Hashtable)
If Parametros("SERIEFOLIO") IsNot Nothing AndAlso Parametros("SERIEFOLIO").ToString <> "" Then
@@ -613,10 +613,10 @@ Partial Class PopUpVerFactura
End If
Archivo = Nothing
End If
End Sub
End Sub
#End Region
#Region "OP DesXmlNom- DESCARGAR XML DE UTILIDADES"
Private Sub DescargaXMLUtilidades(Parametros As Hashtable)
If Parametros("SERIEFOLIO") IsNot Nothing AndAlso Parametros("SERIEFOLIO").ToString <> "" Then
@@ -636,9 +636,9 @@ Partial Class PopUpVerFactura
End If
Archivo = Nothing
End If
End Sub
End Sub
#End Region
#Region "OP = 'CONG' - IMPRIME GASTO DE CONTRATO"
Private Sub ImprimeGastoContrato(CveContrato As Integer, CveContratoGasto As Integer)
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
@@ -680,10 +680,10 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("LogoPath", ""))
End If
ImprimirPDF("Empresas/Grales/Formatos/ContratoGasto.rdlc", dt, params, $"{Nombre}-Gastos", Formato:="PDF")
End Sub
End Sub
#End Region
#Region "OP = 'CIC' - IMPRIME FORMATO CICOVISA"
Private Sub ImprimeFormatoCICOVISA(CveVenta As Integer)
If CveVenta > 0 Then
@@ -720,10 +720,10 @@ Partial Class PopUpVerFactura
ImprimirPDF("Empresas/Grales/Formatos/Cicovisa.rdlc", Dt, params, String.Format("Formato Cicovisa -{0}", Now.ToDateTime.ToShortDateString))
End If
End If
End Sub
End Sub
#End Region
#Region "OP = 'CARPO' - IMPRIME FORMATO CARTA PORTE"
Private Sub ImprimeFormatoCartaPorte(CveMovimiento As Integer)
If CveMovimiento > 0 Then
@@ -848,12 +848,12 @@ Partial Class PopUpVerFactura
ImprimirPDF("Empresas/Grales/Formatos/CartaPorte.rdlc", Dt, params, String.Format("Carta Porte -{0}", Now.ToDateTime.ToShortDateString))
End If
End If
End Sub
End Sub
#End Region
#Region "OP = 'DesXmlTra' - IMPRIME XML TRASLADO"
Private Sub DescargaXMLTraslado(Parametros As Hashtable)
If Parametros("CVEMOVIMIENTO") IsNot Nothing AndAlso Parametros("CVEMOVIMIENTO").ToString.ToEntero > 0 Then
Dim Exten As String = If(Parametros("EXT").ToString.ToLower = "xml", "xml", "pdf")
@@ -872,12 +872,12 @@ Partial Class PopUpVerFactura
End If
Archivo = Nothing
End If
End Sub
End Sub
#End Region
#Region "OP = 'DesPdfTra' - IMPRIME PDF TRASLADO"
Private Sub DescargaPDFTraslado(Parametros As Hashtable)
If Parametros("CVEMOVIMIENTO") IsNot Nothing AndAlso Parametros("CVEMOVIMIENTO").ToString.ToEntero > 0 Then
Dim Exten As String = If(Parametros("EXT").ToString.ToLower = "xml", "xml", "pdf")
@@ -896,10 +896,10 @@ Partial Class PopUpVerFactura
End If
Archivo = Nothing
End If
End Sub
End Sub
#End Region
#Region " OP = 'Vta,Fact' - IMPRIME PDF VENTAS"
Private Sub DescargaFacturaVenta(Parametros As Hashtable)
If Parametros("CVEVENTA") IsNot Nothing AndAlso Parametros("CVEVENTA").ToString.ToEntero > 0 Then
@@ -1140,6 +1140,19 @@ Partial Class PopUpVerFactura
Vta.Timbre.CFDIRelacionados.UUID.Add(dtVentas(0)("FolioFiscalPadre").ToString)
Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = "Refacturación de Ingreso"
End If
If UsuarioActual.Empresa.Funcionalidad(592) = "1" Then
Dim RowTipoRelacion As DataRow = GlobalDTVtaTiposRelacion().FiltroPrimero($"CveTipoRelacion = {dtVentas(0)("CveTipoRelacion").ToString.ToEntero}")
Vta.Timbre.CFDIRelacionados.TipoRelacion = RowTipoRelacion("SATClaveTipoRelacion").ToString()
Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = RowTipoRelacion("SATTipoRelacion").ToString()
If ObjVentas.GetVentasRelacionadas(CveVenta, UsuarioActual.CveEmpresa) Then
Vta.DtDocumentosRelacionados = ObjVentas.DtResultados.FiltraParametros("FolioFiscal IS NOT NULL")
End If
End If
End If
'If UsuarioActual.CveEmpresa.Contiene(72, 80, 119) Then
@@ -1183,6 +1196,7 @@ Partial Class PopUpVerFactura
End If
End If
End If
'End If
'If Vta.TipoDocto.Contiene("Egs", "Dev", "Ant") Then
@@ -1209,11 +1223,11 @@ Partial Class PopUpVerFactura
End If
End If
End Sub
End Sub
#End Region
#Region " - OP = 'Alm' - REPORTE ENTRADAS ALMACEN "
Private Sub CargaMovimientosAlmacen(CveMovimiento As Integer)
Dim ObjInventarios As New ClsInventarios
@@ -1284,8 +1298,8 @@ Partial Class PopUpVerFactura
Dim CveMovimientoRelacionado As Integer = -1
Dim FolioRelacionado As String = ""
Dim CveConceptoMovtoRelacionado As Integer = -1
Dim CveConceptoMovtoRelacionado As Integer = -1
Dim CveTipoAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {CveAlmacen}").ToString.ToEntero
'VERIFICA SI TIENE MOVIMIENTO VIRTUAL RELACIONADO
@@ -1296,7 +1310,7 @@ Partial Class PopUpVerFactura
CveConceptoMovtoRelacionado = 37
ElseIf CveConcepto.Contiene(36, 37) Then
FolioRelacionado = ObjInventarios.DtResultados.FiltroPrimeroValor("FolioRelacionado")
CveConceptoMovtoRelacionado = 3
CveConceptoMovtoRelacionado = 3
ElseIf CveConcepto.Contiene(2) AndAlso CveTipoAlmacen.Contiene(24, 25) Then
FolioRelacionado = ObjInventarios.DtResultados.FiltroPrimeroValor("FolioRelacionado")
CveConceptoMovtoRelacionado = 3
@@ -1308,10 +1322,10 @@ Partial Class PopUpVerFactura
Dim CantidadProductos As Decimal = 0
Dim CantidadUsados As Decimal = 0
If CveConcepto = 3 Or CveConcepto = 18 Or CveConcepto = 30 Or CveConcepto = 34 Or CveConcepto = 35 Or CveConcepto = 16 Or CveConcepto = 7 Then 'SALIDA Y DEVOLUCION DEL CLIENTE
If CveConcepto = 3 Or CveConcepto = 18 Or CveConcepto = 30 Or CveConcepto = 34 Or CveConcepto = 35 Or CveConcepto = 16 Or CveConcepto = 7 Or CveConcepto = 40 Then 'SALIDA Y DEVOLUCION DEL CLIENTE
If ObjInventarios.GetMovimientosDetalleImpresion(CveMovimiento, UsuarioActual.CveEmpresa) Then
DtMovimientos = ObjInventarios.DtResultados
Alert("asdf")
DtMovimientos.Columns("No").AutoIncrement = True
DtMovimientos.Columns("No").AutoIncrementSeed = DtMovimientos.Rows.Count + 1
DtMovimientos.Columns("No").AutoIncrementStep = 1
@@ -1355,27 +1369,27 @@ Partial Class PopUpVerFactura
End If
End If
If UsuarioActual.CveEmpresa = 140 AndAlso CveCompra > 0 Then
If ObjInventarios.RecepcionAlmacenGet(CveCompra, -1, UsuarioActual.CveEmpresa) AndAlso ObjInventarios.DtResultados.Rows.Count > 0 Then
Dim DtFaltante As DataTable = ObjInventarios.DtResultados.FiltraParametros("CantidadF > 0")
If DtFaltante.Rows.Count > 0 Then
Dim SbPendientes As New StringBuilder
SbPendientes.AppendFormat("Los siguientes productos quedaron pendientes por recibir:")
For Each Row As DataRow In DtFaltante.Rows
SbPendientes.AppendFormat(" PS:{0} Cant.:{1:N0},", Row("CodigoPS"), Row("CantidadF"))
Next
SbPendientes.Remove(SbPendientes.Length - 1, 1)
SbPendientes.AppendFormat(" Total Cant.:{0:N0}, Total Costo:{1:N2}", DtFaltante.SUM("CantidadF"), DtFaltante.SUM("Total"))
If Not String.IsNullOrEmpty(Observaciones) Then
Observaciones = SbPendientes.ToString() + ".<br/>" + Observaciones
Else
Observaciones = SbPendientes.ToString()
End If
End If
DtFaltante.Dispose()
End If
If UsuarioActual.CveEmpresa = 140 AndAlso CveCompra > 0 Then
If ObjInventarios.RecepcionAlmacenGet(CveCompra, -1, UsuarioActual.CveEmpresa) AndAlso ObjInventarios.DtResultados.Rows.Count > 0 Then
Dim DtFaltante As DataTable = ObjInventarios.DtResultados.FiltraParametros("CantidadF > 0")
If DtFaltante.Rows.Count > 0 Then
Dim SbPendientes As New StringBuilder
SbPendientes.AppendFormat("Los siguientes productos quedaron pendientes por recibir:")
For Each Row As DataRow In DtFaltante.Rows
SbPendientes.AppendFormat(" PS:{0} Cant.:{1:N0},", Row("CodigoPS"), Row("CantidadF"))
Next
SbPendientes.Remove(SbPendientes.Length - 1, 1)
SbPendientes.AppendFormat(" Total Cant.:{0:N0}, Total Costo:{1:N2}", DtFaltante.SUM("CantidadF"), DtFaltante.SUM("Total"))
If Not String.IsNullOrEmpty(Observaciones) Then
Observaciones = SbPendientes.ToString() + ".<br/>" + Observaciones
Else
Observaciones = SbPendientes.ToString()
End If
End If
DtFaltante.Dispose()
End If
End If
If CveTipoAlmacen = 20 Then
@@ -1535,38 +1549,38 @@ Partial Class PopUpVerFactura
End If
ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/Entradas.rdlc", DtMovimientos, params, String.Format("Entrada de Almacen - {0}", Folio), RDSName:="DsInventarios")
ElseIf UsuarioActual.CveEmpresa = 140 Then
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
If Imagen.Exists Then
params.Add(New ReportParameter("LogoPath", logouri))
Else
params.Add(New ReportParameter("LogoPath", ""))
End If
Dim concepto As String = ""
If CveConcepto.Contiene(2, 32, 33) Then
concepto = "ENTRADA DE ALMACÉN"
ElseIf CveConcepto.Contiene(36) Then
concepto = "ENTRADA VIRTUAL"
End If
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("Concepto", concepto))
params.Add(New ReportParameter("Almacen", Almacen))
params.Add(New ReportParameter("Fecha", Fecha))
params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("Folio", Folio))
params.Add(New ReportParameter("FacturadoA", NombreCliente))
params.Add(New ReportParameter("FacturaProveedor", If(CveCompra > 0 AndAlso dr IsNot Nothing, dr("SerieFolio").ToString, "")))
params.Add(New ReportParameter("Descuentos", If(CveCompra > 0 AndAlso dr IsNot Nothing, (dr("Descuentos").ToString.ToDouble).FormatoNumero(2), "")))
params.Add(New ReportParameter("IVA", If(CveCompra > 0 AndAlso dr IsNot Nothing, dr("IVA").ToString.FormatoNumero(2), "")))
params.Add(New ReportParameter("Total", If(CveCompra > 0 AndAlso dr IsNot Nothing, dr("Total").ToString.FormatoNumero(2), "")))
'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo)))
params.Add(New ReportParameter("Observaciones", Observaciones))
params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio)))
params.Add(New ReportParameter("CveConceptoMovRelacionado", CveConceptoMovRelacionado.ToString()))
params.Add(New ReportParameter("FolioRelacionado", FolioRelacionado))
ImprimirPDF(String.Format("{0}Formatos/Entradas.rdlc", UsuarioActual.Empresa.Ruta), DtMovimientos, params, String.Format("Entrada de Almacen - {0}", Folio.ToString), RDSName:="DsInventarios")
ElseIf UsuarioActual.CveEmpresa = 140 Then
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
If Imagen.Exists Then
params.Add(New ReportParameter("LogoPath", logouri))
Else
params.Add(New ReportParameter("LogoPath", ""))
End If
Dim concepto As String = ""
If CveConcepto.Contiene(2, 32, 33) Then
concepto = "ENTRADA DE ALMACÉN"
ElseIf CveConcepto.Contiene(36) Then
concepto = "ENTRADA VIRTUAL"
End If
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("Concepto", concepto))
params.Add(New ReportParameter("Almacen", Almacen))
params.Add(New ReportParameter("Fecha", Fecha))
params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("Folio", Folio))
params.Add(New ReportParameter("FacturadoA", NombreCliente))
params.Add(New ReportParameter("FacturaProveedor", If(CveCompra > 0 AndAlso dr IsNot Nothing, dr("SerieFolio").ToString, "")))
params.Add(New ReportParameter("Descuentos", If(CveCompra > 0 AndAlso dr IsNot Nothing, (dr("Descuentos").ToString.ToDouble).FormatoNumero(2), "")))
params.Add(New ReportParameter("IVA", If(CveCompra > 0 AndAlso dr IsNot Nothing, dr("IVA").ToString.FormatoNumero(2), "")))
params.Add(New ReportParameter("Total", If(CveCompra > 0 AndAlso dr IsNot Nothing, dr("Total").ToString.FormatoNumero(2), "")))
'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo)))
params.Add(New ReportParameter("Observaciones", Observaciones))
params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio)))
params.Add(New ReportParameter("CveConceptoMovRelacionado", CveConceptoMovRelacionado.ToString()))
params.Add(New ReportParameter("FolioRelacionado", FolioRelacionado))
ImprimirPDF(String.Format("{0}Formatos/Entradas.rdlc", UsuarioActual.Empresa.Ruta), DtMovimientos, params, String.Format("Entrada de Almacen - {0}", Folio.ToString), RDSName:="DsInventarios")
Else
params.Add(New ReportParameter("TipoDocumento", String.Format("Compras {0}", Almacen)))
@@ -1616,6 +1630,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Descuentos", If(CveCompra > 0 AndAlso dr IsNot Nothing, (dr("Descuentos").ToString.ToDouble).FormatoNumero(2), "")))
params.Add(New ReportParameter("IVA", If(CveCompra > 0 AndAlso dr IsNot Nothing, dr("IVA").ToString.FormatoNumero(2), "")))
params.Add(New ReportParameter("Total", If(CveCompra > 0 AndAlso dr IsNot Nothing, dr("Total").ToString.FormatoNumero(2), "")))
params.Add(New ReportParameter("Observaciones", Observaciones))
'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo)))
params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio)))
If (UsuarioActual.CveEmpresa = 72) Then
@@ -1624,7 +1639,7 @@ Partial Class PopUpVerFactura
ImprimirPDF("Empresas/Grales/Formatos/EntradaSalida.rdlc", DtMovimientos, params, String.Format("Entrada de Almacen - {0}", Folio.ToString), RDSName:="DsInventarios")
End If
Case 3, 16, 37 ' S A L I D A S
Case 3, 16, 37, 40 ' S A L I D A S
'Dim Archivo As New System.IO.FileInfo(String.Format("Empresas/{0}/Formatos/Salidas.rdlc", 72))
'Dim Imagen As New System.IO.FileInfo(String.Format("Empresas/{0}/Logo.png", 72))
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/Salidas.rdlc", UsuarioActual.Empresa.Ruta))
@@ -1632,7 +1647,7 @@ Partial Class PopUpVerFactura
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
Dim params As New List(Of ReportParameter)
Dim concepto As String = ""
If CveConcepto = 3 Then
If CveConcepto.Contiene(3, 40) Then
concepto = "SALIDA DE ALMACÉN"
ElseIf CveConcepto = 37 Then
concepto = "SALIDA VIRTUAL"
@@ -1797,7 +1812,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("NombreRecibio", Recibio))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("CveConceptoMovRelacionado", CveConceptoMovRelacionado.ToString()))
params.Add(New ReportParameter("FolioRelacionado", FolioRelacionado))
params.Add(New ReportParameter("FolioRelacionado", FolioRelacionado))
params.Add(New ReportParameter("UsuarioRegistro", UsuarioRegistro))
ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/Salidas.rdlc", DtMovimientos, params, String.Format("Salida de Almacen - {0}", Folio.ToString), RDSName:="DsInventarios")
@@ -2323,7 +2338,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("CveConceptoMovRelacionado", CveConceptoMovRelacionado.ToString()))
params.Add(New ReportParameter("FolioRelacionado", FolioRelacionado))
End If
@@ -3327,10 +3342,10 @@ Partial Class PopUpVerFactura
ImprimirbytesPDF(reporte, $"OrdenCompra-{Folio.ToString}")
End If
End If
End Sub
End Sub
#End Region
#Region "OP = 'VAL' - IMPRIME PDF VAL"
Private Sub GenerarPDFVale(CveVale As Integer)
@@ -3360,9 +3375,9 @@ Partial Class PopUpVerFactura
'End If
End If
ObjAF.Dispose()
End Sub
End Sub
#End Region
#Region "OP = 'OS' - IMPRIMIR PDF OS"
Private Sub GenerarPDFOS(CveOS As Integer)
Dim ObjOS As New ClsOS()
@@ -3481,9 +3496,9 @@ Partial Class PopUpVerFactura
TmpDTMaterialesOS.Columns.Add("Clasificacion", GetType(String))
TmpDTMaterialesOS.Columns.Add("PS", GetType(String))
TmpDTMaterialesOS.Columns.Add("UM", GetType(String))
End Sub
End Sub
#End Region
#Region "OP = 'OI' - Crear Archivo "
Private Sub CrearArchivo(Archivo As String)
Dim ObjEventos As New ClsOIEventos
@@ -3492,11 +3507,11 @@ Partial Class PopUpVerFactura
Dim file As System.IO.FileInfo = New System.IO.FileInfo(path) '-- if the file exists on the server
DescargarArchivo(file)
End Sub
End Sub
#End Region
#Region "OP = 'Contratos' - Crear Archivo "
Private Sub CrearArchivoContratos(Archivo As String)
@@ -3504,11 +3519,11 @@ Partial Class PopUpVerFactura
Dim file As System.IO.FileInfo = New System.IO.FileInfo(Archivo) '-- if the file exists on the server
DescargarArchivo(file)
End Sub
End Sub
#End Region
#Region "OP = 'OI' - Descargar Archivo "
Private Sub DescargarArchivo(File As System.IO.FileInfo)
If File.Exists Then 'set appropriate headers
@@ -3538,11 +3553,11 @@ Partial Class PopUpVerFactura
Alert("Ocurrio un error al descargar el archivo", TipoMensaje.MsgAdvertencia, "window.close()")
End If 'nothing in the URL as HTTP GET
End Sub
End Sub
#End Region
#Region "OP = 'AFR' - AF"
Private Sub ImprimirPDFAFR(CveAFR As Integer, Tipo As Integer)
Dim ObjAF As New ClsAF
'Dim ObjSubProyecto As New ClsSubProyectos
@@ -3646,7 +3661,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("RFC", dr("RFC").ToString))
params.Add(New ReportParameter("Puesto", dr("Puesto").ToString))
params.Add(New ReportParameter("PuestoEntrego", dr("PuestoEntrego").ToString))
params.Add(New ReportParameter("Departamento", dr("Departamento").ToString))
params.Add(New ReportParameter("Departamento", dr("Departamento").ToString))
params.Add(New ReportParameter("DepartamentoEntrego", dr("DepartamentoEntrego").ToString))
params.Add(New ReportParameter("Folio", dr("Folio").ToString))
params.Add(New ReportParameter("Sucursal", dr("SubProyecto").ToString))
@@ -3729,9 +3744,9 @@ Partial Class PopUpVerFactura
ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/ResguardoAF.rdlc", dtVC, params, NomArchivo)
End Sub
End Sub
#End Region
#Region "OP = 'POL' "
Private Sub ImprimirPolizaPDF(IdPoliza As Integer)
'Dim ObjConta As New ClsContabilidad
@@ -3770,9 +3785,9 @@ Partial Class PopUpVerFactura
ObjPoliza.Dispose()
End Sub
End Sub
#End Region
#Region "OP = 'CAN' - CANCELACION"
Public Sub ImprimeCancelacion(CveVenta As Integer)
Dim ObjVentas As New ClsVentas
@@ -3797,9 +3812,9 @@ Partial Class PopUpVerFactura
End If
ObjVentas.Dispose()
End Sub
End Sub
#End Region
#Region "OP = 'DC' - DEPOSITOS CAJA"
Private Sub CargaDepositosCaja(CveIE As Integer, CuentaCaja As String, CuentaDeposito As String)
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/DepositoCaja.rdlc", UsuarioActual.Empresa.Ruta))
@@ -3826,11 +3841,11 @@ Partial Class PopUpVerFactura
ObjIE.Dispose()
End Sub
End Sub
#End Region
#Region "I E C H E Q U E S"
Private Sub ImprimirIE(CveIE As Integer, CveEmpresa As Integer)
Dim CveTipoTransaccion = -1
Dim ObjIE As New ClsBancos()
@@ -4237,21 +4252,21 @@ Partial Class PopUpVerFactura
ParamComprobacion.Dispose()
ObjIE.Dispose()
End Sub
End Sub
#End Region
#Region "OP = RECIBO DE PAGOS"
Private Sub ImprimirReciboDePagos(CveIE As Integer, CveVenta As Integer)
PDFReciboDePagos(CveVenta, CveIE, -1)
End Sub
End Sub
#End Region
#Region "OP = VTA - PyME"
' 04/05/2018 - Pruebas de impresion de factura PyME
' 04/05/2018 - Pruebas de impresion de factura PyME
Private Sub GeneraPDFVtaPyMe(Venta As Modelos.Factura, Optional Formato As String = "PDF")
Dim Directorio1 As String = String.Format("{0}Empresas\{1}\Formatos\Factura.mrt", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa)
Dim File As FileInfo = New FileInfo(Directorio1)
@@ -4306,9 +4321,9 @@ Partial Class PopUpVerFactura
Else
RegistraScript("alert('No hay un formato de factura predefinido,favor de comunicar a soporte tecnico')")
End If
End Sub
End Sub
#End Region
#Region "OP = ENTREGAS - Entregas por realizar"
Public Sub ImprimeEntregasPorRealizar(CveAsignacionEntrega As Long, pUsuarioEntregar As String)
Dim Correcto As Boolean = False
@@ -4331,79 +4346,79 @@ Partial Class PopUpVerFactura
End Sub
#End Region
#Region "OP = Etiqueta - Etiquetas de recepcion"
Private Sub ImprimirEtiqueta(CveMovimiento As Integer, Modalidad As String)
Dim ObjInventarios As New ClsInventarios
Dim All As Byte()
Using ms As New MemoryStream
Using d As New Document
Using Copy As New PdfCopy(d, ms)
d.Open()
If ObjInventarios.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
If ObjInventarios.DtResultados IsNot Nothing Then
For Each DetalleRow As DataRow In ObjInventarios.DtResultados.Rows
Dim CvePS As Integer = DetalleRow.Item("CvePS").ToString.ToEntero
Dim Lote As String = DetalleRow.Item("Lote").ToString
Dim FechaCaducidad As Date = DetalleRow.Item("FechaCaducidad").ToString.ToDate
Dim PS As String = String.Format("{0} - {1}", DetalleRow.Item("Codigo").ToString, DetalleRow.Item("PS").ToString)
If Modalidad = "Individual" Then
Dim reporteByte As Byte() = GenerarEtiqueta(CvePS, Lote, FechaCaducidad, PS)
Dim reader As New PdfReader(reporteByte)
Dim Paginas As Integer = reader.NumberOfPages
Dim Contador As Integer = 0
While Contador < Paginas
Contador += 1
Copy.AddPage(Copy.GetImportedPage(reader, Contador))
End While
Else
Dim Cant As Integer = DetalleRow.Item("Cantidad").ToString.ToEntero - 1
For contador As Integer = 0 To Cant
Dim reporteByte As Byte() = GenerarEtiqueta(CvePS, Lote, FechaCaducidad, PS)
Dim reader As New PdfReader(reporteByte)
Dim Paginas As Integer = reader.NumberOfPages
Dim Cont As Integer = 0
While Cont < Paginas
Cont += 1
Copy.AddPage(Copy.GetImportedPage(reader, Cont))
End While
Next
End If
Next
End If
End If
d.Close()
End Using
End Using
All = ms.ToArray()
End Using
ImprimirbytesPDF(All, "Etiquetas")
If Modalidad = "Individual" Then
Else
End If
ObjInventarios.Dispose()
End Sub
Private Function GenerarEtiqueta(CvePS As Integer, Lote As String, FechaCaducidad As Date, PS As String) As Byte()
Dim QrDescarga As String = ""
Dim Cfdi As New RVCFDI33.GeneraCFDI()
Dim b As Byte() = Cfdi.ConvertirQrCode(String.Format("?CvePS={0}&Lote={1}&Fecha={2}", CvePS, Lote, Format(FechaCaducidad, "dd/MM/yyyy").ToString()))
QrDescarga = Convert.ToBase64String(b)
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("QR", QrDescarga))
params.Add(New ReportParameter("PS", PS))
params.Add(New ReportParameter("Lote", Lote))
params.Add(New ReportParameter("FechaCad", FechaCaducidad.ToString()))
Return StreamPDF("Empresas/Grales/Formatos/EtiquetaDeRecepcion.rdlc", New DataTable, params)
#Region "OP = Etiqueta - Etiquetas de recepcion"
Private Sub ImprimirEtiqueta(CveMovimiento As Integer, Modalidad As String)
Dim ObjInventarios As New ClsInventarios
Dim All As Byte()
Using ms As New MemoryStream
Using d As New Document
Using Copy As New PdfCopy(d, ms)
d.Open()
If ObjInventarios.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
If ObjInventarios.DtResultados IsNot Nothing Then
For Each DetalleRow As DataRow In ObjInventarios.DtResultados.Rows
Dim CvePS As Integer = DetalleRow.Item("CvePS").ToString.ToEntero
Dim Lote As String = DetalleRow.Item("Lote").ToString
Dim FechaCaducidad As Date = DetalleRow.Item("FechaCaducidad").ToString.ToDate
Dim PS As String = String.Format("{0} - {1}", DetalleRow.Item("Codigo").ToString, DetalleRow.Item("PS").ToString)
If Modalidad = "Individual" Then
Dim reporteByte As Byte() = GenerarEtiqueta(CvePS, Lote, FechaCaducidad, PS)
Dim reader As New PdfReader(reporteByte)
Dim Paginas As Integer = reader.NumberOfPages
Dim Contador As Integer = 0
While Contador < Paginas
Contador += 1
Copy.AddPage(Copy.GetImportedPage(reader, Contador))
End While
Else
Dim Cant As Integer = DetalleRow.Item("Cantidad").ToString.ToEntero - 1
For contador As Integer = 0 To Cant
Dim reporteByte As Byte() = GenerarEtiqueta(CvePS, Lote, FechaCaducidad, PS)
Dim reader As New PdfReader(reporteByte)
Dim Paginas As Integer = reader.NumberOfPages
Dim Cont As Integer = 0
While Cont < Paginas
Cont += 1
Copy.AddPage(Copy.GetImportedPage(reader, Cont))
End While
Next
End If
Next
End If
End If
d.Close()
End Using
End Using
All = ms.ToArray()
End Using
ImprimirbytesPDF(All, "Etiquetas")
If Modalidad = "Individual" Then
Else
End If
ObjInventarios.Dispose()
End Sub
Private Function GenerarEtiqueta(CvePS As Integer, Lote As String, FechaCaducidad As Date, PS As String) As Byte()
Dim QrDescarga As String = ""
Dim Cfdi As New RVCFDI33.GeneraCFDI()
Dim b As Byte() = Cfdi.ConvertirQrCode(String.Format("?CvePS={0}&Lote={1}&Fecha={2}", CvePS, Lote, Format(FechaCaducidad, "dd/MM/yyyy").ToString()))
QrDescarga = Convert.ToBase64String(b)
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("QR", QrDescarga))
params.Add(New ReportParameter("PS", PS))
params.Add(New ReportParameter("Lote", Lote))
params.Add(New ReportParameter("FechaCad", FechaCaducidad.ToString()))
Return StreamPDF("Empresas/Grales/Formatos/EtiquetaDeRecepcion.rdlc", New DataTable, params)
End Function
#End Region
#End Region
End Class

View File

@@ -2512,7 +2512,7 @@ Partial Class Inventarios_EntregaAlmacen
End If
'se registra
If ContabilizaMovimientoAlmacen(ObjConta, TxtFecha.Text.ToDate, HLFolio.Text, "EntregaAlmacen", CveMovimiento, CveMovimientoEntrada, ImporteAlmacen, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, True) <= 0 Then
If ContabilizaMovimientoAlmacen(ObjConta, TxtFecha.Text.ToDate, HLFolio.Text, "EntregaAlmacen", CveMovimiento, CveMovimientoEntrada, ImporteAlmacen, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False) <= 0 Then
ErrorMovInv = True
End If

View File

@@ -138,7 +138,7 @@
</Columns>
</asp:GridView>
</div>
<div id="DivMedRin" style="overflow-y: auto; width: 765px; height: 230px;" runat="server" visible="True">
<div id="DivMedRin" style="overflow-y: auto; width: 765px; height: 230px;" runat="server" visible="False">
<asp:GridView ID="GvMedRin" Width="100%" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron registros" ToolTip="Listado de Contratos encontrados." CssClass="table table-striped table-hover" GridLines="None">
<Columns>
<asp:BoundField DataField="Almacen" HeaderText="Almacén" />

View File

@@ -243,6 +243,7 @@ Partial Class Inventarios_Default
ObjInventarios.Dispose()
GvMedRin.DataBind()
UPDatos.Update()
DivMedRin.Visible = True
End Sub
Private Sub CargaEquivalencia()

View File

@@ -46,8 +46,7 @@
</div>
<label id="LblMarca" runat="server" visible="false" class="col-md-1 v-center truncate">Marca:</label>
<div class="col-md-9">
<asp:ListBox ID="DdlMarca" runat="server" DataTextField="Marca" DataValueField="CveMarca" data-text="Todos" SelectionMode="Multiple" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 50%; height: 50px !important;">
<asp:ListItem Text="Todas" Value="-1"></asp:ListItem>
<asp:ListBox ID="DdlMarca" visible="false" runat="server" DataTextField="Marca" DataValueField="CveMarca" data-text="Todos" SelectionMode="Multiple" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 50%; height: 50px !important;">
</asp:ListBox>
</div>
</div>

View File

@@ -221,7 +221,7 @@ Partial Class Ventas_ActualizarPrecios
Next
If Correcto Then
If Correcto AndAlso Not TieneError Then
Alert("Los Precios de lista de los Productos/Servicios se actualizaron correctamente")
End If
@@ -531,29 +531,38 @@ Partial Class Ventas_ActualizarPrecios
Private Function ActualizarPreciosFranquicia(ObjPS As ClsProductosServicios, Codigo As String, PS As String, Precio As Decimal, PrecioMinimo As Decimal, PrecioLista As String) As Boolean
Dim FranquiciasStr As String = UsuarioActual.Empresa.Funcionalidad(563)
Dim Franquicias = FranquiciasStr.Split(","c)
Dim Porcentaje As Decimal = If(TxtPorcentaje.Text = "", -1, TxtPorcentaje.Text.ToDecimal)
Dim StrMsg As New StringBuilder
For Each Franquicia In Franquicias
Dim CveFranquicia As Integer = Franquicia.ToEntero
Dim CvePS As Integer = GlobalDTPS(CveFranquicia, Codigo:=Codigo).FiltroPrimeroValor("CvePS", "").ToEntero
Dim CvePrecioLisa As Integer = GlobalDTPrecioListas(CveFranquicia).FiltroPrimeroValor("CvePrecioLista", String.Format("PrecioLista = '{0}'", PrecioLista)).ToEntero
Dim StrMsgError As New StringBuilder
If FranquiciasStr <> "" Then
If CvePS <= 0 Then
Dim EmpresaFranquicia As String = GlobalDTEmpresas(CveEmpresa:=CveFranquicia).FiltroPrimeroValor("Empresa")
StrMsg.AppendFormat("El producto '{0}' no se encuentra en la Franquicia '{1}'", PS, EmpresaFranquicia)
Dim Franquicias = FranquiciasStr.Split(","c)
Dim Porcentaje As Decimal = If(TxtPorcentaje.Text = "", -1, TxtPorcentaje.Text.ToDecimal)
End If
If CvePrecioLisa <= 0 Then
Dim EmpresaFranquicia As String = GlobalDTEmpresas(CveEmpresa:=CveFranquicia).FiltroPrimeroValor("Empresa")
StrMsg.AppendFormat("El precio lista '{0}' no existe en la Franquicia '{1}'", DdlPrecioLista.SelectedItem.Text, EmpresaFranquicia)
End If
If CvePrecioLisa > 0 AndAlso CvePS > 0 AndAlso Not ObjPS.UpdatePSPreciosLista(Precio, CvePrecioLisa, Porcentaje, CvePS, UsuarioActual.CveUsuario, DateTime.Now, If(RblTipo.SelectedValue = "Imp", True, False), PrecioMinimo:=PrecioMinimo) Then
StrMsg.AppendFormat("No se pudo actualizar el producto")
End If
Next
For Each Franquicia In Franquicias
Dim CveFranquicia As Integer = Franquicia.ToEntero
Dim CvePS As Integer = GlobalDTPS(CveFranquicia, Codigo:=Codigo).FiltroPrimeroValor("CvePS", "").ToEntero
Dim CvePrecioLisa As Integer = GlobalDTPrecioListas(CveFranquicia).FiltroPrimeroValor("CvePrecioLista", String.Format("PrecioLista = '{0}'", PrecioLista)).ToEntero
If StrMsg.ToString = "" Then
If CvePS <= 0 Then
Dim EmpresaFranquicia As String = GlobalDTEmpresas(CveEmpresa:=CveFranquicia).FiltroPrimeroValor("Empresa")
StrMsg.AppendFormat("El producto '{0}' no se encuentra en la Franquicia '{1}' <br/>", PS, EmpresaFranquicia)
End If
'If CvePrecioLisa <= 0 Then
' Dim EmpresaFranquicia As String = GlobalDTEmpresas(CveEmpresa:=CveFranquicia).FiltroPrimeroValor("Empresa")
' StrMsg.AppendFormat("El precio lista '{0}' no existe en la Franquicia '{1}'<br/>", DdlPrecioLista.SelectedItem.Text, EmpresaFranquicia)
'End If
If CvePrecioLisa > 0 AndAlso CvePS > 0 AndAlso Not ObjPS.UpdatePSPreciosLista(Precio, CvePrecioLisa, Porcentaje, CvePS, UsuarioActual.CveUsuario, DateTime.Now, If(RblTipo.SelectedValue = "Imp", True, False), PrecioMinimo:=PrecioMinimo) Then
StrMsgError.AppendFormat("No se pudo actualizar el producto")
End If
Next
End If
If StrMsgError.ToString = "" Then
If StrMsg.ToString <> "" Then
Alert(StrMsg.ToString, TipoMensaje.MsgAdvertencia)
End If
Return False
Else
Return True

View File

@@ -360,9 +360,9 @@
<li>
<asp:LinkButton runat="server" ID="LnkEnviarPolizaVirtual" Visible="false" OnClick="LnkEnviarPolizaVirtual_Click">Enviar Póliza Virtual</asp:LinkButton>
</li>
<%-- <li>
<asp:LinkButton runat="server" ID="LnkDescargarFacturaPrueba" OnClick="LnkDescargarFacturaPrueba_Click">Descargar Factura Prueba</asp:LinkButton>
</li>--%>
<li>
<asp:HyperLink ID="HlFacturasRelaciondas" Visible="false" NavigateUrl="#" data-toggle="modal" data-backdrop="static" data-keyboard="false" data-target="#DivFacturasRelaciondas" runat="server"><i class='fa fa-file'></i> Relacionar Facturas</asp:HyperLink>
</li>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="LnkImprimir" EventName="Click" />
@@ -6029,6 +6029,59 @@
</div>
</div>
<div id="DivFacturasRelaciondas" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpFacturasRelacionadas" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Facturas Relacionadas</h4>
</div>
<div class="modal-body">
<div id="DivDdlFacturaRela" runat="server" class="row">
<div class="col-md-2">
<label>Factura:</label></div>
<div class="col-md-8">
<asp:DropDownList ID="DdlFacturaARelacionar" runat="server" AutoPostBack="true" AppendDataBoundItems="true" DataTextField="Folio" DataValueField="CveVenta" Width="100%" CssClass="select2me"></asp:DropDownList>
</div>
<div class="col-md-2">
<asp:LinkButton ID="LnkAgregarFacturaRelacionada" runat="server" CssClass="btn btn-sm btn-primary" OnClick="LnkAgregarFacturaRelacionada_Click"><i class="fa fa-plus"></i>Agregar</asp:LinkButton></div>
</div>
<br />
<div class="row">
<div class="col-md-2">
<label>Relación:</label></div>
<div class="col-md-8">
<asp:DropDownList ID="DdlTipoRelacionARelacionar" CssClass=" form-control input-sm select2me" runat="server" Width="100%" DataTextField="SATTipoRelacion" DataValueField="CveTipoRelacion">
</asp:DropDownList>
</div>
</div>
<br />
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GvFacturasRelacionadas" runat="server" DataKeyNames="CveVenta,SerieFolio,FolioFiscal" GridLines="none" CssClass="tabla_correcto grides Widthall mysmallbtn" AutoGenerateColumns="False" ShowHeaderWhenEmpty="False">
<Columns>
<asp:BoundField HeaderText="Serie Folio" ReadOnly="true" DataField="SerieFolio" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="FolioFiscal" ReadOnly="true" DataField="FolioFiscal" ItemStyle-Width="70%" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%">
<ItemTemplate>
<asp:LinkButton ID="LnkEliminarFacturaRelacionada" runat="server" AlternateText="Eliminar" CommandArgument='<%# Eval("CveVenta")%>' OnClick="LnkEliminarFacturaRelacionada_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea eliminar el concepto?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnAgregarFacturasRelaciondas" runat="server" CssClass="btn btn-primary" Text="Asignar" OnClick="BtnAgregarFacturasRelaciondas_Click" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div id="ModalFolioFiscal" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
@@ -6274,7 +6327,7 @@
</div>
<div class="row">
<div class="col-md-12">
<asp:RadioButtonList ID="RblRNCTipo" runat="server" RepeatDirection="Horizontal" CssClass="input-group col-md-12" CellSpacing="100" AutoPostBack="true" OnSelectedIndexChanged="RblRNCTipo_SelectedIndexChanged" >
<asp:RadioButtonList ID="RblRNCTipo" runat="server" RepeatDirection="Horizontal" CssClass="input-group col-md-12" CellSpacing="100" AutoPostBack="true" OnSelectedIndexChanged="RblRNCTipo_SelectedIndexChanged">
<asp:ListItem Value="1" Class="one" Selected="True"><label><b>Cargos</b></label></asp:ListItem>
<asp:ListItem Value="2" Class="one"><label><b>Bonificaciones</b></label></asp:ListItem>
<asp:ListItem Value="3" Class="one"><label><b>Ajuste/Garantía</b></label></asp:ListItem>
@@ -6287,7 +6340,8 @@
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase"><asp:Literal ID="LtlCargos" runat="server" Text=""></asp:Literal></span>
<span class="caption-subject bold uppercase">
<asp:Literal ID="LtlCargos" runat="server" Text=""></asp:Literal></span>
</div>
<div class="actions">
<div class="btn-group">
@@ -6314,7 +6368,7 @@
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="ChkAplicar" runat="server"/>
<asp:CheckBox ID="ChkAplicar" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:HyperLinkField DataNavigateUrlFields="CveVenta" Target="_blank" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataTextField="Folio" HeaderText="Folio" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left" />
@@ -8164,161 +8218,161 @@
td = $('<td style = "font-weight:bold;" >' + item[key] + '</td>'); tr.append(td);
} else {
if ('<%= UsuarioActual.Empresa.Funcionalidad(566) %>' == '1') {
var buscarAlmacenes = "CargaExistenciasSucursales(" + item.id + ",'" + item.text + "');"
td = $('<td>' + item[key] + ' <button type="button" class="btn btn-xs btn-primary" onclick="' + buscarAlmacenes + '">Ver mas existencias</button></td>'); tr.append(td);
} else {
td = $('<td>' + item[key] + '</td>'); tr.append(td);
var buscarAlmacenes = "CargaExistenciasSucursales(" + item.id + ",'" + item.text + "');"
td = $('<td>' + item[key] + ' <button type="button" class="btn btn-xs btn-primary" onclick="' + buscarAlmacenes + '">Ver mas existencias</button></td>'); tr.append(td);
} else {
td = $('<td>' + item[key] + '</td>'); tr.append(td);
}
}
}
}
}
indexd += 1;
});
}
function CargaExistenciasSucursales(id, ps) {
$.ajax({
url: '/Ashx/SIGWeb.ashx?metodo=getpsalmacen&cveps=' + id,
type: 'get',
beforeSend: function () {
console.log("procesando.....");
},
success: function (response) {
var obj = JSON.parse(response);
MostarTablaSucursales(obj, ps);
}
});
}
function MostarTablaSucursales(almacenes, ps) {
var div = $('<div class="select2anothertable"></div>');
var table = $('<table style="width: 401px;"></table>');
var tbody = $('<tbody></tbody>'); table.append(tbody);
//div.append(table);
var indexd = 0;
almacenes.forEach(function (item) {
if (indexd == 0) {
var tr = $('<tr></tr>'); tbody.append(tr);
var td1 = $('<th style="font-weight: bold; width: 347px; text-align: center;">Almacen</th>');
var td2 = $('<th style="font-weight: bold; width: 181px; text-align: center;">Existencia</th>');
tr.append(td1);
tr.append(td2);
}
var tr = $('<tr style="text-align: left;"></tr>'); tbody.append(tr);
for (var key in item) {
if (!(key == "almacen" || key == "id")) {
var td1 = $('<td style="width: 347px;">' + item["almacen"] + '</td>'); tr.append(td1);
var td2 = $('<td style="font-weight: bold; width: 181px; text-align: center;"' + ((item["existencia"] > 0) ? 'style = "font-weight:bold;"' : '') + '>' + item["existencia"] + '</td>'); tr.append(td2);
}
}
indexd += 1;
});
if (almacenes.length > 0) {
TbExistenciasPS.innerHTML = table.html();
hPS.innerText = "Existencias: " + ps;
$("#DivModalExistencias").modal("show");
} else {
alert("No hay existencias en otros almacenes");
indexd += 1;
});
}
function CargaExistenciasSucursales(id, ps) {
$.ajax({
url: '/Ashx/SIGWeb.ashx?metodo=getpsalmacen&cveps=' + id,
type: 'get',
beforeSend: function () {
console.log("procesando.....");
},
success: function (response) {
var obj = JSON.parse(response);
MostarTablaSucursales(obj, ps);
}
});
}
function MostarTablaSucursales(almacenes, ps) {
var div = $('<div class="select2anothertable"></div>');
}
var table = $('<table style="width: 401px;"></table>');
var tbody = $('<tbody></tbody>'); table.append(tbody);
function ADSReady() {
//MakeSortable();
}
var indices;
var oldIndex;
function MakeSortable() {
$('#C_Tab_TabGenerales_GvPS').sortable({
containerSelector: 'table',
itemPath: '> tbody',
itemSelector: 'tr',
placeholder: '<tr class="placeholder"/>'
});
// Sortable column heads
$('#C_Tab_TabGenerales_GvPS tr').sortable({
containerSelector: 'tr',
itemSelector: 'th',
placeholder: '<th class="placeholder"/>',
vertical: false,
onDragStart: function ($item, container, _super) {
oldIndex = $item.index();
$item.appendTo($item.parent());
_super($item, container);
},
onDrop: function ($item, container, _super) {
var field,
newIndex = $item.index();
if (newIndex != oldIndex) {
$item.closest('table').find('tbody tr').each(function (i, row) {
row = $(row);
if (newIndex < oldIndex) {
row.children().eq(newIndex).before(row.children()[oldIndex]);
} else if (newIndex > oldIndex) {
row.children().eq(newIndex).after(row.children()[oldIndex]);
}
});
//div.append(table);
var indexd = 0;
almacenes.forEach(function (item) {
if (indexd == 0) {
var tr = $('<tr></tr>'); tbody.append(tr);
var td1 = $('<th style="font-weight: bold; width: 347px; text-align: center;">Almacen</th>');
var td2 = $('<th style="font-weight: bold; width: 181px; text-align: center;">Existencia</th>');
tr.append(td1);
tr.append(td2);
}
_super($item, container);
},
var tr = $('<tr style="text-align: left;"></tr>'); tbody.append(tr);
for (var key in item) {
if (!(key == "almacen" || key == "id")) {
var td1 = $('<td style="width: 347px;">' + item["almacen"] + '</td>'); tr.append(td1);
var td2 = $('<td style="font-weight: bold; width: 181px; text-align: center;"' + ((item["existencia"] > 0) ? 'style = "font-weight:bold;"' : '') + '>' + item["existencia"] + '</td>'); tr.append(td2);
}
}
indexd += 1;
});
});
if (almacenes.length > 0) {
TbExistenciasPS.innerHTML = table.html();
hPS.innerText = "Existencias: " + ps;
$("#DivModalExistencias").modal("show");
} else {
alert("No hay existencias en otros almacenes");
}
}
function CallFunc() {
//var AR = $("#C_Tab_TabGenerales_GvPS").find("tr")
//indices = ""
//for (i = 1; i < AR.length; i++) {
// indices = indices + AR[i].id + ";"
//}
//$("#HdnIndices").val(indices);
//$("#BtnReordenar").click()
}
function playsonidito(NomArchivo) {
var URL = /Sonidos/ + NomArchivo
var snd = new Audio(URL);
snd.play();
snd.currentTime = 0;
}
function ConvertirDllsPesos() {
var totalPesos = FormatoNumero(ToDouble($get('TxtTotal').value) * ToDouble($get('TxtTipoCambio').value), 2)
$('#<%= LtlTotalConvertido.ClientID %>').text(totalPesos);
$("#TrConversionPesosTexto").show();
}
function ConvertirPesos(ChkConvertirDoctoPesos) {
//LIMPIA
$('#<%= LtlTotalConvertido.ClientID %>').text('');
$("#TrConversionPesosTexto").hide();
//CALCULA
if (ChkConvertirDoctoPesos.checked) {
ConvertirDllsPesos();
}
}
function ConvertirPesosDlls() {
var totalPesos = FormatoNumero(ToDouble($get('TxtTotal').value) / ToDouble($get('TxtTipoCambioDlls').value), 2)
$('#<%= LblDolaresConvertidos.ClientID %>').text(totalPesos);
$("#TrConversionDolaresTexto").show();
}
function ADSReady() {
//MakeSortable();
}
function ConvertirDolares(ChkConvertirDolares) {
//LIMPIA
$('#<%= LblDolaresConvertidos.ClientID %>').text('');
var indices;
var oldIndex;
function MakeSortable() {
$('#C_Tab_TabGenerales_GvPS').sortable({
containerSelector: 'table',
itemPath: '> tbody',
itemSelector: 'tr',
placeholder: '<tr class="placeholder"/>'
});
// Sortable column heads
$('#C_Tab_TabGenerales_GvPS tr').sortable({
containerSelector: 'tr',
itemSelector: 'th',
placeholder: '<th class="placeholder"/>',
vertical: false,
onDragStart: function ($item, container, _super) {
oldIndex = $item.index();
$item.appendTo($item.parent());
_super($item, container);
},
onDrop: function ($item, container, _super) {
var field,
newIndex = $item.index();
if (newIndex != oldIndex) {
$item.closest('table').find('tbody tr').each(function (i, row) {
row = $(row);
if (newIndex < oldIndex) {
row.children().eq(newIndex).before(row.children()[oldIndex]);
} else if (newIndex > oldIndex) {
row.children().eq(newIndex).after(row.children()[oldIndex]);
}
});
}
_super($item, container);
},
});
}
function CallFunc() {
//var AR = $("#C_Tab_TabGenerales_GvPS").find("tr")
//indices = ""
//for (i = 1; i < AR.length; i++) {
// indices = indices + AR[i].id + ";"
//}
//$("#HdnIndices").val(indices);
//$("#BtnReordenar").click()
}
function playsonidito(NomArchivo) {
var URL = /Sonidos/ + NomArchivo
var snd = new Audio(URL);
snd.play();
snd.currentTime = 0;
}
function ConvertirDllsPesos() {
var totalPesos = FormatoNumero(ToDouble($get('TxtTotal').value) * ToDouble($get('TxtTipoCambio').value), 2)
$('#<%= LtlTotalConvertido.ClientID %>').text(totalPesos);
$("#TrConversionPesosTexto").show();
}
function ConvertirPesos(ChkConvertirDoctoPesos) {
//LIMPIA
$('#<%= LtlTotalConvertido.ClientID %>').text('');
$("#TrConversionPesosTexto").hide();
//CALCULA
if (ChkConvertirDoctoPesos.checked) {
ConvertirDllsPesos();
}
}
function ConvertirPesosDlls() {
var totalPesos = FormatoNumero(ToDouble($get('TxtTotal').value) / ToDouble($get('TxtTipoCambioDlls').value), 2)
$('#<%= LblDolaresConvertidos.ClientID %>').text(totalPesos);
$("#TrConversionDolaresTexto").show();
}
function ConvertirDolares(ChkConvertirDolares) {
//LIMPIA
$('#<%= LblDolaresConvertidos.ClientID %>').text('');
$("#TrConversionDolaresTexto").hide();
//CALCULA
@@ -8381,33 +8435,33 @@
function showDivEC() {
$('#<%= TxtRFCCliente.ClientID %>').val('');
$('#<%= TxtNombreCliente.ClientID %>').val('');
$('#<%= TxtDireccionCliente.ClientID %>').val('');
$('#<%= TxtNumExtCliente.ClientID %>').val('');
$('#<%= TxtNumIntCliente.ClientID %>').val('');
$('#<%= TxtCPCliente.ClientID %>').val('');
$('#<%= TxtColoniaCliente.ClientID %>').val('');
$('#<%= TxtTelefonoCliente.ClientID %>').val('');
$('#<%= TxtCiudadCliente.ClientID %>').val('');
$('#<%= TxtLocalidadCliente.ClientID %>').val('');
$('#<%= DdlSATPais.ClientID %>').val('');
$('#<%= DdlEstadoSAT.ClientID %>').val('');
$('#<%= TxtCorreoCliente.ClientID %>').val('');
$('#<%= TxtNombreCliente.ClientID %>').val('');
$('#<%= TxtDireccionCliente.ClientID %>').val('');
$('#<%= TxtNumExtCliente.ClientID %>').val('');
$('#<%= TxtNumIntCliente.ClientID %>').val('');
$('#<%= TxtCPCliente.ClientID %>').val('');
$('#<%= TxtColoniaCliente.ClientID %>').val('');
$('#<%= TxtTelefonoCliente.ClientID %>').val('');
$('#<%= TxtCiudadCliente.ClientID %>').val('');
$('#<%= TxtLocalidadCliente.ClientID %>').val('');
$('#<%= DdlSATPais.ClientID %>').val('');
$('#<%= DdlEstadoSAT.ClientID %>').val('');
$('#<%= TxtCorreoCliente.ClientID %>').val('');
$('#divAgregarCliente').modal();
}
$('#divAgregarCliente').modal();
}
function hideDivEC() {
$('#divAgregarCliente').modal('hide');
}
function hideDivEC() {
$('#divAgregarCliente').modal('hide');
}
var ValidarRNC = false;
function AplicarValidarRNC(Valor) {
ValidarRNC = Valor;
}
function CompararNC() {
if (ValidarRNC) {
var TotalRem = ToDouble(document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').value);
var ValidarRNC = false;
function AplicarValidarRNC(Valor) {
ValidarRNC = Valor;
}
function CompararNC() {
if (ValidarRNC) {
var TotalRem = ToDouble(document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').value);
var TotalNC = ToDouble(document.getElementById('<%= TxtNCImporte.ClientID %>').value);
if (TotalRem == TotalNC) {
@@ -8436,22 +8490,22 @@
var verficaRNC = function () {
var total = 0;
if ('<%= UsuarioActual.CveEmpresa %>' == '140') {
$(".ChkAplicaRNC > input").each(function () {
if (this.checked) {
total = total + 1;
}
if (total == 2) {
alert("No se puede seleccionar mas de una remisión de nota de crédito.");
this.checked = false;
return false;
}
});
}
};
$(".ChkAplicaRNC > input").each(function () {
if (this.checked) {
total = total + 1;
}
if (total == 2) {
alert("No se puede seleccionar mas de una remisión de nota de crédito.");
this.checked = false;
return false;
}
});
}
};
function showDivAgregarSucursal() {
function showDivAgregarSucursal() {
$('#<%= TxtNombreSucursal.ClientID %>').val('');
$('#<%= TxtNombreSucursal.ClientID %>').val('');
$('#<%= TxtDireccionSucursal.ClientID %>').val('');
$('#<%= TxtNumExtSucursal.ClientID %>').val('');
$('#<%= TxtNumIntSucursal.ClientID %>').val('');

View File

@@ -1893,6 +1893,26 @@ Partial Class Ventas
ViewState("AplicaRNCXDetalle") = value
End Set
End Property
Private Property AplicaRelacionManual As Boolean
Get
Return CBool(IfNull(ViewState("AplicaRelacionManual"), "False", ViewState("AplicaRelacionManual")))
End Get
Set(value As Boolean)
ViewState("AplicaRelacionManual") = value
End Set
End Property
Private Property TmpDTFacturasRelacionadas As DataTable
Get
If ViewState("TmpDTFacturasRelacionadas") IsNot Nothing Then
Return CType(ViewState("TmpDTFacturasRelacionadas"), DataTable)
Else
Return Nothing
End If
End Get
Set(value As DataTable)
ViewState("TmpDTFacturasRelacionadas") = value
End Set
End Property
#End Region
@@ -2253,6 +2273,10 @@ Partial Class Ventas
CargaOrdenProduccion()
End If
'MUESTRA EL MODAL PARA PODER RELACIONAR FACTURAS
If UsuarioActual.Empresa.Funcionalidad(592) = "1" Then
HlFacturasRelaciondas.Visible = True
End If
'Carga Venta
@@ -2260,6 +2284,9 @@ Partial Class Ventas
ViewState("CveVenta") = Request("CveVenta")
If CargaVenta() Then
If UsuarioActual.Empresa.Funcionalidad(592) = "1" Then
CargaRelacionadasPendientes()
End If
'DdlSucursal.Enabled = False
DdlSubProyectoDatos.Enabled = False
@@ -4136,6 +4163,8 @@ Partial Class Ventas
End If
DdlTipoRelacionARelacionar.SelectedValueExist(DbRowVenta("CveTipoRelacion").ToString())
'contado 0, credito 1, terminal 2
If DbRowVenta("CondicionesPago").ToString().ToEntero() = 1 Then
RBLPago.SelectedValue = "1"
@@ -5096,8 +5125,13 @@ Partial Class Ventas
End Sub
Private Sub CargaTiposRelacion()
DdlTiposRelacion.DataSource = GlobalDTVtaTiposRelacion
DdlTipoRelacionARelacionar.DataSource = GlobalDTVtaTiposRelacion
DdlTiposRelacion.DataBind()
DdlTipoRelacionARelacionar.DataBind()
DdlTiposRelacion.Items.Insert(0, New ListItem("-", "-1"))
DdlTipoRelacionARelacionar.Items.Insert(0, New ListItem("-", "-1"))
End Sub
Private Sub CargaFormaEntrega()
TrFormaEntrega.Visible = True
@@ -5141,44 +5175,44 @@ Partial Class Ventas
End Function
Private Sub CargarAlmacenes()
If (CveVenta > 0 And DdlTipoComprobante.SelectedValue <> "Cot") AndAlso Not (UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso EsCreaApartirDe) Then
DivAlmacen.Visible = False
Else
Dim DTAlmacen As DataTable
ddlAlmacen.Items.Clear()
DTAlmacen = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyectoDatos.SelectedValue.ToEntero()}")
ddlAlmacen.DataSource = DTAlmacen
If DTAlmacen Is Nothing Or DTAlmacen.Rows.Count = 0 Then
ddlAlmacen.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
ddlAlmacen.SelectedValue = "-1"
If UsuarioActual.Empresa.UsaInventarios Then
If (CveVenta > 0 And DdlTipoComprobante.SelectedValue <> "Cot") AndAlso Not (UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso EsCreaApartirDe) Then
DivAlmacen.Visible = False
Else
Dim DTAlmacen As DataTable
ddlAlmacen.Items.Clear()
DTAlmacen = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyectoDatos.SelectedValue.ToEntero()}")
ddlAlmacen.DataSource = DTAlmacen
If DTAlmacen Is Nothing Or DTAlmacen.Rows.Count = 0 Then
ddlAlmacen.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
ddlAlmacen.SelectedValue = "-1"
End If
ddlAlmacen.DataBind()
If GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyectoDatos.SelectedValue.ToEntero()}").Rows.Count > 0 Then
ddlAlmacen.SelectedValueExist(UsuarioActual.CveAlmacen)
End If
End If
'SI TIENE CONTRATO NO SE MUEVE
If Not CveContrato > 0 Then
DdlAlmacenAsignado.Items.Clear()
DdlAlmacenAsignado.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacen:=-1).FiltraParametros($"CveSubProyecto = {DdlSubProyectoDatos.SelectedValue.ToEntero()} AND CveTipoAlmacen IN (4,10)")
DdlAlmacenAsignado.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
DdlAlmacenAsignado.SelectedValue = "-1"
DdlAlmacenAsignado.DataBind()
DdlAlmacenAsignado.SelectedValueExist(GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveTipoAlmacen = 10 AND CveSubProyecto = {DdlSubProyectoDatos.SelectedValue.ToEntero()}").ToString().ToEntero())
End If
If CveContrato > 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ped", "PeC") Then
DdlAlmacenAsignado.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacen:=-1).FiltraParametros($"CveSubProyecto = {DdlSubProyectoDatos.SelectedValue.ToEntero()}")
DdlAlmacenAsignado.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
DdlAlmacenAsignado.SelectedValue = "-1"
DdlAlmacenAsignado.DataBind()
DdlAlmacenAsignado.SelectedValueExist(GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto = {DdlSubProyectoDatos.SelectedValue}").ToString().ToEntero())
End If
Else
ddlAlmacen.DataSource = Nothing
ddlAlmacen.DataBind()
If GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyectoDatos.SelectedValue.ToEntero()}").Rows.Count > 0 Then
ddlAlmacen.SelectedValueExist(UsuarioActual.CveAlmacen)
End If
End If
'SI TIENE CONTRATO NO SE MUEVE
If Not CveContrato > 0 Then
DdlAlmacenAsignado.Items.Clear()
DdlAlmacenAsignado.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacen:=-1).FiltraParametros($"CveSubProyecto = {DdlSubProyectoDatos.SelectedValue.ToEntero()} AND CveTipoAlmacen IN (4,10)")
DdlAlmacenAsignado.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
DdlAlmacenAsignado.SelectedValue = "-1"
DdlAlmacenAsignado.DataBind()
DdlAlmacenAsignado.SelectedValueExist(GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveTipoAlmacen = 10 AND CveSubProyecto = {DdlSubProyectoDatos.SelectedValue.ToEntero()}").ToString().ToEntero())
End If
If CveContrato > 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ped", "PeC") Then
DdlAlmacenAsignado.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacen:=-1).FiltraParametros($"CveSubProyecto = {DdlSubProyectoDatos.SelectedValue.ToEntero()}")
DdlAlmacenAsignado.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
DdlAlmacenAsignado.SelectedValue = "-1"
DdlAlmacenAsignado.DataBind()
DdlAlmacenAsignado.SelectedValueExist(GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto = {DdlSubProyectoDatos.SelectedValue}").ToString().ToEntero())
End If
Else
ddlAlmacen.DataSource = Nothing
ddlAlmacen.DataBind()
End If
UpINV.Update()
@@ -5629,6 +5663,8 @@ Partial Class Ventas
CargaPorcentajeMarcas()
End If
CargaFacturasARelacionar()
UpFacturar.Update()
UpEstatus.Update()
UpPS.Update()
@@ -5666,6 +5702,8 @@ Partial Class Ventas
UpModalRemisionesNC.Update()
End If
CargaFacturasARelacionar()
If RequiereOC Then
Dim Documentacion As String = ""
'RegistraScript("$('#DivDocsCliente').modal({ backdrop: 'static', keyboard: false });", "ModalArchivos")
@@ -5697,6 +5735,138 @@ Partial Class Ventas
DeshabilitarAplicarNotaDeCredito(LblRFC.Text)
End Sub
Private Sub CargaRelacionadasPendientes()
If CveVenta > 0 AndAlso UsuarioActual.Empresa.Funcionalidad(592) = "1" Then
Me.TmpDTFacturasRelacionadas = New DataTable()
Me.TmpDTFacturasRelacionadas.Columns.Add(New DataColumn("CveVenta", GetType(Integer)))
Me.TmpDTFacturasRelacionadas.Columns.Add(New DataColumn("SerieFolio", GetType(String)))
Me.TmpDTFacturasRelacionadas.Columns.Add(New DataColumn("FolioFiscal", GetType(String)))
Using ObjVentas As New ClsVentas
If ObjVentas.GetVentasRelacionadas(CveVenta, UsuarioActual.CveEmpresa) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
'SI LA FACTURA NO SE TIMBRO QUE VUELVA A INTENTAR FACTURAR
If LblSeTimbro.Text = "No" Then
Me.AplicaRelacionManual = True
End If
For Each RowRelacionada As DataRow In ObjVentas.DtResultados.Rows
Dim Row As DataRow = TmpDTFacturasRelacionadas.NewRow()
Row("CveVenta") = RowRelacionada("CveVentaRelacionada").ToString().ToEntero()
Row("SerieFolio") = RowRelacionada("SerieFolio").ToString()
Row("FolioFiscal") = RowRelacionada("FolioFiscal").ToString()
Me.TmpDTFacturasRelacionadas.Rows.Add(Row)
Next
End If
End Using
DivDdlFacturaRela.Visible = False
BtnAgregarFacturasRelaciondas.Visible = False
DdlTipoRelacionARelacionar.Enabled = False
GvFacturasRelacionadas.Columns(2).Visible = False
GvFacturasRelacionadas.DataSource = Me.TmpDTFacturasRelacionadas
GvFacturasRelacionadas.DataBind()
UpFacturasRelacionadas.Update()
End If
End Sub
Private Sub CargaFacturasARelacionar()
Using ObjClientes As New ClsClientes
If ObjClientes.GetHistorialVentas(Me.CveCliente, TipoDocto:="Ing") Then
DdlFacturaARelacionar.DataSource = ObjClientes.DtResultados
End If
End Using
DdlFacturaARelacionar.DataBind()
If Not DdlFacturaARelacionar.Items.Contains(New ListItem("Seleccione", "-1")) Then
DdlFacturaARelacionar.Items.Insert(0, New ListItem("Seleccione", "-1"))
End If
UpFacturasRelacionadas.Update()
End Sub
Protected Sub CreaTmpFacturasRelacionadas()
If CveVenta <= 0 Then
Me.TmpDTFacturasRelacionadas = New DataTable()
Me.TmpDTFacturasRelacionadas.Columns.Add(New DataColumn("CveVenta", GetType(Integer)))
Me.TmpDTFacturasRelacionadas.Columns.Add(New DataColumn("SerieFolio", GetType(String)))
Me.TmpDTFacturasRelacionadas.Columns.Add(New DataColumn("FolioFiscal", GetType(String)))
End If
End Sub
Protected Sub LnkAgregarFacturaRelacionada_Click(sender As Object, e As EventArgs)
If CveVenta <= 0 Then
If Me.TmpDTFacturasRelacionadas Is Nothing Then
CreaTmpFacturasRelacionadas()
End If
If TmpDTFacturasRelacionadas.COUNT("CveVenta", $"CveVenta ={DdlFacturaARelacionar.SelectedValue.ToEntero()}") > 0 Then
Alert("La factura ya fue agregada", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim Row As DataRow = TmpDTFacturasRelacionadas.NewRow()
Row("CveVenta") = DdlFacturaARelacionar.SelectedValue.ToEntero()
Using ObjVentas As New ClsVentas
If ObjVentas.GetVenta(DdlFacturaARelacionar.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
Row("SerieFolio") = ObjVentas.DtResultados(0)("SerieFolio").ToString()
Row("FolioFiscal") = ObjVentas.DtResultados(0)("FolioFiscal").ToString()
End If
End Using
Me.TmpDTFacturasRelacionadas.Rows.Add(Row)
GvFacturasRelacionadas.DataSource = Me.TmpDTFacturasRelacionadas
GvFacturasRelacionadas.DataBind()
UpFacturasRelacionadas.Update()
End If
End Sub
Protected Sub BtnAgregarFacturasRelaciondas_Click(sender As Object, e As EventArgs)
If CveVenta <= 0 Then
If Me.TmpDTFacturasRelacionadas Is Nothing OrElse Me.TmpDTFacturasRelacionadas.Rows.Count = 0 Then
Me.AplicaRelacionManual = False
Alert("No hay facturas para relacionar", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If DdlTipoRelacionARelacionar.SelectedValue.ToEntero() <= 0 Then
Me.AplicaRelacionManual = False
Alert("Debe seleccionar un tipo de relación", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Me.AplicaRelacionManual = True
RegistraScript("$('#DivFacturasRelaciondas').modal('hide');", "R1")
Alert("Las facturas seleccionadas se relacionaran con la factura nueva")
End If
UpFacturasRelacionadas.Update()
End Sub
Protected Sub LnkEliminarFacturaRelacionada_Click(sender As Object, e As EventArgs)
Dim lnkRemove As LinkButton = DirectCast(sender, LinkButton)
If Me.TmpDTFacturasRelacionadas.Rows.Count > 0 And lnkRemove.CommandArgument.ToString.Length > 0 Then
Dim CveVenta As Integer = lnkRemove.CommandArgument.ToString.ToEntero
Dim Drs As DataRow() = Me.TmpDTFacturasRelacionadas.Select(String.Format("CveVenta = {0}", CveVenta))
If Drs.Count > 0 Then
Drs(0).Delete()
End If
Me.TmpDTFacturasRelacionadas.AcceptChanges()
End If
GvFacturasRelacionadas.EditIndex = -1
GvFacturasRelacionadas.DataSource = Me.TmpDTFacturasRelacionadas
GvFacturasRelacionadas.DataBind()
UpFacturasRelacionadas.Update()
End Sub
Private Sub CargaRestriccionesCreditoCliente(Optional Alertas As Boolean = False, Optional CveVenta As Integer = -1)
If UsuarioActual.Empresa.Funcionalidad(570) = "1" AndAlso Me.PermiteCredito = False AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem") AndAlso CveVenta < 1 Then
@@ -9778,16 +9948,11 @@ Partial Class Ventas
Timbre.Comprobante.TipoCambio = If(Obj.CveMoneda = 1, "1", Obj.TipoCambio.ToString())
Timbre.Comprobante.Total = Obj.Total
'Try
'Obj.SetSubProyecto(Me)
Timbre.Comprobante.LugarExpedicion = Obj.SubProyecto.CP
If Timbre.Comprobante.LugarExpedicion = "" Then
Dim aa As String = "no se guardo lugar de expedicion"
aa.GuardaLog()
End If
'Catch ex As Exception
'End Try
Timbre.Comprobante.Confirmacion = ""
@@ -9870,6 +10035,26 @@ Partial Class Ventas
End If
'SI LAS FACTURAS SE RELACIONARAN MANUALMENTE SE AGREGAN
If UsuarioActual.Empresa.Funcionalidad(592) = "1" AndAlso Me.AplicaRelacionManual AndAlso DdlTipoRelacionARelacionar.SelectedValue.ToEntero() > 0 Then
Dim CveTipoRelacion As Integer = DdlTipoRelacionARelacionar.SelectedValue.ToEntero()
Obj.CveTipoRelacion = DdlTipoRelacionARelacionar.SelectedValue.ToEntero()
Dim RowTipoRelacion As DataRow = GlobalDTVtaTiposRelacion().FiltroPrimero($"CveTipoRelacion = {CveTipoRelacion}")
Timbre.CFDIRelacionados.TipoRelacion = RowTipoRelacion("SATClaveTipoRelacion").ToString()
Timbre.CFDIRelacionados.TipoRelacionTexto = RowTipoRelacion("SATTipoRelacion").ToString()
For Each GvRow As GridViewRow In GvFacturasRelacionadas.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
Timbre.CFDIRelacionados.UUID.Add(GvRow.DataKey("FolioFiscal").Replace("test", ""))
End If
Next
End If
Dim totSubTotal As Decimal = Obj.SubTotal
Dim totIVA As Decimal = Obj.IVA
@@ -10465,7 +10650,18 @@ Partial Class Ventas
End If
End If
End If
End If
If UsuarioActual.Empresa.Funcionalidad(592) = "1" AndAlso Me.AplicaRelacionManual Then
For Each GvRow As GridViewRow In GvFacturasRelacionadas.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
If Not ObjVentas.AddVentasRelacionadas(ObjVentas.CveVenta, GvRow.DataKey("CveVenta").ToEntero()) Then
ErrorList.Add("Ocurrió un error al relacionar las ventas entre si comuníquese a Soporte Técnico")
End If
End If
Next
'LO LIMPIA PARA QUE NO VUELVA A APLICAR
Me.AplicaRelacionManual = False
End If
If UsuarioActual.Empresa.Funcionalidad(280) = "1" And RblPaqueteria.SelectedValue = "1" And Not factura.TipoDocto.Contiene("Rem", "Ped") Then
@@ -24023,11 +24219,7 @@ Partial Class Ventas
End Sub
Private Sub BtnAplicaNuevaNC_Click(sender As Object, e As EventArgs) Handles BtnAplicaNuevaNC.Click
If ListaRemisionesNC IsNot Nothing AndAlso ListaRemisionesNC.Count > 0 Then
AplicarNotaCreditoDesdeVenta(AplicaNuevoDocumento:=True)
Else
Alert("No ha seleccionado ninguna remisión de nota de crédito", TipoMensaje.MsgAdvertencia)
End If
AplicarNotaCreditoDesdeVenta(AplicaNuevoDocumento:=True)
End Sub
Private Sub AplicarNotaCreditoDesdeVenta(Optional AplicaNuevoDocumento As Boolean = False)
@@ -28534,4 +28726,7 @@ Partial Class Ventas
Public ImporteBonificacion As Decimal = 0
Public IVABonificacion As Decimal = 0
End Class
End Class