módulo de cobranza en PV
This commit is contained in:
289
Ventas/PVCobranza.aspx
Normal file
289
Ventas/PVCobranza.aspx
Normal file
@@ -0,0 +1,289 @@
|
|||||||
|
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PVCobranza.aspx.vb" Inherits="Ventas_PVCobranza" %>
|
||||||
|
|
||||||
|
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||||
|
<style>
|
||||||
|
|
||||||
|
.e-big-btn {
|
||||||
|
height: 50px;
|
||||||
|
width: 200px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||||
|
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||||
|
Cobranza
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||||
|
|
||||||
|
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
<div id="IdPorlet" class="portlet solid grey-cascade portlet-filter" id="PortletPadre" style="">
|
||||||
|
<div class="portlet-title portlet-filterT smalltitle " style="">
|
||||||
|
<div class="tools">
|
||||||
|
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
|
||||||
|
<a href="javascript:;" class="expand" data-placement="left"></a>
|
||||||
|
</div>
|
||||||
|
<div class="titlefiltros caption">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-1 truncate">
|
||||||
|
Sucursal:
|
||||||
|
</div>
|
||||||
|
<div class="col-md-2 ">
|
||||||
|
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-small input-sm select2me" Width="100%">
|
||||||
|
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
|
||||||
|
</asp:DropDownList>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="portlet-body" style="display: none;">
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<div class="col-md-1 truncate" title="Fecha Inicio Documento" data-toggle="tooltip" data-placement="top">
|
||||||
|
Fecha Inicio Docto:
|
||||||
|
</div>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||||
|
<asp:TextBox Width="80px" ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||||
|
<span class="input-group-btn ">
|
||||||
|
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||||
|
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||||
|
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||||
|
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-1 truncate" title="Fecha Fin Documento" data-toggle="tooltip" data-placement="top">
|
||||||
|
Fecha Fin Docto:
|
||||||
|
</div>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||||
|
<asp:TextBox Width="80px" ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||||
|
<span class="input-group-btn ">
|
||||||
|
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||||
|
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||||
|
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||||
|
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
<asp:UpdatePanel ID="UpL" runat="server" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" Width="100%"
|
||||||
|
EmptyDataText="No se encontraron Ventas con los filtros especificados" data-sort="true" ToolTip="Listado de Ventas"
|
||||||
|
CssClass="ScrollAD table table-striped table-hover Widthall" data-heighterror="320" data-freezecols="0" data-freezerows="0" GridLines="None"
|
||||||
|
DataKeyNames="CveVenta,TipoDocto,Saldo,DescripcionVenta">
|
||||||
|
<Columns>
|
||||||
|
<asp:BoundField HeaderText="Descripcion" DataField="DescripcionVenta" ItemStyle-HorizontalAlign="Center" />
|
||||||
|
<asp:BoundField HeaderText="Importe" DataField="Saldo" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
|
<asp:TemplateField HeaderText="">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:LinkButton ID="BtnPagar" runat="server" CssClass="btn btn-xs btn-success" Text="Cobrar" CommandName="Cobrar" CommandArgument='<%# Eval("CveVenta") %>' />
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
</Columns>
|
||||||
|
</asp:GridView>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<asp:Panel runat="server" ID="PnlContado" DefaultButton="BtnPagar" Visible="false" >
|
||||||
|
<div class="row">
|
||||||
|
<div class="note note-success">
|
||||||
|
<b>
|
||||||
|
Nombre:
|
||||||
|
</b>
|
||||||
|
<label><asp:Literal ID="LtlNombre" runat="server"></asp:Literal></label>
|
||||||
|
<b>
|
||||||
|
<asp:Literal ID="LtLTipoSaldo" runat="server" Text="Total:"></asp:Literal>
|
||||||
|
</b>
|
||||||
|
<asp:TextBox ID="LtlSaldo" runat="server" Enabled="true" CssClass="TextBoxAsLabel" BorderStyle="None" BackColor="Transparent" ForeColor="#3c763d" Style="text-align: left"></asp:TextBox>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div>
|
||||||
|
|
||||||
|
<div runat="server" id="DivContadoBancos" class="row" visible="True">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="chequesie1">
|
||||||
|
<div class="row">
|
||||||
|
<label class="col-md-2">Efectivo:</label>
|
||||||
|
<div class="col-md-4 input-icon">
|
||||||
|
<i style="margin: 0px;">$</i>
|
||||||
|
<asp:TextBox ID="TxtImporteEfectivo" CssClass="form-control input-sm " runat="server" MaxLength="12" Width="100px" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox>
|
||||||
|
<ajax:FilteredTextBoxExtender ID="FTBEImporteContado" runat="server" TargetControlID="TxtImporteEfectivo" FilterType="Custom, Numbers" ValidChars=".," />
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<asp:DropDownList ID="DdlCuentaEfectivo" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%"></asp:DropDownList>
|
||||||
|
<asp:CustomValidator ID="RFVCuenta" runat="server" ClientValidationFunction="ValidaCuentaEfectivo" ControlToValidate="DdlCuentaEfectivo" 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:CustomValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VCOCuenta" runat="server" HighlightCssClass="vco" TargetControlID="RFVCuenta" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="chequesie1">
|
||||||
|
<div class="row">
|
||||||
|
<label class="col-md-2">Crédito:</label>
|
||||||
|
<div class="col-md-4 input-icon">
|
||||||
|
<i style="margin: 0px;">$</i>
|
||||||
|
<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" runat="server" id="DivDdlCuentaTarjetaCredito" style="margin-right: -40px">
|
||||||
|
<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:CustomValidator ID="RequiredFieldValidator1" runat="server" ClientValidationFunction="ValidaCuentaCredito" 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:CustomValidator>
|
||||||
|
<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" style="text-align: right;">
|
||||||
|
<asp:DropDownList ID="DDlMesesSinIntereses" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="80%">
|
||||||
|
<asp:ListItem Value="-1">MSI</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 class="chequesie1">
|
||||||
|
<div class="row">
|
||||||
|
<label class="col-md-2">Débito:</label>
|
||||||
|
<div class="col-md-4 input-icon">
|
||||||
|
<i style="margin: 0px;">$</i>
|
||||||
|
<asp:TextBox ID="TxtImporteDebito" CssClass="form-control input-sm " runat="server" MaxLength="12" Width="100px" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox>
|
||||||
|
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" runat="server" TargetControlID="TxtImporteDebito" FilterType="Custom, Numbers" ValidChars=".," />
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<asp:DropDownList ID="DdlCuentaTarjetaDebito" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%"></asp:DropDownList>
|
||||||
|
<asp:CustomValidator ID="RequiredFieldValidator4" runat="server" ClientValidationFunction="ValidaCuentaDebito" ControlToValidate="DdlCuentaTarjetaDebito" 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:CustomValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender9" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator4" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="chequesie1">
|
||||||
|
<div class="row">
|
||||||
|
<label class="col-md-2">Cheque:</label>
|
||||||
|
<div class="col-md-4 input-icon">
|
||||||
|
<i style="margin: 0px;">$</i>
|
||||||
|
<asp:TextBox ID="TxtImporteCheque" CssClass="form-control input-sm " runat="server" MaxLength="12" Width="100px" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox>
|
||||||
|
<ajax:FilteredTextBoxExtender ID="FTBECheque" runat="server" TargetControlID="TxtImporteCheque" FilterType="Custom, Numbers" ValidChars=".," />
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<asp:DropDownList ID="DdlCuentaCheque" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%"></asp:DropDownList>
|
||||||
|
<asp:CustomValidator ID="RequiredFieldValidator3" runat="server" ClientValidationFunction="ValidaCuentaCheque" ControlToValidate="DdlCuentaCheque" 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:CustomValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender11" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator3" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="chequesie1" id="DivTransferencia" runat="server">
|
||||||
|
<div class="row">
|
||||||
|
<label class="col-md-2">Transf.:</label>
|
||||||
|
<div class="col-md-4 input-icon">
|
||||||
|
<i style="margin: 0px;">$</i>
|
||||||
|
<asp:TextBox ID="TxtImporteTransferencia" CssClass="form-control input-sm " runat="server" MaxLength="12" Width="100px" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox>
|
||||||
|
<ajax:FilteredTextBoxExtender ID="FTBETransferencia" runat="server" TargetControlID="TxtImporteTransferencia" FilterType="Custom, Numbers" ValidChars=".," />
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<asp:DropDownList ID="DdlCuentaTransferencia" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%"></asp:DropDownList>
|
||||||
|
<asp:CustomValidator ID="RFVTransferencia" runat="server" ClientValidationFunction="ValidaCuentaTransferencia" ControlToValidate="DdlCuentaTransferencia" 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:CustomValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VCETransferencia" runat="server" HighlightCssClass="vco" TargetControlID="RFVTransferencia" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||||
|
</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" >
|
||||||
|
<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">
|
||||||
|
<label class="col-md-2">Total:</label>
|
||||||
|
<div class="col-md-4 input-icon">
|
||||||
|
<i style="margin: 0px;">$</i>
|
||||||
|
<asp:TextBox ID="TxtImporteContado" CssClass="form-control input-sm " runat="server" MaxLength="12" Width="100px" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox>
|
||||||
|
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender3" runat="server" TargetControlID="TxtImporteContado" FilterType="Custom, Numbers" ValidChars=".," />
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<label id="lblCambio" class="col-md-2">Cambio:</label>
|
||||||
|
<div class="col-md-4 input-icon">
|
||||||
|
<i style="margin: 0px;">$</i>
|
||||||
|
<asp:TextBox ID="TxtCambio" CssClass="form-control input-sm " Enabled="false" runat="server" MaxLength="12" Width="100px" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox>
|
||||||
|
<ajax:FilteredTextBoxExtender ID="FTBECambio" runat="server" TargetControlID="TxtCambio" FilterType="Custom, Numbers" ValidChars=".," />
|
||||||
|
<br />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12" style="text-align:center;">
|
||||||
|
<asp:HiddenField ID="HdnCveVenta" runat="server" />
|
||||||
|
<asp:Button ID="BtnPagar" CssClass="btn btn-large btn-success e-big-btn" runat="server" Text="Pagar" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</asp:Panel>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||||
|
|
||||||
|
</asp:Content>
|
||||||
235
Ventas/PVCobranza.aspx.vb
Normal file
235
Ventas/PVCobranza.aspx.vb
Normal file
@@ -0,0 +1,235 @@
|
|||||||
|
Option Explicit On
|
||||||
|
Option Strict On
|
||||||
|
|
||||||
|
Imports System.Data
|
||||||
|
Imports System.Runtime.Remoting
|
||||||
|
Imports Extensiones
|
||||||
|
|
||||||
|
Partial Class Ventas_PVCobranza
|
||||||
|
Inherits ClsPaginas
|
||||||
|
|
||||||
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||||
|
If Not Page.IsPostBack Then
|
||||||
|
CargaFiltros()
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub CargaFiltros()
|
||||||
|
|
||||||
|
DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
|
||||||
|
DdlSubProyecto.DataBind()
|
||||||
|
|
||||||
|
txtFechaI.Text = Now.AddYears(-1).ToShortDateString
|
||||||
|
txtFechaF.Text = Now.ToShortDateString
|
||||||
|
|
||||||
|
'DdlCuentaEfectivo.Items.Clear()
|
||||||
|
'DdlCuentaTarjetaCredito.Items.Clear()
|
||||||
|
'DdlCuentaTarjetaDebito.Items.Clear()
|
||||||
|
'DdlCuentaCheque.Items.Clear()
|
||||||
|
'DdlCuentaTransferencia.Items.Clear()
|
||||||
|
|
||||||
|
Dim DtCC As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa)
|
||||||
|
Dim CveMon As Integer = 1
|
||||||
|
|
||||||
|
'MOSTRAR SOLO CUENTAS DE CONTADO EN BDH
|
||||||
|
'If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||||
|
DdlCuentaEfectivo.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1 AND TieneTerminal = 0", CveMon))
|
||||||
|
DdlCuentaCheque.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1 AND TieneTerminal = 0", CveMon))
|
||||||
|
'Else
|
||||||
|
' DdlCuentaEfectivo.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1", CveMon))
|
||||||
|
' DdlCuentaCheque.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1", CveMon))
|
||||||
|
'End If
|
||||||
|
|
||||||
|
'If UsuarioActual.Empresa.Funcionalidad(558) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||||
|
DdlCuentaTarjetaCredito.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1 AND TieneTerminal = 1", CveMon))
|
||||||
|
DdlCuentaTarjetaDebito.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1 AND TieneTerminal = 1", CveMon))
|
||||||
|
'Else
|
||||||
|
' DdlCuentaTarjetaCredito.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND (CveTipoCuenta <> 1 OR TieneTerminal = 1)", CveMon))
|
||||||
|
'DdlCuentaTarjetaDebito.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND (CveTipoCuenta <> 1 OR TieneTerminal = 1)", CveMon))
|
||||||
|
'End If
|
||||||
|
|
||||||
|
DdlCuentaTransferencia.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", CveMon))
|
||||||
|
|
||||||
|
DtCC.Dispose()
|
||||||
|
|
||||||
|
DdlCuentaEfectivo.DataBind()
|
||||||
|
DdlCuentaTarjetaCredito.DataBind()
|
||||||
|
DdlCuentaTarjetaDebito.DataBind()
|
||||||
|
DdlCuentaCheque.DataBind()
|
||||||
|
DdlCuentaTransferencia.DataBind()
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub CargaDatos()
|
||||||
|
|
||||||
|
Dim ObjMovtos As New ClsMovimientos()
|
||||||
|
Dim FechaI, FechaF As Date
|
||||||
|
FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim().ToDate, MinFecha)
|
||||||
|
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim().ToDate, MaxFecha).AddDays(1)
|
||||||
|
|
||||||
|
If ObjMovtos.GetCxCDetalle(FechaI, FechaF, -1, DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, -1, "-1", "-1", -1, "-1", -1,
|
||||||
|
"-1", 1, UsuarioActual.CveEmpresa, -1, 1,
|
||||||
|
TipoDocto:="Rem", FechaCorte:=NowADS.AddDays(1), CveUsuarioConsulta:=UsuarioActual.CveUsuario, AplicaAnticiposPagados:=0) Then
|
||||||
|
|
||||||
|
Dim dtt As DataTable = ObjMovtos.DSResultados.Tables(0).FiltraParametros("CveVenta > 0")
|
||||||
|
'si hay ya asignado, solo la mostrará
|
||||||
|
Dim Dtta As DataTable = dtt.FiltraParametros($"CveUsuarioCobranza = {UsuarioActual.CveUsuario}")
|
||||||
|
If Dtta IsNot Nothing AndAlso Dtta.Rows.Count > 0 Then dtt = Dtta
|
||||||
|
GvDatos.DataSource = dtt
|
||||||
|
End If
|
||||||
|
ObjMovtos.Dispose()
|
||||||
|
GvDatos.DataBind()
|
||||||
|
UpL.Update()
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||||
|
CargaDatos()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||||
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||||
|
|
||||||
|
If e.Row.DBCampo("CveUsuarioCobranza") <> "" Then
|
||||||
|
e.Row.BackColor = Drawing.ColorTranslator.FromHtml("#3598dc")
|
||||||
|
'e.Row.CssClass = "blue-madison"
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub GvDatos_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvDatos.RowCommand
|
||||||
|
If e.CommandName = "Cobrar" Then
|
||||||
|
Dim ImgBtn As LinkButton = DirectCast(e.CommandSource, LinkButton)
|
||||||
|
Dim GvRow As GridViewRow = DirectCast(ImgBtn.BindingContainer, GridViewRow)
|
||||||
|
Dim TieneError As Boolean = False
|
||||||
|
|
||||||
|
Dim CveVenta As Integer = e.CommandArgument.ToString.ToEntero
|
||||||
|
Dim ObjVentas As New ClsVentas
|
||||||
|
ObjVentas.IniciaTransacSQL()
|
||||||
|
If Not ObjVentas.UpdateAsignaVentaCobranza(CveVenta, 1, UsuarioActual.CveUsuario, -1, "", Now) Then
|
||||||
|
TieneError = True
|
||||||
|
End If
|
||||||
|
HdnCveVenta.Value = CveVenta.ToString
|
||||||
|
TxtImporteEfectivo.Text = GvRow.DataKey("Saldo")
|
||||||
|
TxtImporteEfectivo.Focus()
|
||||||
|
LtlNombre.Text = GvRow.DataKey("DescripcionVenta")
|
||||||
|
LtlSaldo.Text = GvRow.DataKey("Saldo").ToDecimal.FormatoNumero
|
||||||
|
'carga información para cobranza
|
||||||
|
|
||||||
|
If Not TieneError Then
|
||||||
|
ObjVentas.Commit()
|
||||||
|
PnlContado.Visible = True
|
||||||
|
Else
|
||||||
|
ObjVentas.RollBack()
|
||||||
|
PnlContado.Visible = False
|
||||||
|
Alert("Hubo un error al asignar datos de cobranza", TipoMensaje.MsgInformacion)
|
||||||
|
End If
|
||||||
|
|
||||||
|
ObjVentas.Dispose()
|
||||||
|
'CargaDatos()
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub BtnPagar_Click(sender As Object, e As EventArgs) Handles BtnPagar.Click
|
||||||
|
'registrar pago
|
||||||
|
|
||||||
|
'validaciones
|
||||||
|
If TxtImporteEfectivo.Text.ToDecimal + TxtImporteCredito.Text.ToDecimal + TxtImporteDebito.Text.ToDecimal + TxtImporteCheque.Text.ToDecimal = 0 Then
|
||||||
|
Alert("Favor de especificar importe", TipoMensaje.ToastAdventencia)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim CveVenta As Integer = HdnCveVenta.Value.ToEntero
|
||||||
|
Dim ObjVentas As New ClsVentas
|
||||||
|
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
|
||||||
|
Dim DbRowVenta As DataRow = ObjVentas.DtResultados.FiltroPrimero("")
|
||||||
|
|
||||||
|
Dim VentaActual As New Venta(UsuarioActual)
|
||||||
|
VentaActual.CveVenta = CveVenta
|
||||||
|
|
||||||
|
VentaActual.Fecha = DbRowVenta("Fecha").ToString.ToDate
|
||||||
|
VentaActual.CveCliente = DbRowVenta("CveCliente").ToString.ToEntero
|
||||||
|
VentaActual.CveMoneda = DbRowVenta("CveMoneda").ToString.ToEntero
|
||||||
|
VentaActual.SerieFolio = DbRowVenta("SerieFolio").ToString
|
||||||
|
VentaActual.ClienteNombre = DbRowVenta("ClienteNombre").ToString
|
||||||
|
VentaActual.TC = DbRowVenta("TipoCambio").ToString.ToDecimal
|
||||||
|
VentaActual.Total = DbRowVenta("Total").ToString.ToDecimal
|
||||||
|
VentaActual.IVA = DbRowVenta("IVA").ToString.ToDecimal
|
||||||
|
VentaActual.IEPS = DbRowVenta("IEPS").ToString.ToDecimal
|
||||||
|
VentaActual.RetIVA = DbRowVenta("RetIVA").ToString.ToDecimal
|
||||||
|
VentaActual.RetISR = DbRowVenta("RetISR").ToString.ToDecimal
|
||||||
|
|
||||||
|
VentaActual.PorcentajeIVA = DbRowVenta("PorcentajeIVA").ToString.ToDecimal
|
||||||
|
VentaActual.UsuarioActual = UsuarioActual
|
||||||
|
VentaActual.CveSubProyecto = DbRowVenta("CveSubProyecto").ToString.ToEntero
|
||||||
|
|
||||||
|
Dim ObjConta As New ClsContabilidad
|
||||||
|
Dim ObjIE As New ClsBancos(ObjConta.IniciaTransacSQL())
|
||||||
|
|
||||||
|
Dim CvePrePoliza As Integer
|
||||||
|
Dim Fecha As Date = NowADS()
|
||||||
|
Dim Mensaje As String = ""
|
||||||
|
|
||||||
|
CvePrePoliza = ObjConta.AddPrePolizas("PVCobranza", 5, 0, 0, 1, Fecha, $"Pago {VentaActual.SerieFolio}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||||
|
|
||||||
|
If CvePrePoliza > 0 Then
|
||||||
|
|
||||||
|
If TxtImporteEfectivo.Text.ToDecimal > 0 Then
|
||||||
|
Mensaje = RegistraIE(13, DdlCuentaEfectivo.SelectedValue.ToEntero, TxtImporteEfectivo.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta)
|
||||||
|
End If
|
||||||
|
If TxtImporteCredito.Text.ToDecimal > 0 Then
|
||||||
|
Mensaje = RegistraIE(12, DdlCuentaTarjetaCredito.SelectedValue.ToEntero, TxtImporteCredito.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta)
|
||||||
|
End If
|
||||||
|
If TxtImporteDebito.Text.ToDecimal > 0 Then
|
||||||
|
Mensaje = RegistraIE(11, DdlCuentaTarjetaDebito.SelectedValue.ToEntero, TxtImporteDebito.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta)
|
||||||
|
End If
|
||||||
|
If TxtImporteCheque.Text.ToDecimal > 0 Then
|
||||||
|
Mensaje = RegistraIE(3, DdlCuentaCheque.SelectedValue.ToEntero, TxtImporteCheque.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta)
|
||||||
|
End If
|
||||||
|
|
||||||
|
Else
|
||||||
|
Mensaje = "Error al registrar prepólizas"
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Mensaje = "" Then
|
||||||
|
PnlContado.Visible = False
|
||||||
|
ObjConta.Commit()
|
||||||
|
CargaDatos()
|
||||||
|
Alert("Pago Registrado correctamente.", TipoMensaje.MsgInformacion)
|
||||||
|
Else
|
||||||
|
ObjConta.RollBack()
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Function RegistraIE(Metodo As Integer, CveBancoCuenta As Integer, ImportePago As Decimal, Fecha As Date, CvePrePoliza As Integer, VentaActual As Venta, ByRef ObjIE As ClsBancos, ByRef ObjConta As ClsContabilidad) As String
|
||||||
|
Dim Retorno As String = ""
|
||||||
|
Dim CveIEPago As Integer = 0
|
||||||
|
Dim ErrorConta As Boolean
|
||||||
|
CveIEPago = ObjIE.AddBancos_IE(CveBancoCuenta, Metodo, Fecha, "-1", VentaActual.ClienteNombre, ImportePago, 1, 1, VentaActual.SerieFolio, "", False, True, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||||
|
If CveIEPago > 0 Then
|
||||||
|
Dim Pago As New VentaPago
|
||||||
|
Pago.ImportePagoVenta = ImportePago
|
||||||
|
Pago.ImportePago = ImportePago
|
||||||
|
Pago.CveIE = CveIEPago
|
||||||
|
Pago.CveMonedaPago = VentaActual.CveMoneda
|
||||||
|
Pago.Fecha = NowADS()
|
||||||
|
Pago.Referencia = VentaActual.SerieFolio
|
||||||
|
|
||||||
|
ErrorConta = AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjConta)
|
||||||
|
If ErrorConta Then
|
||||||
|
Retorno = "Error en aplicación de pago"
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
Retorno = "Pago en Bancos no registrado"
|
||||||
|
ErrorConta = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
|
End Class
|
||||||
Reference in New Issue
Block a user