--merge Clientes.aspx

This commit is contained in:
2025-01-07 22:10:53 -07:00
26 changed files with 5630 additions and 597 deletions

View File

@@ -1162,7 +1162,7 @@ Public Class ClsCompras
Return Retorno Return Retorno
End Function End Function
Public Function GetFacturasComparacionXML(Version As String, Xml As String, CveEmpresa As Integer) As Boolean Public Function GetFacturasComparacionXML(Version As String, Xml As String, CveEmpresa As Integer, Optional RestriccionesVinculacion As String = "") As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Comp_ComparacionXML") DataAdapter("PA_Comp_ComparacionXML")
@@ -1170,6 +1170,7 @@ Public Class ClsCompras
.Add("@Version", SqlDbType.VarChar, 4).Value = Version .Add("@Version", SqlDbType.VarChar, 4).Value = Version
.Add("@Xml", SqlDbType.Xml).Value = Xml .Add("@Xml", SqlDbType.Xml).Value = Xml
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@RestriccionesVinculacion", SqlDbType.VarChar, 100).Value = RestriccionesVinculacion
.Add("@Error", SqlDbType.VarChar, 300).Direction = ParameterDirection.Output .Add("@Error", SqlDbType.VarChar, 300).Direction = ParameterDirection.Output
End With End With

View File

@@ -715,7 +715,7 @@ Public Class ClsOC
Optional PorcentajeIVA As Decimal = 0.16D, Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional FechaExpiracion As Date = Nothing, Optional CveCotizacion As Integer = -1, Optional PorcentajeIVA As Decimal = 0.16D, Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional FechaExpiracion As Date = Nothing, Optional CveCotizacion As Integer = -1,
Optional FolioAdicional As String = "", Optional EntregaDirecta As Integer = -1, Optional CveDireccionEnvio As Integer = -1, Optional Guia As String = "-1", Optional IEPS As Decimal = -1, Optional FolioAdicional As String = "", Optional EntregaDirecta As Integer = -1, Optional CveDireccionEnvio As Integer = -1, Optional Guia As String = "-1", Optional IEPS As Decimal = -1,
Optional CveIEAnticipo As Integer = -1, Optional ImporteAnticipo As Decimal = 0, Optional UsoCFDI As Integer = -1, Optional Promocion As String = "-1", Optional CveProveedorContacto As Integer = -1, Optional NumRemision As String = "-1", Optional CveIEAnticipo As Integer = -1, Optional ImporteAnticipo As Decimal = 0, Optional UsoCFDI As Integer = -1, Optional Promocion As String = "-1", Optional CveProveedorContacto As Integer = -1, Optional NumRemision As String = "-1",
Optional CveColectiva As Integer = -1, Optional MetodoPago As Integer = -1, Optional CveSubProyectoEntrega As Integer = -1, Optional PorcentajeProntoPago As Decimal = 0, Optional EsTemporal As Boolean = False) As Boolean Optional CveColectiva As Integer = -1, Optional MetodoPago As Integer = -1, Optional CveSubProyectoEntrega As Integer = -1, Optional PorcentajeProntoPago As Decimal = 0) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_OC_OrdenesCompraAdd") DataAdapter("PA_OC_OrdenesCompraAdd")
@@ -763,8 +763,6 @@ Public Class ClsOC
.Add("@MetodoPago", SqlDbType.Int).Value = MetodoPago ' 0 Contado, 1 Credito .Add("@MetodoPago", SqlDbType.Int).Value = MetodoPago ' 0 Contado, 1 Credito
.Add("@CveSubProyectoEntrega", SqlDbType.Int).Value = CveSubProyectoEntrega ' 0 Contado, 1 Credito .Add("@CveSubProyectoEntrega", SqlDbType.Int).Value = CveSubProyectoEntrega ' 0 Contado, 1 Credito
.Add("@PorcentajeProntoPago", SqlDbType.Decimal).Value = PorcentajeProntoPago .Add("@PorcentajeProntoPago", SqlDbType.Decimal).Value = PorcentajeProntoPago
.Add("@EsTemporal", SqlDbType.Bit).Value = EsTemporal
.Add("@vCveOrdenCompra", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@vCveOrdenCompra", SqlDbType.Int).Direction = ParameterDirection.Output
.Add("@vFolio", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@vFolio", SqlDbType.Int).Direction = ParameterDirection.Output
@@ -1675,7 +1673,7 @@ Public Class ClsOC
CveEmpresa As Integer, CvePS As Integer, Optional PendientePorSurtir As Boolean = False, Optional CveCliente As Integer = -1, Optional Guia As String = "-1", CveEmpresa As Integer, CvePS As Integer, Optional PendientePorSurtir As Boolean = False, Optional CveCliente As Integer = -1, Optional Guia As String = "-1",
Optional CveActivoFijo As Integer = -1, Optional SoloSubProyectosConPermiso As Boolean = False, Optional CveUsuarioAutorizo As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional SoloSubProyectosConPermiso As Boolean = False, Optional CveUsuarioAutorizo As Integer = -1,
Optional CveUsuarioAsignado As Integer = -1, Optional EntregaDirecta As Integer = -1, Optional TopSelect As Integer = 10000, Optional CveMoneda As Integer = -1, Optional CveUsuarioAsignado As Integer = -1, Optional EntregaDirecta As Integer = -1, Optional TopSelect As Integer = 10000, Optional CveMoneda As Integer = -1,
Optional MetodoPago As Integer = -1, Optional Serie As String = "-1", Optional TieneAnticipo As Integer = -1, Optional EsTemporal As Integer = -1) As Boolean Optional MetodoPago As Integer = -1, Optional Serie As String = "-1", Optional TieneAnticipo As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_OC_OrdenesCompraRep") DataAdapter("PA_OC_OrdenesCompraRep")
@@ -1708,9 +1706,6 @@ Public Class ClsOC
.Add("@MetodoPago", SqlDbType.Int).Value = MetodoPago .Add("@MetodoPago", SqlDbType.Int).Value = MetodoPago
.Add("@Serie", SqlDbType.VarChar).Value = Serie .Add("@Serie", SqlDbType.VarChar).Value = Serie
.Add("@TieneAnticipo", SqlDbType.Int).Value = TieneAnticipo .Add("@TieneAnticipo", SqlDbType.Int).Value = TieneAnticipo
.Add("@EsTemporal", SqlDbType.Int).Value = EsTemporal
End With End With
Try Try
@@ -1849,7 +1844,7 @@ Public Class ClsOC
Public Function GetOrdenesPendientes(pTipo As String, pTipoBusqueda As Integer, pCveEmpresa As Integer, pCveProyecto As Integer, pCveSubProyecto As Integer, pCveEstatusCompra As Integer, Public Function GetOrdenesPendientes(pTipo As String, pTipoBusqueda As Integer, pCveEmpresa As Integer, pCveProyecto As Integer, pCveSubProyecto As Integer, pCveEstatusCompra As Integer,
pCveUsuario As Integer, CveCliente As Integer, Optional SoloSubProyectosConPermiso As Boolean = False, Optional CveUsuarioAsignado As Integer = -1, Optional EntregaDirecta As Integer = -1, pCveUsuario As Integer, CveCliente As Integer, Optional SoloSubProyectosConPermiso As Boolean = False, Optional CveUsuarioAsignado As Integer = -1, Optional EntregaDirecta As Integer = -1,
Optional TieneAnticipo As Integer = -1, Optional EsTemporal As Integer = -1) As Boolean Optional TieneAnticipo As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_OC_OrdenesCompraPendientes") DataAdapter("PA_OC_OrdenesCompraPendientes")
@@ -1867,7 +1862,6 @@ Public Class ClsOC
.Add("@CveUsuarioAsignado", SqlDbType.Int).Value = CveUsuarioAsignado .Add("@CveUsuarioAsignado", SqlDbType.Int).Value = CveUsuarioAsignado
.Add("@EntregaDirecta", SqlDbType.Int).Value = EntregaDirecta .Add("@EntregaDirecta", SqlDbType.Int).Value = EntregaDirecta
.Add("@TieneAnticipo", SqlDbType.Int).Value = TieneAnticipo .Add("@TieneAnticipo", SqlDbType.Int).Value = TieneAnticipo
.Add("@EsTemporal", SqlDbType.Int).Value = EsTemporal
End With End With
Try Try
@@ -2631,12 +2625,13 @@ Public Class ClsOC
End Function End Function
Public Function PendientesCompra(CvePS As Integer, CveEmpresa As Integer) As Boolean Public Function PendientesCompra(CvePS As Integer, CveSubProyectos As String, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_OC_PendientesCompra") DataAdapter("PA_OC_PendientesCompra")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CvePS", SqlDbType.Int).Value = CvePS .Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@CveSubProyectos", SqlDbType.VarChar, 100).Value = CveSubProyectos
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With End With

View File

@@ -2504,7 +2504,7 @@ Public Class ClsVentas
End Function End Function
Public Function AddPromociones(Promocion As String, FechaInicio As Date, FechaFin As Date, CveVendedor As Integer, CveCliente As Integer, Estatus As Boolean, Public Function AddPromociones(Promocion As String, FechaInicio As Date, FechaFin As Date, CveVendedor As Integer, CveCliente As Integer, Estatus As Boolean,
CveMoneda As Integer, CveUsuario As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, TipoAplicacion As String, CveMoneda As Integer, CveUsuario As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, TipoAplicacion As String,
Optional CveMarca As Integer = -1, Optional EsDistribuidor As Integer = -1) As Integer Optional CveMarca As Integer = -1, Optional EsDistribuidor As Integer = -1, Optional ReqAutorizacion As Boolean = False) As Integer
Dim Retorno As Integer = -1 Dim Retorno As Integer = -1
DataAdapter("PA_Vta_PromocionesAdd") DataAdapter("PA_Vta_PromocionesAdd")
@@ -2522,6 +2522,7 @@ Public Class ClsVentas
.Add("@TipoAplicacion", SqlDbType.VarChar).Value = TipoAplicacion .Add("@TipoAplicacion", SqlDbType.VarChar).Value = TipoAplicacion
.Add("@CveMarca", SqlDbType.Int).Value = CveMarca .Add("@CveMarca", SqlDbType.Int).Value = CveMarca
.Add("@EsDistribuidor", SqlDbType.Int).Value = EsDistribuidor .Add("@EsDistribuidor", SqlDbType.Int).Value = EsDistribuidor
.Add("@ReqAutorizacion", SqlDbType.Bit).Value = ReqAutorizacion
.Add("@CvePromocion", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@CvePromocion", SqlDbType.Int).Direction = ParameterDirection.Output
End With End With
@@ -2668,7 +2669,8 @@ Public Class ClsVentas
Public Function AddPromocionesDetalle(CvePromocion As Integer, CvePS As Integer, TipoPromocion As Integer, Promocion As Double, PUAnterior As Double, PUPromocion As Double, Public Function AddPromocionesDetalle(CvePromocion As Integer, CvePS As Integer, TipoPromocion As Integer, Promocion As Double, PUAnterior As Double, PUPromocion As Double,
AplicaRestriccion As Boolean, AplicaLunes As Boolean, AplicaMartes As Boolean, AplicaMiercoles As Boolean, AplicaJueves As Boolean, AplicaRestriccion As Boolean, AplicaLunes As Boolean, AplicaMartes As Boolean, AplicaMiercoles As Boolean, AplicaJueves As Boolean,
AplicaViernes As Boolean, AplicaSabado As Boolean, AplicaDomingo As Boolean, HoraInicio As DateTime, HoraFin As DateTime, Optional CantidadMinima As Integer = 1, AplicaViernes As Boolean, AplicaSabado As Boolean, AplicaDomingo As Boolean, HoraInicio As DateTime, HoraFin As DateTime, Optional CantidadMinima As Integer = 1,
Optional CveClasificacion As Integer = -1, Optional CveRinTamaño As Integer = -1, Optional IncluyeImpuestos As Boolean = False, Optional Opcion As Integer = 1) As Boolean Optional CveClasificacion As Integer = -1, Optional CveRinTamaño As Integer = -1, Optional IncluyeImpuestos As Boolean = False, Optional Opcion As Integer = 1
) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_PromocionesDetalleAdd") DataAdapter("PA_Vta_PromocionesDetalleAdd")
@@ -2695,6 +2697,7 @@ Public Class ClsVentas
.Add("@CveRinTamaño", SqlDbType.Int).Value = CveRinTamaño .Add("@CveRinTamaño", SqlDbType.Int).Value = CveRinTamaño
.Add("@IncluyeImpuestos", SqlDbType.Bit).Value = IncluyeImpuestos .Add("@IncluyeImpuestos", SqlDbType.Bit).Value = IncluyeImpuestos
.Add("@Opcion", SqlDbType.Int).Value = Opcion .Add("@Opcion", SqlDbType.Int).Value = Opcion
End With End With
Try Try

View File

@@ -3726,6 +3726,14 @@ Namespace Extensiones
End Try End Try
End Sub End Sub
<Runtime.CompilerServices.Extension()>
Public Function DataColumnToString(ByRef dtt As DataTable, NombreColumna As String) As String
Return String.Join(", ", dtt.AsEnumerable().
Where(Function(row) Not row.IsNull(NombreColumna)).
Select(Function(row) row(NombreColumna).ToString()))
End Function
<Runtime.CompilerServices.Extension()> <Runtime.CompilerServices.Extension()>
Public Function GetSelectedValues(ByRef Ddl As ListBox, Optional beforeValue As String = "", Optional AfterValue As String = "") As String Public Function GetSelectedValues(ByRef Ddl As ListBox, Optional beforeValue As String = "", Optional AfterValue As String = "") As String
Dim retorno As New StringBuilder Dim retorno As New StringBuilder

View File

@@ -672,7 +672,7 @@
<th style="width: 15px">#</th> <th style="width: 15px">#</th>
<th style="width: 45px">Cant</th> <th style="width: 45px">Cant</th>
<th style="width: 70px">Unidad</th> <th style="width: 70px">Unidad</th>
<th style="width: 299px">Clasificación <th style="width: 349px">Clasificación
<asp:HyperLink ID="HplAddClasificacion" data-toggle="tooltip" data-placement="top" NavigateUrl="/Ventas/CatClasificaciones.aspx" CssClass="btn btn-default btn-circle btn-xs " ToolTip="Agregar Clasificacion" runat="server"><i class="fa fa-plus" style="color:black" aria-hidden="true"></i></asp:HyperLink>&nbsp;&nbsp;&nbsp; <asp:HyperLink ID="HplAddClasificacion" data-toggle="tooltip" data-placement="top" NavigateUrl="/Ventas/CatClasificaciones.aspx" CssClass="btn btn-default btn-circle btn-xs " ToolTip="Agregar Clasificacion" runat="server"><i class="fa fa-plus" style="color:black" aria-hidden="true"></i></asp:HyperLink>&nbsp;&nbsp;&nbsp;
@@ -682,7 +682,7 @@
</span> </span>
<br /> <br />
Producto o Servicio<asp:HyperLink ID="HyperLink1" data-toggle="tooltip" CssClass="btn btn-default btn-circle btn-xs " data-placement="top" ToolTip="Agregar Producto o Servicio" NavigateUrl="/Ventas/CatPS.aspx" runat="server"><i class="fa fa-plus" style="color:black" aria-hidden="true"></i></asp:HyperLink></th> Producto o Servicio<asp:HyperLink ID="HyperLink1" data-toggle="tooltip" CssClass="btn btn-default btn-circle btn-xs " data-placement="top" ToolTip="Agregar Producto o Servicio" NavigateUrl="/Ventas/CatPS.aspx" runat="server"><i class="fa fa-plus" style="color:black" aria-hidden="true"></i></asp:HyperLink></th>
<th style="width: 350px">Observación</th> <th style="width: 300px">Observación</th>
<th style="width: 150px"> <th style="width: 150px">
<asp:Label ID="LitHProyecto" runat="server" Text=""></asp:Label> <asp:Label ID="LitHProyecto" runat="server" Text=""></asp:Label>
<asp:Label runat="server" ID="LblSubProyectoHeader" Text=""></asp:Label>&nbsp; <asp:Label runat="server" ID="LblSubProyectoHeader" Text=""></asp:Label>&nbsp;
@@ -772,7 +772,7 @@
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<%-- 3 --%> <%-- 3 --%>
<asp:TemplateField ItemStyle-VerticalAlign="Top" ItemStyle-Width="299"> <asp:TemplateField ItemStyle-VerticalAlign="Top" ItemStyle-Width="349">
<ItemTemplate> <ItemTemplate>
<div style="float: left; width: 100%;"> <div style="float: left; width: 100%;">
<span style="width: 100%; border-bottom: 1px solid gray;"> <span style="width: 100%; border-bottom: 1px solid gray;">
@@ -785,7 +785,7 @@
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<%-- 4 --%> <%-- 4 --%>
<asp:BoundField DataField="Obs" ItemStyle-Width="350px" /> <asp:BoundField DataField="Obs" ItemStyle-Width="300px" />
<%-- 5 --%> <%-- 5 --%>
<asp:TemplateField ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left"> <asp:TemplateField ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left">
<ItemTemplate> <ItemTemplate>

View File

@@ -1901,14 +1901,19 @@ Partial Class Compras_Compras
Xml = Xml.Replace("&lt;", "") Xml = Xml.Replace("&lt;", "")
Xml = Xml.Replace("&", "") 'adicional, si hay otros Xml = Xml.Replace("&", "") 'adicional, si hay otros
If ObjeFacturas.GetFacturasComparacionXML(Version, Xml, UsuarioActual.CveEmpresa) Then 'si el tipo de proveedor es acreedor, no cruzar por numero de parte
Dim RestriccionesVinculacion As String = ""
' Acreedor
If CveTipoProveedor.Contiene(2, 3) Then RestriccionesVinculacion = "NO-NUMEROPARTE"
If ObjeFacturas.GetFacturasComparacionXML(Version, Xml, UsuarioActual.CveEmpresa, RestriccionesVinculacion) Then
TmpDT = ObjeFacturas.DtResultados TmpDT = ObjeFacturas.DtResultados
TmpDT.Columns.Add("CveSATPSActualizado") TmpDT.Columns.Add("CveSATPSActualizado")
SubTotalConceptos = TmpDT.SUMD("Total").RoundSQL SubTotalConceptos = TmpDT.SUMD("Total").RoundSQL
If Not TmpDT.Columns.Contains("Amortizacion") Then TmpDT.Columns.Add("Amortizacion", GetType(Decimal)) If Not TmpDT.Columns.Contains("Amortizacion") Then TmpDT.Columns.Add("Amortizacion", GetType(Decimal))
If Not TmpDT.Columns.Contains("AplicaLote") Then TmpDT.Columns.Add("AplicaLote", GetType(Boolean)) If Not TmpDT.Columns.Contains("AplicaLote") Then TmpDT.Columns.Add(New DataColumn("AplicaLote", GetType(Boolean)) With {.DefaultValue = False})
If Not TmpDT.Columns.Contains("AplicaCaducidad") Then TmpDT.Columns.Add("AplicaCaducidad", GetType(Boolean)) If Not TmpDT.Columns.Contains("AplicaCaducidad") Then TmpDT.Columns.Add(New DataColumn("AplicaCaducidad", GetType(Boolean)) With {.DefaultValue = False})
If Not TmpDT.Columns.Contains("Lote") Then TmpDT.Columns.Add("Lote", GetType(String)) If Not TmpDT.Columns.Contains("Lote") Then TmpDT.Columns.Add("Lote", GetType(String))
If Not TmpDT.Columns.Contains("FechaCaducidad") Then TmpDT.Columns.Add("FechaCaducidad", GetType(Date)) If Not TmpDT.Columns.Contains("FechaCaducidad") Then TmpDT.Columns.Add("FechaCaducidad", GetType(Date))
@@ -3154,36 +3159,34 @@ Partial Class Compras_Compras
'VINCULACIÓN OC - NUEVA DICIEMBRE 2015 'VINCULACIÓN OC - NUEVA DICIEMBRE 2015
If dr("OCVinculada").ToString() <> "" Then If dr("OCVinculada").ToString() <> "" Then
Dim DtOCs As New DataTable
Dim OCS As String = "", CveOCS As String = "" Dim OCS As String = "", CveOCS As String = ""
Dim DtOCs As New DataTable
DtOCs.Columns.Add("FolioOC", GetType(Integer)) DtOCs.Columns.Add("SerieFolioOC", GetType(String))
DtOCs.Columns.Add("CveOrdenCompra", GetType(Integer)) DtOCs.Columns.Add("CveOrdenCompra", GetType(Integer))
DtOCs.Columns.Add("Fecha", GetType(Date))
DtOCs.Columns.Add("Descripcion", GetType(String))
For Each drt As DataRow In TmpDT.Rows For Each drt As DataRow In TmpDT.FiltraParametros("", "", {"SerieFolioOC", "CveOrdenCompra"}).Rows
If drt("FolioOC").ToString <> "" Then If drt("SerieFolioOC").ToString <> "" Then
Dim DrOC As DataRow = DtOCs.NewRow Dim DrOC As DataRow = DtOCs.NewRow
DrOC("FolioOC") = drt("FolioOC").ToString DrOC("SerieFolioOC") = drt("SerieFolioOC").ToString
DrOC("CveOrdenCompra") = drt("CveOrdenCompra").ToString DrOC("CveOrdenCompra") = drt("CveOrdenCompra").ToString
DtOCs.Rows.Add(DrOC) DtOCs.Rows.Add(DrOC)
End If End If
Next Next
DtOCs = DtOCs.FiltraParametros("", "", {"FolioOC", "CveOrdenCompra"})
DtOCs.Columns.Add("Fecha", GetType(Date))
DtOCs.Columns.Add("Descripcion", GetType(String))
If DtOCs.Rows.Count > 0 Then If DtOCs.Rows.Count > 0 Then
For Each drt As DataRow In DtOCs.Rows For Each drt As DataRow In DtOCs.Rows
If ObjOC.GetOrdenesCompraRep("OC", -1, -1, -1, -1, MinFecha, MaxFecha, drt("CveOrdenCompra").ToString.ToEntero, CveProveedor, -1, -1, -1, UsuarioActual.CveEmpresa, -1) Then OCS += If(OCS <> "", String.Format(",{0}", drt("SerieFolioOC").ToString), drt("SerieFolioOC").ToString)
If ObjOC.DtResultados.Rows.Count = 1 Then CveOCS += If(CveOCS <> "", String.Format(",{0}", drt("CveOrdenCompra").ToString), drt("CveOrdenCompra").ToString)
OCS += If(OCS <> "", String.Format(",{0}", drt("FolioOC").ToString), drt("FolioOC").ToString) 'If ObjOC.GetOrdenesCompraRep("OC", -1, -1, -1, -1, MinFecha, MaxFecha, drt("CveOrdenCompra").ToString.ToEntero, CveProveedor, -1, -1, -1, UsuarioActual.CveEmpresa, -1) Then
CveOCS += If(CveOCS <> "", String.Format(",{0}", drt("CveOrdenCompra").ToString), drt("CveOrdenCompra").ToString) ' If ObjOC.DtResultados.Rows.Count = 1 Then
drt("Fecha") = ObjOC.DtResultados.FiltroPrimeroValor("FechaIng") ' OCS += If(OCS <> "", String.Format(",{0}", drt("FolioOC").ToString), drt("FolioOC").ToString)
drt("Descripcion") = ObjOC.DtResultados.FiltroPrimeroValor("Descripcion") ' CveOCS += If(CveOCS <> "", String.Format(",{0}", drt("CveOrdenCompra").ToString), drt("CveOrdenCompra").ToString)
End If ' drt("Fecha") = ObjOC.DtResultados.FiltroPrimeroValor("FechaIng")
End If ' drt("Descripcion") = ObjOC.DtResultados.FiltroPrimeroValor("Descripcion")
' End If
'End If
Next Next
End If End If
@@ -4301,7 +4304,7 @@ Partial Class Compras_Compras
Dim AnioFactura As Integer = TxtFecha.Text.ToDate.Year Dim AnioFactura As Integer = TxtFecha.Text.ToDate.Year
Dim Fecha28Dic As Date = New Date(2024, 12, 28) Dim Fecha28Dic As Date = New Date(2024, 12, 28)
If NowADS() >= Fecha28Dic Then If NowADS() >= Fecha28Dic AndAlso TxtFecha.Text.ToDate.Year < 2025 Then
Alert("A partir del 28 de diciembre de 2024 no se pueden registrar facturas de 2024.", TipoMensaje.MsgAdvertencia) Alert("A partir del 28 de diciembre de 2024 no se pueden registrar facturas de 2024.", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If End If
@@ -7752,8 +7755,8 @@ Partial Class Compras_Compras
If CveMovimientoInventario > 0 Then If CveMovimientoInventario > 0 Then
Dim TempParametros As String = Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoInventario)) Dim TempParametros As String = Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoInventario))
Msg.AppendFormat("</br><a class=""Texto"" target='_blank' href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"">Ver Movimiento de Almacen</a>", CveMovimientoInventario) Msg.AppendFormat("</br><a class=""Texto"" target='_blank' href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"">Ver Movimiento de Almacen</a>&nbsp;&nbsp;", CveMovimientoInventario)
Msg.AppendFormat("</br><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Entrada Almacen</a>", TempParametros) Msg.AppendFormat("<a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}""><i class='fa fa-file-pdf-o' aria-hidden='true'></i> Imprimir</a>", TempParametros)
End If End If
If UsuarioActual.Empresa.TipoContabilidad = 2 Then If UsuarioActual.Empresa.TipoContabilidad = 2 Then
@@ -11087,7 +11090,7 @@ Partial Class Compras_Compras
If OC.GetOC(CveOC, UsuarioActual.CveEmpresa) Then If OC.GetOC(CveOC, UsuarioActual.CveEmpresa) Then
TxtOC.Text = OC.Folio.ToString TxtOC.Text = OC.SerieFolio
'RegistraScript(String.Format("$get('TxtOC').value = '{0}';tb_remove;", OC.Folio)) 'RegistraScript(String.Format("$get('TxtOC').value = '{0}';tb_remove;", OC.Folio))
RegistraScript("tb_remove();") RegistraScript("tb_remove();")
@@ -11141,29 +11144,26 @@ Partial Class Compras_Compras
#Region " ALMACEN " #Region " ALMACEN "
Private Sub CargaGvInv() Private Sub CargaGvInv()
If Not TmpDT.Columns.Contains("UUIDRow") Then TmpDT.Columns.Add("UUIDRow", GetType(String))
If Not TmpDT.Columns.Contains("UUIDRow") Then
TmpDT.Columns.Add("UUIDRow", GetType(String))
End If
For Each dRow As DataRow In TmpDT.Rows For Each dRow As DataRow In TmpDT.Rows
If dRow("UUIDRow").ToString.Trim = "" Then If dRow("UUIDRow").ToString.Trim = "" Then
dRow("UUIDRow") = Guid.NewGuid().ToString() dRow("UUIDRow") = Guid.NewGuid().ToString()
End If End If
Dim CvePS As Integer = dRow("CvePS").ToString.ToEntero 'Dim CvePS As Integer = dRow("CvePS").ToString.ToEntero
dRow("AplicaLote") = False 'dRow("AplicaLote") = False
dRow("AplicaCaducidad") = False 'dRow("AplicaCaducidad") = False
If CvePS > 0 Then 'If CvePS > 0 Then
Dim drPS As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimero($"CvePS={CvePS}") ' Dim drPS As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
If drPS IsNot Nothing Then ' If drPS IsNot Nothing Then
dRow("AplicaLote") = If(drPS("AplicaLote").ToString = "", False, Boolean.Parse(drPS("AplicaLote").ToString)) ' dRow("AplicaLote") = If(drPS("AplicaLote").ToString = "", False, Boolean.Parse(drPS("AplicaLote").ToString))
dRow("AplicaCaducidad") = If(drPS("AplicaCaducidad").ToString = "", False, Boolean.Parse(drPS("AplicaCaducidad").ToString)) ' dRow("AplicaCaducidad") = If(drPS("AplicaCaducidad").ToString = "", False, Boolean.Parse(drPS("AplicaCaducidad").ToString))
'Boolean.Parse(GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("AplicaCaducidad", $"CvePS={CvePS}")) ' 'Boolean.Parse(GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("AplicaCaducidad", $"CvePS={CvePS}"))
End If ' End If
End If 'End If
Next Next
TmpDT.AcceptChanges() TmpDT.AcceptChanges()
@@ -11175,16 +11175,14 @@ Partial Class Compras_Compras
DtInv = TmpDT.FiltraParametros(String.Format("CveTipoPS = 2")).Copy DtInv = TmpDT.FiltraParametros(String.Format("CveTipoPS = 2")).Copy
End If End If
For Each dRow As DataRow In DtInv.Rows For Each dRow As DataRow In DtInv.Rows
Dim AplicaLote As Boolean = False
'Dim CvePS As Integer = dRow("CvePS").ToString.ToEntero Boolean.TryParse(dRow("AplicaLote").ToString, AplicaLote)
Dim AplicaLote As Boolean = Boolean.Parse(dRow("AplicaLote").ToString) 'Boolean.Parse(GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("AplicaLote", $"CvePS={CvePS}")) Dim AplicaCaducidad As Boolean = False
Dim AplicaCaducidad As Boolean = Boolean.Parse(dRow("AplicaCaducidad").ToString) 'Boolean.Parse(GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("AplicaCaducidad", $"CvePS={CvePS}")) Boolean.TryParse(dRow("AplicaCaducidad").ToString, AplicaCaducidad)
GvInv.Columns(7).Visible = AplicaLote GvInv.Columns(7).Visible = AplicaLote
GvInv.Columns(8).Visible = AplicaCaducidad GvInv.Columns(8).Visible = AplicaCaducidad
Next Next
GvInv.DataSource = DtInv GvInv.DataSource = DtInv
@@ -11254,25 +11252,10 @@ Partial Class Compras_Compras
Protected Sub GVINV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvInv.RowDataBound Protected Sub GVINV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvInv.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
Dim AplicaLote As Boolean = e.Row.DBCampo("AplicaLote").ToBool
Dim AplicaCaducidad As Boolean = e.Row.DBCampo("AplicaCaducidad").ToBool
Dim CvePS As Integer = e.Row.DataKey("CvePS").ToEntero If AplicaLote Then e.Row.FCTextBox("TxtLote").Visible = True
Dim AplicaLote As Boolean = False
Dim AplicaCaducidad As Boolean = False
If CvePS > 0 Then
Dim drPS As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimero($"CvePS={CvePS}")
If drPS IsNot Nothing Then
AplicaLote = If(drPS("AplicaLote").ToString = "", False, Boolean.Parse(drPS("AplicaLote").ToString)) 'Boolean.Parse(GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("AplicaLote", $"CvePS={CvePS}"))
AplicaCaducidad = If(drPS("AplicaCaducidad").ToString = "", False, Boolean.Parse(drPS("AplicaCaducidad").ToString)) 'Boolean.Parse(GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("AplicaCaducidad", $"CvePS={CvePS}"))
End If
End If
If AplicaLote Then
e.Row.FCTextBox("TxtLote").Visible = True
End If
If AplicaCaducidad Then If AplicaCaducidad Then
Dim DvFechaCaducidad As HtmlGenericControl = TryCast(e.Row.FindControl("DvFechaCaducidad"), HtmlGenericControl) Dim DvFechaCaducidad As HtmlGenericControl = TryCast(e.Row.FindControl("DvFechaCaducidad"), HtmlGenericControl)
DvFechaCaducidad.Visible = True DvFechaCaducidad.Visible = True
@@ -11283,6 +11266,13 @@ Partial Class Compras_Compras
Dim StrTipo As String = "CveTipoAlmacen IN (1,2,7,14,19)" Dim StrTipo As String = "CveTipoAlmacen IN (1,2,7,14,19)"
If DdlTipoCompra.SelectedValue.Contiene("9", "12") Then StrTipo = "CveTipoAlmacen IN (21)" If DdlTipoCompra.SelectedValue.Contiene("9", "12") Then StrTipo = "CveTipoAlmacen IN (21)"
If EsDevolucionApoyoLogistico Then StrTipo = "CveTipoAlmacen = 27" If EsDevolucionApoyoLogistico Then StrTipo = "CveTipoAlmacen = 27"
If CompraEstaVinculadaOC Then
'filtrar solo los almacenes de las sucursales especficiadsa en el tmpdt. para encasillarlo
Dim dttt As DataTable = TmpDT.FiltraParametros("", DistinctColumns:={"CveSubProyecto"})
If dttt IsNot Nothing AndAlso dttt.Rows.Count > 0 Then
StrTipo = StrTipo & " AND CveSubProyecto IN (" & DataColumnToString(dttt, "CveSubProyecto") & ") "
End If
End If
e.Row.FCDropDownList("ddlEAlmacen").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros(StrTipo) 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"))
@@ -11303,7 +11293,6 @@ Partial Class Compras_Compras
e.Row.FCTextBox("TbCantidad").Enabled = True e.Row.FCTextBox("TbCantidad").Enabled = True
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
'SIEMPRE ENABLED FALSE 'SIEMPRE ENABLED FALSE
@@ -11336,10 +11325,14 @@ Partial Class Compras_Compras
'que no sea recepcion alamcen adelantado. DdlOCVinculaInv 'que no sea recepcion alamcen adelantado. DdlOCVinculaInv
If (UsuarioActual.Empresa.Funcionalidad(567) = "1" OrElse UsuarioActual.TienePermisoProceso(121)) AndAlso DdlOCVinculaInv.SelectedValue <> "176" Then If (UsuarioActual.Empresa.Funcionalidad(567) = "1" OrElse UsuarioActual.TienePermisoProceso(121)) AndAlso DdlOCVinculaInv.SelectedValue <> "176" 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 If UsuarioActual.CveAlmacen > 0 Then
e.Row.FCDropDownList("ddlEAlmacen").SelectedValueExist(UsuarioActual.CveAlmacen)
Else
e.Row.FCDropDownList("ddlEAlmacen").SelectedIndex = 1
End If
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 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
@@ -11388,17 +11381,6 @@ Partial Class Compras_Compras
End If End If
End If End If
If UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 Then
'e.Row.Cells(4).Text = e.Row.DataKey("PUProtoPago").ToDecimal.ToString("###,###,###.00")
'If PorcentajeProntoPago > 0 Then
' e.Row.Cells(4).Text = e.Row.DataKey("PUProtoPago").ToDecimal - ()
'End If
End If
''VALIDA UNIDAD DE MEDIDA ''VALIDA UNIDAD DE MEDIDA
'If e.Row.DBCampo("CvePS").ToString.ToEntero > 0 Then 'If e.Row.DBCampo("CvePS").ToString.ToEntero > 0 Then
@@ -11453,6 +11435,14 @@ Partial Class Compras_Compras
If DdlTipoCompra.SelectedValue.ToEntero = 10 Then StrAlmacenes = $"Modalidad = 0" If DdlTipoCompra.SelectedValue.ToEntero = 10 Then StrAlmacenes = $"Modalidad = 0"
If EsDevolucionApoyoLogistico Then StrAlmacenes = " CveTipoAlmacen = 27" If EsDevolucionApoyoLogistico Then StrAlmacenes = " CveTipoAlmacen = 27"
If CompraEstaVinculadaOC Then
'filtrar solo los almacenes de las sucursales especficiadsa en el tmpdt. para encasillarlo
Dim dttt As DataTable = TmpDT.FiltraParametros("", DistinctColumns:={"CveSubProyecto"})
If dttt IsNot Nothing AndAlso dttt.Rows.Count > 0 Then
StrAlmacenes = StrAlmacenes & " AND CveSubProyecto IN (" & DataColumnToString(dttt, "CveSubProyecto") & ") "
End If
End If
e.Row.FCDropDownList("ddlAlmacen").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros(StrAlmacenes) 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").Items.Insert(0, New ListItem("Seleccione", "-1"))
e.Row.FCDropDownList("ddlAlmacen").DataBind() e.Row.FCDropDownList("ddlAlmacen").DataBind()
@@ -11469,7 +11459,11 @@ Partial Class Compras_Compras
'que no sea recepcion almacen adelantado. DdlOCVinculaInv 'que no sea recepcion almacen adelantado. DdlOCVinculaInv
If (UsuarioActual.Empresa.Funcionalidad(567) = "1" OrElse UsuarioActual.TienePermisoProceso(121)) AndAlso DdlOCVinculaInv.SelectedValue <> "176" Then If (UsuarioActual.Empresa.Funcionalidad(567) = "1" OrElse UsuarioActual.TienePermisoProceso(121)) AndAlso DdlOCVinculaInv.SelectedValue <> "176" 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 If UsuarioActual.CveAlmacen > 0 Then
e.Row.FCDropDownList("ddlAlmacen").SelectedValueExist(UsuarioActual.CveAlmacen)
Else
e.Row.FCDropDownList("ddlAlmacen").SelectedIndex = 1
End If
e.Row.FCCheckBox("cbAll").Checked = True e.Row.FCCheckBox("cbAll").Checked = True
End If End If
End If End If
@@ -12122,7 +12116,7 @@ Partial Class Compras_Compras
End Sub End Sub
Protected Sub CambiaTotalDevengar(sender As Object, e As EventArgs) Protected Sub CambiaTotalDevengar(sender As Object, e As EventArgs)
CalculaTotalPorDevengar() If UsuarioActual.Empresa.UsaAC Then CalculaTotalPorDevengar()
End Sub End Sub
#End Region #End Region
@@ -15484,6 +15478,8 @@ Partial Class Compras_Compras
AjusteProntoPagoPorcentajeIVA = TmpDT.MAX("IVAPorcentaje").ToDecimal AjusteProntoPagoPorcentajeIVA = TmpDT.MAX("IVAPorcentaje").ToDecimal
AjusteProntoPagoConIVA = (ImporteCompraConIVA - ImporteOCConIVA) AjusteProntoPagoConIVA = (ImporteCompraConIVA - ImporteOCConIVA)
AjusteProntoPagoSinIVA = (ImporteCompraSinIVA - ImporteOCSinIVA) AjusteProntoPagoSinIVA = (ImporteCompraSinIVA - ImporteOCSinIVA)
If Math.Abs(AjusteProntoPagoConIVA) < 1 Then AjusteProntoPagoConIVA = 0 Else ImporteRNC += AjusteProntoPagoConIVA
If Math.Abs(AjusteProntoPagoSinIVA) < 1 Then AjusteProntoPagoSinIVA = 0
If ConfirmaVinculacionOC_RNC(AjusteProntoPagoPorcentajeIVA) Then If ConfirmaVinculacionOC_RNC(AjusteProntoPagoPorcentajeIVA) Then
Vinculacion() Vinculacion()
@@ -15505,9 +15501,9 @@ Partial Class Compras_Compras
For Each gvr As GridViewRow In GvOC1.Rows For Each gvr As GridViewRow In GvOC1.Rows
If gvr.DataKey("IVAPorcentaje").ToDecimal > 0 Then If gvr.DataKey("IVAPorcentaje").ToDecimal > 0 Then
ImporteOCConIVA = ImporteOCConIVA + (gvr.FCTextBox("TxtCantidad").Text.ToDecimal * gvr.FCTextBox("TxtPU").Text.ToDecimal) ImporteOCConIVA = ImporteOCConIVA + (gvr.FCTextBox("TxtCantidad").Text.ToDecimal * gvr.FCTextBox("TxtPU").Text.ToDecimal) '- gvr.DataKey("Descuento").ToDecimal
Else Else
ImporteOCSinIVA = ImporteOCSinIVA + (gvr.FCTextBox("TxtCantidad").Text.ToDecimal * gvr.FCTextBox("TxtPU").Text.ToDecimal) ImporteOCSinIVA = ImporteOCSinIVA + (gvr.FCTextBox("TxtCantidad").Text.ToDecimal * gvr.FCTextBox("TxtPU").Text.ToDecimal) '- gvr.DataKey("Descuento").ToDecimal
End If End If
Next Next
@@ -15534,7 +15530,6 @@ Partial Class Compras_Compras
End Sub End Sub
Private Sub Vinculacion(Optional VinculacionCompleta As Boolean = False) Private Sub Vinculacion(Optional VinculacionCompleta As Boolean = False)
'SI PUEDE RECIBIR POR OC Y COMPRA 'SI PUEDE RECIBIR POR OC Y COMPRA
If UsuarioActual.CveEmpresa = 119 AndAlso UsuarioActual.Empresa.UsaInventarios And UsuarioActual.Empresa.Funcionalidad(131).ToEntero > 0 AndAlso CveTipoConcepto = 1 Then If UsuarioActual.CveEmpresa = 119 AndAlso UsuarioActual.Empresa.UsaInventarios And UsuarioActual.Empresa.Funcionalidad(131).ToEntero > 0 AndAlso CveTipoConcepto = 1 Then
@@ -15596,6 +15591,7 @@ Partial Class Compras_Compras
Dim PU As Decimal = gvr.FCTextBox("TxtPU").Text.ToDecimal Dim PU As Decimal = gvr.FCTextBox("TxtPU").Text.ToDecimal
Dim tDescuento As Decimal = dr("Descuento").ToString.ToDecimal Dim tDescuento As Decimal = dr("Descuento").ToString.ToDecimal
Dim Total As Decimal = If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, Math.Round((gvr.FCTextBox("TxtCantidad").Text.ToDecimal * gvr.FCTextBox("TxtPU").Text.ToDecimal) - (TxtDescuento.Text.ToDouble / TotalRows).ToDecimal, 2), Cantidad * PU - tDescuento) 'gvr.FCTextBox("TxtTotalOC1").Text.ToDecimal) Dim Total As Decimal = If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, Math.Round((gvr.FCTextBox("TxtCantidad").Text.ToDecimal * gvr.FCTextBox("TxtPU").Text.ToDecimal) - (TxtDescuento.Text.ToDouble / TotalRows).ToDecimal, 2), Cantidad * PU - tDescuento) 'gvr.FCTextBox("TxtTotalOC1").Text.ToDecimal)
'Dim Total As Decimal = gvr.FCTextBox("TxtTotalOC1").Text.ToDecimal 'Dim Total As Decimal = gvr.FCTextBox("TxtTotalOC1").Text.ToDecimal
'Dim IVA As Decimal = gvr.FCHiddenField("HdnOC1IVA").Value.ToDecimal 'Dim IVA As Decimal = gvr.FCHiddenField("HdnOC1IVA").Value.ToDecimal
'Dim RetIVA As Double = gvr.FCHiddenField("HdnOC1RetIVA").Value.ToDecimal 'Dim RetIVA As Double = gvr.FCHiddenField("HdnOC1RetIVA").Value.ToDecimal
@@ -15627,6 +15623,12 @@ Partial Class Compras_Compras
End If End If
End If End If
If UsuarioActual.Empresa.Funcionalidad(574) = "1" Then
PU = ((PU * Cantidad) - tDescuento) / Cantidad
Descuentos = 0
Descuento = 0
End If
AddPS(Cantidad, CveUM, UM, CveClasificacion, Clasificacion, CvePS, PS, CveTipoPS, CveSubProyectoContrato, SubProyecto, Proyecto, CveProyecto, Obs, PU, Total, IVA, RetIVA, RetISR, IEPSPS, IEPSPSIVA, Descuento, CveOrdenCompraDetalle, False, AddPS(Cantidad, CveUM, UM, CveClasificacion, Clasificacion, CvePS, PS, CveTipoPS, CveSubProyectoContrato, SubProyecto, Proyecto, CveProyecto, Obs, PU, Total, IVA, RetIVA, RetISR, IEPSPS, IEPSPSIVA, Descuento, CveOrdenCompraDetalle, False,
CantidadF:=CantidadF, EntregaDirecta:=EntregaDirecta, CveSATPS:=CveSATPS, CveTipoGasto:=CveTipoGasto, TipoGasto:=TipoGasto, CveContratoDetalle:=CveContratoDetalle, CveCultivoCuadroDetalle:=CveCultivoCuadroDetalle, CveSATPSActualizado:=CveSATPSActualizado) CantidadF:=CantidadF, EntregaDirecta:=EntregaDirecta, CveSATPS:=CveSATPS, CveTipoGasto:=CveTipoGasto, TipoGasto:=TipoGasto, CveContratoDetalle:=CveContratoDetalle, CveCultivoCuadroDetalle:=CveCultivoCuadroDetalle, CveSATPSActualizado:=CveSATPSActualizado)
@@ -15640,7 +15642,7 @@ Partial Class Compras_Compras
TmpDT.Rows(Index)("CveClasificacionOG") = dr("CveClasificacionOG").ToString.ToEntero TmpDT.Rows(Index)("CveClasificacionOG") = dr("CveClasificacionOG").ToString.ToEntero
'TmpDT.Rows(Index)("PSCodigo") = DtTemporalXML.Rows(IndexTmpOriginal)("PSCodigo") 'TmpDT.Rows(Index)("PSCodigo") = DtTemporalXML.Rows(IndexTmpOriginal)("PSCodigo")
TmpDT.Rows(Index)("PSCodigo") = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("PSCodigo", "").ToString TmpDT.Rows(Index)("PSCodigo") = dr("PS").ToString ' GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("PSCodigo", "").ToString
Dim CveAF As String = dr("CveActivoFijo").ToString Dim CveAF As String = dr("CveActivoFijo").ToString
If CveAF <> "" AndAlso CveAF <> "-1" Then If CveAF <> "" AndAlso CveAF <> "-1" Then
@@ -15657,7 +15659,7 @@ Partial Class Compras_Compras
IndexTmpOriginal += 1 IndexTmpOriginal += 1
Next Next
If UsuarioActual.Empresa.Funcionalidad(574) = "1" AndAlso (AjusteProntoPagoConIVA > 0 Or AjusteProntoPagoSinIVA > 0) Then If UsuarioActual.Empresa.Funcionalidad(574) = "1" AndAlso (ImporteRNC > 0 Or AjusteProntoPagoSinIVA > 0) Then
Dim CvePS_RNC As Integer = UsuarioActual.Empresa.Funcionalidad(580).ToEntero Dim CvePS_RNC As Integer = UsuarioActual.Empresa.Funcionalidad(580).ToEntero
If CvePS_RNC = 0 Then If CvePS_RNC = 0 Then
@@ -15689,8 +15691,8 @@ Partial Class Compras_Compras
Dim UM As String = PSRow("UnidadMedida").ToString Dim UM As String = PSRow("UnidadMedida").ToString
If AjusteProntoPagoConIVA > 0 Then If ImporteRNC > 0 Then
AddPS(1, CveUM, UM, CveClasificacion, Clasificacion, CvePS_RNC, PS, 1, CveSubProyectoPrincipal.ToString, SubProyecto, "", "-1", "", AjusteProntoPagoConIVA, AjusteProntoPagoConIVA, AjusteProntoPagoPorcentajeIVA, 0, 0, 0, 0, 0) AddPS(1, CveUM, UM, CveClasificacion, Clasificacion, CvePS_RNC, PS, 1, CveSubProyectoPrincipal.ToString, SubProyecto, "", "-1", "", ImporteRNC, ImporteRNC, AjusteProntoPagoPorcentajeIVA, 0, 0, 0, 0, 0)
End If End If
If AjusteProntoPagoSinIVA > 0 Then If AjusteProntoPagoSinIVA > 0 Then
@@ -15698,14 +15700,13 @@ Partial Class Compras_Compras
End If End If
End If End If
CompraEstaVinculadaOC = True
AddPS2(False) 'AddPS2(False)
'AJUSTE DE REDONDEO O DIFERENCIA PERMITIDA DE IMPORTE 'AJUSTE DE REDONDEO O DIFERENCIA PERMITIDA DE IMPORTE
AjustaImporteUltimoConcepto((If(TieneAmortizacion, TmpDT.SUMD("ImporteSinImpuestos"), TxtSubTotal2.Text.ToDouble) + TxtOtrosImpuestos.Text.ToDouble).ToDecimal - If(TieneAmortizacion, TmpDT.SUM("ImporteSinImpuestos").ToString.ToDecimal, TmpDT.SUM("Total").ToString.ToDecimal)) AjustaImporteUltimoConcepto((If(TieneAmortizacion, TmpDT.SUMD("ImporteSinImpuestos"), TxtSubTotal2.Text.ToDouble) + TxtOtrosImpuestos.Text.ToDouble).ToDecimal - If(TieneAmortizacion, TmpDT.SUM("ImporteSinImpuestos").ToString.ToDecimal, TmpDT.SUM("Total").ToString.ToDecimal))
'AjustaImporteUltimoConcepto(TxtSubTotal2.Text.ToDecimal + TxtOtrosImpuestos.Text.ToDecimal - (TmpDT.SUM("Total").ToString.ToDecimal)) 'AjustaImporteUltimoConcepto(TxtSubTotal2.Text.ToDecimal + TxtOtrosImpuestos.Text.ToDecimal - (TmpDT.SUM("Total").ToString.ToDecimal))
BtnGuardar.Enabled = True BtnGuardar.Enabled = True
If Not CierrePeriodo Then If Not CierrePeriodo Then
BtnGuardar.Visible = True BtnGuardar.Visible = True
@@ -15804,9 +15805,7 @@ Partial Class Compras_Compras
End If End If
CalculaTotales() CalculaTotales()
CompraEstaVinculadaOC = True
End Sub End Sub
@@ -16917,8 +16916,9 @@ Partial Class Compras_Compras
Private Sub CargaSerie() Private Sub CargaSerie()
Dim AplicaCaducidad As Boolean = False Dim AplicaCaducidad As Boolean = False
If GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerieLote).Rows(0) IsNot Nothing Then Dim drr As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePSSerieLote).FiltroPrimero("")
AplicaCaducidad = If(GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerieLote).Rows(0)("AplicaCaducidad").ToString = "True", True, False) If drr IsNot Nothing Then
AplicaCaducidad = If(drr("AplicaCaducidad").ToString = "True", True, False)
End If End If
If AplicaCaducidad Then If AplicaCaducidad Then
@@ -16969,7 +16969,7 @@ Partial Class Compras_Compras
Protected Sub BtnAgregarPS_Click(sender As Object, e As EventArgs) Protected Sub BtnAgregarPS_Click(sender As Object, e As EventArgs)
Dim SerieLote As String = TxtSerieLote.Text.Replace(" ", String.Empty) Dim SerieLote As String = TxtSerieLote.Text.Replace(" ", String.Empty)
Dim AplicaCaducidad As Boolean = False Dim AplicaCaducidad As Boolean = False
Dim dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerieLote).FiltroPrimero("", "PS") Dim dr As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePSSerieLote).FiltroPrimero("", "PS")
If dr IsNot Nothing Then AplicaCaducidad = dr("AplicaCaducidad").ToString = "True" If dr IsNot Nothing Then AplicaCaducidad = dr("AplicaCaducidad").ToString = "True"
'VALIDA QUE LA SERIE NO SEA IGUAL AL CODIGO O CODIGOBARRAS 'VALIDA QUE LA SERIE NO SEA IGUAL AL CODIGO O CODIGOBARRAS
@@ -21992,7 +21992,7 @@ Partial Class Compras_Compras
.NombreProveedor = NombreProveedor, .NombreProveedor = NombreProveedor,
.Fecha = Fecha, .Fecha = Fecha,
.CveMoneda = CveMoneda, .CveMoneda = CveMoneda,
.Serie = If(EsDRMN, $"DRNC-{Serie}", Serie), .Serie = $"D-{Serie}",
.Folio = Folio, .Folio = Folio,
.CveCompraAmortizacion = CveCompraRegistrada .CveCompraAmortizacion = CveCompraRegistrada
} }
@@ -22849,23 +22849,15 @@ Public Class ClsCompraManagerCompras
TmpDT.Columns.Add("CveSATPSActualizado") TmpDT.Columns.Add("CveSATPSActualizado")
SubTotalConceptos = TmpDT.SUMD("Total").RoundSQL SubTotalConceptos = TmpDT.SUMD("Total").RoundSQL
If Not TmpDT.Columns.Contains("Amortizacion") Then If Not TmpDT.Columns.Contains("Amortizacion") Then TmpDT.Columns.Add("Amortizacion", GetType(Decimal))
TmpDT.Columns.Add("Amortizacion", GetType(Decimal))
End If
If Not TmpDT.Columns.Contains("AplicaLote") Then TmpDT.Columns.Add("AplicaLote", GetType(Boolean))
If Not TmpDT.Columns.Contains("AplicaLote") Then If Not TmpDT.Columns.Contains("AplicaCaducidad") Then TmpDT.Columns.Add("AplicaCaducidad", GetType(Boolean))
TmpDT.Columns.Add("AplicaLote", GetType(Boolean))
End If If Not TmpDT.Columns.Contains("Lote") Then TmpDT.Columns.Add("Lote", GetType(String))
If Not TmpDT.Columns.Contains("AplicaCaducidad") Then
TmpDT.Columns.Add("AplicaCaducidad", GetType(Boolean)) If Not TmpDT.Columns.Contains("FechaCaducidad") Then TmpDT.Columns.Add("FechaCaducidad", GetType(Date))
End If
If Not TmpDT.Columns.Contains("Lote") Then
TmpDT.Columns.Add("Lote", GetType(String))
End If
If Not TmpDT.Columns.Contains("FechaCaducidad") Then
TmpDT.Columns.Add("FechaCaducidad", GetType(Date))
End If
'VALIDA QUE EL XML SI VIENE CON EL CODIGO SAT 01010101 'VALIDA QUE EL XML SI VIENE CON EL CODIGO SAT 01010101
Dim ProductosCodigoSATNoPermitidos As New StringBuilder("") Dim ProductosCodigoSATNoPermitidos As New StringBuilder("")
@@ -22875,7 +22867,6 @@ Public Class ClsCompraManagerCompras
If ProductosCodigoSATNoPermitidos.ToString.Length > 0 Then If ProductosCodigoSATNoPermitidos.ToString.Length > 0 Then
Errores.AppendLine($"El comprobante contiene productos con código SAT '01010101', revise los productos:</br></br>{ProductosCodigoSATNoPermitidos.ToString}") Errores.AppendLine($"El comprobante contiene productos con código SAT '01010101', revise los productos:</br></br>{ProductosCodigoSATNoPermitidos.ToString}")
End If End If
Else Else
GuardaLog($"Error al cargar detalles GetFacturasComparacionXML.") GuardaLog($"Error al cargar detalles GetFacturasComparacionXML.")

View File

@@ -3140,6 +3140,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("FechaVencimiento", If(CveCompra > 0, dr("FechaVencimiento").ToString.ToDate().ToString("dd/MM/yyyy"), ""))) params.Add(New ReportParameter("FechaVencimiento", If(CveCompra > 0, dr("FechaVencimiento").ToString.ToDate().ToString("dd/MM/yyyy"), "")))
params.Add(New ReportParameter("NombreCapturo", If(CveCompra > 0, dr("NombreCapturo").ToString, ""))) params.Add(New ReportParameter("NombreCapturo", If(CveCompra > 0, dr("NombreCapturo").ToString, "")))
params.Add(New ReportParameter("NumeroOrden", If(CveCompra > 0, dr("OCSerieFolioVinculada").ToString, "")))
Else Else
params.Add(New ReportParameter("NombreRecibio", String.Format(Recibio))) params.Add(New ReportParameter("NombreRecibio", String.Format(Recibio)))

View File

@@ -1125,7 +1125,7 @@ Partial Class Compras_eFacturas
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then If UsuarioActual.CveEmpresa.Contiene(13, 83) Then
Dim Fecha28Dic As Date = New Date(2024, 12, 28) Dim Fecha28Dic As Date = New Date(2024, 12, 28)
If NowADS() >= Fecha28Dic AndAlso e.Row.DBCampo("FechaFactura").ToDate <= "2025/01/01".ToDate Then If NowADS() >= Fecha28Dic AndAlso e.Row.DBCampo("FechaFactura").ToDate.Year < 2025 Then
e.Row.FCHyperLink("HplAgregar").Visible = False e.Row.FCHyperLink("HplAgregar").Visible = False
End If End If
End If End If

View File

@@ -179,22 +179,22 @@
<TablixBody> <TablixBody>
<TablixColumns> <TablixColumns>
<TablixColumn> <TablixColumn>
<Width>1.0835cm</Width> <Width>0.97724cm</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>1.53251cm</Width> <Width>1.40581cm</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>1.40148cm</Width> <Width>1.40148cm</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>11.05821cm</Width> <Width>10.82525cm</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>2.33994cm</Width> <Width>3.03882cm</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>1.86685cm</Width> <Width>1.63389cm</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>1.96383cm</Width> <Width>1.96383cm</Width>
@@ -222,7 +222,7 @@
</TextRun> </TextRun>
</TextRuns> </TextRuns>
<Style> <Style>
<TextAlign>Center</TextAlign> <TextAlign>Right</TextAlign>
</Style> </Style>
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
@@ -275,7 +275,7 @@
</TextRun> </TextRun>
</TextRuns> </TextRuns>
<Style> <Style>
<TextAlign>Center</TextAlign> <TextAlign>Left</TextAlign>
</Style> </Style>
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
@@ -478,7 +478,7 @@
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>Costo Unit.</Value> <Value>Cos.Unit.</Value>
<Style> <Style>
<FontFamily>MYRIAd Pro</FontFamily> <FontFamily>MYRIAd Pro</FontFamily>
<FontSize>7.5pt</FontSize> <FontSize>7.5pt</FontSize>
@@ -598,7 +598,7 @@
</TextRun> </TextRun>
</TextRuns> </TextRuns>
<Style> <Style>
<TextAlign>Center</TextAlign> <TextAlign>Right</TextAlign>
</Style> </Style>
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
@@ -632,7 +632,7 @@
</TextRun> </TextRun>
</TextRuns> </TextRuns>
<Style> <Style>
<TextAlign>Center</TextAlign> <TextAlign>Left</TextAlign>
</Style> </Style>
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
@@ -1899,7 +1899,7 @@
</Style> </Style>
</TextRun> </TextRun>
<TextRun> <TextRun>
<Value>=Parameters!OCVinculada.Value</Value> <Value>=Parameters!NumeroOrden.Value</Value>
<Style> <Style>
<FontFamily>Myriad Pro</FontFamily> <FontFamily>Myriad Pro</FontFamily>
<FontSize>8pt</FontSize> <FontSize>8pt</FontSize>

View File

@@ -113,6 +113,10 @@
<DataField>IEPS</DataField> <DataField>IEPS</DataField>
<rd:TypeName>System.Decimal</rd:TypeName> <rd:TypeName>System.Decimal</rd:TypeName>
</Field> </Field>
<Field Name="NumeroParte">
<DataField>NumeroParte</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
</Fields> </Fields>
<rd:DataSetInfo> <rd:DataSetInfo>
<rd:DataSetName>DsOC</rd:DataSetName> <rd:DataSetName>DsOC</rd:DataSetName>
@@ -132,31 +136,34 @@
<TablixBody> <TablixBody>
<TablixColumns> <TablixColumns>
<TablixColumn> <TablixColumn>
<Width>0.2in</Width> <Width>0.15in</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>0.57026in</Width> <Width>0.35in</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>0.74207in</Width> <Width>0.5in</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>0.78808in</Width> <Width>0.6in</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>2.63616in</Width> <Width>2.63616in</Width>
</TablixColumn> </TablixColumn>
<TablixColumn>
<Width>1.05574in</Width>
</TablixColumn>
<TablixColumn> <TablixColumn>
<Width>1.03151in</Width> <Width>1.03151in</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>0.68106in</Width> <Width>0.5in</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>0.56042in</Width> <Width>0.56042in</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>0.95956in</Width> <Width>0.83282in</Width>
</TablixColumn> </TablixColumn>
</TablixColumns> </TablixColumns>
<TablixRows> <TablixRows>
@@ -343,6 +350,42 @@
</Textbox> </Textbox>
</CellContents> </CellContents>
</TablixCell> </TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox12">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Código Prov.</Value>
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>9.5pt</FontSize>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox12</rd:DefaultName>
<Style>
<Border>
<Style>None</Style>
</Border>
<BackgroundColor>#e36c09</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell> <TablixCell>
<CellContents> <CellContents>
<Textbox Name="Textbox46"> <Textbox Name="Textbox46">
@@ -553,7 +596,6 @@
</Border> </Border>
</Style> </Style>
</Textbox> </Textbox>
<rd:Selected>true</rd:Selected>
</CellContents> </CellContents>
</TablixCell> </TablixCell>
<TablixCell> <TablixCell>
@@ -647,6 +689,35 @@
</Textbox> </Textbox>
</CellContents> </CellContents>
</TablixCell> </TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="NumeroParte">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!NumeroParte.Value</Value>
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>7.5pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>NumeroParte</rd:DefaultName>
<Style>
<Border>
<Style>None</Style>
</Border>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell> <TablixCell>
<CellContents> <CellContents>
<Textbox Name="Obs1"> <Textbox Name="Obs1">
@@ -790,6 +861,7 @@
<TablixMember /> <TablixMember />
<TablixMember /> <TablixMember />
<TablixMember /> <TablixMember />
<TablixMember />
</TablixMembers> </TablixMembers>
</TablixColumnHierarchy> </TablixColumnHierarchy>
<TablixRowHierarchy> <TablixRowHierarchy>
@@ -805,7 +877,7 @@
<DataSetName>DsOC</DataSetName> <DataSetName>DsOC</DataSetName>
<Left>0.04788in</Left> <Left>0.04788in</Left>
<Height>0.34081in</Height> <Height>0.34081in</Height>
<Width>8.16912in</Width> <Width>8.21665in</Width>
<Style> <Style>
<Border> <Border>
<Style>None</Style> <Style>None</Style>
@@ -1700,7 +1772,7 @@
<Height>3.83039in</Height> <Height>3.83039in</Height>
<Style /> <Style />
</Body> </Body>
<Width>8.21701in</Width> <Width>8.26453in</Width>
<Page> <Page>
<PageHeader> <PageHeader>
<Height>5.96613cm</Height> <Height>5.96613cm</Height>

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -309,24 +309,24 @@ Partial Class General_SaldosIniciales
End If End If
If RblFormato.SelectedValue = "18" Then If RblFormato.SelectedValue = "18" Then
If Not dt.Columns(17).ColumnName = "Cantidad" Then If Not dt.Columns(18).ColumnName = "Cantidad" Then
Alert("El nombre de la Decimoctava columna debe ser 'Cantidad'. Favor de corregirlo", TipoMensaje.MsgError) Alert("El nombre de la Decimoctava columna debe ser 'Cantidad'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub Exit Sub
End If End If
If Not dt.Columns(18).ColumnName = "Codigo" Then If Not dt.Columns(19).ColumnName = "Codigo" Then
Alert("El nombre de la Decimonovena columna debe ser 'Codigo'. Favor de corregirlo", TipoMensaje.MsgError) Alert("El nombre de la Decimonovena columna debe ser 'Codigo'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub Exit Sub
End If End If
If Not dt.Columns(19).ColumnName = "PU" Then If Not dt.Columns(20).ColumnName = "PU" Then
Alert("El nombre de la Vigésima columna debe ser 'PU'. Favor de corregirlo", TipoMensaje.MsgError) Alert("El nombre de la Vigésima columna debe ser 'PU'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub Exit Sub
End If End If
If Not dt.Columns(20).ColumnName = "IVADetalle" Then If Not dt.Columns(21).ColumnName = "IVADetalle" Then
Alert("El nombre de la Vigésimo primera columna debe ser 'IVADetalle'. Favor de corregirlo", TipoMensaje.MsgError) Alert("El nombre de la Vigésimo primera columna debe ser 'IVADetalle'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub Exit Sub
End If End If
If Not dt.Columns(21).ColumnName = "IEPS" Then If Not dt.Columns(22).ColumnName = "IEPS" Then
Alert("El nombre de la Vigésimo segunda columna debe ser 'IEPS'. Favor de corregirlo", TipoMensaje.MsgError) Alert("El nombre de la Vigésimo segunda columna debe ser 'IEPS'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub Exit Sub
End If End If
@@ -2535,7 +2535,7 @@ Partial Class General_SaldosIniciales
If UsuarioActual.CveEmpresa = 189 Then If UsuarioActual.CveEmpresa = 189 Then
Dim DTFoliosFiscales As DataTable = dt.FiltraParametros("", "", {"Folio Fiscal"}) Dim DTFoliosFiscales As DataTable = dt.FiltraParametros("[Folio Fiscal] <> ''", "", {"Folio Fiscal"})
For Each drFolioFiscal As DataRow In DTFoliosFiscales.Rows For Each drFolioFiscal As DataRow In DTFoliosFiscales.Rows
Dim FolioFiscalActual As String = drFolioFiscal("Folio Fiscal").ToString Dim FolioFiscalActual As String = drFolioFiscal("Folio Fiscal").ToString
@@ -2622,7 +2622,6 @@ Partial Class General_SaldosIniciales
Exit For Exit For
End If End If
If Vendedor <> "" Then If Vendedor <> "" Then
CveVendedor = GlobalDTVendedores(UsuarioActual.CveEmpresa, VendedorTipo:=-1).FiltroPrimeroValor("CveVendedor", $"Vendedor = '{Vendedor}'").ToString().ToEntero() CveVendedor = GlobalDTVendedores(UsuarioActual.CveEmpresa, VendedorTipo:=-1).FiltroPrimeroValor("CveVendedor", $"Vendedor = '{Vendedor}'").ToString().ToEntero()
If Not CveVendedor > 0 Then CveVendedor = 0 If Not CveVendedor > 0 Then CveVendedor = 0
@@ -2648,7 +2647,6 @@ Partial Class General_SaldosIniciales
End If End If
If TipoCambio = "" Then TipoCambio = "1" If TipoCambio = "" Then TipoCambio = "1"
If Not CveClienteSucursal > 0 Then CveClienteSucursal = -1 If Not CveClienteSucursal > 0 Then CveClienteSucursal = -1
@@ -2663,15 +2661,32 @@ Partial Class General_SaldosIniciales
ErrorVentas = True ErrorVentas = True
End If End If
End If End If
Dim VentayaRegistrada As Boolean = False
If Not ErrorVentas Then If Not ErrorVentas Then
'Venta 'Venta
If CveCliente > 0 Then If CveCliente > 0 Then
If TipoDocto.Contiene("Ing", "Egs", "Rem") Then If TipoDocto.Contiene("Ing", "Egs", "Rem") Then
GuardaLog(Serie & "-" & Folio) GuardaLog(Serie & "-" & Folio)
If Not EsDetalle Then CveVenta = 0
Dim contador As Integer = 0
'verificar si existe la venta, si existe obtener el cveventa y limpiar su contenido para carga de lo nuevo.
If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, TipoDocto, Serie, Folio, "-1", -1, -1, -1, -1, "2000-01-01", Now.ToShortDateString, FolioFiscalActual, CveUsuarioConsulta:=100) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then
contador = 1
CveVenta = ObjVentas.DtResultados.FiltroPrimeroValor("CveVenta").ToEntero
VentayaRegistrada = True
VentasAgregadas += 1
'limpieza de las partidas
If ObjVentas.GetVentaDetalle(CveVenta) Then
For Each dr As DataRow In ObjVentas.DtResultados.Rows
ObjVentas.RemoveVentasDetalle(CveVenta, dr("CveVentaDetalle").ToString.ToEntero)
Next
End If
End If
End If
If Not EsDetalle AndAlso CveVenta = 0 Then
If Not ObjVentas.AddVenta(TipoDocto, Folio, CveCliente.ToEntero(), CveClienteSucursal, SubTotal, 0, Amortizacion, IVA, RetIVA, RetISR, Total, CveMoneda, TipoCambio.ToDecimal, If Not ObjVentas.AddVenta(TipoDocto, Folio, CveCliente.ToEntero(), CveClienteSucursal, SubTotal, 0, Amortizacion, IVA, RetIVA, RetISR, Total, CveMoneda, TipoCambio.ToDecimal,
0, 0, 0, FechaVencimiento, Fecha, "", "", Fecha, CveVendedor, Folio2, "", "", 0, 0, 0, "-1".ToDate, "-1".ToDate, "-1".ToDate, -1, 0, CvePrePoliza, 0, 0, 0, FechaVencimiento, Fecha, "", "", Fecha, CveVendedor, Folio2, "", "", 0, 0, 0, "-1".ToDate, "-1".ToDate, "-1".ToDate, -1, 0, CvePrePoliza,
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Serie:=Serie, CveSubProyecto:=Sucursal.ToEntero(), CveSubProyectoEjecucion:=Sucursal.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Serie:=Serie, CveSubProyecto:=Sucursal.ToEntero(), CveSubProyectoEjecucion:=Sucursal.ToEntero(),
@@ -2685,10 +2700,8 @@ Partial Class General_SaldosIniciales
CveVenta = ObjVentas.CveVenta CveVenta = ObjVentas.CveVenta
End If End If
For Each dRowDetalle As DataRow In dt.FiltraParametros($"[Folio Fiscal]='{FolioFiscalActual}'").Rows For Each dRowDetalle As DataRow In dt.FiltraParametros($"[Folio Fiscal]='{FolioFiscalActual}'").Rows
Dim CantidadDetalle As Decimal = dRowDetalle("Cantidad").ToString.ToDecimal 'digo PU IVADetalle Dim CantidadDetalle As Decimal = dRowDetalle("Cantidad").ToString.ToDecimal 'digo PU IVADetalle
Dim PuDetalle As Decimal = dRowDetalle("PU").ToString.ToDecimal Dim PuDetalle As Decimal = dRowDetalle("PU").ToString.ToDecimal
Dim IVADetalle As Decimal = dRowDetalle("IVADetalle").ToString.ToDecimal Dim IVADetalle As Decimal = dRowDetalle("IVADetalle").ToString.ToDecimal
@@ -2697,7 +2710,7 @@ Partial Class General_SaldosIniciales
Dim CodigoDetalle As String = dRowDetalle("Codigo").ToString Dim CodigoDetalle As String = dRowDetalle("Codigo").ToString
If CodigoDetalle.Trim.Length > 0 Then If CodigoDetalle.Trim.Length > 0 Then
Dim DrDetalles As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero($"Codigo = '{CodigoDetalle}'") Dim DrDetalles As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimero($"Codigo = '{CodigoDetalle}'")
If DrDetalles IsNot Nothing Then If DrDetalles IsNot Nothing Then
CvePS = DrDetalles("CvePS").ToString().ToEntero() CvePS = DrDetalles("CvePS").ToString().ToEntero()
@@ -2722,61 +2735,61 @@ Partial Class General_SaldosIniciales
Next Next
If Not VentayaRegistrada Then
Dim ConceptoContable As Integer = 1 Dim ConceptoContable As Integer = 1
Dim ConceptoContablePago As Integer = 2 Dim ConceptoContablePago As Integer = 2
If TipoDocto = "Egs" Then If TipoDocto = "Egs" Then
ConceptoContable = 12 ConceptoContable = 12
ConceptoContablePago = 91 ConceptoContablePago = 91
End If
If FolioFiscalActual <> "" Then
If Not ObjVentas.UpdateVentaFolioFiscal(FolioFiscalActual, CveVenta, UsuarioActual.CveEmpresa) Then
ErrorVentas = True
Exit For
End If End If
End If
Dim UsaComplementaria As Boolean = False If FolioFiscalActual <> "" Then
If Not ObjVentas.UpdateVentaFolioFiscal(FolioFiscalActual, CveVenta, UsuarioActual.CveEmpresa) Then
ErrorVentas = True
Exit For
End If
End If
If UsuarioActual.CveEmpresa.Contiene(119, 158) Then UsaComplementaria = True Dim UsaComplementaria As Boolean = False
'PrePólizaDetalle If UsuarioActual.CveEmpresa.Contiene(119, 158) Then UsaComplementaria = True
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, SubTotal, SubTotal, 4, Folio.ToString(), String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, CveClasificacion:=CveClasificacion, CveSubProyecto:=Sucursal.ToEntero(), PorcentajeImpuesto:=PorcentajeIVA, Contabilizable:=False) Then ErrorVentas = True : Exit For
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total, Total, ConceptoContable, Folio.ToString(), String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, PorcentajeImpuesto:=PorcentajeIVA, Contabilizable:=False) Then ErrorVentas = True : Exit For
If IVA > 0 Then 'PrePólizaDetalle
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IVA, IVA, 13, Folio.ToString(), String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, PorcentajeImpuesto:=PorcentajeIVA, Contabilizable:=False) Then ErrorVentas = True : Exit For If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, SubTotal, SubTotal, 4, Folio.ToString(), String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, CveClasificacion:=CveClasificacion, CveSubProyecto:=Sucursal.ToEntero(), PorcentajeImpuesto:=PorcentajeIVA, Contabilizable:=False) Then ErrorVentas = True : Exit For
End If If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total, Total, ConceptoContable, Folio.ToString(), String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, PorcentajeImpuesto:=PorcentajeIVA, Contabilizable:=False) Then ErrorVentas = True : Exit For
If IEPS > 0 Then If IVA > 0 Then
'AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IEPS, Folio, 38, String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=IEPS) If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IVA, IVA, 13, Folio.ToString(), String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, PorcentajeImpuesto:=PorcentajeIVA, Contabilizable:=False) Then ErrorVentas = True : Exit For
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IEPS, IEPS, 38, Folio.ToString, String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, Contabilizable:=False) Then ErrorVentas = True : Exit For End If
End If If IEPS > 0 Then
'AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IEPS, Folio, 38, String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=IEPS)
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IEPS, IEPS, 38, Folio.ToString, String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, Contabilizable:=False) Then ErrorVentas = True : Exit For
If RetIVA > 0 Then End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, RetISR, RetISR, 8, Folio.ToString(), String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, PorcentajeImpuesto:=PorcentajeRetISR, Contabilizable:=False) Then ErrorVentas = True : Exit For If RetIVA > 0 Then
End If
If RetISR > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, RetISR, RetISR, 8, Folio.ToString(), String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, PorcentajeImpuesto:=PorcentajeRetISR, Contabilizable:=False) Then ErrorVentas = True : Exit For
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, RetISR, RetISR, 9, Folio.ToString(), String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, PorcentajeImpuesto:=PorcentajeRetISR, Contabilizable:=False) Then ErrorVentas = True : Exit For End If
End If
If ImpuestoLocal > 0 Then If RetISR > 0 Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImpuestoLocal, ImpuestoLocal, 27, Folio.ToString(), String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, PorcentajeImpuesto:=PorcentajeIVA, Contabilizable:=False) Then ErrorVentas = True : Exit For If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, RetISR, RetISR, 9, Folio.ToString(), String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, PorcentajeImpuesto:=PorcentajeRetISR, Contabilizable:=False) Then ErrorVentas = True : Exit For
End If End If
If ImpuestoLocal > 0 Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImpuestoLocal, ImpuestoLocal, 27, Folio.ToString(), String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, PorcentajeImpuesto:=PorcentajeIVA, Contabilizable:=False) Then ErrorVentas = True : Exit For
End If
If UsaComplementaria Then If UsaComplementaria Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total * TipoCambio.ToDecimal - Total, Total * TipoCambio.ToDecimal - Total, 203, Folio.ToString(), String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteME:=Total, TipoCambio:=TipoCambio.ToDecimal, Contabilizable:=False) Then ErrorVentas = True : Exit For If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total * TipoCambio.ToDecimal - Total, Total * TipoCambio.ToDecimal - Total, 203, Folio.ToString(), String.Format("{0}-{1}", Serie, Folio), CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteME:=Total, TipoCambio:=TipoCambio.ToDecimal, Contabilizable:=False) Then ErrorVentas = True : Exit For
End If End If
'Saldo 'Saldo
If Saldo < Total Then If Saldo < Total Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Total - Saldo, Total - Saldo, ConceptoContablePago, Folio.ToString(), Folio.ToString(), CveVenta:=CveVenta, CveCliente:=CveCliente, CveVentaAmortizacion:=CveVenta, Contabilizable:=False) Then ErrorVentas = True : Exit For If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Total - Saldo, Total - Saldo, ConceptoContablePago, Folio.ToString(), Folio.ToString(), CveVenta:=CveVenta, CveCliente:=CveCliente, CveVentaAmortizacion:=CveVenta, Contabilizable:=False) Then ErrorVentas = True : Exit For
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total - Saldo, Total - Saldo, 95, Folio.ToString(), Folio.ToString(), CveVenta:=CveVenta, CveCliente:=CveCliente, Contabilizable:=False) Then ErrorVentas = True : Exit For If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total - Saldo, Total - Saldo, 95, Folio.ToString(), Folio.ToString(), CveVenta:=CveVenta, CveCliente:=CveCliente, Contabilizable:=False) Then ErrorVentas = True : Exit For
End If
End If End If
If Not ErrorVentas Then If Not ErrorVentas Then
@@ -2801,9 +2814,6 @@ Partial Class General_SaldosIniciales
'ErrorVentas = True 'ErrorVentas = True
'Exit For 'Exit For
End If End If
End If End If
@@ -2829,7 +2839,6 @@ Partial Class General_SaldosIniciales
EsDetalle = False EsDetalle = False
End If End If
Dim SubTotal As Decimal = 0 Dim SubTotal As Decimal = 0
Dim IVA As Decimal = 0 Dim IVA As Decimal = 0
Dim Total As Decimal = 0 Dim Total As Decimal = 0
@@ -2979,7 +2988,6 @@ Partial Class General_SaldosIniciales
'Venta 'Venta
If CveCliente > 0 Then If CveCliente > 0 Then
If TipoDocto.Contiene("Ing", "Egs", "Rem") Then If TipoDocto.Contiene("Ing", "Egs", "Rem") Then
GuardaLog(Serie & "-" & Folio) GuardaLog(Serie & "-" & Folio)
If Not EsDetalle Then If Not EsDetalle Then
@@ -3150,13 +3158,8 @@ Partial Class General_SaldosIniciales
Next Next
End If End If
'********************************************************************************************************************************************************************************** '**********************************************************************************************************************************************************************************
If Not ErrorVentas Then If Not ErrorVentas Then
If UsuarioActual.CveEmpresa = 189 Then If UsuarioActual.CveEmpresa = 189 Then

View File

@@ -245,14 +245,10 @@ Partial Class Inventarios_Kardex
Private Sub CargaDatos() Private Sub CargaDatos()
Dim CvePS As Integer = ddlProducto2.SelectedValue.ToEntero
Dim CveProducto As Integer = ddlProducto2.SelectedValue.ToEntero If CvePS > 0 Then
Dim DtTemp = CargarKardex(CvePS)
If CveProducto > 0 Then
Dim DtTemp = CargarKardex(CveProducto)
If DtTemp IsNot Nothing AndAlso DtTemp.Rows.Count > 0 Then If DtTemp IsNot Nothing AndAlso DtTemp.Rows.Count > 0 Then
Dim AplicaSeccion, AplicaLote, AplicaCaducidad, AplicaSerie, AplicaAlmacenDestino As Boolean Dim AplicaSeccion, AplicaLote, AplicaCaducidad, AplicaSerie, AplicaAlmacenDestino As Boolean
@@ -271,8 +267,7 @@ Partial Class Inventarios_Kardex
If AplicaCaducidad Then GvM.Columns(12).Visible = True If AplicaCaducidad Then GvM.Columns(12).Visible = True
If Not String.IsNullOrWhiteSpace(UsuarioActual.Empresa.Funcionalidad(147)) Then GvM.Columns(12).HeaderText = UsuarioActual.Empresa.Funcionalidad(147) If Not String.IsNullOrWhiteSpace(UsuarioActual.Empresa.Funcionalidad(147)) Then GvM.Columns(12).HeaderText = UsuarioActual.Empresa.Funcionalidad(147)
Dim Drp As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
Dim Drp As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CveProducto).FiltroPrimero("")
Dim AuxAplicaSerie As Boolean Dim AuxAplicaSerie As Boolean
Dim AuxAplicaCad As Boolean Dim AuxAplicaCad As Boolean
If Drp IsNot Nothing Then If Drp IsNot Nothing Then
@@ -335,8 +330,13 @@ Partial Class Inventarios_Kardex
End Sub End Sub
Private Sub CargarOCPendientesCompra() Private Sub CargarOCPendientesCompra()
Dim tCveSubProyectos As String = "-1"
If ddlAlmacen.SelectedValue <> "" Then
Dim tt As String = ddlAlmacen.GetSelectedValues()
tCveSubProyectos = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros($"CveAlmacen IN ({tt})").DataColumnToString("CveSubProyecto")
End If
Dim ObjOC As New ClsOC Dim ObjOC As New ClsOC
If ObjOC.PendientesCompra(ddlProducto2.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then If ObjOC.PendientesCompra(ddlProducto2.SelectedValue.ToEntero, tCveSubProyectos, UsuarioActual.CveEmpresa) Then
GvOC.DataSource = ObjOC.DtResultados.Copy GvOC.DataSource = ObjOC.DtResultados.Copy
LnkIndicador_OC.Text = ObjOC.DtResultados.Copy.SUM("CantidadPendienteVincular").ToString() LnkIndicador_OC.Text = ObjOC.DtResultados.Copy.SUM("CantidadPendienteVincular").ToString()
End If End If
@@ -383,6 +383,7 @@ Partial Class Inventarios_Kardex
ChkAgruparAlmacen.Checked, Serie, CveAlmacenes) Then ChkAgruparAlmacen.Checked, Serie, CveAlmacenes) Then
dt = ObjInventarios.DtResultados.Copy dt = ObjInventarios.DtResultados.Copy
End If End If
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then dt = dt.FiltraParametros("", "FechaMovto DESC") ' ordenamiento descendente
ObjInventarios.Dispose() ObjInventarios.Dispose()
Return dt Return dt

View File

@@ -810,7 +810,7 @@ Partial Class Inventarios_TrasladoSolicitud
e.Row.FCLinkButton("LnkMostrarTraspaso").CssClass = "btn btn-circle btn-sm green" e.Row.FCLinkButton("LnkMostrarTraspaso").CssClass = "btn btn-circle btn-sm green"
e.Row.FCLinkButton("LnkMostrarTraspaso").Text = "<i class='fa fa-info'></i>" e.Row.FCLinkButton("LnkMostrarTraspaso").Text = "<i class='fa fa-info'></i>"
If CveMovimientoAlmacen > 0 AndAlso PermisoDestino AndAlso e.Row.DataKey("CveMovimientoRelacionado") = "" Then If CveMovimientoAlmacen > 0 AndAlso PermisoDestino AndAlso (e.Row.DataKey("CveMovimientoRelacionado") = "" OrElse e.Row.DBCampo("CantidadRecibida").ToDecimal < e.Row.DBCampo("CantidadSolicitada").ToDecimal) Then
e.Row.FCHyperLink("HypRecibeTraspaso").Visible = True e.Row.FCHyperLink("HypRecibeTraspaso").Visible = True
e.Row.FCHyperLink("HypRecibeTraspaso").NavigateUrl = $"~/Inventarios/TraspasoAlmacen.aspx?CveAlmacenTransitorioR={CveAlmacenTransitorio}&FolioR={FolioMovimiento}&CveAlmacenDestinoR={CveAlmacenDestino}" e.Row.FCHyperLink("HypRecibeTraspaso").NavigateUrl = $"~/Inventarios/TraspasoAlmacen.aspx?CveAlmacenTransitorioR={CveAlmacenTransitorio}&FolioR={FolioMovimiento}&CveAlmacenDestinoR={CveAlmacenDestino}"
End If End If

View File

@@ -515,14 +515,6 @@
</td> </td>
<td><asp:CheckBox runat="server" ID="ChkEsTemporal" Text=" Es Temporal" Width="100px" /></td> <td><asp:CheckBox runat="server" ID="ChkEsTemporal" Text=" Es Temporal" Width="100px" /></td>
</tr> </tr>
<tr id="TrBotonesInvTemporal" runat="server" visible="false">
<td></td>
<td><asp:Button runat="server" ID="BtnInvTempEntrada" Text="Entrada" CssClass="btn btn-primary" OnClick="BtnInvTempEntrada_Click" Visible="false" /> </td>
<td><asp:Button runat="server" ID="BtnInvTempSalida" Text="Salida" CssClass="btn btn-primary" OnClick="BtnInvTempSalida_Click" Visible="false" /> </td>
</tr>
</table> </table>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>

View File

@@ -1056,13 +1056,10 @@ Partial Class OC_OC
DdlSubProyectoGral.Visible = True DdlSubProyectoGral.Visible = True
TrDescuentoEscalonado.Visible = True TrDescuentoEscalonado.Visible = True
TrDescuentoProntoPago.Visible = True TrDescuentoProntoPago.Visible = True
TrBotonesInvTemporal.Visible = True
If TipoOC = "OC" AndAlso UsuarioActual.TienePermisoProceso(401) AndAlso EsNuevo Then If TipoOC = "OC" AndAlso UsuarioActual.TienePermisoProceso(401) AndAlso EsNuevo Then
ChkEsTemporalRegistro.Visible = True ChkEsTemporalRegistro.Visible = True
End If End If
End If End If
If UsuarioActual.Empresa.CveEmpresa = 189 AndAlso CveOrdenCompra <> Nothing AndAlso CveOrdenCompra > 0 Then If UsuarioActual.Empresa.CveEmpresa = 189 AndAlso CveOrdenCompra <> Nothing AndAlso CveOrdenCompra > 0 Then
@@ -1555,10 +1552,6 @@ Partial Class OC_OC
End If End If
ChkEsTemporal.Checked = Boolean.Parse(objOC.DtResultados.Rows(0)("EsTemporal").ToString)
'PROMOCIONES 'PROMOCIONES
TxtPromocion.Text = objOC.Promocion TxtPromocion.Text = objOC.Promocion
ChkPromocion.Checked = TxtPromocion.Text.Trim.Length > 0 ChkPromocion.Checked = TxtPromocion.Text.Trim.Length > 0
@@ -2062,35 +2055,6 @@ Partial Class OC_OC
InicializaMovtosAlmacen() InicializaMovtosAlmacen()
End If End If
If EsGrupoDiaz And TipoOC = "OC" And ChkEsTemporal.Checked Then
Dim TieneEntrada As Boolean = False
Dim TieneSalida As Boolean = False
For Each gvRow As GridViewRow In GVInv.Rows
If gvRow.DataKey("CveConcepto").ToEntero = 33 Then
TieneEntrada = True
End If
If gvRow.DataKey("CveConcepto").ToEntero = 35 Then
TieneSalida = True
End If
Next
If UsuarioActual.TienePermisoProceso(401) Then
If Not TieneEntrada Then
BtnInvTempEntrada.Visible = True
End If
If TieneEntrada AndAlso Not TieneSalida Then
BtnInvTempSalida.Visible = True
End If
End If
End If
If UsuarioActual.Empresa.Funcionalidad(565) = "1" And pCveOrdenCompra > 0 And TipoOC.ToUpper() = "REQ" Then If UsuarioActual.Empresa.Funcionalidad(565) = "1" And pCveOrdenCompra > 0 And TipoOC.ToUpper() = "REQ" Then
'LAS COTIZACIONES RAPIDAS SOLO DEBE APARECER SI EL PROVEEDOR ES DEDICADO 'LAS COTIZACIONES RAPIDAS SOLO DEBE APARECER SI EL PROVEEDOR ES DEDICADO
If CveConfianzaProveedor = 1 Then If CveConfianzaProveedor = 1 Then
@@ -2981,7 +2945,7 @@ Partial Class OC_OC
RequiereCotizacion:=ChkCotizacion.Checked, CveCliente:=Ddlcliente.txtValue.Value.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text, PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RequiereCotizacion:=ChkCotizacion.Checked, CveCliente:=Ddlcliente.txtValue.Value.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text, PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal,
RetISR:=TxtRetISR.Text.ToDecimal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), Guia:=TxtGuia.Text.Trim, RetISR:=TxtRetISR.Text.ToDecimal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), Guia:=TxtGuia.Text.Trim,
IEPS:=TxtIEPS.Text.ToDecimal, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, Promocion:=Promocion, CveProveedorContacto:=CveProveedorContacto, NumRemision:=TxtNumRemision.Text.Trim(), MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), IEPS:=TxtIEPS.Text.ToDecimal, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, Promocion:=Promocion, CveProveedorContacto:=CveProveedorContacto, NumRemision:=TxtNumRemision.Text.Trim(), MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(),
CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago, EsTemporal:=ChkEsTemporal.Checked) Then CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago) Then
CveOrdenCompraPadre = OC.CveOrdenCompra CveOrdenCompraPadre = OC.CveOrdenCompra
If CveOrdenCompraPadre > 0 Then If CveOrdenCompraPadre > 0 Then
@@ -3003,12 +2967,9 @@ Partial Class OC_OC
Else Else
TieneError = True TieneError = True
End If End If
End If End If
End If End If
If Not ValidaNumRemision(TxtNumRemision.Text.Trim(), If(TipoOS, "OS", TipoOC), CveProveedor, OC.IniciaTransacSQL) Then If Not ValidaNumRemision(TxtNumRemision.Text.Trim(), If(TipoOS, "OS", TipoOC), CveProveedor, OC.IniciaTransacSQL) Then
TieneError = True TieneError = True
End If End If
@@ -3028,7 +2989,7 @@ Partial Class OC_OC
PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1),
CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), Guia:=TxtGuia.Text.Trim, IEPS:=TxtIEPS.Text.ToDecimal, CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=ImporteAnticipos, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), Guia:=TxtGuia.Text.Trim, IEPS:=TxtIEPS.Text.ToDecimal, CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=ImporteAnticipos, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero,
Promocion:=Promocion, CveProveedorContacto:=CveProveedorContacto, NumRemision:=TxtNumRemision.Text, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, Promocion:=Promocion, CveProveedorContacto:=CveProveedorContacto, NumRemision:=TxtNumRemision.Text, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero,
PorcentajeProntoPago:=PorcentajeProntoPago, EsTemporal:=ChkEsTemporal.Checked) Then PorcentajeProntoPago:=PorcentajeProntoPago) Then
CveOrdenCompra = OC.CveOrdenCompra CveOrdenCompra = OC.CveOrdenCompra
CveEstatus = CboE.SelectedValue.ToEntero CveEstatus = CboE.SelectedValue.ToEntero
@@ -3106,30 +3067,19 @@ Partial Class OC_OC
End If End If
End If End If
If Not TieneError AndAlso DdlMetodoPago.SelectedValue.ToEntero = 0 AndAlso TipoOC = "OC" Then If Not TieneError AndAlso DdlMetodoPago.SelectedValue.ToEntero = 0 AndAlso TipoOC = "OC" Then
If Not GeneraAnticpoContado(CveOrdenCompra, OC.IniciaTransacSQL()) Then If Not GeneraAnticpoContado(CveOrdenCompra, OC.IniciaTransacSQL()) Then
TieneError = True TieneError = True
End If End If
End If End If
If Not TieneError AndAlso TipoOC = "OC" Then If Not TieneError AndAlso TipoOC = "OC" Then
If Not GeneraPrePolizaPresupuesto(CveOrdenCompra, OC.IniciaTransacSQL) Then If Not GeneraPrePolizaPresupuesto(CveOrdenCompra, OC.IniciaTransacSQL) Then
TieneError = True TieneError = True
End If End If
End If End If
If EsGrupoDiaz AndAlso EsNuevo AndAlso CveOrdenCompra > 0 AndAlso TipoOC = "OC" AndAlso ChkEsTemporalRegistro.Checked Then
If Not RegistroInventarioTemporal(OC.IniciaTransacSQL, CveOrdenCompra, 1, False) Then
TieneError = True
End If
End If
If Not TieneError Then If Not TieneError Then
If Conta IsNot Nothing Then Conta.Commit() If Conta IsNot Nothing Then Conta.Commit()
OC.Commit() OC.Commit()
@@ -3729,7 +3679,7 @@ Partial Class OC_OC
PorcentajeIVA:=PorIVA, IVA:=IVACot, RetIVA:=RetIVA.ToString.ToDecimal, RetISR:=RetISR.ToString.ToDecimal, IDPoliza:=IdPoliza, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, PorcentajeIVA:=PorIVA, IVA:=IVACot, RetIVA:=RetIVA.ToString.ToDecimal, RetISR:=RetISR.ToString.ToDecimal, IDPoliza:=IdPoliza, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text,
EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), IEPS:=TxtIEPS.Text.ToDecimal, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), IEPS:=TxtIEPS.Text.ToDecimal,
CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=ImporteAnticipos, Promocion:=Promocion, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, NumRemision:=TxtNumRemision.Text.Trim, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=ImporteAnticipos, Promocion:=Promocion, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, NumRemision:=TxtNumRemision.Text.Trim, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(),
CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago, EsTemporal:=ChkEsTemporal.Checked) Then CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago) Then
'CREA POLIZA POR CADA PROVEEDOR 'CREA POLIZA POR CADA PROVEEDOR
@@ -3804,17 +3754,11 @@ Partial Class OC_OC
tCveSubProyecto = GetCveSubProyectoDetalles() tCveSubProyecto = GetCveSubProyectoDetalles()
End If End If
If (Not HuboError) AndAlso objOrdenCompra.AddOrdenCompra("OC", tCveSubProyecto, TxtDescrip.Text, TxtJustificacion.Text, DdlPrioridad.SelectedValue.ToEntero, TxtFecha.Text.ToDate, DdlMoneda.SelectedValue.ToEntero, CveEstatusInicialOC, TxtFechaEstimadaEntrega.Text, LugarEntrega, If (Not HuboError) AndAlso objOrdenCompra.AddOrdenCompra("OC", tCveSubProyecto, TxtDescrip.Text, TxtJustificacion.Text, DdlPrioridad.SelectedValue.ToEntero, TxtFecha.Text.ToDate, DdlMoneda.SelectedValue.ToEntero, CveEstatusInicialOC, TxtFechaEstimadaEntrega.Text, LugarEntrega,
CveUsuario, CveEmpresaActual, 0, pCveProveedor:=DdlProveedores.SelectedValue.ToEntero, pCveProveedorSucursal:=DdlProveedorSucursal.SelectedValue.ToEntero, CveUsuarioAsignado:=DdlUsuariosAsignado.SelectedValue.ToEntero(), CveCliente:=Ddlcliente.txtValue.Value.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text, CveUsuario, CveEmpresaActual, 0, pCveProveedor:=DdlProveedores.SelectedValue.ToEntero, pCveProveedorSucursal:=DdlProveedorSucursal.SelectedValue.ToEntero, CveUsuarioAsignado:=DdlUsuariosAsignado.SelectedValue.ToEntero(), CveCliente:=Ddlcliente.txtValue.Value.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text,
PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, IDPoliza:=IDPolizaPresupuestal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, IDPoliza:=IDPolizaPresupuestal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text,
EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), IEPS:=TxtIEPS.Text.ToDecimal, CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=ImporteAnticipos, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), IEPS:=TxtIEPS.Text.ToDecimal, CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=ImporteAnticipos, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero,
Promocion:=Promocion, NumRemision:=TxtNumRemision.Text.Trim, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago, Promocion:=Promocion, NumRemision:=TxtNumRemision.Text.Trim, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago) Then
EsTemporal:=ChkEsTemporal.Checked) Then
'USA AC 'USA AC
If UsuarioActual.Empresa.UsaAC AndAlso VerificaPresupuesto Then ' AGREGAR POLIZA If UsuarioActual.Empresa.UsaAC AndAlso VerificaPresupuesto Then ' AGREGAR POLIZA
@@ -5644,7 +5588,6 @@ Partial Class OC_OC
File.Move(Archivo.ToString, String.Format("{0}OI\OI{1}{2}", UsuarioActual.Empresa.Ruta, ObjEventoBitacora.CveEvento.ToString, Archivo.Extension)) File.Move(Archivo.ToString, String.Format("{0}OI\OI{1}{2}", UsuarioActual.Empresa.Ruta, ObjEventoBitacora.CveEvento.ToString, Archivo.Extension))
End If End If
Else Else
Retorno = True Retorno = True
Exit For Exit For
@@ -9800,253 +9743,6 @@ Partial Class OC_OC
FileExcel.Save(Response, $"OC_{CveOrdenCompra}.xlsx", SaveOptions.XlsxDefault) FileExcel.Save(Response, $"OC_{CveOrdenCompra}.xlsx", SaveOptions.XlsxDefault)
End Sub End Sub
Function RegistroInventarioTemporal(ByRef transaccion As SqlTransaction, CveOCInv As Integer, OpcionOrigen As Integer, Recargar As Boolean) As Boolean
Dim CveConceptoInv As Integer = If(OpcionOrigen = 1, 33, 35) 'Conceptos 33 Entrada Manual 35 Salida Manual
Dim Respuesta As Boolean = True
Dim ObjOC As New ClsOC(transaccion)
Dim DTDetalleOC As New DataTable
If ObjOC.GetOrdenesDetalle(CveOCInv, UsuarioActual.CveEmpresa) Then
DTDetalleOC = ObjOC.DtResultados.FiltraParametros(" CveTipoPS = 2 ")
If DTDetalleOC.Rows.Count = 0 Then 'No hay PSs Tipo Producto
Return True
End If
Else
Return False
End If
Dim tCveSubProyecto As Integer = UsuarioActual.CveSubProyecto
If ModalidadSubProyectoGeneral Then tCveSubProyecto = DdlSubProyectoGral.SelectedValue.ToEntero
If tCveSubProyecto <= 0 Then
tCveSubProyecto = GetCveSubProyectoDetalles()
End If
If tCveSubProyecto <= 0 Then
Alert("Sub Proyecto no asignado.")
Return False
End If
Dim CveAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveSubProyecto = {tCveSubProyecto} AND CveTipoAlmacen = 1 ").ToEntero
If CveAlmacen <= 0 Then
Alert("Almacén no asignado.")
Return False
End If
Dim ObjConta As New ClsContabilidad(transaccion)
Dim ObjInventario As New ClsInventarios(transaccion)
'Dim CveConceptoInv As Integer = If(TipoTermino = 1, 3, 2)
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inv/OC", 53, 0, 0, 1, TxtFecha.Text.Replace(",", "").ToDate, TxtDescrip.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3)
Dim CveMovimiento As Integer = ObjInventario.AddMovimiento(CveAlmacen, CveConceptoInv, 1, NowADS, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, tCveSubProyecto, -1, Observaciones:=TxtDescrip.Text, Modulo:="OC/1")
Dim FolioMto As Integer = ObjInventario.Folio
If CveMovimiento <= 0 OrElse CvePrePoliza <= 0 Then
Alert("No se pudo almacenar el movimiento correctamente", TipoMensaje.MsgError)
'ObjInventario.RollBack() 'deshace lo insertado
Respuesta = False
Else
Dim Mensaje As String = ""
''VALIDA EXISTENCIAS
Dim Cont As Integer = 0
If CveConceptoInv = 3 Then
For Each Dr As DataRow In DTDetalleOC.Rows
'Dim FechaCaducidadVal As Date = If(Dr("AplicaCaducidad").ToString = "True", Dr("FechaCaducidad").ToString.ToDate, MinFecha)
Dim FechaMovtoExistenciaStr As String = $"{NowADS.ToString("yyyy/MM/dd")} {NowADS.ToString("HH:mm")}"
If ObjInventario.GetExistenciasPS(Dr("CvePS").ToString.ToEntero, Dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, CveAlmacen, FechaMovto:=FechaMovtoExistenciaStr) >= Dr("Cantidad").ToString.ToDouble Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, -1, Observaciones:=Dr("Descripcion").ToString, CveUsuarioModifico:=UsuarioActual.CveUsuario, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
Mensaje = "Error al guardar los movimientos"
Respuesta = False
Exit For
End If
Else
If UsuarioActual.TienePermisoProceso(114) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, -1, Observaciones:=Dr("Descripcion").ToString, CveUsuarioModifico:=UsuarioActual.CveUsuario, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
Mensaje = "Error al guardar los movimientos"
Respuesta = False
Exit For
End If
Else
Mensaje = String.Format("No hay existencias suficientes del producto: {0}", Dr("PS"))
Alert(Mensaje, TipoMensaje.MsgAdvertencia)
Respuesta = False
Exit For
End If
End If
Cont += 1
Next
Else
For Each Dr As DataRow In DTDetalleOC.Rows
Dim ImporteConcepto As Decimal = 0
If CveConceptoInv = 2 AndAlso DdlMoneda.SelectedValue.ToEntero = 2 Then
ImporteConcepto = Dr("PU").ToString.ToDecimal * GlobalTipoCambio(TxtFecha.Text.Replace(",", "").ToDate).ToDecimal
Else
ImporteConcepto = Dr("PU").ToString.ToDecimal
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, ImporteConcepto, Observaciones:=Dr("Descripcion").ToString, CveUsuarioModifico:=UsuarioActual.CveUsuario, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
Mensaje = "Error al guardar los movimientos"
Respuesta = False
Exit For
End If
Cont += 1
Next
End If
Dim EsContabilizable As Boolean = False
'Registro la prepóliza
If Respuesta AndAlso ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
Dim tValorInventario As Decimal = ObjInventario.DtResultados.SUMD("Total", "").RoundSQL()
Dim tValorOtro As Decimal = tValorInventario
Dim TipoMovtoAlmacen As Boolean = False
Dim TipoMovtoOtro As Boolean = True
Dim drA2 As DataRow = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveAlmacen = {0}", CveAlmacen))
If drA2 IsNot Nothing Then
tCveSubProyecto = drA2("CveSubProyecto").ToString.ToEntero
End If
Dim OrigenMov As Integer = GlobalDTInvConceptos.FiltroPrimeroValor("Origen", "CveConcepto = " & CveConceptoInv).ToEntero
If OrigenMov = 1 Then TipoMovtoAlmacen = False Else TipoMovtoAlmacen = True
TipoMovtoOtro = Not TipoMovtoAlmacen
Dim CveConceptoContable As Integer = 260
Dim CveClasificacion As Integer = -1
Select Case CveConceptoInv
Case 2, 32
CveConceptoContable = 78
EsContabilizable = True
Case 28, 31
CveConceptoContable = 51
If CveConceptoInv = 28 Then
''cuando es 28, es otros ingresos.78
CveConceptoContable = 78
End If
EsContabilizable = True
Case 30
CveConceptoContable = 181
TipoMovtoOtro = False
If DdlSubProyecto.Visible = True AndAlso DdlSubProyecto.SelectedValue.ToEntero > 0 Then tCveSubProyecto = DdlSubProyecto.SelectedValue.ToEntero
Case 34
CveConceptoContable = 51
EsContabilizable = True
Case 13, 29
CveConceptoContable = 69
TipoMovtoOtro = True
tValorOtro = -tValorOtro
Dim drr As DataRow = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimero("")
If drr IsNot Nothing Then
CveClasificacion = drr("CveClasificacion").ToString.ToEntero
End If
Case 3
CveConceptoContable = 51
EsContabilizable = True
Case Else
CveConceptoContable = 95
End Select
'2-78
Dim Obs As String = TxtDescrip.Text
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoAlmacen, tValorInventario, tValorInventario, 68, Obs, Obs, CveMovimientoAlmacen:=CveMovimiento, CveClasificacion:=CveClasificacion, Contabilizable:=EsContabilizable) Then
Respuesta = False
Else
'Dim Total As Decimal = 0
If CveConceptoContable.Contiene(181, 78, 51, 69) Then
Dim Dt As DataTable = ObjInventario.DtResultados.FiltraParametros("", "", {"CveClasificacion"}).Copy
For Each Dr As DataRow In Dt.Rows
Dim Total As Decimal = ObjInventario.DtResultados.FiltraParametros($"CveClasificacion = {Dr("CveClasificacion")}").SUM("Total").RoundSQL()
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovtoAlmacen, Total, Total, CveConceptoContable, lblFolio.Text, Obs, 0, CveMovimientoAlmacen:=CveMovimiento, CveClasificacion:=Dr("CveClasificacion").ToString.ToEntero, CveSubProyecto:=tCveSubProyecto) Then
Respuesta = False
End If
Next
Else
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovtoAlmacen, tValorInventario, tValorInventario, CveConceptoContable, Obs, Obs, CveMovimientoAlmacen:=CveMovimiento, CveClasificacion:=CveClasificacion, Contabilizable:=EsContabilizable) Then
Respuesta = False
End If
End If
End If
Else
Respuesta = False
End If
End If
If Respuesta Then
If Recargar Then
Alert($"Movimiento Guardado Correctamente Folio:{FolioMto}", TipoMensaje.MsgInformacion, "window.location.reload();")
Else
Alert($"Movimiento Guardado Correctamente Folio:{FolioMto}", TipoMensaje.MsgInformacion)
End If
End If
Return Respuesta
End Function
Protected Sub BtnInvTempEntrada_Click(sender As Object, e As EventArgs)
Dim ObjOC As New ClsOC
Try
If RegistroInventarioTemporal(ObjOC.IniciaTransacSQL(), CveOrdenCompra, 1, True) Then
ObjOC.Commit()
Else
ObjOC.RollBack()
End If
Catch ex As Exception
ObjOC.RollBack()
Finally
ObjOC.Dispose()
End Try
End Sub
Protected Sub BtnInvTempSalida_Click(sender As Object, e As EventArgs)
Dim ObjOC As New ClsOC
Try
If RegistroInventarioTemporal(ObjOC.IniciaTransacSQL(), CveOrdenCompra, 0, True) Then
ObjOC.Commit()
Else
ObjOC.RollBack()
End If
Catch ex As Exception
ObjOC.RollBack()
Finally
ObjOC.Dispose()
End Try
End Sub
End Class End Class

View File

@@ -137,7 +137,7 @@
<br /> <br />
<div runat="server" id="DivDatos"> <div runat="server" id="DivDatos">
<asp:GridView ID="GV" runat="server" ClientIDMode="Static" DataKeyNames="CveOrdenCompra,Folio,CveEstatusSiguiente,FolioREQ" AutoGenerateColumns="false" EmptyDataText="No se encontraron registros" ToolTip="Listado de Ordenes de Compra Encontrados." OnRowDataBound="GV_RowDataBound" CssClass="table GVD table-striped table-hover " GridLines="None" HorizontalAlign="Left"> <asp:GridView ID="GV" runat="server" ClientIDMode="Static" DataKeyNames="CveOrdenCompra,SerieFolio,Folio,CveEstatusSiguiente,FolioREQ" AutoGenerateColumns="false" EmptyDataText="No se encontraron registros" ToolTip="Listado de Ordenes de Compra Encontrados." OnRowDataBound="GV_RowDataBound" CssClass="table GVD table-striped table-hover " GridLines="None" HorizontalAlign="Left">
<Columns> <Columns>
<asp:TemplateField HeaderText="Folio" ItemStyle-Width="7.5%"> <asp:TemplateField HeaderText="Folio" ItemStyle-Width="7.5%">
<ItemTemplate> <ItemTemplate>

View File

@@ -244,7 +244,12 @@ Partial Class OC_PopUpBuscarReq
e.Row.FCHyperLink("HLFolio").NavigateUrl = Link e.Row.FCHyperLink("HLFolio").NavigateUrl = Link
e.Row.FCHyperLink("HLDescripcion").NavigateUrl = Link e.Row.FCHyperLink("HLDescripcion").NavigateUrl = Link
ElseIf ViewState("VinculacionOC").ToString = "VOCCOMP" AndAlso UsuarioActual.Empresa.MetodoOC = 1 Then
e.Row.FCLabel("LbFolio").Visible = False
e.Row.FCHyperLink("HLFolio").Visible = True
e.Row.FCHyperLink("HLFolio").Target = "_blank"
e.Row.FCHyperLink("HLFolio").NavigateUrl = String.Format("/OC/OC.aspx?OC={0}", e.Row.DBCampo("CveOrdenCompra"))
ElseIf ViewState("VinculacionOC").ToString = "FactFle" Then ElseIf ViewState("VinculacionOC").ToString = "FactFle" Then
e.Row.FCHyperLink("HLFolio").Visible = True e.Row.FCHyperLink("HLFolio").Visible = True
e.Row.FCLabel("LbFolio").Visible = False e.Row.FCLabel("LbFolio").Visible = False
@@ -319,7 +324,7 @@ Partial Class OC_PopUpBuscarReq
If GV.Rows(i).FCCheckBox("CheckVincular").Checked = True Then If GV.Rows(i).FCCheckBox("CheckVincular").Checked = True Then
If CveOC <> "" Then If CveOC <> "" Then
CveOC &= String.Format(", {0}", GV.Rows(i).DataKey("CveOrdenCompra").ToString) CveOC &= String.Format(", {0}", GV.Rows(i).DataKey("CveOrdenCompra").ToString)
Folio &= String.Format(", {0}", GV.Rows(i).DataKey("Folio").ToString) Folio &= String.Format(", {0}", GV.Rows(i).DataKey("SerieFolio").ToString)
CveEstatus &= String.Format(", {0}", GV.Rows(i).DataKey("CveEstatusSiguiente").ToString) CveEstatus &= String.Format(", {0}", GV.Rows(i).DataKey("CveEstatusSiguiente").ToString)
'código para cambiar de proveedor a la oc, para caso 172 'código para cambiar de proveedor a la oc, para caso 172
@@ -332,7 +337,7 @@ Partial Class OC_PopUpBuscarReq
'End If 'End If
Else Else
CveOC = GV.Rows(i).DataKey("CveOrdenCompra").ToString CveOC = GV.Rows(i).DataKey("CveOrdenCompra").ToString
Folio = GV.Rows(i).DataKey("Folio").ToString Folio = GV.Rows(i).DataKey("SerieFolio").ToString
CveEstatus = GV.Rows(i).DataKey("CveEstatusSiguiente").ToString CveEstatus = GV.Rows(i).DataKey("CveEstatusSiguiente").ToString
End If End If
End If End If

View File

@@ -201,10 +201,6 @@
<asp:DropDownList ID="DdlMoneda" runat="server" CssClass="form-control input-sm select2me" DataTextField="Moneda" DataValueField="CveMoneda" Style="width: 95px; height: 30px; display: inline-block;"> <asp:DropDownList ID="DdlMoneda" runat="server" CssClass="form-control input-sm select2me" DataTextField="Moneda" DataValueField="CveMoneda" Style="width: 95px; height: 30px; display: inline-block;">
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<div class="colf-1" runat="server" id="DVEsTemporal" visible="false">
<asp:CheckBox runat="server" ID="ChkEsTempral" Text="Es Temporal" />
</div>
</div> </div>
<div class="row rownomargin"> <div class="row rownomargin">
<label class="colf-1 truncate">Clasificación</label> <label class="colf-1 truncate">Clasificación</label>
@@ -266,7 +262,7 @@
</div> </div>
<label class="colf-1 truncate" id="clintesdiv1" runat="server" visible="false">Cliente</label> <label class="colf-1 truncate" id="clintesdiv1" runat="server" visible="false">Cliente</label>
<div class="colf-2" id="clintesdiv2" runat="server" visible="false"> <div class="colf-2" id="clintesdiv2" runat="server" visible="false">
<asp:DropDownList ID="ddlcliente" runat="server" CssClass="form-control input-sm select2me" DataTextField="NombreComercial" DataValueField="CveCliente"></asp:DropDownList> <ADS:Dropdownlost ID="ddlclientes" runat="server" CssClassDdl="select2me" CssStyle="width: 100%;" Width="100%" DataTextField="NombreComercial" DataValueField="CveCliente"></ADS:Dropdownlost>
</div> </div>
<div class="colf-3"> <div class="colf-3">
<asp:CheckBox Text="No Completa" TextAlign="Left" CssClass="md-checksd2" ID="CheckNoCompleta" Visible="true" runat="server" /> <asp:CheckBox Text="No Completa" TextAlign="Left" CssClass="md-checksd2" ID="CheckNoCompleta" Visible="true" runat="server" />

View File

@@ -69,31 +69,22 @@ Partial Class RepOC
CargaActivoFijo() CargaActivoFijo()
CargaClasificacion() CargaClasificacion()
CargaPS(-1) CargaPS(-1)
CargaClientes()
If UsuarioActual.Empresa.Funcionalidad(108) = "1" Then 'If UsuarioActual.Empresa.Funcionalidad(108) = "1" Then
CargaClientes() ' CargaClientes()
Else 'Else
ddlcliente.Items.Insert(0, New ListItem("Todos", "-1")) ' ddlcliente.Items.Insert(0, New ListItem("Todos", "-1"))
End If 'End If
CargaPendientes() CargaPendientes()
txtFechaISemanal.Text = NowADS().FirstDayOfMonth.ToShortDateString txtFechaISemanal.Text = NowADS().FirstDayOfMonth.ToShortDateString
txtFechaFSemanal.Text = NowADS().ToShortDateString txtFechaFSemanal.Text = NowADS().ToShortDateString
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
DVEsTemporal.Visible = True
End If
End If End If
End Sub End Sub
#Region " CARGA COMBOS " #Region " CARGA COMBOS "
Protected Sub CargaProyectos() Protected Sub CargaProyectos()
'DdlProyectos.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1), GlobalDTProyectos(UsuarioActual.CveEmpresa, -1)) 'DdlProyectos.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1), GlobalDTProyectos(UsuarioActual.CveEmpresa, -1))
'DdlProyectos.DataBind() 'DdlProyectos.DataBind()
@@ -146,9 +137,13 @@ Partial Class RepOC
Protected Sub CargaClientes() Protected Sub CargaClientes()
clintesdiv1.Visible = True clintesdiv1.Visible = True
clintesdiv2.Visible = True clintesdiv2.Visible = True
ddlcliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa) ddlclientes.setEsWebService(True)
ddlcliente.DataBind() ddlclientes.Attributes.Add("data-metodo", "getcliente")
ddlcliente.Items.Insert(0, New ListItem("Todos", "-1")) ddlclientes.SelectedText = "Todos"
ddlclientes.SelectedValue = "-1"
'ddlcliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa)
'ddlcliente.DataBind()
'ddlcliente.Items.Insert(0, New ListItem("Todos", "-1"))
GvPorAtender.Columns(12).Visible = False GvPorAtender.Columns(12).Visible = False
GvPendientes.Columns(12).Visible = False GvPendientes.Columns(12).Visible = False
@@ -222,12 +217,10 @@ Partial Class RepOC
End Sub End Sub
Private Sub CargaPendientes() Private Sub CargaPendientes()
Dim EsTemporal As Integer = If(ChkEsTempral.Checked, 1, -1)
Dim OC As New ClsOC Dim OC As New ClsOC
If OC.GetOrdenesPendientes(DdlTipo.SelectedValue.ToString, 0, UsuarioActual.CveEmpresa, DdlProyectos.SelectedValue.ToEntero, DdlSubProyectos.SelectedValue.ToEntero, If OC.GetOrdenesPendientes(DdlTipo.SelectedValue.ToString, 0, UsuarioActual.CveEmpresa, DdlProyectos.SelectedValue.ToEntero, DdlSubProyectos.SelectedValue.ToEntero,
DdlEstatus.SelectedValue.ToEntero, UsuarioActual.CveUsuario, ddlcliente.SelectedValue.ToEntero, SoloSubProyectosConPermiso:=If(UsuarioActual.Empresa.Funcionalidad(530) = "1", True, False), DdlEstatus.SelectedValue.ToEntero, UsuarioActual.CveUsuario, ddlclientes.SelectedValue.ToEntero, SoloSubProyectosConPermiso:=If(UsuarioActual.Empresa.Funcionalidad(530) = "1", True, False),
CveUsuarioAsignado:=DdlUsuarioAsignado.SelectedValue.ToEntero(), EntregaDirecta:=DdlEntregaDirecta.SelectedValue.ToEntero(), TieneAnticipo:=DdlTieneAnticipo.SelectedValue.ToEntero, EsTemporal:=EsTemporal) Then CveUsuarioAsignado:=DdlUsuarioAsignado.SelectedValue.ToEntero(), EntregaDirecta:=DdlEntregaDirecta.SelectedValue.ToEntero(), TieneAnticipo:=DdlTieneAnticipo.SelectedValue.ToEntero) Then
DtPorAtender = OC.DtResultados DtPorAtender = OC.DtResultados
GvPorAtender.DataSource = DtPorAtender 'OC.DtResultados GvPorAtender.DataSource = DtPorAtender 'OC.DtResultados
@@ -255,8 +248,8 @@ Partial Class RepOC
End If End If
If OC.GetOrdenesPendientes(DdlTipo.SelectedValue.ToString, 1, UsuarioActual.CveEmpresa, DdlProyectos.SelectedValue.ToEntero, DdlSubProyectos.SelectedValue.ToEntero, If OC.GetOrdenesPendientes(DdlTipo.SelectedValue.ToString, 1, UsuarioActual.CveEmpresa, DdlProyectos.SelectedValue.ToEntero, DdlSubProyectos.SelectedValue.ToEntero,
DdlEstatus.SelectedValue.ToEntero, UsuarioActual.CveUsuario, ddlcliente.SelectedValue.ToEntero, SoloSubProyectosConPermiso:=If(UsuarioActual.Empresa.Funcionalidad(530) = "1", True, False), DdlEstatus.SelectedValue.ToEntero, UsuarioActual.CveUsuario, ddlclientes.SelectedValue.ToEntero, SoloSubProyectosConPermiso:=If(UsuarioActual.Empresa.Funcionalidad(530) = "1", True, False),
CveUsuarioAsignado:=DdlUsuarioAsignado.SelectedValue.ToEntero(), EntregaDirecta:=DdlEntregaDirecta.SelectedValue.ToEntero(), TieneAnticipo:=DdlTieneAnticipo.SelectedValue.ToEntero, EsTemporal:=EsTemporal) Then CveUsuarioAsignado:=DdlUsuarioAsignado.SelectedValue.ToEntero(), EntregaDirecta:=DdlEntregaDirecta.SelectedValue.ToEntero(), TieneAnticipo:=DdlTieneAnticipo.SelectedValue.ToEntero) Then
GvPendientes.DataSource = OC.DtResultados GvPendientes.DataSource = OC.DtResultados
DtPendiente = OC.DtResultados DtPendiente = OC.DtResultados
GvPendientes.DataBind() GvPendientes.DataBind()
@@ -373,9 +366,6 @@ Partial Class RepOC
#Region " CONSULTAR " #Region " CONSULTAR "
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles btnConsultar.Click Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles btnConsultar.Click
Dim EsTemporal As Integer = If(ChkEsTempral.Checked, 1, -1)
LbPorAtenderPDF.Visible = False LbPorAtenderPDF.Visible = False
LbPorAtender.Visible = False LbPorAtender.Visible = False
LbPendientes.Visible = False LbPendientes.Visible = False
@@ -387,16 +377,15 @@ Partial Class RepOC
Dim FI As Date = If(txtFechaI.Text.Trim = "", MinFecha, txtFechaI.Text.Trim.ToDate) Dim FI As Date = If(txtFechaI.Text.Trim = "", MinFecha, txtFechaI.Text.Trim.ToDate)
Dim FF As Date = If(txtFechaF.Text.Trim = "", MaxFecha, txtFechaF.Text.Trim.ToDate) Dim FF As Date = If(txtFechaF.Text.Trim = "", MaxFecha, txtFechaF.Text.Trim.ToDate)
FF = FF.AddDays(1) FF = FF.AddDays(1)
Dim OC As New ClsOC Dim OC As New ClsOC
If OC.GetOrdenesCompraRep(DdlTipo.SelectedValue.ToString, DdlProyectos.SelectedValue.ToEntero, DdlSubProyectos.SelectedValue.ToEntero, DDlClasificacion.SelectedValue.ToEntero, If OC.GetOrdenesCompraRep(DdlTipo.SelectedValue.ToString, DdlProyectos.SelectedValue.ToEntero, DdlSubProyectos.SelectedValue.ToEntero, DDlClasificacion.SelectedValue.ToEntero,
DdlEstatus.SelectedValue.ToEntero, FI, FF, -1, DdlProveedores.SelectedValue.ToEntero, If(txtFolio.Text.ToEntero = 0, -1, txtFolio.Text.ToEntero), ddlUsuario.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero, FI, FF, -1, DdlProveedores.SelectedValue.ToEntero, If(txtFolio.Text.ToEntero = 0, -1, txtFolio.Text.ToEntero), ddlUsuario.SelectedValue.ToEntero,
If(CheckNoCompleta.Checked, -1, UsuarioActual.CveUsuario), UsuarioActual.Empresa.CveEmpresa, If(DDlPS.SelectedValue = "", -1, DDlPS.SelectedValue.ToEntero), If(CheckNoCompleta.Checked, True, False), If(CheckNoCompleta.Checked, -1, UsuarioActual.CveUsuario), UsuarioActual.Empresa.CveEmpresa, If(DDlPS.SelectedValue = "", -1, DDlPS.SelectedValue.ToEntero), If(CheckNoCompleta.Checked, True, False),
ddlcliente.SelectedValue.ToEntero, CveActivoFijo:=DdlActivoFijo.SelectedValue.ToEntero, SoloSubProyectosConPermiso:=If(UsuarioActual.Empresa.Funcionalidad(530) = "1", True, False), ddlclientes.SelectedValue.ToEntero, CveActivoFijo:=DdlActivoFijo.SelectedValue.ToEntero, SoloSubProyectosConPermiso:=If(UsuarioActual.Empresa.Funcionalidad(530) = "1", True, False),
CveUsuarioAutorizo:=DdlUsuarioAutorizo.SelectedValue.ToEntero(), CveUsuarioAsignado:=DdlUsuarioAsignado.SelectedValue.ToEntero(), EntregaDirecta:=DdlEntregaDirecta.SelectedValue.ToEntero(), CveUsuarioAutorizo:=DdlUsuarioAutorizo.SelectedValue.ToEntero(), CveUsuarioAsignado:=DdlUsuarioAsignado.SelectedValue.ToEntero(), EntregaDirecta:=DdlEntregaDirecta.SelectedValue.ToEntero(),
CveMoneda:=DdlMoneda.SelectedValue.ToEntero(), MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero, TieneAnticipo:=DdlTieneAnticipo.SelectedValue.ToEntero, EsTemporal:=EsTemporal) Then CveMoneda:=DdlMoneda.SelectedValue.ToEntero(), MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero, TieneAnticipo:=DdlTieneAnticipo.SelectedValue.ToEntero) Then
GvConsultar.DataSource = OC.DtResultados GvConsultar.DataSource = OC.DtResultados
DtOC = OC.DtResultados DtOC = OC.DtResultados
@@ -551,15 +540,12 @@ Partial Class RepOC
Dim Clasificacion = If(DDlClasificacion.SelectedValue = "-1", "", $"&emsp;<b>Clasificación:</b>&nbsp;{DDlClasificacion.SelectedItem.Text}") Dim Clasificacion = If(DDlClasificacion.SelectedValue = "-1", "", $"&emsp;<b>Clasificación:</b>&nbsp;{DDlClasificacion.SelectedItem.Text}")
Dim Producto = If(DDlPS.SelectedValue = "-1", "", $"&emsp;<b>Producto/Servicio:</b>&nbsp;{DDlPS.SelectedText}") Dim Producto = If(DDlPS.SelectedValue = "-1", "", $"&emsp;<b>Producto/Servicio:</b>&nbsp;{DDlPS.SelectedText}")
Dim Completa As String = If(CheckNoCompleta.Checked = False, "", $"&emsp;, <b>No completa</b>&nbsp;") Dim Completa As String = If(CheckNoCompleta.Checked = False, "", $"&emsp;, <b>No completa</b>&nbsp;")
Dim Proveedor = If(DdlProveedores.SelectedValue = "-1", "", $"&emsp;<b>Proveedor:</b>&nbsp;{DdlProveedores.txtText.Value }") Dim Proveedor = If(DdlProveedores.SelectedValue = "-1", "", $"&emsp;<b>Proveedor:</b>&nbsp;{DdlProveedores.txtText.Value}")
Dim Cliente = If(ddlcliente.SelectedValue = "-1", "", $"&emsp;<b>Cliente:</b>&nbsp;{ddlcliente.SelectedItem.Text}") Dim Cliente = If(ddlclientes.SelectedValue = "-1", "", $"&emsp;<b>Cliente:</b>&nbsp;{ddlclientes.txtText.Value}")
Dim TieneAnticipo As String = If(DdlTieneAnticipo.SelectedValue.ToEntero = -1, "", $"&emsp;<b>Anticpo:</b>&nbsp;{DdlTieneAnticipo.SelectedItem.Text}") Dim TieneAnticipo As String = If(DdlTieneAnticipo.SelectedValue.ToEntero = -1, "", $"&emsp;<b>Anticpo:</b>&nbsp;{DdlTieneAnticipo.SelectedItem.Text}")
If DtPorAtender IsNot Nothing AndAlso DtPorAtender.Rows.Count > 0 Then If DtPorAtender IsNot Nothing AndAlso DtPorAtender.Rows.Count > 0 Then
Dim Cantidad As Integer = DtOC.COUNT("CveOrdenCompra") Dim Cantidad As Integer = DtOC.COUNT("CveOrdenCompra")
Dim TotalPesos As Double = DtOC.SUM("Total", "CveMoneda = 1") Dim TotalPesos As Double = DtOC.SUM("Total", "CveMoneda = 1")
Dim TotalDolares As Double = DtOC.SUM("Total", "CveMoneda = 2") Dim TotalDolares As Double = DtOC.SUM("Total", "CveMoneda = 2")

View File

@@ -5639,15 +5639,18 @@
<div class="row"> <div class="row">
<div class="col-md-6 pull-right" style="text-align: right;"> <div class="col-md-6 pull-right" style="text-align: right;">
Importe total: Importe total:
<asp:TextBox Text="" ID="TxtSaldoImportar" ClientIDMode="Static" Enabled="false" runat="server" /> <asp:TextBox Text="" ID="TxtSaldoImportar" ClientIDMode="Static" Enabled="false" runat="server" />
</div> </div>
</div>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right" runat="server" id="DVBusquedaImportarSaldos" visible="false">
<input type="text" id="TxtBusquedaImportarSaldos" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaImportarSaldos','{0}')", GvImportarSaldos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaImportarSaldos','{0}')", GvImportarSaldos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div> </div>
<br />
<div class="row"> <div class="row">
<div style="height: 300px; overflow-y: auto;"> <div style="height: 300px; overflow-y: auto;">
<asp:GridView ID="GvImportarSaldos" DataKeyNames="CveIE, CveCliente,Total,IVA,Original,PorcentajeIVA,Tipo,CveVenta" AutoGenerateColumns="false" GridLines="None" CssClass="table table-striped table-hover Widthall" runat="server"> <asp:GridView ID="GvImportarSaldos" DataKeyNames="CveIE, CveCliente,Total,IVA,Original,PorcentajeIVA,Tipo,CveVenta" AutoGenerateColumns="false" GridLines="None"
CssClass="table table-striped table-hover Widthall" runat="server">
<Columns> <Columns>
<asp:TemplateField ItemStyle-Width="5%"> <asp:TemplateField ItemStyle-Width="5%">
<ItemTemplate> <ItemTemplate>

View File

@@ -1302,9 +1302,13 @@ Partial Class Ventas_ClientesAbonar
Dim StrMsg As New StringBuilder Dim StrMsg As New StringBuilder
StrMsg.AppendFormat("Abono Registrado Correctamente. Folio <b><a href='/Bancos/IE.aspx?CveIE={0}' target='_blank' class='Texto'>{1}</a></b> <br/>", CveIE, ObjIE.Folio) StrMsg.AppendFormat("Abono Registrado Correctamente. Folio <b><a href='/Bancos/IE.aspx?CveIE={0}' target='_blank' class='Texto'>{1}</a></b> <br/>", CveIE, ObjIE.Folio)
If IDPoliza > 0 Then StrMsg.AppendFormat("Poliza: <a href='/Contabilidad/RegPoliza.aspx?IdPoliza={0}' target='_blank' class='Texto'>{1}</a> <br/>", IDPoliza, FolioPoliza) If UsuarioActual.TienePermisoProceso(354) Then 'visualizar la póliza al registros
StrMsg.AppendFormat("<br/><a Class=""Texto"" target='_blank' href=""/Contabilidad/RegPrePolizaS.aspx?CvePrePoliza={0}"">Ver Póliza</a>&nbsp;&nbsp; ", CvePrePoliza)
Dim TempParametros As String = Encripta(String.Format("OP=PREPO&CvePrePoliza={0}", CvePrePoliza))
StrMsg.Append($" <a class='Texto' target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={TempParametros}""> <i class='fa fa-file-pdf-o' aria-hidden='true'></i> Imprimir </a>")
End If
Dim TextoComplementoPago As String = EmitirComplementoPago(CveIE, CveVentasPago, SeriesPago) If IDPoliza > 0 Then StrMsg.AppendFormat("Poliza: <a href='/Contabilidad/RegPoliza.aspx?IdPoliza={0}' target='_blank' class='Texto'>{1}</a> <br/>", IDPoliza, FolioPoliza)
For Each RespuestaNotaCredito As RespuestaNotaCredrito In NCGeneradas For Each RespuestaNotaCredito As RespuestaNotaCredrito In NCGeneradas
If RespuestaNotaCredito IsNot Nothing AndAlso RespuestaNotaCredito.Respuesta IsNot Nothing Then If RespuestaNotaCredito IsNot Nothing AndAlso RespuestaNotaCredito.Respuesta IsNot Nothing Then
@@ -1321,7 +1325,12 @@ Partial Class Ventas_ClientesAbonar
StrMsg.AppendFormat("Nota de crédito generada correctamente.<br/><br/> Folio: <a href='/Ventas/Ventas.aspx?CveVenta={0}' target='_blank' class='Texto'>{1}</a><br/>", RespuestaNotaCredito.Respuesta.CveVenta, RespuestaNotaCredito.Respuesta.SerieFolio) StrMsg.AppendFormat("Nota de crédito generada correctamente.<br/><br/> Folio: <a href='/Ventas/Ventas.aspx?CveVenta={0}' target='_blank' class='Texto'>{1}</a><br/>", RespuestaNotaCredito.Respuesta.CveVenta, RespuestaNotaCredito.Respuesta.SerieFolio)
End If End If
Next Next
Alert($"{StrMsg.ToString}<br/><br/>{TextoComplementoPago}", TipoMensaje.MsgInformacion, If(ChkSeguirRegistrando.Checked, "location.href =""#""", "location.href =""/Bancos/RepCxCCliente.aspx"""))
If ChkComplementoPago.Checked Then
Dim TextoComplementoPago As String = EmitirComplementoPago(CveIE, CveVentasPago, SeriesPago)
StrMsg.AppendFormat("<br/><br/>{0}", TextoComplementoPago)
End If
Alert(StrMsg.ToString, TipoMensaje.MsgInformacion, If(ChkSeguirRegistrando.Checked, "location.href =""#""", "location.href =""/Bancos/RepCxCCliente.aspx"""))
Else Else
If ObjConta IsNot Nothing Then ObjConta.RollBack() If ObjConta IsNot Nothing Then ObjConta.RollBack()

View File

@@ -31,12 +31,16 @@ Partial Class Ventas_Promociones
Private Property CvePromocion As Integer Private Property CvePromocion As Integer
Get Get
If ViewState("CvePromocion") Is Nothing Then
ViewState("CvePromocion") = -1
End If
Return ViewState("CvePromocion").ToString.ToEntero Return ViewState("CvePromocion").ToString.ToEntero
End Get End Get
Set(value As Integer) Set(value As Integer)
ViewState("CvePromocion") = value ViewState("CvePromocion") = value
End Set End Set
End Property End Property
Private Property CveConsecutivo As Integer Private Property CveConsecutivo As Integer
Get Get
Return ViewState("CveConsecutivo").ToString.ToEntero Return ViewState("CveConsecutivo").ToString.ToEntero
@@ -108,6 +112,19 @@ Partial Class Ventas_Promociones
End Set End Set
End Property End Property
Private Property ReqAutorizacion As Boolean
Get
If ViewState("ReqAutorizacion") Is Nothing Then
ViewState("ReqAutorizacion") = False
End If
Return Boolean.Parse(ViewState("ReqAutorizacion").ToString)
End Get
Set(value As Boolean)
ViewState("ReqAutorizacion") = value
End Set
End Property
Private Property BloqueadoPromocionPorcentaje As Boolean Private Property BloqueadoPromocionPorcentaje As Boolean
Get Get
@@ -181,7 +198,7 @@ Partial Class Ventas_Promociones
ChkEstatus.Enabled = False ChkEstatus.Enabled = False
End If End If
If ChkEstatus.Checked = True And Not PermisoAutorizPromocionPorcentaje Then If (ChkEstatus.Checked = True And Not PermisoAutorizPromocionPorcentaje) Or (ReqAutorizacion And Not PermisoAutorizPromocionPorcentaje) Then
BtnGuardar.Visible = False BtnGuardar.Visible = False
ButBtnEliminar.Visible = False ButBtnEliminar.Visible = False
End If End If
@@ -433,6 +450,7 @@ Partial Class Ventas_Promociones
DdlMarca.SelectedValue = Dr("CveMarca").ToString DdlMarca.SelectedValue = Dr("CveMarca").ToString
LblUsuario.Text = Dr("Usuario").ToString LblUsuario.Text = Dr("Usuario").ToString
LblFechaIng.Text = Dr("FechaIng").ToString.ToDate.ToString("dd/MM/yyyy") LblFechaIng.Text = Dr("FechaIng").ToString.ToDate.ToString("dd/MM/yyyy")
If Dr("CveVendedor").ToString.ToEntero > 0 Then DdlVendedor.SelectedValue = Dr("CveVendedor").ToString If Dr("CveVendedor").ToString.ToEntero > 0 Then DdlVendedor.SelectedValue = Dr("CveVendedor").ToString
If Dr("CveCliente").ToString.ToEntero > 0 Then If Dr("CveCliente").ToString.ToEntero > 0 Then
@@ -455,6 +473,8 @@ Partial Class Ventas_Promociones
CvePromocionPadre = If(Dr("CvePromocionPadre").ToString.ToEntero > 0, Dr("CvePromocionPadre").ToString.ToEntero, -1) CvePromocionPadre = If(Dr("CvePromocionPadre").ToString.ToEntero > 0, Dr("CvePromocionPadre").ToString.ToEntero, -1)
ReqAutorizacion = Boolean.Parse(Dr("ReqAutorizacion").ToString)
If ObjVentas.GetPromocionesDetalle(CvePromocion, UsuarioActual.CveEmpresa) Then If ObjVentas.GetPromocionesDetalle(CvePromocion, UsuarioActual.CveEmpresa) Then
TempDT = ObjVentas.DtResultados.Copy TempDT = ObjVentas.DtResultados.Copy
TempDTOriginal = ObjVentas.DtResultados.Copy TempDTOriginal = ObjVentas.DtResultados.Copy
@@ -727,6 +747,9 @@ Partial Class Ventas_Promociones
If (Not PermisoAutorizPromocionPorcentaje) AndAlso BloqueadoPromocionPorcentaje AndAlso Bloquear Then If (Not PermisoAutorizPromocionPorcentaje) AndAlso BloqueadoPromocionPorcentaje AndAlso Bloquear Then
ChkEstatus.Checked = False ChkEstatus.Checked = False
ChkEstatus.Enabled = False ChkEstatus.Enabled = False
If CvePromocion <= 0 Then
ReqAutorizacion = True
End If
End If End If
UpGenerales.Update() UpGenerales.Update()
@@ -833,7 +856,8 @@ Partial Class Ventas_Promociones
ObjVentas.IniciaTransacSQL() ObjVentas.IniciaTransacSQL()
CvePromocion = ObjVentas.AddPromociones(TxtPromocion.Text.Trim, If(IsDate(TxtFechaI.Text), TxtFechaI.Text.ToDate, MinFecha), If(IsDate(TxtFechaF.Text), TxtFechaF.Text.ToDate, MaxFecha), CvePromocion = ObjVentas.AddPromociones(TxtPromocion.Text.Trim, If(IsDate(TxtFechaI.Text), TxtFechaI.Text.ToDate, MinFecha), If(IsDate(TxtFechaF.Text), TxtFechaF.Text.ToDate, MaxFecha),
DdlVendedor.SelectedValue.ToEntero, CveCliente, ChkEstatus.Checked, DdlMoneda.SelectedValue.ToEntero, UsuarioActual.CveUsuario, DdlVendedor.SelectedValue.ToEntero, CveCliente, ChkEstatus.Checked, DdlMoneda.SelectedValue.ToEntero, UsuarioActual.CveUsuario,
UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero, DdlTipoAplicacion.SelectedValue.ToString, DdlMarca.SelectedValue.ToEntero, DdlDistribuidor.SelectedValue.ToEntero) UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero, DdlTipoAplicacion.SelectedValue.ToString, DdlMarca.SelectedValue.ToEntero, DdlDistribuidor.SelectedValue.ToEntero,
ReqAutorizacion:=ReqAutorizacion)
If CvePromocion > 0 Then If CvePromocion > 0 Then
For Each Dr As DataRow In TempDT.Rows For Each Dr As DataRow In TempDT.Rows