-- mejoras registro de compras E189, RNC
This commit is contained in:
@@ -672,7 +672,7 @@
|
||||
<th style="width: 15px">#</th>
|
||||
<th style="width: 45px">Cant</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>
|
||||
|
||||
@@ -682,7 +682,7 @@
|
||||
</span>
|
||||
<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>
|
||||
<th style="width: 350px">Observación</th>
|
||||
<th style="width: 300px">Observación</th>
|
||||
<th style="width: 150px">
|
||||
<asp:Label ID="LitHProyecto" runat="server" Text=""></asp:Label>
|
||||
<asp:Label runat="server" ID="LblSubProyectoHeader" Text=""></asp:Label>
|
||||
@@ -772,7 +772,7 @@
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%-- 3 --%>
|
||||
<asp:TemplateField ItemStyle-VerticalAlign="Top" ItemStyle-Width="299">
|
||||
<asp:TemplateField ItemStyle-VerticalAlign="Top" ItemStyle-Width="349">
|
||||
<ItemTemplate>
|
||||
<div style="float: left; width: 100%;">
|
||||
<span style="width: 100%; border-bottom: 1px solid gray;">
|
||||
@@ -785,7 +785,7 @@
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%-- 4 --%>
|
||||
<asp:BoundField DataField="Obs" ItemStyle-Width="350px" />
|
||||
<asp:BoundField DataField="Obs" ItemStyle-Width="300px" />
|
||||
<%-- 5 --%>
|
||||
<asp:TemplateField ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
|
||||
@@ -1907,8 +1907,8 @@ Partial Class Compras_Compras
|
||||
SubTotalConceptos = TmpDT.SUMD("Total").RoundSQL
|
||||
|
||||
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("AplicaCaducidad") Then TmpDT.Columns.Add("AplicaCaducidad", 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(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("FechaCaducidad") Then TmpDT.Columns.Add("FechaCaducidad", GetType(Date))
|
||||
|
||||
@@ -3154,36 +3154,34 @@ Partial Class Compras_Compras
|
||||
|
||||
'VINCULACIÓN OC - NUEVA DICIEMBRE 2015
|
||||
If dr("OCVinculada").ToString() <> "" Then
|
||||
Dim DtOCs As New DataTable
|
||||
|
||||
Dim OCS As String = "", CveOCS As String = ""
|
||||
|
||||
DtOCs.Columns.Add("FolioOC", GetType(Integer))
|
||||
Dim DtOCs As New DataTable
|
||||
DtOCs.Columns.Add("SerieFolioOC", GetType(String))
|
||||
DtOCs.Columns.Add("CveOrdenCompra", GetType(Integer))
|
||||
|
||||
|
||||
For Each drt As DataRow In TmpDT.Rows
|
||||
If drt("FolioOC").ToString <> "" Then
|
||||
DtOCs.Columns.Add("Fecha", GetType(Date))
|
||||
DtOCs.Columns.Add("Descripcion", GetType(String))
|
||||
For Each drt As DataRow In TmpDT.FiltraParametros("", "", {"SerieFolioOC", "CveOrdenCompra"}).Rows
|
||||
If drt("SerieFolioOC").ToString <> "" Then
|
||||
Dim DrOC As DataRow = DtOCs.NewRow
|
||||
DrOC("FolioOC") = drt("FolioOC").ToString
|
||||
DrOC("SerieFolioOC") = drt("SerieFolioOC").ToString
|
||||
DrOC("CveOrdenCompra") = drt("CveOrdenCompra").ToString
|
||||
DtOCs.Rows.Add(DrOC)
|
||||
End If
|
||||
Next
|
||||
|
||||
DtOCs = DtOCs.FiltraParametros("", "", {"FolioOC", "CveOrdenCompra"})
|
||||
DtOCs.Columns.Add("Fecha", GetType(Date))
|
||||
DtOCs.Columns.Add("Descripcion", GetType(String))
|
||||
|
||||
If DtOCs.Rows.Count > 0 Then
|
||||
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
|
||||
If ObjOC.DtResultados.Rows.Count = 1 Then
|
||||
OCS += If(OCS <> "", String.Format(",{0}", drt("FolioOC").ToString), drt("FolioOC").ToString)
|
||||
CveOCS += If(CveOCS <> "", String.Format(",{0}", drt("CveOrdenCompra").ToString), drt("CveOrdenCompra").ToString)
|
||||
drt("Fecha") = ObjOC.DtResultados.FiltroPrimeroValor("FechaIng")
|
||||
drt("Descripcion") = ObjOC.DtResultados.FiltroPrimeroValor("Descripcion")
|
||||
End If
|
||||
End If
|
||||
OCS += If(OCS <> "", String.Format(",{0}", drt("SerieFolioOC").ToString), drt("SerieFolioOC").ToString)
|
||||
CveOCS += If(CveOCS <> "", String.Format(",{0}", drt("CveOrdenCompra").ToString), drt("CveOrdenCompra").ToString)
|
||||
'If ObjOC.GetOrdenesCompraRep("OC", -1, -1, -1, -1, MinFecha, MaxFecha, drt("CveOrdenCompra").ToString.ToEntero, CveProveedor, -1, -1, -1, UsuarioActual.CveEmpresa, -1) Then
|
||||
' If ObjOC.DtResultados.Rows.Count = 1 Then
|
||||
' OCS += If(OCS <> "", String.Format(",{0}", drt("FolioOC").ToString), drt("FolioOC").ToString)
|
||||
' CveOCS += If(CveOCS <> "", String.Format(",{0}", drt("CveOrdenCompra").ToString), drt("CveOrdenCompra").ToString)
|
||||
' drt("Fecha") = ObjOC.DtResultados.FiltroPrimeroValor("FechaIng")
|
||||
' drt("Descripcion") = ObjOC.DtResultados.FiltroPrimeroValor("Descripcion")
|
||||
' End If
|
||||
'End If
|
||||
Next
|
||||
End If
|
||||
|
||||
@@ -4301,7 +4299,7 @@ Partial Class Compras_Compras
|
||||
|
||||
Dim AnioFactura As Integer = TxtFecha.Text.ToDate.Year
|
||||
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)
|
||||
Exit Sub
|
||||
End If
|
||||
@@ -7752,8 +7750,8 @@ Partial Class Compras_Compras
|
||||
|
||||
If CveMovimientoInventario > 0 Then
|
||||
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=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Entrada Almacen</a>", TempParametros)
|
||||
Msg.AppendFormat("</br><a class=""Texto"" target='_blank' href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"">Ver Movimiento de Almacen</a> ", CveMovimientoInventario)
|
||||
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
|
||||
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
|
||||
@@ -11087,7 +11085,7 @@ Partial Class Compras_Compras
|
||||
|
||||
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("tb_remove();")
|
||||
|
||||
@@ -11141,29 +11139,26 @@ Partial Class Compras_Compras
|
||||
#Region " ALMACEN "
|
||||
Private Sub CargaGvInv()
|
||||
|
||||
|
||||
If Not TmpDT.Columns.Contains("UUIDRow") Then
|
||||
TmpDT.Columns.Add("UUIDRow", GetType(String))
|
||||
End If
|
||||
If Not TmpDT.Columns.Contains("UUIDRow") Then TmpDT.Columns.Add("UUIDRow", GetType(String))
|
||||
|
||||
For Each dRow As DataRow In TmpDT.Rows
|
||||
If dRow("UUIDRow").ToString.Trim = "" Then
|
||||
dRow("UUIDRow") = Guid.NewGuid().ToString()
|
||||
End If
|
||||
Dim CvePS As Integer = dRow("CvePS").ToString.ToEntero
|
||||
'Dim CvePS As Integer = dRow("CvePS").ToString.ToEntero
|
||||
|
||||
dRow("AplicaLote") = False
|
||||
dRow("AplicaCaducidad") = False
|
||||
'dRow("AplicaLote") = False
|
||||
'dRow("AplicaCaducidad") = False
|
||||
|
||||
If CvePS > 0 Then
|
||||
Dim drPS As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimero($"CvePS={CvePS}")
|
||||
If drPS IsNot Nothing Then
|
||||
dRow("AplicaLote") = If(drPS("AplicaLote").ToString = "", False, Boolean.Parse(drPS("AplicaLote").ToString))
|
||||
dRow("AplicaCaducidad") = If(drPS("AplicaCaducidad").ToString = "", False, Boolean.Parse(drPS("AplicaCaducidad").ToString))
|
||||
'Boolean.Parse(GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("AplicaCaducidad", $"CvePS={CvePS}"))
|
||||
End If
|
||||
'If CvePS > 0 Then
|
||||
' Dim drPS As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
|
||||
' If drPS IsNot Nothing Then
|
||||
' dRow("AplicaLote") = If(drPS("AplicaLote").ToString = "", False, Boolean.Parse(drPS("AplicaLote").ToString))
|
||||
' dRow("AplicaCaducidad") = If(drPS("AplicaCaducidad").ToString = "", False, Boolean.Parse(drPS("AplicaCaducidad").ToString))
|
||||
' 'Boolean.Parse(GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("AplicaCaducidad", $"CvePS={CvePS}"))
|
||||
' End If
|
||||
|
||||
End If
|
||||
'End If
|
||||
|
||||
Next
|
||||
TmpDT.AcceptChanges()
|
||||
@@ -11175,16 +11170,14 @@ Partial Class Compras_Compras
|
||||
DtInv = TmpDT.FiltraParametros(String.Format("CveTipoPS = 2")).Copy
|
||||
End If
|
||||
|
||||
|
||||
For Each dRow As DataRow In DtInv.Rows
|
||||
|
||||
'Dim CvePS As Integer = dRow("CvePS").ToString.ToEntero
|
||||
Dim AplicaLote As Boolean = Boolean.Parse(dRow("AplicaLote").ToString) 'Boolean.Parse(GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("AplicaLote", $"CvePS={CvePS}"))
|
||||
Dim AplicaCaducidad As Boolean = Boolean.Parse(dRow("AplicaCaducidad").ToString) 'Boolean.Parse(GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("AplicaCaducidad", $"CvePS={CvePS}"))
|
||||
Dim AplicaLote As Boolean = False
|
||||
Boolean.TryParse(dRow("AplicaLote").ToString, AplicaLote)
|
||||
Dim AplicaCaducidad As Boolean = False
|
||||
Boolean.TryParse(dRow("AplicaCaducidad").ToString, AplicaCaducidad)
|
||||
|
||||
GvInv.Columns(7).Visible = AplicaLote
|
||||
GvInv.Columns(8).Visible = AplicaCaducidad
|
||||
|
||||
Next
|
||||
|
||||
GvInv.DataSource = DtInv
|
||||
@@ -11254,25 +11247,10 @@ Partial Class Compras_Compras
|
||||
Protected Sub GVINV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvInv.RowDataBound
|
||||
|
||||
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
|
||||
|
||||
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 AplicaLote Then e.Row.FCTextBox("TxtLote").Visible = True
|
||||
If AplicaCaducidad Then
|
||||
Dim DvFechaCaducidad As HtmlGenericControl = TryCast(e.Row.FindControl("DvFechaCaducidad"), HtmlGenericControl)
|
||||
DvFechaCaducidad.Visible = True
|
||||
@@ -11283,6 +11261,13 @@ Partial Class Compras_Compras
|
||||
Dim StrTipo As String = "CveTipoAlmacen IN (1,2,7,14,19)"
|
||||
If DdlTipoCompra.SelectedValue.Contiene("9", "12") Then StrTipo = "CveTipoAlmacen IN (21)"
|
||||
If EsDevolucionApoyoLogistico Then StrTipo = "CveTipoAlmacen = 27"
|
||||
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 (" & DttoString(dttt, "CveSubProyecto") & ") "
|
||||
End If
|
||||
End If
|
||||
e.Row.FCDropDownList("ddlEAlmacen").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros(StrTipo)
|
||||
|
||||
e.Row.FCDropDownList("ddlEAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
@@ -11303,7 +11288,6 @@ Partial Class Compras_Compras
|
||||
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").Text = If(e.Row.DBCampo("CantidadF").ToString.ToDecimal > e.Row.DBCampo("Cantidad").ToString.ToDecimal, e.Row.DBCampo("Cantidad"), e.Row.DBCampo("CantidadF"))
|
||||
|
||||
End If
|
||||
|
||||
'SIEMPRE ENABLED FALSE
|
||||
@@ -11336,10 +11320,14 @@ Partial Class Compras_Compras
|
||||
'que no sea recepcion alamcen adelantado. DdlOCVinculaInv
|
||||
If (UsuarioActual.Empresa.Funcionalidad(567) = "1" OrElse UsuarioActual.TienePermisoProceso(121)) AndAlso DdlOCVinculaInv.SelectedValue <> "176" 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
|
||||
ddlAlmacenConsignacion_SelectedIndexChanged(e.Row.FCDropDownList("ddlEAlmacen"), Nothing)
|
||||
CambiaTotalDevengar(Nothing, Nothing)
|
||||
'ddlAlmacenConsignacion_SelectedIndexChanged(e.Row.FCDropDownList("ddlEAlmacen"), Nothing)
|
||||
' CambiaTotalDevengar(Nothing, Nothing)
|
||||
End If
|
||||
End If
|
||||
If e.Row.DBCampo("Consec").ToEntero = 0 Then e.Row.BackColor = Drawing.Color.PaleGreen
|
||||
@@ -11388,17 +11376,6 @@ Partial Class Compras_Compras
|
||||
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
|
||||
'If e.Row.DBCampo("CvePS").ToString.ToEntero > 0 Then
|
||||
@@ -11453,6 +11430,14 @@ Partial Class Compras_Compras
|
||||
If DdlTipoCompra.SelectedValue.ToEntero = 10 Then StrAlmacenes = $"Modalidad = 0"
|
||||
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 (" & DttoString(dttt, "CveSubProyecto") & ") "
|
||||
End If
|
||||
End If
|
||||
|
||||
e.Row.FCDropDownList("ddlAlmacen").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros(StrAlmacenes)
|
||||
e.Row.FCDropDownList("ddlAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
e.Row.FCDropDownList("ddlAlmacen").DataBind()
|
||||
@@ -11469,7 +11454,11 @@ Partial Class Compras_Compras
|
||||
'que no sea recepcion almacen adelantado. DdlOCVinculaInv
|
||||
If (UsuarioActual.Empresa.Funcionalidad(567) = "1" OrElse UsuarioActual.TienePermisoProceso(121)) AndAlso DdlOCVinculaInv.SelectedValue <> "176" 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
|
||||
End If
|
||||
End If
|
||||
@@ -11477,6 +11466,13 @@ Partial Class Compras_Compras
|
||||
|
||||
End Sub
|
||||
|
||||
Public Function DttoString(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
|
||||
|
||||
Protected Sub ddlAlmacen_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
|
||||
Dim Ddl As DropDownList = CType(sender, DropDownList)
|
||||
|
||||
@@ -12122,7 +12118,7 @@ Partial Class Compras_Compras
|
||||
End Sub
|
||||
|
||||
Protected Sub CambiaTotalDevengar(sender As Object, e As EventArgs)
|
||||
CalculaTotalPorDevengar()
|
||||
If UsuarioActual.Empresa.UsaAC Then CalculaTotalPorDevengar()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
@@ -15484,6 +15480,8 @@ Partial Class Compras_Compras
|
||||
AjusteProntoPagoPorcentajeIVA = TmpDT.MAX("IVAPorcentaje").ToDecimal
|
||||
AjusteProntoPagoConIVA = (ImporteCompraConIVA - ImporteOCConIVA)
|
||||
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
|
||||
Vinculacion()
|
||||
@@ -15505,9 +15503,9 @@ Partial Class Compras_Compras
|
||||
|
||||
For Each gvr As GridViewRow In GvOC1.Rows
|
||||
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
|
||||
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
|
||||
Next
|
||||
|
||||
@@ -15534,7 +15532,6 @@ Partial Class Compras_Compras
|
||||
End Sub
|
||||
Private Sub Vinculacion(Optional VinculacionCompleta As Boolean = False)
|
||||
|
||||
|
||||
'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
|
||||
@@ -15596,6 +15593,7 @@ Partial Class Compras_Compras
|
||||
Dim PU As Decimal = gvr.FCTextBox("TxtPU").Text.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 = gvr.FCTextBox("TxtTotalOC1").Text.ToDecimal
|
||||
'Dim IVA As Decimal = gvr.FCHiddenField("HdnOC1IVA").Value.ToDecimal
|
||||
'Dim RetIVA As Double = gvr.FCHiddenField("HdnOC1RetIVA").Value.ToDecimal
|
||||
@@ -15627,6 +15625,12 @@ Partial Class Compras_Compras
|
||||
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,
|
||||
CantidadF:=CantidadF, EntregaDirecta:=EntregaDirecta, CveSATPS:=CveSATPS, CveTipoGasto:=CveTipoGasto, TipoGasto:=TipoGasto, CveContratoDetalle:=CveContratoDetalle, CveCultivoCuadroDetalle:=CveCultivoCuadroDetalle, CveSATPSActualizado:=CveSATPSActualizado)
|
||||
|
||||
@@ -15640,7 +15644,7 @@ Partial Class Compras_Compras
|
||||
TmpDT.Rows(Index)("CveClasificacionOG") = dr("CveClasificacionOG").ToString.ToEntero
|
||||
|
||||
'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
|
||||
If CveAF <> "" AndAlso CveAF <> "-1" Then
|
||||
@@ -15657,7 +15661,7 @@ Partial Class Compras_Compras
|
||||
IndexTmpOriginal += 1
|
||||
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
|
||||
If CvePS_RNC = 0 Then
|
||||
@@ -15689,8 +15693,8 @@ Partial Class Compras_Compras
|
||||
|
||||
Dim UM As String = PSRow("UnidadMedida").ToString
|
||||
|
||||
If AjusteProntoPagoConIVA > 0 Then
|
||||
AddPS(1, CveUM, UM, CveClasificacion, Clasificacion, CvePS_RNC, PS, 1, CveSubProyectoPrincipal.ToString, SubProyecto, "", "-1", "", AjusteProntoPagoConIVA, AjusteProntoPagoConIVA, AjusteProntoPagoPorcentajeIVA, 0, 0, 0, 0, 0)
|
||||
If ImporteRNC > 0 Then
|
||||
AddPS(1, CveUM, UM, CveClasificacion, Clasificacion, CvePS_RNC, PS, 1, CveSubProyectoPrincipal.ToString, SubProyecto, "", "-1", "", ImporteRNC, ImporteRNC, AjusteProntoPagoPorcentajeIVA, 0, 0, 0, 0, 0)
|
||||
End If
|
||||
|
||||
If AjusteProntoPagoSinIVA > 0 Then
|
||||
@@ -15698,14 +15702,13 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
AddPS2(False)
|
||||
CompraEstaVinculadaOC = True
|
||||
'AddPS2(False)
|
||||
|
||||
'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(TxtSubTotal2.Text.ToDecimal + TxtOtrosImpuestos.Text.ToDecimal - (TmpDT.SUM("Total").ToString.ToDecimal))
|
||||
|
||||
|
||||
BtnGuardar.Enabled = True
|
||||
If Not CierrePeriodo Then
|
||||
BtnGuardar.Visible = True
|
||||
@@ -15804,9 +15807,7 @@ Partial Class Compras_Compras
|
||||
|
||||
End If
|
||||
|
||||
|
||||
CalculaTotales()
|
||||
CompraEstaVinculadaOC = True
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -16917,8 +16918,9 @@ Partial Class Compras_Compras
|
||||
Private Sub CargaSerie()
|
||||
|
||||
Dim AplicaCaducidad As Boolean = False
|
||||
If GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerieLote).Rows(0) IsNot Nothing Then
|
||||
AplicaCaducidad = If(GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerieLote).Rows(0)("AplicaCaducidad").ToString = "True", True, False)
|
||||
Dim drr As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePSSerieLote).FiltroPrimero("")
|
||||
If drr IsNot Nothing Then
|
||||
AplicaCaducidad = If(drr("AplicaCaducidad").ToString = "True", True, False)
|
||||
End If
|
||||
|
||||
If AplicaCaducidad Then
|
||||
@@ -16969,7 +16971,7 @@ Partial Class Compras_Compras
|
||||
Protected Sub BtnAgregarPS_Click(sender As Object, e As EventArgs)
|
||||
Dim SerieLote As String = TxtSerieLote.Text.Replace(" ", String.Empty)
|
||||
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"
|
||||
|
||||
'VALIDA QUE LA SERIE NO SEA IGUAL AL CODIGO O CODIGOBARRAS
|
||||
@@ -21992,7 +21994,7 @@ Partial Class Compras_Compras
|
||||
.NombreProveedor = NombreProveedor,
|
||||
.Fecha = Fecha,
|
||||
.CveMoneda = CveMoneda,
|
||||
.Serie = If(EsDRMN, $"DRNC-{Serie}", Serie),
|
||||
.Serie = $"D-{Serie}",
|
||||
.Folio = Folio,
|
||||
.CveCompraAmortizacion = CveCompraRegistrada
|
||||
}
|
||||
@@ -22849,23 +22851,15 @@ Public Class ClsCompraManagerCompras
|
||||
TmpDT.Columns.Add("CveSATPSActualizado")
|
||||
SubTotalConceptos = TmpDT.SUMD("Total").RoundSQL
|
||||
|
||||
If Not TmpDT.Columns.Contains("Amortizacion") Then
|
||||
TmpDT.Columns.Add("Amortizacion", GetType(Decimal))
|
||||
End If
|
||||
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("AplicaLote", GetType(Boolean))
|
||||
End If
|
||||
If Not TmpDT.Columns.Contains("AplicaCaducidad") Then
|
||||
TmpDT.Columns.Add("AplicaCaducidad", GetType(Boolean))
|
||||
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
|
||||
If Not TmpDT.Columns.Contains("AplicaCaducidad") Then TmpDT.Columns.Add("AplicaCaducidad", GetType(Boolean))
|
||||
|
||||
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))
|
||||
|
||||
'VALIDA QUE EL XML SI VIENE CON EL CODIGO SAT 01010101
|
||||
Dim ProductosCodigoSATNoPermitidos As New StringBuilder("")
|
||||
@@ -22875,7 +22869,6 @@ Public Class ClsCompraManagerCompras
|
||||
|
||||
If ProductosCodigoSATNoPermitidos.ToString.Length > 0 Then
|
||||
Errores.AppendLine($"El comprobante contiene productos con código SAT '01010101', revise los productos:</br></br>{ProductosCodigoSATNoPermitidos.ToString}")
|
||||
|
||||
End If
|
||||
Else
|
||||
GuardaLog($"Error al cargar detalles GetFacturasComparacionXML.")
|
||||
|
||||
Reference in New Issue
Block a user