E13. Contrato y descripcion de ventas (Parte 1)

This commit is contained in:
2023-01-27 12:26:53 -07:00
parent 07c93ec42d
commit 59b7743779
6 changed files with 106 additions and 11 deletions

View File

@@ -249,7 +249,7 @@ Public Class ClsMovimientos
TipoCambio As Integer, Optional TCEspecifico As Double = -1, Optional TipoDocto As String = "-1",
Optional FechaVI As String = "-1", Optional FechaVF As String = "-1", Optional FechaCorte As Date = Nothing, Optional EstatusCliente As Integer = -1, Optional CveUsuarioConsulta As Integer = -1,
Optional CveCobranzaEstatus As Integer = -1, Optional CveClienteClasificacion As Integer = -1, Optional TipoCliente As Integer = -1, Optional AplicaAnticiposPagados As Integer = 1, Optional CveMoneda As Integer = -1,
Optional TieneLineaAdicional As Integer = -1) As Boolean
Optional TieneLineaAdicional As Integer = -1, Optional CveContrato As Integer = -1) As Boolean
Dim Retorno As Boolean = False
'Data = New DataTable
@@ -284,7 +284,8 @@ Public Class ClsMovimientos
.Add("@TipoCliente", SqlDbType.Int).Value = TipoCliente
.Add("@AplicaAnticiposPagados", SqlDbType.Int).Value = AplicaAnticiposPagados
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
.Add("@TieneLineaAdicional", SqlDbType.Int).Value = TieneLineaAdicional
.Add("@TieneLineaAdicional", SqlDbType.Int).Value = TieneLineaAdicional
.Add("@CveContrato", SqlDbType.Int).Value = CveContrato
End With
Try
@@ -335,7 +336,8 @@ Public Class ClsMovimientos
CveResponsable As Integer, TipoCambio As Integer, Optional TCEspecifico As Double = -1, Optional TipoDocto As String = "-1",
Optional FechaVI As String = "-1", Optional FechaVF As String = "1", Optional FechaCorte As Date = Nothing, Optional CveUsuarioConsulta As Integer = -1,
Optional CveCobranzaEstatus As Integer = -1, Optional CveClienteClasificacion As Integer = -1, Optional LimiteCredito As Decimal = -1,
Optional TipoCliente As Integer = -1, Optional CveMoneda As Integer = -1, Optional EstatusCliente As Integer = -1, Optional AplicaAnticiposPagados As Integer = 1, Optional TieneLineaAdicional As Integer = -1) As Boolean
Optional TipoCliente As Integer = -1, Optional CveMoneda As Integer = -1, Optional EstatusCliente As Integer = -1, Optional AplicaAnticiposPagados As Integer = 1,
Optional TieneLineaAdicional As Integer = -1, Optional CveContrato As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DS = New DataSet
@@ -379,6 +381,7 @@ Public Class ClsMovimientos
.Add("@EstatusCliente", SqlDbType.Int).Value = EstatusCliente
.Add("@AplicaAnticiposPagados", SqlDbType.Int).Value = AplicaAnticiposPagados
.Add("@TieneLineaAdicional", SqlDbType.Int).Value = TieneLineaAdicional
.Add("@CveContrato", SqlDbType.Int).Value = CveContrato
End With
Try

View File

@@ -418,7 +418,7 @@ Public Class ClsVentas
Optional CveTipoAmortizacionAnticipo As Integer = -1, Optional CveVentaRelacion As Integer = -1, Optional ImporteRelacion As Decimal = -1, Optional CveEmpresaCRM As Integer = -1, Optional EsInterno As Integer = -1, Optional CveAcercamientoCRM As Integer = -1,
Optional DiasCredito As Integer = 0, Optional EsDiasCreditoFijo As Boolean = False, Optional AnticipoEspecial As Boolean = False, Optional Kilometraje As Double = 0, Optional EsAmortizacion As Boolean = False, Optional CveTipoRetencion As Integer = 0,
Optional CorreoNotificacion As String = "", Optional FormaPaqueteria As Integer = 1, Optional FacturarSucursal As Boolean = False, Optional VentaDesglosaIEPS As Boolean = False, Optional ServicioDomicilio As Boolean = False, Optional RFCReceptor As String = "", Optional Adjunto As String = "-1",
Optional DevolucionImportePagado As Decimal = 0, Optional EsGarantia As Boolean = False, Optional CveLineaAdicional As Integer = -1) As Boolean
Optional DevolucionImportePagado As Decimal = 0, Optional EsGarantia As Boolean = False, Optional CveLineaAdicional As Integer = -1, Optional DescripcionVenta As String = "") As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_VentasAdd")
@@ -517,6 +517,7 @@ Public Class ClsVentas
.Add("@DevolucionImportePagado", SqlDbType.Money).Value = DevolucionImportePagado
.Add("@EsGarantia", SqlDbType.Bit).Value = EsGarantia
.Add("@CveLineaAdicional", SqlDbType.Int).Value = CveLineaAdicional
.Add("@DescripcionVenta", SqlDbType.VarChar).Value = DescripcionVenta
.Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue
End With
'SqlTypes.SqlDateTime.Null

View File

@@ -362,6 +362,14 @@
<asp:ListItem Text="Sin lineas adicionales" Value="0"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-1 truncate" title="Tipo Cliente:" data-toggle="tooltip" data-placement="top">
Contrato:
</div>
<div class="col-md-2">
<asp:DropDownList ID="DdlContrato" runat="server" AppendDataBoundItems="true" DataTextField="TituloInfo" DataValueField="CveContrato" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>

View File

@@ -172,6 +172,20 @@ Partial Class RepCxC
' Next
'End If
'ObjSisUsuarios.Dispose()
If UsuarioActual.CveEmpresa = 13 Then
CargaContratos()
End If
End Sub
Private Sub CargaContratos()
Dim ObjContratos As New ClsContratos
If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, CveCliente:=-1) Then
DdlContrato.DataSource = ObjContratos.DtResultados
End If
ObjContratos.Dispose()
DdlContrato.DataBind()
End Sub

View File

@@ -512,7 +512,7 @@
<td width="95px"><b>Empresa:</b>&nbsp;</td>
<td width="200px">
<asp:Label ID="LblEmpresaCRM" runat="server" Text="Cliente"></asp:Label></td>
<td width="135px" runat="server" id="Td5"><b>Enviar Mail:</b></td>
<td width="135px" runat="server" id="Td5"><b>Enviar Mail:</b></td>
<td width="85px">
<asp:CheckBox ID="ChkEnviarFacturaCRM" runat="server" /></td>
</tr>
@@ -907,6 +907,32 @@
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDescripcionVenta" runat="server" class="portlet light xspadding bordered whitoutcol" style="margin-left: auto" UpdateMode="Conditional" Visible="false">
<ContentTemplate>
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span id="Span1" runat="server" class="caption-subject bold uppercase">Descripción </span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body formnombottom">
<table border="0" width="250px">
<tr align="left">
<td>
<asp:TextBox ID="TxtDescripcionVenta" runat="server" Rows="3" TextMode="MultiLine" Width="250px" MaxLength="800" CssClass="form-control input-sm" Enabled="false"></asp:TextBox></td>
</tr>
</table>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<asp:UpdatePanel ID="Updatetabs" runat="server" UpdateMode="Conditional">
@@ -2578,7 +2604,7 @@
<div class="row rowpadding">
<div class="col-md-2 form-group form-md-line-input" id="DivLblDestino" runat="server" visible="false"><span>Destino:</span></div>
<div class="col-md-4 form-group form-md-line-input" id="DivDdlDestino" runat="server" visible="false">
<asp:DropDownList ID="DdlDirecionDestinatario" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="DireccionEnvioContacto" DataValueField="CveDireccionEnvio"></asp:DropDownList>
<asp:DropDownList ID="DdlDirecionDestinatario" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="DireccionEnvioContacto" DataValueField="CveDireccionEnvio"></asp:DropDownList>
</div>
</div>
<div class="row">
@@ -2615,7 +2641,7 @@
</asp:GridView>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>

View File

@@ -3463,6 +3463,13 @@ Partial Class Ventas
UPObservaciones.Update()
End If
If UsuarioActual.CveEmpresa = 13 Then
UpDescripcionVenta.Visible = True
If CveVenta <= 0 Then
TxtDescripcionVenta.Enabled = True
End If
End If
End If
End Sub
@@ -4813,6 +4820,11 @@ Partial Class Ventas
End If
End If
If UsuarioActual.CveEmpresa = 13 Then
UpDescripcionVenta.Visible = True
TxtDescripcionVenta.Text = DbRowVenta("DescripcionVenta").ToString()
End If
HplDownXML.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", CveVenta, "XML", DbRowVenta("SerieFolio"), DbRowVenta("TipoDocto"))))
Case "Egs"
@@ -9418,22 +9430,30 @@ Partial Class Ventas
If UsuarioActual.Empresa.Funcionalidad(705) = "1" AndAlso DdlLineaAdicional.SelectedValue.ToEntero() > 0 Then
'VERIFICA QUE LA MONEDA DE LA LINEA ADICIONAL SEA LA MISMA QUE LA VENTA
If Me.CveMonedaLineaAdicional <> ObjFactura.CveMoneda Then
TmpDT = TmpDTError.Copy()
CalculaTotalesVenta(RecalcularTotalOriginal:=False)
Alert("La moneda de la linea adicional de crédito debe ser la misma que la factura.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
'VERIFICA QUE EL SALDO DISPONIBLE SEA MENOR AL IMPORTE
If ObjFactura.TipoDocto = "Rem" AndAlso Me.SaldoLineaAdicional <= ObjFactura.Total Then
TmpDT = TmpDTError.Copy()
CalculaTotalesVenta(RecalcularTotalOriginal:=False)
Alert("El saldo de la linea adicional debe ser mayor o igual al de la remisión", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If ObjFactura.TipoDocto = "Ing" AndAlso (DtRemisionesPS Is Nothing OrElse DtRemisionesPS.Rows.Count = 0) Then
TmpDT = TmpDTError.Copy()
CalculaTotalesVenta(RecalcularTotalOriginal:=False)
Alert("No se puede generar un ingreso con una linea adicional de credito si este no viene de una remisión", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If ObjFactura.TipoDocto = "Ing" AndAlso Me.SaldoIngresosLineaAdicional <= ObjFactura.Total Then
TmpDT = TmpDTError.Copy()
CalculaTotalesVenta(RecalcularTotalOriginal:=False)
Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
@@ -9775,6 +9795,24 @@ Partial Class Ventas
End If
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso ErrorList.Count = 0 AndAlso ObjFactura.TipoDocto = "Ing" Then
Dim RowVenta As DataRow = Nothing
If ObjVentas.GetVenta(ObjFactura.CveVenta, UsuarioActual.CveEmpresa, VerificaAlmacen:=False) Then
RowVenta = ObjVentas.DtResultados.Rows(0)
Else
ErrorList.Add("No se pudieron validar los datos de la venta")
End If
If RowVenta IsNot Nothing Then
'SI FUE VENTA DE CONTADO VALIDA QUE SE HAYA PAGADO EN SU TOTALIDAD
If RowVenta("CondicionesPago").ToString().ToEntero() = 0 AndAlso RowVenta("Saldo").ToString().ToDecimal() > 0.01D Then
ErrorList.Add("La venta no fue pagada en su totalidad")
End If
Else
ErrorList.Add("No se pudieron validar los datos de la venta")
End If
End If
'MARCA PARA NO SURTIR VENTA DE COTNRATO DE CONSIGNACION DE VENTA | [IPP] : PARCHE
If ErrorList.Count = 0 Then
If ObjFactura.CveVenta > 0 And CveAlmacenExistenciasContrato > 0 And DdlTipoComprobante.SelectedValue = "Ing" Then
@@ -13041,6 +13079,11 @@ Partial Class Ventas
End If
Dim DescripcionVenta As String = ""
If factura.TipoDocto = "Ing" AndAlso UsuarioActual.CveEmpresa = 13 Then
DescripcionVenta = TxtDescripcionVenta.Text
End If
If Not ObjVentas.AddVenta(factura.TipoDocto, factura.Folio, factura.CveCliente, factura.CveClienteSucursal, factura.SubTotalTC, factura.DescuentoTC,
factura.AmortizacionTC, factura.IVATC, factura.RetIVATC, factura.RetISRTC,
factura.TotalTC, factura.CveMoneda, factura.TipoCambio, factura.CveMetodoPago, factura.CondicionesPago, factura.FormaPago, factura.FechaPago, factura.Fecha, factura.MotivoDescuento,
@@ -13057,7 +13100,7 @@ Partial Class Ventas
DiasCredito:=factura.DiasCredito, EsDiasCreditoFijo:=factura.EsDiasCreditoFijo, AnticipoEspecial:=If(TrAntEspecial.Visible, ChkAntEspecial.Checked, False),
Kilometraje:=TxtKilometraje.Text.ToDouble, EsAmortizacion:=EsNCAmortizacion, CveTipoRetencion:=factura.CveTipoRetencion, CorreoNotificacion:=TxtCorreoNotificaciones.Text,
FormaPaqueteria:=RblPaqueteria.SelectedValue.ToEntero, FacturarSucursal:=factura.FacturarSucursal, VentaDesglosaIEPS:=factura.VentaDesglosaIEPS, RFCReceptor:=RFCReceptor, Adjunto:=Adjunto, DevolucionImportePagado:=factura.DevolucionImportePagado, EsGarantia:=factura.EsGarantia, ServicioDomicilio:=TrServicioDomicilio.Visible,
CveLineaAdicional:=DdlLineaAdicional.SelectedValue.ToEntero()) Then
CveLineaAdicional:=DdlLineaAdicional.SelectedValue.ToEntero(), DescripcionVenta:=DescripcionVenta) Then
ErrorList.Add("Ocurrió un error al Generar la Venta.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
Else
If factura.TipoDocto.Contiene("Dev", "Egs") OrElse DtVentasNC IsNot Nothing OrElse CveEstatusRefacturacion > 0 OrElse CveAnticipoPadre > 0 Then
@@ -22341,9 +22384,9 @@ Partial Class Ventas
CargaAnticipos(CveCliente)
End If
If CveVenta <= 0 Then
CalculaLineasAdicionales()
End If
'If CveVenta <= 0 Then
' CalculaLineasAdicionales()
'End If
End Sub
Private Sub btnBuscarPrecio_Click(sender As Object, e As EventArgs) Handles btnBuscarPrecio.Click