Commit inicial Ventas Productivo
This commit is contained in:
38
Presupuestos/Generacion.aspx
Normal file
38
Presupuestos/Generacion.aspx
Normal file
@@ -0,0 +1,38 @@
|
||||
<%@ Page Title="Presupuestos" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Generacion.aspx.vb" Inherits="Presupuestos_Generacion" %>
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="H" Runat="Server">
|
||||
<asp:ImageButton ID="ImgImprimir" runat="server" ImageUrl="/Imagenes/btnImprimir.gif" Width="17px" Height="17px" Enabled="false" />
|
||||
<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" Width="17px" Height="17px" />
|
||||
<asp:Image ID="ImgPersonalizar" runat="server" ImageUrl="/Imagenes/Table-icon.png" Width="17px" Height="17px" Style="cursor:pointer;" />
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="E" Runat="Server">
|
||||
Generación de Presupuestos
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="C" Runat="Server">
|
||||
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<br />
|
||||
<table border="1" rules="all" style="border-collapse:collapse;">
|
||||
<tr>
|
||||
<td>Partida</td>
|
||||
<td>
|
||||
<asp:DropDownList ID="DropDownList1" runat="server" AppendDataBoundItems="true" DataTextField="EstatusFactura" DataValueField="CveEstatusFactura" Width="150px">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Selected="False" Text="Diesel" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Selected="False" Text="Refacciones" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Selected="False" Text="Fletes" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Selected="False" Text="Nómina" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</td>
|
||||
<td>Cantidad</td>
|
||||
<td><asp:TextBox ID="TxtCantidad" runat="server"></asp:TextBox></td>
|
||||
<td>Monto</td>
|
||||
<td><asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></td>
|
||||
<td><asp:Button ID="CmdAgregar" runat="server" Text="Agregar" /></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</asp:Content>
|
||||
5
Presupuestos/Generacion.aspx.vb
Normal file
5
Presupuestos/Generacion.aspx.vb
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
Partial Class Presupuestos_Generacion
|
||||
Inherits System.Web.UI.Page
|
||||
|
||||
End Class
|
||||
705
Presupuestos/GenerarPresupuestos.aspx
Normal file
705
Presupuestos/GenerarPresupuestos.aspx
Normal file
@@ -0,0 +1,705 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="GenerarPresupuestos.aspx.vb" Inherits="Presupuestos_GenerarPresupuestos" %>
|
||||
|
||||
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="E" runat="Server">
|
||||
Generar Presupuestos
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server">
|
||||
<script type="text/javascript" src="../Scripts/funciones.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
function RecalculaCosto(id, Formula, hdnTB, hdnFm) {
|
||||
var total = parseFloat($get('LblCostoDirecto').innerText.replace(",", ""));
|
||||
|
||||
var desc = $get(Formula).value;
|
||||
if (desc > 0 && total > 0) {
|
||||
desc = (desc / 100);
|
||||
$get(id).value = FormatNumber((desc * total), 2, true, true, true);
|
||||
|
||||
$get(hdnTB).value = (desc * total);
|
||||
$get(hdnFm).value = $get(Formula).value;
|
||||
|
||||
}
|
||||
SumaConceptos();
|
||||
}
|
||||
|
||||
function RecalculaCosto2(id, Formula, hdnTB, hdnFm) {
|
||||
var total = parseFloat($get('LblCostoDirecto').innerText.replace(",", ""));
|
||||
var desc = $get(id).value * 100;
|
||||
if (desc > 0 && total > 0) {
|
||||
|
||||
|
||||
$get(Formula).value = FormatNumber((desc / total), 2, true, true, true);
|
||||
$get(hdnTB).value = (desc / total);
|
||||
$get(hdnFm).value = $get(Formula).value;
|
||||
}
|
||||
SumaConceptos();
|
||||
}
|
||||
|
||||
function CostoHerramienta(num) {
|
||||
if (num.value <= 100) {
|
||||
|
||||
var costo =parseFloat( '<%= TotalMO %>');
|
||||
var porcentaje = parseFloat($get('tbHPorcentaje').value) / 100;
|
||||
|
||||
var total = parseFloat('<%= TotalMO + TotalM %>');
|
||||
|
||||
costo = parseFloat(costo * porcentaje);
|
||||
total += parseFloat(costo);
|
||||
$get('LblCostoDirecto').innerText = FormatNumber(total,2,true,true,true);
|
||||
$get('hdnImporte').value = total;
|
||||
$get('lbHImporte').innerHTML = costo.toFixed(2);
|
||||
$get('hdnHImporte').value = costo;
|
||||
Recalculatodo();
|
||||
SumaConceptos();
|
||||
|
||||
} else {
|
||||
|
||||
num.value = 0;
|
||||
var total = parseFloat('<%= TotalMO + TotalM %>');
|
||||
$get('hdnImporte').value = total;
|
||||
$get('LblCostoDirecto').innerText = total;
|
||||
|
||||
}
|
||||
}
|
||||
function SumaConceptos() {
|
||||
|
||||
debugger;
|
||||
var total = parseFloat($get('LblCostoDirecto').innerText.replace(",", ""));
|
||||
$('.sumConcepto').each(function (index, value) {
|
||||
var val = value.value;
|
||||
total += parseFloat(val.replace(",", ""));
|
||||
//total += $(this).find('input').val();
|
||||
|
||||
debugger;
|
||||
});
|
||||
$get('LblTotalConceptos').innerText = total.toFixed(2);
|
||||
}
|
||||
|
||||
function Recalculatodo() {
|
||||
var list = $(document.getElementsByClassName('Porcentajes'));
|
||||
var list2 = $(document.getElementsByClassName('sumConcepto'));
|
||||
var costo = parseFloat($get('LblCostoDirecto').innerText.replace(",", ""));
|
||||
|
||||
$('.sumConcepto').each(function (index, value) {
|
||||
var val = value.value;
|
||||
var por = parseFloat(list[index].value) / 100;
|
||||
total = por * costo;
|
||||
$(this).val(FormatNumber(total,2,true,true,true));
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
<div style="margin-bottom: 2%;" class="SubTotales">
|
||||
<table width="100%" border="0" cellpadding="2" cellspacing="5" >
|
||||
<tr>
|
||||
<td align="right" width="10%"><b>Presupuesto:</b></td>
|
||||
<td width="27%">
|
||||
<asp:TextBox ID="tbPresupuesto" runat="server" Width="90%"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator runat="server" ID="RFVtbPresupuesto" ControlToValidate="tbPresupuesto" ValidationGroup="GrpGuardar" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Presupuesto''</b> es necesario, por favor ingrése una." Display="Dynamic" Text="*"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEtbPresupuesto" runat="server" HighlightCssClass="vco" TargetControlID="RFVtbPresupuesto" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</td>
|
||||
<td width="8%" align="right">
|
||||
<b>Unidad: </b>
|
||||
</td>
|
||||
<td width="20%">
|
||||
<asp:DropDownList ID="ddlPUM" runat="server" DataValueField="CveUnidadMedida"
|
||||
Width="90%" DataTextField="UnidadMedida">
|
||||
</asp:DropDownList>
|
||||
</td>
|
||||
|
||||
<td width="10%" align="right">
|
||||
<b>Fecha: </b>
|
||||
</td>
|
||||
<td width="30%">
|
||||
<asp:TextBox ID="TxtFecha" runat="server" CausesValidation="true" MaxLength="10" Onblur="Recalculafechapago();" ValidationGroup="GrpGuardar" Width="68px" Style="vertical-align: middle;"></asp:TextBox>
|
||||
<asp:ImageButton runat="server" ID="ImgFecha" ImageUrl="/Imagenes/calendar.png" ImageAlign="AbsMiddle" Width="16px" Height="16px" AlternateText="Click para ver el Calendario" />
|
||||
<ajax:MaskedEditExtender ID="MEEFecha" runat="server" TargetControlID="TxtFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CEFecha" TargetControlID="TxtFecha" PopupButtonID="ImgFecha" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVFecha" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOFecha1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFecha" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<asp:Button ID="btnprueba" runat="server" Text="prueba" />
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">
|
||||
<b>Concepto: </b>
|
||||
</td>
|
||||
<td align="left">
|
||||
<asp:DropDownList ID="ddlPPS" runat="server" DataValueField="CvePS" DataTextField="PS" Width="90%" Height="16px"></asp:DropDownList>
|
||||
<ajax:ListSearchExtender ID="ListSearchExtender2" runat="server" TargetControlID="ddlPPS" PromptCssClass="Titulos" PromptText="Escriba el Producto o Servicio." QueryPattern="Contains" PromptPosition="Top" IsSorted="TRUE" QueryTimeout="0"></ajax:ListSearchExtender>
|
||||
|
||||
</td>
|
||||
<td align="right"><b>Cliente:</b></td>
|
||||
<td>
|
||||
<asp:DropDownList ID="ddlCliente" runat="server" AppendDataBoundItems="true" DataTextField="Nombre" DataValueField="CveCliente" Width="90%">
|
||||
<asp:ListItem Text="Seleccione Cliente" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</td>
|
||||
<td align="right">
|
||||
<b>Prospecto: </b>
|
||||
</td>
|
||||
<td>
|
||||
<asp:DropDownList ID="ddlProspecto" runat="server" AppendDataBoundItems="true" DataTextField="NombreCompleto" DataValueField="CveProspecto" Width="90%">
|
||||
<asp:ListItem Text="Seleccione Prospecto" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
|
||||
</td>
|
||||
<td><asp:Button ID="btnGuardarP" runat="server" ValidationGroup="GrpGuardar" Text="Guardar"
|
||||
ToolTip="Guarda el presupuesto." />
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<ajax:TabContainer ID="Tab" runat="server" ActiveTabIndex="0" Width="100%">
|
||||
<ajax:TabPanel ID="TabPP" runat="server" HeaderText="Presupuesto Base">
|
||||
|
||||
|
||||
<ContentTemplate>
|
||||
|
||||
|
||||
<div class="cont" style="float: left; width: 73%; margin-left: 1%; min-height: 900px; ">
|
||||
<div id="DivMat" class="div1" runat="server">
|
||||
<table width="100%" border="1" cellpadding="0" cellspacing="0">
|
||||
<tr class="Titulos">
|
||||
<td colspan="8">Material </td>
|
||||
</tr>
|
||||
<tr class="Titulos">
|
||||
<td width="5%">#</td>
|
||||
<td width="34%">Descripción</td>
|
||||
<td width="14%">Unidad</td>
|
||||
<td width="10%">Cantidad</td>
|
||||
<td width="10%">P.U.</td>
|
||||
<td width="10%">Descuento</td>
|
||||
<td width="10%">Importe</td>
|
||||
<td width="7%"></td>
|
||||
</tr>
|
||||
<tr align="center">
|
||||
|
||||
<td width="5%">
|
||||
<asp:Label ID="lbConsec" runat="server"></asp:Label></td>
|
||||
<td width="34%">
|
||||
<asp:DropDownList ID="ddlPS" runat="server" Width="95%" DataTextField="PS" AutoPostBack="true" DataValueField="CvePS">
|
||||
</asp:DropDownList>
|
||||
<ajax:ListSearchExtender ID="LSEPS" runat="server" TargetControlID="ddlPS" PromptCssClass="Titulos" PromptText="Escriba el Producto o Servicio." QueryPattern="Contains" PromptPosition="Top" IsSorted="TRUE" QueryTimeout="0"></ajax:ListSearchExtender>
|
||||
|
||||
</td>
|
||||
<td width="14%">
|
||||
<asp:DropDownList ID="ddlUM" runat="server" Width="90%" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida"></asp:DropDownList>
|
||||
<ajax:ListSearchExtender ID="LSEddlUM" runat="server" TargetControlID="ddlUM" PromptCssClass="Titulos" PromptText="Escriba U.M." QueryPattern="Contains" PromptPosition="Top" IsSorted="TRUE" QueryTimeout="0"></ajax:ListSearchExtender>
|
||||
|
||||
</td>
|
||||
<td width="10%">
|
||||
<asp:TextBox ID="tbCantidad" runat="server" Width="90%" Style="text-align: right;"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server"
|
||||
TargetControlID="tbCantidad"
|
||||
FilterType="Custom, Numbers"
|
||||
ValidChars=".," />
|
||||
<asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator1" ControlToValidate="tbCantidad"
|
||||
ValidationGroup="GrAdd"
|
||||
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario, por favor ingrése una." Display="none" Text=""></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator1" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
|
||||
</td>
|
||||
<td width="10%">
|
||||
<asp:TextBox ID="tbPrecio" runat="server" Width="90%" Style="text-align:center;" > </asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender4" runat="server"
|
||||
TargetControlID="tbPrecio"
|
||||
FilterType="Custom, Numbers"
|
||||
ValidChars=".," />
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
<td width="10%">
|
||||
<asp:TextBox ID="tbDesc" runat="server" Width="87%" Style="text-align: right;"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FTBtbDesc" runat="server"
|
||||
TargetControlID="tbDesc"
|
||||
FilterType="Custom, Numbers"
|
||||
ValidChars=".," />
|
||||
<asp:RangeValidator
|
||||
ID="RVtbDesc"
|
||||
ControlToValidate="tbDesc"
|
||||
MinimumValue="0"
|
||||
MaximumValue="100"
|
||||
Type="Double"
|
||||
ValidationGroup="GrpGuardar"
|
||||
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />Ingrese valores entre 0 - 100 en el campo <b>''Descuento''</b>." Display="none"
|
||||
runat="server" />
|
||||
<ajax:ValidatorCalloutExtender ID="VCEtbDesc" runat="server" HighlightCssClass="vco" TargetControlID="RVtbDesc" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</td>
|
||||
<td width="10%"> </td>
|
||||
<td width="7%">
|
||||
<asp:ImageButton ID="ImgBtnAddPS" runat="server" ValidationGroup="GrAdd" ImageUrl="~/Imagenes/Btn_Add.png" />
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<asp:UpdatePanel ID="UDPMaterial" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvMat" runat="server" CssClass="tabla_correcto" EmptyDataText="Aun no hay registros."
|
||||
AutoGenerateColumns="False" ShowFooter="True" ShowHeader="false" ClientIDMode="Static"
|
||||
Width="100%" HeaderStyle-CssClass="Titulos" FooterStyle-CssClass="SubTotales2">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="#" >
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbConsec" runat="server" Text='<%#Eval("Consec")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="5%" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Descripción" >
|
||||
<ItemTemplate >
|
||||
<asp:Label ID="lbPS" runat="server" Text='<%#Eval("PS") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="34%" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Unidad">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbUM" runat="server" Text='<%#Eval("UM")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="14%" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Cantidad">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbCantidad" runat="server" Style="text-align: right;" Text='<%#Eval("Cantidad","{0:N2}")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="10%" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbPU" runat="server" Style="text-align: right;" Text='<%#Eval("PU", "{0:N2}")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="10%" />
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Descuento">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbDesc" runat="server" Text='<%# Eval("Descuento", "{0:N2}%")%>' Style="text-align: right;"></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="10%" />
|
||||
<FooterTemplate>
|
||||
<asp:Label ID="lbTotalTM" runat="server" Style="text-align: right;" Text="Total:"></asp:Label></FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Importe">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbImporte" runat="server" Text='<%# Eval("Importe", "{0:N2}")%>' Style="text-align: right;"></asp:Label>
|
||||
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="10%" />
|
||||
<FooterTemplate>
|
||||
<asp:Label ID="lbTotalImporte" runat="server" />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="">
|
||||
<ItemTemplate>
|
||||
<asp:ImageButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" ImageUrl="/Imagenes/Btn_Delete.png" OnClientClick="return confirm('¿Estas seguro que desea eliminar?');" />
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="7%"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
|
||||
|
||||
<table width="100%" border="1" cellpadding="0" cellspacing="0">
|
||||
<tr class="Titulos">
|
||||
<td colspan="8">Mano de Obra </td>
|
||||
</tr>
|
||||
<tr class="Titulos">
|
||||
<td width="5%">#</td>
|
||||
<td width="34%">Descripción</td>
|
||||
<td width="14%">Unidad</td>
|
||||
<td width="10%">Cantidad</td>
|
||||
<td width="10%">P.U.</td>
|
||||
<td width="10%">Descuento</td>
|
||||
<td width="10%">Importe</td>
|
||||
|
||||
<td width="7%"></td>
|
||||
</tr>
|
||||
<tr align="center">
|
||||
|
||||
<td width="5%">
|
||||
<asp:Label ID="lbMOConsec" runat="server"></asp:Label></td>
|
||||
<td width="34%">
|
||||
<asp:DropDownList ID="ddlMOPS" runat="server" Width="95%" DataTextField="PS" AutoPostBack="true" DataValueField="CvePS">
|
||||
</asp:DropDownList>
|
||||
<ajax:ListSearchExtender ID="ListSearchExtender1" runat="server" TargetControlID="ddlMOPS" PromptCssClass="Titulos" PromptText="Escriba el Producto o Servicio." QueryPattern="Contains" PromptPosition="Top" IsSorted="TRUE" QueryTimeout="0"></ajax:ListSearchExtender>
|
||||
|
||||
</td>
|
||||
<td width="14%">
|
||||
<asp:DropDownList ID="ddlMOUnidad" runat="server" Width="90%" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida"></asp:DropDownList>
|
||||
<ajax:ListSearchExtender ID="LSEMOUnidad" runat="server" TargetControlID="ddlMOUnidad" PromptCssClass="Titulos" PromptText="Escriba U.M." QueryPattern="Contains" PromptPosition="Top" IsSorted="TRUE" QueryTimeout="0"></ajax:ListSearchExtender>
|
||||
|
||||
</td>
|
||||
<td width="10%">
|
||||
<asp:TextBox ID="tbMOCantidad" runat="server" Width="90%" Style="text-align: right;"></asp:TextBox>
|
||||
|
||||
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" runat="server"
|
||||
TargetControlID="tbMOCantidad"
|
||||
FilterType="Custom, Numbers"
|
||||
ValidChars=".," />
|
||||
<asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator2" ControlToValidate="tbMOCantidad"
|
||||
ValidationGroup="GrAdd2"
|
||||
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario, por favor ingrése una." Display="None"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator2" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
|
||||
</td>
|
||||
<td width="10%"> <asp:TextBox ID="tbPrecioMO" runat="server" Width="90%" Style="text-align:center;" > </asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender5" runat="server"
|
||||
TargetControlID="tbPrecioMO"
|
||||
FilterType="Custom, Numbers"
|
||||
ValidChars=".," /></td>
|
||||
<td width="10%">
|
||||
<asp:TextBox ID="tbMODescuento" runat="server" Width="87%" Style="text-align: right;"> </asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender3" runat="server"
|
||||
TargetControlID="tbMODescuento"
|
||||
FilterType="Custom, Numbers"
|
||||
ValidChars=".," />
|
||||
<asp:RangeValidator
|
||||
ID="RVtbMODescuento"
|
||||
ControlToValidate="tbMODescuento"
|
||||
MinimumValue="0"
|
||||
MaximumValue="100"
|
||||
Type="Integer"
|
||||
ValidationGroup="GrpGuardar"
|
||||
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Descuento''</b> debe que tener valores entre 0 - 100." Display="none"
|
||||
runat="server" />
|
||||
<ajax:ValidatorCalloutExtender ID="VCEtbMODescuento" runat="server" HighlightCssClass="vco" TargetControlID="RVtbMODescuento" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</td>
|
||||
<td width="10%">
|
||||
<%-- <asp:TextBox ID="tbMOImporte" runat="server" Width="90%" Style="text-align: center;"></asp:TextBox>--%>
|
||||
</td>
|
||||
|
||||
<td width="7%">
|
||||
<asp:ImageButton ID="ImgBtnAdd_MO" runat="server" ValidationGroup="GrAdd2" ImageUrl="~/Imagenes/Btn_Add.png" />
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<asp:UpdatePanel ID="UDPMO" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvMO" runat="server" CssClass="tabla_correcto" EmptyDataText="Aun no hay registros."
|
||||
AutoGenerateColumns="False" ShowFooter="True" ShowHeader="false"
|
||||
Width="100%" HeaderStyle-CssClass="Titulos" FooterStyle-CssClass="SubTotales2">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbMOConsec" runat="server" Text='<%#Eval("Consec")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="5%" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbMOPS" runat="server" Text='<%#Eval("PS") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="34%" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbMOUnidad" runat="server" Text='<%#Eval("UM")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="14%" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbMOCantidad" runat="server" Style="text-align: right;" Text='<%#Eval("Cantidad", "{0:N2}")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="10%" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbMOPU" runat="server" Text='<%#Eval("PU", "{0:N2}")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="10%" />
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbMODesc" runat="server" Text='<%# Eval("Descuento", "{0:N2}%")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="10%" />
|
||||
<FooterTemplate>
|
||||
<asp:Label ID="lbTotalMO" runat="server" Text="Total:"></asp:Label>
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbMOImporte" runat="server" Text='<%# Eval("Importe","{0:N2}")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:Label ID="lbTotalImporteMO" runat="server"></asp:Label>
|
||||
</FooterTemplate>
|
||||
|
||||
<ItemStyle Width="10%" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:ImageButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete"
|
||||
ImageUrl="/Imagenes/Btn_Delete.png" OnClientClick="return confirm('¿Estas seguro que desea eliminar?');" />
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="7%"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div style="margin-top:2%;" align="left">
|
||||
<table width="30%" border="1" cellpadding="0" cellspacing="0">
|
||||
<tr class="Titulos">
|
||||
<td colspan="2">Herramienta</td>
|
||||
</tr>
|
||||
<tr class="Titulos" >
|
||||
<td width="40%">
|
||||
Porcentaje
|
||||
</td>
|
||||
<td width="60%">Importe</td>
|
||||
</tr>
|
||||
<tr align="center" >
|
||||
<td>
|
||||
<asp:TextBox ID="tbHPorcentaje" runat="server" Width="45%" Text="" ClientIDMode="Static"></asp:TextBox>%
|
||||
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender6" runat="server"
|
||||
TargetControlID="tbHPorcentaje"
|
||||
FilterType="Custom, Numbers"
|
||||
ValidChars=".," />
|
||||
<asp:RangeValidator
|
||||
ID="RVtbHPorcentaje"
|
||||
ControlToValidate="tbHPorcentaje"
|
||||
MinimumValue="0"
|
||||
MaximumValue="100"
|
||||
Type="Double"
|
||||
ValidationGroup="GrpGuardar"
|
||||
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />Ingrese valores entre 0 - 100 en el campo <b>''Porcentaje''</b>." Display="none"
|
||||
runat="server" />
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server" HighlightCssClass="vco"
|
||||
TargetControlID="RVtbHPorcentaje" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</td>
|
||||
<td><asp:Label ID="lbHImporte" runat="server" Width="70%" ClientIDMode="Static">
|
||||
</asp:Label> <asp:HiddenField ID="hdnHImporte" runat="server" ClientIDMode="Static" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="div2" style="float: right; width: 24%; margin-right: 1%;">
|
||||
<table width="100%" border="1" cellpadding="0" cellspacing="0">
|
||||
<tr class="Titulos">
|
||||
<td>Costo por Unidad</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<asp:UpdatePanel ID="UDPCostoUnidad" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvCon" value="0" runat="server" CssClass="tabla_correcto" EmptyDataText="Aun no hay registros."
|
||||
AutoGenerateColumns="False" ShowFooter="True" ShowHeader="false" FooterStyle-CssClass="SubTotales2"
|
||||
Width="100%">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbConcepto" runat="server" Text='<%# Eval("PresupuestoSubConcepto")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="45%" />
|
||||
<FooterTemplate>
|
||||
Total:
|
||||
</FooterTemplate>
|
||||
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField>
|
||||
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="tbImporte" runat="server" CssClass="sumConcepto" Style="text-align: right; border-style:inset;" Text='<%# Eval("Importe","{0:N2}")%>' Width="100%"></asp:TextBox>
|
||||
<asp:Label ID="lbImporte" runat="server" Style="text-align: right" Text='<%# Eval("Importe","{0:N2}")%>' Width="100%"></asp:Label>
|
||||
<ajax:FilteredTextBoxExtender ID="FTBtbImporte" runat="server"
|
||||
TargetControlID="tbImporte"
|
||||
FilterType="Custom, Numbers"
|
||||
ValidChars=".," />
|
||||
|
||||
<asp:HiddenField ID="hdnImporte" runat="server" Value='<%# Eval("Importe","{0:N2}")%>' />
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="22%" />
|
||||
<FooterTemplate>
|
||||
<asp:Label ID="LblTotalConceptos" runat="server" Text="" Style="text-align:right;" ClientIDMode="Static"></asp:Label>
|
||||
</FooterTemplate>
|
||||
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="tbFormula" runat="server" Style="text-align: center;" Text='<%# Eval("Formula","{0:N2}")%>' Width="55%" CssClass="Porcentajes"></asp:TextBox>%
|
||||
<ajax:FilteredTextBoxExtender ID="FTBtbFormula" runat="server"
|
||||
TargetControlID="tbFormula"
|
||||
FilterType="Custom, Numbers"
|
||||
ValidChars=".," />
|
||||
|
||||
<asp:HiddenField ID="hdnFormula" runat="server" Value='<%# Eval("Formula","{0:N2}")%>' />
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="center"/>
|
||||
<FooterTemplate>
|
||||
|
||||
</FooterTemplate>
|
||||
<ItemStyle Width="20%" />
|
||||
|
||||
</asp:TemplateField>
|
||||
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
|
||||
</ajax:TabPanel>
|
||||
|
||||
<ajax:TabPanel ID="TabPoyecto" runat="server" HeaderText="Datos del Proyecto">
|
||||
<ContentTemplate>
|
||||
|
||||
|
||||
<table border="1" cellpadding="1" cellspacing="5" align="center" width="30%" style="margin-top: 2%;" >
|
||||
<tr class="Titulos">
|
||||
<td colspan="5" align="center">Datos del Proyecto</td>
|
||||
</tr>
|
||||
<tr class="">
|
||||
<td>Unidad</td><td>
|
||||
<asp:Label ID="lbDPUnidad" runat="server"></asp:Label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cantidad</td> <td>
|
||||
<asp:TextBox ID="tbCantidadP" runat="server" Width="60%"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender7" runat="server"
|
||||
TargetControlID="tbCantidadP"
|
||||
FilterType="Custom, Numbers"
|
||||
ValidChars=".," />
|
||||
<asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator3" ControlToValidate="tbCantidadP"
|
||||
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario, por favor ingrése una." Display="Dynamic" Text="*"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator3" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>P.U.</td> <td>
|
||||
<asp:Label ID="lbDPPU" runat="server"></asp:Label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Importe Total</td><td>
|
||||
<asp:Label ID="lbDPIT" runat="server"></asp:Label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Anticipo</td>
|
||||
<td>
|
||||
<asp:Label ID="lbDPAnt" runat="server"></asp:Label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
<table width="50%" border="1" cellpadding="0" cellspacing="0">
|
||||
<tr class="Titulos">
|
||||
<td align="center">Datos del Proyecto</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
<asp:UpdatePanel ID="UPProyecto" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:GridView ID="GvProyecto" runat="server" CssClass="tabla_correcto" EmptyDataText="Aun no hay registros."
|
||||
AutoGenerateColumns="False" ShowFooter="False" ShowHeader="False"
|
||||
Width="50%" HeaderStyle-CssClass="Titulos" FooterStyle-CssClass="SubTotales2">
|
||||
<Columns>
|
||||
|
||||
<asp:TemplateField HeaderText="" >
|
||||
<ItemTemplate >
|
||||
<asp:Label ID="lbSubConcepto" runat="server" Text='<%# Eval("PresupuestoSubConcepto")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="45%" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbImporte" runat="server" Text='<%# Eval("Importe", "{0:N2}")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="45%" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbFormula" runat="server" Text='<%# Eval("Formula", "{0:N2}%")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="45%" />
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
</asp:GridView>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
|
||||
</ajax:TabContainer>
|
||||
|
||||
<asp:UpdateProgress ID="upProgress" runat="server" DisplayAfter="0">
|
||||
<ProgressTemplate>
|
||||
<div id="overlay">
|
||||
<div id="modalprogress">
|
||||
<div id="theprogress">
|
||||
<center>
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td>La información se está procesando...</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<img src="/Imagenes/Cargando.gif" style="border-width: 0px;" alt="" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ProgressTemplate>
|
||||
</asp:UpdateProgress>
|
||||
|
||||
</asp:Content>
|
||||
|
||||
624
Presupuestos/GenerarPresupuestos.aspx.vb
Normal file
624
Presupuestos/GenerarPresupuestos.aspx.vb
Normal file
@@ -0,0 +1,624 @@
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
|
||||
Imports System.IO
|
||||
|
||||
Partial Class Presupuestos_GenerarPresupuestos
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
|
||||
|
||||
#Region "P R O P I E D A D E S"
|
||||
|
||||
Public Property DtMaterial() As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtMaterial"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtMaterial") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property DtMO() As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtMO"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtMO") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property DtPS() As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtPS"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtPS") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property DtSubConceptos() As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtSubConceptos"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtSubConceptos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property CvePresupuesto As Integer
|
||||
Get
|
||||
Return CType(ViewState("CvePresupuesto"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CvePresupuesto") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property CostoDirecto As Double
|
||||
Get
|
||||
Return CType(ViewState("CostoDirecto"), Double)
|
||||
End Get
|
||||
Set(value As Double)
|
||||
ViewState("CostoDirecto") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property CvePresupuestoDetalle As Integer
|
||||
Get
|
||||
Return CType(ViewState("CvePresupuestoDetalle"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CvePresupuestoDetalle") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Bandera As Boolean
|
||||
Get
|
||||
Return CType(ViewState("Bandera"), Boolean)
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("Bandera") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property TotalMO As Double
|
||||
Get
|
||||
Return CType(ViewState("TotalMO"), Double)
|
||||
End Get
|
||||
Set(value As Double)
|
||||
ViewState("TotalMO") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property TotalM As Double
|
||||
Get
|
||||
Return CType(ViewState("TotalM"), Double)
|
||||
End Get
|
||||
Set(value As Double)
|
||||
ViewState("TotalM") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
TxtFecha.Text = Now.ToShortDateString
|
||||
tbHPorcentaje.Attributes.Add("onchange", "CostoHerramienta(this);")
|
||||
InicializarListas()
|
||||
CrearDTMaterial()
|
||||
CrearDTMO()
|
||||
Bandera = True
|
||||
If Request("CvePresupuesto") IsNot Nothing AndAlso Request("CvePresupuesto").ToString.ToEntero > 0 Then
|
||||
CvePresupuesto = Request("CvePresupuesto").ToEntero
|
||||
CargarPresupuesto()
|
||||
btnGuardarP.Text = "Actualizar"
|
||||
Bandera = False
|
||||
|
||||
End If
|
||||
|
||||
GvMat.DataSource = DtMaterial
|
||||
GvMat.DataBind()
|
||||
GvMO.DataSource = DtMO
|
||||
GvMO.DataBind()
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargarPresupuesto()
|
||||
Dim ObjPresupuestos As New ClsPresupuestos
|
||||
|
||||
If ObjPresupuestos.GetPresupuestos(CvePresupuesto, UsuarioActual.CveEmpresa) Then
|
||||
'LLENAR CAMPOS CON INFO DEL PRESUPUESTO
|
||||
If ObjPresupuestos.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
tbPresupuesto.Text = ObjPresupuestos.DtResultados.Rows(0)("Presupuesto").ToString
|
||||
|
||||
|
||||
'OBTENGO EL DETALLE DEL PRESUPUESTO
|
||||
ObjPresupuestos.GetPresupuestosDetalle(CvePresupuesto)
|
||||
ddlPPS.SelectedValue = ObjPresupuestos.DtResultados.Rows(0)("CvePS").ToString
|
||||
ddlPUM.SelectedValue = ObjPresupuestos.DtResultados.Rows(0)("CveUM").ToString
|
||||
CvePresupuestoDetalle = ObjPresupuestos.DtResultados.Rows(0)("CvePresupuestoDetalle").ToString.ToEntero
|
||||
tbCantidadP.Text = ObjPresupuestos.DtResultados.Rows(0)("Cantidad").ToString.FormatoNumero
|
||||
ObjPresupuestos.GetPresupuestosDetalleProductos(CvePresupuestoDetalle)
|
||||
DtMaterial = ObjPresupuestos.DtResultados.FiltraParametros("CveTipoPS=" & 2)
|
||||
DtMO = ObjPresupuestos.DtResultados.FiltraParametros("CveTipoPS=" & 3)
|
||||
|
||||
If ObjPresupuestos.DtResultados.FiltraParametros("CveTipoPS=" & 4).Rows.Count > 0 Then
|
||||
|
||||
tbHPorcentaje.Text = ObjPresupuestos.DtResultados.FiltraParametros("CveTipoPS=" & 4).Rows(0)("Descuento").ToString.FormatoNumero
|
||||
lbHImporte.Text = ObjPresupuestos.DtResultados.FiltraParametros("CveTipoPS=" & 4).Rows(0)("Importe").ToString.FormatoNumero
|
||||
|
||||
End If
|
||||
|
||||
|
||||
'OBTIENE EL COSTO POR UNIDAD
|
||||
If ObjPresupuestos.GetSubConceptos(UsuarioActual.CveEmpresa, CvePresupuestoDetalle) Then
|
||||
|
||||
GvCon.DataSource = ObjPresupuestos.DtResultados
|
||||
DtSubConceptos = ObjPresupuestos.DtResultados
|
||||
CostoDirecto = DtSubConceptos.FiltraParametros("PresupuestoSubConcepto='Costo Directo'").Rows(0)("Importe").ToString.ToDouble()
|
||||
GvCon.DataBind()
|
||||
|
||||
End If
|
||||
|
||||
'OBTIENE LOS DATOS DEL PROYECTO
|
||||
If ObjPresupuestos.GetDatosProyecto(UsuarioActual.CveEmpresa, CvePresupuestoDetalle) Then
|
||||
GvProyecto.DataSource = ObjPresupuestos.DtResultados
|
||||
GvProyecto.DataBind()
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
ObjPresupuestos.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub InicializarListas()
|
||||
|
||||
Dim ps As New ClsProductosServicios
|
||||
Dim ObjPresupuesto As New ClsPresupuestos
|
||||
|
||||
If ps.GetPS(-1, -1, UsuarioActual.CveEmpresa) Then
|
||||
DtPS = ps.DtResultados
|
||||
ddlPS.DataSource = ps.DtResultados.FiltraParametros("CveTipoPS=" & 2)
|
||||
ddlPS.DataBind()
|
||||
ddlPS.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Seleccione un producto.", "-1"))
|
||||
|
||||
ddlMOPS.DataSource = ps.DtResultados.FiltraParametros("CveTipoPS=" & 3)
|
||||
|
||||
ddlMOPS.DataBind()
|
||||
ddlMOPS.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Seleccione un producto.", "-1"))
|
||||
|
||||
ddlPPS.DataSource = ps.DtResultados.FiltraParametros("CveTipoPS=" & 1)
|
||||
ddlPPS.DataBind()
|
||||
ddlPPS.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Seleccione un producto.", "-1"))
|
||||
End If
|
||||
|
||||
ddlUM.Items.Insert(0, New System.Web.UI.WebControls.ListItem("---------", "-1"))
|
||||
ddlMOUnidad.Items.Insert(0, New System.Web.UI.WebControls.ListItem("---------", "-1"))
|
||||
|
||||
ddlPUM.DataSource = GlobalDTUnidadesMedida.FiltraParametros("CveEmpresa=" & UsuarioActual.CveEmpresa)
|
||||
ddlPUM.DataBind()
|
||||
|
||||
Dim ObjClientes As New ClsClientes
|
||||
If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
|
||||
ddlCliente.DataSource = ObjClientes.DtResultados
|
||||
Else
|
||||
ddlCliente.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjClientes.Dispose()
|
||||
ddlCliente.DataBind()
|
||||
|
||||
Dim ObjProspectos As New ClsProspectos
|
||||
|
||||
If ObjProspectos.GetProspectos(-1, "-1", "-1", -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
End If
|
||||
If ObjPresupuesto.GetSubConceptos(UsuarioActual.CveEmpresa, -1) Then
|
||||
|
||||
GvCon.DataSource = ObjPresupuesto.DtResultados
|
||||
DtSubConceptos = ObjPresupuesto.DtResultados
|
||||
|
||||
GvCon.DataBind()
|
||||
|
||||
|
||||
End If
|
||||
ps.Dispose()
|
||||
ObjPresupuesto.Dispose()
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CrearDTMaterial()
|
||||
DtMaterial = New DataTable
|
||||
DtMaterial.Columns.Add("Consec", GetType(Integer))
|
||||
DtMaterial.Columns.Add("Cantidad", GetType(Double))
|
||||
DtMaterial.Columns.Add("CveUM", GetType(Integer))
|
||||
DtMaterial.Columns.Add("UM", GetType(String))
|
||||
DtMaterial.Columns.Add("CvePS", GetType(Integer))
|
||||
DtMaterial.Columns.Add("PS", GetType(String))
|
||||
DtMaterial.Columns.Add("PU", GetType(Double))
|
||||
DtMaterial.Columns.Add("Importe", GetType(Double))
|
||||
DtMaterial.Columns.Add("Descuento", GetType(Double))
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CrearDTMO()
|
||||
|
||||
DtMO = New DataTable
|
||||
DtMO.Columns.Add("Consec", GetType(Integer))
|
||||
DtMO.Columns.Add("Cantidad", GetType(Double))
|
||||
DtMO.Columns.Add("CveUM", GetType(Integer))
|
||||
DtMO.Columns.Add("UM", GetType(String))
|
||||
DtMO.Columns.Add("CvePS", GetType(Integer))
|
||||
DtMO.Columns.Add("PS", GetType(String))
|
||||
DtMO.Columns.Add("PU", GetType(Double))
|
||||
DtMO.Columns.Add("Importe", GetType(Double))
|
||||
DtMO.Columns.Add("Descuento", GetType(Double))
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub AddDTMaterial(Cantidad As Double, UM As String, CveUM As Integer, CvePS As Integer, PS As String,
|
||||
PU As Double, Importe As Double, Descuento As Double)
|
||||
|
||||
Dim dr As DataRow = DtMaterial.NewRow
|
||||
dr("Consec") = DtMaterial.Rows.Count + 1
|
||||
dr("Cantidad") = Cantidad
|
||||
dr("UM") = UM
|
||||
dr("CveUM") = CveUM
|
||||
dr("CvePS") = CvePS
|
||||
dr("PS") = PS
|
||||
dr("PU") = PU
|
||||
dr("Descuento") = Descuento
|
||||
dr("Importe") = Importe
|
||||
DtMaterial.Rows.Add(dr)
|
||||
GvMat.DataSource = DtMaterial
|
||||
GvMat.DataBind()
|
||||
RecalculaCosto()
|
||||
UDPMaterial.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub AddDTMO(Cantidad As Double, UM As String, CveUM As Integer, CvePS As Integer, PS As String,
|
||||
PU As Double, Importe As Double, Descuento As Double)
|
||||
|
||||
Dim dr As DataRow = DtMO.NewRow
|
||||
dr("Consec") = DtMO.Rows.Count + 1
|
||||
dr("Cantidad") = Cantidad
|
||||
dr("UM") = UM
|
||||
dr("CveUM") = CveUM
|
||||
dr("CvePS") = CvePS
|
||||
dr("PS") = PS
|
||||
dr("PU") = PU
|
||||
dr("Importe") = Importe
|
||||
dr("Descuento") = Descuento
|
||||
DtMO.Rows.Add(dr)
|
||||
GvMO.DataSource = DtMO
|
||||
GvMO.DataBind()
|
||||
|
||||
RecalculaCosto()
|
||||
UDPMO.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub ImgBtnAddPS_Click(sender As Object, e As ImageClickEventArgs) Handles ImgBtnAddPS.Click
|
||||
|
||||
If ddlPS.SelectedIndex.ToEntero > 0 Then
|
||||
Dim Desc As Double = (1 - (tbDesc.Text.ToDouble / 100))
|
||||
Dim Importe As Double = If(tbDesc.Text.ToEntero > 0, (tbPrecio.Text.ToDouble * tbCantidad.Text.ToDouble * Desc), (tbPrecio.Text.ToDouble * tbCantidad.Text.ToDouble))
|
||||
AddDTMaterial(tbCantidad.Text.ToDouble, ddlUM.SelectedItem.ToString, ddlUM.SelectedValue.ToEntero,
|
||||
ddlPS.SelectedValue.ToEntero, ddlPS.SelectedItem.ToString, tbPrecio.Text.ToDouble, Importe, tbDesc.Text.ToDouble)
|
||||
Else
|
||||
Alert("Seleccione Material.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub ImgBtnAdd_MO_Click(sender As Object, e As ImageClickEventArgs) Handles ImgBtnAdd_MO.Click
|
||||
|
||||
If ddlMOPS.SelectedIndex.ToEntero > 0 Then
|
||||
Dim Desc As Double = (1 - (tbMODescuento.Text.ToDouble / 100))
|
||||
Dim Importe As Double = If(tbMODescuento.Text.ToEntero > 0, (tbPrecioMO.Text.ToDouble * tbMOCantidad.Text.ToDouble * Desc), (tbPrecioMO.Text.ToDouble * tbMOCantidad.Text.ToDouble))
|
||||
|
||||
AddDTMO(tbMOCantidad.Text.ToDouble, ddlMOUnidad.SelectedItem.ToString, ddlMOUnidad.SelectedValue.ToEntero,
|
||||
ddlMOPS.SelectedValue.ToEntero, ddlMOPS.SelectedItem.ToString,
|
||||
tbPrecioMO.Text.ToDouble, Importe, tbMODescuento.Text.ToDouble)
|
||||
Else
|
||||
Alert("Seleccione Mano de Obra.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub btnGuardarP_Click(sender As Object, e As EventArgs) Handles btnGuardarP.Click
|
||||
|
||||
If ddlPPS.SelectedIndex.ToEntero > 0 Then
|
||||
If ddlCliente.SelectedValue > "-1" Or ddlProspecto.SelectedValue.ToEntero > -1 Then
|
||||
Dim ObjPresupuesto As New ClsPresupuestos
|
||||
|
||||
Dim ErrorPresupuesto As Boolean = False
|
||||
Dim CvePresupuestoDetalle As Integer = 0
|
||||
Dim CvePresupuestoSubConcepto As Integer = 0
|
||||
ObjPresupuesto.IniciaTransacSQL()
|
||||
Dim CveClienteProspecto As Integer = If(ddlCliente.SelectedValue.ToEntero > -1, ddlCliente.SelectedValue.ToEntero, ddlProspecto.SelectedValue.ToEntero)
|
||||
'SE AGREGA EL MATERIAL
|
||||
CvePresupuesto = ObjPresupuesto.AddPresupuestos(tbPresupuesto.Text, TxtFecha.Text.ToDate, CveClienteProspecto, True, True,
|
||||
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
|
||||
|
||||
If Not CvePresupuesto <= 0 Then
|
||||
CvePresupuestoDetalle = ObjPresupuesto.AddPresupuestosDetalle(CvePresupuesto, ddlPPS.SelectedValue.ToString.ToEntero, tbCantidadP.Text.ToDouble)
|
||||
|
||||
If CvePresupuestoDetalle <= 0 Then
|
||||
ErrorPresupuesto = True
|
||||
Else
|
||||
|
||||
If Not CvePresupuestoDetalle < 0 Then
|
||||
For Each dr As DataRow In DtMaterial.Rows
|
||||
|
||||
If Not ObjPresupuesto.AddPresupuestosDetalleProductos(CvePresupuestoDetalle, dr("CvePS").ToString.ToEntero,
|
||||
dr("CveUM").ToString.ToEntero,
|
||||
dr("Cantidad").ToString.ToDouble, dr("PU").ToString.ToDouble, dr("Descuento").ToString.ToDouble) Then
|
||||
ErrorPresupuesto = True
|
||||
|
||||
End If
|
||||
|
||||
Next
|
||||
Else
|
||||
ErrorPresupuesto = True
|
||||
End If
|
||||
|
||||
End If
|
||||
Else
|
||||
|
||||
ErrorPresupuesto = True
|
||||
|
||||
End If
|
||||
|
||||
'SE AGREGA LA MANO DE OBRA
|
||||
If Not ErrorPresupuesto Then
|
||||
|
||||
For Each dr As DataRow In DtMO.Rows
|
||||
|
||||
If Not ObjPresupuesto.AddPresupuestosDetalleProductos(CvePresupuestoDetalle, dr("CvePS").ToString.ToEntero,
|
||||
dr("CveUM").ToString.ToEntero,
|
||||
dr("Cantidad").ToString.ToDouble,
|
||||
dr("PU").ToString.ToDouble,
|
||||
dr("Descuento").ToString.ToDouble) Then
|
||||
ErrorPresupuesto = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
|
||||
End If
|
||||
'SE AGREGA HERRAMIENTA
|
||||
If Not ErrorPresupuesto Then
|
||||
|
||||
|
||||
If Not ObjPresupuesto.AddPresupuestosDetalleProductos(CvePresupuestoDetalle, DtPS.FiltraParametros("CveTipoPS=" & 4).Rows(0)("CvePS").ToString.ToEntero,
|
||||
0,
|
||||
1,
|
||||
TotalMO,
|
||||
tbHPorcentaje.Text.ToDouble) Then
|
||||
ErrorPresupuesto = True
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
'AGREGAR SUB CONCEPTOS
|
||||
For Each row As GridViewRow In GvCon.Rows
|
||||
|
||||
If Not ObjPresupuesto.AddPresupuestosDetalleConceptos(CvePresupuestoDetalle, DtSubConceptos.Rows(row.RowIndex)("CvePresupuestoSubConcepto").ToString.ToEntero,
|
||||
row.FCHiddenField("hdnImporte").Value.ToString.ToDouble, row.FCHiddenField("hdnFormula").Value.ToString.ToDouble) Then
|
||||
ErrorPresupuesto = True
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
If ErrorPresupuesto Then
|
||||
ObjPresupuesto.RollBack()
|
||||
Alert("Error al guardar la información.", TipoMensaje.MsgError)
|
||||
|
||||
Else
|
||||
ObjPresupuesto.Commit()
|
||||
|
||||
End If
|
||||
|
||||
ObjPresupuesto.Dispose()
|
||||
Else
|
||||
|
||||
Alert("Seleccione un Cliente o Prospecto.", TipoMensaje.MsgAdvertencia)
|
||||
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert("Seleccione un Producto.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
'Dim ObjPresupuestoUpdate As New ClsPresupuestos
|
||||
'Dim ErrorPresupuestoUpdate As Boolean
|
||||
|
||||
'If Not ObjPresupuestoUpdate.UpdatePresupuestos(CvePresupuesto, tbPresupuesto.Text, TxtFecha.Text.ToDate, tbCantidadP.Text.ToDouble, 0, True, True,
|
||||
' UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
' ErrorPresupuestoUpdate = True
|
||||
'Else
|
||||
' ObjPresupuestoUpdate.UpdatePresupuestosDetalle(CvePresupuestoDetalle, CvePresupuesto, ddlPPS.SelectedValue.ToString.ToEntero)
|
||||
|
||||
'End If
|
||||
|
||||
'If ErrorPresupuestoUpdate Then
|
||||
' ObjPresupuestoUpdate.RollBack()
|
||||
' Alert("Error al Actualizar la información.")
|
||||
'Else
|
||||
' ObjPresupuestoUpdate.Commit()
|
||||
'End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvMaterial_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvMat.RowDataBound
|
||||
|
||||
If (e.Row.RowType = DataControlRowType.Footer) Then
|
||||
TotalM = CType(GvMat.DataSource, DataTable).SUM("Importe")
|
||||
e.Row.FCLabel("lbTotalImporte").Text = String.Format("{0:N2}", TotalM)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvMaterial_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvMat.RowDeleting
|
||||
|
||||
DtMaterial.Rows.RemoveAt(e.RowIndex)
|
||||
GvMat.DataSource = DtMaterial
|
||||
GvMat.DataBind()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvMO_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvMO.RowDataBound
|
||||
|
||||
If (e.Row.RowType = DataControlRowType.Footer) Then
|
||||
|
||||
e.Row.Cells(1).ColumnSpan = 1
|
||||
TotalMO = CType(GvMO.DataSource, DataTable).SUM("Importe")
|
||||
e.Row.FCLabel("lbTotalImporteMO").Text = String.Format("{0:N2}", TotalMO)
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvMO_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvMO.RowDeleting
|
||||
|
||||
DtMO.Rows.RemoveAt(e.RowIndex)
|
||||
GvMO.DataSource = DtMO
|
||||
GvMO.DataBind()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub ddlMOPS_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ddlMOPS.SelectedIndexChanged
|
||||
|
||||
If ddlMOPS.SelectedIndex > 0 Then
|
||||
Dim PU As Double = DtPS.FiltraParametros("CvePS=" & ddlMOPS.SelectedValue.ToString).Rows(0)("Precio").ToString.ToDouble
|
||||
tbPrecioMO.Text = PU.ToString
|
||||
|
||||
ddlMOUnidad.DataSource = GlobalDTUnidadesMedida.FiltraParametros("CveEmpresa=" & UsuarioActual.CveEmpresa)
|
||||
ddlMOUnidad.DataBind()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvCon_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvCon.RowDataBound
|
||||
|
||||
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("PresupuestoSubConcepto") = "Costo Directo" Then
|
||||
e.Row.Cells(2).Visible = False
|
||||
e.Row.FCTextBox("tbImporte").Visible = False
|
||||
e.Row.FCTextBox("tbFormula").Visible = False
|
||||
e.Row.FCLabel("lbImporte").Text = CostoDirecto.FormatoNumero()
|
||||
e.Row.FCLabel("lbImporte").ClientIDMode = ClientIDMode.Static
|
||||
e.Row.FCHiddenField("hdnImporte").ClientIDMode = ClientIDMode.Static
|
||||
e.Row.FCLabel("lbImporte").ID = "LblCostoDirecto"
|
||||
|
||||
Else
|
||||
|
||||
e.Row.FCLabel("lbImporte").Visible = False
|
||||
|
||||
If e.Row.DBCampo("PresupuestoSubConcepto") = "Total" Then
|
||||
e.Row.CssClass = "SubTotales2"
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
e.Row.FCTextBox("tbImporte").Attributes.Add("onchange", "RecalculaCosto2('" & e.Row.FCTextBox("tbImporte").ClientID & "','" & e.Row.FCTextBox("tbFormula").ClientID & "','" & e.Row.FCHiddenField("hdnImporte").ClientID & "','" & e.Row.FCHiddenField("hdnFormula").ClientID & "')")
|
||||
e.Row.FCTextBox("tbFormula").Attributes.Add("onchange", "RecalculaCosto('" & e.Row.FCTextBox("tbImporte").ClientID & "','" & e.Row.FCTextBox("tbFormula").ClientID & "','" & e.Row.FCHiddenField("hdnImporte").ClientID & " ','" & e.Row.FCHiddenField("hdnFormula").ClientID & "')")
|
||||
|
||||
End If
|
||||
|
||||
If e.Row.RowType = DataControlRowType.Footer Then
|
||||
e.Row.FCLabel("LblTotalConceptos").Text = DtSubConceptos.SUM("Importe").FormatoNumero
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub ddlPS_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ddlPS.SelectedIndexChanged
|
||||
If ddlPS.SelectedIndex > 0 Then
|
||||
Dim PU As Double = DtPS.FiltroPrimero("CvePS=" & ddlPS.SelectedValue.ToString)("Precio").ToString.ToDouble
|
||||
tbPrecio.Text = PU.ToString
|
||||
ddlUM.DataSource = GlobalDTUnidadesMedida.FiltraParametros("CveEmpresa=" & UsuarioActual.CveEmpresa)
|
||||
ddlUM.DataBind()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub RecalculaCosto()
|
||||
Dim por As Double = tbHPorcentaje.Text.ToDouble / 100
|
||||
lbHImporte.Text = (TotalMO * por).FormatoNumero
|
||||
CostoDirecto = DtMaterial.SUM("Importe") + DtMO.SUM("Importe") + (TotalMO * por)
|
||||
Dim total As Double = CostoDirecto
|
||||
For Each Row As GridViewRow In GvCon.Rows
|
||||
|
||||
If Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
If Row.FCLabel("lbConcepto").Text = "Costo Directo" Then
|
||||
DtSubConceptos.Rows(Row.RowIndex)("Importe") = CostoDirecto
|
||||
Else
|
||||
|
||||
Dim P As Double = Row.FCHiddenField("hdnFormula").Value.ToDouble / 100
|
||||
Dim NewImporte As Double = CostoDirecto * P
|
||||
DtSubConceptos.Rows(Row.RowIndex)("Importe") = NewImporte
|
||||
|
||||
DtSubConceptos.Rows(Row.RowIndex)("Formula") = Row.FCHiddenField("hdnFormula").Value.ToDouble
|
||||
|
||||
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
GvCon.DataSource = DtSubConceptos
|
||||
GvCon.DataBind()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvProyecto_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvProyecto.RowDataBound
|
||||
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("CvePresupuestoSubConcepto") = "" Then
|
||||
e.Row.CssClass = "SubTotales2"
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Protected Sub btnprueba_Click(sender As Object, e As EventArgs) Handles btnprueba.Click
|
||||
'Dim rv As New ReportViewer
|
||||
'Dim rds = New ReportDataSource("DsPresupuesto", DtMaterial)
|
||||
'rv.LocalReport.DataSources.Clear()
|
||||
'rv.LocalReport.DataSources.Add(rds)
|
||||
'rv.LocalReport.ReportPath = AppDomain.CurrentDomain.BaseDirectory & "Presupuestos\Reportes\RepPresupuesto.rdlc"
|
||||
'rv.LocalReport.Refresh()
|
||||
'Dim paramList As New List(Of ReportParameter)
|
||||
'With paramList
|
||||
' .Add(New ReportParameter("Presupuesto", tbPresupuesto.Text, True))
|
||||
' .Add(New ReportParameter("PS", ddlPPS.SelectedItem.ToString, True))
|
||||
' .Add(New ReportParameter("Unidad", ddlPUM.SelectedItem.ToString, True))
|
||||
' .Add(New ReportParameter("Cliente", ddlCliente.SelectedItem.ToString, True))
|
||||
' .Add(New ReportParameter("Fecha", TxtFecha.Text, True))
|
||||
|
||||
'End With
|
||||
|
||||
'rv.LocalReport.SetParameters(paramList)
|
||||
'rv.LocalReport.Refresh()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
1022
Presupuestos/Reportes/RepPresupuesto.rdlc
Normal file
1022
Presupuestos/Reportes/RepPresupuesto.rdlc
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user