-- option strict on
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<%@ WebService Language="VB" Class="WSSIGApp" %>
|
||||
|
||||
Option Strict Off
|
||||
Option Explicit On
|
||||
|
||||
Imports System.Data
|
||||
@@ -1023,7 +1023,8 @@ Public Class WSSIGApp
|
||||
Dim IdPoliza = -1
|
||||
If RequiereCotizacion Then
|
||||
Dim CveProveedor = -1
|
||||
Dim TotalCot = 0.0, IVACot = 0D, RetIVA = 0.0, RetISR = 0.0, PorIVA = 0.0, Porcentaje = 0.0
|
||||
Dim TotalCot = 0.0, IVACot = 0D, RetIVA = 0.0, RetISR = 0.0
|
||||
Dim PorIVA As Decimal = 0, Porcentaje = 0.0
|
||||
|
||||
|
||||
For Each dr As DataRow In DtDetalle.FiltraParametros("", "CveProveedor").Rows
|
||||
@@ -1034,7 +1035,7 @@ Public Class WSSIGApp
|
||||
CveProveedor = dr("CveProveedor").ToString.ToEntero
|
||||
|
||||
Porcentaje = DtDetalle.SUM("Total", String.Format("CveProveedor = {0}", CveProveedor)) / DtDetalle.SUM("Total")
|
||||
PorIVA = GlobalDTCompProveedores(CveEmpresa).FiltraParametros(String.Format("CveProveedor = {0}", CveProveedor)).Rows(0)("IVA").ToString.ToDouble
|
||||
PorIVA = GlobalDTCompProveedores(CveEmpresa).FiltraParametros(String.Format("CveProveedor = {0}", CveProveedor)).Rows(0)("IVA").ToString.ToDecimal
|
||||
IVACot = (DtDetalle.SUM("Total", String.Format("CveProveedor = {0}", CveProveedor)) * PorIVA).ToString.ToDecimal
|
||||
RetIVA = DrOC("RetIVA").ToString().ToDecimal * Porcentaje
|
||||
RetISR = DrOC("RetISR").ToString().ToDecimal * Porcentaje
|
||||
@@ -1061,7 +1062,7 @@ Public Class WSSIGApp
|
||||
End If
|
||||
|
||||
'AGREGA DETALLES
|
||||
If Not objOrdenCompra.AddOrdenCompraDetalle(objOrdenCompra.CveOrdenCompra, dr("Cantidad").ToString.ToDouble(), dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDouble, dr("CveSubProyecto").ToString.ToEntero(), dr("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, CveUsuarioActual, CveOrdenCompra, CvePresupuestoEgreso:=dr("CvePresupuestoEgreso").ToString.ToEntero, Descuento:=dr("Descuento").ToString.ToDouble) Then
|
||||
If Not objOrdenCompra.AddOrdenCompraDetalle(objOrdenCompra.CveOrdenCompra, dr("Cantidad").ToString.ToDecimal(), dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDecimal, dr("CveSubProyecto").ToString.ToEntero(), dr("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, CveUsuarioActual, CveOrdenCompra, CvePresupuestoEgreso:=dr("CvePresupuestoEgreso").ToString.ToEntero, Descuento:=dr("Descuento").ToString.ToDecimal) Then
|
||||
HuboError = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -1071,7 +1072,7 @@ Public Class WSSIGApp
|
||||
Dim CveProveedor As Integer = DrOC("CveProveedor").ToString.ToEntero
|
||||
Dim RetIVA = DrOC("RetIVA").ToString().ToDecimal
|
||||
Dim RetISR = DrOC("RetISR").ToString().ToDecimal
|
||||
Dim PorcentajeIVA As Double = DrOC("PorcentajeIVA").ToString().ToDouble
|
||||
Dim PorcentajeIVA As Decimal = DrOC("PorcentajeIVA").ToString().ToDecimal
|
||||
If objOrdenCompra.AddOrdenCompra("OC", -1, Descripcion, Justificacion, Prioridad, Fecha, CveMoneda, CveEstatusInicialOC, FechaEstimadaEntrega, LugarEntrega,
|
||||
CveUsuario, CveEmpresaActual, 0, CveProveedor, CveCliente:=CveCliente, CveVendedor:=CveVendedor, PrioridadObservacion:=PrioridadObservacion,
|
||||
PorcentajeIVA:=PorcentajeIVA, IVA:=IVA, RetIVA:=RetIVA, RetISR:=RetISR, IDPoliza:=IDPolizaPresupuestal, CveCotizacion:=CveCotizacion, FolioAdicional:=FolioAdicional,
|
||||
@@ -1090,7 +1091,7 @@ Public Class WSSIGApp
|
||||
'TERMINA: USA AC
|
||||
If Not HuboError Then
|
||||
For Each dr As DataRow In DtDetalle.Rows
|
||||
If Not objOrdenCompra.AddOrdenCompraDetalle(objOrdenCompra.CveOrdenCompra, dr("Cantidad").ToString.ToDouble(), dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDouble, dr("CveSubProyecto").ToString.ToEntero(), dr("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, CveUsuarioActual, CveOrdenCompra, CvePresupuestoEgreso:=dr("CvePresupuestoEgreso").ToString.ToEntero, Descuento:=dr("Descuento").ToString.ToDouble) Then
|
||||
If Not objOrdenCompra.AddOrdenCompraDetalle(objOrdenCompra.CveOrdenCompra, dr("Cantidad").ToString.ToDecimal(), dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDecimal, dr("CveSubProyecto").ToString.ToEntero(), dr("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, CveUsuarioActual, CveOrdenCompra, CvePresupuestoEgreso:=dr("CvePresupuestoEgreso").ToString.ToEntero, Descuento:=dr("Descuento").ToString.ToDecimal) Then
|
||||
HuboError = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -1780,7 +1781,7 @@ Public Class WSSIGApp
|
||||
ObjEmpresa.Dispose()
|
||||
End Sub
|
||||
<WebMethod>
|
||||
Public Function AddVentas(TipoDocto As String, CveCliente As Integer, CveSubProyecto As Integer, CveUsuario As Integer, SubTotal As Double, IVA As Double, CveMoneda As Integer, Observaciones As String, Productos As String) As String
|
||||
Public Function AddVentas(TipoDocto As String, CveCliente As Integer, CveSubProyecto As Integer, CveUsuario As Integer, SubTotal As Decimal, IVA As Decimal, CveMoneda As Integer, Observaciones As String, Productos As String) As String
|
||||
Dim Retorno = New Modelos.Factura.MMensajeFactura()
|
||||
Try
|
||||
Dim ObjUsuarios As New ClsSisUsuarios()
|
||||
@@ -1820,7 +1821,7 @@ Public Class WSSIGApp
|
||||
Return JsonConvert.SerializeObject(Retorno)
|
||||
End Function
|
||||
#Region "F A C T U R A C I O N"
|
||||
Private Function CreaFactura(TipoDocto As String, SubTotal As Double, IVA As Double, CveCliente As Integer, CveSubProyecto As Integer, CveMoneda As Integer, UsuarioActual As Usuario, ListaPS As List(Of MVentaProductos)) As Modelos.Factura
|
||||
Private Function CreaFactura(TipoDocto As String, SubTotal As Decimal, IVA As Decimal, CveCliente As Integer, CveSubProyecto As Integer, CveMoneda As Integer, UsuarioActual As Usuario, ListaPS As List(Of MVentaProductos)) As Modelos.Factura
|
||||
If CveSubProyecto <= 0 Then
|
||||
'SE ASIGNA EL SUBPROYECTO MATRIZ, EN CASO DE NO ENCONTRARSE SE LE ASIGNA CUALQUIERA
|
||||
Dim Dr As DataRow = Nothing
|
||||
@@ -1846,22 +1847,22 @@ Public Class WSSIGApp
|
||||
If ObjFolios.GetFolios(TipoDocto, UsuarioActual.CveEmpresa) Then
|
||||
Dim DT As DataTable = ObjFolios.DtResultados.FiltraParametros(String.Format("CveSubProyecto = {0} And Estado = 'Activo'", CveSubProyecto))
|
||||
If DT.Rows.Count > 0 Then
|
||||
ObjFactura.Folio = DT.Rows(0)("FActual").ToString()
|
||||
ObjFactura.Folio = DT.Rows(0)("FActual").ToString.ToEntero
|
||||
ObjFactura.Serie = DT.Rows(0)("Serie").ToString()
|
||||
End If
|
||||
DT.Dispose()
|
||||
End If
|
||||
ObjFolios.Dispose()
|
||||
|
||||
If Not String.IsNullOrEmpty(ObjFactura.Folio) Then
|
||||
If ObjFactura.Folio > 0 Then
|
||||
|
||||
Select Case CveMoneda
|
||||
Case 1
|
||||
ObjFactura.TipoCambio = "1"
|
||||
ObjFactura.TipoCambio = 1
|
||||
Case 2
|
||||
ObjFactura.TipoCambio = GlobalTipoCambio(Now).ToString
|
||||
ObjFactura.TipoCambio = GlobalTipoCambio(Now).ToDecimal
|
||||
Case Else
|
||||
ObjFactura.TipoCambio = GlobalTipoCambio(Now).ToString
|
||||
ObjFactura.TipoCambio = GlobalTipoCambio(Now).ToDecimal
|
||||
End Select
|
||||
ObjFactura.CveVendedor = -1
|
||||
|
||||
@@ -2011,7 +2012,7 @@ Public Class WSSIGApp
|
||||
TmpDT.Columns.Add("TotalImporte", GetType(Decimal))
|
||||
TmpDT.Columns.Add("Total", GetType(Decimal))
|
||||
'Para uso del módulo contable
|
||||
TmpDT.Columns.Add("AsientoContableVentas", GetType(Integer))
|
||||
TmpDT.Columns.Add("AsientoContableVentas", GetType(Integer))
|
||||
TmpDT.Columns.Add("AplicaParaConcepto", GetType(Boolean))
|
||||
TmpDT.Columns.Add("CveProyecto", GetType(Integer))
|
||||
TmpDT.Columns.Add("Proyecto", GetType(String))
|
||||
@@ -2133,8 +2134,8 @@ Public Class WSSIGApp
|
||||
Row("IVA") = Row("PorcentajeIVA")
|
||||
Row("ImporteIVA") = Math.Round(Row("PorcentajeIVA").ToString.ToDecimal * TotalCalculableImpuestos, 2)
|
||||
|
||||
Row("Total") = (PS.Cantidad * PS.Precio).Value
|
||||
Row("TotalImporte") = Math.Round(PS.Cantidad.Value * PS.Precio, 2)
|
||||
Row("Total") = PS.Cantidad * PS.Precio
|
||||
Row("TotalImporte") = Math.Round(PS.Cantidad * PS.Precio, 2)
|
||||
|
||||
Row("SATClaveProdServ") = DrPS("SATClavePS")
|
||||
Row("SATClaveUM") = DrPS("SATClaveUnidadMedida")
|
||||
@@ -2638,7 +2639,7 @@ Public Class WSSIGApp
|
||||
|
||||
If Not TieneError Then
|
||||
ObjOC.Commit()
|
||||
Retorno = ObjOC.Folio
|
||||
Retorno = ObjOC.Folio.ToString
|
||||
Else
|
||||
ObjOC.RollBack()
|
||||
Retorno = ""
|
||||
@@ -2872,7 +2873,7 @@ Public Class WSSIGApp
|
||||
'Agrega CveCotizacion a la lista
|
||||
|
||||
For Each RowCD As DataRow In ObjOC.DtResultados.Rows
|
||||
If Not ObjOC.AddCotizacionDetalle(ObjOC.CveCotizacion, RowCD("CvePS").ToString.ToEntero, -1, RowCD("Cantidad").ToString.ToDouble, RowCD("CveUnidadMedida").ToString.ToEntero, 0, "-1", "", RowCD("CveOrdenCompraDetalle").ToString.ToEntero) Then TieneError = True : Exit For
|
||||
If Not ObjOC.AddCotizacionDetalle(ObjOC.CveCotizacion, RowCD("CvePS").ToString.ToEntero, -1, RowCD("Cantidad").ToString.ToDecimal, RowCD("CveUnidadMedida").ToString.ToEntero, 0, "-1", "", RowCD("CveOrdenCompraDetalle").ToString.ToEntero) Then TieneError = True : Exit For
|
||||
Next
|
||||
Else
|
||||
TieneError = True
|
||||
@@ -3499,7 +3500,7 @@ Public Class WSSIGApp
|
||||
If Ent.EmpresaCRM.CveEmpresaCRM > 0 Then
|
||||
If Ent.EmpresaCRM.CveEncuestaAplicada > 0 Then
|
||||
For Each Resp In Ent.Respuestas
|
||||
If Not ObjDatosTecnicos.UpdateDatosTecnicosCRM(Resp.CveEncuestaAplicadaDetalle, Ent.EmpresaCRM.CveEncuestaAplicada, Resp.CvePregunta, Resp.CveRespuesta, IfNull(Resp.Valor, "")) Then
|
||||
If Not ObjDatosTecnicos.UpdateDatosTecnicosCRM(Resp.CveEncuestaAplicadaDetalle, Ent.EmpresaCRM.CveEncuestaAplicada, Resp.CvePregunta, Resp.CveRespuesta, IfNull(Resp.Valor, "").ToString) Then
|
||||
TieneError = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -3688,7 +3689,8 @@ Public Class WSSIGApp
|
||||
If item.CveAcercamiento > 0 Then
|
||||
TieneError = Not ObjCRM.UpdateAcercamiento(item.CveAcercamiento, item.CveContactoPrincipal, item.CveTipoProceso, item.CveEtapaProcesoActual, item.CveVendedor, item.CveMedioCaptacion, item.CveProbabilidadAcercamiento, item.NombreAcercamiento, item.Descripcion, item.Importe, item.Comision, item.Prioridad, item.CveUsuarioMod, item.CveRechazoMotivo, item.CveEncuestaAplicadaProceso, item.FechaApertura, item.FechaCierre)
|
||||
Else
|
||||
TieneError = Not ObjCRM.AddAcercamiento(item.CveEmpresaCRM, item.CveContactoPrincipal, item.CveTipoProceso, item.CveEtapaProcesoActual, item.CveVendedor, item.CveMedioCaptacion, item.CveRechazoMotivo, item.CveProbabilidadAcercamiento, item.FechaApertura, item.NombreAcercamiento, item.Descripcion, item.Importe, item.Comision, item.Prioridad, item.CveEmpresa, item.CveUsuarioIng, item.FechaCierre)
|
||||
Dim i As Integer = ObjCRM.AddAcercamiento(item.CveEmpresaCRM, item.CveContactoPrincipal, item.CveTipoProceso, item.CveEtapaProcesoActual, item.CveVendedor, item.CveMedioCaptacion, item.CveRechazoMotivo, item.CveProbabilidadAcercamiento, item.FechaApertura, item.NombreAcercamiento, item.Descripcion, item.Importe, item.Comision, item.Prioridad, item.CveEmpresa, item.CveUsuarioIng, Now)
|
||||
If i <= 0 Then TieneError = True
|
||||
End If
|
||||
If TieneError Then
|
||||
Exit For
|
||||
@@ -4177,7 +4179,7 @@ Public Class WSSIGApp
|
||||
Public Function GetRepAcercamientos(CveEmpresa As Integer, CveVendedor As Integer, FechaInicio As DateTime, FechaFin As DateTime) As String
|
||||
Dim Retorno = "[]"
|
||||
Using ObjCRM As New ClsCRM
|
||||
If ObjCRM.GetAcercamiento(CveEmpresa, CveVendedor:=CveVendedor, FechaInicio:=FechaInicio, FechaFin:="-1") Then
|
||||
If ObjCRM.GetAcercamiento(CveEmpresa, CveVendedor:=CveVendedor, FechaInicio:=FechaInicio.ToShortDateString, FechaFin:="-1") Then
|
||||
Retorno = ObjCRM.DtResultados.DataTableToJSONIPP()
|
||||
End If
|
||||
End Using
|
||||
@@ -4921,11 +4923,11 @@ Namespace WebServiceAppModels
|
||||
Public Property IDTemp As Integer
|
||||
Public Property IDTempVenta As Integer
|
||||
Public Property CvePS As Integer
|
||||
Public Property Cantidad As Double?
|
||||
Public Property Cantidad As Decimal = 0
|
||||
Public Property Obs As String
|
||||
Public Property PS As String
|
||||
Public Property Precio As Double
|
||||
Public Property Descuento As Double
|
||||
Public Property Precio As Decimal
|
||||
Public Property Descuento As Decimal
|
||||
Public Property CveUnidadMedida As Integer
|
||||
End Class
|
||||
Public Class MMessage
|
||||
|
||||
Reference in New Issue
Block a user