Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -2675,6 +2675,7 @@ Public Class ClsInventarios
|
|||||||
DataAdapter("PA_Inv_InventarioFisicoResultadoAvance")
|
DataAdapter("PA_Inv_InventarioFisicoResultadoAvance")
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
.Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico
|
.Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
End With
|
End With
|
||||||
Try
|
Try
|
||||||
SqlAdapter.Fill(Data)
|
SqlAdapter.Fill(Data)
|
||||||
|
|||||||
@@ -4847,7 +4847,7 @@ Public Class ClsPaginas
|
|||||||
PaginaDict.Add("/RH/RepVacaciones.aspx".ToUpper(), 422)
|
PaginaDict.Add("/RH/RepVacaciones.aspx".ToUpper(), 422)
|
||||||
PaginaDict.Add("/RH/CatChecadorTipo.aspx".ToUpper(), 427)
|
PaginaDict.Add("/RH/CatChecadorTipo.aspx".ToUpper(), 427)
|
||||||
PaginaDict.Add("/RH/CatChecadorHorarios.aspx".ToUpper(), 428)
|
PaginaDict.Add("/RH/CatChecadorHorarios.aspx".ToUpper(), 428)
|
||||||
PaginaDict.Add("/RH/CatChecadorEstaciones.aspx".ToUpper(), 627)
|
|
||||||
PaginaDict.Add("/RH/RepChecadorPreAsistencia.aspx".ToUpper(), 628)
|
PaginaDict.Add("/RH/RepChecadorPreAsistencia.aspx".ToUpper(), 628)
|
||||||
PaginaDict.Add("/RH/CatCaptaciones.aspx".ToUpper(), 629)
|
PaginaDict.Add("/RH/CatCaptaciones.aspx".ToUpper(), 629)
|
||||||
PaginaDict.Add("/RH/RepUniformes.aspx".ToUpper(), 630)
|
PaginaDict.Add("/RH/RepUniformes.aspx".ToUpper(), 630)
|
||||||
|
|||||||
@@ -1140,6 +1140,19 @@ Partial Class PopUpVerFactura
|
|||||||
Vta.Timbre.CFDIRelacionados.UUID.Add(dtVentas(0)("FolioFiscalPadre").ToString)
|
Vta.Timbre.CFDIRelacionados.UUID.Add(dtVentas(0)("FolioFiscalPadre").ToString)
|
||||||
Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = "Refacturación de Ingreso"
|
Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = "Refacturación de Ingreso"
|
||||||
End If
|
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
|
End If
|
||||||
|
|
||||||
'If UsuarioActual.CveEmpresa.Contiene(72, 80, 119) Then
|
'If UsuarioActual.CveEmpresa.Contiene(72, 80, 119) Then
|
||||||
@@ -1183,6 +1196,7 @@ Partial Class PopUpVerFactura
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'End If
|
'End If
|
||||||
|
|
||||||
'If Vta.TipoDocto.Contiene("Egs", "Dev", "Ant") Then
|
'If Vta.TipoDocto.Contiene("Egs", "Dev", "Ant") Then
|
||||||
@@ -1308,10 +1322,10 @@ Partial Class PopUpVerFactura
|
|||||||
Dim CantidadProductos As Decimal = 0
|
Dim CantidadProductos As Decimal = 0
|
||||||
Dim CantidadUsados 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
|
If ObjInventarios.GetMovimientosDetalleImpresion(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
||||||
DtMovimientos = ObjInventarios.DtResultados
|
DtMovimientos = ObjInventarios.DtResultados
|
||||||
|
Alert("asdf")
|
||||||
DtMovimientos.Columns("No").AutoIncrement = True
|
DtMovimientos.Columns("No").AutoIncrement = True
|
||||||
DtMovimientos.Columns("No").AutoIncrementSeed = DtMovimientos.Rows.Count + 1
|
DtMovimientos.Columns("No").AutoIncrementSeed = DtMovimientos.Rows.Count + 1
|
||||||
DtMovimientos.Columns("No").AutoIncrementStep = 1
|
DtMovimientos.Columns("No").AutoIncrementStep = 1
|
||||||
@@ -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("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("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("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("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo)))
|
||||||
params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio)))
|
params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio)))
|
||||||
If (UsuarioActual.CveEmpresa = 72) Then
|
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")
|
ImprimirPDF("Empresas/Grales/Formatos/EntradaSalida.rdlc", DtMovimientos, params, String.Format("Entrada de Almacen - {0}", Folio.ToString), RDSName:="DsInventarios")
|
||||||
End If
|
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 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 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))
|
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 Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||||
Dim params As New List(Of ReportParameter)
|
Dim params As New List(Of ReportParameter)
|
||||||
Dim concepto As String = ""
|
Dim concepto As String = ""
|
||||||
If CveConcepto = 3 Then
|
If CveConcepto.Contiene(3, 40) Then
|
||||||
concepto = "SALIDA DE ALMACÉN"
|
concepto = "SALIDA DE ALMACÉN"
|
||||||
ElseIf CveConcepto = 37 Then
|
ElseIf CveConcepto = 37 Then
|
||||||
concepto = "SALIDA VIRTUAL"
|
concepto = "SALIDA VIRTUAL"
|
||||||
|
|||||||
@@ -360,9 +360,9 @@
|
|||||||
<li>
|
<li>
|
||||||
<asp:LinkButton runat="server" ID="LnkEnviarPolizaVirtual" Visible="false" OnClick="LnkEnviarPolizaVirtual_Click">Enviar Póliza Virtual</asp:LinkButton>
|
<asp:LinkButton runat="server" ID="LnkEnviarPolizaVirtual" Visible="false" OnClick="LnkEnviarPolizaVirtual_Click">Enviar Póliza Virtual</asp:LinkButton>
|
||||||
</li>
|
</li>
|
||||||
<%-- <li>
|
<li>
|
||||||
<asp:LinkButton runat="server" ID="LnkDescargarFacturaPrueba" OnClick="LnkDescargarFacturaPrueba_Click">Descargar Factura Prueba</asp:LinkButton>
|
<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>--%>
|
</li>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
<Triggers>
|
<Triggers>
|
||||||
<asp:AsyncPostBackTrigger ControlID="LnkImprimir" EventName="Click" />
|
<asp:AsyncPostBackTrigger ControlID="LnkImprimir" EventName="Click" />
|
||||||
@@ -6029,6 +6029,59 @@
|
|||||||
</div>
|
</div>
|
||||||
</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">×</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 id="ModalFolioFiscal" class="modal ADS fade" role="dialog">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
|
|
||||||
@@ -6287,7 +6340,8 @@
|
|||||||
<div class="portlet-title">
|
<div class="portlet-title">
|
||||||
<div class="caption font-green">
|
<div class="caption font-green">
|
||||||
<i class="icon-pin font-green"></i>
|
<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>
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
|
|||||||
@@ -1893,6 +1893,26 @@ Partial Class Ventas
|
|||||||
ViewState("AplicaRNCXDetalle") = value
|
ViewState("AplicaRNCXDetalle") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
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
|
#End Region
|
||||||
|
|
||||||
@@ -2253,6 +2273,10 @@ Partial Class Ventas
|
|||||||
CargaOrdenProduccion()
|
CargaOrdenProduccion()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'MUESTRA EL MODAL PARA PODER RELACIONAR FACTURAS
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(592) = "1" Then
|
||||||
|
HlFacturasRelaciondas.Visible = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
'Carga Venta
|
'Carga Venta
|
||||||
@@ -2260,6 +2284,9 @@ Partial Class Ventas
|
|||||||
ViewState("CveVenta") = Request("CveVenta")
|
ViewState("CveVenta") = Request("CveVenta")
|
||||||
|
|
||||||
If CargaVenta() Then
|
If CargaVenta() Then
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(592) = "1" Then
|
||||||
|
CargaRelacionadasPendientes()
|
||||||
|
End If
|
||||||
|
|
||||||
'DdlSucursal.Enabled = False
|
'DdlSucursal.Enabled = False
|
||||||
DdlSubProyectoDatos.Enabled = False
|
DdlSubProyectoDatos.Enabled = False
|
||||||
@@ -4136,6 +4163,8 @@ Partial Class Ventas
|
|||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
DdlTipoRelacionARelacionar.SelectedValueExist(DbRowVenta("CveTipoRelacion").ToString())
|
||||||
|
|
||||||
'contado 0, credito 1, terminal 2
|
'contado 0, credito 1, terminal 2
|
||||||
If DbRowVenta("CondicionesPago").ToString().ToEntero() = 1 Then
|
If DbRowVenta("CondicionesPago").ToString().ToEntero() = 1 Then
|
||||||
RBLPago.SelectedValue = "1"
|
RBLPago.SelectedValue = "1"
|
||||||
@@ -5096,8 +5125,13 @@ Partial Class Ventas
|
|||||||
End Sub
|
End Sub
|
||||||
Private Sub CargaTiposRelacion()
|
Private Sub CargaTiposRelacion()
|
||||||
DdlTiposRelacion.DataSource = GlobalDTVtaTiposRelacion
|
DdlTiposRelacion.DataSource = GlobalDTVtaTiposRelacion
|
||||||
|
DdlTipoRelacionARelacionar.DataSource = GlobalDTVtaTiposRelacion
|
||||||
|
|
||||||
DdlTiposRelacion.DataBind()
|
DdlTiposRelacion.DataBind()
|
||||||
|
DdlTipoRelacionARelacionar.DataBind()
|
||||||
|
|
||||||
DdlTiposRelacion.Items.Insert(0, New ListItem("-", "-1"))
|
DdlTiposRelacion.Items.Insert(0, New ListItem("-", "-1"))
|
||||||
|
DdlTipoRelacionARelacionar.Items.Insert(0, New ListItem("-", "-1"))
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CargaFormaEntrega()
|
Private Sub CargaFormaEntrega()
|
||||||
TrFormaEntrega.Visible = True
|
TrFormaEntrega.Visible = True
|
||||||
@@ -5141,7 +5175,7 @@ Partial Class Ventas
|
|||||||
|
|
||||||
End Function
|
End Function
|
||||||
Private Sub CargarAlmacenes()
|
Private Sub CargarAlmacenes()
|
||||||
|
If UsuarioActual.Empresa.UsaInventarios Then
|
||||||
If (CveVenta > 0 And DdlTipoComprobante.SelectedValue <> "Cot") AndAlso Not (UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso EsCreaApartirDe) Then
|
If (CveVenta > 0 And DdlTipoComprobante.SelectedValue <> "Cot") AndAlso Not (UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso EsCreaApartirDe) Then
|
||||||
DivAlmacen.Visible = False
|
DivAlmacen.Visible = False
|
||||||
Else
|
Else
|
||||||
@@ -5629,6 +5663,8 @@ Partial Class Ventas
|
|||||||
CargaPorcentajeMarcas()
|
CargaPorcentajeMarcas()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
CargaFacturasARelacionar()
|
||||||
|
|
||||||
UpFacturar.Update()
|
UpFacturar.Update()
|
||||||
UpEstatus.Update()
|
UpEstatus.Update()
|
||||||
UpPS.Update()
|
UpPS.Update()
|
||||||
@@ -5666,6 +5702,8 @@ Partial Class Ventas
|
|||||||
UpModalRemisionesNC.Update()
|
UpModalRemisionesNC.Update()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
CargaFacturasARelacionar()
|
||||||
|
|
||||||
If RequiereOC Then
|
If RequiereOC Then
|
||||||
Dim Documentacion As String = ""
|
Dim Documentacion As String = ""
|
||||||
'RegistraScript("$('#DivDocsCliente').modal({ backdrop: 'static', keyboard: false });", "ModalArchivos")
|
'RegistraScript("$('#DivDocsCliente').modal({ backdrop: 'static', keyboard: false });", "ModalArchivos")
|
||||||
@@ -5697,6 +5735,138 @@ Partial Class Ventas
|
|||||||
DeshabilitarAplicarNotaDeCredito(LblRFC.Text)
|
DeshabilitarAplicarNotaDeCredito(LblRFC.Text)
|
||||||
End Sub
|
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)
|
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
|
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.TipoCambio = If(Obj.CveMoneda = 1, "1", Obj.TipoCambio.ToString())
|
||||||
Timbre.Comprobante.Total = Obj.Total
|
Timbre.Comprobante.Total = Obj.Total
|
||||||
|
|
||||||
'Try
|
|
||||||
'Obj.SetSubProyecto(Me)
|
|
||||||
Timbre.Comprobante.LugarExpedicion = Obj.SubProyecto.CP
|
Timbre.Comprobante.LugarExpedicion = Obj.SubProyecto.CP
|
||||||
If Timbre.Comprobante.LugarExpedicion = "" Then
|
If Timbre.Comprobante.LugarExpedicion = "" Then
|
||||||
Dim aa As String = "no se guardo lugar de expedicion"
|
Dim aa As String = "no se guardo lugar de expedicion"
|
||||||
aa.GuardaLog()
|
aa.GuardaLog()
|
||||||
End If
|
End If
|
||||||
'Catch ex As Exception
|
|
||||||
|
|
||||||
'End Try
|
|
||||||
|
|
||||||
Timbre.Comprobante.Confirmacion = ""
|
Timbre.Comprobante.Confirmacion = ""
|
||||||
|
|
||||||
@@ -9870,6 +10035,26 @@ Partial Class Ventas
|
|||||||
|
|
||||||
End If
|
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 totSubTotal As Decimal = Obj.SubTotal
|
||||||
Dim totIVA As Decimal = Obj.IVA
|
Dim totIVA As Decimal = Obj.IVA
|
||||||
@@ -10465,7 +10650,18 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
End If
|
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
|
End If
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(280) = "1" And RblPaqueteria.SelectedValue = "1" And Not factura.TipoDocto.Contiene("Rem", "Ped") Then
|
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
|
End Sub
|
||||||
|
|
||||||
Private Sub BtnAplicaNuevaNC_Click(sender As Object, e As EventArgs) Handles BtnAplicaNuevaNC.Click
|
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)
|
AplicarNotaCreditoDesdeVenta(AplicaNuevoDocumento:=True)
|
||||||
Else
|
|
||||||
Alert("No ha seleccionado ninguna remisión de nota de crédito", TipoMensaje.MsgAdvertencia)
|
|
||||||
End If
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub AplicarNotaCreditoDesdeVenta(Optional AplicaNuevoDocumento As Boolean = False)
|
Private Sub AplicarNotaCreditoDesdeVenta(Optional AplicaNuevoDocumento As Boolean = False)
|
||||||
@@ -28534,4 +28726,7 @@ Partial Class Ventas
|
|||||||
Public ImporteBonificacion As Decimal = 0
|
Public ImporteBonificacion As Decimal = 0
|
||||||
Public IVABonificacion As Decimal = 0
|
Public IVABonificacion As Decimal = 0
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
Reference in New Issue
Block a user