This commit is contained in:
2025-01-10 06:38:45 -07:00
23 changed files with 316 additions and 100 deletions

View File

@@ -2008,7 +2008,7 @@ Public Class ClsInventarios
Return Retorno Return Retorno
End Function End Function
Public Function RepNotasSinAlmacen(Opcion As Integer, CveClienteProveedor As Integer, FechaIni As Date, FechaFin As Date, TipoDocumento As String, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean Public Function RepNotasSinAlmacen(Opcion As Integer, CveClienteProveedor As Integer, FechaIni As Date, FechaFin As Date, TipoDocumento As String, CveSubProyecto As Integer, CveEmpresa As Integer, CveUsuario As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Inv_RepNotasSinAlmacen") DataAdapter("PA_Inv_RepNotasSinAlmacen")
@@ -2021,6 +2021,7 @@ Public Class ClsInventarios
.Add("@Opcion", SqlDbType.Int).Value = Opcion .Add("@Opcion", SqlDbType.Int).Value = Opcion
.Add("@TipoDocumento", SqlDbType.VarChar).Value = TipoDocumento .Add("@TipoDocumento", SqlDbType.VarChar).Value = TipoDocumento
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
End With End With
Try Try

View File

@@ -3943,12 +3943,13 @@ Namespace Modelos
CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=Contabilizable) Then CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=Contabilizable) Then
ErrorPrepoliza = True ErrorPrepoliza = True
End If End If
End If End If
End If End If
'SI ES PAGO CON DEVOLUCION 'SI ES PAGO CON DEVOLUCION
If ObjFactura.CveTipoAmortizacionAnticipo = 4 Then If Not ErrorPrepoliza AndAlso ObjFactura.CveTipoAmortizacionAnticipo = 4 Then
If row2("CveConceptoContable").ToString().ToEntero = 277 Then If row2("CveConceptoContable").ToString().ToEntero = 277 Then
importeMovimiento = row2("Importe").ToString().ToDecimal() importeMovimiento = row2("Importe").ToString().ToDecimal()
@@ -3972,10 +3973,15 @@ Namespace Modelos
End If End If
End If End If
If ErrorPrepoliza Then
Exit For
End If
Next Next
End If End If
If sumaAmorticaciones <> 0 Then
If Not ErrorPrepoliza AndAlso sumaAmorticaciones <> 0 Then
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, sumaAmorticaciones, sumaAmorticaciones * tipoCambio, 251, Referencia, Concepto, If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, sumaAmorticaciones, sumaAmorticaciones * tipoCambio, 251, Referencia, Concepto,
CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento),
CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=Contabilizable) Then CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=Contabilizable) Then

View File

@@ -160,7 +160,7 @@
<div class="row" style="padding-bottom: 5px;"> <div class="row" style="padding-bottom: 5px;">
<div class="col-md-4"> <div class="col-md-4">
<label>Subproyecto:</label> <label><asp:Label runat="server" id="LblSubProyecto"></asp:Label>:</label>
</div> </div>
<div class="col-md-8" style="width:175px;"> <div class="col-md-8" style="width:175px;">
<asp:DropDownList ID="DdlSubProyecto" runat="server" CssClass="form-control input-sm select2me" DataTextField="SubProyecto" DataValueField="CveSubProyecto" ValidationGroup="GrpGuardar" Width="145px"> <asp:DropDownList ID="DdlSubProyecto" runat="server" CssClass="form-control input-sm select2me" DataTextField="SubProyecto" DataValueField="CveSubProyecto" ValidationGroup="GrpGuardar" Width="145px">

View File

@@ -24,6 +24,7 @@ public partial class Bancos_Devoluciones : ClsPaginas
TxtComisiones.Attributes.Add("disabled", "disabled"); TxtComisiones.Attributes.Add("disabled", "disabled");
TxtTotal.Attributes.Add("disabled", "disabled"); TxtTotal.Attributes.Add("disabled", "disabled");
TipoDevolucion.SelectedValue = "1"; TipoDevolucion.SelectedValue = "1";
CargarCentrosDeCosto(null, null, null, LblSubProyecto);
} }
} }

View File

@@ -101,8 +101,7 @@
</div> </div>
<div class="col-md-1 control-label" > <div class="col-md-1 control-label" >
<asp:Label ID="LblSubproyecto" runat="server" Text="SubProyecto:"></asp:Label> <label><asp:Label runat="server" id="LblSubProyecto"></asp:Label>:</label>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<asp:DropDownList runat="server" ID="DdlSubProyecto" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="150px" CssClass="select2me" ></asp:DropDownList> <asp:DropDownList runat="server" ID="DdlSubProyecto" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="150px" CssClass="select2me" ></asp:DropDownList>
@@ -250,7 +249,7 @@
<asp:TextBox ID="TxtTotal" runat="server" CssClass="form-control input-sm" Visible="false" MaxLength="12" Width="140px" placeholder="Total" Enabled="false" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox> <asp:TextBox ID="TxtTotal" runat="server" CssClass="form-control input-sm" Visible="false" MaxLength="12" Width="140px" placeholder="Total" Enabled="false" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-3 input-icon">SubProyecto <label><asp:Label runat="server" id="LblSubProyecto2"></asp:Label>:</label>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">

View File

@@ -50,6 +50,8 @@ public partial class Bancos_PagoAcreedor : ClsPaginas
txtFechaI.Text = NowADS().FirstDayOfMonth().ToShortDateString(); txtFechaI.Text = NowADS().FirstDayOfMonth().ToShortDateString();
txtFechaF.Text = NowADS().ToShortDateString(); txtFechaF.Text = NowADS().ToShortDateString();
TxtImporte.Attributes.Add("disabled", "disabled"); TxtImporte.Attributes.Add("disabled", "disabled");
CargarCentrosDeCosto(null, null, null, LblSubProyecto);
LblSubProyecto2.Text = LblSubProyecto.Text;
} }
} }

View File

@@ -122,7 +122,7 @@
<div class="row"> <div class="row">
<div class="col-md-2"> <div class="col-md-2">
<label>SubProyecto:</label> <label><asp:Label runat="server" id="LblSubProyecto"></asp:Label>:</label>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<asp:DropDownList runat="server" ID="DdlSubProyecto" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="145px" CssClass="select2me"></asp:DropDownList> <asp:DropDownList runat="server" ID="DdlSubProyecto" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="145px" CssClass="select2me"></asp:DropDownList>
@@ -305,7 +305,7 @@
<div class="row"> <div class="row">
<div class="col-md-2"> <div class="col-md-2">
<label>SubProyecto:</label> <label><asp:Label runat="server" id="LblSubProyecto2"></asp:Label>:</label>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<asp:DropDownList runat="server" ID="DdlSubProyectoPago" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="145px" CssClass="select2me"></asp:DropDownList> <asp:DropDownList runat="server" ID="DdlSubProyectoPago" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="145px" CssClass="select2me"></asp:DropDownList>

View File

@@ -54,6 +54,8 @@ public partial class Bancos_PagoDeudor : ClsPaginas
TxtTCDolaresPrestamo.Text = get_GlobalTipoCambio(TxtFechaPrestamo.Text.ToDateTime()).FormatoNumero(4); TxtTCDolaresPrestamo.Text = get_GlobalTipoCambio(TxtFechaPrestamo.Text.ToDateTime()).FormatoNumero(4);
TxtTCDolaresPago.Text = get_GlobalTipoCambio(TxtFechaDocumento.Text.ToDateTime()).FormatoNumero(4); TxtTCDolaresPago.Text = get_GlobalTipoCambio(TxtFechaDocumento.Text.ToDateTime()).FormatoNumero(4);
TxtImporte.Attributes.Add("disabled", "disabled"); TxtImporte.Attributes.Add("disabled", "disabled");
CargarCentrosDeCosto(null, null, null, LblSubProyecto);
LblSubProyecto2.Text = LblSubProyecto.Text;
} }
} }

View File

@@ -4576,7 +4576,9 @@
</asp:DropDownList> </asp:DropDownList>
<%--<asp:RequiredFieldValidator runat="server" Enabled="true" Display="None" ID="RFVSubProyecto" ControlToValidate="DdlSubProyecto" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''SubProyecto''</b> es necesario, por favor seleccione uno." ValidationGroup="GprAgregaPS"></asp:RequiredFieldValidator> <%--<asp:RequiredFieldValidator runat="server" Enabled="true" Display="None" ID="RFVSubProyecto" ControlToValidate="DdlSubProyecto" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''SubProyecto''</b> es necesario, por favor seleccione uno." ValidationGroup="GprAgregaPS"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCORVSubProyecto" runat="server" HighlightCssClass="vco" TargetControlID="RFVSubProyecto" Width="300px"></ajax:ValidatorCalloutExtender>--%> <ajax:ValidatorCalloutExtender ID="VCORVSubProyecto" runat="server" HighlightCssClass="vco" TargetControlID="RFVSubProyecto" Width="300px"></ajax:ValidatorCalloutExtender>--%>
<label runat="server" id="LblSubProyecto" for="<%= DdlSubProyecto.ClientID.ToString()%>">SubProyecto:</label> <label runat="server" id="LblSubProyectoEx" for="<%= DdlSubProyecto.ClientID.ToString()%>">
<asp:Label runat="server" id="LblSubProyecto"></asp:Label>:
</label>
</div> </div>
</div> </div>

View File

@@ -1406,6 +1406,9 @@ Partial Class Compras_Compras
End If End If
CargarCentrosDeCosto(Nothing, Nothing, Nothing, LblSubProyecto)
'Carga Proveedor 'Carga Proveedor
If Request("CveProveedor") IsNot Nothing AndAlso IsNumeric(Request("CveProveedor")) AndAlso Request("CveProveedor").ToEntero > 0 Then If Request("CveProveedor") IsNot Nothing AndAlso IsNumeric(Request("CveProveedor")) AndAlso Request("CveProveedor").ToEntero > 0 Then
ViewState("CveProveedor") = Request("CveProveedor") ViewState("CveProveedor") = Request("CveProveedor")
@@ -1502,6 +1505,9 @@ Partial Class Compras_Compras
DVModalAnticipoFechaEjecucion.Visible = True DVModalAnticipoFechaEjecucion.Visible = True
HlEvento.Visible = True HlEvento.Visible = True
HlEvento.NavigateUrl = "/OI/PopUpAgenda.aspx?CveTipoEvento=2&CveCompra=" & CveCompra & "&TB_iframe=true&height=370&width=600;" HlEvento.NavigateUrl = "/OI/PopUpAgenda.aspx?CveTipoEvento=2&CveCompra=" & CveCompra & "&TB_iframe=true&height=370&width=600;"
If UsuarioActual.CveEmpresa = 189 Then
BtnCancelarCompra.Visible = False
End If
Else Else
ViewState("CveProveedor") = -1 ViewState("CveProveedor") = -1

View File

@@ -2727,7 +2727,8 @@ Partial Class General_SaldosIniciales
If Not ErrorVentas Then If Not ErrorVentas Then
If Not ObjVentas.AddVentaDetalle(CveVenta, CvePS, CantidadDetalle, CveUnidadMedida, PuDetalle, IVADetalle, TotalDetalles, "Saldo Inicial", 0, 0, Sucursal.ToEntero(), 0, If Not ObjVentas.AddVentaDetalle(CveVenta, CvePS, CantidadDetalle, CveUnidadMedida, PuDetalle, IVADetalle, TotalDetalles, "Saldo Inicial", 0, 0, Sucursal.ToEntero(), 0,
PorcentajeIVA:=PorcentajeIVA, PorcentajeRetIVA:=PorcentajeRetIVA, ImporteRetIVA:=0, IEPS:=IEPSDetalle, PorcentajeRetISR:=0, PorcentajeIEPS:=PorcentajeIEPSDetalle) Then PorcentajeIVA:=PorcentajeIVA, PorcentajeRetIVA:=PorcentajeRetIVA, ImporteRetIVA:=0, IEPS:=IEPSDetalle, PorcentajeRetISR:=0, PorcentajeIEPS:=PorcentajeIEPSDetalle,
EstatusAlmacen:=2) Then
ErrorVentas = True ErrorVentas = True
Exit For Exit For
End If End If

View File

@@ -172,7 +172,8 @@
<div class="row" style="padding-top: 10px; position: relative;"> <div class="row" style="padding-top: 10px; position: relative;">
<asp:Label runat="server" ID="LblPS" CssClass="col-md-1 truncate">Producto:</asp:Label> <asp:Label runat="server" ID="LblPS" CssClass="col-md-1 truncate">Producto:</asp:Label>
<div class="col-md-2 " style="min-width: 250px; max-width: 300px;"> <div class="col-md-2 " style="min-width: 250px; max-width: 300px;">
<ADS:Dropdownlost ID="ddlProducto2" runat="server" autopostback="False" DataTextField="PSCodigo" IncluyeTodos="false" DataValueField="CvePS" CssClassDdl="select2me" CssStyle="width: 250px; " Onselectedindexchange="ddlProducto2_selectedindexchange"></ADS:Dropdownlost> <ADS:Dropdownlost ID="ddlProducto2" runat="server" autopostback="False" DataTextField="PSCodigo" IncluyeTodos="false" DataValueField="CvePS" CssClassDdl="select2me" CssStyle="width: 250px; "
Onselectedindexchange="ddlProducto2_selectedindexchange" ></ADS:Dropdownlost>
</div> </div>
<label class="col-md-1 truncate" style="max-width: 80px;" id="lblAlm" runat="server">Almacén:</label> <label class="col-md-1 truncate" style="max-width: 80px;" id="lblAlm" runat="server">Almacén:</label>
@@ -416,12 +417,26 @@
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<div class="row">
<div class="col-md-6">
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpNumeroParte">
<ContentTemplate>
<asp:Label runat="server" ID="LblNumeroParte" Text="" Visible ="false"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
<div class="text-right" style="margin: 5px 0px;"> </div>
<input type="text" id="TxtBusqueda2" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvM.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" /> <div class="col-md-6">
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvM.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a> <div class="text-right" style="margin: 5px 0px;">
<input type="text" id="TxtBusqueda2" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvM.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvM.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
</div> </div>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional" RenderMode="Inline"> <asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GvM" Width="100%" runat="server" ShowHeader="true" EmptyDataText="No hay registros." AutoGenerateColumns="False" AllowPaging="False" <asp:GridView ID="GvM" Width="100%" runat="server" ShowHeader="true" EmptyDataText="No hay registros." AutoGenerateColumns="False" AllowPaging="False"

View File

@@ -246,6 +246,8 @@ Partial Class Inventarios_Kardex
Private Sub CargaDatos() Private Sub CargaDatos()
Dim CvePS As Integer = ddlProducto2.SelectedValue.ToEntero Dim CvePS As Integer = ddlProducto2.SelectedValue.ToEntero
LblNumeroParte.Text = ""
LblNumeroParte.Visible = False
If CvePS > 0 Then If CvePS > 0 Then
Dim DtTemp = CargarKardex(CvePS) Dim DtTemp = CargarKardex(CvePS)
@@ -286,6 +288,20 @@ Partial Class Inventarios_Kardex
GvM.DataBind() GvM.DataBind()
UpAcciones.Update() UpAcciones.Update()
End If End If
If CvePS > 0 Then
Dim NumeroParte As String = GlobalDTPS(UsuarioActual.CveEmpresa, ddlProducto2.SelectedValue.ToEntero).FiltroPrimeroValor("NumeroParte")
If NumeroParte.Trim.Length > 0 Then
LblNumeroParte.Text = $" Número de Parte: {NumeroParte}"
LblNumeroParte.Visible = True
End If
End If
UpNumeroParte.Update()
Else Else
Alert("Seleccione un producto.", TipoMensaje.MsgAdvertencia) Alert("Seleccione un producto.", TipoMensaje.MsgAdvertencia)
End If End If
@@ -809,11 +825,14 @@ Partial Class Inventarios_Kardex
Protected Sub ddlProducto2_selectedindexchange(sender As Object, e As EventArgs) Protected Sub ddlProducto2_selectedindexchange(sender As Object, e As EventArgs)
LnkKPIVerComportamiento.Visible = False LnkKPIVerComportamiento.Visible = False
If ddlProducto2.SelectedValue.ToEntero > 0 And UsuarioActual.CveRol = 1 Then If ddlProducto2.SelectedValue.ToEntero > 0 And UsuarioActual.CveRol = 1 Then
LnkKPIVerComportamiento.Visible = True LnkKPIVerComportamiento.Visible = True
End If End If
UpAcciones.Update() UpAcciones.Update()
End Sub End Sub
End Class End Class

View File

@@ -257,33 +257,36 @@
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<asp:GridView ID="GvDatos" runat="server" ShowHeader="true" EmptyDataText="No hay registros." AutoGenerateColumns="True" ShowHeaderWhenEmpty="true" <asp:GridView ID="GvDatos" runat="server" ShowHeader="true" EmptyDataText="No hay registros." AutoGenerateColumns="True" ShowHeaderWhenEmpty="true"
CssClass="ADSCROLLER2 table table-striped table-advance table-hover " data-cols="2" data-heightmenos="300" GridLines="None" > DataKeyNames="CvePS"
<Columns> CssClass="ADSCROLLER2 table table-striped table-advance table-hover " data-cols="2" data-heightmenos="300" GridLines="None">
<asp:TemplateField ItemStyle-HorizontalAlign="Left" ItemStyle-Width="120px"> <Columns>
<HeaderTemplate> <asp:TemplateField ItemStyle-HorizontalAlign="Left" ItemStyle-Width="120px">
Código <HeaderTemplate>
</HeaderTemplate> Código
<ItemTemplate> </HeaderTemplate>
<div class="truncate" style="min-width:120px"> <ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("Codigo") %>'></asp:Label> <div class="truncate" style="min-width: 120px">
</div> <asp:Label runat="server" Text='<%# Eval("Codigo") %>'></asp:Label>
</ItemTemplate> </div>
<HeaderStyle HorizontalAlign="Left" Width="120px" /> </ItemTemplate>
</asp:TemplateField> <HeaderStyle HorizontalAlign="Left" Width="120px" />
<asp:TemplateField ItemStyle-HorizontalAlign="Left" ItemStyle-Width="250px"> </asp:TemplateField>
<HeaderTemplate>
Producto <asp:TemplateField ItemStyle-HorizontalAlign="Left" ItemStyle-Width="250px">
</HeaderTemplate> <HeaderTemplate>
<ItemTemplate> Producto
<div class="truncate" style="min-width:250px"> </HeaderTemplate>
<asp:Label runat="server" Text='<%# Eval("PS") %>'></asp:Label> <ItemTemplate>
</div> <div class="truncate" style="min-width: 250px">
</ItemTemplate> <asp:Label runat="server" Text='<%# Eval("PS") %>'></asp:Label>
<HeaderStyle HorizontalAlign="Left" Width="250px" /> </div>
</asp:TemplateField> </ItemTemplate>
</Columns> <HeaderStyle HorizontalAlign="Left" Width="250px" />
<RowStyle Height="31" /> </asp:TemplateField>
</asp:GridView>
</Columns>
<RowStyle Height="31" />
</asp:GridView>
</div> </div>

View File

@@ -4,6 +4,7 @@ Imports ADSNetLibrary.SIGAPI.Models.CGame
Imports Extensiones Imports Extensiones
Imports GemBox.Spreadsheet Imports GemBox.Spreadsheet
Imports Microsoft.Reporting.WebForms Imports Microsoft.Reporting.WebForms
Imports Telerik.Web.UI
Partial Class Inventarios_KardexAlmacenHorizontal Partial Class Inventarios_KardexAlmacenHorizontal
Inherits ClsPaginas Inherits ClsPaginas
@@ -144,7 +145,7 @@ Partial Class Inventarios_KardexAlmacenHorizontal
End Sub End Sub
Private Sub CargarKardex(CvePS As Integer) Private Sub CargarKardex(CvePS As Integer)
Dim dt As DataTable = Nothing Dim dt As New DataTable
Dim ObjMovimientos As New ClsInventarios Dim ObjMovimientos As New ClsInventarios
Dim FechaI As String = "-1" ' If(TxtFechaI.Text <> "" AndAlso TxtFechaI.Text <> "__/__/____", TxtFechaI.Text, "-1") Dim FechaI As String = "-1" ' If(TxtFechaI.Text <> "" AndAlso TxtFechaI.Text <> "__/__/____", TxtFechaI.Text, "-1")
' Dim FechaF As String = If(TxtFechaF.Text <> "" AndAlso TxtFechaF.Text <> "__/__/____", TxtFechaF.Text, "-1") ' Dim FechaF As String = If(TxtFechaF.Text <> "" AndAlso TxtFechaF.Text <> "__/__/____", TxtFechaF.Text, "-1")
@@ -163,9 +164,10 @@ Partial Class Inventarios_KardexAlmacenHorizontal
If ObjMovimientos.DtResultados IsNot Nothing AndAlso ObjMovimientos.DtResultados.Rows.Count > 0 Then If ObjMovimientos.DtResultados IsNot Nothing AndAlso ObjMovimientos.DtResultados.Rows.Count > 0 Then
dt = ObjMovimientos.DtResultados dt = ObjMovimientos.DtResultados
Dim ListaBorrar As New List(Of DataColumn) Dim ListaBorrar As New List(Of DataColumn)
If Not TienePermisoImportes Then
dt.Columns.RemoveAt(dt.Columns.Count - 1) 'CP-quito columna de importe total If Not TienePermisoImportes AndAlso DdlExistencia.SelectedValue.ToEntero = 2 Then
dt.Columns.RemoveAt(dt.Columns.Count - 1) 'Valor-quito columna de importe total dt.Columns.RemoveAt(dt.Columns.Count - 2) 'CP-quito columna de importe total
dt.Columns.RemoveAt(dt.Columns.Count - 2) 'Valor-quito columna de importe total
End If End If
For index As Integer = 3 To dt.Columns.Count - 1 For index As Integer = 3 To dt.Columns.Count - 1
Dim TotColumna As Double = 0 Dim TotColumna As Double = 0
@@ -195,8 +197,23 @@ Partial Class Inventarios_KardexAlmacenHorizontal
End If End If
GvDatos.DataBind() GvDatos.DataBind()
For index = 4 To GvDatos.Rows(0).Cells.Count - 1 For index = 0 To GvDatos.Rows(0).Cells.Count - 1
GvDatos.HeaderRow.Cells(index).Text = GvDatos.HeaderRow.Cells(index).Text.Split("|"c)(0)
If GvDatos.HeaderRow.Cells(index).Text = "CvePS" Then
GvDatos.HeaderRow.Cells(index).Text = ""
End If
If GvDatos.HeaderRow.Cells(index).Text = "PS" Then
GvDatos.HeaderRow.Cells(index).Text = "Producto"
GvDatos.HeaderRow.Cells(index).Width = 300
End If
If index >= 2 Then
GvDatos.HeaderRow.Cells(index).Text = GvDatos.HeaderRow.Cells(index).Text.Split("|"c)(0)
End If
Next Next
End Sub End Sub
@@ -242,13 +259,26 @@ Partial Class Inventarios_KardexAlmacenHorizontal
Cells.Text = Cells.Text.FormatoNumero(2) Cells.Text = Cells.Text.FormatoNumero(2)
'ElseIf ce.ContainingField.HeaderText = "Total" Then 'ElseIf ce.ContainingField.HeaderText = "Total" Then
' Cells.Text = Cells.Text.FormatoNumero(2) ' Cells.Text = Cells.Text.FormatoNumero(2)
ElseIf ce.ContainingField.HeaderText = "Codigo" Then
ElseIf ce.ContainingField.HeaderText = "PS" Then
Cells.Width = 300
ElseIf ce.ContainingField.HeaderText = "CvePS" Then
Cells.Text = ""
Cells.Width = 1
ElseIf ce.ContainingField.HeaderText = "Total" Then
Cells.Text = String.Format("{0:#,###.##}", Cells.Text.ToDecimal)
Else Else
Cells.Text = String.Format("{0:#,###.##}", Cells.Text.ToDecimal) Cells.Text = String.Format("{0:#,###.##}", Cells.Text.ToDecimal)
If Not e.Row.RowIndex = 0 And Ddlgrupo.SelectedValue.ToEntero = 1 Then
Dim Liga2 As String = String.Format($"/Inventarios/Kardex.aspx?CvePS={e.Row.DataKey("CvePS")}&CveAlmacen={CveAlmacen2}&CveUM={DdlUnidadMedida.SelectedValue.ToEntero}&FechaI={txtFechaI.Text}&FechaF={TxtFechaF.Text}")
Cells.Text = String.Format("<a target='_blank' href=""{1}"">{0}</a>", Celda.FormatoNumero(), Liga2)
End If
End If End If
End If End If
e.Row.Cells(e.Row.Cells.GetCellIndex(Cells)).Width = Unit.Pixel(80) e.Row.Cells(e.Row.Cells.GetCellIndex(Cells)).Width = Unit.Pixel(80)
'Dim Liga2 As String = String.Format($"/Inventarios/Kardex.aspx?CvePS={ddlProducto2.SelectedValue.ToEntero}&CveAlmacen={CveAlmacen2}&CveUM={DdlUnidadMedida.SelectedValue.ToEntero}&FechaI={TxtFechaI.Text}&FechaF={TxtFechaF.Text}")
'Cells.Text = String.Format("<a href=""{1}"">{0}</a>", Celda.FormatoNumero(), Liga2)
End If End If
Index = Index + 1 Index = Index + 1
Next Next
@@ -261,8 +291,20 @@ Partial Class Inventarios_KardexAlmacenHorizontal
Private Sub GvDatos_RowCreated(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowCreated Private Sub GvDatos_RowCreated(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowCreated
'Escondo CvePS y CveAlmacén (Se generan por autogeneratecolumns por eso se borran por aqui). 'Escondo CvePS y CveAlmacén (Se generan por autogeneratecolumns por eso se borran por aqui).
' e.Row.Cells(0).Width = New Unit("200px") ' e.Row.Cells(0).Width = New Unit("200px")
e.Row.Cells(2).Visible = False
e.Row.Cells(3).Visible = False
If DdlExistencia.SelectedValue.ToEntero = 2 Then
Try
e.Row.Cells(2).Visible = False
e.Row.Cells(3).Visible = False
Catch ex As Exception
End Try
Else
e.Row.Cells(0).Visible = False
End If
If e.Row.RowType = DataControlRowType.Header Then If e.Row.RowType = DataControlRowType.Header Then
'e.Row.Cells(6).ToolTip = "Costo" 'e.Row.Cells(6).ToolTip = "Costo"
End If End If

View File

@@ -33,7 +33,7 @@
</div> </div>
<div class="titlefiltros caption "> <div class="titlefiltros caption ">
<ul class="list-inline" style="font-size: 12px;"> <ul class="list-inline" style="font-size: 12px;">
<li>SubProyecto:</li> <li><asp:Label runat="server" id="LblSubProyecto"></asp:Label>:</li>
<%--SubProyecto--%> <%--SubProyecto--%>
<li> <li>
<div > <div >

View File

@@ -34,6 +34,7 @@ Partial Class Inventarios_RepAlmacenCompras
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then If Not Page.IsPostBack Then
CargarCentrosDeCosto(Nothing, Nothing, Nothing, LblSubProyecto)
CargaDatos() CargaDatos()
CargaPermisos() CargaPermisos()
End If End If

View File

@@ -140,7 +140,7 @@ Partial Class RepNotasSinAlmacen
CveClienteProveedor = DdlCliente.SelectedValue.ToEntero CveClienteProveedor = DdlCliente.SelectedValue.ToEntero
End If End If
Dim Reporte As New ClsInventarios Dim Reporte As New ClsInventarios
If Reporte.RepNotasSinAlmacen(Opcion, CveClienteProveedor, FechaInicial, FechaFinal, TipoDocumento, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa) Then If Reporte.RepNotasSinAlmacen(Opcion, CveClienteProveedor, FechaInicial, FechaFinal, TipoDocumento, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa, UsuarioActual.CveUsuario) Then
Dim dtt As DataTable = Reporte.DtResultados Dim dtt As DataTable = Reporte.DtResultados
GvVentas.DataSource = Reporte.DtResultados GvVentas.DataSource = Reporte.DtResultados
@@ -159,7 +159,7 @@ Partial Class RepNotasSinAlmacen
CveClienteProveedor = DdlProveedor.SelectedValue.ToEntero CveClienteProveedor = DdlProveedor.SelectedValue.ToEntero
End If End If
Dim Reporte As New ClsInventarios Dim Reporte As New ClsInventarios
If Reporte.RepNotasSinAlmacen(2, CveClienteProveedor, FechaInicial, FechaFinal, DdlTipoDocto2.SelectedValue, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa) Then If Reporte.RepNotasSinAlmacen(2, CveClienteProveedor, FechaInicial, FechaFinal, DdlTipoDocto2.SelectedValue, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa, UsuarioActual.CveUsuario) Then
GvCompras.DataSource = Reporte.DtResultados GvCompras.DataSource = Reporte.DtResultados
DtNotasSinAlmacenCompras = Reporte.DtResultados DtNotasSinAlmacenCompras = Reporte.DtResultados
Else Else

View File

@@ -3527,9 +3527,14 @@ Partial Class OC_OC
'Alert(String.Format("La {0} se guardó correctamente", TipoLargo), TipoMensaje.MsgInformacion) 'Alert(String.Format("La {0} se guardó correctamente", TipoLargo), TipoMensaje.MsgInformacion)
'Edicion 'Edicion
Dim ImprimirOC As String = ""
Dim Msg As New StringBuilder
ImprimirOC = String.Format("<br/> <a Class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Orden de Compra</a> ", Encripta(String.Format("OP=OC&CVEOC={0}", CveOrdenCompra)))
Dim Liga1 As String = $"document.location.href=""/OC/OC.aspx?Tipo={TipoOC}""" Dim Liga1 As String = $"document.location.href=""/OC/OC.aspx?Tipo={TipoOC}"""
Dim Liga2 As String = $"document.location.href=""/OC/RepOC.aspx""" Dim Liga2 As String = $"document.location.href=""/OC/RepOC.aspx"""
Alert(String.Format("La {0} se guardó correctamente", TipoLargo), TipoMensaje.MsgDosBotones, Liga1, TextoConfirmacion:="Seguir Registrando", TextoSegundoBoton:="Ir al Reporte", JSBtn2:=Liga2) Alert(String.Format("La {0} se guardó correctamente. {1}", TipoLargo, ImprimirOC), TipoMensaje.MsgDosBotones, Liga1, TextoConfirmacion:="Seguir Registrando", TextoSegundoBoton:="Ir al Reporte", JSBtn2:=Liga2)
Else Else
Dim ImprimirOC As String = "" Dim ImprimirOC As String = ""
@@ -3562,6 +3567,7 @@ Partial Class OC_OC
If Conta IsNot Nothing Then Conta.RollBack() If Conta IsNot Nothing Then Conta.RollBack()
Alert(MsgError, TipoMensaje.MsgError) Alert(MsgError, TipoMensaje.MsgError)
End If End If
End If End If

View File

@@ -5659,6 +5659,7 @@
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField HeaderText="Folio" DataField="Folio" ItemStyle-Width="10%" /> <asp:BoundField HeaderText="Folio" DataField="Folio" ItemStyle-Width="10%" />
<asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-Width="15%" /> <asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-Width="15%" />
<asp:BoundField HeaderText="Tipo" DataField="Tipo" DataFormatString="{0}" ItemStyle-Width="15%" />
<asp:BoundField HeaderText="INPC" DataField="Total" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="20%" /> <asp:BoundField HeaderText="INPC" DataField="Total" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="20%" />
<asp:BoundField HeaderText="IVA" DataField="IVA" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="10%" /> <asp:BoundField HeaderText="IVA" DataField="IVA" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="10%" />
<asp:BoundField HeaderText="Saldo" DataField="SaldoConImpuestos" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="20%" /> <asp:BoundField HeaderText="Saldo" DataField="SaldoConImpuestos" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="20%" />

View File

@@ -796,19 +796,22 @@ Partial Class Ventas_PVCobranza
Dim DebeTimbrar As Boolean = True Dim DebeTimbrar As Boolean = True
Dim SeTimbro As Boolean = False
Dim SeTimbroNC As Boolean = False
'SI SE GENERO FACTURA DE INGRESO, TIMBRARLA DESPUES DE REALIZAR EL PAGO 'SI SE GENERO FACTURA DE INGRESO, TIMBRARLA DESPUES DE REALIZAR EL PAGO
If DebeTimbrar AndAlso respFactura IsNot Nothing Then If DebeTimbrar AndAlso respFactura IsNot Nothing Then
'VERIFICA SI SE GENERO NC 'VERIFICA SI SE GENERO NC
If respNC IsNot Nothing Then If respNC IsNot Nothing Then
AjustarTimbre(respFactura.Factura, respNC.Factura) AjustarTimbre(respFactura.Factura, respNC.Factura)
MsgTimbrado = TimbrarFactura(respFactura.Factura, respNC.Factura) MsgTimbrado = TimbrarFactura(respFactura.Factura, respNC.Factura, SeTimbro, SeTimbroNC)
Else Else
AjustarTimbre(respFactura.Factura, Nothing) AjustarTimbre(respFactura.Factura, Nothing)
MsgTimbrado = TimbrarFactura(respFactura.Factura, Nothing) MsgTimbrado = TimbrarFactura(respFactura.Factura, Nothing, SeTimbro, SeTimbroNC)
End If End If
If Not String.IsNullOrEmpty(MsgTimbrado) Then If Not String.IsNullOrEmpty(MsgTimbrado) Then
Dim StrEr As String = $"<br/><div id = 'DivTipoCambioAdvertencia' class='alert alert-warning' style='padding: 5px; margin-bottom: 5px; padding-right: 25px;'><strong style = 'font-size: 20px; margin-right: 25px;' > Comprobante no emitido : </strong> {MsgTimbrado}<br/>Por favor inténtelo de nuevo a través del botón 'Emitir' en ventas.</div>" Dim StrEr As String = $"<br/><div id = 'DivTipoCambioAdvertencia' class='alert alert-danger' style='padding: 5px; margin-bottom: 5px; padding-right: 25px;'><strong style = 'font-size: 20px; margin-right: 25px;' > Comprobante no emitido : </strong><br/> {MsgTimbrado}<br/>Por favor inténtelo de nuevo a través del botón 'Emitir' en ventas.</div>"
MsgTimbrado = StrEr MsgTimbrado = StrEr
End If End If
@@ -816,27 +819,41 @@ Partial Class Ventas_PVCobranza
If respFactura IsNot Nothing Then If respFactura IsNot Nothing Then
If RegistrarPago Then If RegistrarPago Then
msBuild.Append($"Pago Registrado correctamente.") msBuild.Append("<span style=""font-size:14px;"">Pago Registrado correctamente. </span> <br/><br/>")
End If End If
For Each m In respFactura.Mensajes msBuild.AppendFormat("<span style=""font-size:14px;""> La factura <a class=""Texto"" target=""_blank"" style=""font-size:18px;font-weight:bold;"" href=""/Ventas/Ventas.aspx?CveVenta={0}"">{1}</a> se genero correctamente. </span> <br/>", respFactura.CveVenta, respFactura.SerieFolio)
msBuild.AppendFormat("<br/> {0}", m)
Next If SeTimbro Then
Dim xml = String.Format("<ul><li><a class=""Texto"" target=""_blank"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar XML</a></li></ul>", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", respFactura.CveVenta, "XML", respFactura.SerieFolio, respFactura.Factura.TipoDocto)))
msBuild.AppendFormat("{0}", xml)
End If
Dim pdf = String.Format("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", respFactura.CveVenta)))
msBuild.AppendFormat("{0}", pdf)
If respFactura.Factura.Inv_CveMovimiento > 0 Then
msBuild.AppendFormat("<b><a target='_blank' class='Texto' href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"">Movimiento de Almacén</a></b><br/>", respFactura.Factura.Inv_CveMovimiento)
End If
If respNC IsNot Nothing Then If respNC IsNot Nothing Then
For Each m In respNC.Mensajes msBuild.AppendFormat("<span style=""font-size:14px;""> La nota de crédito <a class=""Texto"" target=""_blank"" style=""font-size:18px;font-weight:bold;"" href=""/Ventas/Ventas.aspx?CveVenta={0}"">{1}</a> se genero correctamente.</span> <br/>", respNC.CveVenta, respNC.SerieFolio)
msBuild.AppendFormat("<br/> {0}", m) If SeTimbroNC Then
Next Dim xml = String.Format("<ul><li><a class=""Texto"" target=""_blank"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar XML</a></li></ul>", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", respNC.CveVenta, "XML", respNC.SerieFolio, respNC.Factura.TipoDocto)))
msBuild.AppendFormat("{0}", xml)
End If
Dim pdfNC = String.Format("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", respNC.CveVenta)))
msBuild.AppendFormat("{0}", pdfNC)
End If End If
If Not String.IsNullOrEmpty(MsgTimbrado) Then
msBuild.AppendFormat("<br/>{0}<br/>", MsgTimbrado)
End If
Else Else
msBuild.Append($"Pago Registrado correctamente.<br/><br/> <a href=""/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1&TICKET=1&REGENERAR=1", CveVenta))}"" class='Texto'>Imprimir ticket</a>") msBuild.Append($"Pago Registrado correctamente.<br/><br/> <a href=""/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1&TICKET=1&REGENERAR=1", CveVenta))}"" class='Texto'>Imprimir ticket</a>")
End If End If
If Not String.IsNullOrEmpty(MsgTimbrado) Then
msBuild.AppendFormat("<br/> {0}", MsgTimbrado)
End If
Alert(msBuild.ToString(), TipoMensaje.MsgInformacion) Alert(msBuild.ToString(), TipoMensaje.MsgInformacion)
Else Else
ObjVentas2.RollBack() ObjVentas2.RollBack()
@@ -1256,9 +1273,11 @@ Partial Class Ventas_PVCobranza
End Sub End Sub
Private Function TimbrarFactura(ByRef ObjFactura As Modelos.Factura, ByRef ObjNC As Modelos.Factura) As String Private Function TimbrarFactura(ByRef ObjFactura As Modelos.Factura, ByRef ObjNC As Modelos.Factura, ByRef SeTimbro As Boolean, ByRef SeTimbroNC As Boolean) As String
Dim MsgErrorTimbrado As String = "" Dim MsgErrorTimbrado As String = ""
Dim SeTimbro As Boolean = False 'Dim SeTimbro As Boolean = False
'Dim TimbroNC As Boolean = False
Dim ObjTimbrado As New Timbrado Dim ObjTimbrado As New Timbrado
Try Try
SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura) SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura)
@@ -1272,9 +1291,9 @@ Partial Class Ventas_PVCobranza
ObjNC.Timbre.CFDIRelacionados.UUID.Add(FolioFiscalFactura) ObjNC.Timbre.CFDIRelacionados.UUID.Add(FolioFiscalFactura)
Dim ObjTimbradoNC As New Timbrado Dim ObjTimbradoNC As New Timbrado
Dim TimbroNC As Boolean = ObjTimbradoNC.TimbrarFactura(UsuarioActual, ObjNC) SeTimbroNC = ObjTimbradoNC.TimbrarFactura(UsuarioActual, ObjNC)
If Not TimbroNC Then If Not SeTimbroNC Then
MsgErrorTimbrado = $"{MsgErrorTimbrado} {ObjTimbradoNC.MensajeErrorCFDI}" MsgErrorTimbrado = $"{MsgErrorTimbrado} {ObjTimbradoNC.MensajeErrorCFDI}"
End If End If
ObjTimbradoNC = Nothing ObjTimbradoNC = Nothing

View File

@@ -198,7 +198,7 @@ Partial Class Ventas_Promociones
ChkEstatus.Enabled = False ChkEstatus.Enabled = False
End If End If
If (ChkEstatus.Checked = True And Not PermisoAutorizPromocionPorcentaje) Or (ReqAutorizacion And Not PermisoAutorizPromocionPorcentaje) Then If (ChkEstatus.Checked = False And Not PermisoAutorizPromocionPorcentaje And ReqAutorizacion) Or (ReqAutorizacion And Not PermisoAutorizPromocionPorcentaje) Then
BtnGuardar.Visible = False BtnGuardar.Visible = False
ButBtnEliminar.Visible = False ButBtnEliminar.Visible = False
End If End If

View File

@@ -9157,6 +9157,9 @@ Partial Class Ventas
Cantidad = GvPS.Rows(e.RowIndex).FCTextBox("TxtCantidad").Text.ToDecimal Cantidad = GvPS.Rows(e.RowIndex).FCTextBox("TxtCantidad").Text.ToDecimal
PU = (GvPS.Rows(e.RowIndex).FCTextBox("TxtPrecio").Text.ToDecimal).RoundSQL(6) PU = (GvPS.Rows(e.RowIndex).FCTextBox("TxtPrecio").Text.ToDecimal).RoundSQL(6)
Dim CantidadOriginal As Decimal = GvPS.Rows(e.RowIndex).DataKey("Cantidad").ToDecimal()
Dim TotalOriginal As Decimal = GvPS.Rows(e.RowIndex).DataKey("Total").ToDecimal()
If Cantidad <= 0 Then If Cantidad <= 0 Then
Alert("La cantidad debe ser mayor a cero", TipoMensaje.MsgAdvertencia) Alert("La cantidad debe ser mayor a cero", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
@@ -9172,8 +9175,62 @@ Partial Class Ventas
Exit Sub Exit Sub
End If End If
If UsuarioActual.CveEmpresa = 140 OrElse DtPromociones IsNot Nothing AndAlso DtPromociones.Rows.Count > 0 Then Dim DdlUM As DropDownList = GvPS.Rows(e.RowIndex).FCDropDownList("DdlUnidadMedida")
ObjDescuento = CalcularDescuentos(TmpDT.Rows(e.RowIndex)("CvePS").ToString().ToEntero(), Cantidad, PU) Dim DdlCla As DropDownList = GvPS.Rows(e.RowIndex).FCDropDownList("DdlClasificacion")
Dim DdlSP As DropDownList = GvPS.Rows(e.RowIndex).FCDropDownList("DdlSubProyecto")
Dim DrProducto = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePSNuevo).FiltroPrimero("")
Dim CveUMPS As Integer = DrProducto("CveUnidadMedida").ToString().ToEntero()
Dim CveClasificacion As Integer = DrProducto("CveClasificacion").ToString().ToEntero()
DdlUM.SelectedValueExist(CveUMPS)
Dim RecalcularPromociones As Boolean = False
Dim RegeneraPrecio As Boolean = False
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
RecalcularPromociones = True
End If
If DtPromociones IsNot Nothing AndAlso DtPromociones.Rows.Count > 0 Then
RecalcularPromociones = True
End If
If Not GvPS.Rows(e.RowIndex).FCTextBox("TxtPrecio").Enabled Then
If CvePSAnterior <> CvePSNuevo Then
RegeneraPrecio = True
End If
If Cantidad <> CantidadOriginal Then
RegeneraPrecio = True
End If
If RegeneraPrecio Then
Dim CvePrecioLista As Integer = -1
If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(360) = "1" Then
CvePrecioLista = GvPS.Rows(e.RowIndex).FCDropDownList("DdlPrecioListaEdit").SelectedValue.ToEntero()
Else
CvePrecioLista = GvPS.Rows(e.RowIndex).DataKey("CvePrecioLista").ToEntero()
End If
Dim ObjPrecioSugerido As Modelos.MPrecioSugerido = CalculaPrecioSugerido(CvePSNuevo, CveClasificacion, CvePrecioListaSugerido:=CvePrecioLista)
If ObjPrecioSugerido IsNot Nothing AndAlso ObjPrecioSugerido.PrecioSugerido > 0 Then
PU = ObjPrecioSugerido.PrecioSugerido
End If
End If
End If
If RecalcularPromociones Then
ObjDescuento = CalcularDescuentos(CvePSNuevo, Cantidad, PU)
Dim RegenerarPU As Boolean = False
If ObjDescuento.EsPUModificado Then
PU = ObjDescuento.PU
End If
End If End If
'SI ESTA HABILITADO LA OPCION DE DESCUENTO, SE AGREGO UN DESCUENTO MANUAL Y NO TIENE PROMOCION 'SI ESTA HABILITADO LA OPCION DE DESCUENTO, SE AGREGO UN DESCUENTO MANUAL Y NO TIENE PROMOCION
@@ -9187,19 +9244,6 @@ Partial Class Ventas
Exit Sub Exit Sub
End If End If
Dim DdlUM As DropDownList = GvPS.Rows(e.RowIndex).FCDropDownList("DdlUnidadMedida")
Dim DdlCla As DropDownList = GvPS.Rows(e.RowIndex).FCDropDownList("DdlClasificacion")
Dim DdlSP As DropDownList = GvPS.Rows(e.RowIndex).FCDropDownList("DdlSubProyecto")
Dim CantidadOriginal As Decimal = GvPS.Rows(e.RowIndex).DataKey("Cantidad").ToDecimal()
Dim TotalOriginal As Decimal = GvPS.Rows(e.RowIndex).DataKey("Total").ToDecimal()
Dim DrProducto = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePSNuevo).FiltroPrimero("")
Dim CveUMPS As Integer = DrProducto("CveUnidadMedida").ToString().ToEntero()
DdlUM.SelectedValueExist(CveUMPS)
If Not ValidaAgregarPS(Cantidad, CvePSNuevo, DdlUM.SelectedValue.ToEntero(), PU, DrProducto("CveTipoPS").ToString().ToEntero(), DdlCla.SelectedValue.ToEntero(), DdlSubProyectoDatos.SelectedValue.ToEntero(), ObjDescuento, CantidadOriginal:=CantidadOriginal) Then If Not ValidaAgregarPS(Cantidad, CvePSNuevo, DdlUM.SelectedValue.ToEntero(), PU, DrProducto("CveTipoPS").ToString().ToEntero(), DdlCla.SelectedValue.ToEntero(), DdlSubProyectoDatos.SelectedValue.ToEntero(), ObjDescuento, CantidadOriginal:=CantidadOriginal) Then
Exit Sub Exit Sub
End If End If
@@ -9220,9 +9264,9 @@ Partial Class Ventas
Dim ConsecutivoActual As Integer = TmpDT.Rows(e.RowIndex)("Consec").ToString().ToEntero() Dim ConsecutivoActual As Integer = TmpDT.Rows(e.RowIndex)("Consec").ToString().ToEntero()
Dim OrdenOriginal As Integer = TmpDT.Rows(e.RowIndex)("Orden").ToString().ToEntero() Dim OrdenOriginal As Integer = TmpDT.Rows(e.RowIndex)("Orden").ToString().ToEntero()
If DtPromociones IsNot Nothing AndAlso DtPromociones.Rows.Count > 0 Then 'If DtPromociones IsNot Nothing AndAlso DtPromociones.Rows.Count > 0 Then
ObjDescuento = CalcularDescuentos(CvePSNuevo, Cantidad, PU) ' ObjDescuento = CalcularDescuentos(CvePSNuevo, Cantidad, PU)
End If 'End If
Dim NumTurnos As Decimal = 0 Dim NumTurnos As Decimal = 0
If UsuarioActual.CveEmpresa.Contiene(7, 122) Then If UsuarioActual.CveEmpresa.Contiene(7, 122) Then
@@ -18333,7 +18377,7 @@ Partial Class Ventas
If EsVentaMedica Then If EsVentaMedica Then
TxtPrecio.Enabled = False TxtPrecio.Enabled = False
If UsuarioActual.CveUsuario = 3986 OrElse RBLTipoVenta.SelectedValue = "2" Then If UsuarioActual.CveUsuario = 3986 Or RBLTipoVenta.SelectedValue.ToEntero = 2 Then
TxtPrecio.Enabled = True TxtPrecio.Enabled = True
End If End If
@@ -18352,7 +18396,11 @@ Partial Class Ventas
End If End If
End If End If
If UsuarioActual.TienePermisoProceso(68) AndAlso Not drPS("SATClavePS").ToString.Contiene("84111506", "80141610") Then TxtPrecio.Enabled = False
Dim PSCodigoSAT As String = drPS("SATClavePS").ToString
If UsuarioActual.TienePermisoProceso(68) AndAlso Not PSCodigoSAT.Contiene("84111506", "80141610") Then TxtPrecio.Enabled = False
If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count = 0 AndAlso Not ChkEmitirComercioExterior.Checked Then If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count = 0 AndAlso Not ChkEmitirComercioExterior.Checked Then
DdlMoneda.SelectedValueExist(drPS("CveMoneda").ToString()) DdlMoneda.SelectedValueExist(drPS("CveMoneda").ToString())
@@ -19644,7 +19692,7 @@ Partial Class Ventas
objPS.Dispose() objPS.Dispose()
End If End If
Dim ValidaExistencia As Boolean = (DdlTipoComprobante.SelectedValue <> "Cot" And ChkSinExistencia.Checked = False) OrElse UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Dim ValidaExistencia As Boolean = (DdlTipoComprobante.SelectedValue <> "Cot" And ChkSinExistencia.Checked = False) Or UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1
If CantidadOriginal > 0 Then If CantidadOriginal > 0 Then
'SI NO HAY CAMBIOS EN LAS CANTIDADES, NO VALIDAR EXISTENCIA 'SI NO HAY CAMBIOS EN LAS CANTIDADES, NO VALIDAR EXISTENCIA
@@ -23983,6 +24031,27 @@ Partial Class Ventas
TxtAtencionA.Enabled = True TxtAtencionA.Enabled = True
GvPS.Columns(21).Visible = True
thOrden.Visible = True
If GvPS.Columns(21).Visible Then
For Each GvRow As GridViewRow In GvPS.Rows
If GvRow.RowType = DataControlRowType.Header Then
GvRow.FCLinkButton("LnkOrdenarGvPS").Visible = True
End If
If GvRow.RowType = DataControlRowType.DataRow Then
GvRow.FCTextBox("TxtOrden").Visible = True
If GvRow.FCTextBox("TxtOrden").ToEntero() <= 0 Then
GvRow.FCTextBox("TxtOrden").Text = GvRow.DataKey("Consec")
End If
End If
Next
End If
OrdenarPS(True)
UpCliente.Update() UpCliente.Update()
UPPVentas.Update() UPPVentas.Update()
UpPS.Update() UpPS.Update()
@@ -33157,6 +33226,27 @@ Partial Class Ventas
imgCalendario.Visible = False imgCalendario.Visible = False
End If End If
GvPS.Columns(21).Visible = True
thOrden.Visible = True
If GvPS.Columns(21).Visible Then
For Each GvRow As GridViewRow In GvPS.Rows
If GvRow.RowType = DataControlRowType.Header Then
GvRow.FCLinkButton("LnkOrdenarGvPS").Visible = True
End If
If GvRow.RowType = DataControlRowType.DataRow Then
GvRow.FCTextBox("TxtOrden").Visible = True
If GvRow.FCTextBox("TxtOrden").ToEntero() <= 0 Then
GvRow.FCTextBox("TxtOrden").Text = GvRow.DataKey("Consec")
End If
End If
Next
End If
OrdenarPS(True)
UpPS.Update() UpPS.Update()
UPPDescuento.Update() UPPDescuento.Update()
UPObservaciones.Update() UPObservaciones.Update()