Contrtos compras
This commit is contained in:
@@ -5158,7 +5158,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div id="DvModalContratos" class="modal ADS fade" role="dialog">
|
<%-- <div id="DvModalContratos" class="modal ADS fade" role="dialog">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
|
|
||||||
<!-- Modal content-->
|
<!-- Modal content-->
|
||||||
@@ -5197,7 +5197,111 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>--%>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div id="DivmodalConmtrato" class="modal ADS fade">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<asp:UpdatePanel ID="UpModalContrato" runat="server" class="modal-content rowpadding" tabindex="-1" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
|
<h4>
|
||||||
|
<asp:Label Text="Contratos" ID="LblTituloContrato" runat="server" />
|
||||||
|
</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
|
<asp:DropDownList runat="server" ID="DdlContratosObra" AutoPostBack="true" OnSelectedIndexChanged="DdlContratosCompras_SelectedIndexChanged" DataTextField="ContratoCompleto" DataValueField="CveContrato" CssClass="form-control input-sm select2me" Width="100%">
|
||||||
|
<asp:ListItem Value="-1">Seleccione uno</asp:ListItem>
|
||||||
|
</asp:DropDownList>
|
||||||
|
<label for="<%= DdlContratosObra.ClientID.ToString()%>">Contrato:</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
|
<asp:DropDownList ID="DdlTipoGastoObra" runat="server" DataTextField="TipoGasto" DataValueField="CveTipoGasto" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" Width="100%">
|
||||||
|
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||||
|
</asp:DropDownList>
|
||||||
|
<label for="<%= DdlTipoGastoObra.ClientID.ToString()%>">Tipo de Gasto:</label>
|
||||||
|
|
||||||
|
|
||||||
|
<asp:RequiredFieldValidator runat="server" Enabled="true" InitialValue="-1" Display="None" ID="RFVDdlTipoGastoObra" ControlToValidate="DdlTipoGastoObra" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Gasto''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpAplicaContrato"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="CERFVDdlTipoGastoObra" runat="server" HighlightCssClass="vco" TargetControlID="RFVDdlTipoGastoObra" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
|
||||||
|
<asp:GridView ID="GvContratosControl" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron partidas"
|
||||||
|
DataKeyNames="CveContratoDetalle,CvePS,PS,Cantidad,PU,CantidadMax,CveUnidadMedida,Abreviatura,CveSubProyecto,SubProyecto,Codigo,CveProyecto,Proyecto,IVA,RetISR,RetIVA,IEPSPorcentaje,IEPSGrabaIVA,CveClasificacion,Clasificacion,CveTipoPS,CveSATPS"
|
||||||
|
CssClass="table GVEstimacion table-advance table-hover" GridLines="None" Width="100%">
|
||||||
|
<Columns>
|
||||||
|
|
||||||
|
<asp:TemplateField HeaderText="Producto">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Label ID="LblPS" runat="server" CssClass="Texto" Text='<%# Eval("PS")%>' Width="250px"></asp:Label>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
<asp:TemplateField HeaderText="Cantidad">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:TextBox ID="TxtCantidad" Text="" type="number" step="any"
|
||||||
|
Width="90" runat="server" ></asp:TextBox>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
<asp:TemplateField HeaderText="PU">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:TextBox runat="server" ID="TxtPU" Text='<%# Eval("PU", "{0:N2}")%>' type="number" step="any" Width="60px" >
|
||||||
|
</asp:TextBox>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
<asp:TemplateField HeaderText="Importe">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:TextBox ID="TxtImporte" Text="" CssClass='<%# String.Format("ImporteCSS CssImporte{0}", Eval("CveContratoDetalle")) %>' type="number" step="any" Width="90" runat="server" onkeydown="keydownenabledtab(event)"></asp:TextBox>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
</Columns>
|
||||||
|
</asp:GridView>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-10" style="text-align:right!important">Sub Total: </div>
|
||||||
|
<div class="col-md-2"><asp:Label runat="server" ClientIDMode="Static" id="LblTotalContrato"></asp:Label></div>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
|
||||||
|
<asp:Button ID="BtnAplicarContrato" runat="server" Text="Aceptar" ClientIDMode="Static" CssClass="btn btn-success" OnClick="BtnAplicarContrato_Click" ValidationGroup="GrpAplicaContrato" CausesValidation="true" />
|
||||||
|
<button type="button" class="btn default" data-dismiss="modal">Cancelar</button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content4" ContentPlaceHolderID="JS" runat="server">
|
<asp:Content ID="Content4" ContentPlaceHolderID="JS" runat="server">
|
||||||
@@ -6292,14 +6396,80 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//function ScrollVentanaAddProducto() {
|
function ValidateCant(ncss, SubtotalValidar) {
|
||||||
// let wh = $(window).height();
|
|
||||||
|
let SubTotal = 0.0;
|
||||||
// if (wh <= 770) {
|
|
||||||
// // $('#DVBodyAddProducto').css("max-height", 450);
|
let CantidadS = $(".CssCantidad" + ncss).val();
|
||||||
// }
|
let PuS = $(".CssPU" + ncss).val();
|
||||||
//}
|
|
||||||
|
let Cantidad = 0.0;
|
||||||
|
let Pu = 0.0;
|
||||||
|
|
||||||
|
try{
|
||||||
|
|
||||||
|
if (CantidadS.length > 0 && PuS.length > 0) {
|
||||||
|
|
||||||
|
Cantidad = parseFloat(CantidadS);
|
||||||
|
Pu = parseFloat(PuS);
|
||||||
|
|
||||||
|
$(".CssImporte" + ncss).val(Cantidad * Pu);
|
||||||
|
|
||||||
|
|
||||||
|
}else{
|
||||||
|
$(".CssImporte" + ncss).val("0");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
$(".CssImporte" + ncss).val("0");
|
||||||
|
}
|
||||||
|
|
||||||
|
//$('.ImporteCSS').each(function () {
|
||||||
|
|
||||||
|
|
||||||
|
// if(! isNaN(parseFloat($(this).val()) )){
|
||||||
|
// SubTotal = SubTotal + parseFloat($(this).val())
|
||||||
|
// }
|
||||||
|
|
||||||
|
//});
|
||||||
|
|
||||||
|
ValidaBotonContrato(SubtotalValidar);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//if (SubtotalValidar == SubTotal) {
|
||||||
|
// $('#BtnAplicarContrato').prop('disabled', false);
|
||||||
|
//} else {
|
||||||
|
// $('#BtnAplicarContrato').prop('disabled', true);
|
||||||
|
//}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function ValidaBotonContrato(SubtotalValidar) {
|
||||||
|
|
||||||
|
let SubTotal = 0.0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$('.ImporteCSS').each(function () {
|
||||||
|
|
||||||
|
if (!isNaN(parseFloat($(this).val()))) {
|
||||||
|
SubTotal = SubTotal + parseFloat($(this).val())
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (SubtotalValidar == SubTotal) {
|
||||||
|
$('#BtnAplicarContrato').prop('disabled', false);
|
||||||
|
} else {
|
||||||
|
$('#BtnAplicarContrato').prop('disabled', true);
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#LblTotalContrato').text(SubTotal);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1181,6 +1181,37 @@ Partial Class Compras_Compras
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Private Property MaxIVAProcentaje As Decimal
|
||||||
|
Get
|
||||||
|
If ViewState("MaxIVAProcentaje") Is Nothing Then
|
||||||
|
Return 0
|
||||||
|
Else
|
||||||
|
Return ViewState("MaxIVAProcentaje").ToString.ToDecimal
|
||||||
|
End If
|
||||||
|
End Get
|
||||||
|
Set(value As Decimal)
|
||||||
|
ViewState("MaxIVAProcentaje") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
|
||||||
|
Private Property MAXRetIVAPorcentaje As Decimal
|
||||||
|
Get
|
||||||
|
If ViewState("MAXRetIVAPorcentaje") Is Nothing Then
|
||||||
|
Return 0
|
||||||
|
Else
|
||||||
|
Return ViewState("MAXRetIVAPorcentaje").ToString.ToDecimal
|
||||||
|
End If
|
||||||
|
End Get
|
||||||
|
Set(value As Decimal)
|
||||||
|
ViewState("MAXRetIVAPorcentaje") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1206,7 +1237,7 @@ Partial Class Compras_Compras
|
|||||||
CveConceptoContableAlmacen = 0
|
CveConceptoContableAlmacen = 0
|
||||||
EsNoDeducible = False
|
EsNoDeducible = False
|
||||||
CveTipoConcepto = 1
|
CveTipoConcepto = 1
|
||||||
CargaContratos()
|
'CargaContratos()
|
||||||
'******** Prorrateo ********************************************
|
'******** Prorrateo ********************************************
|
||||||
If UsuarioActual.Empresa.Funcionalidad(117) <> "" Then
|
If UsuarioActual.Empresa.Funcionalidad(117) <> "" Then
|
||||||
btnProrateo.Visible = True
|
btnProrateo.Visible = True
|
||||||
@@ -1781,31 +1812,42 @@ Partial Class Compras_Compras
|
|||||||
Xml.Append(Replace(Replace(Replace(nodeconceptos.OuterXml, "<cfdi:", "<"), "</cfdi:", "</"), "xmlns:cfdi=""http://www.sat.gob.mx/cfd/3""", ""))
|
Xml.Append(Replace(Replace(Replace(nodeconceptos.OuterXml, "<cfdi:", "<"), "</cfdi:", "</"), "xmlns:cfdi=""http://www.sat.gob.mx/cfd/3""", ""))
|
||||||
If ObjeFacturas.GetFacturasComparacionXML(Version, Xml.ToString, UsuarioActual.CveEmpresa) Then
|
If ObjeFacturas.GetFacturasComparacionXML(Version, Xml.ToString, UsuarioActual.CveEmpresa) Then
|
||||||
TmpDT = ObjeFacturas.DtResultados
|
TmpDT = ObjeFacturas.DtResultados
|
||||||
|
|
||||||
|
If ObjeFacturas.DtResultados.Rows.Count > 0 Then
|
||||||
|
MaxIVAProcentaje = ObjeFacturas.DtResultados.MAX("IVAPorcentaje").ToDecimal
|
||||||
|
MAXRetIVAPorcentaje = ObjeFacturas.DtResultados.MAX("RetIVAPorcentaje").ToDecimal
|
||||||
|
Else
|
||||||
|
MaxIVAProcentaje = 0
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'TmpDT.Columns.Add("IVAPorcentaje")
|
'TmpDT.Columns.Add("IVAPorcentaje")
|
||||||
'TmpDT.Columns.Add("RetIVAPorcentaje")
|
'TmpDT.Columns.Add("RetIVAPorcentaje")
|
||||||
'TmpDT.Columns.Add("RetISRPorcentaje")
|
'TmpDT.Columns.Add("RetISRPorcentaje")
|
||||||
'TmpDT.Columns.Add("IEPSPSPorcentaje")
|
'TmpDT.Columns.Add("IEPSPSPorcentaje")
|
||||||
'TmpDT.Columns.Add("IEPSPSIVAPorcentaje")
|
'TmpDT.Columns.Add("IEPSPSIVAPorcentaje")
|
||||||
SubTotalConceptos = Math.Round(TmpDT.SUM("Total"), 2).ToDecimal
|
SubTotalConceptos = Math.Round(TmpDT.SUM("Total"), 2).ToDecimal
|
||||||
AddPS2(False)
|
AddPS2(False)
|
||||||
|
|
||||||
|
|
||||||
'VALIDA QUE EL XML SI VIENE CON EL CODIGO SAT 01010101
|
'VALIDA QUE EL XML SI VIENE CON EL CODIGO SAT 01010101
|
||||||
Dim ProductosCodigoSATNoPermitidos As New StringBuilder("")
|
Dim ProductosCodigoSATNoPermitidos As New StringBuilder("")
|
||||||
For Each drr As DataRow In TmpDT.FiltraParametros("ClaveProdServ = '01010101'").Rows
|
For Each drr As DataRow In TmpDT.FiltraParametros("ClaveProdServ = '01010101'").Rows
|
||||||
|
|
||||||
ProductosCodigoSATNoPermitidos.AppendFormat("{0}</br>", drr("PS"))
|
ProductosCodigoSATNoPermitidos.AppendFormat("{0}</br>", drr("PS"))
|
||||||
|
|
||||||
Next
|
Next
|
||||||
|
|
||||||
If ProductosCodigoSATNoPermitidos.ToString.Length > 0 Then
|
If ProductosCodigoSATNoPermitidos.ToString.Length > 0 Then
|
||||||
Dim mensajeAdvertencia As String = String.Format("El comprobante contiene productos con código SAT '01010101', revise los productos:</br></br>{0}", ProductosCodigoSATNoPermitidos.ToString)
|
Dim mensajeAdvertencia As String = String.Format("El comprobante contiene productos con código SAT '01010101', revise los productos:</br></br>{0}", ProductosCodigoSATNoPermitidos.ToString)
|
||||||
Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia)
|
Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia)
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
Else
|
||||||
End If
|
|
||||||
Else
|
|
||||||
CargaConceptosXML(XMLDoc)
|
CargaConceptosXML(XMLDoc)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -1831,7 +1873,7 @@ Partial Class Compras_Compras
|
|||||||
DdlTipoCompra.Items.Add(New ListItem("Apoyo Logístico", "9"))
|
DdlTipoCompra.Items.Add(New ListItem("Apoyo Logístico", "9"))
|
||||||
DdlTipoCompra.Items.Add(New ListItem("NC Por Devolución", "11"))
|
DdlTipoCompra.Items.Add(New ListItem("NC Por Devolución", "11"))
|
||||||
|
|
||||||
|
LiAccionesContratos.Visible = True
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
'DIV ALIAS
|
'DIV ALIAS
|
||||||
@@ -20475,22 +20517,183 @@ Partial Class Compras_Compras
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
Private Sub CargaContratos()
|
'Private Sub CargaContratos()
|
||||||
DdlContrato.DataSource = GlobalDTContratos.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveContratoTipo IN(30,31) ")
|
' DdlContrato.DataSource = GlobalDTContratos.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveContratoTipo IN(30,31) ")
|
||||||
DdlContrato.DataBind()
|
' DdlContrato.DataBind()
|
||||||
DdlContrato.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todos", "-1"))
|
' DdlContrato.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todos", "-1"))
|
||||||
End Sub
|
'End Sub
|
||||||
|
|
||||||
Protected Sub BtnModalContratos_Click(sender As Object, e As EventArgs)
|
'Protected Sub BtnModalContratos_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
RegistraScript("$('#DvModalContratos').modal('hide');")
|
' RegistraScript("$('#DvModalContratos').modal('hide');")
|
||||||
CveContratoObra = DdlContrato.SelectedValue.ToEntero
|
' CveContratoObra = DdlContrato.SelectedValue.ToEntero
|
||||||
|
|
||||||
|
|
||||||
|
'End Sub
|
||||||
|
|
||||||
|
|
||||||
End Sub
|
|
||||||
Protected Sub LnkContratos_Click(sender As Object, e As EventArgs)
|
Protected Sub LnkContratos_Click(sender As Object, e As EventArgs)
|
||||||
RegistraScript("$('#DvModalContratos').modal('show');")
|
|
||||||
|
'RegistraScript("$('#DvModalContratos').modal('show');")
|
||||||
|
|
||||||
|
DdlContratosObra.Items.Clear()
|
||||||
|
DdlContratosObra.DataSource = GlobalDTContratos.FiltraParametros(String.Format($"CveContratoTipo in (30,31) AND CveEmpresa = {UsuarioActual.CveEmpresa}"))
|
||||||
|
DdlContratosObra.DataBind()
|
||||||
|
'DdlContratosObra.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||||
|
|
||||||
|
|
||||||
|
DdlTipoGastoObra.Items.Clear()
|
||||||
|
DdlTipoGastoObra.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa)
|
||||||
|
DdlTipoGastoObra.DataBind()
|
||||||
|
DdlTipoGastoObra.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
RegistraScript($"$('#DivmodalConmtrato').modal('show'); $( '#BtnAplicarContrato' ).prop( 'disabled', true ); ValidaBotonContrato({TxtSubTotal2.Text.ToDecimal});")
|
||||||
|
UpModalContrato.Update()
|
||||||
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Protected Sub DdlContratosCompras_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
|
||||||
|
If DdlContratosObra.SelectedValue.ToEntero > 0 Then
|
||||||
|
Dim ObjContratos As New ClsContratos()
|
||||||
|
|
||||||
|
If ObjContratos.GetContratosObraCompras(DdlContratosObra.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||||
|
|
||||||
|
If ObjContratos.DtResultados.Rows.Count > 0 Then
|
||||||
|
GvContratosControl.DataSource = ObjContratos.DtResultados
|
||||||
|
'BtnAplicarContrato.Visible = True
|
||||||
|
Else
|
||||||
|
GvContratosControl.DataSource = Nothing
|
||||||
|
'BtnAplicarContrato.Visible = False
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
ObjContratos.Dispose()
|
||||||
|
|
||||||
|
GvContratosControl.DataBind()
|
||||||
|
|
||||||
|
UpModalContrato.Update()
|
||||||
|
End If
|
||||||
|
|
||||||
|
RegistraScript("$( '#BtnAplicarContrato' ).prop( 'disabled', true );")
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Protected Sub BtnAplicarContrato_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
|
||||||
|
TmpDT.Rows.Clear()
|
||||||
|
|
||||||
|
Dim CveTipoGastoObra As Integer = DdlTipoGasto.SelectedValue.ToEntero
|
||||||
|
|
||||||
|
For Each GvRow As GridViewRow In GvContratosControl.Rows
|
||||||
|
|
||||||
|
Dim CveContratoDetalle As Integer = GvRow.DataKey("CveContratoDetalle").ToEntero
|
||||||
|
|
||||||
|
Dim Cantidad As Double = GvRow.FCTextBox("TxtCantidad").Text.ToDouble
|
||||||
|
Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero
|
||||||
|
Dim PS As String = GvRow.DataKey("PS")
|
||||||
|
Dim PU As Double = GvRow.FCTextBox("TxtPU").Text.ToDouble
|
||||||
|
Dim TotalPS As Double = GvRow.FCTextBox("TxtImporte").Text.ToDouble
|
||||||
|
Dim CveUnidadMedida As Integer = GvRow.DataKey("CveUnidadMedida").ToEntero
|
||||||
|
Dim UMAbreviatura As String = GvRow.DataKey("Abreviatura").ToString
|
||||||
|
|
||||||
|
Dim SubProyecto As String = GvRow.DataKey("SubProyecto")
|
||||||
|
Dim CveSubProyecto As Integer = GvRow.DataKey("CveSubProyecto").ToEntero
|
||||||
|
Dim Codigo As String = "" 'GvRow.DataKey("Codigo")
|
||||||
|
|
||||||
|
Dim Proyecto As String = GvRow.DataKey("Proyecto")
|
||||||
|
Dim CveProyecto As Integer = GvRow.DataKey("CveProyecto").ToEntero
|
||||||
|
|
||||||
|
Dim RetISR As Double = GvRow.DataKey("RetISR").ToString.ToDouble
|
||||||
|
Dim RetIVA As Double = MAXRetIVAPorcentaje 'GvRow.DataKey("RetIVA").ToString.ToDouble
|
||||||
|
|
||||||
|
Dim IvaPS As Double = MaxIVAProcentaje
|
||||||
|
|
||||||
|
Dim CveClasificacion As Integer = GvRow.DataKey("CveClasificacion").ToString.ToEntero
|
||||||
|
Dim Clasificacion As String = GvRow.DataKey("Clasificacion")
|
||||||
|
|
||||||
|
|
||||||
|
Dim IEPSPS As Double = GvRow.DataKey("IEPSPorcentaje").ToString.ToDouble
|
||||||
|
Dim IEPSPSIVA As Double = If(GvRow.DataKey("IEPSGrabaIVA").ToString = "True", IEPSPS, 0)
|
||||||
|
|
||||||
|
|
||||||
|
Dim CveTipoPS As Integer = GvRow.DataKey("CveTipoPS").ToEntero
|
||||||
|
|
||||||
|
Dim CveSATPS As Integer = GvRow.DataKey("CveSATPS").ToEntero
|
||||||
|
|
||||||
|
|
||||||
|
Dim IdCuentaPorEjercer As Integer = -1
|
||||||
|
Dim IdCuentaComprometido As Integer = -1
|
||||||
|
|
||||||
|
Dim TotalRow As Decimal = (PU * Cantidad).RoundSQL(2).ToDecimal
|
||||||
|
|
||||||
|
If Cantidad > 0 Then
|
||||||
|
|
||||||
|
|
||||||
|
AddPS(Cantidad, CveUnidadMedida, UMAbreviatura, CveClasificacion, Clasificacion, CvePS, PS, CveTipoPS, CveSubProyecto.ToString, SubProyecto, Proyecto, CveProyecto.ToString, "", PU, TotalRow, IvaPS, RetIVA, RetISR, IEPSPS, IEPSPSIVA, 0, -1, False,
|
||||||
|
CantidadF:=0, EntregaDirecta:=0, CveSATPS:=CveSATPS, CveTipoGasto:=DdlTipoGastoObra.SelectedValue.ToEntero, TipoGasto:=DdlTipoGastoObra.SelectedItem.Text, CveContratoDetalle:=CveContratoDetalle, CveCultivoCuadroDetalle:=-1)
|
||||||
|
|
||||||
|
|
||||||
|
'AddPS(Cantidad, CvePS, PS, PS, PU, 0, TotalPS,
|
||||||
|
'CveUnidadMedida, IvaPS, IEPSPS, IEPSPSIVA, CveClasificacion, UMAbreviatura, Clasificacion, CveProyecto, Proyecto,
|
||||||
|
'CveSubProyecto, SubProyecto, Codigo, -1, 0, -1, -1, IdCuentaPorEjercer,
|
||||||
|
'IdCuentaComprometido, -1, -1, -1, -1,
|
||||||
|
'-1, RetIVA, RetISR, CveContratoDetalle:=CveContratoDetalle, CveTipoGastoObra:=CveTipoGastoObra, CveCultivoCuadroDetalle:=-1, Cuadro:="")
|
||||||
|
|
||||||
|
|
||||||
|
'' ContratoObraAplciado = True
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
Next
|
||||||
|
|
||||||
|
'CargaSuperior()
|
||||||
|
'CargaDatosDetalles()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
GvPS.DataSource = TmpDT
|
||||||
|
GvPS.DataBind()
|
||||||
|
UpPS.Update()
|
||||||
|
|
||||||
|
RegistraScript("$('#DivmodalConmtrato').modal('hide')")
|
||||||
|
' UPPDetalle.Update()
|
||||||
|
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub GvContratosControl_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvContratosControl.RowDataBound
|
||||||
|
|
||||||
|
|
||||||
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||||
|
|
||||||
|
Dim CveContratoDetalle As Integer = e.Row.DataKey("CveContratoDetalle").ToEntero
|
||||||
|
|
||||||
|
e.Row.FCTextBox("TxtCantidad").CssClass = $"CssCantidad{CveContratoDetalle}"
|
||||||
|
e.Row.FCTextBox("TxtCantidad").Attributes.Add("onkeyup", $"ValidateCant('{CveContratoDetalle}',{TxtSubTotal2.Text.ToDecimal})")
|
||||||
|
|
||||||
|
e.Row.FCTextBox("TxtPU").CssClass = $"CssPU{CveContratoDetalle}"
|
||||||
|
e.Row.FCTextBox("TxtPU").Attributes.Add("onkeyup", $"ValidateCant('{CveContratoDetalle}',{TxtSubTotal2.Text.ToDecimal})")
|
||||||
|
|
||||||
|
|
||||||
|
e.Row.FCTextBox("TxtImporte").CssClass = $"ImporteCSS CssImporte{CveContratoDetalle}"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
Public Class MMensajeDevolucion
|
Public Class MMensajeDevolucion
|
||||||
|
|||||||
Reference in New Issue
Block a user