Ventas Empresa llantera Solo mostrar ps con existencias, meses sin intereses, contado otros pagos

This commit is contained in:
Rakcsle Supertramp
2019-09-24 18:01:33 -07:00
parent e186734343
commit 9a2a463706
4 changed files with 277 additions and 48 deletions

View File

@@ -2952,13 +2952,28 @@
<asp:TextBox ID="TxtImporteCredito" CssClass="form-control input-sm " runat="server" MaxLength="12" Width="100px" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" TargetControlID="TxtImporteCredito" FilterType="Custom, Numbers" ValidChars=".," />
</div>
<div class="col-md-6">
<div class="col-md-6" runat="server" id="DivDdlCuentaTarjetaCredito" >
<asp:DropDownList ID="DdlCuentaTarjetaCredito" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="DdlCuentaTarjetaCredito" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAgregarPago"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender5" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator1" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-3" runat="server" id="DivMesesSinIntereses" visible="false">
<asp:DropDownList ID="DDlMesesSinIntereses" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%">
<asp:ListItem Value="-1">Meses</asp:ListItem>
<asp:ListItem Value="3">3M</asp:ListItem>
<asp:ListItem Value="6">6M</asp:ListItem>
<asp:ListItem Value="9">9M</asp:ListItem>
<asp:ListItem Value="12">12M</asp:ListItem>
</asp:DropDownList>
<%--<asp:RequiredFieldValidator ID="RFVDDlMesesSinIntereses" runat="server" ControlToValidate="DDlMesesSinIntereses" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />campo <b>''Meses sin intereses''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAgregarPago"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="CEDDlMesesSinIntereses" runat="server" HighlightCssClass="vco" TargetControlID="RFVDDlMesesSinIntereses" Width="300px"></ajax:ValidatorCalloutExtender>--%>
</div>
</div>
</div>
</div>
<div class="chequesie1">
<div class="row">
<label class="col-md-2">Debito:</label>
@@ -2989,7 +3004,8 @@
</div>
</div>
</div>
<div class="chequesie1">
<div class="chequesie1">
<div class="row">
<label class="col-md-2">Transf.:</label>
<div class="col-md-4 input-icon">
@@ -3004,6 +3020,47 @@
</div>
</div>
</div>
<div class="chequesie1" runat="server" id ="DivContadoOtros" visible="false">
<div class="row">
<div class="col-md-2">
<asp:DropDownList runat="server" ID="DdlOtroFormaPago" ClientIDMode="Static" AutoPostBack="true" OnSelectedIndexChanged="DdlOtroFormaPago_SelectedIndexChanged">
<asp:ListItem Value="-1">Otros</asp:ListItem>
<asp:ListItem Value="1">Credito</asp:ListItem>
<asp:ListItem Value="2">Debito</asp:ListItem>
<asp:ListItem Value="3">Cheque</asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-4 input-icon">
<i style="margin: 0px;">$</i>
<asp:TextBox ID="TxtImporteOtrosContado" CssClass="form-control input-sm " runat="server" MaxLength="12" Width="100px" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FETxtImporteOtrosContado" runat="server" TargetControlID="TxtImporteOtrosContado" FilterType="Custom, Numbers" ValidChars=".," />
</div>
<div class="col-md-6" runat="server" id="DivContadoOtrosCuenta" >
<asp:DropDownList ID="DdlCuentaOtrosContado" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator12" runat="server" ControlToValidate="DdlCuentaTarjetaCredito" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAgregarPago"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender24" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator1" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-3" runat="server" id="DivMesesSinIntereses2" visible="false">
<asp:DropDownList ID="DdlMesesSinIntereses2" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%">
<asp:ListItem Value="-1">Meses</asp:ListItem>
<asp:ListItem Value="3">3M</asp:ListItem>
<asp:ListItem Value="6">6M</asp:ListItem>
<asp:ListItem Value="9">9M</asp:ListItem>
<asp:ListItem Value="12">12M</asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
<div class="chequesie2">
<div class="row">
<div class="col-md-6">
@@ -3021,6 +3078,12 @@
</div>
</div>
</div>
</div>
</div>
@@ -6620,7 +6683,18 @@
var totalDebito = ToDouble($get("TxtImporteDebito").value);
var totalCheque = ToDouble($get("TxtImporteCheque").value);
var totalTransferencia = ToDouble($get("TxtImporteTransferencia").value);
var total = totalEfectivo + totalCredito + totalDebito + totalCheque + totalTransferencia;
var TotalOtrosContado = 0;
try{
if ($('#DdlOtroFormaPago').val() != "-1") {
TotalOtrosContado = ToDouble($get("TxtImporteOtrosContado").value);
}
} catch (e) {}
var total = totalEfectivo + totalCredito + totalDebito + totalCheque + totalTransferencia + TotalOtrosContado;
$get("TxtImporteContado").value = total;
}

View File

@@ -1802,7 +1802,10 @@ Partial Class Ventas
TxtImporteDebito.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();")
TxtImporteCheque.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();")
TxtImporteTransferencia.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();")
TxtImporteOtrosContado.Attributes.Add("onKeyUp", "CalculaTotalPagoContado();")
TxtEfectivoEnCaja.Attributes.Add("onKeyUp", "CalculaDiferencia();")
'ImgCerrarTerminoCorte.Attributes.Add("OnClick", "$('#DivTerminarCorte').hide();")
'ImgCerrarIE.Attributes.Add("OnClick", "$('#DivIngresoEgreso').hide();")DdlTipoComprobante
'ImgCerrarEstadoCaja.Attributes.Add("OnClick", "$('#DivEstadoCaja').hide();")
@@ -1907,6 +1910,8 @@ Partial Class Ventas
CargaOrdenProduccion()
End If
'Carga Venta
If Request("CveVenta") IsNot Nothing AndAlso IsNumeric(Request("CveVenta")) AndAlso Request("CveVenta").ToEntero > 0 Then
ViewState("CveVenta") = Request("CveVenta")
@@ -2422,6 +2427,16 @@ Partial Class Ventas
End If
End If
If UsuarioActual.Empresa.Funcionalidad(558).ToEntero = 1 Then
DivMesesSinIntereses.Visible = True
DivDdlCuentaTarjetaCredito.Attributes.Add("class", "col-md-3")
DivContadoOtros.Visible = True
End If
End If
''EN REALIDAD SE OCUPAN ESTAS COSAS DENTRO DEL POSTABCK ???
@@ -10090,7 +10105,7 @@ Partial Class Ventas
Exit For
End If
CveIEPago = ObjBancos.AddBancos_IE(DrPago("CveCuenta").ToString.ToEntero, DrPago("CveTipoMovimiento").ToString.ToEntero, Fecha, FolioIE.ToString, String.Format("PAGO: {0}", TxtFolio.Text), DrPago("Importe").ToString.ToDouble, DdlMoneda.SelectedValue.ToEntero, tipoCambio, DrPago("Observaciones").ToString, "", False, False, -1, ObjFactura.CvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=CveCorte)
CveIEPago = ObjBancos.AddBancos_IE(DrPago("CveCuenta").ToString.ToEntero, DrPago("CveTipoMovimiento").ToString.ToEntero, Fecha, FolioIE.ToString, String.Format("PAGO: {0}", TxtFolio.Text), DrPago("Importe").ToString.ToDouble, DdlMoneda.SelectedValue.ToEntero, tipoCambio, DrPago("Observaciones").ToString, "", False, False, -1, ObjFactura.CvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=CveCorte, MesesSinIntereses:=DrPago("MesesSinIntereses").ToString.ToEntero)
If CveIEPago > 0 Then
@@ -16095,6 +16110,7 @@ Partial Class Ventas
DtPagos.Columns.Add("Observaciones", GetType(String))
DtPagos.Columns.Add("Tipo", GetType(String))
DtPagos.Columns.Add("CveMetodoPago", GetType(Integer))
DtPagos.Columns.Add("MesesSinIntereses", GetType(Integer))
CargaCuentas()
@@ -16108,6 +16124,8 @@ Partial Class Ventas
TxtImporteCheque.Text = "0.00"
TxtImporteTransferencia.Text = "0.00"
TxtImporteContado.Text = "0.00"
TxtImporteOtrosContado.Text = "0.00"
End Sub
Private Sub LimpiaEscondeContado()
'LIMPIA
@@ -16156,6 +16174,39 @@ Partial Class Ventas
DdlCuentaTransferencia.DataBind()
End Sub
Protected Sub DdlOtroFormaPago_SelectedIndexChanged(sender As Object, e As EventArgs)
DivContadoOtrosCuenta.Attributes.Add("class", "col-md-6")
DivMesesSinIntereses2.Visible = False
Select Case DdlOtroFormaPago.SelectedValue.ToEntero
Case 1
DivContadoOtrosCuenta.Attributes.Add("class", "col-md-3")
DivMesesSinIntereses2.Visible = True
DdlCuentaOtrosContado.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(DdlMoneda.SelectedValue.ToEntero <= 0, 1, DdlMoneda.SelectedValue.ToEntero)))
Exit Select
Case 2
DdlCuentaOtrosContado.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(DdlMoneda.SelectedValue.ToEntero <= 0, 1, DdlMoneda.SelectedValue.ToEntero)))
Exit Select
Case 3
DdlCuentaOtrosContado.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1", If(DdlMoneda.SelectedValue.ToEntero <= 0, 1, DdlMoneda.SelectedValue.ToEntero)))
Exit Select
Case -1
DdlCuentaOtrosContado.DataSource = Nothing
Exit Select
End Select
DdlCuentaOtrosContado.DataBind()
UpContado.Update()
End Sub
'DdlOtroFormaPago
Private Function CargaFolioContado(CveCuenta As Integer, TipoTransaccion As Integer) As Long
Dim Folio As Long
@@ -16211,6 +16262,8 @@ Partial Class Ventas
DrEfectivo("Observaciones") = ""
DrEfectivo("Tipo") = "Caja Chica"
DrEfectivo("CveMetodoPago") = 1
DrEfectivo("MesesSinIntereses") = -1
DtPagos.Rows.Add(DrEfectivo)
Else
Alert("Debe seleccionar una cuenta válida de caja", TipoMensaje.MsgAdvertencia)
@@ -16219,6 +16272,7 @@ Partial Class Ventas
'Pago Tarjeta Credito
If TxtImporteCredito.Text.ToDecimal > 0 Then
If DdlCuentaTarjetaCredito.Items.Count > 0 Then
Dim DrCredito = DtPagos.NewRow
DrCredito("CveTipoMovimiento") = 12
@@ -16230,10 +16284,20 @@ Partial Class Ventas
DrCredito("Observaciones") = ""
DrCredito("Tipo") = "Tarjeta de Crédito"
DrCredito("CveMetodoPago") = 4
If UsuarioActual.Empresa.Funcionalidad(558).ToEntero = 1 Then
DrCredito("MesesSinIntereses") = DDlMesesSinIntereses.SelectedValue.ToEntero
Else
DrCredito("MesesSinIntereses") = -1
End If
DtPagos.Rows.Add(DrCredito)
Else
Alert("Debe seleccionar una cuenta válida de crédito", TipoMensaje.MsgAdvertencia)
End If
End If
'Pago Tarjeta Debito
@@ -16249,6 +16313,7 @@ Partial Class Ventas
DrDebito("Observaciones") = ""
DrDebito("Tipo") = "Tarjeta de Débito"
DrDebito("CveMetodoPago") = 5
DrDebito("MesesSinIntereses") = -1
DtPagos.Rows.Add(DrDebito)
Else
@@ -16269,6 +16334,7 @@ Partial Class Ventas
DrCheque("Observaciones") = ""
DrCheque("Tipo") = "Cheque"
DrCheque("CveMetodoPago") = 2
DrCheque("MesesSinIntereses") = -1
DtPagos.Rows.Add(DrCheque)
Else
@@ -16289,6 +16355,7 @@ Partial Class Ventas
DrCheque("Observaciones") = ""
DrCheque("Tipo") = "Transferencia"
DrCheque("CveMetodoPago") = 3
DrCheque("MesesSinIntereses") = -1
DtPagos.Rows.Add(DrCheque)
Else
@@ -16296,6 +16363,82 @@ Partial Class Ventas
End If
End If
'Otro Metodo de pago
Select Case DdlOtroFormaPago.SelectedValue.ToEntero
Case -1
Exit Select
Case 1
If TxtImporteOtrosContado.Text.ToDecimal > 0 Then
If DdlCuentaOtrosContado.Items.Count > 0 Then
Dim DrCredito = DtPagos.NewRow
DrCredito("CveTipoMovimiento") = 12
DrCredito("TipoMovimiento") = "Tarjeta de Crédito"
DrCredito("CveCuenta") = DdlCuentaOtrosContado.SelectedValue
DrCredito("Cuenta") = DdlCuentaOtrosContado.SelectedItem.Text
DrCredito("Importe") = TxtImporteOtrosContado.Text
DrCredito("Folio") = CargaFolioContado(DdlCuentaOtrosContado.SelectedValue.ToEntero, 12)
DrCredito("Observaciones") = ""
DrCredito("Tipo") = "Tarjeta de Crédito"
DrCredito("CveMetodoPago") = 4
If UsuarioActual.Empresa.Funcionalidad(558).ToEntero = 1 Then
DrCredito("MesesSinIntereses") = DdlMesesSinIntereses2.SelectedValue.ToEntero
Else
DrCredito("MesesSinIntereses") = -1
End If
DtPagos.Rows.Add(DrCredito)
Else
Alert("Debe seleccionar una cuenta válida de crédito( Otra condición de pago)", TipoMensaje.MsgAdvertencia)
End If
End If
Exit Select
Case 2
If TxtImporteOtrosContado.Text.ToDecimal > 0 Then
If DdlCuentaOtrosContado.Items.Count > 0 Then
Dim DrDebito = DtPagos.NewRow
DrDebito("CveTipoMovimiento") = 11
DrDebito("TipoMovimiento") = "Tarjeta de Debito"
DrDebito("CveCuenta") = DdlCuentaOtrosContado.SelectedValue
DrDebito("Cuenta") = DdlCuentaOtrosContado.SelectedItem.Text
DrDebito("Importe") = TxtImporteOtrosContado.Text
DrDebito("Folio") = CargaFolioContado(DdlCuentaOtrosContado.SelectedValue.ToEntero, 11)
DrDebito("Observaciones") = ""
DrDebito("Tipo") = "Tarjeta de Débito"
DrDebito("CveMetodoPago") = 5
DrDebito("MesesSinIntereses") = -1
DtPagos.Rows.Add(DrDebito)
Else
Alert("Debe seleccionar una cuenta válida de débito( Otra condición de pago)", TipoMensaje.MsgAdvertencia)
End If
End If
Exit Select
Case 3
If TxtImporteOtrosContado.Text.ToDecimal > 0 Then
If DdlCuentaOtrosContado.Items.Count > 0 Then
Dim DrCheque = DtPagos.NewRow
DrCheque("CveTipoMovimiento") = 3
DrCheque("TipoMovimiento") = "Cheque"
DrCheque("CveCuenta") = DdlCuentaOtrosContado.SelectedValue
DrCheque("Cuenta") = DdlCuentaOtrosContado.SelectedItem.Text
DrCheque("Importe") = TxtImporteOtrosContado.Text
DrCheque("Folio") = CargaFolioContado(DdlCuentaOtrosContado.SelectedValue.ToEntero, 3)
DrCheque("Observaciones") = ""
DrCheque("Tipo") = "Cheque"
DrCheque("CveMetodoPago") = 2
DrCheque("MesesSinIntereses") = -1
DtPagos.Rows.Add(DrCheque)
Else
Alert("Debe seleccionar una cuenta de cheque( Otra condición de pago)", TipoMensaje.MsgAdvertencia)
End If
End If
Exit Select
End Select
'JJMQ 20160506: Validacion para no pagar de mas a peticion de I.P.
abonado = DtPagos.SUM("Importe")
saldo = TxtTotal.Text.Replace(",", "").ToDouble - abonado
@@ -22763,4 +22906,5 @@ Partial Class Ventas
#End Region
End Class