-
This commit is contained in:
@@ -2601,16 +2601,27 @@ Partial Class Clientes
|
||||
If tPagare = 0 Then InformacionCompleta = False
|
||||
|
||||
End If
|
||||
If TxtContacto.Text.Trim() = "" Then InformacionCompleta = False
|
||||
|
||||
If TxtTelefono.Text.Trim() = "" Then InformacionCompleta = False
|
||||
If TxtEmail.Text.Trim() = "" Then InformacionCompleta = False
|
||||
If TxtRepresentanteLegal.Text.Trim() = "" Then InformacionCompleta = False
|
||||
|
||||
tPagare = 0 'valida que cuando menos tenga una cuenta
|
||||
For Each dRow As GridViewRow In GvBancosCuentas.Rows
|
||||
tPagare = 1
|
||||
Next
|
||||
If tPagare = 0 Then InformacionCompleta = False
|
||||
'SOLO VALIDA EN CLIENTES FRENCUENTE
|
||||
If DdlTipoCliente.SelectedValue = "1" Then
|
||||
If TxtContacto.Text.Trim() = "" Then InformacionCompleta = False
|
||||
If TxtRepresentanteLegal.Text.Trim() = "" Then InformacionCompleta = False
|
||||
'si es el concepto de pagaré
|
||||
Dim tPagare As Integer = 0
|
||||
For Each dRow As GridViewRow In GvDocumentosCliente.Rows
|
||||
Dim CveDocumentacion As Integer = dRow.DataKey("CveDocumentacion").ToEntero()
|
||||
If CveDocumentacion = 265 Then tPagare = 1
|
||||
Next
|
||||
If tPagare = 0 Then InformacionCompleta = False
|
||||
tPagare = 0 'valida que cuando menos tenga una cuenta
|
||||
For Each dRow As GridViewRow In GvBancosCuentas.Rows
|
||||
tPagare = 1
|
||||
Next
|
||||
If tPagare = 0 Then InformacionCompleta = False
|
||||
End If
|
||||
|
||||
'If DivInfoCompleta.Visible Then
|
||||
' InformacionCompleta = ChkInformacionCompleta.Checked
|
||||
|
||||
@@ -706,7 +706,7 @@
|
||||
<asp:CheckBox ID="ChkSobFaltante" runat="server" ClientIDMode="Static" />
|
||||
<div class="input-icon" style="margin-left: 20px;">
|
||||
<i style="margin: 0px;">$</i>
|
||||
<asp:TextBox ID="TxtFaltante" CssClass="form-control input-sm " runat="server" MaxLength="12" Width="100px" ClientIDMode="Static" Style="text-align: right; font-size: 14px;"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtFaltante" CssClass="form-control input-sm" onkeyup="ValidaSobranteFaltante()" runat="server" MaxLength="12" Width="100px" ClientIDMode="Static" Style="text-align: right; font-size: 14px;"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender4" runat="server" TargetControlID="TxtCambio" FilterType="Custom, Numbers" ValidChars=".," />
|
||||
</div>
|
||||
</div>
|
||||
@@ -1591,7 +1591,7 @@
|
||||
} else {
|
||||
$get("TxtFaltante").value = FormatoNumero(cambio);
|
||||
$get("ChkSobFaltante").checked = true;
|
||||
$get("TxtCambio").value = FormatoNumero(cambio);
|
||||
$get("TxtCambio").value = "";
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -1617,15 +1617,26 @@
|
||||
$('#C_LblDiferenciaCajaBloqueo').val(FormatoNumero(total));
|
||||
}
|
||||
|
||||
function ValidaSobranteFaltante() {
|
||||
if (ToDouble($get("TxtFaltante").value) > 1) {
|
||||
alert("El sobrante/faltante no debe ser mayor a 1");
|
||||
$get("TxtFaltante").value = "";
|
||||
$get("ChkSobFaltante").checked = false;
|
||||
} else {
|
||||
$get("ChkSobFaltante").checked = true;
|
||||
}
|
||||
}
|
||||
|
||||
function CargaSobranteFaltante() {
|
||||
$('#ChkSobFaltante').change(function () {
|
||||
if (this.checked == true) {
|
||||
if (ToDouble($get("TxtCambio").value) > 1) {
|
||||
alert("El sobrante/faltante no debe ser mayor a 1")
|
||||
$get("ChkSobFaltante").checked = false;
|
||||
} else {
|
||||
$get("TxtFaltante").value = $get("TxtCambio").value;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
$get("TxtFaltante").value = "";
|
||||
|
||||
@@ -607,6 +607,11 @@ Partial Class Ventas_PVCobranza
|
||||
Alert("No hay importe para sobrante/faltante", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
Else
|
||||
If TxtFaltante.Text.ToDecimal() <> 0 Then
|
||||
Alert("No debe especificar sobrante/faltante", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
'validaciones
|
||||
@@ -1024,12 +1029,12 @@ Partial Class Ventas_PVCobranza
|
||||
|
||||
If respFactura IsNot Nothing AndAlso respFactura.Factura IsNot Nothing AndAlso respFactura.Factura.DtAnticiposAplicados IsNot Nothing Then
|
||||
For Each dr As DataRow In respFactura.Factura.DtAnticiposAplicados.Rows
|
||||
msBuild.AppendLine($"<br><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=AMORTIZACIONHIS&CVEIE={0}&CVEVENTA={1}&CVECLIENTE={2}&CVEVENTAAMORTIZADA={3}&MONTO={4}",
|
||||
msBuild.AppendLine($"<br><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=AMORTIZACIONHIS&CVEIE={0}&CVEVENTA={1}&CVECLIENTE={2}&CVEVENTAAMORTIZADA={3}&MONTO={4}&TIPO={5}",
|
||||
dr("CveIE").ToString,
|
||||
dr("CveVenta").ToString,
|
||||
respFactura.Factura.CveCliente,
|
||||
respFactura.CveVenta,
|
||||
respFactura.Factura.Total))}"">Imprimir Saldo Aplicado {dr("Folio").ToString}</a><br/>")
|
||||
respFactura.Factura.Total, dr("Tipo")))}"">Imprimir Saldo Aplicado {dr("Folio").ToString}</a><br/>")
|
||||
Next
|
||||
End If
|
||||
|
||||
@@ -1064,12 +1069,12 @@ Partial Class Ventas_PVCobranza
|
||||
|
||||
If respNC IsNot Nothing AndAlso respNC.Factura IsNot Nothing AndAlso respNC.Factura.DtAnticiposAplicados IsNot Nothing Then
|
||||
For Each dr As DataRow In respNC.Factura.DtAnticiposAplicados.Rows
|
||||
msBuild.AppendLine($"<br><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=AMORTIZACIONHIS&CVEIE={0}&CVEVENTA={1}&CVECLIENTE={2}&CVEVENTAAMORTIZADA={3}&MONTO={4}",
|
||||
msBuild.AppendLine($"<br><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=AMORTIZACIONHIS&CVEIE={0}&CVEVENTA={1}&CVECLIENTE={2}&CVEVENTAAMORTIZADA={3}&MONTO={4}&Tipo={5}",
|
||||
dr("CveIE").ToString,
|
||||
dr("CveVenta").ToString,
|
||||
respNC.Factura.CveCliente,
|
||||
respNC.CveVenta,
|
||||
respNC.Factura.Total))}"">Imprimir Saldo Aplicado {dr("Folio").ToString}</a><br/>")
|
||||
respNC.Factura.Total, dr("Tipo")))}"">Imprimir Saldo Aplicado {dr("Folio").ToString}</a><br/>")
|
||||
Next
|
||||
End If
|
||||
|
||||
@@ -1444,22 +1449,6 @@ Partial Class Ventas_PVCobranza
|
||||
For Each msg In Retorno.Mensajes
|
||||
SbAlert.AppendFormat("{0} <br/>", msg)
|
||||
Next
|
||||
|
||||
SbAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF Factura</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", Retorno.CveVenta)))
|
||||
|
||||
For Each dr As DataRow In DtAnticipos.Rows
|
||||
SBAmortizaciones.AppendLine($"<br><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=AMORTIZACIONHIS&CVEIE={0}&CVEVENTA={1}&CVECLIENTE={2}&CVEVENTAAMORTIZADA={3}&MONTO={4}&SALDO={5}",
|
||||
dr("CveIE").ToString,
|
||||
dr("CveVenta").ToString,
|
||||
Retorno.Factura.CveCliente,
|
||||
Retorno.CveVenta,
|
||||
Retorno.Factura.Total,
|
||||
(Retorno.Factura.Total - Retorno.Factura.DtAnticiposAplicados.SUM("Importe"))))}"">Imprimir historial {dr("Folio").ToString}</a><br/>")
|
||||
Next
|
||||
|
||||
|
||||
SbAlert.Append(SBAmortizaciones.ToString)
|
||||
|
||||
Else
|
||||
SbAlert.Append("Ocurrió un error al generar la factura")
|
||||
End If
|
||||
@@ -1601,7 +1590,6 @@ Partial Class Ventas_PVCobranza
|
||||
Dim Importe = GvRowAnticipo.FCTextBox(String.Format("TxtAnticipo{0}", GvRowAnticipo.RowIndex)).Text.ToDecimal()
|
||||
Dim CveConceptoContable = GvRowAnticipo.DataKey("CveConceptoContable").ToEntero()
|
||||
|
||||
|
||||
Dim FolioFiscal = GvRowAnticipo.DataKey("FolioFiscal")
|
||||
Dim Descuentos As Decimal = GvRowAnticipo.DataKey("Descuentos").ToDecimal()
|
||||
Dim TotalAnticipo As Decimal = GvRowAnticipo.DataKey("TotalAnticipo").ToDecimal()
|
||||
@@ -1612,8 +1600,10 @@ Partial Class Ventas_PVCobranza
|
||||
Dim Folio = GvRowAnticipo.DataKey("Folio")
|
||||
Dim Tipo = GvRowAnticipo.DataKey("Tipo")
|
||||
|
||||
|
||||
DtAnticipos.Rows.Add(CveVenta, Importe, CveConceptoContable, CveIE, FolioFiscal, Descuentos, TotalAnticipo, SubTotalAnticipo, CveMoneda, Fecha, TipoCambioPago, Folio, Tipo)
|
||||
|
||||
ObjNC.Observaciones = $"Folio: {GvRowAnticipo.DataKey("Folio")}"
|
||||
|
||||
End If
|
||||
|
||||
ObjNC.EsNCAmortizacion = True
|
||||
@@ -1708,12 +1698,14 @@ Partial Class Ventas_PVCobranza
|
||||
'METER LO QUE FALTA COMO GASTO
|
||||
If (ImporteBancos.RoundSQL(2) + Math.Abs(SobranteFaltante)) = ImporteAbonoVenta.RoundSQL(2) Then
|
||||
Pago.OtroGastoIngreso = SobranteFaltante.ToString().ToDecimal()
|
||||
'LIMPIAR SOBRANTE/FALTANTE
|
||||
SobranteFaltante = 0
|
||||
|
||||
'SUMAR AL PAGO
|
||||
If ImporteBancos < ImporteAbonoVenta Then
|
||||
ImporteBancos += Math.Abs(SobranteFaltante)
|
||||
End If
|
||||
|
||||
'LIMPIAR SOBRANTE/FALTANTE
|
||||
SobranteFaltante = 0
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -2469,9 +2461,9 @@ Partial Class Ventas_PVCobranza
|
||||
|
||||
Dim AnticipoAutorizado = CBool(e.Row.DBCampo("AnticipoAutorizado"))
|
||||
|
||||
'If Not EsProduccion AndAlso UsuarioActual.CveRol = 1 Then
|
||||
' AnticipoAutorizado = True
|
||||
'End If
|
||||
If Not EsProduccion AndAlso UsuarioActual.CveRol = 1 Then
|
||||
AnticipoAutorizado = True
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(185) = "1" Then
|
||||
If e.Row.DBCampo("Tipo").ToString().Contiene("NC", "Ant", "IxC") AndAlso Not AnticipoAutorizado Then
|
||||
|
||||
@@ -5255,7 +5255,7 @@ Partial Class Ventas
|
||||
If TienePermiso <> "" Then ' si tiene acceso en el subproyecto
|
||||
'LkNotaCredito.Visible = UsuarioActual.TienePermisoProceso(175)
|
||||
If UsuarioActual.TienePermisoProceso(264) Then
|
||||
InicializaAplicaDevolucion(TmpDT)
|
||||
InicializaAplicaDevolucion(TmpDT, DbRowVenta("Fecha").ToString().ToDateTime())
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -32863,7 +32863,7 @@ Partial Class Ventas
|
||||
#End Region
|
||||
|
||||
#Region " APLICA DEVOLUCION "
|
||||
Private Sub InicializaAplicaDevolucion(DtDetalle As DataTable)
|
||||
Private Sub InicializaAplicaDevolucion(DtDetalle As DataTable, FechaVenta As DateTime)
|
||||
'If Not UsuarioActual.CveUsuario = 100 Then
|
||||
' If Not UsuarioActual.CveEmpresa.Contiene(72, 80, 119, 140, 141, 146) Then
|
||||
' Exit Sub
|
||||
@@ -32875,7 +32875,17 @@ Partial Class Ventas
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
LBAplicaDevolucion.Visible = True
|
||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||
If FechaVenta.ToShortDateString.ToDate < Now.ToShortDateString.ToDate Then
|
||||
LBAplicaDevolucion.Visible = True
|
||||
Else
|
||||
LBAplicaDevolucion.Visible = False
|
||||
End If
|
||||
Else
|
||||
LBAplicaDevolucion.Visible = True
|
||||
End If
|
||||
|
||||
|
||||
|
||||
'SOLO APLICA DEVOLUCION SI TIENE MOVIMIENTOS DE ALMACEN
|
||||
'If VentaSaldoAlmacen < 0 Then
|
||||
|
||||
Reference in New Issue
Block a user