Repcomprasaf, compras ver cultivos en subproyectos
This commit is contained in:
@@ -1,14 +1,11 @@
|
||||
<%@ Page Title="Catálogo de Unidades" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CierreCultivo.aspx.vb" Inherits="Agrupecuaria_CierreCultivo" EnableEventValidation="false" %>
|
||||
<%@ Page Title="Cierre de Cultivo" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CierreCultivo.aspx.vb" Inherits="Agrupecuaria_CierreCultivo" EnableEventValidation="false" %>
|
||||
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
|
||||
<style>
|
||||
#DivAgregarUnidad > div.modal-dialog > div label input {
|
||||
padding: 0px !important;
|
||||
}
|
||||
<style>
|
||||
</style>
|
||||
|
||||
</asp:Content>
|
||||
@@ -18,10 +15,10 @@
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel runat="server" ID="UpAgregar">
|
||||
<asp:UpdatePanel runat="server" ID="UpAcciones" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
|
||||
<asp:LinkButton ID="LnkAccionesCerrarCultivo" OnClick="LnkAccionesCerrarCultivo_Click" Visible="false" runat="server"><i class="fa fa-check"></i> Cerrar Cultivo</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
@@ -33,32 +30,32 @@
|
||||
|
||||
<asp:UpdatePanel ID="UpFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="">
|
||||
<div class="portlet-title portlet-filterT smalltitle" style="min-height: 49px; position: relative;">
|
||||
<div class="tools">
|
||||
<asp:Button ID="btConsultar" CssClass="btn btn-primary" runat="server" ValidationGroup="GrpConsultar" Text="Consultar" OnClick="btConsultar_Click" /></td>
|
||||
<a href="javascript:;" data-idchekbox="<%= chkexpand.ClientID%>" class=" <%= IIf(chkexpand.Checked = True, "collapse", "expand")%>"></a>
|
||||
<asp:CheckBox ID="chkexpand" CssClass="hidden" runat="server" />
|
||||
</div>
|
||||
<div class="titlefiltros caption magindate">
|
||||
<div class="row">
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="">
|
||||
<div class="portlet-title portlet-filterT smalltitle" style="min-height: 49px; position: relative;">
|
||||
<div class="tools">
|
||||
<asp:Button ID="btConsultar" CssClass="btn btn-primary" runat="server" ValidationGroup="GrpConsultar" Text="Consultar" OnClick="btConsultar_Click" /></td>
|
||||
|
||||
<a href="javascript:;" data-idchekbox="<%= chkexpand.ClientID%>" class=" <%= IIf(chkexpand.Checked = True, "collapse", "expand")%>"></a>
|
||||
<asp:CheckBox ID="chkexpand" CssClass="hidden" runat="server" />
|
||||
</div>
|
||||
<div class="titlefiltros caption magindate">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-1 truncate">Temporada:</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlTemporada" CssClass="form-control input-sm select2me" runat="server" Width="100%"
|
||||
DataTextField="Temporada" DataValueField="CveTemporada">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 truncate">Temporada:</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlTemporada" CssClass="form-control input-sm select2me" runat="server" Width="100%"
|
||||
DataTextField="Temporada" DataValueField="CveTemporada">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="portlet-body magindate" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body magindate" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>> 1
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
@@ -69,15 +66,15 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False"
|
||||
DataKeyNames="CveClasificacion"
|
||||
EmptyDataText="No se Encontraron datos" CssClass="table table-striped table-advance table-hover mysmallbtn " data-sort="true" Style="width: 100%" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Clasificación" DataField="Clasificacion" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Importe" DataField="Importe" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:n2}" />
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False"
|
||||
DataKeyNames="CveClasificacion"
|
||||
EmptyDataText="No se Encontraron datos" CssClass="table table-striped table-advance table-hover mysmallbtn " data-sort="true" Style="width: 100%" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Clasificación" DataField="Clasificacion" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Importe" DataField="Importe" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:n2}" />
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -87,6 +84,61 @@
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="DivModalCerrarCultivo" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalCerrarCultivo" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<h4 class="modal-title">Cerrar Cultivo</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
|
||||
<asp:DropDownList ID="DdlModalSubProyectoCierreCultivo" runat="server" Width="100%" CssClass="form-control select2me" DataTextField="SubProyecto" DataValueField="CveSubProyecto">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RfvDdlSubProyecto" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlModalSubProyectoCierreCultivo" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Sub Proyecto''</b> es necesario, por favor ingréselo." ValidationGroup="GpoModalCerrarCultivo"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlModalSubProyectoCierreCultivo.ClientID.ToString()%>"><asp:Label ID="LblMoldalSubProyectoCierreCultivo" runat="server"></asp:Label></label>
|
||||
<i></i>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
|
||||
<asp:TextBox ID="TxtmodalFechaCierreCultivo" CssClass="form-control" MaxLength="50" runat="server"></asp:TextBox>
|
||||
<span class="input-group-btn " style="position: absolute; right: 41px; top: -5px;">
|
||||
<asp:LinkButton ID="LnkTxtmodalFechaCierreCultivo" class="btn default" Style="margin-top: 15px; margin-left: 6px" Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:CalendarExtender runat="server" ID="CETxtmodalFechaCierreCultivo" TargetControlID="TxtmodalFechaCierreCultivo" PopupButtonID="LnkTxtmodalFechaCierreCultivo" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
|
||||
<asp:CompareValidator ID="CvTxtmodalFechaCierreCultivo" runat="server" ControlToValidate="TxtmodalFechaCierreCultivo" Display="None"
|
||||
ErrorMessage="El campo <b>''Fecha de Cierre''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)."
|
||||
Operator="DataTypeCheck" Type="Date" ValidationGroup="GpoModalCerrarCultivo"></asp:CompareValidator>
|
||||
|
||||
<asp:RequiredFieldValidator ID="RfvTxtmodalFechaCierreCultivo" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtmodalFechaCierreCultivo"
|
||||
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha de Cierre''</b> es necesario, por favor ingréselo." ValidationGroup="GpoModalCerrarCultivo"></asp:RequiredFieldValidator>
|
||||
|
||||
<ajax:ValidatorCalloutExtender ID="CvcTxtmodalFechaCierreCultivo" runat="server" HighlightCssClass="vco" TargetControlID="CvTxtmodalFechaCierreCultivo" Width="100px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="VCE" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtmodalFechaCierreCultivo" Width="100px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
<label for="<%= TxtmodalFechaCierreCultivo.ClientID.ToString() %>">Fecha de Cierre:</label>
|
||||
<i></i>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnModalCerrarCultivo" runat="server" Text="Cerrar Cultivo" CssClass="btn btn-primary" ValidationGroup="GpoModalCerrarCultivo" />
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Partial Class Agrupecuaria_CierreCultivo
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Property CveCamion As Integer
|
||||
Private Property DT_Datos_Cierre As DataTable
|
||||
Get
|
||||
|
||||
If ViewState("CveCamion") Is Nothing Then
|
||||
Return -1
|
||||
Else
|
||||
Return ViewState("CveCamion").ToString().ToEntero()
|
||||
If ViewState("DT_Datos_Cierre") Is Nothing Then
|
||||
ViewState("DataTable") = New DataTable
|
||||
End If
|
||||
|
||||
Return DirectCast(ViewState("DT_Datos_Cierre"), DataTable)
|
||||
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
ViewState("CveCamion") = value
|
||||
Set(ByVal value As DataTable)
|
||||
ViewState("DT_Datos_Cierre") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -36,6 +38,9 @@ Partial Class Agrupecuaria_CierreCultivo
|
||||
|
||||
UpFiltros.Update()
|
||||
|
||||
|
||||
CargarCentrosDeCosto(Nothing, DdlModalSubProyectoCierreCultivo, Nothing, LblMoldalSubProyectoCierreCultivo, "Seleccione Uno")
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -51,10 +56,14 @@ Partial Class Agrupecuaria_CierreCultivo
|
||||
|
||||
If ObjGral.GetCierreCultivos(DdlTemporada.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
GvDatos.DataSource = ObjGral.DtResultados
|
||||
DT_Datos_Cierre = ObjGral.DtResultados
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
DT_Datos_Cierre = Nothing
|
||||
End If
|
||||
|
||||
OcultarmostrarControles(DT_Datos_Cierre)
|
||||
|
||||
ObjGral.Dispose()
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
@@ -63,16 +72,64 @@ Partial Class Agrupecuaria_CierreCultivo
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CierraCultivo()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Protected Sub btConsultar_Click(sender As Object, e As EventArgs)
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkAccionesCerrarCultivo_Click(sender As Object, e As EventArgs)
|
||||
|
||||
|
||||
|
||||
RegistraScript("$('#DivModalCerrarCultivo').modal('show');")
|
||||
UpModalCerrarCultivo.Update()
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Public Sub OcultarmostrarControles(ByRef DTCierreCultivos As DataTable)
|
||||
|
||||
If DTCierreCultivos IsNot Nothing AndAlso DTCierreCultivos.Rows.Count > 0 Then
|
||||
LnkAccionesCerrarCultivo.Visible = True
|
||||
Else
|
||||
LnkAccionesCerrarCultivo.Visible = False
|
||||
End If
|
||||
|
||||
UpAcciones.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CierraCultivo()
|
||||
|
||||
Dim ObjConta As New ClsContabilidad()
|
||||
ObjConta.IniciaTransacSQL()
|
||||
Dim CvePrePoliza As Integer = -1
|
||||
Dim ErrorProceso As Boolean = False
|
||||
|
||||
|
||||
Dim ImporteCierre As Decimal = DT_Datos_Cierre.SUMD("Importe")
|
||||
|
||||
CvePrePoliza = ObjConta.AddPrePolizas("CierreCultivo/Cerrar", 1, ImporteCierre, ImporteCierre, 1, TxtmodalFechaCierreCultivo.Text.ToDate, $"Cierre Temporada {DdlTemporada.Text}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjCompras.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, DdlTipoTransaccionCaja.SelectedValue, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjConta.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, DdlTipoTransaccionCaja.SelectedValue, UsuarioActual.CveEmpresa))
|
||||
|
||||
If CvePrePoliza > 0 Then
|
||||
|
||||
Else
|
||||
ErrorProceso = True
|
||||
End If
|
||||
|
||||
|
||||
If ErrorProceso Then
|
||||
ObjConta.RollBack()
|
||||
Else
|
||||
ObjConta.Commit()
|
||||
|
||||
RegistraScript("$('#DivModalCerrarCultivo').modal('hide');")
|
||||
End If
|
||||
|
||||
ObjConta.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user