-- surtido automático
-- si hay un subproyecto asignado que lo asigne en la carga de factura
This commit is contained in:
@@ -5171,7 +5171,7 @@
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12" style="text-align:right">
|
||||
<asp:CheckBox runat="server" ID="ChkEsDevolucionDevInv" Text="Es Temporal" Visible="false" />
|
||||
<asp:CheckBox runat="server" ID="ChkEsDevolucionDevInv" Text="Genera Saldo a favor" Visible="false" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
|
||||
@@ -1377,7 +1377,7 @@ Partial Class Compras_Compras
|
||||
DdlMedico.DataBind()
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(590).ToString = "1" Then
|
||||
DVCultivosCuadro.Visible = True
|
||||
DdlSubProyecto.AutoPostBack = True
|
||||
|
||||
@@ -1906,24 +1906,11 @@ Partial Class Compras_Compras
|
||||
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("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("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("Lote") Then TmpDT.Columns.Add("Lote", GetType(String))
|
||||
If Not TmpDT.Columns.Contains("FechaCaducidad") Then TmpDT.Columns.Add("FechaCaducidad", GetType(Date))
|
||||
|
||||
AddPS2(False)
|
||||
|
||||
@@ -2324,6 +2311,19 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
'consideración si el usuarioactual, solo tienen un centro de costo, que lo asigne en automático
|
||||
Dim dtsubAsignados As DataTable = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa)
|
||||
If dtsubAsignados.Rows.Count = 1 Then
|
||||
Dim drtt As DataRow = dtsubAsignados.FiltroPrimero("")
|
||||
For Each item As DataRow In TmpDT.Rows
|
||||
item("CveSubProyecto") = drtt("CveSubProyecto")
|
||||
item("SubProyecto") = drtt("SubProyecto")
|
||||
item("CveProyecto") = drtt("CveProyecto")
|
||||
item("Proyecto") = drtt("Proyecto")
|
||||
Next
|
||||
End If
|
||||
|
||||
GvPS.DataSource = TmpDT
|
||||
GvPS.DataBind()
|
||||
UpPS.Update()
|
||||
@@ -4391,24 +4391,6 @@ Partial Class Compras_Compras
|
||||
|
||||
End If
|
||||
|
||||
''VERIFICA SI LOS PRODUCTOS/SERVICIOS EXISTEN EN EL CATALOGO DEL SAT
|
||||
'If UsuarioActual.CveEmpresa = 72 Then
|
||||
|
||||
' Dim DtNoEncontrados As DataTable = TmpDT.FiltraParametros("ISNULL(CveSATPS,0) = 46920 ")
|
||||
' If DtNoEncontrados IsNot Nothing AndAlso DtNoEncontrados.Rows.Count > 0 Then
|
||||
' Dim StrNoEncontrados As New StringBuilder
|
||||
' StrNoEncontrados.Append("Los siguientes productos no tiene asignado la clave Producto SAT o Unidad Medida SAT<br/><br/>")
|
||||
' For Each drt As DataRow In DtNoEncontrados.Rows
|
||||
' StrNoEncontrados.AppendFormat("{0} <br/>", drt("CodigoPS"))
|
||||
' Next
|
||||
' Alert(StrNoEncontrados.ToString(), TipoMensaje.MsgAdvertencia)
|
||||
' DtNoEncontrados.Dispose()
|
||||
' StrNoEncontrados.Clear()
|
||||
' Exit Sub
|
||||
' End If
|
||||
' DtNoEncontrados.Dispose()
|
||||
'End If
|
||||
|
||||
'Verifica funcionalidad 128 "Require orden de compra para factura de compra"
|
||||
|
||||
Dim EsViatico As Boolean = False
|
||||
@@ -4447,21 +4429,6 @@ Partial Class Compras_Compras
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
''DF - 10/04/2017
|
||||
'If UsuarioActual.TienePermisoProceso(187) Then
|
||||
' If TxtSerie.Text <> SerieVieja Then
|
||||
' Dim dtt As DataTable = GlobalDTProveedorSucursales(CveProveedor, UsuarioActual.CveEmpresa)
|
||||
' If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then
|
||||
' Dim SerieNueva As String = dtt.FiltroPrimeroValor("Serie", $"Serie = '{TxtSerie.Text}'").ToString
|
||||
' If SerieNueva = "" Then
|
||||
' Alert("La Serie no es válida, por favor revise que se encuentre dentro de la lista de las sucursales del proveedor.", TipoMensaje.MsgAdvertencia)
|
||||
' Exit Sub
|
||||
' End If
|
||||
' End If
|
||||
|
||||
' End If
|
||||
'End If
|
||||
|
||||
'Excede el limite de credito
|
||||
If RBLPago.SelectedValue = "1" AndAlso DdlTipoComprobante.SelectedValue.Contiene("Fac") AndAlso UsuarioActual.Empresa.Funcionalidad(518) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(185) Then
|
||||
Dim ObjCompras As New ClsCompras
|
||||
@@ -4528,36 +4495,28 @@ Partial Class Compras_Compras
|
||||
ValidaFechaDeAlamacen()
|
||||
Else
|
||||
'GvInv.Rows(x).FCDropDownList("ddlEAlmacen").SelectedValue.ToEntero 'Charlie
|
||||
Dim x As Integer = 0
|
||||
For Each Dr As GridViewRow In GvInv.Rows
|
||||
If Dr.FCCheckBox("cbInv").Checked Then
|
||||
'pestaña de almacen, si hay especificado una entrada por partida dealmacen, debe de existir el almacen.
|
||||
If GvInv.Rows.Count > 0 Then
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Fac") Then
|
||||
Dim x As Integer = 0
|
||||
For Each Dr As GridViewRow In GvInv.Rows
|
||||
If Dr.FCCheckBox("cbInv").Checked Then
|
||||
If Dr.FCDropDownList("ddlEAlmacen").SelectedValue.ToEntero <= 0 Then
|
||||
Alert("Favor de seleccionar almacen en la pestaña de almacén.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
x = x + 1
|
||||
End If
|
||||
Next
|
||||
|
||||
If Not Dr.FCDropDownList("ddlEAlmacen").SelectedValue.ToEntero > 0 Then
|
||||
Alert("Favor de seleccionar almacen en la pestaña de almacén.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
If Not (CveCompraRefacturacion > 0 AndAlso ChkRefacturacionConAlmacen.Checked) Then
|
||||
If x = 0 AndAlso GvInv.Rows.Count > 0 Then
|
||||
Alert("Favor de seleccionar un producto en la pestaña de almacén", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
x = x + 1
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
If Not (CveCompraRefacturacion > 0 AndAlso ChkRefacturacionConAlmacen.Checked) Then
|
||||
If x = 0 AndAlso GvInv.Rows.Count > 0 Then
|
||||
Alert("Favor de seleccionar un producto en la pestaña de almacén", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(538) = "1" Then
|
||||
If TmpDT.MIN("CvePS").ToEntero <= 0 Then
|
||||
Alert("Todos los Productos/Servicios deben estar registrados o aliados a un productos ya registrado.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -11502,7 +11461,7 @@ Partial Class Compras_Compras
|
||||
e.Row.FCDropDownList("ddlAlmacenConsignacionGeneral").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 4)
|
||||
e.Row.FCDropDownList("ddlAlmacenConsignacionGeneral").DataBind()
|
||||
|
||||
'que no sea recepcion alamcen adelatnado. DdlOCVinculaInv
|
||||
'que no sea recepcion almacen adelantado. DdlOCVinculaInv
|
||||
If UsuarioActual.Empresa.Funcionalidad(567) = "1" AndAlso DdlOCVinculaInv.SelectedValue <> "176" Then
|
||||
If e.Row.FCDropDownList("ddlAlmacen").Items.Count > 1 Then
|
||||
e.Row.FCDropDownList("ddlAlmacen").SelectedIndex = 1
|
||||
@@ -19152,7 +19111,11 @@ Partial Class Compras_Compras
|
||||
Else
|
||||
HplDevv.Text = "<i class='fa fa-pencil'></i> Solicitar Devolución Almacén"
|
||||
HplDevv.ToolTip = "¿Está seguro de Solicitar la Devolución de Almacén?"
|
||||
ChkEsDevolucionDevInv.Visible = True
|
||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||
ChkEsDevolucionDevInv.Visible = True
|
||||
ChkEsDevolucionDevInv.Checked = True
|
||||
ChkEsDevolucionDevInv.Enabled = False
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
@@ -19181,26 +19144,18 @@ Partial Class Compras_Compras
|
||||
Dim tCveSubProyeto As Integer = TmpDT.FiltroPrimeroValor("CveSubProyecto", " CveSubProyecto > 0").ToEntero
|
||||
ObjCompras.IniciaTransacSQL()
|
||||
|
||||
If ChkEsDevolucionDevInv.Checked Then
|
||||
|
||||
End If
|
||||
|
||||
Dim ImporteCompra As Decimal = 0
|
||||
|
||||
If EstatusAlmacen = 0 Then
|
||||
|
||||
For Each gvr As GridViewRow In GvSolDev.Rows
|
||||
|
||||
Dim Cantidad As Decimal = gvr.FCTextBox("TxtCant").Text.ToDecimal
|
||||
Dim PU As Decimal = gvr.DataKey("PU").ToDecimal
|
||||
|
||||
If gvr.FCTextBox("TxtCant").Text.ToDecimal > 0 Then
|
||||
ObjCompras.UpdateEstatusAlmacenDetalle(gvr.DataKey("CveCompraDetalle").ToEntero, 0, UsuarioActual.CveUsuario, CantidadDevolucion:=gvr.FCTextBox("TxtCant").Text.ToDecimal)
|
||||
ImporteCompra = ImporteCompra + ((PU * Cantidad))
|
||||
Else
|
||||
ObjCompras.UpdateEstatusAlmacenDetalle(gvr.DataKey("CveCompraDetalle").ToEntero, 1, UsuarioActual.CveUsuario, CantidadDevolucion:=0)
|
||||
End If
|
||||
|
||||
Next
|
||||
End If
|
||||
|
||||
|
||||
Reference in New Issue
Block a user