This commit is contained in:
2020-12-17 15:08:40 -07:00
45 changed files with 2151 additions and 1373 deletions

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

@@ -9141,7 +9141,7 @@ Partial Class Clientes
End If
Dim ImporteBonificacion As Decimal = 0
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) AndAlso ObjAcum.DtResultados.Rows.Count > 0 Then
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) AndAlso ObjAcum.DtResultados.Rows.Count >= 4 Then
GvUsadosResumen.DataSource = ObjAcum.DtResultados
ImporteBonificacion = ObjAcum.DtResultados.Rows(4)("Valor").ToString().ToDecimal()
End If

View File

@@ -261,7 +261,7 @@
<asp:UpdatePanel ID="UPVentas" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvCxC" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Cuentas por Cobrar Pendientes"
DataKeyNames="TipoDocto,CveVenta,CveCliente,SerieFolio,Original,SubTotal,IVA,IEPS,RetIVA,RetISR,Num3,CveSubProyecto,CveMoneda,Saldo,TipoCambio, RFC,UUID,Fecha,PorcentajeIVA,DescuentoProntoPago,CveTipoRetencion,Descuento"
DataKeyNames="TipoDocto,CveVenta,CveCliente,SerieFolio,Original,SubTotal,IVA,IEPS,RetIVA,RetISR,Num3,CveSubProyecto,CveMoneda,Saldo,TipoCambio, RFC,UUID,Fecha,PorcentajeIVA,DescuentoProntoPago,CveTipoRetencion,Descuento,ClaveMetodoPagoSAT"
CssClass="table table-striped table-advance table-hover Widthall" Style="text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
@@ -358,7 +358,15 @@
<asp:TemplateField Visible="False">
<HeaderTemplate>CveVenta</HeaderTemplate>
<ItemTemplate>
<asp:HyperLink ID="HplF2" CssClass="Texto" Text='<%# Eval("CveVenta")%>' runat="server"></asp:HyperLink>
<asp:HyperLink ID="HplF2" CssClass="btn-success" Text='<%# Eval("CveVenta")%>' runat="server"></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<HeaderTemplate>Complemento Pago</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton runat="server" ID="LnkComplemento" CssClass="text-success" Text="<i class='fa fa-check' aria-hidden='true'></i>" OnClientClick="return false;" ></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>

View File

@@ -636,6 +636,17 @@ Partial Class Ventas_ClientesAbonar
e.Row.FCCheckBox("Chk").Visible = False
End If
If e.Row.DBCampo("CveVenta").ToEntero > 0 Then
If e.Row.DataKey("ClaveMetodoPagoSAT") = "PUE" Then
e.Row.FCLinkButton("LnkComplemento").Text = "<i class='fa fa-times' aria-hidden='true'></i>"
e.Row.FCLinkButton("LnkComplemento").CssClass = "text-danger"
End If
Else
e.Row.FCLinkButton("LnkComplemento").Visible = False
End If
End If
End Sub
@@ -2071,8 +2082,13 @@ Partial Class Ventas_ClientesAbonar
Dim SubProyecto = DrSubProyecto("SubProyecto").ToString
Dim Proyecto = DrSubProyecto("Proyecto").ToString
Dim CveSATNC = "84111506"
Dim DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:=CveSATNC, AplicaParaVenta:=1).FiltroPrimero("")
Dim CveSATNC As Integer
Dim ArrayNC As String() = UsuarioActual.Empresa.Funcionalidad(591).Split(",".ToCharArray())
Dim NCBonificacion As Integer = 0
If ArrayNC.Length > 6 Then 'CONCEPTO DE PRONTO PAGO
CveSATNC = ArrayNC(6).ToEntero()
End If
Dim DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CveSATNC, AplicaParaVenta:=1).FiltroPrimero("")
For Each Dr As DataRow In DtImpuestos.Rows
AgregaTempDTNC(ObjFacturaDevolucion.DtDetalle, DrPS("CvePS").ToString.ToEntero, DrPS("PS").ToString, DrPS("Codigo").ToString, DrPS("PSCodigo").ToString, DrPS("CveTipoPS").ToString.ToEntero, DrPS("Inv_CveMetodoInventario").ToString.ToEntero,
@@ -2505,6 +2521,18 @@ Partial Class Ventas_ClientesAbonar
'For i = 0 To CveVentas.Count - 1
Dim ObjBancos As New ClsBancos
If ObjBancos.GetComplementoPagosRep(-1, Now.AddYears(-2), Now, CveIE, -1, If(CveIESustitucion > 0, 2, 1), UsuarioActual.CveEmpresa, -1) Then
If Not ObjBancos.DtResultados.Rows.Count > 0 Then
ObjBancos.Dispose()
Alert("No se generaron complementos de pago porque no hay facturas con método de pago PPD", TipoMensaje.MsgAdvertencia)
Return ""
End If
End If
ObjBancos.IniciaTransacSQL()
If ObjBancos.GeneraTimbrePago(CveIE, -1, UsuarioActual, CveCliente, CFDIRelacionado:=CFDIRelacionadoSustitucion, EsRegeneracion:=If(CveIESustitucion > 0, True, False)) Then

View File

@@ -2700,6 +2700,8 @@ Partial Class PV
Objeto.Attributes.Add("data-cvesubproyecto", DdlSubProyectoDatos.SelectedValue)
'Objeto.ddlWS.Attributes.Add("data-cveclasificacion", CveClasificacion.ToString)
Objeto.ddlWS.Attributes.Add("data-cveclasificacion", "-1")
Objeto.ddlWS.Attributes.Add("data-aplicaparaventa", "1")
If AplicaAlmacen Then
Objeto.ddlWS.Attributes.Add("data-pagina", "ventas/ventas")
Else

View File

@@ -132,7 +132,7 @@
<div class="row">
<div class="col-md-12">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPS" CssClass="form-control Mayuscula" runat="server" MaxLength="846"></asp:TextBox>
<asp:TextBox ID="TxtPS" TextMode="MultiLine" Rows="2" CssClass="form-control Mayuscula" runat="server" MaxLength="846"></asp:TextBox>
<label class="truncate" for="<%= TxtPS.ClientID.ToString()%>">Descripción del Producto / Servicio:</label>
<asp:RequiredFieldValidator ID="RFVPS" runat="server" ControlToValidate="TxtPS" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Producto Servicio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEPS" runat="server" HighlightCssClass="vco" TargetControlID="RFVPS" Width="300px"></ajax:ValidatorCalloutExtender>

View File

@@ -2822,9 +2822,9 @@
<div class="col-md-5">
<asp:RadioButtonList ID="RBLTipoContrato" AppendDataBoundItems="true" OnSelectedIndexChanged="RBLTipoContrato_SelectedIndexChanged" AutoPostBack="true" runat="server" RepeatDirection="Horizontal">
<asp:ListItem Text="Venta" Value="2" Selected="True" />
<asp:ListItem Text="Suministro" Value="1" />
<%--<asp:ListItem Text="Consignación" Value="3" Enabled="false" />--%>
<asp:ListItem Text="Suministro" Value="1" />
<asp:ListItem Text="Obra" Value="4" />
</asp:RadioButtonList>
</div>
<div class="col-md-6">

View File

@@ -8312,7 +8312,7 @@ Partial Class Ventas
If ObjFolios.GetFolios(TipoDoctoConsulta, UsuarioActual.CveEmpresa) Then
Dim DT As DataTable = ObjFolios.DtResultados.FiltraParametros(String.Format(" CveSubProyecto = {0} And Estado = 'Activo'", DdlSubProyectoDatos.SelectedValue))
If DT.Rows.Count > 0 Then
ObjFactura.Serie = DT.Rows(0)("Serie").ToString()
ObjFacturaDevolucion.Serie = DT.Rows(0)("Serie").ToString()
End If
DT.Dispose()
End If
@@ -8590,7 +8590,7 @@ Partial Class Ventas
If ObjFolios.GetFolios(TipoDoctoConsulta, UsuarioActual.CveEmpresa) Then
Dim DT As DataTable = ObjFolios.DtResultados.FiltraParametros(String.Format(" CveSubProyecto = {0} And Estado = 'Activo'", DdlSubProyectoDatos.SelectedValue))
If DT.Rows.Count > 0 Then
ObjFactura.Serie = DT.Rows(0)("Serie").ToString()
ObjFacturaBonificacion.Serie = DT.Rows(0)("Serie").ToString()
End If
DT.Dispose()
End If
@@ -9117,7 +9117,7 @@ Partial Class Ventas
ObjFactura.NumeroPersonas = 0
If ObjFactura.TipoDocto = "Ant" And DdlContratosModal.SelectedValue.ToEntero > 0 Or ObjFactura.TipoDocto = "Ing" And DdlContratosModal.SelectedValue.ToEntero > 0 Then
If ObjFactura.TipoDocto = "Ant" And DdlContratosModal.SelectedValue.ToEntero > 0 Or ObjFactura.TipoDocto = "Ing" And DdlContratosModal.SelectedValue.ToEntero > 0 Or ObjFactura.TipoDocto = "Egs" And DdlContratosModal.SelectedValue.ToEntero > 0 Then
CveContrato = DdlContratosModal.SelectedValue.ToEntero
End If
@@ -16417,6 +16417,10 @@ Partial Class Ventas
Dim TotalCalculableImpuestosIVA As Decimal = 0
PU = PU.RoundAD(6) ' el precio unitario puede llevar hasta 6 decimales permitidos
If Not TmpDT.Columns.Contains("RetIVA") Then
TmpDT.Columns.Add("RetIVA", GetType(Decimal))
End If
Row = TmpDT.NewRow()
Row("CveProyecto") = CveProyecto
Row("Proyecto") = Proyecto
@@ -16543,7 +16547,11 @@ Partial Class Ventas
Row("IVA") = Row("PorcentajeIVA")
Row("ImporteIVA") = (Row("PorcentajeIVA").ToString().ToDecimal * TotalCalculableImpuestosIVA).RoundAD(NumeroDecimales)
Row("ImporteRetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundAD(NumeroDecimales)
Row("RetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundAD(NumeroDecimales)
Row("ImporteRetISR") = (ClienteRetISR * TotalCalculableImpuestos).RoundAD(NumeroDecimales)
Row("PorcentajeRetIVA") = ClienteRetIVA
Row("PorcentajeRetISR") = ClienteRetISR
@@ -16741,6 +16749,8 @@ Partial Class Ventas
TmpDT.Columns.Add("TipoDescuento", GetType(Integer))
TmpDT.Columns.Add("TotalImporte", GetType(Decimal))
TmpDT.Columns.Add("Total", GetType(Decimal))
TmpDT.Columns.Add("RetIVA", GetType(Decimal))
TmpDT.Columns.Add("RetISR", GetType(Decimal))
'Para uso del módulo contable
TmpDT.Columns.Add("AsientoContableVentas", GetType(Integer))
TmpDT.Columns.Add("IdCtaContVentas", GetType(Integer))
@@ -22613,6 +22623,42 @@ Partial Class Ventas
If Not GeneraPrePolizaMovimientoAlmacen(ObjInventario, ObjConta, ObjContPaq, ObjFactura, ObjFactura.CvePrePoliza, CveMovimientoSalidaGeneral, CveAlmacenOrigenContrato) Then
Return False
End If
Dim RealizarMovimientoVirtual As Boolean = False
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
RealizarMovimientoVirtual = True
End If
'VIRTUAL SALIDA
If RealizarMovimientoVirtual Then
Dim dtvirtual As DataTable = Nothing
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=CveAlmacenOrigenContrato).FiltroPrimeroValor("CveAlmacenVirtual", "").ToEntero()
Dim CveMovimientoVirtualSalida As Integer
If ObjInventario.GetMovimientosDetalleVirtual(CveMovimientoSalidaGeneral, UsuarioActual.CveEmpresa) Then
dtvirtual = ObjInventario.DtResultados
If dtvirtual.Rows.Count > 0 Then
CveMovimientoVirtualSalida = ObjInventario.AddMovimiento(CveAlmacenVirtual, 37, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:="", Modulo:="VV2", CveMovimientoRelacionado:=CveMovimientoSalidaGeneral)
'FolioVirtualSalida = ObjInventario.Folio
For Each RowVirtual As DataRow In dtvirtual.Rows
Dim CvePS = RowVirtual("CvePS").ToString().ToEntero()
Dim CantidadUsado As Double = RowVirtual("Cantidad").ToString().ToDouble()
Dim PU As Decimal = RowVirtual("PU").ToString().ToDecimal()
Dim CveUM As Integer = RowVirtual("CveUM").ToString().ToEntero()
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtualSalida, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
Return False
End If
Next
End If
Else
Return False
End If
End If
Else
Return False
End If
@@ -28910,11 +28956,11 @@ Partial Class Ventas
Alert("Se selecciono un contrato de obra, para continuar seleccione una estimación.", TipoMensaje.MsgAdvertencia)
End If
ElseIf DdlTipoComprobante.SelectedValue = "Ant" Then
ElseIf DdlTipoComprobante.SelectedValue = "Ant" Or DdlTipoComprobante.SelectedValue = "Egs" Then
Respuesta = True
Else
Alert("Tipo de documento no valido para contratos de obra.", TipoMensaje.MsgAdvertencia)
Respuesta = True
Respuesta = False
End If
Else