This commit is contained in:
rrene
2020-09-12 08:34:38 -07:00
8 changed files with 320 additions and 85 deletions

View File

@@ -241,6 +241,7 @@
<asp:BoundField DataField="Cantidad" ItemStyle-Width="15%" HeaderText="Cantidad" /> <asp:BoundField DataField="Cantidad" ItemStyle-Width="15%" HeaderText="Cantidad" />
<asp:BoundField DataField="Abreviatura" ItemStyle-Width="15%" HeaderText="U.M." /> <asp:BoundField DataField="Abreviatura" ItemStyle-Width="15%" HeaderText="U.M." />
<asp:TemplateField ItemStyle-Width="45%" HeaderText="Producto"> <asp:TemplateField ItemStyle-Width="45%" HeaderText="Producto">
<ItemTemplate> <ItemTemplate>
<asp:Label ID="LblPS" runat="server" Text='<%# Eval("PS") %>' Width="220px"></asp:Label> <asp:Label ID="LblPS" runat="server" Text='<%# Eval("PS") %>' Width="220px"></asp:Label>
@@ -253,6 +254,17 @@
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField ItemStyle-Width="150px" HeaderText="Faltante" Visible="false" ItemStyle-HorizontalAlign="Right">
<HeaderTemplate>
<asp:HyperLink ID="HLOC" runat="server" Text="" Target="_blank" CssClass="Texto" data-toggle="tooltip" data-placement="top" title="Crear orden de compra" >Faltante <i class="fa fa-shopping-cart" aria-hidden="true"></i></asp:HyperLink>
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="LtlFaltante" runat="server" Text='<%# Eval("Faltante") %>' Width="220px"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
+
</Columns> </Columns>
</asp:GridView> </asp:GridView>

View File

@@ -25,6 +25,18 @@ Partial Class AF_OrdenTrabajo
End Set End Set
End Property End Property
Property CveOrdenCompra As Integer
Get
If ViewState("CveOrdenCompra") Is Nothing Then
Return -1
Else
Return ViewState("CveOrdenCompra").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("CveOrdenCompra") = value
End Set
End Property
@@ -101,12 +113,8 @@ Partial Class AF_OrdenTrabajo
#End Region #End Region
#Region " CARGA DATOS "
#End Region
#Region " GV DATOS " #Region " GV DATOS "
Private Sub CargaDatos() Private Sub CargaDatos()
@@ -128,17 +136,16 @@ Partial Class AF_OrdenTrabajo
DdlPrioridad.SelectedValueExist(ObjAF.DtResultados(0)("Prioridad").ToString) DdlPrioridad.SelectedValueExist(ObjAF.DtResultados(0)("Prioridad").ToString)
txtFechaI.Text = ObjAF.DtResultados(0)("FechaInicio").ToString.ToDate.ToString("dd/MM/yyyy") txtFechaI.Text = ObjAF.DtResultados(0)("FechaInicio").ToString.ToDate.ToString("dd/MM/yyyy")
CveOrdenCompra = ObjAF.DtResultados(0)("CveOrdenCompra").ToString.ToEntero
If ObjAF.DtResultados(0)("FechaFin").ToString.Length > 0 Then If ObjAF.DtResultados(0)("FechaFin").ToString.Length > 0 Then
txtFechaF.Text = ObjAF.DtResultados(0)("FechaFin").ToString.ToDate.ToString("dd/MM/yyyy") txtFechaF.Text = ObjAF.DtResultados(0)("FechaFin").ToString.ToDate.ToString("dd/MM/yyyy")
End If End If
'txtFechaFinReal.Text "" 'txtFechaFinReal.Text ""
DdlOrdenesTrabajoEstatus.SelectedValueExist(ObjAF.DtResultados(0)("CveEstatusOT").ToString) DdlOrdenesTrabajoEstatus.SelectedValueExist(ObjAF.DtResultados(0)("CveEstatusOT").ToString)
Else
Alert("No se encontro la orden de trabajo", TipoMensaje.MsgAdvertencia)
Else
Alert("No se encontro la orden de rtabajo", TipoMensaje.MsgAdvertencia)
End If End If
End If End If
@@ -321,16 +328,27 @@ Partial Class AF_OrdenTrabajo
Private Sub CargaMaterial() Private Sub CargaMaterial()
Dim ObjAF As New ClsAF Dim ObjAF As New ClsAF
Dim MaterialFaltante As Decimal = 0
If ObjAF.GetOrdenesTrabajoMateriales(CveOrdenTrabajo, UsuarioActual.CveEmpresa) Then If ObjAF.GetOrdenesTrabajoMateriales(CveOrdenTrabajo, UsuarioActual.CveEmpresa) Then
GvMaterial.DataSource = ObjAF.DtResultados GvMaterial.DataSource = ObjAF.DtResultados
MaterialFaltante = ObjAF.DtResultados.SUMD("Faltante")
Else Else
GvMaterial.DataSource = Nothing GvMaterial.DataSource = Nothing
End If End If
ObjAF.Dispose() ObjAF.Dispose()
If MaterialFaltante > 0 AndAlso CveOrdenCompra <= 0 Then
GvMaterial.Columns(4).Visible = True
End If
GvMaterial.DataBind() GvMaterial.DataBind()
UpGvMaterial.Update() UpGvMaterial.Update()
End Sub End Sub
@@ -376,6 +394,17 @@ Partial Class AF_OrdenTrabajo
Protected Sub GvMaterial_RowDataBound(sender As Object, e As GridViewRowEventArgs) Protected Sub GvMaterial_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.Header Then
If GvMaterial.Columns(4).Visible Then
Dim HLOC As HyperLink = e.Row.FCHyperLink("HLOC")
HLOC.NavigateUrl = $"../OC/OC.aspx?CveOrdenTrabajo={CveOrdenTrabajo}"
End If
End If
End Sub End Sub
Protected Sub GvActividades_RowDataBound(sender As Object, e As GridViewRowEventArgs) Protected Sub GvActividades_RowDataBound(sender As Object, e As GridViewRowEventArgs)

View File

@@ -4300,8 +4300,33 @@ Public Class ClsAF
.Add("@CveEstatusOT", SqlDbType.Int).Value = CveEstatusOT .Add("@CveEstatusOT", SqlDbType.Int).Value = CveEstatusOT
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar la orden de trabajo", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function UpdateOrdenesTrabajoOC(CveOrdenTrabajo As Integer, CveOrdenCompra As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_OrdenesTrabajoOCUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveOrdenTrabajo", SqlDbType.Int).Value = CveOrdenTrabajo
.Add("@CveOrdenCompra", SqlDbType.Int).Value = CveOrdenCompra
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With End With
Try Try

View File

@@ -974,12 +974,20 @@ Partial Class Bancos_IE
LnkEliminar.OnClientClick = "return confirm('¿Está seguro de eliminar el documento y su póliza?');" LnkEliminar.OnClientClick = "return confirm('¿Está seguro de eliminar el documento y su póliza?');"
EstaContabilizado = True EstaContabilizado = True
TxtFechaDocumento.Enabled = False
ImgCalendario.Visible = False
Else Else
BtnContabilizar.Visible = True BtnContabilizar.Visible = True
BtnDescontabilizar.Visible = False BtnDescontabilizar.Visible = False
HplIrPoliza.Visible = False HplIrPoliza.Visible = False
EstaContabilizado = False EstaContabilizado = False
'TxtFechaDocumento.Enabled = True
'ImgCalendario.Visible = True
End If End If
UPPDesContabilizar.Update() UPPDesContabilizar.Update()

View File

@@ -3903,7 +3903,7 @@
<asp:ListItem Value="3">Créditos</asp:ListItem> <asp:ListItem Value="3">Créditos</asp:ListItem>
<asp:ListItem Value="5">Acreedores</asp:ListItem> <asp:ListItem Value="5">Acreedores</asp:ListItem>
<asp:ListItem Value="6">Caja Chica</asp:ListItem> <asp:ListItem Value="6">Caja Chica</asp:ListItem>
<asp:ListItem Value="2">Viaticos</asp:ListItem> <asp:ListItem Value="2">Viáticos</asp:ListItem>
<asp:ListItem Value="4">Deudores</asp:ListItem> <asp:ListItem Value="4">Deudores</asp:ListItem>
</asp:RadioButtonList> </asp:RadioButtonList>
</asp:Panel> </asp:Panel>
@@ -3911,7 +3911,7 @@
<br /> <br />
<div style="text-align:center"> <div style="text-align:center">
<asp:CheckBox runat="server" ID="ChkCreditoMultiple" AutoPostBack="true" Text="Multiple Crédito" /> <asp:CheckBox runat="server" ID="ChkCreditoMultiple" AutoPostBack="true" Text=" Múltiple Crédito" />
</div> </div>
<br /> <br />
@@ -3971,7 +3971,7 @@
</div> </div>
<div runat="server" id="DivContado"> <div runat="server" id="DivContado">
<asp:Panel ID="PnlContadoBancos" CssClass="chequesie text-small" runat="server" Width="470px" Visible="true"> <asp:Panel ID="PnlContadoBancos" CssClass="text-small" runat="server" Width="85%" Style="position:relative;margin:auto" Visible="true">
<div class="chequesie1"> <div class="chequesie1">
<div class="row"> <div class="row">
<div class="col-md-2" style="width: 25%; text-align: left"> <div class="col-md-2" style="width: 25%; text-align: left">
@@ -4000,7 +4000,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="chequesie2"> <div class="chequesie2" style="height:100%">
<div class="row"> <div class="row">
<label class="col-md-2" style="width: 25%; padding-left: 20px; text-align: left"> <label class="col-md-2" style="width: 25%; padding-left: 20px; text-align: left">
<asp:Label ID="LblFolio" runat="server" Text="Número:"></asp:Label></label> <asp:Label ID="LblFolio" runat="server" Text="Número:"></asp:Label></label>
@@ -4029,11 +4029,12 @@
<asp:TextBox ID="TxtDocumentoObservaciones" CssClass="form-control input-sm" runat="server" MaxLength="12" Width="97%" Rows="3" TextMode="MultiLine"></asp:TextBox> <asp:TextBox ID="TxtDocumentoObservaciones" CssClass="form-control input-sm" runat="server" MaxLength="12" Width="97%" Rows="3" TextMode="MultiLine"></asp:TextBox>
</div> </div>
</div> </div>
<br />
</div> </div>
</asp:Panel> </asp:Panel>
<asp:Panel ID="PnlContadoCajaChica" CssClass="chequesie text-small" runat="server" Width="400px" Visible="False"> <asp:Panel ID="PnlContadoCajaChica" CssClass="text-small" runat="server" Width="85%" Style="position:relative;margin:auto" Visible="False">
<div class="chequesie1"> <div class="chequesie1">
<div class="row"> <div class="row">
<label class="col-md-2">Movimiento:</label> <label class="col-md-2">Movimiento:</label>
@@ -4052,7 +4053,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="chequesie2"> <div class="chequesie2" style="height:100%">
<div class="row"> <div class="row">
<label class="col-md-2"> <label class="col-md-2">
<asp:Label ID="Label5" runat="server" Text="Número:"></asp:Label></label> <asp:Label ID="Label5" runat="server" Text="Número:"></asp:Label></label>
@@ -4070,16 +4071,18 @@
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender10" runat="server" HighlightCssClass="vco" TargetControlID="RVDocumentoImporteCaja" Width="350px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender10" runat="server" HighlightCssClass="vco" TargetControlID="RVDocumentoImporteCaja" Width="350px"></ajax:ValidatorCalloutExtender>
</div> </div>
</div> </div>
<br />
<div class="row"> <div class="row">
<label class="col-md-2">Observaciones:</label> <label class="col-md-2">Observaciones:</label>
<div class="col-md-8"> <div class="col-md-8">
<asp:TextBox ID="TxtDocumentoObservacionesCaja" CssClass="form-control input-sm" runat="server" MaxLength="12" Width="250px" Rows="3" TextMode="MultiLine"></asp:TextBox> <asp:TextBox ID="TxtDocumentoObservacionesCaja" CssClass="form-control input-sm" runat="server" MaxLength="12" Width="326px" Rows="3" TextMode="MultiLine"></asp:TextBox>
</div> </div>
</div> </div>
<br />
</div> </div>
</asp:Panel> </asp:Panel>
<asp:Panel ID="PnlContadoFyE" CssClass="chequesie text-small" runat="server" Width="400px" Visible="False"> <asp:Panel ID="PnlContadoFyE" CssClass="text-small" runat="server" Width="85%" Style="position:relative;margin:auto" Visible="False">
<div class="chequesie1"> <div class="chequesie1">
<div class="row"> <div class="row">
<label class="col-md-2">Funcionario Empleado:</label> <label class="col-md-2">Funcionario Empleado:</label>
@@ -4105,7 +4108,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="chequesie2"> <div class="chequesie2" style="height:100%">
<div class="row"> <div class="row">
<div class="row"> <div class="row">
<label class="col-md-2"></label> <label class="col-md-2"></label>
@@ -4119,15 +4122,17 @@
<ajax:ValidatorCalloutExtender ID="VCEDocumentoImporteFE" runat="server" HighlightCssClass="vco" TargetControlID="RVDocumentoImporteFE" Width="350px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCEDocumentoImporteFE" runat="server" HighlightCssClass="vco" TargetControlID="RVDocumentoImporteFE" Width="350px"></ajax:ValidatorCalloutExtender>
</div> </div>
</div> </div>
<br />
<label class="col-md-2">Observaciones:</label> <label class="col-md-2">Observaciones:</label>
<div class="col-md-8"> <div class="col-md-8">
<asp:TextBox ID="TextBox3" runat="server" CssClass="form-control input-sm" MaxLength="12" Width="250px" Rows="3" TextMode="MultiLine"></asp:TextBox> <asp:TextBox ID="TextBox3" runat="server" CssClass="form-control input-sm" MaxLength="12" Width="331px" Rows="3" TextMode="MultiLine"></asp:TextBox>
</div> </div>
</div> </div>
<br />
</div> </div>
</asp:Panel> </asp:Panel>
<asp:Panel ID="PnlContadoDeudores" Width="400px" runat="server" Visible="False"> <asp:Panel ID="PnlContadoDeudores" Width="84%" Style="position:relative;margin:auto" runat="server" Visible="False">
<asp:RadioButtonList ID="RBLTipoDeudor" runat="server" RepeatDirection="Horizontal" AutoPostBack="true"> <asp:RadioButtonList ID="RBLTipoDeudor" runat="server" RepeatDirection="Horizontal" AutoPostBack="true">
<asp:ListItem Value="1" Selected="True">D.D</asp:ListItem> <asp:ListItem Value="1" Selected="True">D.D</asp:ListItem>
@@ -4235,7 +4240,7 @@
</asp:Panel> </asp:Panel>
<asp:Panel ID="PnlContadoCreditos" CssClass="chequesie text-small" runat="server" Width="400px" Visible="true"> <asp:Panel ID="PnlContadoCreditos" CssClass="text-small" runat="server" Width="85%" Style="position:relative;margin:auto" Visible="true">
<div class="chequesie1"> <div class="chequesie1">
<div class="row"> <div class="row">
<label class="col-md-2">Tipo</label> <label class="col-md-2">Tipo</label>
@@ -4267,10 +4272,11 @@
<ajax:ValidatorCalloutExtender ID="VCECreditoDetalle" runat="server" HighlightCssClass="vco" TargetControlID="RFVCreditoDetalle" Width="300px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCECreditoDetalle" runat="server" HighlightCssClass="vco" TargetControlID="RFVCreditoDetalle" Width="300px"></ajax:ValidatorCalloutExtender>
</div> </div>
</div> </div>
<br />
</div> </div>
</asp:Panel> </asp:Panel>
<asp:Panel ID="PnlContadoAcreedores" CssClass="chequesie text-small" runat="server" Width="400px" Visible="False"> <asp:Panel ID="PnlContadoAcreedores" CssClass="text-small" runat="server" Width="85%" Style="position:relative;margin:auto" Visible="False">
<div class="chequesie1"> <div class="chequesie1">
<div class="row"> <div class="row">
<label class="col-md-2">Acreedor:</label> <label class="col-md-2">Acreedor:</label>
@@ -4295,7 +4301,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="chequesie2"> <div class="chequesie2" style="height:100%">
<div class="row"> <div class="row">
<label class="col-md-2"></label> <label class="col-md-2"></label>
<div class="col-md-4"></div> <div class="col-md-4"></div>
@@ -4308,6 +4314,7 @@
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server" HighlightCssClass="vco" TargetControlID="RVContadoAcreedor" Width="350px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server" HighlightCssClass="vco" TargetControlID="RVContadoAcreedor" Width="350px"></ajax:ValidatorCalloutExtender>
</div> </div>
</div> </div>
<br />
</div> </div>
</asp:Panel> </asp:Panel>
</div> </div>

View File

@@ -12838,6 +12838,7 @@ Partial Class Compras_Compras
End Sub End Sub
Protected Sub RBLContado_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RBLContado.SelectedIndexChanged Protected Sub RBLContado_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RBLContado.SelectedIndexChanged
LblCheq.Text = RBLContado.SelectedItem.Text
CargaContado() CargaContado()
End Sub End Sub
Private Sub RBLTipoDeudor_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RBLTipoDeudor.SelectedIndexChanged Private Sub RBLTipoDeudor_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RBLTipoDeudor.SelectedIndexChanged

View File

@@ -167,7 +167,14 @@ Partial Class OC
End Property End Property
Private Property NumCotizaciones As Integer Private Property NumCotizaciones As Integer
Get Get
NumCotizaciones = ViewState("NumCotizaciones").ToString.ToEntero
If ViewState("NumCotizaciones") Is Nothing Then
Return -1
Else
Return ViewState("NumCotizaciones").ToString.ToEntero
End If
End Get End Get
Set(value As Integer) Set(value As Integer)
ViewState("NumCotizaciones") = value ViewState("NumCotizaciones") = value
@@ -524,6 +531,22 @@ Partial Class OC
End Set End Set
End Property End Property
Private Property CveOrdenTrabajo As Integer
Get
If ViewState("CveOrdenTrabajo") Is Nothing Then
Return -1
Else
Return ViewState("CveOrdenTrabajo").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("CveOrdenTrabajo") = value
End Set
End Property
#End Region #End Region
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
@@ -672,6 +695,14 @@ Partial Class OC
'ASIGNA ESTATUS OC 'ASIGNA ESTATUS OC
CboE_SelectedIndexChanged(New Object, New EventArgs) CboE_SelectedIndexChanged(New Object, New EventArgs)
If Request("CveOrdenTrabajo") IsNot Nothing AndAlso Request("CveOrdenTrabajo").ToString.ToEntero > 0 Then
CveOrdenTrabajo = Request("CveOrdenTrabajo").ToEntero
CargaOT()
End If
End If End If
@@ -2548,6 +2579,20 @@ Partial Class OC
Else Else
TieneError = True TieneError = True
End If End If
If CveOrdenTrabajo > 0 Then
Dim ObjAF As New ClsAF(OC.IniciaTransacSQL)
If Not ObjAF.UpdateOrdenesTrabajoOC(CveOrdenTrabajo, CveOrdenCompra, UsuarioActual.CveEmpresa) Then
TieneError = True
End If
End If
End If End If
@@ -8076,4 +8121,112 @@ Partial Class OC
' End If ' End If
' ObjVentas.Dispose() ' ObjVentas.Dispose()
'End Sub 'End Sub
Private Sub CargaOT()
If CveOrdenTrabajo > 0 Then
Dim ObjAF As New ClsAF
Dim CveSubProyecto As Integer = 0
Dim SubProyecto As String = ""
Dim CveProyecto As Integer = 0
Dim Proyecto As String = ""
If ObjAF.GetOrdenesTrabajo(CveOrdenTrabajo, -1, -1, -1, -1, -1, MinFecha, MaxFecha, Nothing, -1, UsuarioActual.CveEmpresa) Then
If ObjAF.DtResultados IsNot Nothing AndAlso ObjAF.DtResultados.Rows.Count > 0 Then
lblFolio.Text = $"Folio OT: {ObjAF.DtResultados(0)("Folio").ToString}"
CveSubProyecto = ObjAF.DtResultados(0)("CveSubProyecto").ToString.ToEntero
SubProyecto = GlobalDTSubProyectos(-1, CveSubProyecto)(0)("SubProyecto").ToString
CveProyecto = GlobalDTSubProyectos(-1, CveSubProyecto)(0)("CveProyecto").ToString.ToEntero
Proyecto = GlobalDTSubProyectos(-1, CveSubProyecto)(0)("Proyecto").ToString
'DdlAF.SelectedValueExist(ObjAF.DtResultados(0)("CveAF").ToString)
'DdlTipoServicio.SelectedValueExist(ObjAF.DtResultados(0)("CveTipoServicio").ToString)
'TxtServicio.Text = ObjAF.DtResultados(0)("Servicio").ToString
DdlPrioridad.SelectedValueExist(ObjAF.DtResultados(0)("Prioridad").ToString)
'txtFechaI.Text = ObjAF.DtResultados(0)("FechaInicio").ToString.ToDate.ToString("dd/MM/yyyy")
If ObjAF.DtResultados(0)("FechaFin").ToString.Length > 0 Then
'txtFechaF.Text = ObjAF.DtResultados(0)("FechaFin").ToString.ToDate.ToString("dd/MM/yyyy")
End If
'txtFechaFinReal.Text ""
'DdlOrdenesTrabajoEstatus.SelectedValueExist(ObjAF.DtResultados(0)("CveEstatusOT").ToString)
Else
Alert("No se encontro la orden de trabajo", TipoMensaje.MsgAdvertencia)
End If
End If
If ObjAF.GetOrdenesTrabajoMateriales(CveOrdenTrabajo, UsuarioActual.CveEmpresa) Then
For Each DRow As DataRow In ObjAF.DtResultados.Rows
Dim Cantidad As Decimal = DRow("Faltante").ToString.ToDecimal
If Cantidad > 0 Then
Dim CvePS As Integer = DRow("CvePS").ToString.ToEntero
Dim PrecioUnitario As Double = 0
Dim dr As DataRow = DtDetalle.NewRow
Dim DrPS = GlobalDTPS(CveEmpresaActual, CvePS:=CvePS).FiltroPrimero("")
If DrPS Is Nothing Then
Alert("Ocurrió un error al cargar la información de los productos del archivo. Por favor vuelva a intentar.", TipoMensaje.MsgAdvertencia)
Continue For
End If
Dim RetIVA As Double = DrPS("RetIVA").ToString.ToDouble
Dim RetISR As Double = DrPS("RetISR").ToString.ToDouble
Dim PS As String = DrPS("PS").ToString
Dim TotalPS As Double = If(PrecioUnitario > 0, PrecioUnitario * Cantidad, 0)
Dim CveUnidadMedida As Integer = DrPS("CveUnidadMedida").ToString.ToEntero
Dim UM As String = DrPS("UnidadMedida").ToString
Dim IvaPS As Double = DrPS("IVA").ToString.ToDouble
'If IvaPS = -1 Then
' Dim Drr As DataRow = GlobalDTSubProyectos(-1, DdlSubProyecto.SelectedValue.ToEntero())(0)
' IvaPS = Drr("IVA").ToString().ToDouble()
'End If
Dim IEPSPS As Double = DrPS("IEPSPorcentaje").ToString.ToDouble
Dim IEPSPSIVA As Double = If(DrPS("IEPSGrabaIVA").ToString = "True", DrPS("IEPSPorcentaje").ToString.ToDouble, 0)
Dim CveClasificacion As Integer = DrPS("CveClasificacion").ToString.ToEntero
Dim Clasificacion As String = DrPS("Clasificacion").ToString
Dim CveActivoFijo = HdnCveActivoFijo.Value.ToEntero
Dim IdCuentaPorEjercer As Integer = If(HdnCveCuentaPorEjercer.Value = String.Empty, -1, HdnCveCuentaPorEjercer.Value.ToEntero)
Dim IdCuentaComprometido As Integer = If(HdnCveCuentaComprometido.Value = String.Empty, -1, HdnCveCuentaComprometido.Value.ToEntero)
Dim CveOrdenCompraDetalle As Integer = DtDetalle.MAX("CveOrdenCompraDetalle").ToEntero + 100
AddPS(Cantidad, CvePS, PS, "", PrecioUnitario, 0, TotalPS, CveUnidadMedida, IvaPS, IEPSPS, IEPSPSIVA, CveClasificacion, UM, Clasificacion, CveProyecto, Proyecto, CveSubProyecto, SubProyecto, LblCodigo.Text,
CveActivoFijo, 0, CveOrdenCompraDetalle, CveOrdenCompra, IdCuentaPorEjercer, IdCuentaComprometido, DdlACGeneral1.SelectedValue.ToEntero, DdlACGeneral2.SelectedValue.ToEntero, DdlACGeneral3.SelectedValue.ToEntero, DdlACGeneral4.SelectedValue.ToEntero,
DdlACGeneral5.SelectedValue.ToEntero, RetIVA, RetISR)
End If
Next
End If
ObjAF.Dispose()
GvD.DataSource = DtDetalle
GvD.DataBind()
End If
End Sub
End Class End Class

View File

@@ -74,32 +74,32 @@ Partial Class Ventas_ActualizarPrecios
DDlClasificacion.Items.Insert(0, New ListItem("Todos", "-1")) DDlClasificacion.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub End Sub
Public Sub CargaPreciosLista() Public Sub CargaPreciosLista()
DdlPrecioLista.Items.Clear() DdlPrecioLista.Items.Clear()
If UsuarioActual.Empresa.Funcionalidad(404).ToEntero > 0 Then 'si manneja precios de lista If UsuarioActual.Empresa.Funcionalidad(404).ToEntero > 0 Then 'si manneja precios de lista
Dim ObjVta As New ClsVentas Dim ObjVta As New ClsVentas
Dim primerItem As String = "" Dim primerItem As String = ""
If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then
DdlPrecioLista.DataSource = ObjVta.DtResultados.Copy() DdlPrecioLista.DataSource = ObjVta.DtResultados.Copy()
DdlPrecioListaCarga.DataSource = ObjVta.DtResultados.Copy() DdlPrecioListaCarga.DataSource = ObjVta.DtResultados.Copy()
primerItem = ObjVta.DtResultados.FiltroPrimeroValor("CvePrecioLista") primerItem = ObjVta.DtResultados.FiltroPrimeroValor("CvePrecioLista")
End If End If
ObjVta.Dispose() ObjVta.Dispose()
DdlPrecioLista.DataBind() DdlPrecioLista.DataBind()
DdlPrecioListaCarga.DataBind() DdlPrecioListaCarga.DataBind()
If (DdlPrecioLista.Items.Count = 1) Then If (DdlPrecioLista.Items.Count = 1) Then
DdlPrecioLista.Items.FindByValue(primerItem).Selected = True DdlPrecioLista.Items.FindByValue(primerItem).Selected = True
End If End If
Else Else
DdlPrecioLista.Items.Insert(0, New ListItem("Sin Precio Lista", "-2")) DdlPrecioLista.Items.Insert(0, New ListItem("Sin Precio Lista", "-2"))
DdlPrecioListaCarga.Items.Insert(0, New ListItem("Sin Precio Lista", "-2")) DdlPrecioListaCarga.Items.Insert(0, New ListItem("Sin Precio Lista", "-2"))
End If End If
End Sub End Sub
Public Sub CargaPS() Public Sub CargaPS()
@@ -142,19 +142,19 @@ Partial Class Ventas_ActualizarPrecios
DdlMarca.Items.Insert(0, New ListItem("Todos", "-1")) DdlMarca.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub End Sub
Private Sub CargarModelos() Private Sub CargarModelos()
If UsuarioActual.Empresa.Funcionalidad(558).ToString = "1" Then If UsuarioActual.Empresa.Funcionalidad(558).ToString = "1" Then
lblModelo.visible = True lblModelo.visible = True
DdlModelo.Visible = True DdlModelo.Visible = True
Dim ObjGeneral As New ClsGenerales Dim ObjGeneral As New ClsGenerales
If ObjGeneral.GetModelos(UsuarioActual.CveEmpresa) Then If ObjGeneral.GetModelos(UsuarioActual.CveEmpresa) Then
DdlModelo.DataSource = ObjGeneral.DtResultados DdlModelo.DataSource = ObjGeneral.DtResultados
End If End If
ObjGeneral.Dispose() ObjGeneral.Dispose()
DdlModelo.DataBind() DdlModelo.DataBind()
DdlModelo.Items.Insert(0, New ListItem("Seleccione", "-1")) End If
End If DdlModelo.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
Dim objPS As New ClsProductosServicios Dim objPS As New ClsProductosServicios
@@ -223,7 +223,7 @@ Partial Class Ventas_ActualizarPrecios
ObjPS.Dispose() ObjPS.Dispose()
BtnConsultar_Click(Nothing, Nothing) BtnConsultar_Click(Nothing, Nothing)
RegistraScript("$('#divAgregar').modal('hide')") RegistraScript("$('#divAgregar').modal('hide')")
TxtImporte.Text = "" TxtImporte.Text = ""
TxtPrecio.Text = "" TxtPrecio.Text = ""
TxtPorcentaje.Text = "" TxtPorcentaje.Text = ""
@@ -410,26 +410,26 @@ Partial Class Ventas_ActualizarPrecios
Dim Correcto As Boolean = False Dim Correcto As Boolean = False
Dim CvePS As Integer = DtPS.FiltroPrimeroValor("CvePS", String.Format("Codigo='{0}' AND CveEmpresa={1}", row(0).ToString(), UsuarioActual.CveEmpresa)) Dim CvePS As Integer = DtPS.FiltroPrimeroValor("CvePS", String.Format("Codigo='{0}' AND CveEmpresa={1}", row(0).ToString(), UsuarioActual.CveEmpresa))
Dim CvePrecioLista As Integer = DdlPrecioListaCarga.SelectedValue.ToEntero() Dim CvePrecioLista As Integer = DdlPrecioListaCarga.SelectedValue.ToEntero()
Dim PrecioNuevo As Decimal = row("Precio").ToString().ToDecimal() Dim PrecioNuevo As Decimal = row("Precio").ToString().ToDecimal()
Dim Porcentaje As Decimal = -1 Dim Porcentaje As Decimal = -1
If CvePS > 0 AndAlso CvePrecioLista > 0 Then If CvePS > 0 AndAlso CvePrecioLista > 0 Then
Correcto = ObjPS.UpdatePSPreciosLista(PrecioNuevo, CvePrecioLista, Porcentaje, CvePS, UsuarioActual.CveUsuario, DateTime.Now, True) Correcto = ObjPS.UpdatePSPreciosLista(PrecioNuevo, CvePrecioLista, Porcentaje, CvePS, UsuarioActual.CveUsuario, DateTime.Now, True)
If Correcto Then If Correcto Then
RowsCargados += 1 RowsCargados += 1
End If End If
Else Else
If CvePS > 0 AndAlso CvePrecioLista = -2 Then If CvePS > 0 AndAlso CvePrecioLista = -2 Then
Correcto = ObjPS.UpdatePSPrecios(PrecioNuevo, CvePrecioLista, Porcentaje, CvePS, UsuarioActual.CveUsuario, DateTime.Now, True) Correcto = ObjPS.UpdatePSPrecios(PrecioNuevo, CvePrecioLista, Porcentaje, CvePS, UsuarioActual.CveUsuario, DateTime.Now, True)
If Correcto Then If Correcto Then
RowsCargados += 1 RowsCargados += 1
End If End If
Else Else
Correcto = False Correcto = False
End If End If
End If End If
If Not Correcto Then If Not Correcto Then
ProductosNoCargados.AppendFormat("{0},", row("Producto / Servicio").ToString()) ProductosNoCargados.AppendFormat("{0},", row("Producto / Servicio").ToString())
@@ -508,12 +508,12 @@ Partial Class Ventas_ActualizarPrecios
End While End While
Return dataTable Return dataTable
End Function End Function
#End Region #End Region
Protected Sub gvSucursal_RowDataBound(sender As Object, e As GridViewRowEventArgs) Protected Sub gvSucursal_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.FCTextBox("TxtPrecioMinimo").Attributes.Add("onKeyUp", String.Format("FncSeleccionaChk({0});", e.Row.FCCheckBox("chkSucursal").ClientID)) e.Row.FCTextBox("TxtPrecioMinimo").Attributes.Add("onKeyUp", String.Format("FncSeleccionaChk({0});", e.Row.FCCheckBox("chkSucursal").ClientID))
End If End If
End Sub End Sub
End Class End Class