This commit is contained in:
2021-07-17 09:44:10 -07:00
11 changed files with 235 additions and 110 deletions

View File

@@ -941,7 +941,7 @@ Public Class ClsCompras
Public Function GetRepProductosServicios(CveProyecto As Integer, CveSubProyecto As String, CveCategoria As String, CveClasificacion As Integer, CvePS As Integer, FechaI As Date, Public Function GetRepProductosServicios(CveProyecto As Integer, CveSubProyecto As String, CveCategoria As String, CveClasificacion As Integer, CvePS As Integer, FechaI As Date,
FechaF As Date, CveProveedor As Integer, CveUsuario As Integer, CveEstatus As Integer, CveEmpresa As Integer, Gpo As Integer, FechaF As Date, CveProveedor As Integer, CveUsuario As Integer, CveEstatus As Integer, CveEmpresa As Integer, Gpo As Integer,
CveFamilia As Integer, CveSubFamilia As Integer, CveTipoActivoFijo As String, CveSubTipoActivoFijo As String, CveActivoFijo As Integer, TipoCambio As Integer, Optional TCEspecifico As Double = -1, Optional TipoGasto As String = "-1", CveFamilia As Integer, CveSubFamilia As Integer, CveTipoActivoFijo As String, CveSubTipoActivoFijo As String, CveActivoFijo As Integer, TipoCambio As Integer, Optional TCEspecifico As Double = -1, Optional TipoGasto As String = "-1",
Optional CveUsuarioConsulta As Integer = -1, Optional TipoDocto As String = "-1", Optional Deducible As Integer = -1) As Boolean Optional CveUsuarioConsulta As Integer = -1, Optional TipoDocto As String = "-1", Optional Deducible As Integer = -1, Optional CveCultivo As String = "-1") As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Comp_GetRepPS") DataAdapter("PA_Comp_GetRepPS")
@@ -970,6 +970,8 @@ Public Class ClsCompras
.Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta
.Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto .Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto
.Add("@Deducible", SqlDbType.Int).Value = Deducible .Add("@Deducible", SqlDbType.Int).Value = Deducible
.Add("@CveCultivo", SqlDbType.VarChar).Value = CveCultivo
End With End With
Try Try
@@ -984,8 +986,8 @@ Public Class ClsCompras
Public Function GetRepProductosServiciosDetalle(CveProyecto As Integer, CveSubProyecto As String, CveCategoria As String, CveClasificacion As Integer, CvePS As Integer, FechaI As Date, Public Function GetRepProductosServiciosDetalle(CveProyecto As Integer, CveSubProyecto As String, CveCategoria As String, CveClasificacion As Integer, CvePS As Integer, FechaI As Date,
FechaF As Date, CveProveedor As Integer, CveUsuario As Integer, CveEstatus As Integer, CveEmpresa As Integer, Gpo As Integer, FechaF As Date, CveProveedor As Integer, CveUsuario As Integer, CveEstatus As Integer, CveEmpresa As Integer, Gpo As Integer,
CveFamilia As Integer, CveSubFamilia As Integer, CveTipoActivoFijo As String, CveSubTipoActivoFijo As String, CveActivoFijo As Integer, CveFamilia As Integer, CveSubFamilia As Integer, CveTipoActivoFijo As String, CveSubTipoActivoFijo As String, CveActivoFijo As Integer,
CveMoneda As Integer, TipoCambio As Integer, Optional TCEspecifico As Double = -1, CveMoneda As Integer, TipoCambio As Integer, Optional TCEspecifico As Double = -1, Optional TipoGasto As String = "-1", Optional CveUsuarioConsulta As Integer = -1,
Optional TipoGasto As String = "-1", Optional CveUsuarioConsulta As Integer = -1, Optional TipoDocto As String = "-1", Optional Deducible As Integer = -1) As Boolean Optional TipoDocto As String = "-1", Optional Deducible As Integer = -1, Optional CveCultivo As String = "-1") As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Comp_GetRepPSDetalle") DataAdapter("PA_Comp_GetRepPSDetalle")
@@ -1018,6 +1020,7 @@ Public Class ClsCompras
.Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta
.Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto .Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto
.Add("@Deducible", SqlDbType.Int).Value = Deducible .Add("@Deducible", SqlDbType.Int).Value = Deducible
.Add("@CveCultivo", SqlDbType.VarChar).Value = CveCultivo
End With End With

View File

@@ -1541,6 +1541,47 @@ Public Class ClsInventarios
Return Retorno Return Retorno
End Function End Function
Public Function GetKardexAlmacenHorizontalAgrupado(CvePS As Integer, FechaFin As Date, CveAlmacen As Integer, CveUnidadMedida As Integer, CveProveedor As Integer, CveTipoAlmacen As Integer,
IncluyeTransitorios As Integer, CveClasificacion As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional CondicionExistencias As Integer = 0,
Optional Orden As Integer = -1, Optional Marcas As String = "-1", Optional IncluyeProyectado As Integer = -1, Optional CveAlmacenes As String = "-1") As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_KardexAlmacenHorizontalGetAgrupado")
With SqlAdapter.SelectCommand.Parameters
'.Add("@FechaI", SqlDbType.VarChar).Value = FechaI
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
.Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida
.Add("@IncluyeTransitorios", SqlDbType.Int).Value = IncluyeTransitorios
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveProveedorCompra", SqlDbType.Int).Value = CveProveedor
.Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen
.Add("@ExistenciasCondicion", SqlDbType.Int).Value = CondicionExistencias
.Add("@Orden", SqlDbType.Int).Value = Orden
.Add("@Marcas", SqlDbType.VarChar).Value = Marcas
.Add("@IncluyeProyectado", SqlDbType.TinyInt).Value = IncluyeProyectado
.Add("@CveAlmacenes", SqlDbType.NVarChar).Value = CveAlmacenes
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch Ex1 As SqlException
Me.OnError("Ocurrió un error al obtener el kardex de almacen.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Catch ex As Exception
OnError("Ocurrió un error al obtener el kardex de almacen.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function GetKardex(Entrada As Boolean, Salida As Boolean, CvePS As Integer, FechaI As String, FechaF As String, CveAlmacen As Integer, CveTiposAlmacen As String, CveUnidadMedida As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional AgruparAlmacen As Boolean = False, Optional Serie As String = "-1", Optional CveAlmacenes As String = "-1") As Boolean Public Function GetKardex(Entrada As Boolean, Salida As Boolean, CvePS As Integer, FechaI As String, FechaF As String, CveAlmacen As Integer, CveTiposAlmacen As String, CveUnidadMedida As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional AgruparAlmacen As Boolean = False, Optional Serie As String = "-1", Optional CveAlmacenes As String = "-1") As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False

View File

@@ -1139,13 +1139,11 @@
<asp:UpdatePanel runat="server" ID="UpConsignaciones" UpdateMode="Conditional"> <asp:UpdatePanel runat="server" ID="UpConsignaciones" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" style="display:none" id="DivConsignaciones" runat="server"> <div class="portlet solid grey-cascade portlet-filter" style="display:none" id="DivConsignaciones" runat="server">
<div class="portlet-title portlet-filterT" style=""> <div class="portlet-title portlet-filterT" style="">
<div class="titlefiltros caption "> <div class="titlefiltros caption ">
<ul class="list-inline" style="font-size: 14px;"> <ul class="list-inline" style="font-size: 14px;">
<li>Aplica consignación: <li>Aplica consignación:
<asp:CheckBox Text="" ID="ChkConsignacion" OnCheckedChanged="ChkConsignacion_CheckedChanged" AutoPostBack="true" Enabled="false" runat="server" /> <asp:CheckBox Text="" ID="ChkConsignacion" OnCheckedChanged="ChkConsignacion_CheckedChanged" AutoPostBack="true" Enabled="false" runat="server" />
</li> </li>
<br /> <br />
@@ -1157,14 +1155,25 @@
</li> </li>
<li runat="server" id="LiConsignacion" visible="false">Consignación: <li runat="server" id="LiConsignacion" visible="false">Consignación:
<asp:DropDownList runat="server" ID="DdlConsignacion" DataValueField="CveConsignacion" DataTextField="SerieFolioFecha" Width="180px"></asp:DropDownList> <asp:DropDownList runat="server" ID="DdlConsignacion" DataValueField="CveConsignacion" DataTextField="SerieFolioFecha" Width="180px"></asp:DropDownList>
</li> </li>
<%--<li>Folio Consignación:
<asp:TextBox ID="TxtConsignacion" Width="70px" runat="server" ValidationGroup="GrpGetConsignacion" />
<asp:RequiredFieldValidator ID="RFVConsignacion" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Folio Consignación''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGetConsignacion"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEConsignacion" runat="server" HighlightCssClass="vco" TargetControlID="RFVConsignacion" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:HiddenField runat="server" ID="HdnCveConsignacion" />
</li>--%>
</ul> </ul>
</div> </div>
<div class="tools"> <div class="tools">
<asp:Button ID="BtnVinculaConsignacion" OnClick="BtnVinculaConsignacion_Click1" Visible="false" CssClass="btn btn-primary" runat="server" Text="Vincular Consignación" /> <asp:Button ID="BtnVinculaConsignacion" OnClick="BtnVinculaConsignacion_Click1" Visible="false" CssClass="btn btn-primary" runat="server" Text="Vincular Consignación" />
<%--<asp:Button ID="BtnVinculaConsignacion" runat="server" Text="Asignar" OnClick="BtnVinculaConsignacion_Click" class="btn btn-primary" ValidationGroup="GrpGetConsignacion" />--%>
</div> </div>
</div> </div>
</div> </div>
@@ -2191,7 +2200,7 @@
<ItemTemplate> <ItemTemplate>
<%--<asp:Label runat="server" ID="LbCveAF" Text='<%# Eval("CodAF")%>'></asp:Label>--%> <%--<asp:Label runat="server" ID="LbCveAF" Text='<%# Eval("CodAF")%>'></asp:Label>--%>
<asp:TextBox ID="LblCodigo" Text='<%# Eval("CodAF")%>' runat="server" Width="100px"></asp:TextBox> <asp:TextBox ID="LblCodigo" Text='<%# Eval("CodAF")%>' runat="server" Width="100px"></asp:TextBox>
<asp:Label runat="server" ID="LblValido" Style="display: none" Text="<i class='fa fa-check' style='color:green'></i>"></asp:Label> <asp:Label runat="server" ID="LblValido" Style="display: none" Text="<i class='fa fa-check' style='color:green'></i>"></asp:Label>
<asp:HyperLink runat="server" ID="HLBuscarAF"><i class="fa fa-search" aria-hidden="true"></i></asp:HyperLink> <asp:HyperLink runat="server" ID="HLBuscarAF"><i class="fa fa-search" aria-hidden="true"></i></asp:HyperLink>
<asp:HiddenField runat="server" ID="HdnCveConcepto" Value='<%# Eval("CveConcepto")%>' /> <asp:HiddenField runat="server" ID="HdnCveConcepto" Value='<%# Eval("CveConcepto")%>' />
@@ -2401,17 +2410,15 @@
<ajax:CalendarExtender ID="Calendario" runat="server" TargetControlID="TxtFechaPago" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender> <ajax:CalendarExtender ID="Calendario" runat="server" TargetControlID="TxtFechaPago" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaC" runat="server" ControlToValidate="TxtFechaPago" Display="None" ErrorMessage="El campo <b>''Fecha de Pago''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RFVFechaC" runat="server" ControlToValidate="TxtFechaPago" Display="None" ErrorMessage="El campo <b>''Fecha de Pago''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFechaC" runat="server" ControlToValidate="TxtFechaPago" Display="None" ErrorMessage="El campo <b>''Fecha de Pago''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator> <asp:CompareValidator ID="CVFechaC" runat="server" ControlToValidate="TxtFechaPago" Display="None" ErrorMessage="El campo <b>''Fecha de Pago''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCERFVFC" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaC" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VCERFVFC" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaC" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VCECVFC" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaC" Width="350px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCECVFC" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaC" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:CompareValidator ID="CVFechaPago" runat="server" ControlToCompare="TxtFecha" ControlToValidate="TxtFechaPago" Display="None" Operator="GreaterThanEqual" Type="Date" ValidationGroup="GrpGuardar" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Pago''</b>tiene que ser mayor o igual a la fecha del documento."></asp:CompareValidator> <asp:CompareValidator ID="CVFechaPago" runat="server" ControlToCompare="TxtFecha" ControlToValidate="TxtFechaPago" Display="None" Operator="GreaterThanEqual" Type="Date" ValidationGroup="GrpGuardar" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Pago''</b>tiene que ser mayor o igual a la fecha del documento."></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCEFechaPago" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaPago" Width="350px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCEFechaPago" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaPago" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:CustomValidator runat="server" id="CBTxtFechaPago" ControlToValidate="TxtFechaPago" ClientValidationFunction="ValidaRangoDeFechas" ValidationGroup="GrpGuardar" ErrorMessage="La fecha de pago no debe de exeder de 5 años en relaciión a la fecha de la compra." Display="None" /> <asp:CustomValidator runat="server" id="CBTxtFechaPago" ControlToValidate="TxtFechaPago" ClientValidationFunction="ValidaRangoDeFechas" ValidationGroup="GrpGuardar" ErrorMessage="La fecha de pago no debe de exeder de 5 años en relación a la fecha de la compra" Display="None" />
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender8" runat="server" HighlightCssClass="vco" TargetControlID="CBTxtFechaPago" Width="350px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender8" runat="server" HighlightCssClass="vco" TargetControlID="CBTxtFechaPago" Width="350px"></ajax:ValidatorCalloutExtender>
</div> </div>
</td> </td>
<td align="left"> <td align="left">
@@ -4422,7 +4429,7 @@
<asp:UpdatePanel ID="UpIVA" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpIVA" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<div class="row"> <div class="row">
<div class="col-md-3" id="divIVA" runat="server" visible="true"> <div class="col-md-3" id="divIVA" runat="server" visible="false">
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlIVA" CssClass="form-control select2me" Style="width: 100%; display: inline-block;" runat="server" Enabled="false"> <asp:DropDownList ID="DdlIVA" CssClass="form-control select2me" Style="width: 100%; display: inline-block;" runat="server" Enabled="false">
<asp:ListItem Selected="True" Value="1.08">8%</asp:ListItem> <asp:ListItem Selected="True" Value="1.08">8%</asp:ListItem>
@@ -4565,7 +4572,6 @@
<asp:HiddenField ID="HdnPSAliasClasificacion" ClientIDMode="Static" runat="server" /> <asp:HiddenField ID="HdnPSAliasClasificacion" ClientIDMode="Static" runat="server" />
<asp:HiddenField ID="HdnPSAliasCveSATPS" ClientIDMode="Static" runat="server" /> <asp:HiddenField ID="HdnPSAliasCveSATPS" ClientIDMode="Static" runat="server" />
<asp:HiddenField ID="HdnPSAliasSATClavePS" ClientIDMode="Static" runat="server" /> <asp:HiddenField ID="HdnPSAliasSATClavePS" ClientIDMode="Static" runat="server" />
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@@ -5812,7 +5818,7 @@
} }
//var SaldoCompra = parseFloat(parseFloat($get('HdnCompraSaldo').value).toFixed(2)); //var SaldoCompra = parseFloat(parseFloat($get('HdnCompraSaldo').value).toFixed(2));
var SaldoCompra = (TotalSaldo - FnSumaValoresAnt() + txtvalue).toFixed(2); // le agrego lo del valor actual para validarlo var SaldoCompra = (Total - FnSumaValoresAnt() + txtvalue).toFixed(2); // le agrego lo del valor actual para validarlo
@@ -5843,7 +5849,7 @@
$("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2)); $("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2));
$("#LblAplicadoCompraAnt").text(FormatoNumero(FnSumaValoresAnt(), 2)); $("#LblAplicadoCompraAnt").text(FormatoNumero(FnSumaValoresAnt(), 2));
$("#LblSaldoFactura").text(FormatoNumero(TotalSaldo - FnSumaValoresAnt(), 2)); $("#LblSaldoFactura").text(FormatoNumero(Total - FnSumaValoresAnt(), 2));
} }
@@ -6034,7 +6040,6 @@
} }
$get("BtnLimpiaAF").click(); $get("BtnLimpiaAF").click();
// $get("BtnVinculaAFEdit").click();
} }
@@ -6653,6 +6658,7 @@
} }
function ValidaRangoDeFechas(sender, args) { function ValidaRangoDeFechas(sender, args) {
if ($("#TxtFecha").val().length == 10 && $("#TxtFechaPago").val().length == 10) { if ($("#TxtFecha").val().length == 10 && $("#TxtFechaPago").val().length == 10) {

View File

@@ -1427,7 +1427,7 @@ Partial Class Compras_Compras
UpLnkPaqueteriaGuias.Update() UpLnkPaqueteriaGuias.Update()
End If End If
If Not CveCompra > 0 And UsuarioActual.CveRol = 1 Then If Not CveCompra > 0 Then
LIContratos.Visible = True LIContratos.Visible = True
End If End If
@@ -3230,6 +3230,7 @@ Partial Class Compras_Compras
CambiaMoneda(False) CambiaMoneda(False)
End If End If
ViewState("CveProveedor") = ObjProveedor.CveProveedor ViewState("CveProveedor") = ObjProveedor.CveProveedor
ViewState("CveTipoProveedor") = ObjProveedor.CveTipoProveedor ViewState("CveTipoProveedor") = ObjProveedor.CveTipoProveedor
If ObjProveedor.CveTipoProveedor = 1 Then LblProveedor.Text = "Proveedor:" Else LblProveedor.Text = "Acreedor:" If ObjProveedor.CveTipoProveedor = 1 Then LblProveedor.Text = "Proveedor:" Else LblProveedor.Text = "Acreedor:"
@@ -3343,6 +3344,7 @@ Partial Class Compras_Compras
'CargaDatosEstimaciones(ObjProveedor.CveProveedor) 'CargaDatosEstimaciones(ObjProveedor.CveProveedor)
ImgBtnBuscarOC.OnClientClick = String.Format("AbrirVentana('/OC/PopUpBuscarReq.aspx?V=VOCCOMP&P={0}&T={1}&Masterimpoup=true',1000,600,'S'); return false;", ObjProveedor.CveProveedor, DdlTipoComprobante.SelectedValue) ImgBtnBuscarOC.OnClientClick = String.Format("AbrirVentana('/OC/PopUpBuscarReq.aspx?V=VOCCOMP&P={0}&T={1}&Masterimpoup=true',1000,600,'S'); return false;", ObjProveedor.CveProveedor, DdlTipoComprobante.SelectedValue)
CargaAnticipos(ObjProveedor.CveProveedor) : UpAnticipos.Update() CargaAnticipos(ObjProveedor.CveProveedor) : UpAnticipos.Update()
If UsuarioActual.Empresa.UsaAC Then If UsuarioActual.Empresa.UsaAC Then
If (TxtRetIVA.Text.ToDouble > 0 And Not ObjProveedor.IdCtaContRetIVA > 0) Or (TxtRetISR.Text.ToDouble > 0 And Not ObjProveedor.IdCtaContRetISR > 0) Then ' If (TxtRetIVA.Text.ToDouble > 0 And Not ObjProveedor.IdCtaContRetIVA > 0) Or (TxtRetISR.Text.ToDouble > 0 And Not ObjProveedor.IdCtaContRetISR > 0) Then '
ImgBtnBuscarOC.Visible = False ImgBtnBuscarOC.Visible = False
@@ -3787,7 +3789,7 @@ Partial Class Compras_Compras
'' AGREGA PS '' AGREGA PS
'AGREGA A TMPDT 'AGREGA A TMPDT
AddPS(ValorXML(node, "cantidad").ToDouble, CveUM, UMM, tCveClasif, Clasif, tCvePS, PSS, TipoPS, "-1", "SE", "SE", "-1", Obs, PU, Total, IVA, RetIVA, RetISR, IEPS, 0, Descuento, PSCodigo:=tPSCodigo, TCalculaTotales:=False, CodigoSATPS:=ValorXML(node, "ClaveProdServ").ToEntero(), CargaXml:=True, PorcentajeIVA:=PorcentajeIVA, PorcentajeRetIVA:=PorcentajeRetIVA, PorcentajeRetISR:=PorcentajeRetISR, PorcentajeIEPS:=PorcentajeIEPS) AddPS(ValorXML(node, "cantidad").ToDouble, CveUM, UMM, tCveClasif, Clasif, tCvePS, PSS, TipoPS, "-1", "SE", "SE", "-1", Obs, PU, Total, IVA, RetIVA, RetISR, IEPS, 0, Descuento, PSCodigo:=tPSCodigo, TCalculaTotales:=False, CveSATPS:=ValorXML(node, "ClaveProdServ").ToEntero(), CargaXml:=True, PorcentajeIVA:=PorcentajeIVA, PorcentajeRetIVA:=PorcentajeRetIVA, PorcentajeRetISR:=PorcentajeRetISR, PorcentajeIEPS:=PorcentajeIEPS)
@@ -3957,6 +3959,7 @@ Partial Class Compras_Compras
Dim EstatusCredito As Integer = 0 Dim EstatusCredito As Integer = 0
Dim CveSubProyecto As Integer = 0 Dim CveSubProyecto As Integer = 0
'Credito Multiple 'Credito Multiple
@@ -4644,6 +4647,7 @@ Partial Class Compras_Compras
'Compra
If ObjCompras.AddCompra(DdlTipoComprobante.SelectedValue, TxtDescripcion.Text.Trim, TxtSerie.Text.Trim, TxtFolio.Text.Trim, TxtFolioSecundario.Text.Trim, CveProveedor, TxtSubTotal.Text.ToDouble, TxtDescuento.Text.ToDouble, If ObjCompras.AddCompra(DdlTipoComprobante.SelectedValue, TxtDescripcion.Text.Trim, TxtSerie.Text.Trim, TxtFolio.Text.Trim, TxtFolioSecundario.Text.Trim, CveProveedor, TxtSubTotal.Text.ToDouble, TxtDescuento.Text.ToDouble,
LblAmortizacion.Text.ToDouble, TxtIVA.Text.ToDouble, TxtRetIVA.Text.ToDouble, TxtRetISR.Text.ToDouble, TxtIEPS.Text.ToDouble, TxtOtrosImpuestos.Text.ToDouble, LblAmortizacion.Text.ToDouble, TxtIVA.Text.ToDouble, TxtRetIVA.Text.ToDouble, TxtRetISR.Text.ToDouble, TxtIEPS.Text.ToDouble, TxtOtrosImpuestos.Text.ToDouble,
@@ -8343,9 +8347,9 @@ Partial Class Compras_Compras
'ACTUALIZA CVEFACTURA 'ACTUALIZA CVEFACTURA
If Request("CveFactura") IsNot Nothing Then If Request("CveFactura") IsNot Nothing Then
'If Not ObjCompras.UpdateCompraFactura(CveCompra, Request("CveFactura").ToEntero, TxtSerie.Text.Trim, TxtFolio.Text.Trim) Then If Not ObjCompras.UpdateCompraFactura(CveCompra, Request("CveFactura").ToEntero, TxtSerie.Text.Trim, TxtFolio.Text.Trim) Then
' TieneError = True TieneError = True
'End If End If
If UsuarioActual.Empresa.UsaAC Then If UsuarioActual.Empresa.UsaAC Then
MsgAccionAceptar = String.Format("window.opener.location.href = window.opener.location.href; window.open(""/Contabilidad/RegPoliza.aspx?IdPoliza={0}""); window.close();", IdPoliza) MsgAccionAceptar = String.Format("window.opener.location.href = window.opener.location.href; window.open(""/Contabilidad/RegPoliza.aspx?IdPoliza={0}""); window.close();", IdPoliza)
@@ -8430,20 +8434,16 @@ Partial Class Compras_Compras
Msg.Append("¿Desea realizar una evaluacion al proveedor?") Msg.Append("¿Desea realizar una evaluacion al proveedor?")
Msg.AppendFormat($"</br><a class=""Texto"" target='_blank' href=""/Compras/EvaluacionProveedor.aspx?CveEvaluacionProveedor={CveEvaluacionProveedor}"">Evaluar Proveedor.</a>") Msg.AppendFormat($"</br><a class=""Texto"" target='_blank' href=""/Compras/EvaluacionProveedor.aspx?CveEvaluacionProveedor={CveEvaluacionProveedor}"">Evaluar Proveedor.</a>")
End If End If
BtnGuardar.Enabled = False
UpFacturar.Update()
Alert(Msg.ToString, TipoMensaje.MsgInformacion, MsgAccionAceptar)
Else Else
ObjCompras.RollBack() ObjCompras.RollBack()
If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack() If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
Alert("Ocurrio un error al guardar la compra. Por favor intente nuevamente.", TipoMensaje.MsgError) Alert("Ocurrio un error al guardar la compra. Por favor intente nuevamente.", TipoMensaje.MsgError)
End If End If
BtnGuardar.Enabled = False
UpFacturar.Update()
Alert(Msg.ToString, TipoMensaje.MsgInformacion, MsgAccionAceptar)
End If End If
@@ -9664,7 +9664,8 @@ Partial Class Compras_Compras
End If End If
LblAmortizacion.Text = ImporteAnticipo.FormatoNumero LblAmortizacion.Text = ImporteAnticipo.FormatoNumero
LblAplicadoCompraAnt.Text = ImporteAnticipo.FormatoNumero
LblSaldoFactura.Text = (TxtTotal.Text.ToDecimal - ImporteAnticipo).ToString.FormatoNumero
UpPS.Update() UpPS.Update()
End If End If
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAnticipos")) RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAnticipos"))
@@ -9732,7 +9733,7 @@ Partial Class Compras_Compras
Dim ObjInventario As New ClsInventarios(ObjCompra.IniciaTransacSQL) Dim ObjInventario As New ClsInventarios(ObjCompra.IniciaTransacSQL)
Dim ObjContabilidad As New ClsContabilidad(ObjCompra.IniciaTransacSQL) Dim ObjContabilidad As New ClsContabilidad(ObjCompra.IniciaTransacSQL)
Dim ObjAF As New ClsAF(ObjCompra.IniciaTransacSQL) Dim ObjAF As New ClsAF(ObjCompra.IniciaTransacSQL)
Dim ObjContaAC As ClsContPAQi = Nothing '= New ClsContPAQi(UsuarioActual.Empresa) Dim ObjContaAC As ClsContPAQi '= New ClsContPAQi(UsuarioActual.Empresa)
Dim Retorno As Boolean = True Dim Retorno As Boolean = True
Dim CveEstatusFactura As Integer = HdnCveEstatusFactura.Value.ToEntero Dim CveEstatusFactura As Integer = HdnCveEstatusFactura.Value.ToEntero
@@ -12672,6 +12673,7 @@ Partial Class Compras_Compras
TmpDT.Rows(Indice)("PU") = TmpDT.Rows(Indice)("PU").ToString.ToDouble + tPU TmpDT.Rows(Indice)("PU") = TmpDT.Rows(Indice)("PU").ToString.ToDouble + tPU
TmpDT.Rows(Indice)("Total") = TmpDT.Rows(Indice)("Total").ToString.ToDouble + ImporteAjuste TmpDT.Rows(Indice)("Total") = TmpDT.Rows(Indice)("Total").ToString.ToDouble + ImporteAjuste
TmpDT.Rows(Indice)("IEPSPS") = (TmpDT.Rows(Indice)("Total").ToString.ToDouble() * TmpDT.Rows(Indice)("IEPSPSPorcentaje").ToString.ToDouble()).RoundAD(2) TmpDT.Rows(Indice)("IEPSPS") = (TmpDT.Rows(Indice)("Total").ToString.ToDouble() * TmpDT.Rows(Indice)("IEPSPSPorcentaje").ToString.ToDouble()).RoundAD(2)
'TmpDT.Rows(Indice)("IVA") = TmpDT.Rows(Indice)("PU").ToString.ToDecimal * TmpDT.Rows(Indice)("Cantidad").ToString.ToDecimal * TmpDT.Rows(Indice)("IVAPorcentaje").ToString.ToDecimal
TmpDT.Rows(Indice)("IVA") = (TmpDT.Rows(Indice)("PU").ToString.ToDecimal * TmpDT.Rows(Indice)("Cantidad").ToString.ToDecimal - TmpDT.Rows(Indice)("Descuento").ToString.ToDecimal) * TmpDT.Rows(Indice)("IVAPorcentaje").ToString.ToDecimal TmpDT.Rows(Indice)("IVA") = (TmpDT.Rows(Indice)("PU").ToString.ToDecimal * TmpDT.Rows(Indice)("Cantidad").ToString.ToDecimal - TmpDT.Rows(Indice)("Descuento").ToString.ToDecimal) * TmpDT.Rows(Indice)("IVAPorcentaje").ToString.ToDecimal
'Row("IEPSPS") = Math.Round(IEPSPS, DecimalesPermitidos) 'Row("IEPSPS") = Math.Round(IEPSPS, DecimalesPermitidos)
'Row("IEPSPSPorcentaje") = PorcentajeIEPS 'Row("IEPSPSPorcentaje") = PorcentajeIEPS
@@ -15066,7 +15068,7 @@ Partial Class Compras_Compras
dt = ObjContabilidad.DtResultados dt = ObjContabilidad.DtResultados
For Each dr As DataRow In dt.Rows For Each dr As DataRow In dt.Rows
If Not ObjContabilidad.UpdatePrePolizasDetalle(dr("CvePrePolizaDetalle").ToString.ToEntero, dr("Concepto").ToString, dr("CveSubProyecto").ToString.ToEntero, dr("IdCtaContable").ToString.ToEntero, CBool(dr("TipoMovto").ToString), 0, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then If Not ObjContabilidad.UpdatePrepolizasDetalle(dr("CvePrePolizaDetalle").ToString.ToEntero, dr("Concepto").ToString, dr("CveSubProyecto").ToString.ToEntero, dr("IdCtaContable").ToString.ToEntero, CBool(dr("TipoMovto").ToString), 0, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
ErrorCancelar = True : Exit For ErrorCancelar = True : Exit For
End If End If
Next Next
@@ -15446,7 +15448,7 @@ Partial Class Compras_Compras
'SI PUEDE RECIBIR POR OC Y COMPRA 'SI PUEDE RECIBIR POR OC Y COMPRA
' si usa almacen, si tiene activado que reciba por OC, y que si la compra tipo Proveedor. que lo muestre ' si usa almacen, si tiene activado que reciba por OC, y que si la compra tipo Proveedor. que lo muestre
If UsuarioActual.Empresa.UsaInventarios And UsuarioActual.Empresa.Funcionalidad(131).ToEntero > 0 AndAlso CveTipoConcepto = 1 Then If UsuarioActual.CveEmpresa = 119 AndAlso UsuarioActual.Empresa.UsaInventarios And UsuarioActual.Empresa.Funcionalidad(131).ToEntero > 0 AndAlso CveTipoConcepto = 1 Then
DivOCVinculaInv.Visible = True DivOCVinculaInv.Visible = True
End If End If
@@ -15904,7 +15906,7 @@ Partial Class Compras_Compras
'Dim Descuento As Double = gvr.FCHiddenField("HdnOC1Descuento").Value.ToDecimal 'Dim Descuento As Double = gvr.FCHiddenField("HdnOC1Descuento").Value.ToDecimal
Dim CveOrdenCompraDetalle As Integer = dr("CveOrdenCompraDetalle").ToString.ToEntero Dim CveOrdenCompraDetalle As Integer = dr("CveOrdenCompraDetalle").ToString.ToEntero
Dim EntregaDirecta As Integer = dr("EntregaDirecta").ToString.ToEntero Dim EntregaDirecta As Integer = dr("EntregaDirecta").ToString.ToEntero
Dim CodigoSATPS As Integer = gvr.FCDropDownLost("DdlSATPS").SelectedValue.ToEntero Dim CveSATPS As Integer = gvr.FCDropDownLost("DdlSATPS").SelectedValue.ToEntero
Dim CveTipoGasto As Integer = dr("CveTipoGastoObra").ToString.ToEntero Dim CveTipoGasto As Integer = dr("CveTipoGastoObra").ToString.ToEntero
Dim TipoGasto As String = dr("TipoGasto").ToString Dim TipoGasto As String = dr("TipoGasto").ToString
@@ -15921,7 +15923,7 @@ Partial Class Compras_Compras
End If End If
AddPS(Cantidad, CveUM, UM, CveClasificacion, Clasificacion, CvePS, PS, CveTipoPS, CveSubProyectoContrato, SubProyecto, Proyecto, CveProyecto, Obs, PU, Total, IVA, RetIVA, RetISR, IEPSPS, IEPSPSIVA, Descuento, CveOrdenCompraDetalle, False, AddPS(Cantidad, CveUM, UM, CveClasificacion, Clasificacion, CvePS, PS, CveTipoPS, CveSubProyectoContrato, SubProyecto, Proyecto, CveProyecto, Obs, PU, Total, IVA, RetIVA, RetISR, IEPSPS, IEPSPSIVA, Descuento, CveOrdenCompraDetalle, False,
CantidadF:=CantidadF, EntregaDirecta:=EntregaDirecta, CodigoSATPS:=CodigoSATPS, CveTipoGasto:=CveTipoGasto, TipoGasto:=TipoGasto, CveContratoDetalle:=CveContratoDetalle, CveCultivoCuadroDetalle:=CveCultivoCuadroDetalle) CantidadF:=CantidadF, EntregaDirecta:=EntregaDirecta, CveSATPS:=CveSATPS, CveTipoGasto:=CveTipoGasto, TipoGasto:=TipoGasto, CveContratoDetalle:=CveContratoDetalle, CveCultivoCuadroDetalle:=CveCultivoCuadroDetalle)
'CARGA PE 'CARGA PE
Index = TmpDT.Rows.Count - 1 Index = TmpDT.Rows.Count - 1
@@ -16170,7 +16172,7 @@ Partial Class Compras_Compras
Dim Descuento As Double = gvr.FCHiddenField("HdnOC1Descuento").Value.ToDecimal Dim Descuento As Double = gvr.FCHiddenField("HdnOC1Descuento").Value.ToDecimal
Dim CveOrdenCompraDetalle As Integer = dr("CveOrdenCompraDetalle").ToString.ToEntero Dim CveOrdenCompraDetalle As Integer = dr("CveOrdenCompraDetalle").ToString.ToEntero
Dim EntregaDirecta As Integer = dr("EntregaDirecta").ToString.ToEntero Dim EntregaDirecta As Integer = dr("EntregaDirecta").ToString.ToEntero
Dim CodigoSATPS As Integer = gvr.FCDropDownLost("DdlSATPS").SelectedValue.ToEntero Dim CveSATPS As Integer = gvr.FCDropDownLost("DdlSATPS").SelectedValue.ToEntero
Dim CveTipoGasto As Integer = -1 Dim CveTipoGasto As Integer = -1
Dim TipoGasto As String = "" Dim TipoGasto As String = ""
@@ -16184,7 +16186,7 @@ Partial Class Compras_Compras
End If End If
'AGREGA PS 'AGREGA PS
Dim IndexVinculacionOC = AddPS(Cantidad, CveUM, UM, CveClasificacion, Clasificacion, CvePS, PS, CveTipoPS, CveSubProyectoContrato, SubProyecto, Proyecto, CveProyecto, Obs, PU, Total, IVA, RetIVA, RetISR, IEPSPS, IEPSPSIVA, Descuento, CveOrdenCompraDetalle, False, CantidadF:=CantidadF, EntregaDirecta:=EntregaDirecta, CodigoSATPS:=CodigoSATPS, CveTipoGasto:=CveTipoGasto, TipoGasto:=TipoGasto) Dim IndexVinculacionOC = AddPS(Cantidad, CveUM, UM, CveClasificacion, Clasificacion, CvePS, PS, CveTipoPS, CveSubProyectoContrato, SubProyecto, Proyecto, CveProyecto, Obs, PU, Total, IVA, RetIVA, RetISR, IEPSPS, IEPSPSIVA, Descuento, CveOrdenCompraDetalle, False, CantidadF:=CantidadF, EntregaDirecta:=EntregaDirecta, CveSATPS:=CveSATPS, CveTipoGasto:=CveTipoGasto, TipoGasto:=TipoGasto)
'CARGA PE 'CARGA PE
TmpDT.Rows(IndexVinculacionOC)("CvePresupuestoEgreso") = dr("CvePresupuestoEgreso").ToString.ToEntero TmpDT.Rows(IndexVinculacionOC)("CvePresupuestoEgreso") = dr("CvePresupuestoEgreso").ToString.ToEntero
@@ -17446,6 +17448,7 @@ Partial Class Compras_Compras
If Not CveCompra > 0 Then 'cuando se está registrando manualmente y se va amortizar If Not CveCompra > 0 Then 'cuando se está registrando manualmente y se va amortizar
LblSaldoFactura.Text = TxtTotal.Text.FormatoNumero LblSaldoFactura.Text = TxtTotal.Text.FormatoNumero
UpAnticipos.Update()
End If End If
@@ -18126,10 +18129,10 @@ Partial Class Compras_Compras
Select Case Modalidad Select Case Modalidad
Case "A" 'ADD Case "A" 'ADD
Dim CodigoSATPS = -1 Dim SATClavePS = -1
Dim PSRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPS.SelectedValue.ToEntero).FiltroPrimero("") Dim PSRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPS.SelectedValue.ToEntero).FiltroPrimero("")
If PSRow IsNot Nothing Then If PSRow IsNot Nothing Then
CodigoSATPS = PSRow("SATClavePS").ToString.ToEntero SATClavePS = PSRow("SATClavePS").ToString.ToEntero
End If End If
Dim IVA As Double Dim IVA As Double
If chkImportacion.Checked Then If chkImportacion.Checked Then
@@ -18140,7 +18143,7 @@ Partial Class Compras_Compras
AddPS(TxtCantidad.Text.Trim.ToDouble, ddlUM.SelectedValue.ToEntero, ddlUM.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text, DdlPS.SelectedValue.ToEntero, DdlPS.SelectedText, HdnTipoPS.Value.ToEntero, AddPS(TxtCantidad.Text.Trim.ToDouble, ddlUM.SelectedValue.ToEntero, ddlUM.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text, DdlPS.SelectedValue.ToEntero, DdlPS.SelectedText, HdnTipoPS.Value.ToEntero,
DdlSubProyecto.SelectedValue.ToString, DdlSubProyecto.SelectedItem.Text, DdlProyecto.SelectedItem.Text, DdlProyecto.SelectedValue.ToString, TxtObsPS.Text.Trim, TxtPrecio.Text.Trim.ToDouble, Total, IVA, DdlSubProyecto.SelectedValue.ToString, DdlSubProyecto.SelectedItem.Text, DdlProyecto.SelectedItem.Text, DdlProyecto.SelectedValue.ToString, TxtObsPS.Text.Trim, TxtPrecio.Text.Trim.ToDouble, Total, IVA,
TxtRetIVAModal.Text.ToDouble / 100, TxtRetISRModal.Text.ToDouble / 100, TxtIEPSModal.Text.ToDouble / 100, 0, TxtDescuentoModal.Text.ToDouble, OtrosGastos:=TxtOtrosGastos.Text.ToDouble, CveTipoGasto:=DdlTipoGasto.SelectedValue.ToEntero, TipoGasto:=DdlTipoGasto.SelectedItem.Text, TxtRetIVAModal.Text.ToDouble / 100, TxtRetISRModal.Text.ToDouble / 100, TxtIEPSModal.Text.ToDouble / 100, 0, TxtDescuentoModal.Text.ToDouble, OtrosGastos:=TxtOtrosGastos.Text.ToDouble, CveTipoGasto:=DdlTipoGasto.SelectedValue.ToEntero, TipoGasto:=DdlTipoGasto.SelectedItem.Text,
NoDeducible:=ChkEsNoDeduciblePS.Checked, CodigoSATPS:=CodigoSATPS) NoDeducible:=ChkEsNoDeduciblePS.Checked, CveSATPS:=SATClavePS)
AddPS2() AddPS2()
LimpiaAgregar() LimpiaAgregar()
@@ -18195,7 +18198,7 @@ Partial Class Compras_Compras
Private Function AddPS(Cantidad As Double, CveUM As Integer, UM As String, CveClasificacion As Integer, Clasificacion As String, CvePS As Integer, PS As String, CveTipoPS As Integer, CveSubProyectoContrato As String, SubProyecto As String, Proyecto As String, CveProyecto As String, Private Function AddPS(Cantidad As Double, CveUM As Integer, UM As String, CveClasificacion As Integer, Clasificacion As String, CvePS As Integer, PS As String, CveTipoPS As Integer, CveSubProyectoContrato As String, SubProyecto As String, Proyecto As String, CveProyecto As String,
Obs As String, PU As Double, Total As Double, IVA As Double, RetIVA As Double, RetISR As Double, IEPSPS As Double, IEPSPSIVA As Double, Descuento As Double, Optional CveOrdenCompraDetalle As Integer = -1, Optional TCalculaTotales As Boolean = True, Obs As String, PU As Double, Total As Double, IVA As Double, RetIVA As Double, RetISR As Double, IEPSPS As Double, IEPSPSIVA As Double, Descuento As Double, Optional CveOrdenCompraDetalle As Integer = -1, Optional TCalculaTotales As Boolean = True,
Optional PSCodigo As String = "-", Optional PSDescripcion As String = "-", Optional CantidadF As Double = -1, Optional EntregaDirecta As Integer = -1, Optional OtrosGastos As Double = 0, Optional PSCodigo As String = "-", Optional PSDescripcion As String = "-", Optional CantidadF As Double = -1, Optional EntregaDirecta As Integer = -1, Optional OtrosGastos As Double = 0,
Optional CodigoSATPS As Integer = -1, Optional CargaXml As Boolean = False, Optional CveTipoGasto As Integer = -1, Optional TipoGasto As String = "", Optional PorcentajeIVA As Double = 0, Optional CveSATPS As Integer = -1, Optional CargaXml As Boolean = False, Optional CveTipoGasto As Integer = -1, Optional TipoGasto As String = "", Optional PorcentajeIVA As Double = 0,
Optional PorcentajeIEPS As Double = 0, Optional PorcentajeRetIVA As Double = 0, Optional PorcentajeRetISR As Double = 0, Optional NoDeducible As Boolean = False, Optional CveContratoDetalle As Integer = -1, Optional CveCultivoCuadroDetalle As Integer = -1) As Integer Optional PorcentajeIEPS As Double = 0, Optional PorcentajeRetIVA As Double = 0, Optional PorcentajeRetISR As Double = 0, Optional NoDeducible As Boolean = False, Optional CveContratoDetalle As Integer = -1, Optional CveCultivoCuadroDetalle As Integer = -1) As Integer
Dim Row As DataRow = Nothing Dim Row As DataRow = Nothing
@@ -18235,15 +18238,15 @@ Partial Class Compras_Compras
Row("Consec") = TmpDT.Rows.Count + 1 Row("Consec") = TmpDT.Rows.Count + 1
End If End If
If Version = "3.3" And CodigoSATPS > 0 Then If Version = "3.3" And CveSATPS > 0 Then
Dim DrPSSAT As DataRow = Nothing Dim DrPSSAT As DataRow = Nothing
If CargaXml Then If CargaXml Then
DrPSSAT = GlobalDTPSATPS("-1", CodigoSATPS.ToString).FiltroPrimero("") DrPSSAT = GlobalDTPSATPS("-1", CveSATPS.ToString).FiltroPrimero("")
'If GlobalDTPSATPS().FiltraParametros(String.Format("SATClavePS={0}", CveSATPS)).Rows.Count > 0 Then 'If GlobalDTPSATPS().FiltraParametros(String.Format("SATClavePS={0}", CveSATPS)).Rows.Count > 0 Then
' DrPSSAT = GlobalDTPSATPS().FiltraParametros(String.Format("SATClavePS={0}", CveSATPS)).Rows(0) ' DrPSSAT = GlobalDTPSATPS().FiltraParametros(String.Format("SATClavePS={0}", CveSATPS)).Rows(0)
'End If 'End If
Else Else
DrPSSAT = GlobalDTPSATPS("-1", CodigoSATPS.ToString).FiltroPrimero("") '= GlobalDTPSATPS().FiltroPrimero(String.Format("SATClavePS={0}", CveSATPS)) DrPSSAT = GlobalDTPSATPS("-1", CveSATPS.ToString).FiltroPrimero("") '= GlobalDTPSATPS().FiltroPrimero(String.Format("SATClavePS={0}", CveSATPS))
'If GlobalDTPSATPS().FiltraParametros(String.Format("CveSATPS={0}", CveSATPS)).Rows.Count > 0 Then 'If GlobalDTPSATPS().FiltraParametros(String.Format("CveSATPS={0}", CveSATPS)).Rows.Count > 0 Then
' DrPSSAT = GlobalDTPSATPS().FiltraParametros(String.Format("CveSATPS={0}", CveSATPS)).Rows(0) ' DrPSSAT = GlobalDTPSATPS().FiltraParametros(String.Format("CveSATPS={0}", CveSATPS)).Rows(0)
'End If 'End If
@@ -18667,9 +18670,6 @@ Partial Class Compras_Compras
DdlUnidadAlias.DataBind() DdlUnidadAlias.DataBind()
HdnPSAliasCveClasificacion.Value = DrPS("CveClasificacion").ToString HdnPSAliasCveClasificacion.Value = DrPS("CveClasificacion").ToString
HdnPSAliasClasificacion.Value = DrPS("Clasificacion").ToString HdnPSAliasClasificacion.Value = DrPS("Clasificacion").ToString
HdnPSAliasCveSATPS.Value = DrPS("CveSATPS").ToString
HdnPSAliasSATClavePS.Value = DrPS("SATClavePS").ToString
End If End If
End If End If
UpPSAlias.Update() UpPSAlias.Update()

View File

@@ -188,8 +188,9 @@
<%-- <asp:DropDownList ID="DdlSubProyecto" Width="100%" CssClass="select2me" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto"> <%-- <asp:DropDownList ID="DdlSubProyecto" Width="100%" CssClass="select2me" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem> <asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>--%> </asp:DropDownList>--%>
<asp:ListBox ID="DdlSubProyecto" SelectionMode="Multiple" data-text="Todos" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server"></asp:ListBox> <asp:ListBox ID="DdlSubProyecto" SelectionMode="Multiple" data-text="Todos" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server" AutoPostBack="true"></asp:ListBox>
</div> </div>
<label class="col-md-1 truncate">Estatus</label> <label class="col-md-1 truncate">Estatus</label>
<div class="col-md-2"> <div class="col-md-2">
<asp:DropDownList ID="DdlEstatus" Width="100%" runat="server" CssClass="select2me" AppendDataBoundItems="true" DataTextField="EstatusFactura" DataValueField="CveEstatusFactura"> <asp:DropDownList ID="DdlEstatus" Width="100%" runat="server" CssClass="select2me" AppendDataBoundItems="true" DataTextField="EstatusFactura" DataValueField="CveEstatusFactura">
@@ -259,6 +260,10 @@
<asp:ListItem Text="No deducible" Value="1"></asp:ListItem> <asp:ListItem Text="No deducible" Value="1"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<label id="lblCultivo" runat="server" class="col-md-1 truncate">Cultivo </label>
<div class="col-md-2" id="DivCultivo" runat="server">
<asp:ListBox ID="DdlCultivo" SelectionMode="Multiple" data-text="Todos" AppendDataBoundItems="true" DataTextField="Cuadro" DataValueField="CveCultivoCuadroDetalle" CssClass="ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server"></asp:ListBox>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -129,6 +129,16 @@ Partial Class Compras_RepProductosServicios
'Carga Tipo Centro de Costo 'Carga Tipo Centro de Costo
CargaTipoCentroCosto() CargaTipoCentroCosto()
If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 Then
lblCultivo.Visible = True
DivCultivo.Visible = True
Else
lblCultivo.Visible = False
DivCultivo.Visible = False
DdlSubProyecto.AutoPostBack = False
End If
'CARGA COSTOS 'CARGA COSTOS
If UsuarioActual.CveEmpresa = 66 Then If UsuarioActual.CveEmpresa = 66 Then
@@ -244,6 +254,8 @@ Partial Class Compras_RepProductosServicios
Dim TipoGasto As String = IIf(DdlTipoGasto.GetSelectedValuesM = "", "-1", DdlTipoGasto.GetSelectedValuesM).ToString Dim TipoGasto As String = IIf(DdlTipoGasto.GetSelectedValuesM = "", "-1", DdlTipoGasto.GetSelectedValuesM).ToString
Dim Categoria As String = IIf(DdlCategoria.GetSelectedValuesM = "", "-1", DdlCategoria.GetSelectedValuesM).ToString Dim Categoria As String = IIf(DdlCategoria.GetSelectedValuesM = "", "-1", DdlCategoria.GetSelectedValuesM).ToString
Dim SubProyectos As String = IIf(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM).ToString Dim SubProyectos As String = IIf(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM).ToString
Dim Cultivo As String = IIf(DdlCultivo.GetSelectedValuesM = "", "-1", DdlCultivo.GetSelectedValuesM).ToString
Dim TipoAF As String = IIf(DdlTipoAF.GetSelectedValuesM = "", "-1", DdlTipoAF.GetSelectedValuesM).ToString Dim TipoAF As String = IIf(DdlTipoAF.GetSelectedValuesM = "", "-1", DdlTipoAF.GetSelectedValuesM).ToString
Dim SubTipoAF As String = IIf(DdlSubTipoAF.GetSelectedValuesM = "", "-1", DdlSubTipoAF.GetSelectedValuesM).ToString Dim SubTipoAF As String = IIf(DdlSubTipoAF.GetSelectedValuesM = "", "-1", DdlSubTipoAF.GetSelectedValuesM).ToString
@@ -253,7 +265,7 @@ Partial Class Compras_RepProductosServicios
DdlPS.SelectedValue.ToEntero, FechaI, FechaF, DdlProveedor.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero, DdlPS.SelectedValue.ToEntero, FechaI, FechaF, DdlProveedor.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero,
UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, DdlFamilia.SelectedValue.ToEntero, DdlSubFamilia.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, DdlFamilia.SelectedValue.ToEntero, DdlSubFamilia.SelectedValue.ToEntero,
TipoAF, SubTipoAF, DdlAF.SelectedValue.ToEntero, TipoCambio, TCEspecifico:=TCEspecifico, TipoGasto:=TipoGasto, CveUsuarioConsulta:=UsuarioActual.CveUsuario, TipoAF, SubTipoAF, DdlAF.SelectedValue.ToEntero, TipoCambio, TCEspecifico:=TCEspecifico, TipoGasto:=TipoGasto, CveUsuarioConsulta:=UsuarioActual.CveUsuario,
TipoDocto:=DdlTipoDocto.SelectedValue, Deducible:=DdlDeducible.SelectedValue.ToEntero) Then TipoDocto:=DdlTipoDocto.SelectedValue, Deducible:=DdlDeducible.SelectedValue.ToEntero, CveCultivo:=Cultivo) Then
DtDatos = ObjCompras.DtResultados DtDatos = ObjCompras.DtResultados
GvDatos.DataSource = DtDatos GvDatos.DataSource = DtDatos
@@ -331,11 +343,11 @@ Partial Class Compras_RepProductosServicios
End If End If
Dim Liga = String.Format("/Compras/RepProductosServiciosDetalle.aspx?GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveEstatusFactura={7}&FechaI={8}&FechaF={9}&CveProyecto={10}&CveSubProyecto={11}&CveCategoria={12}&CveClasificacion={13}&CvePS={14}&CveFamilia={15}&CveSubFamilia={16}&CveTipoAF={17}&CveSubTipoAF={18}&CveAF={19}&CveMoneda={20}&CveTipoGasto={21}&TipoCambio={22}&TCEspecifico={23}&Deducible={24}", Dim Liga = String.Format("/Compras/RepProductosServiciosDetalle.aspx?GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveEstatusFactura={7}&FechaI={8}&FechaF={9}&CveProyecto={10}&CveSubProyecto={11}&CveCategoria={12}&CveClasificacion={13}&CvePS={14}&CveFamilia={15}&CveSubFamilia={16}&CveTipoAF={17}&CveSubTipoAF={18}&CveAF={19}&CveMoneda={20}&CveTipoGasto={21}&TipoCambio={22}&TCEspecifico={23}&Deducible={24}&CveCultivo={25}",
DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"),
e.Row.DBCampo("CveEstatusFactura"), FechaI, FechaF, e.Row.DBCampo("CveProyecto"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveCategoria"), e.Row.DBCampo("CveClasificacion"), e.Row.DBCampo("CveEstatusFactura"), FechaI, FechaF, e.Row.DBCampo("CveProyecto"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveCategoria"), e.Row.DBCampo("CveClasificacion"),
e.Row.DBCampo("CvePS"), e.Row.DBCampo("CveFamilia"), e.Row.DBCampo("CveSubFamilia"), e.Row.DBCampo("CveTipoAF"), e.Row.DBCampo("CveSubTipoAF"), e.Row.DBCampo("CveAF"), e.Row.DBCampo("CveMoneda"), e.Row.DBCampo("CvePS"), e.Row.DBCampo("CveFamilia"), e.Row.DBCampo("CveSubFamilia"), e.Row.DBCampo("CveTipoAF"), e.Row.DBCampo("CveSubTipoAF"), e.Row.DBCampo("CveAF"), e.Row.DBCampo("CveMoneda"),
DdlTipoGasto.GetSelectedValuesM, e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), DdlDeducible.SelectedValue.ToEntero) DdlTipoGasto.GetSelectedValuesM, e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), DdlDeducible.SelectedValue.ToEntero, e.Row.DBCampo("CveCultivo"))
If Not e.Row.DBCampo("GpoID") = "1" Then If Not e.Row.DBCampo("GpoID") = "1" Then
@@ -385,6 +397,18 @@ Partial Class Compras_RepProductosServicios
' DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1")) ' DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub End Sub
Protected Sub DdlSubProyecto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlSubProyecto.SelectedIndexChanged
DdlCultivo.Items.Clear()
If DdlSubProyecto.GetSelectedValuesM(True) <> "" Then
DdlCultivo.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveSubProyecto IN ({0})", DdlSubProyecto.GetSelectedValuesM(True)))
DdlCultivo.DataBind()
Else
DdlCultivo.DataSource = Nothing
DdlCultivo.DataBind()
End If
' DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
Protected Sub DdlFamilia_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlFamilia.SelectedIndexChanged Protected Sub DdlFamilia_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlFamilia.SelectedIndexChanged
DdlSubFamilia.Items.Clear() DdlSubFamilia.Items.Clear()

View File

@@ -251,6 +251,10 @@
<asp:ListItem Text="No deducible" Value="1"></asp:ListItem> <asp:ListItem Text="No deducible" Value="1"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<label id="lblCultivo" runat="server" class="col-md-1 truncate">Cultivo </label>
<div class="col-md-2" id="DivCultivo" runat="server">
<asp:ListBox ID="DdlCultivo" SelectionMode="Multiple" data-text="Todos" AppendDataBoundItems="true" DataTextField="Cuadro" DataValueField="CveCultivoCuadroDetalle" CssClass="ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server"></asp:ListBox>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -72,7 +72,7 @@ Partial Class Compras_RepProductosServiciosDetalle
#Region "CARGAS" #Region "CARGAS"
Private Sub InicializaValores() Private Sub InicializaValores()
Dim Grupo, Proyecto, SubProyecto, Categoria, Clasificacion, PS, Proveedor, Estatus, Usuario, Familia, SubFamilia, TipoActivoFijo, SubTipoActivoFijo, ActivoFijo, TipoGasto As String Dim Grupo, Proyecto, SubProyecto, Categoria, Clasificacion, PS, Proveedor, Estatus, Usuario, Familia, SubFamilia, TipoActivoFijo, SubTipoActivoFijo, ActivoFijo, TipoGasto, CveCultivo As String
Dim Anio, Mes, AnioMes, Fecha, FechaI, FechaF, TipoDocto, Deducible As String Dim Anio, Mes, AnioMes, Fecha, FechaI, FechaF, TipoDocto, Deducible As String
Grupo = If(Request("GPO") IsNot Nothing AndAlso Request("GPO").ToEntero() > 0, Request("GPO").ToEntero(), -1).ToString Grupo = If(Request("GPO") IsNot Nothing AndAlso Request("GPO").ToEntero() > 0, Request("GPO").ToEntero(), -1).ToString
@@ -82,6 +82,7 @@ Partial Class Compras_RepProductosServiciosDetalle
SubProyecto = If(Request("CveSubProyecto") IsNot Nothing AndAlso Request("CveSubProyecto") <> "", Request("CveSubProyecto"), "-1").ToString SubProyecto = If(Request("CveSubProyecto") IsNot Nothing AndAlso Request("CveSubProyecto") <> "", Request("CveSubProyecto"), "-1").ToString
SubProyecto = If(Request("CveSubProyecto") IsNot Nothing AndAlso Request("CveSubProyecto").ToEntero() = -2, "-2", SubProyecto) SubProyecto = If(Request("CveSubProyecto") IsNot Nothing AndAlso Request("CveSubProyecto").ToEntero() = -2, "-2", SubProyecto)
CveCultivo = If(Request("CveCultivo") IsNot Nothing AndAlso Request("CveCultivo") <> "", Request("CveCultivo"), "-1").ToString
TipoGasto = If(Request("CveTipoGasto") IsNot Nothing AndAlso Request("CveTipoGasto") <> "", Request("CveTipoGasto"), "-1").ToString TipoGasto = If(Request("CveTipoGasto") IsNot Nothing AndAlso Request("CveTipoGasto") <> "", Request("CveTipoGasto"), "-1").ToString
Categoria = If(Request("CveCategoria") IsNot Nothing AndAlso Request("CveCategoria") <> "", Request("CveCategoria"), "-1").ToString Categoria = If(Request("CveCategoria") IsNot Nothing AndAlso Request("CveCategoria") <> "", Request("CveCategoria"), "-1").ToString
TipoActivoFijo = If(Request("CveTipoAF") IsNot Nothing AndAlso Request("CveTipoAF") <> "", Request("CveTipoAF"), "-1").ToString TipoActivoFijo = If(Request("CveTipoAF") IsNot Nothing AndAlso Request("CveTipoAF") <> "", Request("CveTipoAF"), "-1").ToString
@@ -133,13 +134,17 @@ Partial Class Compras_RepProductosServiciosDetalle
txtFechaF.Text = FechaF txtFechaF.Text = FechaF
End If End If
End If End If
DdlProyecto.SelectedValueExist(Proyecto)
If DivProyecto.Visible Then CargaSubProyecto()
'CARGA LISTBOXs 'CARGA LISTBOXs
DdlSubProyecto.SelectedValuesIfExistM(SubProyecto) DdlSubProyecto.SelectedValuesIfExistM(SubProyecto)
DdlTipoGasto.SelectedValuesIfExistM(TipoGasto) DdlTipoGasto.SelectedValuesIfExistM(TipoGasto)
DdlCategoria.SelectedValuesIfExistM(Categoria) DdlCategoria.SelectedValuesIfExistM(Categoria)
DdlTipoAF.SelectedValuesIfExistM(TipoActivoFijo) DdlTipoAF.SelectedValuesIfExistM(TipoActivoFijo)
DdlSubTipoAF.SelectedValuesIfExistM(SubTipoActivoFijo) DdlSubTipoAF.SelectedValuesIfExistM(SubTipoActivoFijo)
If SubProyecto <> "" Then CargaCultivo()
DdlCultivo.SelectedValuesIfExistM(CveCultivo)
'END CARGA LISTBOXs 'END CARGA LISTBOXs
'DdlCategoria.SelectedValueExist(Categoria) 'DdlCategoria.SelectedValueExist(Categoria)
@@ -148,13 +153,12 @@ Partial Class Compras_RepProductosServiciosDetalle
DdlPS.SelectedValue = PS DdlPS.SelectedValue = PS
DdlPS.SelectedText = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=PS.ToEntero)(0)("PSCodigo").ToString DdlPS.SelectedText = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=PS.ToEntero)(0)("PSCodigo").ToString
End If End If
DdlProyecto.SelectedValueExist(Proyecto)
If DivProyecto.Visible Then CargaSubProyecto()
'DdlSubProyecto.SelectedValueExist(SubProyecto) 'DdlSubProyecto.SelectedValueExist(SubProyecto)
DdlFamilia.SelectedValueExist(Familia) DdlFamilia.SelectedValueExist(Familia)
DdlSubFamilia.SelectedValueExist(SubFamilia) DdlSubFamilia.SelectedValueExist(SubFamilia)
DdlProveedor.SelectedValue = Proveedor DdlProveedor.SelectedValue = Proveedor
If DdlProveedor.SelectedValue.ToEntero > 0 Then If Proveedor.ToEntero > 0 Then
DdlProveedor.SelectedText = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltraParametros($"CveProveedor = {Proveedor}").Rows(0)("RazonSocial").ToString DdlProveedor.SelectedText = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltraParametros($"CveProveedor = {Proveedor}").Rows(0)("RazonSocial").ToString
Else Else
DdlProveedor.SelectedText = "Todos" DdlProveedor.SelectedText = "Todos"
@@ -172,17 +176,16 @@ Partial Class Compras_RepProductosServiciosDetalle
DdlGrupo.SelectedValueExist(Grupo) DdlGrupo.SelectedValueExist(Grupo)
CargaDatos(Proyecto.ToEntero, SubProyecto, Categoria, Clasificacion.ToEntero, PS.ToEntero, Proveedor.ToEntero, Usuario.ToEntero, Estatus.ToEntero, Grupo.ToEntero, Familia.ToEntero, SubFamilia.ToEntero, TipoActivoFijo, SubTipoActivoFijo, ActivoFijo.ToEntero, TipoGasto) CargaDatos(Proyecto.ToEntero, SubProyecto, Categoria, Clasificacion.ToEntero, PS.ToEntero, Proveedor.ToEntero, Usuario.ToEntero, Estatus.ToEntero, Grupo.ToEntero, Familia.ToEntero, SubFamilia.ToEntero, TipoActivoFijo, SubTipoActivoFijo, ActivoFijo.ToEntero, TipoGasto, CveCultivo)
End Sub End Sub
Private Sub SetValues() Private Sub SetValues()
'Cargo Proyectos 'Cargo Proyectos
DdlProveedor.setEsWebService(True) DdlProyecto.DataSource = GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1)
DdlProveedor.Attributes.Add("data-metodo", "getproveedores") DdlProyecto.DataBind()
DdlProveedor.SelectedText = "Todos"
DdlProveedor.SelectedValue = "-1"
'CAarga Tipos de Gasto 'CAarga Tipos de Gasto
DdlTipoGasto.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa) DdlTipoGasto.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa)
@@ -354,6 +357,7 @@ Partial Class Compras_RepProductosServiciosDetalle
Dim TipoGasto As String = IIf(DdlTipoGasto.GetSelectedValuesM = "", "-1", DdlTipoGasto.GetSelectedValuesM).ToString Dim TipoGasto As String = IIf(DdlTipoGasto.GetSelectedValuesM = "", "-1", DdlTipoGasto.GetSelectedValuesM).ToString
Dim Categoria As String = IIf(DdlCategoria.GetSelectedValuesM = "", "-1", DdlCategoria.GetSelectedValuesM).ToString Dim Categoria As String = IIf(DdlCategoria.GetSelectedValuesM = "", "-1", DdlCategoria.GetSelectedValuesM).ToString
Dim SubProyectos As String = IIf(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM).ToString Dim SubProyectos As String = IIf(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM).ToString
Dim Cultivo As String = IIf(DdlCultivo.GetSelectedValuesM = "", "-1", DdlCultivo.GetSelectedValuesM).ToString
Dim TipoAF As String = IIf(DdlTipoAF.GetSelectedValuesM = "", "-1", DdlTipoAF.GetSelectedValuesM).ToString Dim TipoAF As String = IIf(DdlTipoAF.GetSelectedValuesM = "", "-1", DdlTipoAF.GetSelectedValuesM).ToString
Dim SubTipoAF As String = IIf(DdlSubTipoAF.GetSelectedValuesM = "", "-1", DdlSubTipoAF.GetSelectedValuesM).ToString Dim SubTipoAF As String = IIf(DdlSubTipoAF.GetSelectedValuesM = "", "-1", DdlSubTipoAF.GetSelectedValuesM).ToString
@@ -364,7 +368,7 @@ Partial Class Compras_RepProductosServiciosDetalle
DdlPS.SelectedValue.ToEntero, FechaI, FechaF, DdlProveedor.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero, DdlPS.SelectedValue.ToEntero, FechaI, FechaF, DdlProveedor.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero,
UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, DdlFamilia.SelectedValue.ToEntero, DdlSubFamilia.SelectedValue.ToEntero, TipoAF, SubTipoAF, UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, DdlFamilia.SelectedValue.ToEntero, DdlSubFamilia.SelectedValue.ToEntero, TipoAF, SubTipoAF,
DdlAF.SelectedValue.ToEntero, CveMoneda, TipoCambio, TCEspecifico:=TCEspecifico, TipoGasto:=TipoGasto, CveUsuarioConsulta:=UsuarioActual.CveUsuario, DdlAF.SelectedValue.ToEntero, CveMoneda, TipoCambio, TCEspecifico:=TCEspecifico, TipoGasto:=TipoGasto, CveUsuarioConsulta:=UsuarioActual.CveUsuario,
TipoDocto:=DdlTipoDocto.SelectedValue, Deducible:=DdlDeducible.SelectedValue.ToEntero) Then TipoDocto:=DdlTipoDocto.SelectedValue, Deducible:=DdlDeducible.SelectedValue.ToEntero, CveCultivo:=Cultivo) Then
DtDatos = ObjCompras.DtResultados DtDatos = ObjCompras.DtResultados
Else Else
DtDatos = Nothing DtDatos = Nothing
@@ -376,14 +380,16 @@ Partial Class Compras_RepProductosServiciosDetalle
Agrupador = DdlGrupo.SelectedItem.Text Agrupador = DdlGrupo.SelectedItem.Text
End Sub End Sub
Private Sub CargaDatos(Proyecto As Integer, SubProyecto As String, Categoria As String, Clasificacion As Integer, PS As Integer, Proveedor As Integer, Usuario As Integer, Estatus As Integer, Grupo As Integer, Familia As Integer, SubFamilia As Integer, TipoActivoFijo As String, SubTipoActivoFijo As String, ActivoFijo As Integer, TipoGasto As String) Private Sub CargaDatos(Proyecto As Integer, SubProyecto As String, Categoria As String, Clasificacion As Integer, PS As Integer, Proveedor As Integer, Usuario As Integer, Estatus As Integer, Grupo As Integer, Familia As Integer, SubFamilia As Integer, TipoActivoFijo As String, SubTipoActivoFijo As String, ActivoFijo As Integer, TipoGasto As String, CveCultivo As String)
Dim ObjCompras As New ClsCompras() Dim ObjCompras As New ClsCompras()
Dim FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim().ToDate, MinFecha) Dim FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim().ToDate, MinFecha)
Dim FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim().ToDate, MaxFecha) Dim FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim().ToDate, MaxFecha)
If RblTipoCambio.SelectedValue.ToEntero = 3 And TxtEspecifico.Text <> "" Then TCEspecifico = TxtEspecifico.Text.ToDouble Else TCEspecifico = -1 If RblTipoCambio.SelectedValue.ToEntero = 3 And TxtEspecifico.Text <> "" Then TCEspecifico = TxtEspecifico.Text.ToDouble Else TCEspecifico = -1
If ObjCompras.GetRepProductosServiciosDetalle(Proyecto, SubProyecto, Categoria, Clasificacion, PS, FechaI, FechaF, Proveedor, Usuario, Estatus, UsuarioActual.CveEmpresa, Grupo, Familia, SubFamilia, TipoActivoFijo, SubTipoActivoFijo, ActivoFijo, CveMoneda, TipoCambio, TCEspecifico:=TCEspecifico, TipoGasto:=TipoGasto, CveUsuarioConsulta:=UsuarioActual.CveUsuario, TipoDocto:=DdlTipoDocto.SelectedValue, Deducible:=DdlDeducible.SelectedValue.ToEntero) Then If ObjCompras.GetRepProductosServiciosDetalle(Proyecto, SubProyecto, Categoria, Clasificacion, PS, FechaI, FechaF, Proveedor, Usuario, Estatus, UsuarioActual.CveEmpresa, Grupo,
Familia, SubFamilia, TipoActivoFijo, SubTipoActivoFijo, ActivoFijo, CveMoneda, TipoCambio, TCEspecifico:=TCEspecifico, TipoGasto:=TipoGasto,
CveUsuarioConsulta:=UsuarioActual.CveUsuario, TipoDocto:=DdlTipoDocto.SelectedValue, Deducible:=DdlDeducible.SelectedValue.ToEntero, CveCultivo:=CveCultivo) Then
DtDatos = ObjCompras.DtResultados DtDatos = ObjCompras.DtResultados
Else Else
DtDatos = Nothing DtDatos = Nothing
@@ -404,6 +410,17 @@ Partial Class Compras_RepProductosServiciosDetalle
End If End If
'DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1")) 'DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub End Sub
Private Sub CargaCultivo()
DdlCultivo.Items.Clear()
If DdlSubProyecto.GetSelectedValuesM(True) <> "" Then
DdlCultivo.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveSubProyecto IN ({0})", DdlSubProyecto.GetSelectedValuesM(True)))
DdlCultivo.DataBind()
Else
DdlCultivo.DataSource = Nothing
DdlCultivo.DataBind()
End If
'DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
#End Region #End Region
@@ -411,6 +428,10 @@ Partial Class Compras_RepProductosServiciosDetalle
Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProyecto.SelectedIndexChanged Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProyecto.SelectedIndexChanged
CargaSubProyecto() CargaSubProyecto()
End Sub End Sub
Protected Sub DdlSubProyecto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlSubProyecto.SelectedIndexChanged
CargaCultivo()
' DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
'Protected Sub DdlCategoria_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCategoria.SelectedIndexChanged 'Protected Sub DdlCategoria_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCategoria.SelectedIndexChanged
' CargaClasificaciones(DdlCategoria.SelectedValue.ToEntero) ' CargaClasificaciones(DdlCategoria.SelectedValue.ToEntero)

View File

@@ -114,7 +114,7 @@ Partial Class Contabilidad_ContabilidadElectronica
'CABECERA 'CABECERA
Str.Append("<?xml version=""1.0"" encoding=""UTF-8""?>") Str.Append("<?xml version=""1.0"" encoding=""UTF-8""?>")
Str.Append("<catalogocuentas:Catalogo xsi:schemaLocation=""www.sat.gob.mx/esquemas/ContabilidadE/1_1/CatalogoCuentas CatalogoCuentas_1_1.xsd"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" Version=""1.1"" ") Str.Append("<catalogocuentas:Catalogo xsi:schemaLocation=""www.sat.gob.mx/esquemas/ContabilidadE/1_1/CatalogoCuentas/CatalogoCuentas_1_1.xsd"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" Version=""1.1"" ")
Str.AppendFormat("RFC=""{0}"" ", UsuarioActual.Empresa.RFC) Str.AppendFormat("RFC=""{0}"" ", UsuarioActual.Empresa.RFC)
Str.AppendFormat("Mes=""{0}"" ", DdlPeriodo.SelectedValue) Str.AppendFormat("Mes=""{0}"" ", DdlPeriodo.SelectedValue)
Str.AppendFormat("Anio=""{0}"" ", DdlEjercicio.SelectedValue) Str.AppendFormat("Anio=""{0}"" ", DdlEjercicio.SelectedValue)
@@ -131,7 +131,7 @@ Partial Class Contabilidad_ContabilidadElectronica
Str.AppendFormat("NumCta=""{0}"" ", Dr("Codigo").ToString) Str.AppendFormat("NumCta=""{0}"" ", Dr("Codigo").ToString)
Str.AppendFormat("Desc=""{0}"" ", Dr("Nombre").ToString) Str.AppendFormat("Desc=""{0}"" ", Dr("Nombre").ToString)
Str.AppendFormat("SubCtaDe=""{0}"" ", Dr("CodigoPadre").ToString) Str.AppendFormat("SubCtaDe=""{0}"" ", Dr("CodigoPadre").ToString)
Str.AppendFormat("Nivel=""{0}"" ", "") Str.AppendFormat("Nivel=""{0}"" ", Dr("Nivel").ToString)
Str.AppendFormat("Natur=""{0}"" ", Dr("Tipo").ToString) Str.AppendFormat("Natur=""{0}"" ", Dr("Tipo").ToString)
Else Else
Str.AppendFormat("CodAgrup=""{0}"" ", Dr("CodAgrup").ToString) Str.AppendFormat("CodAgrup=""{0}"" ", Dr("CodAgrup").ToString)

View File

@@ -216,6 +216,10 @@
<asp:ListItem Text="No" Value="0" Selected="True" /> <asp:ListItem Text="No" Value="0" Selected="True" />
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<div class="col-md-1"><span>Ver por SubProyecto:</span></div>
<div class="col-md-1">
<asp:CheckBox runat="server" ID="chkAgruparSubProyecto"/>
</div>
</asp:Panel> </asp:Panel>
</div> </div>
</div> </div>

View File

@@ -139,43 +139,60 @@ Partial Class Inventarios_KardexAlmacen
Dim CveAlmacenes As String = ddlAlmacen.GetSelectedValues() Dim CveAlmacenes As String = ddlAlmacen.GetSelectedValues()
Dim CveProveedorCompra As Integer = If(DdlProveedor.SelectedValue.ToEntero > 0, DdlProveedor.SelectedValue.ToEntero, -1) Dim CveProveedorCompra As Integer = If(DdlProveedor.SelectedValue.ToEntero > 0, DdlProveedor.SelectedValue.ToEntero, -1)
Dim Marcas As String = If(DdlMarca.GetSelectedValuesM = "", "-1", DdlMarca.GetSelectedValuesM) Dim Marcas As String = If(DdlMarca.GetSelectedValuesM = "", "-1", DdlMarca.GetSelectedValuesM)
Dim dtMovs As DataTable = Nothing
If ObjMovimientos.GetKardexAlmacenHorizontal(CvePS, FechaF, -1, DdlUnidadMedida.SelectedValue.ToEntero, CveProveedorCompra, DdlTipoAlmacen.SelectedValue.ToEntero(), DdlIncluyeTransitorios.SelectedValue.ToEntero(), DdlClasificacion.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CondicionExistencias:=DdlExistencia.SelectedValue, Orden:=DdlOrden.SelectedValue.ToEntero(), Marcas:=Marcas, IncluyeProyectado:=DdlProyeccionFiltro.SelectedValue.ToEntero, CveAlmacenes:=CveAlmacenes) Then If chkAgruparSubProyecto.Checked Then
If ObjMovimientos.DtResultados IsNot Nothing AndAlso ObjMovimientos.DtResultados.Rows.Count > 0 Then If ObjMovimientos.GetKardexAlmacenHorizontalAgrupado(CvePS, FechaF, -1, DdlUnidadMedida.SelectedValue.ToEntero, CveProveedorCompra, DdlTipoAlmacen.SelectedValue.ToEntero(), DdlIncluyeTransitorios.SelectedValue.ToEntero(), DdlClasificacion.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CondicionExistencias:=DdlExistencia.SelectedValue, Orden:=DdlOrden.SelectedValue.ToEntero(), Marcas:=Marcas, IncluyeProyectado:=DdlProyeccionFiltro.SelectedValue.ToEntero, CveAlmacenes:=CveAlmacenes) Then
dt = ObjMovimientos.DtResultados If ObjMovimientos.DtResultados IsNot Nothing AndAlso ObjMovimientos.DtResultados.Rows.Count > 0 Then
Dim ListaBorrar As New List(Of DataColumn) dt = ObjMovimientos.DtResultados
For index = 3 To dt.Columns.Count - 1 End If
Dim TotColumna As Double = 0
For Each Dr As DataRow In dt.Rows
TotColumna += Dr.Item(index).ToString.ToDouble
Next
'If Not TotColumna > 0 Then
' ListaBorrar.Add(dt.Columns(index))
'End If
Next
For Each item As DataColumn In ListaBorrar
dt.Columns().Remove(item)
Next
dt.AcceptChanges()
GvDatos.DataSource = dt
Else Else
Alert("La búsqueda no contiene resultados.", TipoMensaje.MsgAdvertencia) ObjMovimientos.Dispose()
GvDatos.Columns.Clear() Alert("Ocurrió un error al consultar el Kardex.", TipoMensaje.MsgError)
dt = Nothing
Exit Sub Exit Sub
End If End If
Else Else
ObjMovimientos.Dispose() If ObjMovimientos.GetKardexAlmacenHorizontal(CvePS, FechaF, -1, DdlUnidadMedida.SelectedValue.ToEntero, CveProveedorCompra, DdlTipoAlmacen.SelectedValue.ToEntero(), DdlIncluyeTransitorios.SelectedValue.ToEntero(), DdlClasificacion.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CondicionExistencias:=DdlExistencia.SelectedValue, Orden:=DdlOrden.SelectedValue.ToEntero(), Marcas:=Marcas, IncluyeProyectado:=DdlProyeccionFiltro.SelectedValue.ToEntero, CveAlmacenes:=CveAlmacenes) Then
Alert("Ocurrió un error al consultar el Kardex.", TipoMensaje.MsgError) If ObjMovimientos.DtResultados IsNot Nothing AndAlso ObjMovimientos.DtResultados.Rows.Count > 0 Then
dt = ObjMovimientos.DtResultados
End If
Else
ObjMovimientos.Dispose()
Alert("Ocurrió un error al consultar el Kardex.", TipoMensaje.MsgError)
Exit Sub
End If
End If
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
Dim ListaBorrar As New List(Of DataColumn)
For index = 3 To dt.Columns.Count - 1
Dim TotColumna As Double = 0
For Each Dr As DataRow In dt.Rows
TotColumna += Dr.Item(index).ToString.ToDouble
Next
'If Not TotColumna > 0 Then
' ListaBorrar.Add(dt.Columns(index))
'End If
Next
For Each item As DataColumn In ListaBorrar
dt.Columns().Remove(item)
Next
dt.AcceptChanges()
GvDatos.DataSource = dt
GvDatos.DataBind()
Else
Alert("La búsqueda no contiene resultados.", TipoMensaje.MsgAdvertencia)
GvDatos.Columns.Clear()
dt = Nothing
Exit Sub Exit Sub
End If End If
GvDatos.DataBind()
For index = 4 To GvDatos.Rows(0).Cells.Count - 1 For index = 4 To GvDatos.Rows(0).Cells.Count - 1
GvDatos.HeaderRow.Cells(index).Text = GvDatos.HeaderRow.Cells(index).Text.Split("|")(0) GvDatos.HeaderRow.Cells(index).Text = GvDatos.HeaderRow.Cells(index).Text.Split("|")(0)
Next Next
ObjMovimientos.Dispose()
End Sub End Sub
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound