-- 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="Apoyo Logístico" Value="9"></asp:ListItem>
<asp:ListItem Text="NC Por Devolución" Value="11"></asp:ListItem>
<%--<asp:ListItem Text="Garantía" Value="12"></asp:ListItem>--%>
</asp:DropDownList>
</div>
@@ -1151,7 +1152,8 @@
<ajax:TabPanel ID="TabAlmacen" runat="server" HeaderText="Almacén">
<ContentTemplate>
<asp:UpdatePanel runat="server" ID="uppAlmacenGral" UpdateMode="Conditional">
<ContentTemplate>
<asp:Panel ID="Pnlalmaceninventarios" runat="server">
<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:DropDownList>
</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>
</li>
<%--<li>Folio Consignación:
@@ -1431,7 +1426,8 @@
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
@@ -1451,14 +1447,7 @@
<div class="portlet-title portlet-filterT">
<div class="titlefiltros caption ">
<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>
<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>
@@ -1857,19 +1846,9 @@
<asp:Label ID="LbProductoServicio" runat="server" Text='<%# Eval("PS")%>'></asp:Label>
</ItemTemplate>
<HeaderTemplate>
Clasificación
Clasificación
<br />
Producto/Servicio
Producto/Servicio
</HeaderTemplate>
</asp:TemplateField>
<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
End Set
End Property
Private Property DtPendientesAlmacen As DataTable
Get
DtPendientesAlmacen = DirectCast(ViewState("DtPendientesAlmacen"), DataTable)
End Get
Set(ByVal value As DataTable)
ViewState("DtPendientesAlmacen") = value
End Set
@@ -1109,19 +1107,12 @@ Partial Class Compras_Compras
ViewState("CveTipoConcepto") = value
End Set
End Property
Private Property CveRetISRConceptoOriginal As Integer
Get
If ViewState("CveRetISRConceptoOriginal") Is Nothing Then
ViewState("CveRetISRConceptoOriginal") = -1
End If
Return ViewState("CveRetISRConceptoOriginal").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveRetISRConceptoOriginal") = value
@@ -1140,7 +1131,6 @@ Partial Class Compras_Compras
End Property
Public Property FechaCompraOriginal As Date
Get
Return ViewState("FechaCompraOriginal").ToString.ToDate
End Get
@@ -1152,7 +1142,6 @@ Partial Class Compras_Compras
Private Property UUIDSList As List(Of String)
Get
If ViewState("UUIDSList") Is Nothing Then
Return New List(Of String)
Else
@@ -1168,7 +1157,6 @@ Partial Class Compras_Compras
Private Property NumeroReembolsoOriginal As String
Get
If ViewState("NumeroReembolsoOriginal") Is Nothing Then
ViewState("NumeroReembolsoOriginal") = ""
End If
@@ -1178,13 +1166,10 @@ Partial Class Compras_Compras
Set(value As String)
ViewState("NumeroReembolsoOriginal") = value
End Set
End Property
Private Property EsDevolucionApoyoLogistico As Boolean
Get
If ViewState("EsDevolucionApoyoLogistico") Is Nothing Then
ViewState("EsDevolucionApoyoLogistico") = False
End If
@@ -1197,21 +1182,16 @@ Partial Class Compras_Compras
Private Property TipoCompraOriginal As Integer
Get
If ViewState("TipoCompraOriginal") Is Nothing Then
ViewState("TipoCompraOriginal") = -1
End If
Return ViewState("TipoCompraOriginal").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("TipoCompraOriginal") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
'ImgBtnBuscarOC.Attributes.Add("data-toggle", "tooltip")
@@ -1242,12 +1222,6 @@ Partial Class Compras_Compras
btnProrateo2.Visible = True
End If
'****************************************************************
'If UsuarioActual.CveEmpresa = 72 Then
' LiRecepcion.Visible = True
' DdlRecepcion.SelectedValue = "2"
'End If
TipoCambio = 1
IvaAcumulado = 0
TotalAlmacen = 0
@@ -1306,8 +1280,6 @@ Partial Class Compras_Compras
TieneOC = False
CveMoneda = -1
ImgAnticiposPendientes.Attributes.Add("OnClick", "MuestraAnticipos();")
'ImgCerrar.Attributes.Add("OnClick", "$('#DivAnticipos').hide(200);")
'BtnCancelar.Attributes.Add("OnClick", "$('#DivAddEq').hide();")
@@ -1320,7 +1292,6 @@ Partial Class Compras_Compras
RBLPago.Visible = True
If UsuarioActual.Empresa.UsaAC Then RBLPago.Items.RemoveAt(2) 'Elimina Reembolso cuando es AC
If UsuarioActual.Empresa.UsaAC Then
TrReembolso.Visible = True
GvPS.Columns(1).Visible = True
@@ -1329,13 +1300,10 @@ Partial Class Compras_Compras
TxtOC.Attributes.Add("onkeypress", "fncBuscaOC(event);")
If UsuarioActual.CveEmpresa = 66 And UsuarioActual.TienePermisoProceso(96) Then
ChkProgramarPago.Visible = True
End If
'CARGA PERSONAL
'Dim ObjPersonal As New ClsRH
'ObjPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa)
@@ -1363,7 +1331,6 @@ Partial Class Compras_Compras
End If
'Carga Proveedor
If Request("CveProveedor") IsNot Nothing AndAlso IsNumeric(Request("CveProveedor")) AndAlso Request("CveProveedor").ToEntero > 0 Then
ViewState("CveProveedor") = Request("CveProveedor")
@@ -1399,7 +1366,6 @@ Partial Class Compras_Compras
InicializaAplicaNCFact()
DivReembolso.Visible = False
RBLPago.Items(2).Enabled = False
End If
If DdlTipoComprobante.SelectedValue = "DEV" Then
@@ -1410,8 +1376,6 @@ Partial Class Compras_Compras
CambiaEjercicioAC()
End If
If UsuarioActual.Empresa.Funcionalidad(123) <> "" And Not UsuarioActual.TienePermisoProceso(156) Then
If Not ValidaCierrePeriodo() Then
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")
CargaCompra()
BtnGuardar.Enabled = False
'TdIVA.Visible = True
'DdlIVA.Enabled = False
DivConsignaciones.Visible = False
' 2018/05/25 - Muestra Boton Agregar Guia
LnkAgregarGuia.Visible = True
UpLnkPaqueteriaGuias.Update()
DivEsNoDeducible.Visible = True
DivActualizarVincular.Visible = True
DVModalAnticipoFechaEjecucion.Visible = True
Else
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("Apoyo Logístico", "9"))
DdlTipoCompra.Items.Add(New ListItem("NC Por Devolución", "11"))
DdlTipoCompra.Items.Add(New ListItem("Garantía", "12"))
Case "T"
DdlTipoCompra.Items.Clear()
DdlTipoCompra.Items.Add(New ListItem("Apoyo Logístico", "9"))
@@ -3218,7 +3176,6 @@ Partial Class Compras_Compras
HplImporte.Visible = False
HplImporte.Text = ""
HplImporte.NavigateUrl = ""
Else
If Saldo <= 0 Then
LblCompraEstatus.Text = "PAGADA"
@@ -3230,26 +3187,20 @@ Partial Class Compras_Compras
HplImporte.Visible = True
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)
Else
If Saldo < Total Then
LblCompraEstatus.Text = "ABONADA"
LblCompraEstatus.Font.Bold = True
End If
LblCompraEstatus.ForeColor = Drawing.Color.Navy
trSaldo.Visible = True
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)
End If
End If
UpEstatus.Update()
Else
If CveCompra > 0 Then
LblCompraEstatus.Font.Bold = True
LblCompraEstatus.ForeColor = Drawing.Color.Navy
@@ -3257,9 +3208,7 @@ Partial Class Compras_Compras
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)
End If
End If
End Sub
Private Sub CargaMonedas()
@@ -3268,9 +3217,6 @@ Partial Class Compras_Compras
End Sub
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)")
If DdlTipoCompra.SelectedValue = "10" Then
@@ -3280,12 +3226,9 @@ Partial Class Compras_Compras
ddlAlmacenAdd.DataSource = DtAlmacenes
DdlAlmacenDevolucion.DataSource = DtAlmacenes
End If
ddlAlmacenAdd.DataBind()
DdlAlmacenDevolucion.DataBind()
DdlAlmacenDevolucion.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub
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 indice = 0
Dim ImporteConcepto As Decimal = 0
If DdlTipoComprobante.SelectedValue = "Fac" AndAlso CveCompraRefacturacion <= 0 Then
Dim CveConceptoMovimiento As Integer = 2
'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
If GvInv.Rows(indice).FCDropDownList("DdlRecibirInv").SelectedValue = "1" Then
@@ -5557,7 +5504,7 @@ Partial Class Compras_Compras
Dim fecha As Date = TxtFecha.Text.ToDate
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
ErrorMovInv = True
@@ -5597,7 +5544,6 @@ Partial Class Compras_Compras
Next
End If
Else
'UNIDAD BASE - EQUIVALENCIAS - INVENTARIO
If UsuarioActual.CveEmpresa = 1 Then
DtEquivalencias = New DataTable
@@ -5614,8 +5560,6 @@ Partial Class Compras_Compras
CveUnidad = CveUnidadBase
End If
End If
ImporteConcepto = If(DdlMoneda.SelectedValue.ToEntero = 1, PUInv, PUInv * TipoCambioGuardar) - If(DdlMoneda.SelectedValue.ToEntero = 1, tDescuento, tDescuento * TipoCambioGuardar)
'si no es por serie lote
ImporteConcepto = If(UsuarioActual.Empresa.UsaAC, ImporteConcepto * IVA, ImporteConcepto)
@@ -5625,22 +5569,13 @@ Partial Class Compras_Compras
Exit For
End If
End If
End If
i = i + 1
contadorAlamcen = contadorAlamcen + 1
Next
End If
Next
End If
End If
If AplicarCostoIndirecto(ObjInventario, ObjCompras) Then
@@ -5848,18 +5783,8 @@ Partial Class Compras_Compras
Dim CuentasContablesInvalidas As New StringBuilder
Dim ConceptoPersonal As String = ""
Dim IdCtaIVAXAcreditar As Integer = 0
' Dim IdCtaIVAAcreditable As Integer = 0
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)
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
@@ -6073,10 +5998,6 @@ Partial Class Compras_Compras
ErrorPrepoliza = True
End If
'daskldaskldmaskldanmlksd
If importeMovimiento <> 0 Then
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
ErrorPrepoliza = True
End If
End If
End If
Next
End If
'If TipoCreditoInteres Then
@@ -6174,10 +6087,6 @@ Partial Class Compras_Compras
IdCtaContable = CtaProveedorExtranjera
End If
Case 30 'Bancos
importeMovimiento = importeBanco + importeCajaChica 'Uno de los dos debe ser 0
If CveMonedaPago = 2 AndAlso DdlMoneda.SelectedValue.ToEntero = 1 Then
@@ -6386,8 +6295,6 @@ Partial Class Compras_Compras
If RBLPago.SelectedValue.ToEntero = 4 Then
Exit Select 'Es credito el concepto 6 se agrega en CASE 17
End If
Dim DifSubTotatles As Decimal = 0D
If CveCompraRefacturacion > 0 Then
@@ -6583,7 +6490,6 @@ Partial Class Compras_Compras
End If
End If
Dim CveMovimientoAlmacen As Integer = -1
'If importeMovimiento <> 0 Then
@@ -6680,11 +6586,8 @@ Partial Class Compras_Compras
ErrorPrepoliza = True
End If
Else
If Not CveCompraRefacturacion > 0 Then
Dim CveSubProyecto240 As Integer = TmpDT.MAX("CveSubProyecto").ToEntero
If CveSubProyecto240 <= 0 Then
Alert("Debe de asignar un sub proyecto o centro de costos", TipoMensaje.MsgAdvertencia)
ErrorPrepoliza = True
@@ -6695,7 +6598,6 @@ Partial Class Compras_Compras
ErrorPrepoliza = True
End If
End If
End If
Case 6
Concepto = $"{NombreProveedor} {TxtSerie.Text} - {TxtFolio.Text}"
@@ -6707,7 +6609,6 @@ Partial Class Compras_Compras
IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaGasto").ToString.ToEntero
End If
End If
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,
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
Next
End Select
'End If
End If
'falta el registro de la NC cuando es
Dim RegistroCuentaPuente As Boolean = False
'NC CON PRODUCTOS - CUENTA PUENTE
If DdlTipoComprobante.SelectedValue = "NC" And DdlTipoCompra.SelectedValue.ToEntero = 9 Then
If DdlTipoComprobante.SelectedValue = "NC" And DdlTipoCompra.SelectedValue.Contiene("9", "12") Then
RegistraConcepto225 = True
End If
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
importeMN = importeMovimiento * tipoCambioActual * Multiplicador
'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 tCveClasif As Integer = -1
Dim tCveSubProyecto As Integer = TmpDT.FiltroPrimeroValor("CveSubProyecto", "CveSubProyecto > 0 ").ToEntero
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
@@ -6759,11 +6643,10 @@ Partial Class Compras_Compras
ConceptoContabilizacionNC = 68
CveMovimientoDevolucion = Devolucion.CveMovimiento
End If
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ObjConta.GetRetCuenta(ConceptoContabilizacionNC, UsuarioActual.CveEmpresa) Then
If ObjConta.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero
End If
'cuando es garantía.
If DdlTipoCompra.SelectedValue = "12" Then
ConceptoContabilizacionNC = 259
tCveClasif = TmpDT.FiltroPrimeroValor("CveClasificacion", "CveClasificacion > 0 ").ToEntero
End If
Concepto = $"{NombreProveedor} {TxtSerie.Text} - {TxtFolio.Text}"
@@ -6771,20 +6654,12 @@ Partial Class Compras_Compras
If importeMovimiento > 0 Or TxtTotal.Text.ToDecimal = 0 Then
RegistroCuentaPuente = True
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
If DdlTipoCompra.SelectedValue = "10" AndAlso ConceptoContabilizacionNC = 68 Then
SeContabiliza = False
IdCtaContable = 0
End If
'se lleva saldo de Mercancía en tránsito
If ChkNCInvNC.Checked Then
For Each Gvr As GridViewRow In GVNCInv.Rows
If Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble > 0 Then
@@ -6792,10 +6667,8 @@ Partial Class Compras_Compras
ErrorMovInv = True
Exit For
End If
End If
Next
Dim diferenciaTransito As Decimal = 0
For Each Gvr As GridViewRow In GVNCInvAlmacen.Rows
If Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble > 0 Then
@@ -6815,7 +6688,6 @@ Partial Class Compras_Compras
End If
End If
Next
'la diferencia se va aplicar sobre los
'Dim diferenciaTransito As Decimal = ImporteTransito - importeMN.RoundSQL
@@ -6832,21 +6704,17 @@ Partial Class Compras_Compras
End If
End If
Else
Dim DiferenciaDevolucion As Decimal = importeMovimiento - TotalRealDevolucion
If TotalRealDevolucion <> 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
If UsuarioActual.CveEmpresa = 119 Then
tMovto = True
Else
DiferenciaDevolucion = -DiferenciaDevolucion
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
End If
End If
@@ -6854,7 +6722,7 @@ Partial Class Compras_Compras
ErrorPrepoliza = True
End If
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
End If
End If
@@ -6864,7 +6732,7 @@ Partial Class Compras_Compras
If UsuarioActual.CveEmpresa.Contiene(119) Then
Dim ContienePSNeteoBonif As Boolean = False
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
Exit For
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
importeMN = importeMovimiento * tipoCambioActual * Multiplicador
Dim IdCtaContableDescCompra As Integer = UsuarioActual.Empresa.Funcionalidad(405).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
@@ -6885,11 +6751,8 @@ Partial Class Compras_Compras
Else
ErrorPrepoliza = True
End If
End If
End If
End If
'ChkNCInvNC
@@ -6921,17 +6784,14 @@ Partial Class Compras_Compras
Dim DTDistinct = DT.Copy
If UsuarioActual.Empresa.Funcionalidad(126) = "1" Then
For Each drowdis As DataRow In DTDistinct.Rows
If drowdis("CveTipoGasto").ToString = "" Then
drowdis("CveTipoGasto") = 0
End If
If drowdis("TipoGasto").ToString.Trim = "" Then
drowdis("TipoGasto") = "ND"
End If
Next
DTDistinct = DTDistinct.FiltraParametros("ISNULL(TipoAF, 0) <> 2", "", {"CveClasificacion", "Clasificacion", "SubProyecto", "CveSubProyecto", "CveTipoGasto", "TipoGasto"})
Else
@@ -6941,7 +6801,6 @@ Partial Class Compras_Compras
End If
If drowdis("TipoGasto").ToString.Trim = "" Then
drowdis("TipoGasto") = "ND"
End If
Next
DTDistinct.AcceptChanges()
@@ -6956,7 +6815,6 @@ Partial Class Compras_Compras
Dim tTipoMovimiento As Boolean = TipoMovimiento
If DTDistinct.Rows.Count > 0 Then
For Each Row2 As DataRow In DTDistinct.Rows
tTipoMovimiento = TipoMovimiento
'DETERMINA IMPORTE
If UsuarioActual.Empresa.Funcionalidad(126) = "1" Then
@@ -6966,7 +6824,6 @@ Partial Class Compras_Compras
End If
'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
importeMN = importeMovimiento * tipoCambioActual * Multiplicador '[IPP] EL 6 DEBE SER POSITIVO 27/AGOSTO/2018
'CLASIFICACION
@@ -7004,8 +6861,6 @@ Partial Class Compras_Compras
importeMovimiento = -importeMovimiento
importeMN = -importeMN
End If
Dim usacomplementariaProveedor As Boolean = False
usacomplementariaProveedor = If(tipoCambioActual > 1, True, False)
@@ -7426,9 +7281,7 @@ Partial Class Compras_Compras
ErrorMovtosCxP = AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjConta)
End If
End If
End If
Else
@@ -7454,12 +7307,6 @@ Partial Class Compras_Compras
IdCtaContable = CtaProveedorAnticiposExtranjera
End If
'Agregamos el 21/37/60
'Dim ImporComisionAnticipo As Decimal = Ant.ImporteComision
'Dim importeMNComision As Decimal = ImporComisionAnticipo * tipoCambioActual * Multiplicador
If Not usacomplementariaAnticipo Then
ImporteAntMN = TipoCambioAnt * ImporteAnt
End If
@@ -7484,13 +7331,10 @@ Partial Class Compras_Compras
Pago.TCPago = Ant.TCCompra
Pago.CveMonedaPago = If(Ant.TCCompra > 1, 2, 1)
Pago.OtroGastoIngreso = ImporComisionAnticipo
ErrorPrepoliza = AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjConta)
End If
End If
End If
If UsuarioActual.CveEmpresa.Contiene(83) Then
@@ -7504,7 +7348,6 @@ Partial Class Compras_Compras
'Simplificacion de PrePolizas
If UsuarioActual.Empresa.Funcionalidad(220) <> "" Then
If Not ObjConta.UpdatePrePolizasDetalleBloquear(Ant.CvePrePoliza, False) Then
ErrorPrepoliza = True
Alert("No se pudo desbloquear los movimientos", TipoMensaje.MsgError)
@@ -7516,10 +7359,8 @@ Partial Class Compras_Compras
End If
End If
End If
Next
importeMovimiento = 0
End If
End Select
@@ -7529,19 +7370,10 @@ Partial Class Compras_Compras
End If
'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
'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
ErrorPrepoliza = True
Exit For
End If
End If
Next
@@ -10773,74 +10605,43 @@ Partial Class Compras_Compras
If Not OCVinculada Then
e.Row.Cells(3).Text = e.Row.DBCampo("PSCodigo").ToString
End If
Else
If e.Row.DBCampo("CveMetodoInventario").ToString = "5" Then
e.Row.FCTextBox("TbCantidad").Enabled = False
Else
e.Row.FCTextBox("TbCantidad").Enabled = True
End If
e.Row.FCCheckBox("cbInv").Enabled = False
End If
If UsuarioActual.Empresa.UsaAC Then
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
If UsuarioActual.Empresa.UsaAC Then e.Row.FCCheckBox("cbInv").Enabled = False
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").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.Funcionalidad(567) = "1" Then
If e.Row.FCDropDownList("ddlEAlmacen").Items.Count > 1 Then
e.Row.FCDropDownList("ddlEAlmacen").SelectedIndex = 1
e.Row.FCCheckBox("cbInv").Checked = True
ddlAlmacenConsignacion_SelectedIndexChanged(e.Row.FCDropDownList("ddlEAlmacen"), Nothing)
CambiaTotalDevengar(Nothing, Nothing)
End If
End If
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").Text = If(e.Row.DBCampo("CantidadF").ToString.ToDecimal > e.Row.DBCampo("Cantidad").ToString.ToDecimal, e.Row.DBCampo("Cantidad"), e.Row.DBCampo("CantidadF"))
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("'", "\'") & "'); ")
' 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 e.Row.BackColor = Drawing.Color.PaleGreen
If e.Row.DBCampo("Consec").ToEntero = 0 Then
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
If UsuarioActual.CveEmpresa = 66 Then e.Row.FCDropDownList("DdlRecibirInv").Items.RemoveAt(1)
'Consignaciones
If CveConsignacion > 0 Then
@@ -10851,7 +10652,6 @@ Partial Class Compras_Compras
If e.Row.DBCampo("CveAlmacenConsignacion").ToEntero > 0 Then
e.Row.FCDropDownList("ddlAlmacenConsignacion").SelectedValueExist(e.Row.DBCampo("CveAlmacenConsignacion"))
End If
''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").DataBind()
@@ -10861,7 +10661,6 @@ Partial Class Compras_Compras
e.Row.FCDropDownList("DdlVinculaConsignacion").SelectedValueExist(e.Row.DBCampo("NoConsignacion"))
e.Row.FCHiddenField("HdnNoConsignacion").Value = e.Row.DBCampo("NoConsignacion")
End If
If e.Row.DBCampo("CveConsignacion").ToEntero > 0 Then
e.Row.FCHiddenField("HdnCveConsignacion").Value = e.Row.DBCampo("CveConsignacion")
e.Row.FCHiddenField("HdnPS").Value = e.Row.DBCampo("HdnPS")
@@ -10877,8 +10676,6 @@ Partial Class Compras_Compras
End If
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").Text = ""
@@ -10889,31 +10686,20 @@ Partial Class Compras_Compras
e.Row.FCTextBox("TxtDividir").Visible = False
End If
End If
End If
'HEADER GvInv
If e.Row.RowType = DataControlRowType.Header Then
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
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").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros(StrAlmacenes)
e.Row.FCDropDownList("ddlAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1"))
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").DataBind()
If UsuarioActual.Empresa.Funcionalidad(567) = "1" Then
If e.Row.FCDropDownList("ddlAlmacen").Items.Count > 1 Then
e.Row.FCDropDownList("ddlAlmacen").SelectedIndex = 1
e.Row.FCCheckBox("cbAll").Checked = True
cbAll_CheckedChanged(e.Row.FCCheckBox("cbAll"), Nothing)
ddlAlmacen_SelectedIndexChanged(e.Row.FCDropDownList("ddlAlmacen"), Nothing)
End If
End If
End If
End Sub
@@ -10953,81 +10734,6 @@ Partial Class Compras_Compras
InicializaCargaEvidenciaAlmacen()
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)
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("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,
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
ErrorCancelar = True
Exit For
@@ -19707,7 +19414,7 @@ Partial Class Compras_Compras
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()
End If
@@ -19720,6 +19427,10 @@ Partial Class Compras_Compras
If DdlFolioGarantia.SelectedValue.ToEntero <> -1 Then
ValidaFolioGarantia(True)
'visualizar el div de almacen
Pnlalmaceninventarios.Visible = True
paneldevolucion.Visible = False
uppAlmacenGral.Update()
End If
End Sub