This commit is contained in:
2024-08-19 10:55:13 -07:00
4 changed files with 53 additions and 17 deletions

View File

@@ -30,6 +30,7 @@ Public Class ClsOC
Public Property CveOrdenCompra As Integer Public Property CveOrdenCompra As Integer
Public Property CveOrdenCompraDetalle As Integer Public Property CveOrdenCompraDetalle As Integer
Public Property Folio As Integer Public Property Folio As Integer
Public Property SerieFolio As String = ""
Public Property Serie As String = "" Public Property Serie As String = ""
Public Property CveIEAnticipo As Integer Public Property CveIEAnticipo As Integer
Public Property CveProveedorAnticipo As Integer Public Property CveProveedorAnticipo As Integer
@@ -609,6 +610,7 @@ Public Class ClsOC
Dim dr As DataRow = Data.Rows(0) Dim dr As DataRow = Data.Rows(0)
_CveOrdenCompra = dr("CveOrdenCompra").ToString.ToEntero _CveOrdenCompra = dr("CveOrdenCompra").ToString.ToEntero
_Folio = dr("Folio").ToString.ToEntero _Folio = dr("Folio").ToString.ToEntero
_SerieFolio = dr("SerieFolio").ToString
_Serie = dr("Serie").ToString _Serie = dr("Serie").ToString
_CveIEAnticipo = dr("CveIEAnticipo").ToString.ToEntero _CveIEAnticipo = dr("CveIEAnticipo").ToString.ToEntero
_FolioIEAnticipo = dr("FolioIEAnticipo").ToString.ToEntero _FolioIEAnticipo = dr("FolioIEAnticipo").ToString.ToEntero

View File

@@ -6705,26 +6705,38 @@ Partial Class Compras_Compras
End If End If
Next Next
Dim importeMNTemp As Decimal = 0
Dim CveCompraAmortizacion As Integer = -1
For Each Gvr As GridViewRow In GVNCInvAlmacen.Rows For Each Gvr As GridViewRow In GVNCInvAlmacen.Rows
If Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble > 0 Then If Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble > 0 Then
Dim importeMNTemp As Decimal = 0
If Not ObjCompras.ComprasDetalleDevolucionesAdd(Gvr.DataKey("CveCompraDetalle").ToEntero, CveCompra, Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble, UsuarioActual.CveEmpresa) Then If Not ObjCompras.ComprasDetalleDevolucionesAdd(Gvr.DataKey("CveCompraDetalle").ToEntero, CveCompra, Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble, UsuarioActual.CveEmpresa) Then
ErrorMovInv = True ErrorMovInv = True
Exit For Exit For
End If End If
Dim DifTC As Decimal = tipoCambioActual - Gvr.DataKey("TipoCambio").ToDecimal ' Dim DifTC As Decimal = tipoCambioActual - Gvr.DataKey("TipoCambio").ToDecimal
'diferenciaTransito = DifTC * (Gvr.DataKey("IVA").ToDecimal / Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDecimal) 'diferenciaTransito = DifTC * (Gvr.DataKey("IVA").ToDecimal / Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDecimal)
'diferenciaTransito += DifTC * (Gvr.DataKey("IEPSPS").ToDecimal / Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDecimal) 'diferenciaTransito += DifTC * (Gvr.DataKey("IEPSPS").ToDecimal / Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDecimal)
importeMNTemp = (Gvr.FCTextBox("TxtPU").Text.ToDecimal * Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDecimal * tipoCambioActual).RoundSQL importeMNTemp = importeMNTemp + (Gvr.FCTextBox("TxtPU").Text.ToDecimal * Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDecimal * tipoCambioActual).RoundSQL
ImporteTransito += importeMNTemp ImporteTransito += importeMNTemp
CveCompraAmortizacion = Gvr.DataKey("CveCompra").ToEntero
'se registra por cada compra relacionada 'se registra por cada compra relacionada
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMNTemp, importeMNTemp, ConceptoContabilizacionNC, Referencia, Concepto, CveCompra:=CveCompra, CveCompraAmortizacion:=Gvr.DataKey("CveCompra").ToEntero, CveProveedor:=CveProveedorConcepto, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True
End If
End If End If
Next Next
If importeMNTemp > 0 Then
importeMNTemp = importeMNTemp - TxtDescuento.Text.ToDecimal
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMNTemp, importeMNTemp, ConceptoContabilizacionNC, Referencia, Concepto, CveCompra:=CveCompra, CveCompraAmortizacion:=CveCompraAmortizacion, CveProveedor:=CveProveedorConcepto, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True
End If
End If
'si se marca que no se va a recibir, falta validación 'si se marca que no se va a recibir, falta validación
If Not ErrorMovInv AndAlso Not ObjCompras.UpdateEstatusAlmacen(CveCompra, 1, UsuarioActual.CveUsuario) Then If Not ErrorMovInv AndAlso Not ObjCompras.UpdateEstatusAlmacen(CveCompra, 1, UsuarioActual.CveUsuario) Then
ErrorMovInv = True ErrorMovInv = True
@@ -7687,10 +7699,10 @@ Partial Class Compras_Compras
If Not ErrorPrepoliza AndAlso Not ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, Opcion:=4, AutoConta:=AutoConta) Then If Not ErrorPrepoliza AndAlso Not ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, Opcion:=4, AutoConta:=AutoConta) Then
TieneError = True TieneError = True
'If ObjConta.ValorPolizaDescuadre > 0 Then If ObjConta.ValorPolizaDescuadre > 0 AndAlso UsuarioActual.CveRol = 1 Then
' Alert($"{ObjConta.MensajePolizaDescuadre} Diferencia{ObjConta.ValorDiferencia}", TipoMensaje.MsgError) Alert($"{ObjConta.MensajePolizaDescuadre} Diferencia{ObjConta.ValorDiferencia}", TipoMensaje.MsgError)
' ErrorPrepolizaDescuadre = True ErrorPrepolizaDescuadre = True
'End If End If
End If End If

View File

@@ -179,6 +179,7 @@
<asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server"> <asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel runat="server" ID="uppBtns" UpdateMode="Conditional"> <asp:UpdatePanel runat="server" ID="uppBtns" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:Button ID="btnCargaCotizaciones" OnClick="btnCargaCotizaciones_Click" runat="server" ClientIDMode="Static" Style="display: none;" /> <asp:Button ID="btnCargaCotizaciones" OnClick="btnCargaCotizaciones_Click" runat="server" ClientIDMode="Static" Style="display: none;" />
@@ -696,7 +697,7 @@
</asp:UpdatePanel> </asp:UpdatePanel>
</div> </div>
</div> </div>
<div id="DVSeccionGVD"></div>
<asp:UpdatePanel ID="UPPTab" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UPPTab" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<ajax:TabContainer ID="Tab" runat="server" ActiveTabIndex="0" Width="100%"> <ajax:TabContainer ID="Tab" runat="server" ActiveTabIndex="0" Width="100%">
@@ -1704,7 +1705,7 @@
<table> <table>
<tr> <tr>
<td style="text-align: center;"> <td style="text-align: center;">
<asp:Button runat="server" ID="BtnEdicionMasiva" Text="Edición Masiva" CssClass="btn btn-success" OnClick="BtnEdicionMasiva_Click" Width="170px" /> <asp:Button runat="server" ID="BtnEdicionMasiva" Text="Edición Masiva" CssClass="btn btn-success" OnClick="BtnEdicionMasiva_Click" Width="170px" Visible="false" />
</td> </td>
</tr> </tr>
<tr> <tr>

View File

@@ -661,11 +661,12 @@ Partial Class OC_OC
CargarCentrosDeCosto(Nothing, DdlSubProyectoEntrega, Nothing, Nothing, "Seleccione") CargarCentrosDeCosto(Nothing, DdlSubProyectoEntrega, Nothing, Nothing, "Seleccione")
If UsuarioActual.CveEmpresa = 189 Then If UsuarioActual.CveEmpresa = 189 Then
'GlobalDTOCEstatusUsuarios(CveEmpresaActual, UsuarioActual.CveUsuario, TipoOC)
DdlSubProyectoGral.DataSource = GlobalDTOCEstatusUsuarios(CveEmpresaActual, UsuarioActual.CveUsuario, TipoOC).FiltraParametros("", "SubProyecto", DistinctColumns:={"CveSubProyecto", "SubProyecto"}) DdlSubProyectoGral.DataSource = GlobalDTOCEstatusUsuarios(CveEmpresaActual, UsuarioActual.CveUsuario, TipoOC).FiltraParametros("", "SubProyecto", DistinctColumns:={"CveSubProyecto", "SubProyecto"})
DdlSubProyectoGral.DataBind() DdlSubProyectoGral.DataBind()
DdlSubProyectoGral.Items.Insert(0, New ListItem("Seleccione uno", "-1")) DdlSubProyectoGral.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
DdlSubProyectoGral.SelectedValueExist(UsuarioActual.CveSubProyecto) DdlSubProyectoGral.SelectedValueExist(UsuarioActual.CveSubProyecto)
TdProyectoSubPrpyectoDdl.Visible = False TdProyectoSubPrpyectoDdl.Visible = False
TdProyectoSubPrpyecto.Visible = False TdProyectoSubPrpyecto.Visible = False
GvD.Columns(4).Visible = False GvD.Columns(4).Visible = False
@@ -1014,6 +1015,9 @@ Partial Class OC_OC
If UsuarioActual.CveRol = 1 Then If UsuarioActual.CveRol = 1 Then
TrDescuentoEscalonado.Visible = True TrDescuentoEscalonado.Visible = True
TrDescuentoProntoPago.Visible = True TrDescuentoProntoPago.Visible = True
End If
If UsuarioActual.Empresa.CveEmpresa = 189 AndAlso CveOrdenCompra <> Nothing AndAlso CveOrdenCompra > 0 Then
BtnEdicionMasiva.Visible = True BtnEdicionMasiva.Visible = True
End If End If
@@ -1577,6 +1581,21 @@ Partial Class OC_OC
TxtPorcentajeProntoPago.Text = (100 * objOC.PorcentajeProntoPago).ToString("###.00") TxtPorcentajeProntoPago.Text = (100 * objOC.PorcentajeProntoPago).ToString("###.00")
If UsuarioActual.CveEmpresa = 189 Then If UsuarioActual.CveEmpresa = 189 Then
Dim existeCvesubproyecto As Boolean = False
If objOC.DtResultados.Rows(0)("CveSubProyectoGral").ToString.ToEntero > 0 Then
For Each tmpItem As ListItem In DdlSubProyectoGral.Items
If tmpItem.Value.ToEntero = objOC.DtResultados.Rows(0)("CveSubProyectoGral").ToString.ToEntero Then
existeCvesubproyecto = True
Exit For
End If
Next
End If
If Not existeCvesubproyecto Then
Dim tmpSubProyecto As String = GlobalDTSubProyectos(UsuarioActual.CveEmpresa, objOC.DtResultados.Rows(0)("CveSubProyectoGral").ToString.ToEntero, -1).FiltroPrimeroValor("SubProyecto")
DdlSubProyectoGral.Items.Add(New ListItem(tmpSubProyecto, objOC.DtResultados.Rows(0)("CveSubProyectoGral").ToString))
End If
DdlSubProyectoGral.SelectedValueExist(objOC.DtResultados.Rows(0)("CveSubProyectoGral").ToString) DdlSubProyectoGral.SelectedValueExist(objOC.DtResultados.Rows(0)("CveSubProyectoGral").ToString)
End If End If
@@ -1609,7 +1628,7 @@ Partial Class OC_OC
HLGenerarVenta.Visible = True HLGenerarVenta.Visible = True
HLGenerarVenta.NavigateUrl = $"/Ventas/Ventas.aspx?CveOC={pCveOrdenCompra}" HLGenerarVenta.NavigateUrl = $"/Ventas/Ventas.aspx?CveOC={pCveOrdenCompra}"
lblFolio.Text = String.Format("OC {0}", objOC.Folio) lblFolio.Text = String.Format("OC {0}", objOC.SerieFolio)
lblTipoPadreHijo.Text = "REQ" lblTipoPadreHijo.Text = "REQ"
ChkCotizacion.Visible = False ChkCotizacion.Visible = False
@@ -1672,7 +1691,7 @@ Partial Class OC_OC
Case "REQ" Case "REQ"
ViewState("TipoOC") = objOC.Tipo ViewState("TipoOC") = objOC.Tipo
ViewState("TipoLargo") = "Requisición" ViewState("TipoLargo") = "Requisición"
lblFolio.Text = "REQ " + objOC.Folio.ToString lblFolio.Text = "REQ " + objOC.SerieFolio.ToString
lblTipoPadreHijo.Text = "OC" lblTipoPadreHijo.Text = "OC"
ChkCotizacion.Visible = True ChkCotizacion.Visible = True
DdlProveedores.SelectedValue = objOC.CveProveedor.ToString DdlProveedores.SelectedValue = objOC.CveProveedor.ToString
@@ -1694,7 +1713,7 @@ Partial Class OC_OC
Case "OS" Case "OS"
ViewState("TipoOC") = "REQ" ViewState("TipoOC") = "REQ"
ViewState("TipoLargo") = "Orden de Servicio" ViewState("TipoLargo") = "Orden de Servicio"
lblFolio.Text = "OS " + objOC.Folio.ToString lblFolio.Text = "OS " + objOC.SerieFolio.ToString
'lblTipoPadreHijo.Text = "OC" 'lblTipoPadreHijo.Text = "OC"
ChkCotizacion.Visible = True ChkCotizacion.Visible = True
TipoOS = True TipoOS = True
@@ -9515,6 +9534,7 @@ Partial Class OC_OC
End If End If
RegistraScript("$(document).ready(function() {setTimeout(function() {document.getElementById('DVSeccionGVD').scrollIntoView({ behavior: 'smooth' }); }, 250);});", "100")
UPPDetalle.Update() UPPDetalle.Update()
@@ -9603,6 +9623,7 @@ Partial Class OC_OC
CargaDatosDetalles() CargaDatosDetalles()
Return True Return True
End Function End Function