This commit is contained in:
rrene
2020-10-21 14:50:03 -07:00
24 changed files with 676 additions and 324 deletions

View File

@@ -772,8 +772,8 @@ Partial Class Clientes
UpAccionesCRM.Update()
End If
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(309) Then
DeshabilitarDatosClienteCajas()
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(309) Then
DeshabilitarDatosClienteCajas()
End If
End If
@@ -845,8 +845,8 @@ Partial Class Clientes
If Request("CveEmpresaCRM") IsNot Nothing AndAlso IsNumeric(Request("CveEmpresaCRM")) AndAlso Request("CveEmpresaCRM").ToEntero > 0 Then
ViewState("CveEmpresaCRM") = Request("CveEmpresaCRM")
CargaDatosCRM()
End If
End If
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then ' Funcionalidad Es Distribuidor
DivEsDistribuidor.Visible = True
DivCargoUsado.Visible = True
@@ -912,33 +912,33 @@ Partial Class Clientes
End Function
Private Function PermiteEliminar() As Boolean
Return UsuarioActual.TienePermisoProceso(194)
End Function
Private Sub DeshabilitarDatosClienteCajas()
DdlSubProyecto.Enabled = False
DdlPrecioLista.Enabled = False
DdlClasificacion.Enabled = False
DdlVendedor.Enabled = False
DdlCorporativo.Enabled = False
ChkRequiereOC.Enabled = False
ChkEsDistribuidor.Enabled = False
DdlTipoCliente.Enabled = False
TxtCorreoEntregaCompras.Enabled = False
TxtCorreoEntregaAlmacen.Enabled = False
ChkCargoUsado.Enabled = False
ChkBonificacionUsado.Enabled = False
End Sub
End Function
Private Sub DeshabilitarDatosClienteCajas()
DdlSubProyecto.Enabled = False
DdlPrecioLista.Enabled = False
DdlClasificacion.Enabled = False
DdlVendedor.Enabled = False
DdlCorporativo.Enabled = False
ChkRequiereOC.Enabled = False
ChkEsDistribuidor.Enabled = False
DdlTipoCliente.Enabled = False
TxtCorreoEntregaCompras.Enabled = False
TxtCorreoEntregaAlmacen.Enabled = False
ChkCargoUsado.Enabled = False
ChkBonificacionUsado.Enabled = False
End Sub
#End Region
#Region "C A R G A S"
Private Sub CreaDtPago()
DtPagos = New DataTable
DtPagos.Columns.Add("CveTipoMovimiento", GetType(String))
@@ -1223,14 +1223,14 @@ Partial Class Clientes
End Sub
Private Sub CargaSubProyectoss()
'DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1).FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
Private Sub CargaSubProyectoss()
'DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1).FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
DdlSubProyecto.DataBind()
DdlSubProyecto.DataBind()
End Sub
Private Sub CargaMetodosPago()
DdlMetodoPago.DataSource = GlobalDTMetodosPago.FiltraParametros("Estatus = 'Activo'", "ClaveSAT") '.FiltraParametros("CveMetodoPago > 0 ")
@@ -1926,14 +1926,14 @@ Partial Class Clientes
GvDireccionesEnvio.DataSource = ObjClientes.DtResultados
End If
ObjClientes.Dispose()
GvDireccionesEnvio.DataBind()
If TxtRFC.Text = "XAXX010101000" Then
If GvDireccionesEnvio.HeaderRow IsNot Nothing AndAlso GvDireccionesEnvio.HeaderRow.FCLiteral("LtlNombreSucursal") IsNot Nothing Then GvDireccionesEnvio.HeaderRow.FCLiteral("LtlNombreSucursal").Text = "Cliente"
LtlNombreSucursal.Text = "Cliente"
LtlNombreSucursalTitulo.Text = "Cliente"
LtlTituloSurcusalCliente.Text = "Datos del cliente"
LtlGvSucursalesCliente.Text = "Clientes"
GvDireccionesEnvio.DataBind()
If TxtRFC.Text = "XAXX010101000" Then
If GvDireccionesEnvio.HeaderRow IsNot Nothing AndAlso GvDireccionesEnvio.HeaderRow.FCLiteral("LtlNombreSucursal") IsNot Nothing Then GvDireccionesEnvio.HeaderRow.FCLiteral("LtlNombreSucursal").Text = "Cliente"
LtlNombreSucursal.Text = "Cliente"
LtlNombreSucursalTitulo.Text = "Cliente"
LtlTituloSurcusalCliente.Text = "Datos del cliente"
LtlGvSucursalesCliente.Text = "Clientes"
End If
UpAgregarSucursal.Update()
UpDatos.Update()
@@ -2758,7 +2758,7 @@ Partial Class Clientes
'HLRemision.HRef = $"/Ventas/Ventas.aspx?CveRemision={e.Row.DBCampo("CveVenta")}"
Dim Liga As String = String.Format("< a class=""Texto"" href=""/Ventas/Ventas.aspx?CveVenta={0}"">", e.Row.DBCampo("CveVenta"))
HLSendMail.HRef = String.Format("javascript:(function mail(){{$get('HdnTipoDocto').value='{0}';$get('HdnCveVenta').value='{1}';$get('HdnFolioVenta').value='{2}';$get('TxtParaMail').value='{3}';$get('HdnSerieFolio').value='{4}';$get('HdnSubProyecto').value='{5}';$('#ModalDivMail').modal();}})();", e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("CveVenta"), e.Row.DBCampo("folio"), e.Row.DBCampo("Correo"), e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("SubProyecto"))
HLSendMail.HRef = String.Format("javascript:(function mail(){{$get('HdnTipoDocto').value='{0}';$get('HdnCveVenta').value='{1}';$get('HdnFolioVenta').value='{2}';$get('TxtParaMail').value='{3}';$get('HdnSerieFolio').value='{4}';$get('HdnSubProyecto').value='{5}';$('#ModalDivMail').modal();return false;}})();", e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("CveVenta"), e.Row.DBCampo("folio"), e.Row.DBCampo("Correo"), e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("SubProyecto"))
e.Row.FCLiteral("LtlFactura").Text = String.Format("<a class=""Texto"" href=""/Ventas/Ventas.aspx?CveVenta={0}"">{1}</a>", e.Row.DBCampo("CveVenta"), e.Row.DBCampo("Folio"))
UpSendMail.Update()
@@ -9082,7 +9082,14 @@ Partial Class Clientes
e.Row.FCCheckBox("ChkBonificacion").Visible = False
Else
e.Row.FCCheckBox("ChkBonificacion").Checked = False
e.Row.FCCheckBox("ChkBonificacion").Visible = True
'VERIFICA SI ES USADO O AJUSTE/GARANTIA
'SI ES USADO
If e.Row.DBCampo("EsUsadoAjuste") = "0" Then
e.Row.FCCheckBox("ChkBonificacion").Visible = True
'SI ES AJUSTE/GARANTIA
ElseIf e.Row.DBCampo("EsUsadoAjuste") = "1" Then
e.Row.FCCheckBox("ChkBonificacion").Visible = False
End If
End If
Else
@@ -10196,18 +10203,18 @@ Partial Class Clientes
GvPagosNoBancarios.DataBind()
End If
ObjBancos.Dispose()
End Sub
Protected Sub TxtCodigo_TextChanged(sender As Object, e As EventArgs)
If CveCliente <= 0 AndAlso UsuarioActual.CveEmpresa = 140 Then
DdlTipoCliente.SelectedValueExist("1")
ChkEsDistribuidor.Checked = True
ChkCargoUsado.Checked = True
ChkBonificacionUsado.Checked = True
End If
UpDatos.Update()
End Sub
End Sub
Protected Sub TxtCodigo_TextChanged(sender As Object, e As EventArgs)
If CveCliente <= 0 AndAlso UsuarioActual.CveEmpresa = 140 Then
DdlTipoCliente.SelectedValueExist("1")
ChkEsDistribuidor.Checked = True
ChkCargoUsado.Checked = True
ChkBonificacionUsado.Checked = True
End If
UpDatos.Update()
End Sub
End Class

View File

@@ -4671,6 +4671,15 @@ Partial Class PV
RegistraScript("$('#DivAddVenta').modal({backdrop: 'static', keyboard: false});", "EdicionVenta")
End Sub
Protected Sub LnkAgregarPS_Click(sender As Object, e As EventArgs)
If ChkAjuste.Checked Then
Dim FolioGarantia As MFolioGarantiaMensaje = ValidaFolioGarantia(DdlPSAjuste.SelectedValue.ToEntero(), DdlFolioGarantia.SelectedValue.ToEntero())
If Not FolioGarantia.Valido Then
Alert($"El folio de garantía no es valido.<br/> Clasificacion del Producto:{FolioGarantia.ClasificacionPS}.<br/>Tipo Folio:{FolioGarantia.TipoFolio}", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
If AgregarPS() Then
If ChkAjuste.Checked Then GuardaAjuste()
AddPolizaVirtual(DdlPS.SelectedValue.ToEntero())
@@ -6511,6 +6520,12 @@ Partial Class PV
UpAjuste.Update()
End If
ObjAcumuladores.Dispose()
Dim FolioGarantia As MFolioGarantiaMensaje = ValidaFolioGarantia(DdlPSAjuste.SelectedValue.ToEntero(), DdlFolioGarantia.SelectedValue.ToEntero())
If Not FolioGarantia.Valido Then
Alert($"El folio de garantía no es valido.<br/> Clasificacion del Producto:{FolioGarantia.ClasificacionPS}.<br/>Tipo Folio:{FolioGarantia.TipoFolio}", TipoMensaje.MsgAdvertencia)
End If
End Sub
#End Region
@@ -6991,4 +7006,68 @@ Partial Class PV
ImprimirPDF("Empresas/Grales/Formatos/Ajuste.rdlc", DtDatos, params, "Reporte de Ajuste", "PDF")
End Sub
Private Function ValidaFolioGarantia(CvePS As Integer, CveFolioGarantia As Integer) As MFolioGarantiaMensaje
Dim Retorno As New MFolioGarantiaMensaje
Dim Valido As Boolean = False
Dim TipoFolio As String = ""
Dim ListaClasificacionesPermitidas As New List(Of Integer)
Dim ObjAcumuladores As New ClsAcumuladores
If ObjAcumuladores.FoliosGarantiaGet(CveFolioGarantia, UsuarioActual.CveEmpresa, Area:=-1) AndAlso ObjAcumuladores.DtResultados.Rows.Count > 0 Then
Dim Row As DataRow = ObjAcumuladores.DtResultados.Rows(0)
TipoFolio = Row("tipoFolio").ToString().ToUpper()
End If
ObjAcumuladores.Dispose()
Dim CveClasificacionPS As Integer = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveClasificacion").ToEntero()
Dim ClasificacionPS As String = GlobalDTClasificaciones(CveEmpresa:=UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionPS).FiltroPrimeroValor("Clasificacion").ToString()
Select Case TipoFolio
Case "GENERAL"
'20520 ACUM. AUTOMOTRIZ
'20522 ACUM. ESPECIALES
'20513 ACUM. ESTANDAR
'20521 ACUM. PESADO
'20512 ACUM. PREMIUM
'20514 ACUM. VALUE
'20229 Acumulador
ListaClasificacionesPermitidas.Add(20520) 'ACUM. AUTOMOTRIZ
ListaClasificacionesPermitidas.Add(20522) 'ACUM. ESPECIALES
ListaClasificacionesPermitidas.Add(20513) 'ACUM. ESTANDAR
ListaClasificacionesPermitidas.Add(20521) 'ACUM. PESADO
ListaClasificacionesPermitidas.Add(20512) 'ACUM. PREMIUM
ListaClasificacionesPermitidas.Add(20514) 'ACUM. VALUE
ListaClasificacionesPermitidas.Add(20229) 'Acumulador
Case "OPTIMA"
'20511 ACUM. OPTIMA
ListaClasificacionesPermitidas.Add(20511) 'ACUM. OPTIMA
Case "MOTOBATERIA"
'20517 MOTOBATERIAS
ListaClasificacionesPermitidas.Add(20517) 'MOTOBATERIAS
End Select
If ListaClasificacionesPermitidas.Contains(CveClasificacionPS) Then
Valido = True
End If
Retorno.CvePS = CvePS
Retorno.CveFolioGarantia = CveFolioGarantia
Retorno.CveClasificacionPS = CveClasificacionPS
Retorno.ClasificacionPS = ClasificacionPS
Retorno.TipoFolio = TipoFolio
Retorno.Valido = Valido
Return Retorno
End Function
Partial Class MFolioGarantiaMensaje
Public Property CvePS As Integer
Public Property CveClasificacionPS As Integer
Public Property ClasificacionPS As String
Public Property CveFolioGarantia As Integer
Public Property TipoFolio As String
Public Property Valido As Boolean
End Class
End Class

View File

@@ -6235,8 +6235,8 @@
</div>
<div class="col-md-10">
<asp:DropDownList ID="DdlVentaUsado" runat="server" AutoPostBack="true" AppendDataBoundItems="true" DataTextField="Folio" DataValueField="CveVenta" Width="100%" CssClass="select2me" OnSelectedIndexChanged="DdlVentaUsado_SelectedIndexChanged"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVVentaUsado" runat="server" InitialValue="-1" ControlToValidate="DdlVentaUsado" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Factura''</b> es necesario, por favor ingréselo." ValidationGroup="VGAplicarRNC"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEVentaUsado" runat="server" HighlightCssClass="vco" TargetControlID="RFVVentaUsado" Width="350px"></ajax:ValidatorCalloutExtender>
<%-- <asp:RequiredFieldValidator ID="RFVVentaUsado" runat="server" InitialValue="-1" ControlToValidate="DdlVentaUsado" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Factura''</b> es necesario, por favor ingréselo." ValidationGroup="VGAplicarRNC"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEVentaUsado" runat="server" HighlightCssClass="vco" TargetControlID="RFVVentaUsado" Width="350px"></ajax:ValidatorCalloutExtender>--%>
</div>
</div>
</div>
@@ -6293,14 +6293,14 @@
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:TextBox ID="TxtImporte" CssClass="myvalue" runat="server" Width="75px" />
<asp:TextBox ID="TxtImporte" CssClass="myvalue ImportesRNCCargo" runat="server" Width="75px" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
<div class="row">
<div class="row" id="DivSMU" runat="server" visible="false">
<div class="col-md-12">
<table border="0" rules="none" class="well TextTab" style="float: right;" runat="server">
<tr align="right">

View File

@@ -2160,6 +2160,7 @@ Partial Class Ventas
'Carga Venta
If Request("CveVenta") IsNot Nothing AndAlso IsNumeric(Request("CveVenta")) AndAlso Request("CveVenta").ToEntero() > 0 Then
ViewState("CveVenta") = Request("CveVenta")
If CargaVenta() Then
'DdlSucursal.Enabled = False
@@ -2694,7 +2695,7 @@ Partial Class Ventas
TrPedido.Visible = False
' TrKilometrajeTxt.Visible = True
End If
LtlTareaNueva.Text = String.Format("<a class=""caption-subject bold font-green"" onclick=""OpenModalNewTareaUserControl(1,-1,{{CveVenta:{0}}});""> <i class=""fa fa-plus""'></i> Tarea</a>", CveVenta)
LtlTareaNueva.Text = String.Format("<a class=""caption-subject bold font-green"" onclick=""OpenModalNewTareaUserControl(1,-1,{{CveVenta:{0}}});""> <i class=""fa fa-plus""></i> Tarea</a>", CveVenta)
End If
@@ -5415,7 +5416,7 @@ Partial Class Ventas
DdlVentaUsado.DataBind()
DdlVentaUsado.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlVentaUsado.Items.Insert(0, New ListItem("No Aplica", "-1"))
UpModalRemisionesNC.Update()
End If
@@ -10190,7 +10191,7 @@ Partial Class Ventas
'PedidoA'
If ObjVentas.CveVenta > 0 And CvePedidoA > 0 And DdlTipoComprobante.SelectedValue.Contiene("Rem") Then
If Not ObjCliente.UpdateEstatusPedido(CvePedidoA, 18, -1, UsuarioActual.CveUsuario) Then
If Not ObjCliente.UpdateEstatusPedido(CvePedidoA, 18, -1, UsuarioActual.CveUsuario, CveRemision:=factura.CveVenta) Then
ErrorList.Add("Ocurrió un error al actualizar el estatus del pedidoA")
End If
End If
@@ -23118,13 +23119,19 @@ Partial Class Ventas
GvRemisionesNCBon.DataBind()
If CveVentaUsado > 0 Then
DivSMU.Visible = True
Dim FacUsado As New Modelos.Factura(UsuarioActual, CveVentaUsado, UsuarioActual.CveEmpresa)
LtlSMU.Text = String.Format("{0:N2}", FacUsado.DtDetalle.SUM("Total", "EsCargo = True").ToDecimal() + FacUsado.DtDetalle.SUM("ImporteIVA", "EsCargo = True").ToDecimal())
Dim SaldoMaximoUsados As Decimal = FacUsado.DtDetalle.SUM("Total", "EsCargo = True").ToDecimal() + FacUsado.DtDetalle.SUM("ImporteIVA", "EsCargo = True").ToDecimal()
HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString()
LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUsados)
Else
LtlSMU.Text = String.Format("{0:N2}", 0)
DivSMU.Visible = False
HdnSaldoMaximoUsados.Value = "0"
LtlSMU.Text = "0"
End If
UpModalRemisionesNC.Update()
UpDescNC.Update()
End Sub
Private Sub CargaDescRNC()
Dim DtNC As DataTable = Nothing
@@ -23320,8 +23327,8 @@ Partial Class Ventas
End Sub
Protected Sub GvRemisionesNC_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvRemisionesNC.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.FCCheckBox("ChkAplicar").Attributes.Add("onclick", $"CalculaTotalRNCChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);")
e.Row.FCTextBox("TxtImporte").Attributes.Add("onkeyup", $"LimitaCantidadRNCMasivo({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);")
e.Row.FCCheckBox("ChkAplicar").Attributes.Add("onclick", $"CalculaSaldoRNCChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);")
e.Row.FCTextBox("TxtImporte").Attributes.Add("onkeyup", $"LimitaSaldoRNCChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);")
End If
End Sub