Folios Ficales en ventas relacionadas, correciones en limite de credito, rfc en ventas, amortizaciones, carga de sucursal al crear a partir de, tipos de retenciones
This commit is contained in:
@@ -2537,12 +2537,13 @@ Public Class ClsVentas
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function AddVentasRelacionadas(CveVenta As Integer, CveVentaRelacionada As Integer) As Boolean
|
||||
Public Function AddVentasRelacionadas(CveVenta As Integer, CveVentaRelacionada As Integer, Optional FolioFiscal As String = "") As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_VentasRelacionadasAdd")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
|
||||
.Add("@CveVentaRelacionada", SqlDbType.Int).Value = CveVentaRelacionada
|
||||
.Add("@FolioFiscal", SqlDbType.VarChar).Value = FolioFiscal
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
|
||||
@@ -353,7 +353,7 @@
|
||||
<asp:HyperLink ID="HlCuentaTerminal" data-toggle="modal" data-target="#ModalCuentaTerminal" runat="server" Visible="false"><i class="fa fa-money"></i> Asignar Cuenta de Terminal</asp:HyperLink>
|
||||
</li>
|
||||
<li>
|
||||
<asp:HyperLink ID="HplFolioFiscalModal" data-toggle="modal" data-target="#ModalFolioFiscal" runat="server" Visible="false"><i class="fa fa-plus"></i> Asignar Folio Fiscal</asp:HyperLink>
|
||||
<asp:HyperLink ID="HplFolioFiscalModal" data-toggle="modal" data-target="#ModalFolioFiscal" runat="server" Visible="false"><i class="fa fa-pencil"></i> Asignar Folio Fiscal</asp:HyperLink>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton runat="server" ID="LnkImprimirFormatoCicovisa" Visible="false" OnClick="LnkImprimirFormatoCicovisa_Click">Imprimir Formato Cicovisa</asp:LinkButton>
|
||||
@@ -4764,10 +4764,19 @@
|
||||
<asp:RadioButtonList ID="RblTipo" runat="server" AutoPostBack="true" RepeatDirection="Horizontal" CssClass="input-group col-md-12" CellSpacing="100">
|
||||
<asp:ListItem Value="3" Class="one" Selected="True"><label><b>Total x Concepto</b></label></asp:ListItem>
|
||||
<asp:ListItem Value="1" Class="one"><label><b>Total General</b></label></asp:ListItem>
|
||||
<asp:ListItem Value="2" Class="one"><label><b>Total x Remisión</b></label></asp:ListItem>
|
||||
<asp:ListItem Value="2" Class="one"><label><b>Total x Remisión</b></label></asp:ListItem>
|
||||
</asp:RadioButtonList>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="DivPSRemision" runat="server" visible="false">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="<%= DdlPSRemision.ClientID.ToString()%>">Producto/Servicio:</label>
|
||||
<ADS:Dropdownlost runat="server" ID="DdlPSRemision" CssStyle="width: 100%;" CssClass=" form-control input-sm DdlPS" IncluyeTodos="false" CssClassDdl="select2me form-control" DataTextField="PSCodigo" DataValueField="CvePS" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<asp:CheckBox ID="ChkRemProductos" runat="server" AutoPostBack="true" Text="Mostrar Productos" />
|
||||
@@ -6182,7 +6191,7 @@
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">Facturas Relacionadas</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="modal-body" style="width:900px;">
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<label>Relación:</label>
|
||||
@@ -6201,7 +6210,19 @@
|
||||
<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>
|
||||
<asp:LinkButton ID="LnkAgregarFacturaRelacionada" runat="server" CssClass="btn btn-sm btn-primary" OnClick="LnkAgregarFacturaRelacionada_Click"><i class="fa fa-plus"></i>Agregar Factura</asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div id="DivFolioFiscalAgregar" runat="server" class="row">
|
||||
<div class="col-md-2">
|
||||
<label>Folio Fiscal:</label>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<asp:TextBox ID="TxtFolioFiscalRelacionar" runat="server" Text="" Width="100%" CssClass="form-control input-sm"></asp:TextBox>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<asp:LinkButton ID="LnkAgregarFolioFiscalRelacionada" runat="server" CssClass="btn btn-sm btn-primary" OnClick="LnkAgregarFolioFiscalRelacionada_Click"><i class="fa fa-plus"></i>Agregar Folio</asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
@@ -6242,8 +6263,10 @@
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel runat="server" ID="UpdatePanel3" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
Folio Fiscal
|
||||
<asp:TextBox ID="TxtModalFolioFiscal" runat="server" Width="250px"></asp:TextBox>
|
||||
<div class="row">
|
||||
<div class="col-md-2"> Folio Fiscal</div>
|
||||
<div class="col-md-10"> <asp:TextBox ID="TxtModalFolioFiscal" runat="server" Width="100%"></asp:TextBox></div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
@@ -6822,7 +6845,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
|
||||
<asp:Button Text="Aplicar Remisiones" ID="BtnAplicarRNCDevoluciones" OnClick="BtnAplicarRNCDevoluciones_Click" CssClass="btn btn-primary" runat="server" ValidationGroup="VGAplicarRNC" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -2217,6 +2217,7 @@ Partial Class Ventas
|
||||
|
||||
CargaClasificaciones()
|
||||
CargaPS(-1, DdlPS)
|
||||
CargaPSRemision(-1, DdlPSRemision)
|
||||
CargaPSPyME(-1, DdlPSPyME)
|
||||
|
||||
CreaDTVentas()
|
||||
@@ -2303,7 +2304,7 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
'MUESTRA EL MODAL PARA PODER RELACIONAR FACTURAS
|
||||
If UsuarioActual.Empresa.Funcionalidad(592) = "1" Then
|
||||
If UsuarioActual.TienePermisoProceso(321) Then
|
||||
HlFacturasRelaciondas.Visible = True
|
||||
End If
|
||||
|
||||
@@ -2313,7 +2314,7 @@ Partial Class Ventas
|
||||
ViewState("CveVenta") = Request("CveVenta")
|
||||
|
||||
If CargaVenta() Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(592) = "1" Then
|
||||
If UsuarioActual.TienePermisoProceso(321) Then
|
||||
CargaRelacionadasPendientes()
|
||||
End If
|
||||
|
||||
@@ -4088,8 +4089,9 @@ Partial Class Ventas
|
||||
'TxtIEPS.Text = If(TmpDT.SUM("IEPS") > 0, TmpDT.SUM("IEPS").FormatoNumero, TxtIEPS.Text)
|
||||
End If
|
||||
|
||||
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Ing", "Ant", "Dev") AndAlso LblFolioFiscal.Text.Trim = "" Then HplFolioFiscalModal.Visible = True
|
||||
If UsuarioActual.TienePermisoProceso(318) Then
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Ing", "Ant", "Dev") AndAlso String.IsNullOrEmpty(LblFolioFiscal.Text.Trim) Then HplFolioFiscalModal.Visible = True
|
||||
End If
|
||||
|
||||
Select Case DbRowVenta("TipoDocto").ToString()
|
||||
Case "Ing"
|
||||
@@ -5939,7 +5941,7 @@ Partial Class Ventas
|
||||
|
||||
Private Sub CargaRelacionadasPendientes()
|
||||
|
||||
If CveVenta > 0 AndAlso UsuarioActual.Empresa.Funcionalidad(592) = "1" Then
|
||||
If CveVenta > 0 AndAlso UsuarioActual.TienePermisoProceso(321) Then
|
||||
Me.TmpDTFacturasRelacionadas = New DataTable()
|
||||
Me.TmpDTFacturasRelacionadas.Columns.Add(New DataColumn("CveVenta", GetType(Integer)))
|
||||
Me.TmpDTFacturasRelacionadas.Columns.Add(New DataColumn("SerieFolio", GetType(String)))
|
||||
@@ -6027,6 +6029,37 @@ Partial Class Ventas
|
||||
UpFacturasRelacionadas.Update()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkAgregarFolioFiscalRelacionada_Click(sender As Object, e As EventArgs)
|
||||
If CveVenta <= 0 OrElse EsCreaApartirDe 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 idx As Integer = TmpDTFacturasRelacionadas.MIN("CveVenta", $"CveVenta <= 0").ToEntero()
|
||||
If idx = 0 Then
|
||||
idx = -1
|
||||
End If
|
||||
Dim Row As DataRow = TmpDTFacturasRelacionadas.NewRow()
|
||||
|
||||
Row("CveVenta") = idx - 1
|
||||
Row("SerieFolio") = "SIN ASIGNAR"
|
||||
Row("FolioFiscal") = TxtFolioFiscalRelacionar.Text
|
||||
|
||||
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 OrElse EsCreaApartirDe Then
|
||||
@@ -6453,6 +6486,9 @@ Partial Class Ventas
|
||||
ElseIf LimiteRestanteSucursal < LimiteRestanteCliente Then
|
||||
Retorno = LimiteRestanteSucursal
|
||||
PorcentajeCredito = PorcentajeSaldoSucursal
|
||||
ElseIf LimiteRestanteSucursal = LimiteRestanteCliente Then
|
||||
Retorno = LimiteRestanteSucursal
|
||||
PorcentajeCredito = PorcentajeSaldoSucursal
|
||||
End If
|
||||
|
||||
Else
|
||||
@@ -6522,6 +6558,29 @@ Partial Class Ventas
|
||||
Objeto.ddlWS.Attributes.Add("data-AplicaparaVenta", "1")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaPSRemision(CveClasificacion As Integer, Objeto As ADServerControl.Dropdownlost)
|
||||
|
||||
Objeto.setEsWebService(UsuarioActual.Empresa.Funcionalidad(141).ToString() = "1")
|
||||
|
||||
If Not UsuarioActual.Empresa.Funcionalidad(141).ToString() = "1" Then
|
||||
Objeto.ddl.Items.Clear()
|
||||
'Objeto.ddl.DataSource = GlobalDTProductosServicios(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacion, AplicaParaVenta:=1, Estatus:=1)
|
||||
Objeto.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacion, Estatus:=1, AplicaParaVenta:=1)
|
||||
Objeto.ddl.DataBind()
|
||||
Objeto.ddl.Items.Insert(0, New ListItem("*** Actualizar listado de Productos o Servicios ***", "-2"))
|
||||
Objeto.ddl.Items.Insert(0, New ListItem("Seleccione el Producto", "-1"))
|
||||
Else
|
||||
Dim cvesubproyecto As String = "-1"
|
||||
|
||||
Objeto.Attributes.Add("data-cvesubproyecto", cvesubproyecto)
|
||||
Objeto.ddlWS.Attributes.Add("data-cveclasificacion", CveClasificacion.ToString())
|
||||
Objeto.ddlWS.Attributes.Add("data-pagina", "ventas/ventas")
|
||||
Objeto.ddlWS.Attributes.Add("data-Estatus", "1")
|
||||
Objeto.ddlWS.Attributes.Add("data-AplicaparaVenta", "1")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Private Sub CargaNC(pCveVenta As Integer)
|
||||
If pCveVenta > 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Egs", "Dev") Or DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant") Then
|
||||
@@ -9088,6 +9147,13 @@ Partial Class Ventas
|
||||
DtVentasNC.AcceptChanges()
|
||||
End If
|
||||
|
||||
'ASIGNAR RFC RECEPTOR
|
||||
If ObjFacturaBonificacion.Timbre IsNot Nothing Then
|
||||
If ObjFacturaBonificacion.Timbre.Receptor IsNot Nothing Then
|
||||
ObjFacturaBonificacion.RFCReceptor = ObjFacturaBonificacion.Timbre.Receptor.RFC
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -9957,6 +10023,13 @@ Partial Class Ventas
|
||||
ObjFactura.DescuentoProntoPago = HdnProntoPago.Value.ToDecimal()
|
||||
|
||||
ObjFactura.NuevaFactura = Me.NuevaFactura
|
||||
|
||||
'ASIGNAR RFC RECEPTOR
|
||||
If ObjFactura.Timbre IsNot Nothing Then
|
||||
If ObjFactura.Timbre.Receptor IsNot Nothing Then
|
||||
ObjFactura.RFCReceptor = ObjFactura.Timbre.Receptor.RFC
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CreaObjetosVentaDevolucion()
|
||||
@@ -10249,6 +10322,13 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
ObjFacturaDevolucion.Timbre = PreParaTimbre(ObjFacturaDevolucion)
|
||||
|
||||
'ASIGNAR RFC RECEPTOR
|
||||
If ObjFacturaDevolucion.Timbre IsNot Nothing Then
|
||||
If ObjFacturaDevolucion.Timbre.Receptor IsNot Nothing Then
|
||||
ObjFacturaDevolucion.RFCReceptor = ObjFacturaDevolucion.Timbre.Receptor.RFC
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function PreParaTimbre(Obj As Modelos.Factura) As CFDITimbre
|
||||
@@ -10354,7 +10434,7 @@ 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
|
||||
If UsuarioActual.TienePermisoProceso(321) AndAlso Me.AplicaRelacionManual AndAlso DdlTipoRelacionARelacionar.SelectedValue.ToEntero() > 0 Then
|
||||
|
||||
Dim CveTipoRelacion As Integer = DdlTipoRelacionARelacionar.SelectedValue.ToEntero()
|
||||
|
||||
@@ -10408,7 +10488,7 @@ Partial Class Ventas
|
||||
Dim concepto As New CFDIConceptos With {.Cantidad = drr("Cantidad").ToString().ToDecimal,
|
||||
.Descripcion = tPS,
|
||||
.ValorUnitario = drr("PU").ToString().ToDecimal,
|
||||
.Importe = drr("TotalImporte").ToString().ToDecimal,
|
||||
.Importe = If(UsuarioActual.Empresa.CvePAC = 3, drr("Total").ToString().ToDecimal, drr("TotalImporte").ToString().ToDecimal),
|
||||
.Descuento = drr("Descuento").ToString().ToDecimal.RoundSQL(2),
|
||||
.Unidad = drr("UM").ToString(),
|
||||
.ClaveUnidad = drr("SATClaveUM").ToString(),
|
||||
@@ -11001,11 +11081,20 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(592) = "1" AndAlso Me.AplicaRelacionManual Then
|
||||
If UsuarioActual.TienePermisoProceso(321) 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")
|
||||
If GvRow.DataKey("CveVenta").ToEntero() > 0 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
|
||||
Else
|
||||
Dim FolioFiscalRelacionado As String = GvRow.DataKey("FolioFiscal")
|
||||
If Not String.IsNullOrEmpty(FolioFiscalRelacionado) Then
|
||||
If Not ObjVentas.AddVentasRelacionadas(ObjVentas.CveVenta, -1, FolioFiscal:=FolioFiscalRelacionado) Then
|
||||
ErrorList.Add("Ocurrió un error al relacionar las ventas entre si comuníquese a Soporte Técnico")
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
@@ -14809,6 +14898,19 @@ Partial Class Ventas
|
||||
Alert("La amortización no se pudo realizar ya que los importes no cubren la totalidad del documento. Por favor verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If Amortizacion > SubTotalRef Then
|
||||
|
||||
'[IPP] LIMPIA LO SELECCIONADO EN CASO DE QUE NO SEA AMORTIZACIÓN DEL 100% 15Junio2018
|
||||
Amortizacion = 0
|
||||
For Each gvr As GridViewRow In GVAnticipos.Rows
|
||||
gvr.FCCheckBox($"Chk{gvr.RowIndex}").Checked = False
|
||||
Next
|
||||
If CveVenta <= 0 Then
|
||||
Alert($"La amortización no se pudo realizar ya que los importes exceden la totalidad del documento.<br/> Importe sugerido para amortizar:<b>{SubTotalRef.FormatoNumero(2)}</b>.<br/> Por favor verifique y vuelva a intentar", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
End If
|
||||
LblAmortizacion.Text = Amortizacion.FormatoNumero(2)
|
||||
|
||||
@@ -16144,7 +16246,7 @@ Partial Class Ventas
|
||||
Private Sub DdlSubProyectoDatos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlSubProyectoDatos.SelectedIndexChanged
|
||||
CambiaSucursalGeneral()
|
||||
End Sub
|
||||
Private Sub CambiaSucursalGeneral()
|
||||
Private Sub CambiaSucursalGeneral(Optional RecargarPartidas As Boolean = True)
|
||||
Dim ObjSubProyectos As New ClsSubProyectos
|
||||
'Dim ObjSucursal As New ClsSucursales
|
||||
If ObjSubProyectos.GetSubProyectos() Then
|
||||
@@ -16158,7 +16260,7 @@ Partial Class Ventas
|
||||
'DdlSubProyecto.SelectedValue = "-1"
|
||||
DdlSubProyecto.DataBind()
|
||||
DdlSubProyecto.SelectedValueExist(DdlSubProyectoDatos.SelectedValue)
|
||||
CambiaSucursal()
|
||||
CambiaSucursal(RecargarPartidas)
|
||||
|
||||
DdlSubProyectoEjecucion.SelectedValueExist(DdlSubProyectoDatos.SelectedValue)
|
||||
DdlSubProyectoCobranza.SelectedValueExist(DdlSubProyectoDatos.SelectedValue)
|
||||
@@ -16176,12 +16278,16 @@ Partial Class Ventas
|
||||
|
||||
UpDetalle.Update()
|
||||
End Sub
|
||||
Private Sub CambiaSucursal()
|
||||
Private Sub CambiaSucursal(Optional RecargarPartidas As Boolean = True)
|
||||
CargaFormatoSucursal()
|
||||
CargaFolios()
|
||||
CargaVendedores()
|
||||
CargarAlmacenes()
|
||||
RecargaSucursalPartidas()
|
||||
|
||||
If RecargarPartidas Then
|
||||
RecargaSucursalPartidas()
|
||||
End If
|
||||
|
||||
DdlPS.Attributes.Remove("data-cvesubproyecto")
|
||||
DdlPS.Attributes.Add("data-cvesubproyecto", DdlSubProyectoDatos.SelectedValue)
|
||||
|
||||
@@ -16191,6 +16297,7 @@ Partial Class Ventas
|
||||
UpPS.Update()
|
||||
End Sub
|
||||
Private Sub RecargaSucursalPartidas()
|
||||
|
||||
Dim CveSubProyecto As Integer = DdlSubProyectoDatos.SelectedValue.ToEntero()
|
||||
Dim SubProyecto As String = ""
|
||||
If CveSubProyecto > 0 Then
|
||||
@@ -23283,12 +23390,12 @@ Partial Class Ventas
|
||||
|
||||
Private Sub CargaPSPyME(CveClasificacion As Integer, Objeto As ADServerControl.Dropdownlost)
|
||||
|
||||
DdlPSPyME.setEsWebService(True)
|
||||
Objeto.setEsWebService(True)
|
||||
|
||||
DdlPSPyME.Attributes.Add("data-cvesubproyecto", DdlSubProyectoDatos.SelectedValue)
|
||||
DdlPSPyME.ddlWS.Attributes.Add("data-cveclasificacion", CveClasificacion.ToString())
|
||||
DdlPSPyME.ddlWS.Attributes.Add("data-pagina", "ventas/ventas")
|
||||
DdlPSPyME.ddlWS.Attributes.Add("data-Estatus", "1")
|
||||
Objeto.Attributes.Add("data-cvesubproyecto", DdlSubProyectoDatos.SelectedValue)
|
||||
Objeto.ddlWS.Attributes.Add("data-cveclasificacion", CveClasificacion.ToString())
|
||||
Objeto.ddlWS.Attributes.Add("data-pagina", "ventas/ventas")
|
||||
Objeto.ddlWS.Attributes.Add("data-Estatus", "1")
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -24015,6 +24122,7 @@ Partial Class Ventas
|
||||
Dim FileExtension As String = "-1"
|
||||
Dim Filesgral As List(Of Archivo) = TxtFileCliente.getfiles().Archivos
|
||||
Dim Filename As String = ""
|
||||
Dim ErrorCarga As Boolean = False
|
||||
|
||||
For Each fileItem As Archivo In Filesgral
|
||||
Try
|
||||
@@ -24033,6 +24141,17 @@ Partial Class Ventas
|
||||
Count = +1
|
||||
Next
|
||||
End If
|
||||
|
||||
If fileItem Is Nothing Then
|
||||
ErrorCarga = True
|
||||
Exit For
|
||||
Else
|
||||
If fileItem.FileUrl Is Nothing Then
|
||||
ErrorCarga = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
|
||||
DtDocumentacionCliente(IndexDocumentoCliente)("RutaArchivo") = fileItem.FileUrl
|
||||
DtDocumentacionCliente(IndexDocumentoCliente)("UpArchivo") = "1"
|
||||
|
||||
@@ -24045,6 +24164,11 @@ Partial Class Ventas
|
||||
|
||||
Next
|
||||
|
||||
If ErrorCarga Then
|
||||
Alert("No se pudo cargar el archivo", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
GvDocumentosCliente.DataSource = DtDocumentacionCliente
|
||||
GvDocumentosCliente.DataBind()
|
||||
|
||||
@@ -28319,8 +28443,11 @@ Partial Class Ventas
|
||||
HuboCambioRemi = Not HuboCambioRemi
|
||||
'TOTAL X CONCEPTO
|
||||
If RblTipo.SelectedValue = "3" Then
|
||||
'DivPSRemision.Visible = False
|
||||
ChkRemProductos.Visible = True
|
||||
Else
|
||||
'DivPSRemision.Visible = True
|
||||
CargaPSRemision(-1, DdlPSRemision)
|
||||
ChkRemProductos.Visible = False
|
||||
ChkRemProductos.Checked = False
|
||||
End If
|
||||
@@ -28329,6 +28456,12 @@ Partial Class Ventas
|
||||
End Sub
|
||||
Protected Sub BtnGuardarRemisiones_Click(sender As Object, e As EventArgs) Handles BtnGuardarRemisiones.Click
|
||||
If GvRem.Rows.Count > 0 Or GvRemPS.Rows.Count > 0 Then
|
||||
|
||||
If RblTipo.SelectedValue.Contiene("1", "2") AndAlso DdlPSRemision.SelectedValue.ToEntero() <= 0 Then
|
||||
Alert("Debe seleccionar un producto para facturar la remisión", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
'Checa las facturas selecionadas
|
||||
If Not VerificaRemisiones(DTRemisiones) Then
|
||||
Alert("La cantidad/total debe ser mayor que 0", TipoMensaje.MsgAdvertencia)
|
||||
@@ -28430,9 +28563,9 @@ Partial Class Ventas
|
||||
Next
|
||||
IsTotalxConcepto = False
|
||||
Dim PU As Decimal = dtSeleccionadas.SUM("SubTotal").ToDecimal
|
||||
Dim PS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa)(0)
|
||||
Dim PS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPSRemision.SelectedValue.ToEntero())(0)
|
||||
Dim IVA As Double = If(dtSeleccionadas.SUM("Iva") > 0, dtSeleccionadas.SUM("Iva") / dtSeleccionadas.SUM("SubTotal"), 0.16)
|
||||
Dim rowSP As DataRow = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa)(0)
|
||||
Dim rowSP As DataRow = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa)(0)
|
||||
|
||||
AgregarProductoServicio(1, PS("CveUM").ToString().ToEntero(), PS("UnidadMedida").ToString(), PS("CveClasificacion").ToString().ToEntero(),
|
||||
PS("Clasificacion").ToString(), PS("CvePS").ToString().ToEntero(), PS("PS").ToString(), "", PU, 0,
|
||||
@@ -28458,8 +28591,8 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
Next
|
||||
Dim PS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa)(0)
|
||||
Dim rowSP As DataRow = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa)(0)
|
||||
Dim PS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPSRemision.SelectedValue.ToEntero())(0)
|
||||
Dim rowSP As DataRow = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa)(0)
|
||||
Dim IVA As Double = If(dtSeleccionadas.SUM("Iva") > 0, dtSeleccionadas.SUM("Iva") / dtSeleccionadas.SUM("SubTotal"), 0.16)
|
||||
For Each gvr As GridViewRow In GvRem.Rows
|
||||
If gvr.FCCheckBox("Chk").Checked Then
|
||||
@@ -29245,7 +29378,7 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
ObjCliente.Dispose()
|
||||
DdlTipoRetencion_SelectedIndexChanged(DdlTipoRetencion, EventArgs.Empty)
|
||||
'DdlTipoRetencion_SelectedIndexChanged(DdlTipoRetencion, EventArgs.Empty)
|
||||
|
||||
TrVistaPrevia.Visible = True
|
||||
TxtFechaVencimientoCotizacion.Text = Now.ToShortDateString
|
||||
@@ -29255,7 +29388,7 @@ Partial Class Ventas
|
||||
GvPS.Columns(18).Visible = True
|
||||
|
||||
CambiaTipoDocto()
|
||||
CambiaSucursalGeneral()
|
||||
CambiaSucursalGeneral(RecargarPartidas:=False)
|
||||
CargaAnticipos(CveCliente)
|
||||
CargaRestriccionesCreditoCliente(CveVenta:=-1)
|
||||
|
||||
@@ -29276,6 +29409,14 @@ Partial Class Ventas
|
||||
|
||||
CalculaTotalesVenta()
|
||||
|
||||
Dim PorcentajeRetIVA = (TmpDT.MAX("PorcentajeRetIVA").ToDecimal() * 100)
|
||||
|
||||
If PorcentajeRetIVA > 0 Then
|
||||
TrRetIVA.Style.Add("display", "")
|
||||
UsuarioActual.Empresa.MostrarRetIVA = True
|
||||
DdlTipoRetencion.Visible = True
|
||||
End If
|
||||
|
||||
UpnTools.Update()
|
||||
UpCliente.Update()
|
||||
UpParametros.Update()
|
||||
|
||||
Reference in New Issue
Block a user