-- activación salida automática en almacen para NC/DEV garantías

This commit is contained in:
2023-05-26 11:58:24 -07:00
parent c9c799df4c
commit 9f13791d2d
2 changed files with 49 additions and 359 deletions

View File

@@ -525,6 +525,7 @@
<asp:ListItem Text="NC Con Productos" Value="6"></asp:ListItem> <asp:ListItem Text="NC Con Productos" Value="6"></asp:ListItem>
<asp:ListItem Text="Apoyo Logístico" Value="9"></asp:ListItem> <asp:ListItem Text="Apoyo Logístico" Value="9"></asp:ListItem>
<asp:ListItem Text="NC Por Devolución" Value="11"></asp:ListItem> <asp:ListItem Text="NC Por Devolución" Value="11"></asp:ListItem>
<%--<asp:ListItem Text="Garantía" Value="12"></asp:ListItem>--%>
</asp:DropDownList> </asp:DropDownList>
</div> </div>
@@ -1151,7 +1152,8 @@
<ajax:TabPanel ID="TabAlmacen" runat="server" HeaderText="Almacén"> <ajax:TabPanel ID="TabAlmacen" runat="server" HeaderText="Almacén">
<ContentTemplate> <ContentTemplate>
<asp:UpdatePanel runat="server" ID="uppAlmacenGral" UpdateMode="Conditional">
<ContentTemplate>
<asp:Panel ID="Pnlalmaceninventarios" runat="server"> <asp:Panel ID="Pnlalmaceninventarios" runat="server">
<asp:UpdatePanel runat="server" ID="UpConsignaciones" UpdateMode="Conditional"> <asp:UpdatePanel runat="server" ID="UpConsignaciones" UpdateMode="Conditional">
@@ -1170,14 +1172,7 @@
<asp:ListItem Value="2" Text="Recepción a Almacén"></asp:ListItem> <asp:ListItem Value="2" Text="Recepción a Almacén"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</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: <%--<li>Folio Consignación:
@@ -1431,7 +1426,8 @@
</asp:Panel> </asp:Panel>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate> </ContentTemplate>
</ajax:TabPanel> </ajax:TabPanel>
@@ -1451,14 +1447,7 @@
<div class="portlet-title portlet-filterT"> <div class="portlet-title portlet-filterT">
<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>Tipo Cambio: <li>Tipo Cambio:
<asp:TextBox ID="TxtTipoCambioOC" runat="server" align="right" MaxLength="12" Text="" Width="100px"></asp:TextBox> <asp:TextBox ID="TxtTipoCambioOC" runat="server" align="right" MaxLength="12" Text="" Width="100px"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="SoloNumeros" runat="server" TargetControlID="TxtTipoCambioOC" FilterType="Custom, Numbers" ValidChars="." /> <ajax:FilteredTextBoxExtender ID="SoloNumeros" runat="server" TargetControlID="TxtTipoCambioOC" FilterType="Custom, Numbers" ValidChars="." />
<asp:RequiredFieldValidator ID="RFVTipoCambioOC" runat="server" ControlToValidate="TxtTipoCambioOC" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Cambio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTipoCambioOC"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RFVTipoCambioOC" runat="server" ControlToValidate="TxtTipoCambioOC" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Cambio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTipoCambioOC"></asp:RequiredFieldValidator>
@@ -1857,19 +1846,9 @@
<asp:Label ID="LbProductoServicio" runat="server" Text='<%# Eval("PS")%>'></asp:Label> <asp:Label ID="LbProductoServicio" runat="server" Text='<%# Eval("PS")%>'></asp:Label>
</ItemTemplate> </ItemTemplate>
<HeaderTemplate> <HeaderTemplate>
Clasificación Clasificación
<br /> <br />
Producto/Servicio Producto/Servicio
</HeaderTemplate> </HeaderTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField HeaderText="Producto/Servicio SAT" DataField="SATClaveProductoServicio" ItemStyle-Width="60px" ItemStyle-HorizontalAlign="Left" Visible="false" /> <asp:BoundField HeaderText="Producto/Servicio SAT" DataField="SATClaveProductoServicio" ItemStyle-Width="60px" ItemStyle-HorizontalAlign="Left" Visible="false" />

View File

@@ -1090,12 +1090,10 @@ Partial Class Compras_Compras
ViewState("EmpresasOC") = value ViewState("EmpresasOC") = value
End Set End Set
End Property End Property
Private Property DtPendientesAlmacen As DataTable Private Property DtPendientesAlmacen As DataTable
Get Get
DtPendientesAlmacen = DirectCast(ViewState("DtPendientesAlmacen"), DataTable) DtPendientesAlmacen = DirectCast(ViewState("DtPendientesAlmacen"), DataTable)
End Get End Get
Set(ByVal value As DataTable) Set(ByVal value As DataTable)
ViewState("DtPendientesAlmacen") = value ViewState("DtPendientesAlmacen") = value
End Set End Set
@@ -1109,19 +1107,12 @@ Partial Class Compras_Compras
ViewState("CveTipoConcepto") = value ViewState("CveTipoConcepto") = value
End Set End Set
End Property End Property
Private Property CveRetISRConceptoOriginal As Integer Private Property CveRetISRConceptoOriginal As Integer
Get Get
If ViewState("CveRetISRConceptoOriginal") Is Nothing Then If ViewState("CveRetISRConceptoOriginal") Is Nothing Then
ViewState("CveRetISRConceptoOriginal") = -1 ViewState("CveRetISRConceptoOriginal") = -1
End If End If
Return ViewState("CveRetISRConceptoOriginal").ToString.ToEntero Return ViewState("CveRetISRConceptoOriginal").ToString.ToEntero
End Get End Get
Set(value As Integer) Set(value As Integer)
ViewState("CveRetISRConceptoOriginal") = value ViewState("CveRetISRConceptoOriginal") = value
@@ -1140,7 +1131,6 @@ Partial Class Compras_Compras
End Property End Property
Public Property FechaCompraOriginal As Date Public Property FechaCompraOriginal As Date
Get Get
Return ViewState("FechaCompraOriginal").ToString.ToDate Return ViewState("FechaCompraOriginal").ToString.ToDate
End Get End Get
@@ -1152,7 +1142,6 @@ Partial Class Compras_Compras
Private Property UUIDSList As List(Of String) Private Property UUIDSList As List(Of String)
Get Get
If ViewState("UUIDSList") Is Nothing Then If ViewState("UUIDSList") Is Nothing Then
Return New List(Of String) Return New List(Of String)
Else Else
@@ -1168,7 +1157,6 @@ Partial Class Compras_Compras
Private Property NumeroReembolsoOriginal As String Private Property NumeroReembolsoOriginal As String
Get Get
If ViewState("NumeroReembolsoOriginal") Is Nothing Then If ViewState("NumeroReembolsoOriginal") Is Nothing Then
ViewState("NumeroReembolsoOriginal") = "" ViewState("NumeroReembolsoOriginal") = ""
End If End If
@@ -1178,13 +1166,10 @@ Partial Class Compras_Compras
Set(value As String) Set(value As String)
ViewState("NumeroReembolsoOriginal") = value ViewState("NumeroReembolsoOriginal") = value
End Set End Set
End Property End Property
Private Property EsDevolucionApoyoLogistico As Boolean Private Property EsDevolucionApoyoLogistico As Boolean
Get Get
If ViewState("EsDevolucionApoyoLogistico") Is Nothing Then If ViewState("EsDevolucionApoyoLogistico") Is Nothing Then
ViewState("EsDevolucionApoyoLogistico") = False ViewState("EsDevolucionApoyoLogistico") = False
End If End If
@@ -1197,21 +1182,16 @@ Partial Class Compras_Compras
Private Property TipoCompraOriginal As Integer Private Property TipoCompraOriginal As Integer
Get Get
If ViewState("TipoCompraOriginal") Is Nothing Then If ViewState("TipoCompraOriginal") Is Nothing Then
ViewState("TipoCompraOriginal") = -1 ViewState("TipoCompraOriginal") = -1
End If End If
Return ViewState("TipoCompraOriginal").ToString.ToEntero Return ViewState("TipoCompraOriginal").ToString.ToEntero
End Get End Get
Set(value As Integer) Set(value As Integer)
ViewState("TipoCompraOriginal") = value ViewState("TipoCompraOriginal") = value
End Set End Set
End Property End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then If Not IsPostBack Then
'ImgBtnBuscarOC.Attributes.Add("data-toggle", "tooltip") 'ImgBtnBuscarOC.Attributes.Add("data-toggle", "tooltip")
@@ -1242,12 +1222,6 @@ Partial Class Compras_Compras
btnProrateo2.Visible = True btnProrateo2.Visible = True
End If End If
'****************************************************************
'If UsuarioActual.CveEmpresa = 72 Then
' LiRecepcion.Visible = True
' DdlRecepcion.SelectedValue = "2"
'End If
TipoCambio = 1 TipoCambio = 1
IvaAcumulado = 0 IvaAcumulado = 0
TotalAlmacen = 0 TotalAlmacen = 0
@@ -1306,8 +1280,6 @@ Partial Class Compras_Compras
TieneOC = False TieneOC = False
CveMoneda = -1 CveMoneda = -1
ImgAnticiposPendientes.Attributes.Add("OnClick", "MuestraAnticipos();") ImgAnticiposPendientes.Attributes.Add("OnClick", "MuestraAnticipos();")
'ImgCerrar.Attributes.Add("OnClick", "$('#DivAnticipos').hide(200);") 'ImgCerrar.Attributes.Add("OnClick", "$('#DivAnticipos').hide(200);")
'BtnCancelar.Attributes.Add("OnClick", "$('#DivAddEq').hide();") 'BtnCancelar.Attributes.Add("OnClick", "$('#DivAddEq').hide();")
@@ -1320,7 +1292,6 @@ Partial Class Compras_Compras
RBLPago.Visible = True RBLPago.Visible = True
If UsuarioActual.Empresa.UsaAC Then RBLPago.Items.RemoveAt(2) 'Elimina Reembolso cuando es AC If UsuarioActual.Empresa.UsaAC Then RBLPago.Items.RemoveAt(2) 'Elimina Reembolso cuando es AC
If UsuarioActual.Empresa.UsaAC Then If UsuarioActual.Empresa.UsaAC Then
TrReembolso.Visible = True TrReembolso.Visible = True
GvPS.Columns(1).Visible = True GvPS.Columns(1).Visible = True
@@ -1329,13 +1300,10 @@ Partial Class Compras_Compras
TxtOC.Attributes.Add("onkeypress", "fncBuscaOC(event);") TxtOC.Attributes.Add("onkeypress", "fncBuscaOC(event);")
If UsuarioActual.CveEmpresa = 66 And UsuarioActual.TienePermisoProceso(96) Then If UsuarioActual.CveEmpresa = 66 And UsuarioActual.TienePermisoProceso(96) Then
ChkProgramarPago.Visible = True ChkProgramarPago.Visible = True
End If End If
'CARGA PERSONAL 'CARGA PERSONAL
'Dim ObjPersonal As New ClsRH 'Dim ObjPersonal As New ClsRH
'ObjPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa) 'ObjPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa)
@@ -1363,7 +1331,6 @@ Partial Class Compras_Compras
End If End If
'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")
@@ -1399,7 +1366,6 @@ Partial Class Compras_Compras
InicializaAplicaNCFact() InicializaAplicaNCFact()
DivReembolso.Visible = False DivReembolso.Visible = False
RBLPago.Items(2).Enabled = False RBLPago.Items(2).Enabled = False
End If End If
If DdlTipoComprobante.SelectedValue = "DEV" Then If DdlTipoComprobante.SelectedValue = "DEV" Then
@@ -1410,8 +1376,6 @@ Partial Class Compras_Compras
CambiaEjercicioAC() CambiaEjercicioAC()
End If End If
If UsuarioActual.Empresa.Funcionalidad(123) <> "" And Not UsuarioActual.TienePermisoProceso(156) Then If UsuarioActual.Empresa.Funcionalidad(123) <> "" And Not UsuarioActual.TienePermisoProceso(156) Then
If Not ValidaCierrePeriodo() Then If Not ValidaCierrePeriodo() Then
Alert("El periodo de la compra actual ya se encuentra cerrado. No podra registrar la compra.", TipoMensaje.MsgAdvertencia) Alert("El periodo de la compra actual ya se encuentra cerrado. No podra registrar la compra.", TipoMensaje.MsgAdvertencia)
@@ -1449,20 +1413,13 @@ Partial Class Compras_Compras
ViewState("CveCompra") = Request("CveCompra") ViewState("CveCompra") = Request("CveCompra")
CargaCompra() CargaCompra()
BtnGuardar.Enabled = False BtnGuardar.Enabled = False
'TdIVA.Visible = True
'DdlIVA.Enabled = False
DivConsignaciones.Visible = False DivConsignaciones.Visible = False
' 2018/05/25 - Muestra Boton Agregar Guia ' 2018/05/25 - Muestra Boton Agregar Guia
LnkAgregarGuia.Visible = True LnkAgregarGuia.Visible = True
UpLnkPaqueteriaGuias.Update() UpLnkPaqueteriaGuias.Update()
DivEsNoDeducible.Visible = True DivEsNoDeducible.Visible = True
DivActualizarVincular.Visible = True DivActualizarVincular.Visible = True
DVModalAnticipoFechaEjecucion.Visible = True DVModalAnticipoFechaEjecucion.Visible = True
Else Else
ViewState("CveProveedor") = -1 ViewState("CveProveedor") = -1
@@ -1911,6 +1868,7 @@ Partial Class Compras_Compras
DdlTipoCompra.Items.Add(New ListItem("NC Con Productos", "6")) DdlTipoCompra.Items.Add(New ListItem("NC Con Productos", "6"))
DdlTipoCompra.Items.Add(New ListItem("Apoyo Logístico", "9")) DdlTipoCompra.Items.Add(New ListItem("Apoyo Logístico", "9"))
DdlTipoCompra.Items.Add(New ListItem("NC Por Devolución", "11")) DdlTipoCompra.Items.Add(New ListItem("NC Por Devolución", "11"))
DdlTipoCompra.Items.Add(New ListItem("Garantía", "12"))
Case "T" Case "T"
DdlTipoCompra.Items.Clear() DdlTipoCompra.Items.Clear()
DdlTipoCompra.Items.Add(New ListItem("Apoyo Logístico", "9")) DdlTipoCompra.Items.Add(New ListItem("Apoyo Logístico", "9"))
@@ -3218,7 +3176,6 @@ Partial Class Compras_Compras
HplImporte.Visible = False HplImporte.Visible = False
HplImporte.Text = "" HplImporte.Text = ""
HplImporte.NavigateUrl = "" HplImporte.NavigateUrl = ""
Else Else
If Saldo <= 0 Then If Saldo <= 0 Then
LblCompraEstatus.Text = "PAGADA" LblCompraEstatus.Text = "PAGADA"
@@ -3230,26 +3187,20 @@ Partial Class Compras_Compras
HplImporte.Visible = True HplImporte.Visible = True
HplImporte.Text = String.Format("$ {0}", Total.FormatoNumero()) HplImporte.Text = String.Format("$ {0}", Total.FormatoNumero())
HplImporte.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxPProveedor&CveProveedor={0}&CveCompra={1}&TB_iframe=true&height=700&width=920", CveProveedor, CveCompra) HplImporte.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxPProveedor&CveProveedor={0}&CveCompra={1}&TB_iframe=true&height=700&width=920", CveProveedor, CveCompra)
Else Else
If Saldo < Total Then If Saldo < Total Then
LblCompraEstatus.Text = "ABONADA" LblCompraEstatus.Text = "ABONADA"
LblCompraEstatus.Font.Bold = True LblCompraEstatus.Font.Bold = True
End If End If
LblCompraEstatus.ForeColor = Drawing.Color.Navy LblCompraEstatus.ForeColor = Drawing.Color.Navy
trSaldo.Visible = True trSaldo.Visible = True
HplSaldoAuxiliar.Text = String.Format("$ {0}", Saldo.FormatoNumero()) HplSaldoAuxiliar.Text = String.Format("$ {0}", Saldo.FormatoNumero())
HplSaldoAuxiliar.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxPProveedor&CveProveedor={0}&CveCompra={1}&TB_iframe=true&height=700&width=920", CveProveedor, CveCompra) HplSaldoAuxiliar.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxPProveedor&CveProveedor={0}&CveCompra={1}&TB_iframe=true&height=700&width=920", CveProveedor, CveCompra)
End If End If
End If End If
UpEstatus.Update() UpEstatus.Update()
Else Else
If CveCompra > 0 Then If CveCompra > 0 Then
LblCompraEstatus.Font.Bold = True LblCompraEstatus.Font.Bold = True
LblCompraEstatus.ForeColor = Drawing.Color.Navy LblCompraEstatus.ForeColor = Drawing.Color.Navy
@@ -3257,9 +3208,7 @@ Partial Class Compras_Compras
HplSaldoAuxiliar.Text = String.Format("$ {0}", Saldo.FormatoNumero()) HplSaldoAuxiliar.Text = String.Format("$ {0}", Saldo.FormatoNumero())
HplSaldoAuxiliar.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxPProveedor&CveProveedor={0}&CveCompra={1}&TB_iframe=true&height=700&width=920", CveProveedor, CveCompra) HplSaldoAuxiliar.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxPProveedor&CveProveedor={0}&CveCompra={1}&TB_iframe=true&height=700&width=920", CveProveedor, CveCompra)
End If End If
End If End If
End Sub End Sub
Private Sub CargaMonedas() Private Sub CargaMonedas()
@@ -3268,9 +3217,6 @@ Partial Class Compras_Compras
End Sub End Sub
Private Sub CargarAlmacen() Private Sub CargarAlmacen()
'ddlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (1,2)") 'solo muestra tipo material y herramientas
'ddlAlmacen.DataBind()
Dim DtAlmacenes = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (1,2,7,14,19)") Dim DtAlmacenes = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (1,2,7,14,19)")
If DdlTipoCompra.SelectedValue = "10" Then If DdlTipoCompra.SelectedValue = "10" Then
@@ -3280,12 +3226,9 @@ Partial Class Compras_Compras
ddlAlmacenAdd.DataSource = DtAlmacenes ddlAlmacenAdd.DataSource = DtAlmacenes
DdlAlmacenDevolucion.DataSource = DtAlmacenes DdlAlmacenDevolucion.DataSource = DtAlmacenes
End If End If
ddlAlmacenAdd.DataBind() ddlAlmacenAdd.DataBind()
DdlAlmacenDevolucion.DataBind() DdlAlmacenDevolucion.DataBind()
DdlAlmacenDevolucion.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlAlmacenDevolucion.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub End Sub
Protected Sub CargaFuncionariosEmpleados() Protected Sub CargaFuncionariosEmpleados()
@@ -5545,8 +5488,12 @@ Partial Class Compras_Compras
Dim ListAlmacenes = (From CveAlmacen In DtInv.AsEnumerable() Where CveAlmacen.Field(Of Integer)("CveAlmacen") > 0 Select CveAlmacen.Field(Of Integer)("CveAlmacen")).Distinct().ToList Dim ListAlmacenes = (From CveAlmacen In DtInv.AsEnumerable() Where CveAlmacen.Field(Of Integer)("CveAlmacen") > 0 Select CveAlmacen.Field(Of Integer)("CveAlmacen")).Distinct().ToList
Dim indice = 0 Dim indice = 0
Dim ImporteConcepto As Decimal = 0 Dim ImporteConcepto As Decimal = 0
Dim CveConceptoMovimiento As Integer = 2
If DdlTipoComprobante.SelectedValue = "Fac" AndAlso CveCompraRefacturacion <= 0 Then 'apoyo logistico/garantia
If UsuarioActual.CveEmpresa = 140 AndAlso DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") AndAlso DdlTipoCompra.SelectedValue = "12" Then
CveConceptoMovimiento = 13
End If
If (DdlTipoComprobante.SelectedValue = "Fac" AndAlso CveCompraRefacturacion <= 0) OrElse CveConceptoMovimiento = 13 Then
For Each tCveAlmacen As Integer In ListAlmacenes For Each tCveAlmacen As Integer In ListAlmacenes
If GvInv.Rows(indice).FCDropDownList("DdlRecibirInv").SelectedValue = "1" Then If GvInv.Rows(indice).FCDropDownList("DdlRecibirInv").SelectedValue = "1" Then
@@ -5557,7 +5504,7 @@ Partial Class Compras_Compras
Dim fecha As Date = TxtFecha.Text.ToDate Dim fecha As Date = TxtFecha.Text.ToDate
If Not UsuarioActual.Empresa.UsaAC Then fecha = Now If Not UsuarioActual.Empresa.UsaAC Then fecha = Now
CveMovimientoInventario = ObjInventario.AddMovimiento(tCveAlmacen, 2, 1, fecha, 0, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra, -1, -1, -1, TipoCambio:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, TipoCambioGuardar), Modulo:="Comp/G2") CveMovimientoInventario = ObjInventario.AddMovimiento(tCveAlmacen, CveConceptoMovimiento, 1, fecha, 0, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra, -1, -1, -1, TipoCambio:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, TipoCambioGuardar), Modulo:="Comp/G2")
If CveMovimientoInventario <= 0 Then If CveMovimientoInventario <= 0 Then
ErrorMovInv = True ErrorMovInv = True
@@ -5597,7 +5544,6 @@ Partial Class Compras_Compras
Next Next
End If End If
Else Else
'UNIDAD BASE - EQUIVALENCIAS - INVENTARIO 'UNIDAD BASE - EQUIVALENCIAS - INVENTARIO
If UsuarioActual.CveEmpresa = 1 Then If UsuarioActual.CveEmpresa = 1 Then
DtEquivalencias = New DataTable DtEquivalencias = New DataTable
@@ -5614,8 +5560,6 @@ Partial Class Compras_Compras
CveUnidad = CveUnidadBase CveUnidad = CveUnidadBase
End If End If
End If End If
ImporteConcepto = If(DdlMoneda.SelectedValue.ToEntero = 1, PUInv, PUInv * TipoCambioGuardar) - If(DdlMoneda.SelectedValue.ToEntero = 1, tDescuento, tDescuento * TipoCambioGuardar) ImporteConcepto = If(DdlMoneda.SelectedValue.ToEntero = 1, PUInv, PUInv * TipoCambioGuardar) - If(DdlMoneda.SelectedValue.ToEntero = 1, tDescuento, tDescuento * TipoCambioGuardar)
'si no es por serie lote 'si no es por serie lote
ImporteConcepto = If(UsuarioActual.Empresa.UsaAC, ImporteConcepto * IVA, ImporteConcepto) ImporteConcepto = If(UsuarioActual.Empresa.UsaAC, ImporteConcepto * IVA, ImporteConcepto)
@@ -5625,22 +5569,13 @@ Partial Class Compras_Compras
Exit For Exit For
End If End If
End If End If
End If End If
i = i + 1 i = i + 1
contadorAlamcen = contadorAlamcen + 1 contadorAlamcen = contadorAlamcen + 1
Next Next
End If End If
Next Next
End If End If
End If End If
If AplicarCostoIndirecto(ObjInventario, ObjCompras) Then If AplicarCostoIndirecto(ObjInventario, ObjCompras) Then
@@ -5848,18 +5783,8 @@ Partial Class Compras_Compras
Dim CuentasContablesInvalidas As New StringBuilder Dim CuentasContablesInvalidas As New StringBuilder
Dim ConceptoPersonal As String = "" Dim ConceptoPersonal As String = ""
Dim IdCtaIVAXAcreditar As Integer = 0 Dim IdCtaIVAXAcreditar As Integer = 0
' Dim IdCtaIVAAcreditable As Integer = 0
Dim GuardoConcepto18 As Boolean = False Dim GuardoConcepto18 As Boolean = False
'If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeIVA).Rows.Count > 0 Then
' IdCtaIVAXAcreditar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeIVA).Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero
' ' IdCtaIVAAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeIVA).Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero
'End If
'********************** Variables '**********************
'****** Pagos
'Bancos (30) 'Bancos (30)
Dim importeBanco As Decimal = 0 Dim importeBanco As Decimal = 0
If CveIE > 0 AndAlso RBLPago.SelectedValue.ToEntero = 2 AndAlso RBLContado.SelectedValue = "1" AndAlso (Not DivTarjeta.Visible Or DdlTarjeta.SelectedValue.ToEntero = -1) Then If CveIE > 0 AndAlso RBLPago.SelectedValue.ToEntero = 2 AndAlso RBLContado.SelectedValue = "1" AndAlso (Not DivTarjeta.Visible Or DdlTarjeta.SelectedValue.ToEntero = -1) Then
@@ -6073,10 +5998,6 @@ Partial Class Compras_Compras
ErrorPrepoliza = True ErrorPrepoliza = True
End If End If
'daskldaskldmaskldanmlksd 'daskldaskldmaskldanmlksd
If importeMovimiento <> 0 Then If importeMovimiento <> 0 Then
For Each gvRowCredito As GridViewRow In GvCreditos.Rows For Each gvRowCredito As GridViewRow In GvCreditos.Rows
@@ -6125,17 +6046,9 @@ Partial Class Compras_Compras
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteDifCredito, ImporteDifCreditoMN, 21, Referencia, Concepto, CtaProveedorAcreedores, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveIE:=CveIECredito, CveCreditoDetalle:=CveCreditoDetalleTemp, CveClasificacion:=CveClasificacionDT, CveSubProyecto:=CveSubProyectoDT, ImporteME:=If(tipoCambioActual = 1, 0, ImporteDifCredito), CveTipoGasto:=CveTipoGastoDT, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteDifCredito, ImporteDifCreditoMN, 21, Referencia, Concepto, CtaProveedorAcreedores, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveIE:=CveIECredito, CveCreditoDetalle:=CveCreditoDetalleTemp, CveClasificacion:=CveClasificacionDT, CveSubProyecto:=CveSubProyectoDT, ImporteME:=If(tipoCambioActual = 1, 0, ImporteDifCredito), CveTipoGasto:=CveTipoGastoDT, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True ErrorPrepoliza = True
End If End If
End If End If
End If End If
Next Next
End If End If
'If TipoCreditoInteres Then 'If TipoCreditoInteres Then
@@ -6174,10 +6087,6 @@ Partial Class Compras_Compras
IdCtaContable = CtaProveedorExtranjera IdCtaContable = CtaProveedorExtranjera
End If End If
Case 30 'Bancos Case 30 'Bancos
importeMovimiento = importeBanco + importeCajaChica 'Uno de los dos debe ser 0 importeMovimiento = importeBanco + importeCajaChica 'Uno de los dos debe ser 0
If CveMonedaPago = 2 AndAlso DdlMoneda.SelectedValue.ToEntero = 1 Then If CveMonedaPago = 2 AndAlso DdlMoneda.SelectedValue.ToEntero = 1 Then
@@ -6386,8 +6295,6 @@ Partial Class Compras_Compras
If RBLPago.SelectedValue.ToEntero = 4 Then If RBLPago.SelectedValue.ToEntero = 4 Then
Exit Select 'Es credito el concepto 6 se agrega en CASE 17 Exit Select 'Es credito el concepto 6 se agrega en CASE 17
End If End If
Dim DifSubTotatles As Decimal = 0D Dim DifSubTotatles As Decimal = 0D
If CveCompraRefacturacion > 0 Then If CveCompraRefacturacion > 0 Then
@@ -6583,7 +6490,6 @@ Partial Class Compras_Compras
End If End If
End If End If
Dim CveMovimientoAlmacen As Integer = -1 Dim CveMovimientoAlmacen As Integer = -1
'If importeMovimiento <> 0 Then 'If importeMovimiento <> 0 Then
@@ -6680,11 +6586,8 @@ Partial Class Compras_Compras
ErrorPrepoliza = True ErrorPrepoliza = True
End If End If
Else Else
If Not CveCompraRefacturacion > 0 Then If Not CveCompraRefacturacion > 0 Then
Dim CveSubProyecto240 As Integer = TmpDT.MAX("CveSubProyecto").ToEntero Dim CveSubProyecto240 As Integer = TmpDT.MAX("CveSubProyecto").ToEntero
If CveSubProyecto240 <= 0 Then If CveSubProyecto240 <= 0 Then
Alert("Debe de asignar un sub proyecto o centro de costos", TipoMensaje.MsgAdvertencia) Alert("Debe de asignar un sub proyecto o centro de costos", TipoMensaje.MsgAdvertencia)
ErrorPrepoliza = True ErrorPrepoliza = True
@@ -6695,7 +6598,6 @@ Partial Class Compras_Compras
ErrorPrepoliza = True ErrorPrepoliza = True
End If End If
End If End If
End If End If
Case 6 Case 6
Concepto = $"{NombreProveedor} {TxtSerie.Text} - {TxtFolio.Text}" Concepto = $"{NombreProveedor} {TxtSerie.Text} - {TxtFolio.Text}"
@@ -6707,7 +6609,6 @@ Partial Class Compras_Compras
IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaGasto").ToString.ToEntero IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaGasto").ToString.ToEntero
End If End If
End If End If
If importeMN <> 0 Then If importeMN <> 0 Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMN, Referencia, 6, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveIE:=CveIE, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMN, Referencia, 6, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveIE:=CveIE, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual,
CveClasificacion:=RowDetalle("CveClasificacion").ToString().ToEntero(), CveSubProyecto:=RowDetalle("CveSubProyecto").ToString().ToEntero(), Contabilizable:=SeContabiliza) Then CveClasificacion:=RowDetalle("CveClasificacion").ToString().ToEntero(), CveSubProyecto:=RowDetalle("CveSubProyecto").ToString().ToEntero(), Contabilizable:=SeContabiliza) Then
@@ -6715,43 +6616,26 @@ Partial Class Compras_Compras
End If End If
End If End If
Next Next
End Select End Select
'End If
End If End If
'falta el registro de la NC cuando es 'falta el registro de la NC cuando es
Dim RegistroCuentaPuente As Boolean = False Dim RegistroCuentaPuente As Boolean = False
'NC CON PRODUCTOS - CUENTA PUENTE 'NC CON PRODUCTOS - CUENTA PUENTE
If DdlTipoComprobante.SelectedValue = "NC" And DdlTipoCompra.SelectedValue.Contiene("9", "12") Then
If DdlTipoComprobante.SelectedValue = "NC" And DdlTipoCompra.SelectedValue.ToEntero = 9 Then
RegistraConcepto225 = True RegistraConcepto225 = True
End If End If
If RegistraConcepto225 Then If RegistraConcepto225 Then
importeMovimiento = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 And ISNULL(AplicaCostoIndirecto,0) <> 1 And ISNULL(CveTipoPS,0) = 2").ToString.ToDecimal importeMovimiento = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 And ISNULL(AplicaCostoIndirecto,0) <> 1 And ISNULL(CveTipoPS,0) = 2").ToString.ToDecimal
importeMN = importeMovimiento * tipoCambioActual * Multiplicador importeMN = importeMovimiento * tipoCambioActual * Multiplicador
'no es necesario, ya se está interpretandoe l usado como producto 'no es necesario, ya se está interpretandoe l usado como producto
'If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'cuando es emp acumuladora
' Dim Valor As Decimal = 0
' For Each RowAcum As DataRow In GlobalDTAcumTamaños().FiltraParametros("CveEmpresa = 140").Rows
' Dim TotalTamanio = TmpDT.FiltroPrimeroValor("Total", $"CvePS={RowAcum("CvePSCargo")}").ToDecimal()
' If TotalTamanio > 0 Then
' Valor += TotalTamanio
' End If
' Next
' importeMovimiento += Valor
' importeMN = importeMovimiento * tipoCambioActual * Multiplicador
'End If
Dim ConceptoContabilizacionNC = 225 Dim ConceptoContabilizacionNC = 225
Dim tCveClasif As Integer = -1
Dim tCveSubProyecto As Integer = TmpDT.FiltroPrimeroValor("CveSubProyecto", "CveSubProyecto > 0 ").ToEntero
Dim CveMovimientoDevolucion As Integer = -1 Dim CveMovimientoDevolucion As Integer = -1
'CUANDO NO SE RECIBE LA MERCANCIA EN COMPRAS, SE REGISTRA EL 225, SI SE ESTA REGISTRANDO LA DEVOLUCION EN ALMACEN, SE REGISTRA EL 68 'CUANDO NO SE RECIBE LA MERCANCIA EN COMPRAS, SE REGISTRA EL 225, SI SE ESTA REGISTRANDO LA DEVOLUCION EN ALMACEN, SE REGISTRA EL 68
@@ -6759,11 +6643,10 @@ Partial Class Compras_Compras
ConceptoContabilizacionNC = 68 ConceptoContabilizacionNC = 68
CveMovimientoDevolucion = Devolucion.CveMovimiento CveMovimientoDevolucion = Devolucion.CveMovimiento
End If End If
'cuando es garantía.
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ObjConta.GetRetCuenta(ConceptoContabilizacionNC, UsuarioActual.CveEmpresa) Then If DdlTipoCompra.SelectedValue = "12" Then
If ObjConta.DtResultados.Rows.Count > 0 Then ConceptoContabilizacionNC = 259
IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero tCveClasif = TmpDT.FiltroPrimeroValor("CveClasificacion", "CveClasificacion > 0 ").ToEntero
End If
End If End If
Concepto = $"{NombreProveedor} {TxtSerie.Text} - {TxtFolio.Text}" Concepto = $"{NombreProveedor} {TxtSerie.Text} - {TxtFolio.Text}"
@@ -6771,20 +6654,12 @@ Partial Class Compras_Compras
If importeMovimiento > 0 Or TxtTotal.Text.ToDecimal = 0 Then If importeMovimiento > 0 Or TxtTotal.Text.ToDecimal = 0 Then
RegistroCuentaPuente = True RegistroCuentaPuente = True
Dim ImporteTransito As Decimal = 0 Dim ImporteTransito As Decimal = 0
'Conta ContPAQ
If IdCtaContable = 0 Then
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 68))("ConceptoContable").ToString)
idCuentaContabilizacion = 0
End If
'SI ES GASTO DE ALMACEN NO DEBE CONTABILIZAR CONCEPTO 68 'SI ES GASTO DE ALMACEN NO DEBE CONTABILIZAR CONCEPTO 68
If DdlTipoCompra.SelectedValue = "10" AndAlso ConceptoContabilizacionNC = 68 Then If DdlTipoCompra.SelectedValue = "10" AndAlso ConceptoContabilizacionNC = 68 Then
SeContabiliza = False SeContabiliza = False
IdCtaContable = 0 IdCtaContable = 0
End If End If
'se lleva saldo de Mercancía en tránsito 'se lleva saldo de Mercancía en tránsito
If ChkNCInvNC.Checked Then If ChkNCInvNC.Checked Then
For Each Gvr As GridViewRow In GVNCInv.Rows For Each Gvr As GridViewRow In GVNCInv.Rows
If Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble > 0 Then If Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble > 0 Then
@@ -6792,10 +6667,8 @@ Partial Class Compras_Compras
ErrorMovInv = True ErrorMovInv = True
Exit For Exit For
End If End If
End If End If
Next Next
Dim diferenciaTransito As Decimal = 0 Dim diferenciaTransito As Decimal = 0
For Each Gvr As GridViewRow In GVNCInvAlmacen.Rows For Each Gvr As GridViewRow In GVNCInvAlmacen.Rows
If Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble > 0 Then If Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble > 0 Then
@@ -6815,7 +6688,6 @@ Partial Class Compras_Compras
End If End If
End If End If
Next Next
'la diferencia se va aplicar sobre los 'la diferencia se va aplicar sobre los
'Dim diferenciaTransito As Decimal = ImporteTransito - importeMN.RoundSQL 'Dim diferenciaTransito As Decimal = ImporteTransito - importeMN.RoundSQL
@@ -6832,21 +6704,17 @@ Partial Class Compras_Compras
End If End If
End If End If
Else Else
Dim DiferenciaDevolucion As Decimal = importeMovimiento - TotalRealDevolucion Dim DiferenciaDevolucion As Decimal = importeMovimiento - TotalRealDevolucion
If TotalRealDevolucion <> 0 Then If TotalRealDevolucion <> 0 Then
If Math.Abs(DiferenciaDevolucion) > 0 Then If Math.Abs(DiferenciaDevolucion) > 0 Then
Dim CveSubProyecto69 As Integer = TmpDT.FiltroPrimeroValor("CveSubProyecto", "CveSubProyecto > 0 ").ToEntero
Dim CveClasificacion69 As Integer = TmpDT.FiltroPrimeroValor("CveClasificacion", "CveClasificacion > 0 ").ToEntero
Dim IdCtaContable69 As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {CveClasificacion69}").ToString.ToEntero
Dim tMovto As Boolean = False Dim tMovto As Boolean = False
If UsuarioActual.CveEmpresa = 119 Then If UsuarioActual.CveEmpresa = 119 Then
tMovto = True tMovto = True
Else Else
DiferenciaDevolucion = -DiferenciaDevolucion DiferenciaDevolucion = -DiferenciaDevolucion
End If End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, tMovto, DiferenciaDevolucion.RoundSQL(), Referencia, 69, Concepto, FechaMovimiento, IdCtaContable69, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=DiferenciaDevolucion, ImporteME:=If(tipoCambioActual = 1, 0, DiferenciaDevolucion), TipoCambio:=tipoCambioActual, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto69, CveClasificacion:=CveClasificacion69) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, tMovto, DiferenciaDevolucion.RoundSQL(), Referencia, 69, Concepto, FechaMovimiento, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=DiferenciaDevolucion, ImporteME:=If(tipoCambioActual = 1, 0, DiferenciaDevolucion), TipoCambio:=tipoCambioActual, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza, CveSubProyecto:=tCveSubProyecto, CveClasificacion:=tCveClasif) Then
ErrorPrepoliza = True ErrorPrepoliza = True
End If End If
End If End If
@@ -6854,7 +6722,7 @@ Partial Class Compras_Compras
ErrorPrepoliza = True ErrorPrepoliza = True
End If End If
Else Else
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento.RoundSQL, Referencia, ConceptoContabilizacionNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMovimiento * tipoCambioActual * Multiplicador, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento.RoundSQL, Referencia, ConceptoContabilizacionNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMovimiento * tipoCambioActual * Multiplicador, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, CveMovimientoAlmacen:=CveMovimientoDevolucion, CveClasificacion:=tCveClasif, CveSubProyecto:=tCveSubProyecto, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True ErrorPrepoliza = True
End If End If
End If End If
@@ -6864,7 +6732,7 @@ Partial Class Compras_Compras
If UsuarioActual.CveEmpresa.Contiene(119) Then If UsuarioActual.CveEmpresa.Contiene(119) Then
Dim ContienePSNeteoBonif As Boolean = False Dim ContienePSNeteoBonif As Boolean = False
For Each Dr As DataRow In TmpDT.Rows For Each Dr As DataRow In TmpDT.Rows
If Dr("CveClasificacion").ToString.ToEntero.Contiene(20319) Or DdlTipoCompra.SelectedValue.ToEntero = 11 Then 'clasificación de Bonificación, no se incluirá en el neteo If Dr("CveClasificacion").ToString.ToEntero.Contiene(20319) Or DdlTipoCompra.SelectedValue.Contiene("11") Then 'clasificación de Bonificación, no se incluirá en el neteo
ContienePSNeteoBonif = True ContienePSNeteoBonif = True
Exit For Exit For
End If End If
@@ -6874,8 +6742,6 @@ Partial Class Compras_Compras
importeMovimiento = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 And ISNULL(CveAlmacen,0) = 0 And ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveClasificacion = 20319 ").ToString.ToDecimal importeMovimiento = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 And ISNULL(CveAlmacen,0) = 0 And ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveClasificacion = 20319 ").ToString.ToDecimal
importeMN = importeMovimiento * tipoCambioActual * Multiplicador importeMN = importeMovimiento * tipoCambioActual * Multiplicador
Dim IdCtaContableDescCompra As Integer = UsuarioActual.Empresa.Funcionalidad(405).ToEntero Dim IdCtaContableDescCompra As Integer = UsuarioActual.Empresa.Funcionalidad(405).ToEntero
Dim CveSubProyecto259 As Integer = TmpDT.MAX("CveSubProyecto").ToEntero Dim CveSubProyecto259 As Integer = TmpDT.MAX("CveSubProyecto").ToEntero
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importeMovimiento, Referencia, 259, Concepto, FechaMovimiento, IdCtaContableDescCompra, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto259) Then If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importeMovimiento, Referencia, 259, Concepto, FechaMovimiento, IdCtaContableDescCompra, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto259) Then
@@ -6885,11 +6751,8 @@ Partial Class Compras_Compras
Else Else
ErrorPrepoliza = True ErrorPrepoliza = True
End If End If
End If End If
End If End If
End If End If
'ChkNCInvNC 'ChkNCInvNC
@@ -6921,17 +6784,14 @@ Partial Class Compras_Compras
Dim DTDistinct = DT.Copy Dim DTDistinct = DT.Copy
If UsuarioActual.Empresa.Funcionalidad(126) = "1" Then If UsuarioActual.Empresa.Funcionalidad(126) = "1" Then
For Each drowdis As DataRow In DTDistinct.Rows For Each drowdis As DataRow In DTDistinct.Rows
If drowdis("CveTipoGasto").ToString = "" Then If drowdis("CveTipoGasto").ToString = "" Then
drowdis("CveTipoGasto") = 0 drowdis("CveTipoGasto") = 0
End If End If
If drowdis("TipoGasto").ToString.Trim = "" Then If drowdis("TipoGasto").ToString.Trim = "" Then
drowdis("TipoGasto") = "ND" drowdis("TipoGasto") = "ND"
End If End If
Next Next
DTDistinct = DTDistinct.FiltraParametros("ISNULL(TipoAF, 0) <> 2", "", {"CveClasificacion", "Clasificacion", "SubProyecto", "CveSubProyecto", "CveTipoGasto", "TipoGasto"}) DTDistinct = DTDistinct.FiltraParametros("ISNULL(TipoAF, 0) <> 2", "", {"CveClasificacion", "Clasificacion", "SubProyecto", "CveSubProyecto", "CveTipoGasto", "TipoGasto"})
Else Else
@@ -6941,7 +6801,6 @@ Partial Class Compras_Compras
End If End If
If drowdis("TipoGasto").ToString.Trim = "" Then If drowdis("TipoGasto").ToString.Trim = "" Then
drowdis("TipoGasto") = "ND" drowdis("TipoGasto") = "ND"
End If End If
Next Next
DTDistinct.AcceptChanges() DTDistinct.AcceptChanges()
@@ -6956,7 +6815,6 @@ Partial Class Compras_Compras
Dim tTipoMovimiento As Boolean = TipoMovimiento Dim tTipoMovimiento As Boolean = TipoMovimiento
If DTDistinct.Rows.Count > 0 Then If DTDistinct.Rows.Count > 0 Then
For Each Row2 As DataRow In DTDistinct.Rows For Each Row2 As DataRow In DTDistinct.Rows
tTipoMovimiento = TipoMovimiento tTipoMovimiento = TipoMovimiento
'DETERMINA IMPORTE 'DETERMINA IMPORTE
If UsuarioActual.Empresa.Funcionalidad(126) = "1" Then If UsuarioActual.Empresa.Funcionalidad(126) = "1" Then
@@ -6966,7 +6824,6 @@ Partial Class Compras_Compras
End If End If
'se debe de restar el costo indirecto, si se recibió por OC sobre el importe del gasto, por si ya está incuido 'se debe de restar el costo indirecto, si se recibió por OC sobre el importe del gasto, por si ya está incuido
importeMovimiento = importeMovimiento - CostoIndirectoAcum176 importeMovimiento = importeMovimiento - CostoIndirectoAcum176
importeMN = importeMovimiento * tipoCambioActual * Multiplicador '[IPP] EL 6 DEBE SER POSITIVO 27/AGOSTO/2018 importeMN = importeMovimiento * tipoCambioActual * Multiplicador '[IPP] EL 6 DEBE SER POSITIVO 27/AGOSTO/2018
'CLASIFICACION 'CLASIFICACION
@@ -7004,8 +6861,6 @@ Partial Class Compras_Compras
importeMovimiento = -importeMovimiento importeMovimiento = -importeMovimiento
importeMN = -importeMN importeMN = -importeMN
End If End If
Dim usacomplementariaProveedor As Boolean = False Dim usacomplementariaProveedor As Boolean = False
usacomplementariaProveedor = If(tipoCambioActual > 1, True, False) usacomplementariaProveedor = If(tipoCambioActual > 1, True, False)
@@ -7426,9 +7281,7 @@ Partial Class Compras_Compras
ErrorMovtosCxP = AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjConta) ErrorMovtosCxP = AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjConta)
End If End If
End If End If
End If End If
Else Else
@@ -7454,12 +7307,6 @@ Partial Class Compras_Compras
IdCtaContable = CtaProveedorAnticiposExtranjera IdCtaContable = CtaProveedorAnticiposExtranjera
End If End If
'Agregamos el 21/37/60
'Dim ImporComisionAnticipo As Decimal = Ant.ImporteComision
'Dim importeMNComision As Decimal = ImporComisionAnticipo * tipoCambioActual * Multiplicador
If Not usacomplementariaAnticipo Then If Not usacomplementariaAnticipo Then
ImporteAntMN = TipoCambioAnt * ImporteAnt ImporteAntMN = TipoCambioAnt * ImporteAnt
End If End If
@@ -7484,13 +7331,10 @@ Partial Class Compras_Compras
Pago.TCPago = Ant.TCCompra Pago.TCPago = Ant.TCCompra
Pago.CveMonedaPago = If(Ant.TCCompra > 1, 2, 1) Pago.CveMonedaPago = If(Ant.TCCompra > 1, 2, 1)
Pago.OtroGastoIngreso = ImporComisionAnticipo Pago.OtroGastoIngreso = ImporComisionAnticipo
ErrorPrepoliza = AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjConta) ErrorPrepoliza = AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjConta)
End If End If
End If End If
End If End If
If UsuarioActual.CveEmpresa.Contiene(83) Then If UsuarioActual.CveEmpresa.Contiene(83) Then
@@ -7504,7 +7348,6 @@ Partial Class Compras_Compras
'Simplificacion de PrePolizas 'Simplificacion de PrePolizas
If UsuarioActual.Empresa.Funcionalidad(220) <> "" Then If UsuarioActual.Empresa.Funcionalidad(220) <> "" Then
If Not ObjConta.UpdatePrePolizasDetalleBloquear(Ant.CvePrePoliza, False) Then If Not ObjConta.UpdatePrePolizasDetalleBloquear(Ant.CvePrePoliza, False) Then
ErrorPrepoliza = True ErrorPrepoliza = True
Alert("No se pudo desbloquear los movimientos", TipoMensaje.MsgError) Alert("No se pudo desbloquear los movimientos", TipoMensaje.MsgError)
@@ -7516,10 +7359,8 @@ Partial Class Compras_Compras
End If End If
End If End If
End If End If
Next Next
importeMovimiento = 0 importeMovimiento = 0
End If End If
End Select End Select
@@ -7529,19 +7370,10 @@ Partial Class Compras_Compras
End If End If
'5, 305, 306, 311 '5, 305, 306, 311
If importeMovimiento <> 0 Or (CveConceptoOriginal = 5 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Fac", "Ant")) Or (ConceptoContable.Contiene(18) AndAlso DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") AndAlso Not GuardoConcepto18) Then If importeMovimiento <> 0 Or (CveConceptoOriginal = 5 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Fac", "Ant")) Or (ConceptoContable.Contiene(18) AndAlso DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") AndAlso Not GuardoConcepto18) Then
'Conta ContPAQ
If IdCtaContable = 0 Then
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
idCuentaContabilizacion = 0
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveSubProyecto:=CveSubProyectoInsertar, CveProveedor:=CveProveedorConcepto, CveIE:=CveIE, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=Math.Round(importeMN, 2, MidpointRounding.AwayFromZero), ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, PorcentajeImpuesto:=PorcentajeImpuesto, Contabilizable:=SeContabiliza) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveSubProyecto:=CveSubProyectoInsertar, CveProveedor:=CveProveedorConcepto, CveIE:=CveIE, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=Math.Round(importeMN, 2, MidpointRounding.AwayFromZero), ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, PorcentajeImpuesto:=PorcentajeImpuesto, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True ErrorPrepoliza = True
Exit For Exit For
End If End If
End If End If
Next Next
@@ -10773,74 +10605,43 @@ Partial Class Compras_Compras
If Not OCVinculada Then If Not OCVinculada Then
e.Row.Cells(3).Text = e.Row.DBCampo("PSCodigo").ToString e.Row.Cells(3).Text = e.Row.DBCampo("PSCodigo").ToString
End If End If
Else Else
If e.Row.DBCampo("CveMetodoInventario").ToString = "5" Then If e.Row.DBCampo("CveMetodoInventario").ToString = "5" Then
e.Row.FCTextBox("TbCantidad").Enabled = False e.Row.FCTextBox("TbCantidad").Enabled = False
Else Else
e.Row.FCTextBox("TbCantidad").Enabled = True e.Row.FCTextBox("TbCantidad").Enabled = True
End If End If
e.Row.FCCheckBox("cbInv").Enabled = False e.Row.FCCheckBox("cbInv").Enabled = False
End If End If
If UsuarioActual.Empresa.UsaAC Then If UsuarioActual.Empresa.UsaAC Then e.Row.FCCheckBox("cbInv").Enabled = False
e.Row.FCCheckBox("cbInv").Enabled = False
End If
If EsDevolucionApoyoLogistico Then
e.Row.FCDropDownList("ddlEAlmacen").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen = 27") 'GlobalDTAlmacen(UsuarioActual.CveEmpresa)
Else
e.Row.FCDropDownList("ddlEAlmacen").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros(If(DdlTipoCompra.SelectedValue.ToEntero = 9, "CveTipoAlmacen IN (21)", "CveTipoAlmacen IN (1,2,7,14,19)")) 'GlobalDTAlmacen(UsuarioActual.CveEmpresa)
End If
Dim StrTipo As String = "CveTipoAlmacen IN (1,2,7,14,19)"
If DdlTipoCompra.SelectedValue.Contiene("9", "12") Then StrTipo = "CveTipoAlmacen IN (21)"
If EsDevolucionApoyoLogistico Then StrTipo = "CveTipoAlmacen = 27"
e.Row.FCDropDownList("ddlEAlmacen").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros(StrTipo)
e.Row.FCDropDownList("ddlEAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1")) e.Row.FCDropDownList("ddlEAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1"))
e.Row.FCDropDownList("ddlEAlmacen").DataBind() e.Row.FCDropDownList("ddlEAlmacen").DataBind()
'e.Row.FCDropDownList("ddlEAlmacen").SelectedValue = If(e.Row.DBCampo("CveAlmacen").ToEntero <= 0, "-1", e.Row.DBCampo("CveAlmacen"))
If UsuarioActual.Empresa.UsaAC Then e.Row.FCDropDownList("ddlEAlmacen").Enabled = False If UsuarioActual.Empresa.UsaAC Then e.Row.FCDropDownList("ddlEAlmacen").Enabled = False
If UsuarioActual.Empresa.Funcionalidad(567) = "1" Then If UsuarioActual.Empresa.Funcionalidad(567) = "1" Then
If e.Row.FCDropDownList("ddlEAlmacen").Items.Count > 1 Then If e.Row.FCDropDownList("ddlEAlmacen").Items.Count > 1 Then
e.Row.FCDropDownList("ddlEAlmacen").SelectedIndex = 1 e.Row.FCDropDownList("ddlEAlmacen").SelectedIndex = 1
e.Row.FCCheckBox("cbInv").Checked = True e.Row.FCCheckBox("cbInv").Checked = True
ddlAlmacenConsignacion_SelectedIndexChanged(e.Row.FCDropDownList("ddlEAlmacen"), Nothing) ddlAlmacenConsignacion_SelectedIndexChanged(e.Row.FCDropDownList("ddlEAlmacen"), Nothing)
CambiaTotalDevengar(Nothing, Nothing) CambiaTotalDevengar(Nothing, Nothing)
End If End If
End If End If
If Not e.Row.DBCampo("CveMetodoInventario").ToString = "5" Then If Not e.Row.DBCampo("CveMetodoInventario").ToString = "5" Then
e.Row.FCTextBox("TbCantidad").Attributes.Add("onblur", String.Format("ValidarCantidad(this,{0})", If(e.Row.DBCampo("CantidadF").ToString.ToDecimal > e.Row.DBCampo("Cantidad").ToString.ToDecimal, e.Row.DBCampo("Cantidad"), e.Row.DBCampo("CantidadF")))) e.Row.FCTextBox("TbCantidad").Attributes.Add("onblur", String.Format("ValidarCantidad(this,{0})", If(e.Row.DBCampo("CantidadF").ToString.ToDecimal > e.Row.DBCampo("Cantidad").ToString.ToDecimal, e.Row.DBCampo("Cantidad"), e.Row.DBCampo("CantidadF"))))
e.Row.FCTextBox("TbCantidad").Text = If(e.Row.DBCampo("CantidadF").ToString.ToDecimal > e.Row.DBCampo("Cantidad").ToString.ToDecimal, e.Row.DBCampo("Cantidad"), e.Row.DBCampo("CantidadF")) e.Row.FCTextBox("TbCantidad").Text = If(e.Row.DBCampo("CantidadF").ToString.ToDecimal > e.Row.DBCampo("Cantidad").ToString.ToDecimal, e.Row.DBCampo("Cantidad"), e.Row.DBCampo("CantidadF"))
End If End If
'e.Row.FCImageButton("btnImgDestino").Attributes.Add("onclick", "javascript:$('#DivAlmacen').show(500); PosicionaObjeto(this.id,'DivAlmacen'); CargarValores('" & e.Row.RowIndex & "','" & e.Row.DBCampo("Cantidad") & "','" & e.Row.DBCampo("PS").Replace("'", "\'") & "'); ") If e.Row.DBCampo("Consec").ToEntero = 0 Then e.Row.BackColor = Drawing.Color.PaleGreen
' e.Row.FCImageButton("btnImgDestino").ID = e.Row.FCImageButton("btnImgDestino").ID.ToString + e.Row.RowIndex.ToString
'e.Row.Cells(6).ToolTip = "Enviar a otro Almacén."
If e.Row.DBCampo("Consec").ToEntero = 0 Then If UsuarioActual.CveEmpresa = 66 Then e.Row.FCDropDownList("DdlRecibirInv").Items.RemoveAt(1)
e.Row.BackColor = Drawing.Color.PaleGreen
End If
If UsuarioActual.CveEmpresa = 66 Then
e.Row.FCDropDownList("DdlRecibirInv").Items.RemoveAt(1)
End If
'If isAlmacenistaGluyas() Then
' Dim dt As DataTable = Nothing
' dt = GlobalDTProductosServicios(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoPS=2", "PS")
' e.Row.FCDropDownList("Ddlnewps").DataSource = dt 'GlobalDTAlmacen(UsuarioActual.CveEmpresa)
' e.Row.FCDropDownList("Ddlnewps").DataBind()
' e.Row.FCDropDownList("Ddlnewps").Items.Insert(0, New ListItem("Seleccione", "-1"))
' dt.Dispose()
'End If
'Consignaciones 'Consignaciones
If CveConsignacion > 0 Then If CveConsignacion > 0 Then
@@ -10851,7 +10652,6 @@ Partial Class Compras_Compras
If e.Row.DBCampo("CveAlmacenConsignacion").ToEntero > 0 Then If e.Row.DBCampo("CveAlmacenConsignacion").ToEntero > 0 Then
e.Row.FCDropDownList("ddlAlmacenConsignacion").SelectedValueExist(e.Row.DBCampo("CveAlmacenConsignacion")) e.Row.FCDropDownList("ddlAlmacenConsignacion").SelectedValueExist(e.Row.DBCampo("CveAlmacenConsignacion"))
End If End If
''CARGA CONSIGNACIONES ''CARGA CONSIGNACIONES
e.Row.FCDropDownList("DdlVinculaConsignacion").DataSource = DtConsignaciones.FiltraParametros(String.Format("CveAlmacenSalida = {0} OR {0} = '-1'", e.Row.FCDropDownList("ddlAlmacenConsignacion").SelectedValue)) e.Row.FCDropDownList("DdlVinculaConsignacion").DataSource = DtConsignaciones.FiltraParametros(String.Format("CveAlmacenSalida = {0} OR {0} = '-1'", e.Row.FCDropDownList("ddlAlmacenConsignacion").SelectedValue))
e.Row.FCDropDownList("DdlVinculaConsignacion").DataBind() e.Row.FCDropDownList("DdlVinculaConsignacion").DataBind()
@@ -10861,7 +10661,6 @@ Partial Class Compras_Compras
e.Row.FCDropDownList("DdlVinculaConsignacion").SelectedValueExist(e.Row.DBCampo("NoConsignacion")) e.Row.FCDropDownList("DdlVinculaConsignacion").SelectedValueExist(e.Row.DBCampo("NoConsignacion"))
e.Row.FCHiddenField("HdnNoConsignacion").Value = e.Row.DBCampo("NoConsignacion") e.Row.FCHiddenField("HdnNoConsignacion").Value = e.Row.DBCampo("NoConsignacion")
End If End If
If e.Row.DBCampo("CveConsignacion").ToEntero > 0 Then If e.Row.DBCampo("CveConsignacion").ToEntero > 0 Then
e.Row.FCHiddenField("HdnCveConsignacion").Value = e.Row.DBCampo("CveConsignacion") e.Row.FCHiddenField("HdnCveConsignacion").Value = e.Row.DBCampo("CveConsignacion")
e.Row.FCHiddenField("HdnPS").Value = e.Row.DBCampo("HdnPS") e.Row.FCHiddenField("HdnPS").Value = e.Row.DBCampo("HdnPS")
@@ -10877,8 +10676,6 @@ Partial Class Compras_Compras
End If End If
If Not UsuarioActual.Empresa.UsaAC Then If Not UsuarioActual.Empresa.UsaAC Then
e.Row.FCTextBox("TxtDividir").Attributes.Add("onkeyup", String.Format("FormatoMoneda(this);LimitaCantidad({0},this,'{1}');", e.Row.DBCampo("Cantidad"), e.Row.FCButton("BtnDividirCompra").ClientID)) e.Row.FCTextBox("TxtDividir").Attributes.Add("onkeyup", String.Format("FormatoMoneda(this);LimitaCantidad({0},this,'{1}');", e.Row.DBCampo("Cantidad"), e.Row.FCButton("BtnDividirCompra").ClientID))
e.Row.FCTextBox("TxtDividir").Text = "" e.Row.FCTextBox("TxtDividir").Text = ""
@@ -10889,31 +10686,20 @@ Partial Class Compras_Compras
e.Row.FCTextBox("TxtDividir").Visible = False e.Row.FCTextBox("TxtDividir").Visible = False
End If End If
End If End If
End If End If
'HEADER GvInv 'HEADER GvInv
If e.Row.RowType = DataControlRowType.Header Then If e.Row.RowType = DataControlRowType.Header Then
Dim StrAlmacenes As String = "CveTipoAlmacen IN (1,2,7,14,19)" Dim StrAlmacenes As String = "CveTipoAlmacen IN (1,2,7,14,19)"
' iliana, horacio, marco, RMF. 2017.03.13
If UsuarioActual.CveUsuario.Contiene(1397, 1517, 1565) Then StrAlmacenes = "CveTipoAlmacen IN (1,2,7,14,12,19)"
If DdlTipoCompra.SelectedValue.ToEntero = 9 Then StrAlmacenes = "CveTipoAlmacen IN (21)"
' salidas de garantía
If DdlTipoCompra.SelectedValue.ToEntero = 12 Then StrAlmacenes = "CveTipoAlmacen IN (21)"
If DdlTipoCompra.SelectedValue.ToEntero = 10 Then StrAlmacenes = $"Modalidad = 0"
If EsDevolucionApoyoLogistico Then StrAlmacenes = " CveTipoAlmacen = 27"
If UsuarioActual.CveUsuario.Contiene(1397, 1517, 1565) Then ' iliana, horacio, marco, RMF. 2017.03.13 e.Row.FCDropDownList("ddlAlmacen").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros(StrAlmacenes)
StrAlmacenes = "CveTipoAlmacen IN (1,2,7,14,12,19)"
End If
If DdlTipoCompra.SelectedValue.ToEntero = 9 Then
StrAlmacenes = "CveTipoAlmacen IN (21)"
End If
If DdlTipoCompra.SelectedValue.ToEntero = 10 Then
StrAlmacenes = $"Modalidad = 0"
End If
If EsDevolucionApoyoLogistico Then
StrAlmacenes = " CveTipoAlmacen = 27"
End If
e.Row.FCDropDownList("ddlAlmacen").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros(StrAlmacenes) 'GlobalDTAlmacen(UsuarioActual.CveEmpresa)
e.Row.FCDropDownList("ddlAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1")) e.Row.FCDropDownList("ddlAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1"))
e.Row.FCDropDownList("ddlAlmacen").DataBind() e.Row.FCDropDownList("ddlAlmacen").DataBind()
@@ -10926,19 +10712,14 @@ Partial Class Compras_Compras
e.Row.FCDropDownList("ddlAlmacenConsignacionGeneral").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 4) e.Row.FCDropDownList("ddlAlmacenConsignacionGeneral").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 4)
e.Row.FCDropDownList("ddlAlmacenConsignacionGeneral").DataBind() e.Row.FCDropDownList("ddlAlmacenConsignacionGeneral").DataBind()
If UsuarioActual.Empresa.Funcionalidad(567) = "1" Then If UsuarioActual.Empresa.Funcionalidad(567) = "1" Then
If e.Row.FCDropDownList("ddlAlmacen").Items.Count > 1 Then If e.Row.FCDropDownList("ddlAlmacen").Items.Count > 1 Then
e.Row.FCDropDownList("ddlAlmacen").SelectedIndex = 1 e.Row.FCDropDownList("ddlAlmacen").SelectedIndex = 1
e.Row.FCCheckBox("cbAll").Checked = True e.Row.FCCheckBox("cbAll").Checked = True
cbAll_CheckedChanged(e.Row.FCCheckBox("cbAll"), Nothing) cbAll_CheckedChanged(e.Row.FCCheckBox("cbAll"), Nothing)
ddlAlmacen_SelectedIndexChanged(e.Row.FCDropDownList("ddlAlmacen"), Nothing) ddlAlmacen_SelectedIndexChanged(e.Row.FCDropDownList("ddlAlmacen"), Nothing)
End If End If
End If End If
End If End If
End Sub End Sub
@@ -10953,81 +10734,6 @@ Partial Class Compras_Compras
InicializaCargaEvidenciaAlmacen() InicializaCargaEvidenciaAlmacen()
End Sub End Sub
'Protected Sub btnAgregarEq_Click(sender As Object, e As EventArgs) Handles btnAceptar.Click
' Dim eq As New ClsProductosServicios
' Dim Unidad As String = TmpDT.Rows.Item(HdnEq.Value.ToEntero)("UM").ToString
' Dim CvePS As Integer = TmpDT.Rows.Item(HdnEq.Value.ToEntero)("CvePS").ToString.ToEntero
' Dim CveUM As Integer = TmpDT.Rows.Item(HdnEq.Value.ToEntero)("CveUM").ToString.ToEntero
' Dim PU As Double = TmpDT.Rows.Item(HdnEq.Value.ToEntero)("PU").ToString.ToDouble
' Dim tCve As Integer = 0
' Dim ErrorUM As Boolean = False
' If UsuarioActual.Empresa.UsaInventarios And CveUM = 0 Then
' Dim UM As New ClsUnidadesMedida
' tCve = UM.AddUnidadMedida(TmpDT.Rows.Item(HdnEq.Value.ToEntero)("UM").ToString, TmpDT.Rows.Item(HdnEq.Value.ToEntero)("UM").ToString, "", "", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1)
' If tCve > 0 Then
' TmpDT.Rows.Item(HdnEq.Value.ToEntero)("CveUM") = tCve
' Else
' ErrorUM = True
' End If
' End If
' If Not ErrorUM Then
' If eq.AddPSEquivalencias(CvePS, CveUM, txtCantidadEq.Text.ToDecimal, False, PU, UsuarioActual.CveUsuario) Then
' TmpDT.Rows.Item(HdnEq.Value.ToEntero)("CveEq") = 1
' End If
' End If
' GvPS.DataSource = TmpDT
' GvPS.DataBind()
' eq.Dispose()
' txtCantidadEq.Text = ""
'End Sub
'Protected Sub Enviar_Click(sender As Object, e As ImageClickEventArgs) Handles ImgAdd.Click
' If TbCantidadAlm.Text.ToDouble < DtInv.Rows.Item(hdnIndexInv.Value.ToEntero)("Cantidad").ToString.ToDouble And TbCantidadAlm.Text.ToDouble > 0 Then
' DtInv.Rows.Item(hdnIndexInv.Value.ToEntero)("Cantidad") = DtInv.Rows.Item(hdnIndexInv.Value.ToEntero)("Cantidad").ToString.ToDouble - TbCantidadAlm.Text.ToDouble
' AddDTEnvio(TbCantidadAlm.Text.ToDouble,
' DtInv.Rows.Item(hdnIndexInv.Value.ToEntero)("UM").ToString,
' DtInv.Rows.Item(hdnIndexInv.Value.ToEntero)("CveUM").ToString.ToEntero,
' DtInv.Rows.Item(hdnIndexInv.Value.ToEntero)("CvePS").ToString().ToEntero,
' DtInv.Rows.Item(hdnIndexInv.Value.ToEntero)("PS").ToString,
' DtInv.Rows.Item(hdnIndexInv.Value.ToEntero)("PU").ToString.ToDouble,
' ddlAlmacenAdd.SelectedValue.ToEntero, DtInv.Rows.Item(hdnIndexInv.Value.ToEntero)("CveEq").ToString.ToEntero)
' Else
' Alert("El campo cantidad es necesario que sea mayor que 0 y menor al registro seleccionado.")
' End If
' TbCantidadAlm.Text = ""
' ddlAlmacenAdd.SelectedIndex = 0
' UpINV.Update()
' ' Alert(TmpDT.Rows.Count.ToString)
'End Sub
Protected Sub cbAll_CheckedChanged(sender As Object, e As EventArgs) Protected Sub cbAll_CheckedChanged(sender As Object, e As EventArgs)
For i As Integer = 0 To GvInv.Rows.Count - 1 For i As Integer = 0 To GvInv.Rows.Count - 1
@@ -13988,7 +13694,8 @@ Partial Class Compras_Compras
dr("Concepto").ToString, TxtFechaCancelacion.Text.ToDate, dr("IdCtaContable").ToString.ToEntero, dr("IdSegmentoNegocio").ToString.ToEntero, dr("CveIE").ToString.ToEntero, dr("Concepto").ToString, TxtFechaCancelacion.Text.ToDate, dr("IdCtaContable").ToString.ToEntero, dr("IdSegmentoNegocio").ToString.ToEntero, dr("CveIE").ToString.ToEntero,
dr("CveVenta").ToString.ToEntero, dr("CveCompra").ToString.ToEntero, dr("CveSubProyecto").ToString.ToEntero, dr("CveCliente").ToString.ToEntero, dr("CveProveedor").ToString.ToEntero, dr("CvePersonal").ToString.ToEntero, dr("CveVenta").ToString.ToEntero, dr("CveCompra").ToString.ToEntero, dr("CveSubProyecto").ToString.ToEntero, dr("CveCliente").ToString.ToEntero, dr("CveProveedor").ToString.ToEntero, dr("CvePersonal").ToString.ToEntero,
dr("CveMovimientoAlmacen").ToString.ToEntero, dr("CveActivoFijo").ToString.ToEntero, -1, -1, dr("CveCreditoDetalle").ToString.ToEntero, dr("CveMovimientoAlmacen").ToString.ToEntero, dr("CveActivoFijo").ToString.ToEntero, -1, -1, dr("CveCreditoDetalle").ToString.ToEntero,
ImporteMX:=dr("Importe").ToString.ToDecimal * -1, ImporteME:=dr("Importe").ToString.ToDecimal * -1, CveTipoGasto:=dr("CveTipoGasto").ToString.ToEntero, CveClasificacion:=dr("CveClasificacion").ToString.ToEntero, CveOCDetalle:=dr("CveOCDetalle").ToString.ToEntero, ImporteMX:=dr("Importe").ToString.ToDecimal * -1, ImporteME:=dr("Importe").ToString.ToDecimal * -1, CveTipoGasto:=dr("CveTipoGasto").ToString.ToEntero, CveClasificacion:=dr("CveClasificacion").ToString.ToEntero,
PorcentajeImpuesto:=dr("PorcentajeImpuesto").ToString.ToDecimal, CveOCDetalle:=dr("CveOCDetalle").ToString.ToEntero,
CveCompraAmortizacion:=dr("CveCompraAmortizacion").ToString.ToEntero) Then CveCompraAmortizacion:=dr("CveCompraAmortizacion").ToString.ToEntero) Then
ErrorCancelar = True ErrorCancelar = True
Exit For Exit For
@@ -19707,7 +19414,7 @@ Partial Class Compras_Compras
Protected Sub DdlTipoCompra_SelectedIndexChanged(sender As Object, e As EventArgs) Protected Sub DdlTipoCompra_SelectedIndexChanged(sender As Object, e As EventArgs)
If DdlTipoCompra.SelectedValue.ToEntero.Contiene(9, 10) Then 'Al seleccionar apoyo logístico se cargan los amancenes de devoculcion proveedor para dar entrada If DdlTipoCompra.SelectedValue.ToEntero.Contiene(9, 10, 12) Then 'Al seleccionar apoyo logístico se cargan los amancenes de devoculcion proveedor para dar entrada
CargaGvInv() CargaGvInv()
End If End If
@@ -19720,6 +19427,10 @@ Partial Class Compras_Compras
If DdlFolioGarantia.SelectedValue.ToEntero <> -1 Then If DdlFolioGarantia.SelectedValue.ToEntero <> -1 Then
ValidaFolioGarantia(True) ValidaFolioGarantia(True)
'visualizar el div de almacen
Pnlalmaceninventarios.Visible = True
paneldevolucion.Visible = False
uppAlmacenGral.Update()
End If End If
End Sub End Sub