Servicio a domicilio, alta y actualizacion en reporte
This commit is contained in:
@@ -36,8 +36,9 @@ Public Class CalendarEvent
|
||||
Public Property CvePersonal As Integer
|
||||
Public Property CveCliente As Integer
|
||||
Public Property CveProveedor As Integer
|
||||
|
||||
|
||||
Public Property CveOS As Integer
|
||||
Public Property CveOSDetalle As Integer
|
||||
Public Property CveUsuarioAtendio As Integer
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -62,6 +62,8 @@ Public Class ClsOS
|
||||
Public Property Telefono As String = ""
|
||||
Public Property CveModeloAuto As Integer = -1
|
||||
Public Property Año As String = ""
|
||||
Public Property CorreoOS As String = ""
|
||||
Public Property FechaInicio As DateTime
|
||||
|
||||
Private Class Especificaciones
|
||||
Public CveValor As Integer
|
||||
@@ -475,7 +477,7 @@ Public Class ClsOS
|
||||
Return Retorno
|
||||
End Function
|
||||
Public Function GetOrdenesServicios(CveOS As Integer, CveCliente As Integer, Folio As Integer, CveUsuarioRecibio As Integer, CveEstatusOrdenServicio As Integer,
|
||||
CveEmpresa As Integer, Optional CveSubProyecto As Integer = -1, Optional TopSelect As Integer = 10000) As Boolean
|
||||
CveEmpresa As Integer, Optional CveSubProyecto As Integer = -1, Optional TopSelect As Integer = 10000, Optional CveOSDetalle As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_OS_OrdenesServiciosGet")
|
||||
|
||||
@@ -488,6 +490,9 @@ Public Class ClsOS
|
||||
.Add("@CveEstatusOrdenServicio", SqlDbType.Int).Value = CveEstatusOrdenServicio
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
.Add("@TopSelect", SqlDbType.Int).Value = TopSelect
|
||||
.Add("@CveOSDetalle", SqlDbType.Int).Value = CveOSDetalle
|
||||
|
||||
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
@@ -523,7 +528,11 @@ Public Class ClsOS
|
||||
|
||||
Me.Telefono = Data.Rows(0)("TelefonoContacto").ToString
|
||||
Me.CveModeloAuto = Data.Rows(0)("CveModeloAuto").ToString.ToEntero
|
||||
Me.CorreoOS = Data.Rows(0)("CorreoOS").ToString
|
||||
Me.Año = Data.Rows(0)("Año").ToString
|
||||
Me.FechaInicio = Data.Rows(0)("FechaInicio").ToString.ToDateTime
|
||||
Me.CveOSDetalle = Data.Rows(0)("CveOSDetalle").ToString.ToEntero
|
||||
|
||||
End If
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
@@ -577,7 +586,7 @@ Public Class ClsOS
|
||||
End Function
|
||||
Public Function AddOrdenesServicios(CveCliente As Integer, CveSubProyecto As Integer, PersonaSolicito As String, FechaRecepcion As Date, Descripcion As String, CveUsuarioRecibio As Integer, CveEstatusOrdenServicio As Integer,
|
||||
CveUsuario As Integer, CveEmpresa As Integer, CveCotizacion As Integer, CveVenta As Integer, CveOSPadre As Integer, CveOSTipo As Integer, Optional CveClienteSucursal As Integer = -1,
|
||||
Optional Direccion As String = "-1", Optional Telefono As String = "", Optional CveModeloAuto As Integer = -1, Optional Año As String = "-1") As Boolean
|
||||
Optional Direccion As String = "-1", Optional Telefono As String = "", Optional CveModeloAuto As Integer = -1, Optional Año As String = "-1", Optional Correo As String = "") As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_OS_OrdenesServiciosAdd")
|
||||
@@ -602,6 +611,7 @@ Public Class ClsOS
|
||||
.Add("@Telefono", SqlDbType.VarChar).Value = Telefono
|
||||
.Add("@CveModeloAuto", SqlDbType.Int).Value = CveModeloAuto
|
||||
.Add("@Año", SqlDbType.VarChar).Value = Año
|
||||
.Add("@Correo", SqlDbType.VarChar).Value = Correo
|
||||
|
||||
.Add("@CveOS", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||
.Add("@vFolio", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||
@@ -646,7 +656,7 @@ Public Class ClsOS
|
||||
End Function
|
||||
Public Function UpdateOrdenesServicios(PersonaSolicito As String, FechaRecepcion As String, Descripcion As String, CveUsuarioRecibio As Integer, CveEstatusOrdenServicio As Integer, CveOS As Integer, CveUsuarioModifico As Integer,
|
||||
CveOSTipo As Integer, Optional CveClienteSucursal As Integer = -1, Optional Direccion As String = "-1",
|
||||
Optional Telefono As String = "", Optional CveModeloAuto As Integer = -1, Optional Año As String = "-1") As Boolean
|
||||
Optional Telefono As String = "", Optional CveModeloAuto As Integer = -1, Optional Año As String = "-1", Optional CveSubProyecto As Integer = -1, Optional Correo As String = "-1") As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_OS_OrdenesServiciosUpdate")
|
||||
@@ -662,10 +672,12 @@ Public Class ClsOS
|
||||
.Add("@CveOS", SqlDbType.Int).Value = CveOS
|
||||
.Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal
|
||||
.Add("@Direccion", SqlDbType.VarChar).Value = Direccion
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
|
||||
.Add("@Telefono", SqlDbType.VarChar).Value = Telefono
|
||||
.Add("@CveModeloAuto", SqlDbType.Int).Value = CveModeloAuto
|
||||
.Add("@Año", SqlDbType.VarChar).Value = Año
|
||||
.Add("@Correo", SqlDbType.VarChar).Value = Correo
|
||||
|
||||
End With
|
||||
|
||||
@@ -700,6 +712,34 @@ Public Class ClsOS
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
|
||||
Public Function UpdateOrdenesServiciosFinaliza(CveOS As Integer, CveOSDetalle As Integer, CvePS As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_OS_OrdenesServiciosFinalizaUpdate")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveOS", SqlDbType.Int).Value = CveOS
|
||||
.Add("@CveOSDetalle", SqlDbType.Int).Value = CveOSDetalle
|
||||
.Add("@CvePS", SqlDbType.Int).Value = CvePS
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al guardar los cambios en La Orden de Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
Public Function RemoveOrdenesServicios(CveOrdenServicio As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
|
||||
@@ -136,13 +136,15 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
|
||||
cevent.CvePersonal = dr("CvePersonal").ToString.ToEntero
|
||||
cevent.CveCliente = dr("CveCliente").ToString.ToEntero
|
||||
cevent.CveProveedor = dr("CveProveedor").ToString.ToEntero
|
||||
|
||||
|
||||
|
||||
cevent.NombreCliente = dr("NombreCliente").ToString
|
||||
cevent.NombreProveedor = dr("NombreProveedor").ToString
|
||||
cevent.NomprePersonal = dr("NomprePersonal").ToString
|
||||
|
||||
|
||||
cevent.CveOS = dr("CveOS").ToString.ToEntero
|
||||
cevent.CveOSDetalle = dr("CveOSDetalle").ToString.ToEntero
|
||||
cevent.CveUsuarioAtendio = dr("CveUsuarioAtendio").ToString.ToEntero
|
||||
|
||||
cevent.NombreAcercamiento = dr("NombreAcercamiento").ToString
|
||||
|
||||
'11/05/2018 - Evento Gasto Recurrente
|
||||
|
||||
@@ -1785,7 +1785,7 @@ Partial Class Compras_Compras
|
||||
|
||||
If Validada And Not EnListadoEFOS Then
|
||||
Try
|
||||
XMLDoc.LoadXml(File.ReadAllText(Archivo).Replace("<br>", "").Replace("<", ""))
|
||||
XMLDoc.LoadXml(File.ReadAllText(Archivo).Replace("<br>", "").Replace("<", "").Replace("o;?", ""))
|
||||
Catch ex As Exception
|
||||
Try
|
||||
Dim oReader = New StreamReader(Archivo, Encoding.GetEncoding("ISO-8859-1"))
|
||||
@@ -4956,7 +4956,7 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
|
||||
|
||||
If UsuarioActual.Empresa.UsaAC Then
|
||||
If UsuarioActual.Empresa.UsaAC AndAlso Not TieneError Then
|
||||
|
||||
If TotalPorDevengar <= TxtTotal.Text.ToDouble And TotalPorDevengar > 0 Then
|
||||
ObjContaAC = New ClsContPAQi(UsuarioActual.Empresa)
|
||||
@@ -5263,7 +5263,7 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not ErrorAC Then
|
||||
If Not ErrorAC AndAlso Not TieneError Then
|
||||
|
||||
|
||||
Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1"
|
||||
@@ -5524,90 +5524,98 @@ Partial Class Compras_Compras
|
||||
Dim indice = 0
|
||||
Dim ImporteConcepto As Decimal = 0
|
||||
|
||||
For Each tCveAlmacen As Integer In ListAlmacenes
|
||||
If GvInv.Rows(indice).FCDropDownList("DdlRecibirInv").SelectedValue = "1" Then
|
||||
Continue For
|
||||
End If
|
||||
indice += 1
|
||||
|
||||
Dim fecha As Date = TxtFecha.Text.ToDate
|
||||
If Not UsuarioActual.Empresa.UsaAC Then fecha = Now
|
||||
|
||||
CveMovimientoInventario = ObjInventario.AddMovimiento(tCveAlmacen, 2, 1, fecha, 0, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra, -1, -1, -1, TipoCambio:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, TipoCambioGuardar), Modulo:="Comp/G2")
|
||||
|
||||
If CveMovimientoInventario <= 0 Then
|
||||
ErrorMovInv = True
|
||||
Else
|
||||
|
||||
Dim DtDetalle As New DataTable
|
||||
Dim DtEquivalencias As DataTable
|
||||
Dim CveProducto As Integer
|
||||
Dim CantidadInv As Decimal
|
||||
Dim PUInv As Decimal
|
||||
Dim CveUnidad As Integer
|
||||
Dim CostoIndirecto As Decimal
|
||||
Dim tDescuento As Decimal = 0
|
||||
|
||||
ListaMovimientosAlmacen.Add(CveMovimientoInventario)
|
||||
|
||||
|
||||
For Each Dr As DataRow In DtInv.Rows
|
||||
If DdlTipoComprobante.SelectedValue = "Fac" Then
|
||||
For Each tCveAlmacen As Integer In ListAlmacenes
|
||||
If GvInv.Rows(indice).FCDropDownList("DdlRecibirInv").SelectedValue = "1" Then
|
||||
Continue For
|
||||
End If
|
||||
indice += 1
|
||||
|
||||
CveProducto = Dr("CvePS").ToString.ToEntero
|
||||
CveUnidad = Dr("CveUM").ToString.ToEntero
|
||||
CantidadInv = Dr("Cantidad").ToString.ToDecimal
|
||||
PUInv = Dr("PU").ToString.ToDecimal
|
||||
tDescuento = Dr("Descuento").ToString.ToDecimal / CantidadInv
|
||||
CostoIndirecto = Dr("CostoIndirectoAlmacen").ToString.ToDecimal
|
||||
Dim fecha As Date = TxtFecha.Text.ToDate
|
||||
If Not UsuarioActual.Empresa.UsaAC Then fecha = Now
|
||||
|
||||
If Dr("CveMetodoInventario").ToString.ToEntero = 5 Then
|
||||
'SI FUE POR SERIE LOTE
|
||||
DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("CvePS = {0}", Dr("CvePS")))
|
||||
If DtDetalle.Rows.Count > 0 Then
|
||||
For Each drr As DataRow In DtDetalle.Rows
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, 1, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, -1, Serie:=drr("Serie").ToString, FechaCaducidad:=drr("FechaCaducidad").ToString.ToDate, CostoIndirecto:=Dr("CostoIndirectoAlmacen").ToString.ToDecimal, CveCompraDetalle:=Dr("CveCompraDetalle").ToString.ToEntero, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
|
||||
CveMovimientoInventario = ObjInventario.AddMovimiento(tCveAlmacen, 2, 1, fecha, 0, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra, -1, -1, -1, TipoCambio:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, TipoCambioGuardar), Modulo:="Comp/G2")
|
||||
|
||||
If CveMovimientoInventario <= 0 Then
|
||||
ErrorMovInv = True
|
||||
Else
|
||||
|
||||
Dim DtDetalle As New DataTable
|
||||
Dim DtEquivalencias As DataTable
|
||||
Dim CveProducto As Integer
|
||||
Dim CantidadInv As Decimal
|
||||
Dim PUInv As Decimal
|
||||
Dim CveUnidad As Integer
|
||||
Dim CostoIndirecto As Decimal
|
||||
Dim tDescuento As Decimal = 0
|
||||
|
||||
ListaMovimientosAlmacen.Add(CveMovimientoInventario)
|
||||
|
||||
|
||||
For Each Dr As DataRow In DtInv.Rows
|
||||
|
||||
CveProducto = Dr("CvePS").ToString.ToEntero
|
||||
CveUnidad = Dr("CveUM").ToString.ToEntero
|
||||
CantidadInv = Dr("Cantidad").ToString.ToDecimal
|
||||
PUInv = Dr("PU").ToString.ToDecimal
|
||||
tDescuento = Dr("Descuento").ToString.ToDecimal / CantidadInv
|
||||
CostoIndirecto = Dr("CostoIndirectoAlmacen").ToString.ToDecimal
|
||||
|
||||
If Dr("CveMetodoInventario").ToString.ToEntero = 5 Then
|
||||
'SI FUE POR SERIE LOTE
|
||||
DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("CvePS = {0}", Dr("CvePS")))
|
||||
If DtDetalle.Rows.Count > 0 Then
|
||||
For Each drr As DataRow In DtDetalle.Rows
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, 1, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, -1, Serie:=drr("Serie").ToString, FechaCaducidad:=drr("FechaCaducidad").ToString.ToDate, CostoIndirecto:=Dr("CostoIndirectoAlmacen").ToString.ToDecimal, CveCompraDetalle:=Dr("CveCompraDetalle").ToString.ToEntero, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
Next
|
||||
End If
|
||||
Else
|
||||
|
||||
'UNIDAD BASE - EQUIVALENCIAS - INVENTARIO
|
||||
If UsuarioActual.CveEmpresa = 1 Then
|
||||
DtEquivalencias = New DataTable
|
||||
DtEquivalencias = GlobalDTProductosServiciosEquivalencias(CveProducto, -1, UsuarioActual.CveEmpresa)
|
||||
Dim CveUnidadBase As Integer = DtEquivalencias.FiltroPrimeroValor("CveUM", "UnidadBase = 'True'").ToEntero
|
||||
Dim drUMBase As DataRow = DtEquivalencias.FiltroPrimero("UnidadBase = 'True'")
|
||||
|
||||
'SI LA UNIDAD ACTUAL NO ES LA BASE SACA PROPORCION (EQUIVALENTE)
|
||||
If CveUnidadBase <> CveUnidad Then
|
||||
' LO QUE PUSE LO QUE VALE UNIDAD BASE LO QUE VALE UNIDAD SELECCIONADA
|
||||
CantidadInv = Dr("Cantidad").ToString.ToDecimal * drUMBase("Cantidad").ToString.ToDecimal / DtEquivalencias.FiltraParametros(String.Format("CveUM = {0}", CveUnidad)).Rows(0)("Cantidad").ToString.ToDecimal
|
||||
PUInv = PUInv * Dr("Cantidad").ToString.ToDecimal / CantidadInv
|
||||
CostoIndirecto = CostoIndirecto * Dr("Cantidad").ToString.ToDecimal / CantidadInv
|
||||
CveUnidad = CveUnidadBase
|
||||
End If
|
||||
End If
|
||||
|
||||
'si no es por serie lote
|
||||
ImporteConcepto = If(DdlMoneda.SelectedValue.ToEntero = 1, PUInv, PUInv * TipoCambioGuardar) - If(DdlMoneda.SelectedValue.ToEntero = 1, tDescuento, tDescuento * TipoCambioGuardar)
|
||||
ImporteConcepto = If(UsuarioActual.Empresa.UsaAC, ImporteConcepto * IVA, ImporteConcepto)
|
||||
If Dr("CveAlmacen").ToString.ToEntero = tCveAlmacen Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, CantidadInv, CveUnidad, Dr("CvePS").ToString.ToEntero, ImporteConcepto, -1, PUTC:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, Dr("PU").ToString.ToDecimal), CostoIndirecto:=CostoIndirecto, CveCompraDetalle:=Dr("CveCompraDetalle").ToString.ToEntero, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
Next
|
||||
End If
|
||||
Else
|
||||
|
||||
'UNIDAD BASE - EQUIVALENCIAS - INVENTARIO
|
||||
If UsuarioActual.CveEmpresa = 1 Then
|
||||
DtEquivalencias = New DataTable
|
||||
DtEquivalencias = GlobalDTProductosServiciosEquivalencias(CveProducto, -1, UsuarioActual.CveEmpresa)
|
||||
Dim CveUnidadBase As Integer = DtEquivalencias.FiltroPrimeroValor("CveUM", "UnidadBase = 'True'").ToEntero
|
||||
Dim drUMBase As DataRow = DtEquivalencias.FiltroPrimero("UnidadBase = 'True'")
|
||||
|
||||
'SI LA UNIDAD ACTUAL NO ES LA BASE SACA PROPORCION (EQUIVALENTE)
|
||||
If CveUnidadBase <> CveUnidad Then
|
||||
' LO QUE PUSE LO QUE VALE UNIDAD BASE LO QUE VALE UNIDAD SELECCIONADA
|
||||
CantidadInv = Dr("Cantidad").ToString.ToDecimal * drUMBase("Cantidad").ToString.ToDecimal / DtEquivalencias.FiltraParametros(String.Format("CveUM = {0}", CveUnidad)).Rows(0)("Cantidad").ToString.ToDecimal
|
||||
PUInv = PUInv * Dr("Cantidad").ToString.ToDecimal / CantidadInv
|
||||
CostoIndirecto = CostoIndirecto * Dr("Cantidad").ToString.ToDecimal / CantidadInv
|
||||
CveUnidad = CveUnidadBase
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
'si no es por serie lote
|
||||
ImporteConcepto = If(DdlMoneda.SelectedValue.ToEntero = 1, PUInv, PUInv * TipoCambioGuardar) - If(DdlMoneda.SelectedValue.ToEntero = 1, tDescuento, tDescuento * TipoCambioGuardar)
|
||||
ImporteConcepto = If(UsuarioActual.Empresa.UsaAC, ImporteConcepto * IVA, ImporteConcepto)
|
||||
If Dr("CveAlmacen").ToString.ToEntero = tCveAlmacen Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, CantidadInv, CveUnidad, Dr("CvePS").ToString.ToEntero, ImporteConcepto, -1, PUTC:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, Dr("PU").ToString.ToDecimal), CostoIndirecto:=CostoIndirecto, CveCompraDetalle:=Dr("CveCompraDetalle").ToString.ToEntero, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
i = i + 1
|
||||
Next
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
i = i + 1
|
||||
Next
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
If AplicarCostoIndirecto(ObjInventario, ObjCompras) Then
|
||||
@@ -7147,11 +7155,11 @@ Partial Class Compras_Compras
|
||||
|
||||
'PROVISION de NC
|
||||
IdCtaContable = CtaProveedorExtranjera
|
||||
Dim CveCon As Integer = ObtConceptoContableProvisionCompra(CveTipoConcepto, DdlTipoComprobante.selectedvalue, ddlmoneda.selectedvalue.toentero, False)
|
||||
Dim CveCon As Integer = ObtConceptoContableProvisionCompra(CveTipoConcepto, DdlTipoComprobante.SelectedValue, DdlMoneda.SelectedValue.ToEntero, False)
|
||||
|
||||
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importeMovimiento, Referencia, CveCon, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMovimiento, ImporteME:=importeMovimiento, Contabilizable:=SeContabiliza) Then
|
||||
IdCtaContable = CtaProveedorComplementaria
|
||||
CveCon = ObtConceptoContableProvisionCompra(CveTipoConcepto, DdlTipoComprobante.selectedvalue, ddlmoneda.selectedvalue.toentero, True)
|
||||
CveCon = ObtConceptoContableProvisionCompra(CveTipoConcepto, DdlTipoComprobante.SelectedValue, DdlMoneda.SelectedValue.ToEntero, True)
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importeMN - importeMovimiento, Referencia, CveCon, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN - importeMovimiento, ImporteME:=importeMovimiento, Contabilizable:=SeContabiliza, TipoCambio:=tipoCambioActual) Then
|
||||
ErrorPrepoliza = True
|
||||
@@ -13487,7 +13495,8 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
|
||||
|
||||
If ObjInventario.GetExistenciasProducto(Dr.DataKey("CvePS").ToString.ToEntero, Dr.DataKey("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, CveAlmacen, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm")) Then
|
||||
If ObjInventario.GetExistenciasProducto(Dr.DataKey("CvePS").ToString.ToEntero, Dr.DataKey("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, CveAlmacen,
|
||||
FechaMovto:=TxtFecha.Text.ToDateTime.AddHours(Now.Hour).AddMinutes(Now.Minute).AddSeconds(Now.Second).ToString("yyyy/MM/dd HH:mm")) Then
|
||||
|
||||
Dim Existencia As Decimal = ObjInventario.DtResultados.FiltroPrimeroValor("ExistenciaFinal", String.Format("CveAlmacen = {0}", CveAlmacen)).ToDecimal
|
||||
|
||||
|
||||
@@ -5899,23 +5899,29 @@ Partial Class PopUpVerFactura
|
||||
Dim ObjIE As New ClsBancos()
|
||||
Dim Tabla As DataTable
|
||||
ObjIE.GetBancosIEMovimientosDepositos(CveIE, UsuarioActual.CveEmpresa)
|
||||
Tabla = ObjIE.DtResultados
|
||||
|
||||
Dim params As New List(Of ReportParameter)
|
||||
params.Add(New ReportParameter("Fecha", Now.ToDateTime.ToString))
|
||||
params.Add(New ReportParameter("FechaIE", ObjIE.DtResultados(0)("FechaDocumento").ToString.ToDate.ToShortDateString))
|
||||
params.Add(New ReportParameter("CuentaCaja", CuentaCaja))
|
||||
params.Add(New ReportParameter("CuentaDeposito", CuentaDeposito))
|
||||
|
||||
If Archivo.Exists Then
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/DepositoCaja.rdlc", Tabla, params, "DepositoCaja")
|
||||
Else
|
||||
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
|
||||
ImprimirPDF("Empresas\Grales\Formatos\DepositoCaja.rdlc", Tabla, params, "DepositoCaja")
|
||||
If ObjIE.DtResultados IsNot Nothing AndAlso ObjIE.DtResultados.Rows.Count > 0 Then
|
||||
Tabla = ObjIE.DtResultados
|
||||
|
||||
Dim params As New List(Of ReportParameter)
|
||||
params.Add(New ReportParameter("Fecha", Now.ToDateTime.ToString))
|
||||
params.Add(New ReportParameter("FechaIE", ObjIE.DtResultados(0)("FechaDocumento").ToString.ToDate.ToShortDateString))
|
||||
params.Add(New ReportParameter("CuentaCaja", CuentaCaja))
|
||||
params.Add(New ReportParameter("CuentaDeposito", CuentaDeposito))
|
||||
|
||||
If Archivo.Exists Then
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/DepositoCaja.rdlc", Tabla, params, "DepositoCaja")
|
||||
Else
|
||||
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
|
||||
ImprimirPDF("Empresas\Grales\Formatos\DepositoCaja.rdlc", Tabla, params, "DepositoCaja")
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
ObjIE.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -572,6 +572,156 @@
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
|
||||
<%--CARTA PORTE INICIO--%>
|
||||
<asp:UpdatePanel ID="UpEmitirTransitorio" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div id="DivEmitirTransitorio" class="col-md-3 " runat="server" visible="false">
|
||||
<div class="portlet smmallpadding light bordered infomov">
|
||||
<div class="portlet-title">
|
||||
<div class="caption uppercase" style="position: relative;">
|
||||
<i class="fa fa-info-circle"></i>Carta Porte
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body ">
|
||||
<div class="rowpadding">
|
||||
<%-- <div class="row">
|
||||
<label class="col-md-3">Transitorio:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:DropDownList ID="DdlAlmacenTransitorio" runat="server" DataTextField="Almacen" DataValueField="CveAlmacen"
|
||||
CssClass="form-control input-sm select2me" Width="100%"></asp:DropDownList>
|
||||
</div>
|
||||
</div>--%>
|
||||
<div class="row rowpadding" id="divEmitir" runat="server">
|
||||
<label class="col-md-3">Emitir:</label>
|
||||
<div class="col-md-9">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<asp:CheckBox ID="ChkEmitirTimbrado" runat="server" CssClass="chksino" Text=" " OnCheckedChanged="ChkEmitirTimbrado_CheckedChanged" AutoPostBack="true" />
|
||||
</td>
|
||||
<td>
|
||||
<asp:CheckBox ID="ChkEmitirCartaPorte" runat="server" Text="Carta Porte" Visible="false" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row rowpadding">
|
||||
<label class="col-md-3">Chofer:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:DropDownList ID="DdlChofer" runat="server" DataTextField="ChoferLicencia" DataValueField="CveChofer" OnSelectedIndexChanged="DldChofer_SelectedIndexChanged" AutoPostBack="true" CssClass="form-control input-sm select2me" Width="100%"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RfvDdlChofer" runat="server" Enabled="false" ControlToValidate="DdlChofer" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Chofer''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VceDdlChofer" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlChofer" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row rowpadding">
|
||||
<label class="col-md-3">Unidad:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:DropDownList runat="server" ID="DdlUnidadCamion" AutoPostBack="true" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" DataValueField="CveCamion" DataTextField="CamionPlaca" OnSelectedIndexChanged="DdlUnidadCamionActivoFijo_SelectedIndexChanged"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RfvDdlUnidadCamion" runat="server" Enabled="false" ControlToValidate="DdlUnidadCamion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Unidad''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VceDdlUnidadCamion" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlUnidadCamion" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row rowpadding" runat="server" id="DvConfiguracionVeiculo" visible="false">
|
||||
<label class="col-md-3">Configuración:</label>
|
||||
<div class="col-md-9">
|
||||
<%--<asp:DropDownList runat="server" ID="DropDownList1" AutoPostBack="true" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" DataValueField="CveActivoFijo" DataTextField="CodigoDescripcion"></asp:DropDownList>--%>
|
||||
<asp:DropDownList ID="DdlConfigAuto" CssClass="form-control input-sm select2me" Width="100%" runat="server" AppendDataBoundItems="true" AutoPostBack="true" OnSelectedIndexChanged="DdlConfigAuto_SelectedIndexChanged" CausesValidation="true" DataTextField="ClaveConfigAutoTransporteDescripcion" DataValueField="CveConfigAutoTransporte" Style="padding: 0px">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RfvDdlConfigAuto" runat="server" Enabled="false" ControlToValidate="DdlConfigAuto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Configuración Carta Porte''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCERfvDdlConfigAuto" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlConfigAuto" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row rowpadding" runat="server" id="DvRemolque1" visible="false">
|
||||
<label class="col-md-3">Remolque 1:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:DropDownList runat="server" ID="DdlRemolque1" AutoPostBack="true" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" DataValueField="CveCamion" DataTextField="CamionPlaca" OnSelectedIndexChanged="DdlRemolque1_SelectedIndexChanged"></asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row rowpadding" runat="server" id="DvRemolque2" visible="false">
|
||||
<label class="col-md-3">Remolque 2:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:DropDownList runat="server" ID="DdlRemolque2" AutoPostBack="true" Width="100%" CssClass="form-control input-sm select2me" DataValueField="CveCamion" DataTextField="CamionPlaca"></asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="row rowpadding">
|
||||
<label class="col-md-3">F. Salida:</label>
|
||||
<div class="col-md-9" style="padding-top: 0px;">
|
||||
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 125px !important;">
|
||||
<asp:TextBox ID="TxtFechaEntrega" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Width="80px" ClientIDMode="Static"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton runat="server" ID="ImgFechaEntrega" class="btn default"> <i class="fa fa-calendar"></i> </asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MaskedEditExtender2" runat="server" TargetControlID="TxtFechaEntrega" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CalendarExtender2" TargetControlID="TxtFechaEntrega" PopupButtonID="ImgFechaEntrega" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="TxtFechaEntrega" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Entrega''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="CompareValidator1" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row rowpadding" runat="server" id="divFechaLlegada">
|
||||
<label class="col-md-3">F. Llegada:</label>
|
||||
<div class="col-md-4" style="padding-top: 0px;">
|
||||
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 125px !important;">
|
||||
<asp:TextBox ID="TxtFechaLlegada" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Width="80px" ClientIDMode="Static"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton runat="server" ID="ImgFechaEnvio" class="btn default"> <i class="fa fa-calendar"></i> </asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MaskedEditExtender3" runat="server" TargetControlID="TxtFechaLlegada" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CalendarExtender3" TargetControlID="TxtFechaLlegada" PopupButtonID="ImgFechaEnvio" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="CompareValidator2" runat="server" ControlToValidate="TxtFechaLlegada" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Envío''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender5" runat="server" HighlightCssClass="vco" TargetControlID="CompareValidator2" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<label class="col-md-1">Dist:</label>
|
||||
<div class="col-md-3">
|
||||
<asp:TextBox ID="TxtDistancia" runat="server" CssClass="form-control input-sm" Width="100%" Text="1"></asp:TextBox>
|
||||
<ajax:TextBoxWatermarkExtender ID="TBWEDistancia" runat="server" TargetControlID="TxtDistancia" WatermarkText="Distancia" WatermarkCssClass="watermarked" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row rowpadding" >
|
||||
<label class="col-md-3">Cliente:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:DropDownList ID="DdlClienteCarta" AutoPostBack="true" OnSelectedIndexChanged="DdlClienteCarta_SelectedIndexChanged" AppendDataBoundItems="true" runat="server" CssClass="form-control input-sm select2me" DataTextField="NombreComercial" DataValueField="CveCliente"></asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row rowpadding" >
|
||||
<label class="col-md-3">Direccón:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:DropDownList ID="DdlDireccionEnvio" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="SucursalClienteVentaDireccion" DataValueField="CveDireccionEnvio" Width="180px" Visible="false" >
|
||||
<asp:ListItem Selected="true" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<%--CARTA PORTE FIN--%>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<asp:UpdatePanel runat="server">
|
||||
|
||||
@@ -306,6 +306,61 @@ Partial Class Inventarios_EntradasSalidas
|
||||
End Property
|
||||
|
||||
|
||||
Property RequiereRemolque As Boolean
|
||||
Get
|
||||
If ViewState("RequiereRemolque") Is Nothing Then
|
||||
ViewState("RequiereRemolque") = False
|
||||
End If
|
||||
|
||||
Return Boolean.Parse(ViewState("RequiereRemolque").ToString)
|
||||
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("RequiereRemolque") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Property MostrarRemolques As Boolean
|
||||
Get
|
||||
If ViewState("MostrarRemolques") Is Nothing Then
|
||||
ViewState("MostrarRemolques") = False
|
||||
End If
|
||||
|
||||
Return Boolean.Parse(ViewState("MostrarRemolques").ToString)
|
||||
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("MostrarRemolques") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Private Property CveMovimientoTimbrado As Integer
|
||||
Get
|
||||
Return CType(ViewState("CveMovimientoTimbrado"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveMovimientoTimbrado") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Property EsApoyoLogistico As Boolean
|
||||
Get
|
||||
If ViewState("EsApoyoLogistico") Is Nothing Then
|
||||
ViewState("EsApoyoLogistico") = False
|
||||
End If
|
||||
|
||||
Return Boolean.Parse(ViewState("EsApoyoLogistico").ToString)
|
||||
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("EsApoyoLogistico") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
@@ -317,6 +372,12 @@ Partial Class Inventarios_EntradasSalidas
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
If IfNull(Request("APOYO"), "").ToString = "1" Then
|
||||
DivEmitirTransitorio.Visible = True
|
||||
EsApoyoLogistico = True
|
||||
End If
|
||||
|
||||
CveMovimiento = -1
|
||||
CveMovimientoRelacionado = -1
|
||||
TieneRelacionado = -1
|
||||
@@ -581,6 +642,10 @@ Partial Class Inventarios_EntradasSalidas
|
||||
DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen NOT IN (9,11)")
|
||||
End If
|
||||
|
||||
If EsApoyoLogistico Then
|
||||
DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen NOT IN (27)") 'GlobalDTAlmacen(UsuarioActual.CveEmpresa)
|
||||
End If
|
||||
|
||||
DdlAlmacenInventarioFisico.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen NOT IN (9,11)") 'GlobalDTAlmacen(UsuarioActual.CveEmpresa)
|
||||
DdlAlmacenCambioVigencias.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen NOT IN (9,11)")
|
||||
|
||||
@@ -612,6 +677,17 @@ Partial Class Inventarios_EntradasSalidas
|
||||
|
||||
' CargaDdlPaqueteria()
|
||||
|
||||
DdlChofer.DataSource = GlobalDTChoferes(UsuarioActual.CveEmpresa)
|
||||
DdlChofer.DataBind()
|
||||
|
||||
DdlChofer.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
TxtFechaEntrega.Text = Now.ToShortDateString
|
||||
TxtFechaLlegada.Text = Now.ToShortDateString
|
||||
|
||||
CargarCamiones()
|
||||
|
||||
CargaClientesCarta()
|
||||
|
||||
End Sub
|
||||
Private Sub CargaPS()
|
||||
DdlProducto2.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
|
||||
@@ -1357,6 +1433,16 @@ Partial Class Inventarios_EntradasSalidas
|
||||
AgregarPS()
|
||||
End Sub
|
||||
Private Sub AgregarPS()
|
||||
|
||||
|
||||
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
|
||||
If ChkEmitirTimbrado.Checked AndAlso ChkEmitirCartaPorte.Checked Then
|
||||
If Not ValidaPSSAT(DrPS) Then
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If Not DdlProducto2.SelectedValue.ToEntero > 0 Then
|
||||
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
||||
Alert("Es necesario especificar el producto.", TipoMensaje.MsgAdvertencia)
|
||||
@@ -1365,7 +1451,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
|
||||
AddNew(DdlProducto2.SelectedValue.ToEntero, DdlProducto2.SelectedText, DdlUnidad.SelectedValue.ToEntero, DdlUnidad.SelectedItem.Text, txtCantidad.Text.ToDecimal,
|
||||
txtPrecio.Text.ToDecimal, TxtnSerie.Text.Replace(" ", String.Empty), LblCodigo.Text, HdnCodigoAF.Value, HdnCveActivoFijo.Value, TxtObservacionesdetalle.Text,
|
||||
TxtnLote.Text.Trim, TxtnFechaCaducidad.Text.ToDate, DdlSeccionAlmacen.SelectedValue.ToEntero, DdlSeccionAlmacen.SelectedItem.Text, CveCultivoCuadroDetalle:=DdlModalCultivosCuadro.SelectedValue.Toentero)
|
||||
TxtnLote.Text.Trim, TxtnFechaCaducidad.Text.ToDate, DdlSeccionAlmacen.SelectedValue.ToEntero, DdlSeccionAlmacen.SelectedItem.Text, CveCultivoCuadroDetalle:=DdlModalCultivosCuadro.SelectedValue.ToEntero)
|
||||
LimpiarAgregar()
|
||||
|
||||
txtCantidad.Text = ""
|
||||
@@ -1946,6 +2032,42 @@ Partial Class Inventarios_EntradasSalidas
|
||||
ErrorMovInv = RetornoVirtual.TieneError
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Dim SerieInsertadaTimbre As String = ""
|
||||
Dim FolioInsertadoTimbre As Integer = -1
|
||||
Dim CveTimbre As Integer = -1
|
||||
|
||||
If Not ErrorAC And Not ErrorMovInv Then
|
||||
|
||||
If ChkEmitirTimbrado.Checked Then
|
||||
|
||||
Dim ObjGral As New ClsGenerales(ObjInventario.IniciaTransacSQL)
|
||||
Dim CveSubProyectoTimbre As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros($"CveAlmacen = {DdlAlmacen.SelectedValue}").Rows(0)("CveSubProyecto").ToString.ToEntero
|
||||
Dim Fechallegada As DateTime = (TxtFechaLlegada.Text & " 23:59:59").ToDateTime
|
||||
|
||||
Dim CveEntregaAlmacen As Integer = ObjGral.AddInvEntregaAlmacenRuta(CveSubProyectoTimbre, -1, -1, CveMovimiento, DdlChofer.SelectedValue.ToEntero, DdlUnidadCamion.SelectedValue.ToEntero, TxtFechaEntrega.Text.ToDate, TxtFechaLlegada.Text.ToDate, "T", "", "", MinFecha, 1, 1, TxtDistancia.Text.ToEntero,
|
||||
CveConfigAutoTransporte:=DdlConfigAuto.SelectedValue.ToEntero, CveCamionRemolque1:=DdlRemolque1.SelectedValue.ToEntero, CveCamionRemolque2:=DdlRemolque2.SelectedValue.ToEntero)
|
||||
|
||||
If CveEntregaAlmacen > 0 Then
|
||||
CveTimbre = ObjGral.AddGralTimbre("Tra", CveSubProyectoTimbre, TxtFechaEntrega.Text.ToDate, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen:=CveEntregaAlmacen, AplicaCP:=ChkEmitirCartaPorte.Checked)
|
||||
|
||||
If CveTimbre > 0 Then
|
||||
SerieInsertadaTimbre = ObjGral.SerieInsertada
|
||||
FolioInsertadoTimbre = ObjGral.FolioInsertado
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
If Not ErrorAC And Not ErrorMovInv Then
|
||||
Dim Msg As New StringBuilder
|
||||
Msg.AppendFormat("<br/>El Movimiento se registro con el Folio: <b><a href='/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}'>{0}</a></b>", ObjInventario.Folio, CveMovimiento)
|
||||
@@ -1963,6 +2085,12 @@ Partial Class Inventarios_EntradasSalidas
|
||||
ObjInventario.Commit() ' aplica los movimientos insertados
|
||||
If ObjContaAC IsNot Nothing Then ObjContaAC.Commit()
|
||||
|
||||
|
||||
If ChkEmitirTimbrado.Checked Then
|
||||
CveMovimientoTimbrado = CveMovimiento
|
||||
EmitirTimbrado(CveTimbre, CveMovimientoTimbrado, Msg)
|
||||
End If
|
||||
|
||||
Alert(Msg.ToString, TipoMensaje.MsgInformacion)
|
||||
|
||||
'Limpia Valores cuando inserta de campos especiales
|
||||
@@ -3617,11 +3745,13 @@ Partial Class Inventarios_EntradasSalidas
|
||||
#Region "DDL CLIENTE / CLIENTE SUCURSAL - SELECTED INDEX CHANGED"
|
||||
Private Sub InicializaClientes()
|
||||
If UsuarioActual.CveEmpresa.Contiene(72, 80) AndAlso CveMovimiento <= 0 Then
|
||||
|
||||
DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa)
|
||||
DdlClientes.DataBind()
|
||||
|
||||
DdlClientes.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
DdlClientes.SelectedValue = "-1"
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub ActivaClientes()
|
||||
@@ -5508,10 +5638,322 @@ Partial Class Inventarios_EntradasSalidas
|
||||
Next
|
||||
Return Timbre
|
||||
End Function
|
||||
|
||||
#Region "APOYO LOGISTICO"
|
||||
|
||||
Protected Sub ChkEmitirTimbrado_CheckedChanged(sender As Object, e As EventArgs)
|
||||
|
||||
If ChkEmitirTimbrado.Checked Then
|
||||
ChkEmitirCartaPorte.Checked = True
|
||||
ChkEmitirCartaPorte.Visible = True
|
||||
Else
|
||||
ChkEmitirCartaPorte.Visible = False
|
||||
ChkEmitirCartaPorte.Checked = False
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub DldChofer_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
' Dim ObjAcar As New ClsAcarreos()
|
||||
|
||||
' If ObjAcar.GetChofer(DdlChofer.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, 1, -1) Then
|
||||
' Dim dr As DataRow = ObjAcar.DtResultados.Rows(0)
|
||||
' If dr IsNot Nothing Then
|
||||
' TxtResponsableRecibio.Text = dr("Chofer").ToString
|
||||
' TxtIdentificacion.Text = dr("Identificacion").ToString
|
||||
' TxtDomicilio.Text = dr("Domicilio").ToString
|
||||
' TxtTelefono.Text = dr("Telefono").ToString
|
||||
' TxtCiudad.Text = dr("Ciudad").ToString
|
||||
' TxtLicencia.Text = dr("Licencia").ToString
|
||||
' End If
|
||||
' End If
|
||||
' ObjAcar.Dispose()
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlUnidadCamionActivoFijo_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
|
||||
|
||||
DvRemolque1.Visible = False
|
||||
DvRemolque2.Visible = False
|
||||
|
||||
DdlRemolque1.SelectedValueExist(-1)
|
||||
DdlRemolque2.SelectedValueExist(-1)
|
||||
|
||||
If DdlUnidadCamion.SelectedValue.ToEntero > 0 Then
|
||||
|
||||
|
||||
Using ObjInv As New ClsInventarios
|
||||
|
||||
If ObjInv.GetCamiones(DdlUnidadCamion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, 1) Then
|
||||
DdlConfigAuto.SelectedValueExist(ObjInv.DtResultados.FiltroPrimeroValor("CveConfigAutoTransporte"))
|
||||
DdlConfigAuto_SelectedIndexChanged(Nothing, Nothing)
|
||||
End If
|
||||
|
||||
End Using
|
||||
|
||||
|
||||
End If
|
||||
|
||||
UpEmitirTransitorio.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub DdlConfigAuto_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
ValidaConfiguracionVehiculo()
|
||||
End Sub
|
||||
Private Sub ValidaConfiguracionVehiculo()
|
||||
DvRemolque1.Visible = False
|
||||
DvRemolque2.Visible = False
|
||||
|
||||
DdlRemolque1.SelectedValueExist(-1)
|
||||
DdlRemolque2.SelectedValueExist(-1)
|
||||
|
||||
If DdlConfigAuto.SelectedValue.ToEntero > 0 Then
|
||||
|
||||
Using ObjGrales As New ClsGenerales
|
||||
If ObjGrales.GetCartaPorteConfigAutoTransportes() Then
|
||||
Dim Remolque As String = ObjGrales.DtResultados.FiltroPrimeroValor("Remolque", $" CveConfigAutoTransporte ='{DdlConfigAuto.SelectedValue.ToEntero}'")
|
||||
|
||||
|
||||
If Remolque = "1" Then
|
||||
RequiereRemolque = True
|
||||
MostrarRemolques = True
|
||||
End If
|
||||
|
||||
If Remolque = "0, 1" Then
|
||||
RequiereRemolque = False
|
||||
MostrarRemolques = True
|
||||
End If
|
||||
|
||||
If Remolque = "0" Then
|
||||
RequiereRemolque = False
|
||||
MostrarRemolques = False
|
||||
End If
|
||||
End If
|
||||
End Using
|
||||
|
||||
Else
|
||||
RequiereRemolque = False
|
||||
MostrarRemolques = False
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
If RequiereRemolque Or MostrarRemolques Then
|
||||
DvRemolque1.Visible = True
|
||||
End If
|
||||
|
||||
If Not RequiereRemolque Then
|
||||
DvConfiguracionVeiculo.Visible = False
|
||||
Else
|
||||
DvConfiguracionVeiculo.Visible = True
|
||||
End If
|
||||
|
||||
|
||||
UpEmitirTransitorio.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlRemolque1_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
|
||||
DdlRemolque2.Items.Clear()
|
||||
|
||||
If DdlRemolque1.SelectedValue.ToEntero > 0 Then
|
||||
DvRemolque2.Visible = True
|
||||
|
||||
Using ObjInv As New ClsInventarios
|
||||
If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2, Estatus:=1) Then
|
||||
DdlRemolque2.DataSource = ObjInv.DtResultados.FiltraParametros($"CveCamion <> {DdlRemolque1.SelectedValue.ToEntero}")
|
||||
End If
|
||||
End Using
|
||||
|
||||
DdlRemolque2.DataBind()
|
||||
|
||||
|
||||
Else
|
||||
DvRemolque2.Visible = False
|
||||
End If
|
||||
|
||||
DdlRemolque2.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
||||
|
||||
UpEmitirTransitorio.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Function ValidaPSSAT(DrPS As DataRow) As Boolean
|
||||
Dim Respuesta As Boolean = False
|
||||
|
||||
Dim CveSATPS As Integer = DrPS("CveSATPS").ToString.ToEntero
|
||||
Dim PesoKg As Decimal = DrPS("PesoKg").ToString.ToDecimal
|
||||
Dim SATClaveUnidadMedida As String = DrPS("SATClaveUnidadMedida").ToString.Trim
|
||||
|
||||
If CveSATPS > 0 AndAlso PesoKg > 0 AndAlso SATClaveUnidadMedida.Length > 0 Then
|
||||
Respuesta = True
|
||||
Else
|
||||
Respuesta = False
|
||||
Dim SBMensaje As New StringBuilder
|
||||
|
||||
SBMensaje.AppendLine("El producto seleccionado presenta la siguiente situación: <br>")
|
||||
|
||||
If CveSATPS <= 0 Then SBMensaje.AppendLine("-Producto SAT no asignado. <br>")
|
||||
|
||||
If PesoKg = 0 Then SBMensaje.AppendLine("-Producto sin peso definido. <br>")
|
||||
|
||||
If SATClaveUnidadMedida.Length = 0 Then SBMensaje.AppendLine("-Producto sin unidad de medida SAT asignada. ")
|
||||
|
||||
SBMensaje.AppendLine($"<br><strong><a class='texto' target='_blank' href='/Ventas/ProductosServicios.aspx?CvePS={DrPS("CvePS").ToString}' > Editar Producto </a></strong>")
|
||||
|
||||
Alert(SBMensaje.ToString, TipoMensaje.MsgAdvertencia)
|
||||
|
||||
End If
|
||||
|
||||
Return Respuesta
|
||||
End Function
|
||||
|
||||
|
||||
Public Sub CargarCamiones()
|
||||
|
||||
DdlConfigAuto.Items.Clear()
|
||||
DdlUnidadCamion.Items.Clear()
|
||||
|
||||
'DdlUnidadCamion.DataSource = GlobalDTInvCamiones(UsuarioActual.CveEmpresa)
|
||||
'DdlUnidadCamion.DataBind()
|
||||
|
||||
|
||||
|
||||
Using ObjInv As New ClsInventarios
|
||||
|
||||
If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 1, Estatus:=1) Then
|
||||
DdlUnidadCamion.DataSource = ObjInv.DtResultados
|
||||
End If
|
||||
|
||||
|
||||
If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2, Estatus:=1) Then
|
||||
DdlRemolque1.DataSource = ObjInv.DtResultados
|
||||
End If
|
||||
|
||||
End Using
|
||||
|
||||
DdlUnidadCamion.DataBind()
|
||||
DdlUnidadCamion.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
|
||||
|
||||
|
||||
DdlRemolque1.DataBind()
|
||||
DdlRemolque1.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
|
||||
|
||||
|
||||
|
||||
Using ObjGrales As New ClsGenerales
|
||||
|
||||
If ObjGrales.GetCartaPorteConfigAutoTransportes() Then
|
||||
DdlConfigAuto.DataSource = ObjGrales.DtResultados
|
||||
End If
|
||||
|
||||
End Using
|
||||
|
||||
DdlConfigAuto.DataBind()
|
||||
DdlConfigAuto.Items.Insert(0, New ListItem("Seleccione una", "-1"))
|
||||
|
||||
'Using ObjGral As New ClsGenerales
|
||||
' If ObjGral.GetCartaPorteConfigAutoTransportes() Then
|
||||
' DdlConfigAuto.DataSource = ObjGral.DtResultados
|
||||
' End If
|
||||
'End Using
|
||||
|
||||
'DdlConfigAuto.DataBind()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaClientesCarta()
|
||||
DdlClienteCarta.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa)
|
||||
DdlClienteCarta.DataBind()
|
||||
|
||||
DdlClienteCarta.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
DdlClienteCarta.SelectedValue = "-1"
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub EmitirTimbrado(CveTimbre As Integer, CveMovimientoTimbrado As Integer, ByRef MensajeAlert As StringBuilder)
|
||||
|
||||
Dim ObjTimbres As New Timbres("Tra", CveTimbre, UsuarioActual)
|
||||
|
||||
MensajeAlert.Append("<br/><br/>")
|
||||
|
||||
If ObjTimbres.Timbrar() Then
|
||||
|
||||
Try
|
||||
PdfFactura(ObjTimbres.ObjFactura)
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
|
||||
MensajeAlert.Append("Emitido con éxito.")
|
||||
'XML
|
||||
Dim ArchivoXML = String.Format("{0}/XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta, ObjTimbres.ObjFactura.TipoDocto, ObjTimbres.ObjFactura.SerieFolio)
|
||||
If File.Exists(ArchivoXML) Then
|
||||
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar XML</a></li></ul>", Encripta(String.Format("OP=DesXmlTra&CVEMOVIMIENTO={0}&EXT={1}&FOLIO={2}&TIPODOCTO={3}", CveMovimientoTimbrado, "XML", ObjTimbres.ObjFactura.SerieFolio, ObjTimbres.ObjFactura.TipoDocto)))
|
||||
End If
|
||||
'PDF
|
||||
'Dim ArchivoPDF = String.Format("{0}/PDF/{1}/{2}.pdf", UsuarioActual.Empresa.Ruta, ObjTimbres.ObjFactura.TipoDocto, ObjTimbres.ObjFactura.SerieFolio)
|
||||
'If File.Exists(ArchivoPDF) Then
|
||||
' MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul>", Encripta(String.Format("OP=DesPdfTra&CVEMOVIMIENTO={0}&EXT={1}&FOLIO={2}&TIPODOCTO={3}", CveMovimientoTimbrado, "PDF", ObjTimbres.ObjFactura.SerieFolio, ObjTimbres.ObjFactura.TipoDocto)))
|
||||
'End If
|
||||
|
||||
If ChkEmitirCartaPorte.Checked Then
|
||||
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar Carta Porte</a></li></ul>", Encripta(String.Format("OP=CARPOTIMBRE&CVETIMBRE={0}", CveTimbre)))
|
||||
Else
|
||||
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar Traslado</a></li></ul>", Encripta(String.Format("OP=CARPO&CVEMOV={0}", CveMovimientoTimbrado)))
|
||||
End If
|
||||
|
||||
Else
|
||||
MensajeAlert.AppendFormat("<ul><li>{0}</li></ul>", ObjTimbres.MsgError.ToString)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlClienteCarta_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
CargaDireccionesEnvio()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaDireccionesEnvio()
|
||||
Dim ObjClientes As New ClsClientes
|
||||
Dim TieneError = False
|
||||
|
||||
DdlDireccionEnvio.Items.Clear()
|
||||
If ObjClientes.DireccionEnvioGet(-1, DdlClienteCarta.SelectedValue.ToEntero, -1) Then
|
||||
DdlDireccionEnvio.DataSource = ObjClientes.DtResultados.FiltraParametros(String.Format("Estatus = 1"))
|
||||
DdlDireccionEnvio.DataBind()
|
||||
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
If TieneError Then
|
||||
Alert("Ocurrió un error al obtener las direcciones de envío", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
ObjClientes.Dispose()
|
||||
|
||||
|
||||
DdlDireccionEnvio.Items.Add(New ListItem("Seleccione una", "-1"))
|
||||
|
||||
UpEmitirTransitorio.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Private Class MMovimientoVirtual
|
||||
Public Property CveMovimientoVirtual As Integer
|
||||
Public Property FolioVirtual As String
|
||||
Public Property TieneError As Boolean
|
||||
End Class
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
@@ -3354,6 +3354,29 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Return Respuesta
|
||||
End Function
|
||||
|
||||
Private Sub CargaDireccionesEnvio()
|
||||
Dim ObjClientes As New ClsClientes
|
||||
Dim TieneError = False
|
||||
|
||||
DdlDireccionEnvio.Items.Clear()
|
||||
If ObjClientes.DireccionEnvioGet(-1, CveCliente, -1) Then
|
||||
DdlDireccionEnvio.DataSource = ObjClientes.DtResultados.FiltraParametros(String.Format("Estatus = 1"))
|
||||
DdlDireccionEnvio.DataBind()
|
||||
'DdlDireccionEnvio.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
TmpDTEnvioDireccion = ObjClientes.DtResultados
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
If TieneError Then
|
||||
Alert("Ocurrió un error al obtener las direcciones de envío", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
ObjClientes.Dispose()
|
||||
UpCliente.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
End Class
|
||||
|
||||
|
||||
@@ -222,13 +222,19 @@
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<table>
|
||||
<tr>
|
||||
<tr runat="server" id="TREstatus" visible="true">
|
||||
<td><b>Estatus:</b></td>
|
||||
<td>
|
||||
<asp:DropDownList CssClass="form-control input-sm select2me" ID="DdlEstatusOS" runat="server" AutoPostBack="true" Width="100%" DataValueField="CveEstatusOrdenServicio" DataTextField="EstatusOrdenServicio">
|
||||
</asp:DropDownList>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr runat="server" id="TREstatus2" visible="false">
|
||||
<td>
|
||||
<asp:LinkButton runat="server" ID="LnkFinalizar" Text="Finalizar" CssClass="btn btn-primary" OnClick="LnkFinalizar_Click"></asp:LinkButton>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1124,6 +1130,51 @@
|
||||
</div>
|
||||
</div>
|
||||
<%-- FIN HISTORIAL --%>
|
||||
|
||||
|
||||
<%--MODAL FINALIZAR ORDEN INICIO --%>
|
||||
|
||||
<div id="DVModalFinalizarOrden" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpModalFinalizarOrden" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="ModalLabel">Finalizar Orden</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-2">
|
||||
Producto:
|
||||
</div>
|
||||
<div class="col-lg-10">
|
||||
<%-- <ADS:Dropdownlost runat="server" ID="DdlPsModalFinalizar" CssStyle="width: 100%;" CssClass="DdlPS " CssClassDdl="select2me " IncluyeTodos="false"
|
||||
DataTextField="PSCodigo" DataValueField="CvePS" />--%>
|
||||
|
||||
<ADS:Dropdownlost runat="server" ID="DdlPsModalFinalizar" CssStyle="width: 100%;" CssClass="DdlPS " CssClassDdl="select2me " IncluyeTodos="false"
|
||||
DataTextField="PSCodigo" DataValueField="CvePS"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
||||
<asp:LinkButton ID="LnkModalFinalizarOrden" runat="server" CssClass="btn btn-primary" data-toggle="confirmation" data-popout="true" data-original-title="confirmar" data-btn-ok-label="si"
|
||||
OnClick="LnkModalFinalizarOrden_Click">Finalizar</asp:LinkButton>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
<%--MODAL FINALIZAR ORDEN INICIO --%>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="content7" ContentPlaceHolderID="JS" runat="server">
|
||||
<script src="/Scripts/DataTables.js"></script>
|
||||
|
||||
@@ -383,6 +383,31 @@ Partial Class OS_OrdenesServicios
|
||||
End If
|
||||
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
|
||||
DivDetalles.Attributes.Add("style", "display:none") 'No se usa .visible = false pora que la llamada a updatepanel no cause errores de js en el cliente
|
||||
TREstatus.Visible = False
|
||||
|
||||
TREstatus2.Visible = If(TipoEstatus.Contiene(4, 5), False, True)
|
||||
|
||||
DdlPsModalFinalizar.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then
|
||||
'DdlPS.ddlWS.Attributes.Add("data-cveclasificacion", DdlClasificacion.SelectedValue)
|
||||
DdlPsModalFinalizar.SelectedText = ""
|
||||
DdlPsModalFinalizar.SelectedValue = "-1"
|
||||
Else
|
||||
DdlPS.ddl.Items.Clear()
|
||||
'DdlPS.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=DdlClasificacion.SelectedValue.ToEntero)
|
||||
DdlPsModalFinalizar.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
|
||||
DdlPsModalFinalizar.ddl.DataBind()
|
||||
DdlPsModalFinalizar.ddl.Items.Insert(0, New ListItem("Seleccione el Producto", "-1"))
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
@@ -496,6 +521,7 @@ Partial Class OS_OrdenesServicios
|
||||
|
||||
TxtDescripcion.Text = ObjOS.Descripcion
|
||||
TxtSolicito.Text = ObjOS.PersonaSolicito
|
||||
CveOsDetalle = ObjOS.CveOSDetalle
|
||||
|
||||
TxtFechaRecibido.Text = ObjOS.FechaRecepcion.ToString
|
||||
CveFolio = ObjOS.Folio
|
||||
@@ -788,7 +814,7 @@ Partial Class OS_OrdenesServicios
|
||||
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
If CargaPublicoGeneral Then
|
||||
CveCliente = ObjCliente.CveCliente
|
||||
Me.CveCliente = ObjCliente.CveCliente
|
||||
End If
|
||||
|
||||
TxtCodigo.Text = ObjCliente.Codigo
|
||||
@@ -2785,4 +2811,32 @@ Partial Class OS_OrdenesServicios
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub LnkFinalizar_Click(sender As Object, e As EventArgs)
|
||||
RegistraScript("$('#DVModalFinalizarOrden').modal('show');")
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkModalFinalizarOrden_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim TieneError As Boolean = True
|
||||
|
||||
Dim CvePsFinalizar As Integer = DdlPsModalFinalizar.SelectedValue.ToEntero
|
||||
|
||||
If Not CvePsFinalizar > 0 Then
|
||||
Alert("El proiducto es requerido.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
Dim objOS As New ClsOS
|
||||
If objOS.UpdateOrdenesServiciosFinaliza(CveOS, CveOsDetalle, CvePsFinalizar, UsuarioActual.CveEmpresa) Then
|
||||
TieneError = False
|
||||
End If
|
||||
objOS.Dispose()
|
||||
|
||||
If Not TieneError Then
|
||||
Alert("Orden Finalizada Correctamente", TipoMensaje.MsgInformacion, "location.reload(true);")
|
||||
RegistraScript("$('#DVModalFinalizarOrden').modal('hide');")
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
@@ -117,7 +117,17 @@
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
|
||||
|
||||
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UpAcciones">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnlAgregarServicioDomiciolio" runat="server" OnClick="LnlAgregarServicioDomiciolio_Click"> <i class="fa fa-plus" aria-hidden="true"></i> Agregar Servicios a Domicilio </asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
@@ -415,92 +425,197 @@
|
||||
|
||||
|
||||
|
||||
<div id="DVModalOSAsginar" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalOSAsginar" UpdateMode="Conditional">
|
||||
<div id="DVModalOS" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalOS" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">Asignar Orden de Servicio</h4>
|
||||
<h4 class="modal-title"><asp:Label runat="server" ID="LblModalOStitulo" ></asp:Label></h4>
|
||||
</div>
|
||||
<div class="modal-body" >
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group form-md-line-input">
|
||||
<asp:Label runat="server" ID="LblModalCliente" Text="" CssClass="form-control"></asp:Label>
|
||||
<label for="<%= LblModalCliente.ClientID.ToString()%>">Cliente: </label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group form-md-line-input">
|
||||
<asp:Label runat="server" ID="LblModalConcepto" Text="" CssClass="form-control"></asp:Label>
|
||||
<label for="<%= LblModalConcepto.ClientID.ToString()%>">Concepto: </label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group form-md-line-input">
|
||||
<asp:Label runat="server" ID="LblModalSubProyecto" Text="" CssClass="form-control"></asp:Label>
|
||||
<label for="<%= LblModalSubProyecto.ClientID.ToString()%>"><asp:Label runat="server" ID="LblModalSubProyectoLabel"></asp:Label>: </label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input">
|
||||
<asp:DropDownList ID="DdlTecnicoAsignar" Width="100%" runat="server" CssClass="form-control select2me" DataTextField="Nombre" Visible="true" DataValueField="CveUsuario">
|
||||
</asp:DropDownList>
|
||||
|
||||
<asp:RequiredFieldValidator ID="RfvDdlTecnicoAsignar" InitialValue="-1" runat="server" ControlToValidate="DdlTecnicoAsignar" Display="None"
|
||||
ErrorMessage="El campo <b>''Técnico''</b> es requerido por la aplicación" ValidationGroup="GrpAsignar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCERfvDdlTecnicoAsignar" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlTecnicoAsignar" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
<label for="<%= DdlTecnicoAsignar.ClientID.ToString()%>">Técnico: </label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright date date-picker date date-picker" style="width:150px">
|
||||
<asp:TextBox ID="TxtModalFechaOS" CssClass="form-control" runat="server" Width="150px"></asp:TextBox>
|
||||
<span class="input-group-btn " style="position: absolute; right: 41px; top: 9px;">
|
||||
<asp:LinkButton ID="LnkTxtModalFechaOS" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="METxtModalFechaOS" runat="server" TargetControlID="TxtModalFechaOS" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CETxtModalFechaOS" TargetControlID="TxtModalFechaOS" PopupButtonID="LnkTxtModalFechaOS" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
|
||||
<asp:RequiredFieldValidator ID="RfvTxtModalFechaOS" runat="server" ControlToValidate="TxtModalFechaOS" Display="None"
|
||||
ErrorMessage="El campo <b>''Fecha''</b> es requerido por la aplicación" ValidationGroup="GrpAsignar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VceRfvTxtModalFechaOS" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtModalFechaOS" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
<label for="<%= TxtModalFechaOS.ClientID.ToString()%>">Fecha: </label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input">
|
||||
<cc1:TimeSelector ID="TSTimeSelector" runat="server" DisplaySeconds="false" DisplayButtons="false" Visible="true" CssClass="form-control" Font-Size="13pt"></cc1:TimeSelector>
|
||||
<label for="<%= TSTimeSelector.ClientID.ToString()%>">Hora Servicio: </label>
|
||||
<div class="row" runat="server" id="DVFolio" visible="false">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input" style="font-size:20px">
|
||||
|
||||
<label for="<%= HLkFolio.ClientID.ToString()%>" style="font-size:20px" >Folio: </label>
|
||||
<asp:HyperLink ID="HLkFolio" runat="server" CssClass="Texto" Target="_blank" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-6">
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright date date-picker date date-picker" style="width: 150px">
|
||||
<asp:TextBox ID="TxtFechaOS" CssClass="form-control" runat="server" Width="150px"></asp:TextBox>
|
||||
<span class="input-group-btn " style="position: absolute; right: 41px; top: 9px;">
|
||||
<asp:LinkButton ID="LnkTxtFechaOS" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="TxtFechaOS" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaOS" PopupButtonID="LnkTxtFechaOS" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
|
||||
<asp:RequiredFieldValidator ID="RfvTxtFechaOS" runat="server" ControlToValidate="TxtFechaOS" Display="None"
|
||||
ErrorMessage="El campo <b>''Fecha''</b> es requerido por la aplicación" ValidationGroup="GrpAsignar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vceTxtFechaOS" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtFechaOS" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
<label for="<%= TxtFechaOS.ClientID.ToString()%>">Fecha: </label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
|
||||
<div class="form-group form-md-line-input">
|
||||
|
||||
<asp:DropDownList ID="DdlSubProyectoOS" AppendDataBoundItems="true" CssClass="form-control select2me" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="100%" Height="30px">
|
||||
<asp:ListItem Selected="true" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
|
||||
<asp:RequiredFieldValidator ID="RFVDdlSubProyectoOS" InitialValue="-1" runat="server" ControlToValidate="DdlSubProyectoOS" Display="None"
|
||||
ErrorMessage="El campo <b>''''</b> es requerido por la aplicación" ValidationGroup="GrpAsignar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEDdlSubProyectoOS" runat="server" HighlightCssClass="vco" TargetControlID="RFVDdlSubProyectoOS" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
<label for="<%= DdlSubProyectoOS.ClientID.ToString()%>">
|
||||
<asp:Label runat="server" ID="LblSubProyectoOS"></asp:Label>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="form-group col-md-12 form-md-line-input input-iconright selectmodal">
|
||||
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlClientesWS">Cliente:</asp:Label>
|
||||
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientesWS" Width="50%" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 267px;"></ADS:Dropdownlost>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%--DESCRIPCION--%>
|
||||
<div class="form-group form-md-line-input">
|
||||
<asp:TextBox ID="TxtDescripcion" runat="server" MaxLength="500" CssClass="form-control" />
|
||||
<label for="<%= TxtDescripcion.ClientID.ToString()%>">Descripción: </label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%--UBICACION--%>
|
||||
<div class="form-group form-md-line-input">
|
||||
<asp:TextBox ID="TxtDireccion" runat="server" MaxLength="300" CssClass="form-control" />
|
||||
<label for="<%= TxtDireccion.ClientID.ToString()%>">Ubicación: </label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<%--TELEFONO--%>
|
||||
<div class="form-group form-md-line-input">
|
||||
<asp:TextBox ID="TxtTelefono" CssClass="form-control" runat="server" MaxLength="10"></asp:TextBox>
|
||||
<ajax:MaskedEditExtender ID="MaskedEditExtender4" runat="server" TargetControlID="TxtTelefono" ClearMaskOnLostFocus="false" MaskType="None" Mask="(999) 999-9999" MessageValidatorTip="true" InputDirection="LeftToRight" ErrorTooltipEnabled="True"></ajax:MaskedEditExtender>
|
||||
<label for="<%= TxtTelefono.ClientID.ToString()%>">Telefono: </label>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<%--CORREO--%>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtEmail" CssClass="form-control" runat="server" MaxLength="300"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FilTxtEmail" runat="server" FilterType="Numbers, LowercaseLetters, UppercaseLetters, Custom" ValidChars=".;@_-ñ" TargetControlID="TxtEmail" />
|
||||
<asp:RegularExpressionValidator ID="REVEmail" runat="server" CssClass="help-block errorimput" ValidationExpression="(([a-zA-Z0-9ñÑ_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)(\s*;\s*|\s*$))*" ControlToValidate="TxtEmail" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Correo''</b> no es válido, por favor ingrése uno correcto." ValidationGroup="GrpAsignar"></asp:RegularExpressionValidator>
|
||||
<asp:Label AssociatedControlID="TxtEmail" runat="server" Text="Correo:"></asp:Label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr style="border: 0; height: 1px; background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));" />
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<%--MODELO--%>
|
||||
<div class="form-group form-md-line-input">
|
||||
<asp:DropDownList ID="DdlModeloAuto" CssClass="form-control select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="ModeloMarca" Width="100%"
|
||||
DataValueField="CveModeloAuto">
|
||||
</asp:DropDownList>
|
||||
<label for="<%= DdlModeloAuto.ClientID.ToString()%>">Modelo: </label>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<%--AÑO--%>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtAnio" CssClass="form-control" runat="server" MaxLength="4"></asp:TextBox>
|
||||
<asp:Label AssociatedControlID="TxtAnio" runat="server" Text="Año:"></asp:Label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<hr style="border: 0; height: 1px; background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));" />
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input">
|
||||
<asp:DropDownList ID="DdlTecnicoAsignar" Width="100%" runat="server" CssClass="form-control select2me" DataTextField="Nombre" Visible="true" DataValueField="CveUsuario">
|
||||
</asp:DropDownList>
|
||||
|
||||
<%--<asp:RequiredFieldValidator ID="RfvDdlTecnicoAsignar" InitialValue="-1" runat="server" ControlToValidate="DdlTecnicoAsignar" Display="None"
|
||||
ErrorMessage="El campo <b>''Técnico''</b> es requerido por la aplicación" ValidationGroup="GrpAsignar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCERfvDdlTecnicoAsignar" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlTecnicoAsignar" Width="350px"></ajax:ValidatorCalloutExtender>--%>
|
||||
|
||||
<label for="<%= DdlTecnicoAsignar.ClientID.ToString()%>">Técnico: </label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright date date-picker date date-picker" style="width: 150px">
|
||||
<asp:TextBox ID="TxtModalFechaOS" CssClass="form-control" runat="server" Width="150px"></asp:TextBox>
|
||||
<span class="input-group-btn " style="position: absolute; right: 41px; top: 9px;">
|
||||
<asp:LinkButton ID="LnkTxtModalFechaOS" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="METxtModalFechaOS" runat="server" TargetControlID="TxtModalFechaOS" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CETxtModalFechaOS" TargetControlID="TxtModalFechaOS" PopupButtonID="LnkTxtModalFechaOS" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
|
||||
<%--<asp:RequiredFieldValidator ID="RfvTxtModalFechaOS" runat="server" ControlToValidate="TxtModalFechaOS" Display="None"
|
||||
ErrorMessage="El campo <b>''Fecha''</b> es requerido por la aplicación" ValidationGroup="GrpAsignar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VceRfvTxtModalFechaOS" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtModalFechaOS" Width="350px"></ajax:ValidatorCalloutExtender>--%>
|
||||
|
||||
<label for="<%= TxtModalFechaOS.ClientID.ToString()%>">Fecha: </label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input">
|
||||
<cc1:TimeSelector ID="TSTimeSelector" runat="server" DisplaySeconds="false" DisplayButtons="false" Visible="true" CssClass="form-control" Font-Size="13pt"></cc1:TimeSelector>
|
||||
<label for="<%= TSTimeSelector.ClientID.ToString()%>">Hora Servicio: </label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:LinkButton runat="server" ID="LnkModalAsignar" CssClass="btn btn-success" Text="Asignar" OnClick="LnkModalAsignar_Click" ValidationGroup="GrpAsignar" ></asp:LinkButton>
|
||||
<asp:LinkButton runat="server" ID="LnkModalAsignar" CssClass="btn btn-success" Text="Guardar" OnClick="LnkModalAsignar_Click" ValidationGroup="GrpAsignar"></asp:LinkButton>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -508,6 +623,25 @@
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
<div style="display:none">
|
||||
|
||||
<asp:UpdatePanel ID="UpCommando" runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:Button runat="server" ID="LnkCommando" OnClick="LnkCommando_Click"></asp:Button>
|
||||
<asp:HiddenField runat="server" ID="HFCveOS" Value="-1" ClientIDMode="Static" />
|
||||
<asp:HiddenField runat="server" ID="HFCveOsDetalle" Value="-1" ClientIDMode="Static" />
|
||||
<asp:HiddenField runat="server" ID="HFOCveOIEvento" Value="-1" ClientIDMode="Static" />
|
||||
<asp:HiddenField runat="server" ID="HFCveUsuarioAtendio" Value="-1" ClientIDMode="Static" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
@@ -550,7 +684,7 @@
|
||||
|
||||
|
||||
function selectDate(start, end, allDay) {
|
||||
$('#ModalAgenda').modal('show');
|
||||
<%-- $('#ModalAgenda').modal('show');
|
||||
$("#SpanTituloAgenda").html("Agregar Evento");
|
||||
|
||||
$("#HdnCveEvento").val(-1);
|
||||
@@ -579,14 +713,30 @@
|
||||
$("#TxtFechaFinRecurrencia").val("");
|
||||
|
||||
$("#ChkGastoRecurrente").prop('checked', false);
|
||||
$("#TxtImporteGastoRecurrente").val("");
|
||||
$("#TxtImporteGastoRecurrente").val("");--%>
|
||||
}
|
||||
|
||||
|
||||
|
||||
function updateEvent(event, element) {
|
||||
$('#ModalAgenda').modal('show');
|
||||
|
||||
//$('#ModalAgenda').modal('show');
|
||||
|
||||
|
||||
// $get("HdnDiasSemanaAgendar").value =
|
||||
|
||||
|
||||
|
||||
|
||||
$("#DivDescripcionUpdate").css("display", "block");
|
||||
$('#<%=HFCveOS.ClientID%>').val(event.CveOS);
|
||||
$('#<%=HFCveOsDetalle.ClientID%>').val(event.CveOSDetalle);
|
||||
$('#<%=HFCveUsuarioAtendio.ClientID%>').val(event.CveUsuarioAtendio);
|
||||
|
||||
$('#<%=HFOCveOIEvento.ClientID%>').val(event.id);
|
||||
|
||||
$('#<%=LnkCommando.ClientID%>').click();
|
||||
|
||||
<%-- $("#DivDescripcionUpdate").css("display", "block");
|
||||
$("#<%=TxtDescripcionAgenda.ClientID%>").css("display", "none");
|
||||
$("#HdnCveEvento").val(event.id);
|
||||
|
||||
@@ -667,7 +817,7 @@
|
||||
$("#<%=LblEmpresaCRM.ClientID%>").text(event.EmpresaCRM);
|
||||
} else {
|
||||
$("#<%=LblEmpresaCRM.ClientID%>").css("display", "none")
|
||||
}
|
||||
}--%>
|
||||
|
||||
}
|
||||
function RadionButtonSelectedValueSet(name, SelectdValue) {
|
||||
|
||||
@@ -7,6 +7,8 @@ Imports Microsoft.Reporting.WebForms
|
||||
Imports System.Web.Services
|
||||
Imports Telerik.Web.UI
|
||||
Imports APP_Code_CSharp
|
||||
Imports AjaxControlToolkit.AsyncFileUpload.Constants
|
||||
Imports System
|
||||
|
||||
Partial Class OS_RepServicioDomicilio
|
||||
Inherits ClsPaginas
|
||||
@@ -115,15 +117,15 @@ Partial Class OS_RepServicioDomicilio
|
||||
|
||||
|
||||
|
||||
Private Property CveOSAsignar As Integer
|
||||
Private Property CveOrdenServicioTipo As Integer
|
||||
Get
|
||||
If ViewState("CveOSAsignar") Is Nothing Then
|
||||
ViewState("CveOSAsignar") = -1
|
||||
If ViewState("CveOrdenServicioTipo") Is Nothing Then
|
||||
ViewState("CveOrdenServicioTipo") = -1
|
||||
End If
|
||||
Return ViewState("CveOSAsignar").ToString.ToEntero
|
||||
Return ViewState("CveOrdenServicioTipo").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveOSAsignar") = value
|
||||
ViewState("CveOrdenServicioTipo") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -176,9 +178,89 @@ Partial Class OS_RepServicioDomicilio
|
||||
End Property
|
||||
|
||||
|
||||
Private Property CveOSAsignar As Integer
|
||||
Get
|
||||
If ViewState("CveOSAsignar") Is Nothing Then
|
||||
ViewState("CveOSAsignar") = -1
|
||||
End If
|
||||
Return ViewState("CveOSAsignar").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveOSAsignar") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property TipoAccion As OSModalTipoAccion
|
||||
Get
|
||||
If ViewState("TipoAccion") Is Nothing Then
|
||||
ViewState("TipoAccion") = OSModalTipoAccion.Agregar
|
||||
End If
|
||||
Return DirectCast(ViewState("TipoAccion"), OSModalTipoAccion)
|
||||
End Get
|
||||
Set(value As OSModalTipoAccion)
|
||||
ViewState("TipoAccion") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
Private Property CveTecnicoAsignarOrioginal As Integer
|
||||
Get
|
||||
If ViewState("CveTecnicoAsignarOrioginal") Is Nothing Then
|
||||
ViewState("CveTecnicoAsignarOrioginal") = -1
|
||||
End If
|
||||
Return ViewState("CveTecnicoAsignarOrioginal").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveTecnicoAsignarOrioginal") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property FechaInicioOriginal As DateTime
|
||||
Get
|
||||
If ViewState("FechaInicioOriginal") Is Nothing Then
|
||||
ViewState("FechaInicioOriginal") = DateTime.Now
|
||||
End If
|
||||
Return ViewState("FechaInicioOriginal").ToString.ToDateTime
|
||||
End Get
|
||||
Set(value As DateTime)
|
||||
ViewState("FechaInicioOriginal") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Private Property CveClientePublicoGeneral As Integer
|
||||
Get
|
||||
If ViewState("CveClientePublicoGeneral") Is Nothing Then
|
||||
ViewState("CveClientePublicoGeneral") = -1
|
||||
End If
|
||||
Return ViewState("CveClientePublicoGeneral").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveClientePublicoGeneral") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property NombreClientePublicoGeneral As String
|
||||
Get
|
||||
If ViewState("NombreClientePublicoGeneral") Is Nothing Then
|
||||
ViewState("NombreClientePublicoGeneral") = ""
|
||||
End If
|
||||
Return ViewState("NombreClientePublicoGeneral").ToString
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("NombreClientePublicoGeneral") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
Enum OSModalTipoAccion
|
||||
Agregar
|
||||
Actualizacion
|
||||
Asignacion
|
||||
End Enum
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
@@ -188,31 +270,21 @@ Partial Class OS_RepServicioDomicilio
|
||||
|
||||
CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyectoEtiqueta)
|
||||
LblSubProyectoFiltro.Text = LblSubProyectoEtiqueta.Text
|
||||
LblModalSubProyectoLabel.Text = LblSubProyectoEtiqueta.Text
|
||||
' LblModalSubProyectoLabel.Text = LblSubProyectoEtiqueta.Text
|
||||
CargaTecnicos()
|
||||
ConsultaOrdenesServiciosNoAsignadas()
|
||||
CargaOrdenesServiciosNoAsignadas()
|
||||
CargaTecnicosAsignar()
|
||||
|
||||
InicializaCalendar()
|
||||
GetCargaTiposOrden()
|
||||
cargaDropsModal()
|
||||
CargaClientePublicoGeneral()
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region "CARGAS"
|
||||
|
||||
Private Sub SetValues()
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaDatos()
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region " FULL CALENDAR "
|
||||
@@ -274,7 +346,7 @@ Partial Class OS_RepServicioDomicilio
|
||||
DdlTecnicoAsignar.DataBind()
|
||||
DdlTecnicoAsignar.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
||||
|
||||
UpModalOSAsginar.Update()
|
||||
UpModalOS.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -451,6 +523,8 @@ Partial Class OS_RepServicioDomicilio
|
||||
|
||||
DdlOrdenesSinAsignar.DataSource = DT_OSNoAsignadas
|
||||
DdlOrdenesSinAsignar.DataBind()
|
||||
DdlOrdenesSinAsignar.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
|
||||
|
||||
UpOrdenesSinAsignar.Update()
|
||||
|
||||
End Sub
|
||||
@@ -493,115 +567,396 @@ Partial Class OS_RepServicioDomicilio
|
||||
|
||||
|
||||
|
||||
Protected Sub LnkOrdenesSinAsignarMostarModal_Click(sender As Object, e As EventArgs)
|
||||
Protected Sub LnlAgregarServicioDomiciolio_Click(sender As Object, e As EventArgs)
|
||||
|
||||
CveOSDetalleAsignar = -1
|
||||
CveOSAsignar = -1
|
||||
CveSubProyectoAsignar = -1
|
||||
Dim DTable As DataTable = DT_OSNoAsignadas.FiltraParametros($"CveOSDetalle={DdlOrdenesSinAsignar.SelectedValue}")
|
||||
HFCveOS.Value = "-1"
|
||||
HFCveOsDetalle.Value = "-1"
|
||||
HFOCveOIEvento.Value = "-1"
|
||||
HFCveUsuarioAtendio.Value = "-1"
|
||||
DdlOrdenesSinAsignar.SelectedValueExist(-1)
|
||||
|
||||
LipiaModalOS()
|
||||
TipoAccion = OSModalTipoAccion.Agregar
|
||||
MostarModal()
|
||||
|
||||
If DTable.Rows.Count = 1 Then
|
||||
End Sub
|
||||
|
||||
CveOSDetalleAsignar = DTable.Rows(0)("CveOSDetalle").ToString.ToEntero
|
||||
CveSubProyectoAsignar = DTable.Rows(0)("CveSubProyecto").ToString.ToEntero
|
||||
CveOSAsignar = DTable.Rows(0)("CveOS").ToString.ToEntero
|
||||
FolioAsignar = DTable.Rows(0)("Folio").ToString
|
||||
Private Sub cargaDropsModal()
|
||||
|
||||
LblModalConcepto.Text = DTable.Rows(0)("Concepto").ToString
|
||||
LblModalCliente.Text = DTable.Rows(0)("Nombre").ToString
|
||||
LblModalSubProyecto.Text = DTable.Rows(0)("SubProyecto").ToString
|
||||
'DdlClientesWS.ddl.Items.Clear()
|
||||
'DdlClientesWS.txtText.Value = ""
|
||||
'DdlClientesWS.txtValue.Value = ""
|
||||
|
||||
|
||||
UpModalOSAsginar.Update()
|
||||
RegistraScript("$('#DVModalOSAsginar').modal('show');")
|
||||
If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then
|
||||
DdlClientesWS.setEsWebService(True)
|
||||
Else
|
||||
Alert("Error al cargar datos.")
|
||||
DdlClientesWS.setEsWebService(False)
|
||||
CargaClientes()
|
||||
End If
|
||||
|
||||
'DdlSubProyectoOS.Items.Clear()
|
||||
CargarCentrosDeCosto(Nothing, DdlSubProyectoOS, Nothing, LblSubProyectoOS)
|
||||
|
||||
'DdlModeloAuto.Items.Clear()
|
||||
Dim ObjGral As New ClsGenerales
|
||||
If ObjGral.ModelosAutosGet(1, UsuarioActual.CveEmpresa) Then
|
||||
DdlModeloAuto.DataSource = ObjGral.DtResultados
|
||||
End If
|
||||
ObjGral.Dispose()
|
||||
DdlModeloAuto.DataBind()
|
||||
DdlModeloAuto.Items.Insert(0, New ListItem("Sin Asignar", "-1"))
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaClientes()
|
||||
If Not UsuarioActual.Empresa.Funcionalidad(105) = "1" Then
|
||||
DdlClientesWS.ddl.Items.Clear()
|
||||
DdlClientesWS.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
|
||||
DdlClientesWS.DataBind()
|
||||
DdlClientesWS.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub LipiaModalOS()
|
||||
|
||||
TxtDescripcion.Text = ""
|
||||
TxtFechaOS.Text = ""
|
||||
DdlSubProyectoOS.SelectedValueExist("-1")
|
||||
TxtDireccion.Text = ""
|
||||
TxtEmail.Text = ""
|
||||
TxtTelefono.Text = ""
|
||||
|
||||
DdlClientesWS.txtText.Value = ""
|
||||
DdlClientesWS.txtValue.Value = ""
|
||||
DdlClientesWS.ddl.SelectedValueExist("-1")
|
||||
|
||||
DdlTecnicoAsignar.SelectedValueExist("-1")
|
||||
|
||||
DdlModeloAuto.SelectedValueExist("-1")
|
||||
TxtAnio.Text = ""
|
||||
|
||||
TxtModalFechaOS.Text = ""
|
||||
TSTimeSelector.Hour = Now.Hour
|
||||
TSTimeSelector.Minute = Now.Minute
|
||||
|
||||
CveTecnicoAsignarOrioginal = -1
|
||||
FechaInicioOriginal = DateTime.Now
|
||||
|
||||
DVFolio.Visible = False
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkOrdenesSinAsignarMostarModal_Click(sender As Object, e As EventArgs)
|
||||
TipoAccion = OSModalTipoAccion.Asignacion
|
||||
HFCveOS.Value = "-1"
|
||||
MostarModal()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub MostarModal()
|
||||
|
||||
LipiaModalOS()
|
||||
|
||||
If TipoAccion = OSModalTipoAccion.Agregar Then
|
||||
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then
|
||||
DdlClientesWS.txtValue.Value = CveClientePublicoGeneral.ToString
|
||||
DdlClientesWS.txtText.Value = NombreClientePublicoGeneral
|
||||
Else
|
||||
DdlClientesWS.ddl.SelectedValueExist(CveClientePublicoGeneral)
|
||||
End If
|
||||
|
||||
TxtFechaOS.Text = Now.ToString("dd/MM/yyyy")
|
||||
RegistraScript("$('#DVModalOS').modal('show');")
|
||||
LblModalOStitulo.Text = "Agregar Orden de Servicio"
|
||||
|
||||
ElseIf TipoAccion = OSModalTipoAccion.Actualizacion Or TipoAccion = OSModalTipoAccion.Asignacion Then
|
||||
|
||||
|
||||
|
||||
'cargaDropsModal()
|
||||
LblModalOStitulo.Text = "Actualizar Orden de Servicio"
|
||||
|
||||
Dim ObjOS As New ClsOS()
|
||||
Dim IDOSDetalle As Integer = 1
|
||||
Dim SeFacturara = ""
|
||||
|
||||
|
||||
Dim CveOsConsultar As Integer = HFCveOS.Value.ToEntero
|
||||
|
||||
If Not CveOsConsultar > 0 AndAlso Not DdlOrdenesSinAsignar.SelectedValue.ToEntero > 0 Then
|
||||
Alert("clave de orden de servicio no encontrada.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If CveOsConsultar > 0 Then
|
||||
DdlOrdenesSinAsignar.SelectedValueExist(-1)
|
||||
End If
|
||||
|
||||
If ObjOS.GetOrdenesServicios(CveOsConsultar, -1, -1, -1, -1, UsuarioActual.CveEmpresa, CveOSDetalle:=DdlOrdenesSinAsignar.SelectedValue.ToEntero) Then
|
||||
|
||||
DVFolio.Visible = True
|
||||
HLkFolio.Text = ObjOS.Folio.ToString
|
||||
HLkFolio.NavigateUrl = $"/OS/OrdenesServicios.aspx?CveOS={ObjOS.CveOS}"
|
||||
|
||||
HFCveOS.Value = ObjOS.CveOS.ToString
|
||||
HFCveOsDetalle.Value = ObjOS.CveOSDetalle.ToString
|
||||
TxtDescripcion.Text = ObjOS.Descripcion
|
||||
TxtFechaOS.Text = ObjOS.FechaRecepcion.ToString("dd/MM/yyyy")
|
||||
DdlSubProyectoOS.SelectedValueExist(ObjOS.CveSubProyecto)
|
||||
TxtDireccion.Text = ObjOS.DtResultados.Rows(0)("DireccionOS").ToString
|
||||
TxtEmail.Text = ObjOS.CorreoOS
|
||||
TxtTelefono.Text = ObjOS.Telefono
|
||||
|
||||
DdlClientesWS.txtText.Value = ObjOS.Cliente
|
||||
DdlClientesWS.txtValue.Value = ObjOS.CveCliente.ToString
|
||||
DdlClientesWS.ddl.SelectedValueExist(ObjOS.CveCliente.ToString)
|
||||
|
||||
DdlModeloAuto.SelectedValueExist(ObjOS.CveModeloAuto)
|
||||
TxtAnio.Text = ObjOS.Año
|
||||
|
||||
|
||||
If TipoAccion = OSModalTipoAccion.Actualizacion Then
|
||||
DdlTecnicoAsignar.SelectedValueExist(ObjOS.CveUsuarioAtendio)
|
||||
CveTecnicoAsignarOrioginal = ObjOS.CveUsuarioAtendio
|
||||
FechaInicioOriginal = ObjOS.FechaInicio
|
||||
TxtModalFechaOS.Text = ObjOS.FechaInicio.ToString.ToDate.ToString("dd/MM/yyyy")
|
||||
TSTimeSelector.Hour = If(ObjOS.FechaInicio.Hour > 12, ObjOS.FechaInicio.Hour - 12, ObjOS.FechaInicio.Hour)
|
||||
TSTimeSelector.Minute = ObjOS.FechaInicio.Minute
|
||||
TSTimeSelector.AmPm = If(ObjOS.FechaInicio.Hour > 12, MKB.TimePicker.TimeSelector.AmPmSpec.PM, MKB.TimePicker.TimeSelector.AmPmSpec.AM)
|
||||
End If
|
||||
|
||||
RegistraScript("$('#DVModalOS').modal('show');")
|
||||
|
||||
End If
|
||||
|
||||
ObjOS.Dispose()
|
||||
|
||||
LblModalOStitulo.Text = "Actualizar Orden de Servicio"
|
||||
|
||||
ElseIf False Then ' Anterior
|
||||
|
||||
CveOSDetalleAsignar = -1
|
||||
CveOSAsignar = -1
|
||||
CveSubProyectoAsignar = -1
|
||||
Dim DTable As DataTable = DT_OSNoAsignadas.FiltraParametros($"CveOSDetalle={DdlOrdenesSinAsignar.SelectedValue}")
|
||||
|
||||
If DTable.Rows.Count = 1 Then
|
||||
|
||||
CveOSDetalleAsignar = DTable.Rows(0)("CveOSDetalle").ToString.ToEntero
|
||||
CveSubProyectoAsignar = DTable.Rows(0)("CveSubProyecto").ToString.ToEntero
|
||||
CveOSAsignar = DTable.Rows(0)("CveOS").ToString.ToEntero
|
||||
FolioAsignar = DTable.Rows(0)("Folio").ToString
|
||||
|
||||
'LblModalConcepto.Text = DTable.Rows(0)("Concepto").ToString
|
||||
'LblModalCliente.Text = DTable.Rows(0)("Nombre").ToString
|
||||
'LblModalSubProyecto.Text = DTable.Rows(0)("SubProyecto").ToString
|
||||
|
||||
LblModalOStitulo.Text = "Asignar Orden de Servicio"
|
||||
|
||||
RegistraScript("$('#DVModalOS').modal('show');")
|
||||
|
||||
Else
|
||||
Alert("Error al cargar datos.")
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
UpModalOS.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub LnkModalAsignar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim TieneError As Boolean = False
|
||||
Dim CveEstatusOS = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", "TipoEstatus = 2", "CveEstatusOrdenServicio ASC").ToEntero
|
||||
Dim CveEstatusSolicidato = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", "TipoEstatus = 1", "CveEstatusOrdenServicio ASC").ToEntero
|
||||
Dim CveEstatusAsiganada = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", "TipoEstatus = 2", "CveEstatusOrdenServicio ASC").ToEntero
|
||||
|
||||
Dim CorreoAsignado As String = ""
|
||||
Dim CveCliente As Integer = If(Not DdlClientesWS.SelectedValue.ToEntero > 0, DdlClientesWS.txtValue.Value.ToString.ToEntero, DdlClientesWS.SelectedValue.ToEntero)
|
||||
Dim CvePSDetalle As Integer = UsuarioActual.Empresa.Funcionalidad(708).ToEntero
|
||||
Dim EsNueva As Boolean = False
|
||||
|
||||
|
||||
Dim CveOS As Integer = HFCveOS.Value.ToEntero
|
||||
Dim CveOsDetalle As Integer = HFCveOsDetalle.Value.ToEntero
|
||||
|
||||
If Not CvePSDetalle > 0 Then
|
||||
Alert("No esta asiganado el producto del detalle a la funcionalidad.")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If Not CveCliente > 0 Then
|
||||
Alert("Debe seleccionar una cliente.")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If TipoAccion = OSModalTipoAccion.Asignacion Then
|
||||
|
||||
If Not DdlTecnicoAsignar.SelectedValue.ToEntero > 0 Then
|
||||
Alert("El tecnico es requerido", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If TxtModalFechaOS.Text.Length = 0 Then
|
||||
Alert("La Fecha de asiganción es requerida", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Dim ObjOS As New ClsOS
|
||||
ObjOS.IniciaTransacSQL()
|
||||
|
||||
|
||||
|
||||
|
||||
If Not CveOS > 0 Then
|
||||
|
||||
EsNueva = True
|
||||
|
||||
Dim CveEstatosOrdenNueva = CveEstatusSolicidato
|
||||
If DdlTecnicoAsignar.SelectedValue.ToEntero > 0 Then
|
||||
CveEstatosOrdenNueva = CveEstatusAsiganada
|
||||
End If
|
||||
|
||||
If ObjOS.AddOrdenesServicios(CveCliente, DdlSubProyectoOS.SelectedValue.ToEntero, "", TxtFechaOS.Text.ToDateTime, TxtDescripcion.Text, UsuarioActual.CveUsuario, CveEstatosOrdenNueva,
|
||||
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, CveOrdenServicioTipo, CveClienteSucursal:=-1,
|
||||
Direccion:=TxtDireccion.Text, Telefono:=TxtTelefono.Text, CveModeloAuto:=DdlModeloAuto.SelectedValue.ToEntero, Año:=TxtAnio.Text, Correo:=TxtEmail.Text) Then
|
||||
CveOS = ObjOS.CveOS
|
||||
|
||||
|
||||
CveOsDetalle = ObjOS.AddOrdenesServiciosDetalle(CveOS, CvePSDetalle, 1, -1, -1, "", False, True, False, -1, "-1", "-1", "-1", "", UsuarioActual.CveUsuario, "")
|
||||
|
||||
If Not CveOsDetalle > 0 Then
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
Else
|
||||
|
||||
Dim CveEstatusOrden = CveEstatusSolicidato
|
||||
If DdlTecnicoAsignar.SelectedValue.ToEntero > 0 Then
|
||||
CveEstatusOrden = CveEstatusAsiganada
|
||||
End If
|
||||
|
||||
If TipoAccion = OSModalTipoAccion.Asignacion Then
|
||||
CveEstatusOrden = CveEstatusAsiganada
|
||||
End If
|
||||
|
||||
|
||||
CveOS = HFCveOS.Value.ToEntero
|
||||
CveOsDetalle = HFCveOsDetalle.Value.ToEntero
|
||||
|
||||
If CveOS > 0 Then
|
||||
|
||||
If Not ObjOS.UpdateOrdenesServicios("", TxtFechaOS.Text, TxtDescripcion.Text, UsuarioActual.CveUsuario, CveEstatusOrden, CveOS, UsuarioActual.CveUsuario,
|
||||
-1, CveClienteSucursal:=-1, Direccion:=TxtDireccion.Text, Telefono:=TxtTelefono.Text,
|
||||
CveModeloAuto:=DdlModeloAuto.SelectedValue.ToEntero, Año:=TxtAnio.Text, CveSubProyecto:=DdlSubProyectoOS.SelectedValue.ToEntero, Correo:=TxtEmail.Text) Then
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Dim picker As MKB.TimePicker.TimeSelector = TSTimeSelector
|
||||
Dim time As DateTime
|
||||
time = DateTime.Parse(String.Format("{0} {1}:{2} {3}", TxtModalFechaOS.Text, picker.Hour, picker.Minute, picker.AmPm))
|
||||
|
||||
If Not TieneError AndAlso CveOS > 0 AndAlso CveOsDetalle > 0 AndAlso DdlTecnicoAsignar.SelectedValue.ToEntero > 0 AndAlso
|
||||
(HFCveUsuarioAtendio.Value.ToEntero <> DdlTecnicoAsignar.SelectedValue.ToEntero Or
|
||||
TxtModalFechaOS.Text.ToDate <> FechaInicioOriginal.ToString.ToDate Or
|
||||
time <> FechaInicioOriginal) Then
|
||||
|
||||
Dim ObjOS As New ClsOS
|
||||
ObjOS.IniciaTransacSQL()
|
||||
|
||||
If ObjOS.GetSubProyectosEstatusInicial(DdlTecnicoAsignar.SelectedValue.ToEntero, 3, UsuarioActual.CveEmpresa) Then
|
||||
Dim subProyectoDelTecnico As DataTable
|
||||
subProyectoDelTecnico = ObjOS.DtResultados.FiltraParametros($"CveSubProyecto = {CveSubProyectoAsignar}")
|
||||
If subProyectoDelTecnico.Rows.Count > 0 Then
|
||||
If Not ObjOS.UpdateOrdenesServiciosAsignadas(CveOSDetalleAsignar, DdlTecnicoAsignar.SelectedValue.ToEntero, TxtModalFechaOS.Text.ToDate, time, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
If ObjOS.GetSubProyectosEstatusInicial(DdlTecnicoAsignar.SelectedValue.ToEntero, 3, UsuarioActual.CveEmpresa) Then
|
||||
Dim subProyectoDelTecnico As DataTable
|
||||
subProyectoDelTecnico = ObjOS.DtResultados.FiltraParametros($"CveSubProyecto = {DdlSubProyectoOS.SelectedValue.ToEntero}")
|
||||
|
||||
If subProyectoDelTecnico.Rows.Count > 0 Then
|
||||
If Not ObjOS.UpdateOrdenesServiciosAsignadas(CveOsDetalle, DdlTecnicoAsignar.SelectedValue.ToEntero, TxtModalFechaOS.Text.ToDate, time, UsuarioActual.CveEmpresa) Then
|
||||
TieneError = True
|
||||
End If
|
||||
Else
|
||||
Alert("El técnico y la Orden de Servicio deben pertenecer al mismo subProyecto", TipoMensaje.MsgAdvertencia)
|
||||
TieneError = True
|
||||
End If
|
||||
Else
|
||||
Alert("El técnico y la Orden de Servicio deben pertenecer al mismo subProyecto", TipoMensaje.MsgAdvertencia)
|
||||
TieneError = True
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not TieneError Then
|
||||
|
||||
If Not ObjOS.UpdateOrdenesServiciosEstatus(CveEstatusOS, UsuarioActual.CveUsuario, CveOSAsignar) Then
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
|
||||
If Not TieneError Then
|
||||
|
||||
Dim RecurrenciaTipo = 0, Frecuencia = -1, DiasSemana = "-1", Dias = -1, Mes = -1, RecurrenciaFin = "-1"
|
||||
Dim OIDescripcion As String = $"{DdlTecnicoAsignar.SelectedItem.Text} <b><a href='/OS/OrdenesServicios.aspx?CveOS={CveOSAsignar}' target='_blank' class='Texto' >Orden de servicio {FolioAsignar} </a></b>"
|
||||
|
||||
Dim ObjEventos As New ClsOIEventos(ObjOS.IniciaTransacSQL())
|
||||
If Not ObjEventos.AddEventoAgenda(2, DdlTecnicoAsignar.SelectedItem.Text, OIDescripcion, 2, time, time.AddHours(1), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
|
||||
RecurrenciaTipo:=RecurrenciaTipo, Frecuencia:=Frecuencia, DiasSemana:=DiasSemana, Dia:=Dias, Mes:=Mes, RecurrenciaFin:=RecurrenciaFin, CveTipoEvento:=2,
|
||||
Importe:=0, CveOS:=CveOSAsignar, CveSubProyecto:=CveSubProyectoAsignar) Then
|
||||
If Not ObjOS.UpdateOrdenesServiciosEstatus(CveEstatusAsiganada, UsuarioActual.CveUsuario, CveOS) Then
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
If Not TieneError Then
|
||||
|
||||
|
||||
Dim ObjEventos As New ClsOIEventos(ObjOS.IniciaTransacSQL())
|
||||
|
||||
If HFOCveOIEvento.Value.ToEntero > 0 Then
|
||||
|
||||
If Not ObjEventos.RemoveAgendaBitacora(HFOCveOIEvento.Value.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Dim RecurrenciaTipo = 0, Frecuencia = -1, DiasSemana = "-1", Dias = -1, Mes = -1, RecurrenciaFin = "-1"
|
||||
Dim OIDescripcion As String = $"{DdlTecnicoAsignar.SelectedItem.Text} <b><a href='/OS/OrdenesServicios.aspx?CveOS={CveOS}' target='_blank' class='Texto' >Orden de servicio {FolioAsignar} </a></b>"
|
||||
If Not ObjEventos.AddEventoAgenda(2, DdlTecnicoAsignar.SelectedItem.Text, OIDescripcion, 2, time, time.AddHours(1), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
|
||||
RecurrenciaTipo:=RecurrenciaTipo, Frecuencia:=Frecuencia, DiasSemana:=DiasSemana, Dia:=Dias, Mes:=Mes, RecurrenciaFin:=RecurrenciaFin, CveTipoEvento:=2,
|
||||
Importe:=0, CveOS:=CveOS, CveSubProyecto:=DdlSubProyectoOS.SelectedValue.ToEntero) Then
|
||||
TieneError = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
CorreoAsignado = GlobalDTUsuarios(DdlTecnicoAsignar.SelectedValue.ToEntero).Rows(0)("Correo").ToString
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If Not TieneError Then
|
||||
ObjOS.Commit()
|
||||
Else
|
||||
ObjOS.RollBack()
|
||||
End If
|
||||
|
||||
|
||||
|
||||
ObjOS.Dispose()
|
||||
|
||||
If Not TieneError And CorreoAsignado.Trim.Length > 0 Then
|
||||
Dim CorreoAsignado As String = GlobalDTUsuarios(DdlTecnicoAsignar.SelectedValue.ToEntero).Rows(0)("Correo").ToString
|
||||
If Not TieneError And CorreoAsignado.Trim.Length > 0 AndAlso DdlTecnicoAsignar.SelectedValue.ToEntero > 0 Then
|
||||
CorreoAsignado = GlobalDTUsuarios(DdlTecnicoAsignar.SelectedValue.ToEntero).Rows(0)("Correo").ToString
|
||||
MandaCorreOS(CveOSAsignar, CorreoAsignado)
|
||||
End If
|
||||
|
||||
If Not TieneError Then
|
||||
|
||||
ConsultaOrdenesServiciosNoAsignadas()
|
||||
CargaOrdenesServiciosNoAsignadas()
|
||||
|
||||
Alert("Orden asignada correctamente.")
|
||||
RegistraScript("$('#DVModalOSAsginar').modal('hide');Calendario();")
|
||||
RegistraScript("$('#DVModalOS').modal('hide');Calendario();")
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub MandaCorreOS(CveOS As Integer, CorreoUsuarioAsignado As String)
|
||||
|
||||
|
||||
@@ -762,4 +1117,76 @@ Partial Class OS_RepServicioDomicilio
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
Private Sub GetCargaTiposOrden()
|
||||
Dim ObjOS As New ClsOS
|
||||
|
||||
If ObjOS.GetTipoOrdenesServicios(UsuarioActual.CveEmpresa) AndAlso ObjOS.DtResultados IsNot Nothing AndAlso ObjOS.DtResultados.Rows.Count > 0 Then
|
||||
CveOrdenServicioTipo = ObjOS.DtResultados.FiltroPrimeroValor("CveOrdenServicioTipo").ToEntero
|
||||
Else
|
||||
CveOrdenServicioTipo = -1
|
||||
End If
|
||||
ObjOS.Dispose()
|
||||
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub LnkCommando_Click(sender As Object, e As EventArgs)
|
||||
|
||||
' Alert($"HFCveOS:{HFCveOS.Value}, HFCveOsDetalle:{HFCveOsDetalle.Value }, HFCveOIEvento:{HFOCveOIEvento.Value}")
|
||||
TipoAccion = OSModalTipoAccion.Actualizacion
|
||||
'RegistraScript("$('#DVModalOS').modal('show');")
|
||||
MostarModal()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub DdlTecnicoAsignar_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
|
||||
|
||||
If TipoAccion = OSModalTipoAccion.Asignacion Then
|
||||
|
||||
|
||||
'DdlTecnicoAsignar.Visible = True
|
||||
'RfvDdlTecnicoAsignar.Visible = True
|
||||
'VCERfvDdlTecnicoAsignar.Visible = True
|
||||
|
||||
'RfvTxtModalFechaOS.Visible = True
|
||||
'VceRfvTxtModalFechaOS.Enabled = True
|
||||
ElseIf TipoAccion = OSModalTipoAccion.Agregar Or TipoAccion = OSModalTipoAccion.Actualizacion Then
|
||||
|
||||
'DdlTecnicoAsignar.Visible = False
|
||||
'RfvDdlTecnicoAsignar.Visible = False
|
||||
' VCERfvDdlTecnicoAsignar.Visible = False
|
||||
|
||||
'RfvTxtModalFechaOS.Visible = False
|
||||
'VceRfvTxtModalFechaOS.Enabled = False
|
||||
|
||||
End If
|
||||
|
||||
UpModalOS.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaClientePublicoGeneral()
|
||||
|
||||
|
||||
Dim ObjCliente As New ClsClientes()
|
||||
|
||||
If ObjCliente.GetClientes(-1, "PUBLICO EN GENERAL", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1) Then
|
||||
|
||||
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
||||
Me.CveClientePublicoGeneral = ObjCliente.CveCliente
|
||||
Me.NombreClientePublicoGeneral = ObjCliente.Nombre
|
||||
End If
|
||||
End If
|
||||
ObjCliente.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user