This commit is contained in:
2022-08-12 11:04:58 -07:00
54 changed files with 3442 additions and 2300 deletions

View File

@@ -689,6 +689,13 @@
<label for="<%= DdlTipoCliente.ClientID.ToString()%>">Tipo de Cliente:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivRepresentanteLegal" runat="server" visible="false">
<asp:TextBox runat="server" ID="TxtRepresentanteLegal" CssClass="form-control" MaxLength="100" />
<label for="<%= TxtRepresentanteLegal.ClientID.ToString()%>">Representante Legal:</label>
</div>
<div class="row">
<div runat="server" id="DivEsDistribuidor" visible="false" class="col-md-4 form-group form-md-line-input input-iconright">

View File

@@ -751,6 +751,10 @@ Partial Class Clientes
If UsuarioActual.Empresa.Funcionalidad(350).Contiene("1", "2") Then
divRegimen.Visible = True
End If
If UsuarioActual.CveEmpresa.Contiene(1) Or UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
DivRepresentanteLegal.Visible = True
End If
If Request("CveCliente") IsNot Nothing AndAlso IsNumeric(Request("CveCliente")) AndAlso Request("CveCliente").ToEntero() > 0 Then
@@ -1873,6 +1877,8 @@ Partial Class Clientes
RdTipoPersona.SelectedValue = If(ObjClientes.TipoPersona, "1", "0")
RdTipoPersona_SelectedIndexChanged(Nothing, Nothing)
TxtRepresentanteLegal.Text = ObjClientes.RepresentanteLegal
End If
UpActivacionPortal.Update()
UpModalPersonaFisica.Update()
@@ -2686,7 +2692,7 @@ Partial Class Clientes
CvePais:=DdlPais.SelectedValue.ToEntero(), CveEstado:=DdlEstado.SelectedValue.ToEntero(), CveMunicipio:=DdlMunicipio.SelectedValue.ToEntero(), CveColonia:=DdlColonia.SelectedValue.ToEntero(), CveMotivoTraslado:=IIf(DdlMotivoTraslado.SelectedValue = "-1", "0", DdlMotivoTraslado.SelectedValue).ToString().ToEntero(), NumRegIdTrib:=IIf(TxtNumRegIdTrib.Text = "", "-1", TxtNumRegIdTrib.Text).ToString(),
ComExtEstado:=IIf(TxtComExtEstado.Text = "", "-1", TxtComExtEstado.Text).ToString(), ComExtMunicipio:=IIf(TxtComExtMunicipio.Text = "", "-1", TxtComExtMunicipio.Text).ToString(), ComExtColonia:=IIf(TxtComExtColonia.Text = "", "-1", TxtComExtColonia.Text).ToString(), RequiereOC:=ChkRequiereOC.Checked, LT:=LT, LG:=LG, EsDistribuidor:=ChkEsDistribuidor.Checked,
TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero(), CargoUsado:=ChkCargoUsado.Checked, BonificacionUsado:=ChkBonificacionUsado.Checked, CveTipoRetencion:=DdlTipoRetencion.SelectedValue.ToEntero(), CorreoEntregaCompras:=TxtCorreoEntregaCompras.Text, CorreoEntregaAlmacen:=TxtCorreoEntregaAlmacen.Text, CveSATEstado:=DdlEstadoSAT.SelectedValue.ToEntero(), CveAdminTrayecto:=If(DdlAdminTrayecto.SelectedValue.ToEntero() <= 0, 0, DdlAdminTrayecto.SelectedValue.ToEntero()),
CveRegimenFiscal:=DdlRegimenFiscal.SelectedValue.ToEntero, RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona) Then
CveRegimenFiscal:=DdlRegimenFiscal.SelectedValue.ToEntero, RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona, RepresentanteLegal:=TxtRepresentanteLegal.Text) Then
ViewState("CveCliente") = ObjClientes.CveCliente
@@ -2783,7 +2789,7 @@ Partial Class Clientes
ApellidoPaternoPF:=IIf(TxtApellidoPaterno.Text = "", "-1", TxtApellidoPaterno.Text).ToString(), ApellidoMaternoPF:=IIf(TxtApellidoMaterno.Text = "", "-1", TxtApellidoMaterno.Text).ToString(), NombresPF:=IIf(TxtNombres.Text = "", "-1", TxtNombres.Text).ToString(),
RequiereOC:=ChkRequiereOC.Checked, LT:=LT, LG:=LG, EsDistribuidor:=ChkEsDistribuidor.Checked, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero(), CargoUsado:=ChkCargoUsado.Checked, BonificacionUsado:=ChkBonificacionUsado.Checked, CveTipoRetencion:=DdlTipoRetencion.SelectedValue.ToEntero(), CorreoEntregaCompras:=TxtCorreoEntregaCompras.Text, CorreoEntregaAlmacen:=TxtCorreoEntregaAlmacen.Text, CveSATEstado:=DdlEstadoSAT.SelectedValue.ToEntero(),
CveAdminTrayecto:=If(DdlAdminTrayecto.SelectedValue.ToEntero() <= 0, 0, DdlAdminTrayecto.SelectedValue.ToEntero()),
NoDesglosaIVA:=ChkNoDesglosaIVA.Checked, CveRegimenFiscal:=DdlRegimenFiscal.SelectedValue.ToEntero, RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona) Then
NoDesglosaIVA:=ChkNoDesglosaIVA.Checked, CveRegimenFiscal:=DdlRegimenFiscal.SelectedValue.ToEntero, RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona, RepresentanteLegal:=TxtRepresentanteLegal.Text) Then
ObjClientes.LimpiaImpuestosLocales(CveCliente)
@@ -4210,8 +4216,22 @@ Partial Class Clientes
<br />
Gracias por la atención brindada al presente.<br /> Reciba un cordial saludo.<br />
<br />
<b>ESTE CORREO SE GENERO EN FORMA AUTOMATICA.</b>", TxtNombreComercial.Text, UsuarioActual.Empresa.Empresa)
Dim Hilo As New System.Threading.Thread(Sub() MandaCorreoEstadoCuenta(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Me.CveCliente, File, TxtCobranzaCorreo.Text, $"Estado Actual de Cartera {UsuarioActual.Empresa.Empresa}", Cuerpo, GuardarBitacora:=True))
<b>ESTE CORREO SE GENERO EN FORMA AUTOMATICA.</b>", TxtNombreComercial.Text, UsuarioActual.Empresa.Empresa)
If UsuarioActual.CveEmpresa = 140 Then
Cuerpo = String.Format("Estimado cliente <u>{0}</u>, se anexa su estado de cuenta con adeudo actual en {1}.<br />
<br />
Quedamos a sus ordenes para cualquier duda o aclaración: con su asesor comercial, al teléfono celular del área de Crédito y Cobranza 6624 52 99 64 o a los correos:<br /><br />
credito@bdhbaterias.com<br />
cobranza@bdhbaterias.com<br />
<br />
Gracias por la atención brindada al presente.<br />
Reciba un cordial saludo.<br />
<br />
<b>ESTE CORREO SE GENERO EN FORMA AUTOMATICA, FAVOR DE NO RESPONDERLO.</b>", TxtNombreComercial.Text, UsuarioActual.Empresa.Empresa)
End If
Dim Hilo As New System.Threading.Thread(Sub() MandaCorreoEstadoCuenta(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Me.CveCliente, File, TxtCobranzaCorreo.Text, $"Estado Actual de Cartera en {UsuarioActual.Empresa.Empresa}", Cuerpo, GuardarBitacora:=True))
Hilo.Start()
Alert("El correo se envió con éxito", TipoMensaje.MsgInformacion)
Catch ex As Exception
@@ -7475,7 +7495,10 @@ Partial Class Clientes
Tags.Add(New TagsDocumentos("{DireccionAval}", TxtDireccionAval.Text))
Tags.Add(New TagsDocumentos("{CiudadAval}", TxtCiudadAval.Text))
Tags.Add(New TagsDocumentos("{TelefonoAval}", TxtTelefonoAval.Text))
Tags.Add(New TagsDocumentos("{RepresentanteLegal}", TxtRepresentanteLegal.Text))
If Not ObjClientes.AddClientePagare(CveCliente, UsuarioActual.CveEmpresa, TxtAval.Text, TxtDireccionAval.Text) Then
Alert("no se pudo registrar el pagare")
Exit Sub

View File

@@ -693,7 +693,7 @@
if (textBoxes[i].value != '') {
idd = textBoxes[i].id.replace('C_GvCxC_TxtAbonar_', '');
Ventas = Ventas + (Importe == 0 ? '' : ', ') + $get("C_GvCxC_HplF_" + idd).innerText;
abono = parseFloat(textBoxes[i].value.split(',').join(''));
abono = ToDouble(textBoxes[i].value);
moneda = $get("C_GvCxC_LtlMoneda_" + idd).innerText;
if (monedaPago == 1 && moneda == 'USD') {
@@ -708,7 +708,7 @@
}
if (textBoxes[i].id.indexOf('C_GvCxC_TxtComision') >= 0) {
if (textBoxes[i].value != '') {
abonoComision = parseFloat(textBoxes[i].value.split(',').join(''));
abonoComision = ToDouble(textBoxes[i].value);
moneda = $get("C_GvCxC_LtlMoneda_" + idd).innerText;
if (monedaPago == 1 && moneda == 'USD') {
facDolares = true
@@ -954,6 +954,7 @@
let Total = 0.0;
let Anticipos = 0.0;
debugger;
$( ClsSelLiqVenta).each(function () {
@@ -966,11 +967,10 @@
});
Total = Total + Anticipos;
Total = Total + Anticipos;
$(ClsSelLiqVentaTotal).each(function () {
$(this).val(Total);
$(this).val(Total.toFixed(2));
FormatoMoneda2($(this));
});
@@ -979,6 +979,7 @@
var Suma = SumaValores(pagoMultiple, monedaPago);
$get('TxtImporte').value = FormatoNumero(Suma, 2);
}
function disablekeys()

View File

@@ -1070,8 +1070,10 @@ Partial Class Ventas_ClientesAbonar
If gvr.FCDropDownList("DdlAnti").SelectedValue.ToEntero > 0 Then
Dim TCP As Decimal = 0
Dim FolioPago As String = " "
If DtIngresos IsNot Nothing Then
TCP = DtIngresos.FiltroPrimeroValor("TipoCambio", String.Format("CveIE={0}", gvr.FCDropDownList("DdlAnti").SelectedValue))
FolioPago = DtIngresos.FiltroPrimeroValor("Folio", String.Format("CveIE={0}", gvr.FCDropDownList("DdlAnti2").SelectedValue))
Dim tTCPFecha As Date = DtIngresos.FiltroPrimeroValor("FechaDocumento", String.Format("CveIE={0}", gvr.FCDropDownList("DdlAnti").SelectedValue)).ToDate
'considera fluctuación
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
@@ -1083,13 +1085,15 @@ Partial Class Ventas_ClientesAbonar
End If
'se calcula la fluctuación de la aplicación del anticipo, para sumarla en el concepto de fluctuación más abajo
FluctuacionAnticipo = ((TCP - tipoCambioVentaValuacion) * gvr.FCTextBox("TxtAmort").Text.ToDecimal).RoundSQL
MsgError = RegistraAmortizacionAnticipo(ObjMov, CvePrePoliza, gvr.FCDropDownList("DdlAnti").SelectedValue.ToEntero, gvr.FCTextBox("TxtAmort").Text.ToDecimal, TCP, tipoCambioVentaValuacion, gvr.DataKey("SerieFolio").ToString)
MsgError = RegistraAmortizacionAnticipo(ObjMov, CvePrePoliza, gvr.FCDropDownList("DdlAnti").SelectedValue.ToEntero, gvr.FCTextBox("TxtAmort").Text.ToDecimal, TCP, tipoCambioVentaValuacion, gvr.DataKey("CveVenta").ToEntero, gvr.DataKey("SerieFolio").ToString, FolioPago)
End If
If gvr.FCDropDownList("DdlAnti2").SelectedValue.ToEntero > 0 Then
Dim TCP As Decimal = 0
Dim FolioPago As String = " "
If DtIngresos IsNot Nothing Then
TCP = DtIngresos.FiltroPrimeroValor("TipoCambio", String.Format("CveIE={0}", gvr.FCDropDownList("DdlAnti2").SelectedValue))
FolioPago = DtIngresos.FiltroPrimeroValor("Folio", String.Format("CveIE={0}", gvr.FCDropDownList("DdlAnti2").SelectedValue))
Dim tTCPFecha As Date = DtIngresos.FiltroPrimeroValor("FechaDocumento", String.Format("CveIE={0}", gvr.FCDropDownList("DdlAnti2").SelectedValue)).ToDate
'considera fluctuación
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
@@ -1102,7 +1106,7 @@ Partial Class Ventas_ClientesAbonar
End If
'se calcula la fluctuación de la aplicación del anticipo, para sumarla en el concepto de fluctuación más abajo
FluctuacionAnticipo += ((TCP - tipoCambioVentaValuacion) * gvr.FCTextBox("TxtAmort2").Text.ToDecimal).RoundSQL
MsgError = RegistraAmortizacionAnticipo(ObjMov, CvePrePoliza, gvr.FCDropDownList("DdlAnti2").SelectedValue.ToEntero, gvr.FCTextBox("TxtAmort2").Text.ToDecimal, TCP, tipoCambioVentaValuacion, gvr.DataKey("SerieFolio").ToString)
MsgError = RegistraAmortizacionAnticipo(ObjMov, CvePrePoliza, gvr.FCDropDownList("DdlAnti2").SelectedValue.ToEntero, gvr.FCTextBox("TxtAmort2").Text.ToDecimal, TCP, tipoCambioVentaValuacion, gvr.DataKey("CveVenta").ToEntero, gvr.DataKey("SerieFolio").ToString, FolioPago)
End If
End If
@@ -1500,7 +1504,7 @@ Partial Class Ventas_ClientesAbonar
If RblTipoPago.SelectedValue = "3" AndAlso MsgError = "" Then
MsgError = RegistraAmortizacionAnticipo(ObjMov, CvePrePoliza, CveIE, TxtImporte.Text.ToDecimal, tipoCambioPago, tipoCambioVenta, TxtObservaciones.Text)
MsgError = RegistraAmortizacionAnticipo(ObjMov, CvePrePoliza, CveIE, TxtImporte.Text.ToDecimal, tipoCambioPago, tipoCambioVenta, -1, TxtObservaciones.Text, DdlIngreso.SelectedItem.Text)
End If
@@ -1696,33 +1700,21 @@ Partial Class Ventas_ClientesAbonar
End Sub
Private Function RegistraAmortizacionAnticipo(ByRef ObjMov As ClsContabilidad, CvePrePoliza As Integer, CveIE As Integer, Importe As Decimal, tipoCambioPago As Decimal, tipoCambioVenta As Decimal, Referencia As String) As String
Private Function RegistraAmortizacionAnticipo(ByRef ObjMov As ClsContabilidad, CvePrePoliza As Integer, CveIE As Integer, Importe As Decimal, tipoCambioPago As Decimal, tipoCambioVenta As Decimal, CveVenta As Integer, ReferenciaVenta As String, ReferenciaPago As String) As String
Dim MsgError As String = ""
If CveMonedaPago = 2 Then
'rmf faltan las cuentas
'If CveMonedaPago = 2 AndAlso CveMonedaFiltro = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES
' tipoCambioPago = TxtTCDolares.Text.ToDecimal
'ElseIf CveMonedaPago = 2 AndAlso CveMonedaFiltro = 2 Then
' tipoCambioPago = TxtTCDolaresDolares.Text.ToDecimal
'End If
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, Importe, TxtObservaciones.Text, 92, Referencia, TxtFechaDocumento.Text, IdCtaContMonedaExtranjeraAnticipo, -1, CveIE, -1, -1, -1, CveCliente, ImporteMX:=Importe, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, Importe, ReferenciaVenta, 92, ReferenciaVenta, TxtFechaDocumento.Text, IdCtaContMonedaExtranjeraAnticipo, -1, CveIE, CveCliente:=CveCliente, ImporteMX:=Importe, CveVenta:=CveVenta, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then
MsgError = "No se pudo insertar la póliza"
End If
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, If(CveMoneda = 1 AndAlso TxtTC.Visible, Importe / TxtTC.Text.ToDecimal, Importe), Referencia, 227, TxtObservaciones.Text + If(TxtTC.Visible, $" TC:{TxtTC.Text}", If(CveMoneda = 2, $" TC:{tipoCambioPago}", "")), TxtFechaDocumento.Text, IdCtaContMonedaComplementariaAnticipo, -1, CveIE, -1, -1, -1, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=If(CveMoneda = 2, (Importe * tipoCambioPago) - Importe, Importe), ImporteME:=If(CveMoneda = 2, Importe, 0), TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, If(CveMoneda = 1 AndAlso TxtTC.Visible, Importe / TxtTC.Text.ToDecimal, Importe), ReferenciaVenta, 227, TxtObservaciones.Text + If(TxtTC.Visible, $" TC:{TxtTC.Text}", If(CveMoneda = 2, $" TC:{tipoCambioPago}", "")), TxtFechaDocumento.Text, IdCtaContMonedaComplementariaAnticipo, -1, CveIE, CveCliente:=ViewState("CveCliente").ToString.ToEntero, ImporteMX:=If(CveMoneda = 2, (Importe * tipoCambioPago) - Importe, Importe), ImporteME:=If(CveMoneda = 2, Importe, 0), CveVenta:=CveVenta, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then
MsgError = "No se pudo insertar la póliza"
End If
Else
'If CveMoneda = 2 AndAlso CveMonedaFiltro = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES
' tipoCambioPago = TxtTCDolares.Text.ToDecimal
'ElseIf CveMoneda = 2 AndAlso CveMonedaFiltro = 2 Then
' tipoCambioPago = TxtTCDolaresDolares.Text.ToDecimal
'End If
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, Importe, TxtObservaciones.Text, 92, TxtObservaciones.Text + If(CveMoneda = 2, $" TC:{tipoCambioPago}", ""), TxtFechaDocumento.Text, IdCtaAnticipo, -1, CveIE, -1, -1, -1, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=If(CveMoneda = 2, Importe * tipoCambioPago, Importe), ImporteME:=If(CveMoneda = 2, Importe, 0), TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, Importe, ReferenciaVenta, 92, ReferenciaVenta, TxtFechaDocumento.Text, IdCtaAnticipo, -1, CveIE, CveCliente:=ViewState("CveCliente").ToString.ToEntero, ImporteMX:=If(CveMoneda = 2, Importe * tipoCambioPago, Importe), ImporteME:=If(CveMoneda = 2, Importe, 0), CveVenta:=CveVenta, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then
MsgError = "No se pudo insertar la póliza"
End If
End If

View File

@@ -182,6 +182,9 @@ Partial Class Ventas_RepProductosServiciosDetalle
End Sub
Private Sub SetValues()
txtFechaI.Text = Now.ToShortDateString
txtFechaF.Text = Now.ToShortDateString
'Cargo Proyectos
DdlProyecto.DataSource = GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1)
DdlProyecto.DataBind()

View File

@@ -72,7 +72,7 @@
<li>
<asp:HyperLink NavigateUrl="#" data-toggle="modal" data-target="#DivPersonalizar" ID="ImgPersonalizar" runat="server"> <i class="fa fa-pencil"></i> Personalizar</asp:HyperLink>
</li>
</ContentTemplate>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpLnkHP" runat="server" UpdateMode="Conditional">
<ContentTemplate>
@@ -89,7 +89,15 @@
<li>
<asp:LinkButton ID="LnkVerGrafica" OnClick="LnkVerGrafica_Click" runat="server"><i class="fa fa-signal"></i> Ver Grafica</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkDescargaCartaPorte" OnClick="LnkDescargaCartaPorte_Click" runat="server" Visible="false"> <i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Descarga Carta Porte</asp:LinkButton>
</li>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkDescargaCartaPorte" />
</Triggers>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">

View File

@@ -120,6 +120,11 @@ Partial Class Ventas_RepVentas
DdlVendedor.Attributes.Add("disabled", "disabled")
DdlVendedor.Enabled = False
End If
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then
LnkDescargaCartaPorte.Visible = True
End If
End If
End Sub
@@ -936,4 +941,26 @@ Partial Class Ventas_RepVentas
Context.Response.End()
End Sub
Protected Sub LnkDescargaCartaPorte_Click(sender As Object, e As EventArgs)
Dim ObjVentas As New ClsVentas
Dim DTDataos As New DataTable
Dim CveSubProyectos As String = If(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM)
If ObjVentas.GetListadoCartaPorteRep(txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, CveSubProyectos, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
DTDataos = ObjVentas.DtResultados
End If
ObjVentas.Dispose()
DTDataos.ExportToExcel("RepCartasPorte.xls")
End Sub
End Class

View File

@@ -4426,7 +4426,7 @@ Partial Class Ventas
End If
If DbRowVenta IsNot Nothing Then
If ObjVentas.GetVentasRelacionadas(CveVenta, UsuarioActual.CveEmpresa) Then
If ObjVentas.GetVentasRelacionadas(CveVenta, 1, UsuarioActual.CveEmpresa) Then
DtAntRelacionados = ObjVentas.DtResultados.FiltraParametros("TipoDocto IN ('Ing','Ant','Egs','Dev')")
End If