diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb
index 9dcdf3eb5..f35f52a0b 100644
--- a/App_Code/ClsCompras.vb
+++ b/App_Code/ClsCompras.vb
@@ -191,7 +191,7 @@ Public Class ClsCompras
AplicaNotaCredito As Boolean, Observaciones As String, CveEstatusCompra As Integer, CvePrePoliza As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional IdPoliza As Integer = -1,
Optional CveOC As Integer = -1, Optional CveCajaChica As Integer = -1, Optional CvePersonal As Integer = -1, Optional NumeroReembolso As String = "-1", Optional CveProveedorSucursal As Integer = -1,
Optional AplicoPromocion As Boolean = False, Optional PorcentajeIVA As Double = 0, Optional CveMetodoPago As Integer = -1, Optional CveRetIVAConcepto As Integer = -1, Optional CveConceptoContableAlmacen As Integer = -1,
- Optional CveRetISRConcepto As Integer = -1, Optional NoDeducible As Boolean = False, Optional CveTipoCompra As Integer = -1, Optional TotalOriginal As Double = 0) As Boolean
+ Optional CveRetISRConcepto As Integer = -1, Optional NoDeducible As Boolean = False, Optional CveTipoCompra As Integer = -1, Optional TotalOriginal As Double = 0, Optional CveConceptoContable As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -240,7 +240,7 @@ Public Class ClsCompras
.Add("@NoDeducible", SqlDbType.Bit).Value = NoDeducible
.Add("@CveTipoCompra", SqlDbType.Int).Value = CveTipoCompra
.Add("@TotalOriginal", SqlDbType.Money).Value = TotalOriginal
-
+ .Add("@CveTipoConcepto", SqlDbType.Int).Value = CveConceptoContable
End With
Try
diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb
index 25fb3c073..5e5e7fc56 100644
--- a/App_Code/ClsVentas.vb
+++ b/App_Code/ClsVentas.vb
@@ -1873,7 +1873,7 @@ Public Class ClsVentas
Return Retorno
End Function
- Public Function AddPromociones(Promocion As String, FechaInicio As Date, FechaFin As Date, CveVendedor As Integer, CveCliente As Integer, Estatus As Boolean, CveMoneda As Integer, CveUsuario As Integer, CveEmpresa As Integer, CveSubProyecto As Integer) As Integer
+ Public Function AddPromociones(Promocion As String, FechaInicio As Date, FechaFin As Date, CveVendedor As Integer, CveCliente As Integer, Estatus As Boolean, CveMoneda As Integer, CveUsuario As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, TipoAplicacion As String) As Integer
Dim Retorno = -1
DataAdapter("PA_Vta_PromocionesAdd")
@@ -1889,6 +1889,7 @@ Public Class ClsVentas
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
+ .Add("@TipoAplicacion", SqlDbType.VarChar).Value = TipoAplicacion
.Add("@CvePromocion", SqlDbType.Int).Direction = ParameterDirection.Output
End With
diff --git a/Ashx/SIGGPS.ashx b/Ashx/SIGGPS.ashx
index f9736c0e1..a58642f67 100644
--- a/Ashx/SIGGPS.ashx
+++ b/Ashx/SIGGPS.ashx
@@ -18,7 +18,9 @@ Public Class SIGGPS : Implements IHttpHandler, IRequiresSessionState
Case "getimginstalacion"
GetImgInstalacion(context)
Case "EjecutarNotificaciones"
- EjecutarNotificaciones(context)
+ EjecutarNotificaciones(context)
+ Case "EjecutaTrayectos"
+ EnviarCorreoTrayectos(context, context.Request("CveTrayecto").ToString().ToEntero())
End Select
ElseIf context.Request.InputStream IsNot Nothing Then
Using reader As New StreamReader(context.Request.InputStream)
@@ -224,5 +226,155 @@ Public Class SIGGPS : Implements IHttpHandler, IRequiresSessionState
)
Return Json
- End Function
+ End Function
+
+#Region "N O T F I C A C I O N - T R A Y E C T O S"
+ Private Sub EnviarCorreoTrayectos(ByVal context As HttpContext, CveTrayecto As Integer)
+ Dim Retorno As JObject = New JObject(New JProperty("EnvioCorreo", False), New JProperty("Mensaje", ""))
+
+ Dim DtInfoTrayecto As DataTable = Nothing
+ Dim DtTrayecto As DataTable = Nothing
+
+ Using ObjGPS As New ClsGPS
+ If ObjGPS.GetTrayectos(CveTrayecto, -1, -1) AndAlso ObjGPS.DtResultados.Rows.Count > 0 Then
+ DtTrayecto = ObjGPS.DtResultados.Copy()
+ End If
+
+ If ObjGPS.GetTrayectosDatos(CveTrayecto) Then
+ DtInfoTrayecto = ObjGPS.DtSetResultados.Tables(0).Copy()
+ End If
+ End Using
+
+ If DtTrayecto IsNot Nothing AndAlso DtInfoTrayecto IsNot Nothing AndAlso DtInfoTrayecto.Rows.Count > 0 Then
+ Dim RowTrayecto As DataRow = DtTrayecto.Rows(0)
+ Dim RowInfo As DataRow = DtInfoTrayecto.Rows(0)
+
+ Dim EnviarLiga As Boolean = CBool(RowTrayecto("EnviarLiga").ToString())
+
+ Dim Asunto As String = "Estatus de Trayecto"
+ Dim Cuerpo As String = GeneraCorreo(CveTrayecto, EnviarLiga, RowInfo)
+ Dim Correos As String = RowTrayecto("CorreosNotificacion").ToString()
+
+ Dim ObjMail As New ClsSisMail
+ If ObjMail.SendMail(ClsPaginas.EmpresaNotificaciones, Correos, Asunto, Cuerpo) Then
+ Retorno("EnvioCorreo") = True
+ Retorno("Mensaje") = "El correo fue enviado correctamente"
+ Else
+ Retorno("EnvioCorreo") = False
+ Retorno("Mensaje") = "Ocurrió un error al enviar el correo"
+ End If
+
+ End If
+
+ context.Response.Write(Retorno.ToString())
+ End Sub
+
+ Protected Function GeneraCorreo(CveTrayecto As Integer, EnviarLiga As Boolean, Row As DataRow) As String
+ Dim strBody As New StringBuilder
+ Try
+ strBody.Append(" ")
+ strBody.Append("
")
+ strBody.Append("")
+ Catch ex As Exception
+ OnError("Ocurrio un error al general el correo.", ex)
+ End Try
+ Return strBody.ToString()
+ End Function
+#End Region
+
End Class
\ No newline at end of file
diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx
index e79fadb0c..6e0b5e8f0 100644
--- a/Compras/Compras.aspx
+++ b/Compras/Compras.aspx
@@ -181,8 +181,8 @@
--%>
-
- Proveedor:
+ Proveedor:
+ <%--Proveedor:--%>
<%-- Proveedor:--%>
Número de Reembolso:
+
@@ -4036,6 +4062,7 @@
Saldo
+
@@ -4043,6 +4070,7 @@
Fecha
+
@@ -4104,13 +4132,15 @@
+
-
+
+
@@ -4240,7 +4270,8 @@
-
+
+
<%--
@@ -4382,7 +4413,8 @@
  $
-
+
+
@@ -4530,6 +4562,7 @@
@@ -4544,6 +4577,7 @@
@@ -5256,7 +5290,7 @@
- function chkAnt(t, txt, importe, TotalSaldo,CveMonedaAnticipo,TCAnticipo,CveMonedaOriginal) {
+ function chkAnt(t, txt, importe, TotalSaldo, CveMonedaAnticipo, TCAnticipo, CveMonedaOriginal) {
var Total = ToDouble($get('TxtTotal').value);
//TotalSaldo = Total;
var txtvalue = ToDouble(txt.value);
@@ -5271,7 +5305,7 @@
//var SaldoCompra = parseFloat(parseFloat($get('HdnCompraSaldo').value).toFixed(2));
var SaldoCompra = (TotalSaldo - FnSumaValoresAnt() + txtvalue).toFixed(2); // le agrego lo del valor actual para validarlo
-
+
if (t.checked) {
@@ -5600,9 +5634,9 @@
function CalculaTotalOCEdit(PS, CantidadOriginal, TxtCantidad, TxtPU, TxtTotal, IEPSOriginal, HdnIEPS, IVAOriginal, HdnIVA, RetIVAOriginal, HdnRetIVA, RetISROriginal, HdnRetISR, IEPSIVAOriginal, HdnIEPSIVA, DescuentoOriginal, HdnDescuento, IVAPorcentaje, RetIVAPorcentaje, RetISRPorcentaje, IEPSPSPorcentaje, IEPSPSIVAPorcentaje) {
//var Proporcional = ((ToDouble(TxtCantidad.value) * 100) / CantidadOriginal) / 100;
-
+
var TotalGravado = ToDouble(TxtCantidad.value) * ToDouble(TxtPU.value);
- var Total = ToDouble(TxtCantidad.value) * ToDouble(TxtPU.value);
+ var Total = ToDouble(TxtCantidad.value) * ToDouble(TxtPU.value);
HdnDescuento.value = ToDouble(DescuentoOriginal * ToDouble(TxtCantidad.value) / CantidadOriginal);
if (true) {
@@ -5622,7 +5656,7 @@
if (RetISROriginal > 0) {
HdnRetISR.value = ToDouble(RetISRPorcentaje * (Total - ToDouble(HdnDescuento.value)));
}
-
+
TxtTotal.value = FormatoNumero(Total - ToDouble(HdnDescuento.value), 2);
//RECALCULA IMPORTES GENERALES
CalculaTotalesOC();
@@ -5638,7 +5672,7 @@
}
function CalculaTotalesOC() {
-
+
var SumaSubTotal = 0, SumaIEPS = 0, SumaIEPSIVA = 0, SumaIVA = 0, SumaRetIVA = 0, SumaRetISR = 0, SumaTotal = 0, SumaDescuento = 0, Amortizacion = 0;
$('input[name*=TxtTotalOC1]').each(function () {
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb
index 3815cc13b..fe5277c09 100644
--- a/Compras/Compras.aspx.vb
+++ b/Compras/Compras.aspx.vb
@@ -1102,6 +1102,15 @@ Partial Class Compras_Compras
End Set
End Property
+ Private Property CveConceptoContable As Integer
+ Get
+ Return ViewState("CveConceptoContable").ToString.ToEntero
+ End Get
+ Set(value As Integer)
+ ViewState("CveConceptoContable") = value
+ End Set
+ End Property
+
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
'ImgBtnBuscarOC.Attributes.Add("data-toggle", "tooltip")
@@ -1587,7 +1596,7 @@ Partial Class Compras_Compras
HplAddClasificacion.Visible = False
ImgClasificacion.Visible = False
End If
-
+ CveConceptoContable = 5
@@ -4408,7 +4417,7 @@ Partial Class Compras_Compras
TxtRedondeo.Text.ToDouble, TxtTotal.Text.ToDouble, TxtFecha.Text.Trim.ToDate, DdlMoneda.SelectedValue.ToEntero, TipoCambio, TxtFechaPago.Text.Trim.ToDate, ChkAplicaNotaCredito.Checked, TxtObsFact.Text.Trim, CveEstatusFactura,
CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, IdPoliza, CveCajaChica:=CveCajaChica, CvePersonal:=CvePersonal, NumeroReembolso:=NumeroReembolso, CveProveedorSucursal:=DdlProveedorSucursal.SelectedValue.ToEntero,
AplicoPromocion:=ChkOCPromocion.Checked, PorcentajeIVA:=PorcentajeIVA, CveMetodoPago:=CveMetodoPago, CveRetIVAConcepto:=If(DdlRetIVAConcepto.Items.Count > 0, DdlRetIVAConcepto.SelectedValue.ToEntero, -1), CveConceptoContableAlmacen:=CveConceptoContableAlmacen,
- CveRetISRConcepto:=If(DdlRetISRConcepto.Items.Count > 0, DdlRetISRConcepto.SelectedValue.ToEntero, -1), NoDeducible:=EsNoDeducible, CveTipoCompra:=DdlTipoCompra.SelectedValue.ToEntero, TotalOriginal:=TotalOriginal) Then
+ CveRetISRConcepto:=If(DdlRetISRConcepto.Items.Count > 0, DdlRetISRConcepto.SelectedValue.ToEntero, -1), NoDeducible:=EsNoDeducible, CveTipoCompra:=DdlTipoCompra.SelectedValue.ToEntero, TotalOriginal:=TotalOriginal, CveConceptoContable:=CveConceptoContable) Then
ViewState("CveCompra") = ObjCompras.CveCompra
If ObjCompras.DtResultados.Rows.Count > 0 Then ViewState("CompraFolio") = ObjCompras.DtResultados.Rows(0)("vFolio").ToString
@@ -19353,4 +19362,14 @@ Partial Class Compras_Compras
End Sub
+ Public Sub LblProveedor_OnClick(sender As Object, e As EventArgs) Handles LblProveedor.Click
+ If LblProveedor.Text = "Proveedor:" Then
+ LblProveedor.Text = "Acreedor:"
+ CveConceptoContable = 305
+ Else
+ LblProveedor.Text = "Proveedor:"
+ CveConceptoContable = 5
+ End If
+ End Sub
+
End Class
\ No newline at end of file
diff --git a/GPS/RastreoTrayectos.aspx.vb b/GPS/RastreoTrayectos.aspx.vb
index 46c849a09..96c2666bd 100644
--- a/GPS/RastreoTrayectos.aspx.vb
+++ b/GPS/RastreoTrayectos.aspx.vb
@@ -13,6 +13,14 @@ Partial Class GPS_RastreoTrayectos
Inherits Page
#Region "P R O P I E D A D E S"
+ Private Property RastreoValido As Boolean
+ Get
+ Return CType(ViewState("RastreoValido"), Boolean)
+ End Get
+ Set(value As Boolean)
+ ViewState("RastreoValido") = value
+ End Set
+ End Property
Private Property TrazarLineaContinuo As Boolean
Get
Return CType(ViewState("TrazarLineaContinuo"), Boolean)
@@ -87,12 +95,19 @@ Partial Class GPS_RastreoTrayectos
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
RegistraScript("$('#SideNav').click();initMap();")
- Me.CveTrayecto = 97
-
- CreaDTPosiciones()
- CargaDatos()
- RastrearEquipos()
- CargaTabla()
+ If Request("P") IsNot Nothing Then
+ Dim URLParametros = Parametros(Decripta((Request("P").ToString)))
+ Me.CveTrayecto = URLParametros("CVETRAYECTO").ToString().ToEntero()
+ CargaDatos()
+ If RastreoValido Then
+ TrazarLineaContinuo = True
+ CreaDTCoordenadas()
+ CreaDTPosiciones()
+ RastrearEquipos()
+ CargaTabla()
+ End If
+
+ End If
End If
End Sub
Private Sub CreaDTPosiciones()
@@ -123,16 +138,19 @@ Partial Class GPS_RastreoTrayectos
Using ObjGPS As New ClsGPS
If ObjGPS.GetTrayectos(CveTrayecto, -1, -1) AndAlso ObjGPS.DtResultados.Rows.Count > 0 Then
Dim Row As DataRow = ObjGPS.DtResultados.Rows(0)
+
Me.CveDispositivo = Row("CveDispositivo").ToString().ToEntero()
Me.CveCliente = Row("CveCliente").ToString().ToEntero()
+ Me.RastreoValido = Not CBool(Row("EsFin"))
+
End If
End Using
- TrazarLineaContinuo = True
- CreaDTCoordenadas()
End Sub
Protected Sub TimmerRefresh_Tick(sender As Object, e As EventArgs)
DtPosiciones.Rows.Clear()
RegistraScript("DeleteMarkers();")
+
+
Dim LastCoord As String = ""
Dim TmpDT As New DataTable
Dim Info = ""
@@ -143,6 +161,14 @@ Partial Class GPS_RastreoTrayectos
Dim ObjGPS As New ClsGPS
Try
+ If ObjGPS.GetTrayectos(CveTrayecto, -1, -1) AndAlso ObjGPS.DtResultados.Rows.Count > 0 Then
+ Dim Row As DataRow = ObjGPS.DtResultados.Rows(0)
+ Me.RastreoValido = Not CBool(Row("EsFin"))
+ End If
+ If Not RastreoValido Then
+ Alert("El trayecto ha sido finalizado.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
Dim RowVehiculo As DataRow = GlobalDTDispositivos(CveCliente).FiltroPrimero($"CveDispositivo = {CveDispositivo}")
If ObjGPS.UltimaPosicionEquipoGet(CveDispositivo, MinFecha, MaxFecha) Then
@@ -178,7 +204,12 @@ Partial Class GPS_RastreoTrayectos
OnError("Ocurrió un error al rastrear equipo", ex)
End Try
End Sub
- Private Sub RastrearEquipos()
+ Private Sub RastrearEquipos()
+ If Not RastreoValido Then
+ Alert("El trayecto ha sido finalizado.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
Dim LastCoord As String = ""
Dim TmpDT As New DataTable
Dim Info = ""
@@ -217,7 +248,6 @@ Partial Class GPS_RastreoTrayectos
End Try
ObjGPS.Dispose()
End Sub
-
Private Sub CargaTabla()
If DtPosiciones IsNot Nothing Then
GvBarra.DataSource = DtPosiciones
@@ -229,7 +259,6 @@ Partial Class GPS_RastreoTrayectos
GvBarra.HeaderRow.Cells(4).Style.Add("display", "none !important")
End If
End Sub
-
Private Sub AddRowCoordenadasContinuas(Coord As String, CveDispositivo As Integer)
Dim dr As DataRow = DtCoordenadasContinuas.NewRow()
dr("CveDispositivo") = CveDispositivo
@@ -333,8 +362,19 @@ Partial Class GPS_RastreoTrayectos
RegistraScript("setTimeout(function(){OpcionesHistorico();},500);")
End Sub
-
-
+ Private Function Parametros(Cadena As String) As Hashtable
+ Dim P1() As String = Cadena.Split("&"c)
+ Dim Tmp As String
+ Dim P2() As String
+
+ Dim URLParametros As New Hashtable
+
+ For Each Tmp In P1
+ P2 = Tmp.Replace("%26%", "&").Split("="c)
+ URLParametros.Add(P2(0).ToString.ToUpper, P2(1))
+ Next
+ Return URLParametros
+ End Function
Public Sub RegistraScript(Script As String, Optional valuetick As String = "")
Dim Rdm As Random = New Random()
ScriptManager.RegisterStartupScript(Page, Me.GetType(), String.Format("{0}{1}{2}", (DateTime.Now.Ticks + 1), Rdm.Next(), valuetick), String.Format("", Script), False)
diff --git a/GPS/Trayectos.aspx.vb b/GPS/Trayectos.aspx.vb
index a1977fccd..ac950d613 100644
--- a/GPS/Trayectos.aspx.vb
+++ b/GPS/Trayectos.aspx.vb
@@ -8,10 +8,11 @@ Imports Extensiones
Imports Microsoft.Reporting.WebForms
Imports Newtonsoft.Json.Linq
Imports System.Linq
-
+Imports System.Net.Http
+
Partial Class GPS_Trayectos
- Inherits ClsPaginas
-
+ Inherits ClsPaginas
+
#Region "P R O P I E D A D E S"
Private Property DtGeocercasAgregar As DataTable
Get
@@ -36,9 +37,9 @@ Partial Class GPS_Trayectos
Set(value As DataTable)
ViewState("DtPosiciones") = value
End Set
- End Property
+ End Property
#End Region
-
+
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
DirectCast(Master.FindControl("TSM"), ScriptManager).EnablePageMethods = True
@@ -276,12 +277,12 @@ Partial Class GPS_Trayectos
Private Sub LimpiaCampos()
TxtNombre.Text = ""
DdlDispositivo.SelectedIndex = 0
- End Sub
-
+ End Sub
+
#Region "C O N S U L T A "
Protected Sub LnkConsultar_Click(sender As Object, e As EventArgs)
CargaTrayectos()
- End Sub
+ End Sub
#End Region
Protected Sub GvBarra_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
@@ -413,105 +414,29 @@ Partial Class GPS_Trayectos
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim CveTrayecto As Integer = GvRow.DataKey("CveTrayecto").ToEntero()
- Dim EnviarLiga As Boolean = CBool(GvRow.DataKey("EnviarLiga"))
If CveTrayecto > 0 Then
- Dim DtInfoTrayecto As DataTable = Nothing
- Using ObjGPS As New ClsGPS
- If ObjGPS.GetTrayectosDatos(CveTrayecto) Then
- DtInfoTrayecto = ObjGPS.DtSetResultados.Tables(0).Copy()
+ Dim Url = New Uri(String.Format("{0}/ashx/SIGGPS.ashx?metodo=EjecutaTrayectos&CveTrayecto={1}", "https://gps.signalsgps.com", CveTrayecto))
+ Dim Retorno As String = "{}"
+ Try
+ Using httpClient = New HttpClient()
+ httpClient.Timeout = New TimeSpan(0, 0, 15)
+ Using request = New HttpRequestMessage(HttpMethod.Get, Url)
+ Dim response = httpClient.SendAsync(request).Result
+ If response.StatusCode = Net.HttpStatusCode.OK Then
+ Retorno = response.Content.ReadAsStringAsync().Result
+ End If
+ End Using
+ End Using
+
+ Dim Resp = JObject.Parse(Retorno)
+ If CBool(Resp("EnvioCorreo").ToString()) Then
+ Alert(Resp("Mensaje").ToString(), TipoMensaje.MsgInformacion)
+ Else
+ Alert(Resp("Mensaje").ToString(), TipoMensaje.MsgError)
End If
- End Using
- If DtInfoTrayecto IsNot Nothing AndAlso DtInfoTrayecto.Rows.Count > 0 Then
- Dim Row As DataRow = DtInfoTrayecto.Rows(0)
- GeneraCorreo(CveTrayecto, EnviarLiga, Row)
- End If
+ Catch ex As Exception
+ OnError("Ocurrió un error al descargar la factura", ex)
+ End Try
End If
End Sub
-
- Protected Function GeneraCorreo(CveTrayecto As Integer, EnviarLiga As Boolean, Row As DataRow) As String
- Dim strBody As New StringBuilder
- Try
- strBody.Append(" ")
- strBody.Append(" ")
- strBody.Append(" ")
- strBody.Append(" ")
- strBody.Append(" ")
- strBody.Append("
")
- strBody.Append(" ")
- strBody.Append("
")
- strBody.Append("
")
- strBody.Append("
")
- strBody.Append(" ")
- strBody.Append("
")
- strBody.Append("
")
- strBody.Append("")
- Catch ex As Exception
- OnError("Ocurrio un error al general el correo.", ex)
- End Try
- Return strBody.ToString()
- End Function
End Class
diff --git a/Ventas/Promociones.aspx b/Ventas/Promociones.aspx
index b1fe35644..6ed0aabef 100644
--- a/Ventas/Promociones.aspx
+++ b/Ventas/Promociones.aspx
@@ -128,6 +128,17 @@
+
+
+ Tipo Aplicacion:
+
+
+ Seleccione
+ Descuento
+ PU
+
+
+
diff --git a/Ventas/Promociones.aspx.vb b/Ventas/Promociones.aspx.vb
index 6b7e1941d..abb594cff 100644
--- a/Ventas/Promociones.aspx.vb
+++ b/Ventas/Promociones.aspx.vb
@@ -380,7 +380,9 @@ Partial Class Ventas_Promociones
Dim ObjVentas As New ClsVentas
Dim TieneError = False
ObjVentas.IniciaTransacSQL()
- CvePromocion = ObjVentas.AddPromociones(TxtPromocion.Text.Trim, If(IsDate(TxtFechaI.Text), TxtFechaI.Text.ToDate, MinFecha), If(IsDate(TxtFechaF.Text), TxtFechaF.Text.ToDate, MaxFecha), DdlVendedor.SelectedValue.ToEntero, DdlCliente.SelectedValue.ToEntero, ChkEstatus.Checked, DdlMoneda.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero)
+ CvePromocion = ObjVentas.AddPromociones(TxtPromocion.Text.Trim, If(IsDate(TxtFechaI.Text), TxtFechaI.Text.ToDate, MinFecha), If(IsDate(TxtFechaF.Text), TxtFechaF.Text.ToDate, MaxFecha),
+ DdlVendedor.SelectedValue.ToEntero, DdlCliente.SelectedValue.ToEntero, ChkEstatus.Checked, DdlMoneda.SelectedValue.ToEntero, UsuarioActual.CveUsuario,
+ UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero, DdlTipoAplicacion.SelectedValue.ToString)
If CvePromocion > 0 Then
For Each Dr As DataRow In TempDT.Rows
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index ad6b37a86..a5b93dbfe 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -5963,11 +5963,11 @@ Partial Class Ventas
TmpDT.Rows(e.RowIndex)("TiempoEntrega") = GvPS.Rows(e.RowIndex).FCTextBox("TxtTiempoEntrega").Text.Trim
TmpDT.Rows(e.RowIndex)("PU") = PU
TmpDT.Rows(e.RowIndex)("Descuento") = Descuento
- TmpDT.Rows(e.RowIndex)("TotalImporte") = Math.Round(Cantidad * PU, NumeroDecimales)
- TmpDT.Rows(e.RowIndex)("ImporteIVA") = Math.Round(TmpDT.Rows(e.RowIndex)("PorcentajeIVA").ToString.ToDecimal * TotalCalculableImpuestosIVA, NumeroDecimales)
- TmpDT.Rows(e.RowIndex)("ImporteIEPS") = Math.Round(TmpDT.Rows(e.RowIndex)("PorcentajeIEPS").ToString.ToDecimal * TotalCalculableImpuestos, NumeroDecimales)
- TmpDT.Rows(e.RowIndex)("ImporteRetIVA") = Math.Round(ClienteRetIVA * TotalCalculableImpuestos, NumeroDecimales)
- TmpDT.Rows(e.RowIndex)("ImporteRetISR") = Math.Round(ClienteRetISR * TotalCalculableImpuestos, NumeroDecimales)
+ TmpDT.Rows(e.RowIndex)("TotalImporte") = (Cantidad * PU).RoundSQL(NumeroDecimales)
+ TmpDT.Rows(e.RowIndex)("ImporteIVA") = (TmpDT.Rows(e.RowIndex)("PorcentajeIVA").ToString.ToDecimal * TotalCalculableImpuestosIVA).RoundSQL(NumeroDecimales)
+ TmpDT.Rows(e.RowIndex)("ImporteIEPS") = (TmpDT.Rows(e.RowIndex)("PorcentajeIEPS").ToString.ToDecimal * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
+ TmpDT.Rows(e.RowIndex)("ImporteRetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
+ TmpDT.Rows(e.RowIndex)("ImporteRetISR") = (ClienteRetISR * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
TmpDT.Rows(e.RowIndex)("PorcentajeRetIVA") = ClienteRetIVA
TmpDT.Rows(e.RowIndex)("PorcentajeRetISR") = ClienteRetISR
TmpDT.Rows(e.RowIndex)("CuentaPredial") = CuentaPredial
@@ -6387,8 +6387,7 @@ Partial Class Ventas
Continue For
End If
-
- If DdlTipoComprobante.SelectedValue <> "Cot" And ChkSinExistencia.Checked = False Then ' si tiene relacionada una OC,
+ If DdlTipoComprobante.SelectedValue <> "Cot" And ChkSinExistencia.Checked = False Then
'VALIDA EXISTENCIA
CveProducto = dr("CvePS").ToString.ToEntero
CveUnidad = dr("CveUM").ToString.ToEntero
@@ -6499,7 +6498,7 @@ Partial Class Ventas
'Valida si en caso de que el detalle tenga llantas o polizas se agreguén kilometraje/serie en la parte de observaciones(solo para el caso de empresas llanteras)
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
- If txtkilometraje.text.toentero = 0 Then
+ If TxtKilometraje.Text.ToEntero = 0 Then
'cuando es la clasificacion de llantas
Dim FaltaObservacion As Integer = TmpDT.FiltroPrimeroValor("CveClasificacion", "CveClasificacion = 20342").ToEntero
If FaltaObservacion = 20342 Then
@@ -6918,8 +6917,7 @@ Partial Class Ventas
'ENVIAR POLIZA VIRTUAL
If ErrorList.Count = 0 Then
If UsuarioActual.Empresa.Funcionalidad(576) = "1" Then
- Dim TipoPoliza As Integer = 1
- GeneraPolizaVentaWS(ObjFactura, TipoPoliza)
+ GeneraPolizaVentaWS(ObjFactura)
End If
End If
@@ -9172,7 +9170,7 @@ Partial Class Ventas
CveVentaRelacion:=(If(factura.CveVentaRelacion.ToEntero > 0, factura.CveVentaRelacion, -1)), ImporteRelacion:=(If(factura.ImporteRelacion <> Nothing, factura.ImporteRelacion, -1)),
CveTipoAmortizacionAnticipo:=factura.CveTipoAmortizacionAnticipo, CveEmpresaCRM:=CveEmpresaCRM, EsInterno:=EsInterno, CveAcercamientoCRM:=CveAcercamientoCRM,
DiasCredito:=factura.DiasCredito, EsDiasCreditoFijo:=factura.EsDiasCreditoFijo, AnticipoEspecial:=If(TrAntEspecial.Visible, ChkAntEspecial.Checked, False),
- Kilometraje:=TxtKilometraje.Text.todouble) Then
+ Kilometraje:=TxtKilometraje.Text.ToDouble) Then
ErrorList.Add("Ocurrió un error al Generar la Venta. Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
@@ -14281,18 +14279,19 @@ Partial Class Ventas
End If
Row("IVA") = Row("PorcentajeIVA")
- Row("ImporteIVA") = Math.Round(Row("PorcentajeIVA").ToString.ToDecimal * TotalCalculableImpuestosIVA, NumeroDecimales)
- Row("ImporteRetIVA") = Math.Round(ClienteRetIVA * TotalCalculableImpuestos, NumeroDecimales)
- Row("ImporteRetISR") = Math.Round(ClienteRetISR * TotalCalculableImpuestos, NumeroDecimales)
+ Row("ImporteIVA") = (Row("PorcentajeIVA").ToString.ToDecimal * TotalCalculableImpuestosIVA).RoundSQL(NumeroDecimales)
+ Row("ImporteRetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
+ Row("ImporteRetISR") = (ClienteRetISR * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
Row("PorcentajeRetIVA") = ClienteRetIVA
Row("PorcentajeRetISR") = ClienteRetISR
Row("PorcentajeIEPS") = DrPS("IEPSPorcentaje")
- Row("ImporteIEPS") = Math.Round(DrPS("IEPSPorcentaje").ToString.ToDecimal * TotalCalculableImpuestos, NumeroDecimales)
+ Row("ImporteIEPS") = (DrPS("IEPSPorcentaje").ToString.ToDecimal * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
Row("IEPS") = Row("ImporteIEPS")
- Row("Descuento") = Math.Round(Descuento, NumeroDecimales)
+ Row("Descuento") = (Descuento).RoundSQL(NumeroDecimales)
Row("TipoDescuento") = HdnTipoDescuento.Value
Row("Total") = (Cantidad * PU)
- Row("TotalImporte") = Math.Round(Cantidad * PU, NumeroDecimales)
+ Row("TotalImporte") = (Cantidad * PU).RoundSQL(NumeroDecimales)
+
'Row("AsientoContableVentas") = DrPS("AsientoContableVentas")
' Row("IdCtaContVentas") = IdCtaContable
' Row("AplicaParaConcepto") = AplicaParaConcepto
@@ -15486,7 +15485,7 @@ Partial Class Ventas
If ConSalida AndAlso Not OcurrioError Then
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
- OcurrioError = GenerarMovimientoAlmacenVirtual(CveRemision, ObjInventario, ObjFactura)
+ OcurrioError = Not GenerarMovimientoAlmacenVirtual(CveRemision, ObjInventario, ObjFactura)
End If
If Not OcurrioError Then
@@ -15811,7 +15810,7 @@ Partial Class Ventas
OcurrioError = True
End Try
- Return OcurrioError
+ Return Not OcurrioError
End Function
Private Function SalidaAlmacenMateriales(ByRef ObjInventario As ClsInventarios, CveOS As Integer, ByRef ObjConta As ClsContabilidad, ConSalida As Boolean, ConceptoMovimiento As Integer) As Boolean
@@ -23945,23 +23944,22 @@ Partial Class Ventas
GvCodigosUnicos.DataBind()
End If
End Sub
- Protected Sub GeneraPolizaVentaWS(ObjFactura As Modelos.Factura, TipoPoliza As Integer)
- 'TipoPoliza: 01 Venta, 02 Ajuste, 03 Garantía
+ Protected Sub GeneraPolizaVentaWS(ObjFactura As Modelos.Factura)
Try
For Each Row As GridViewRow In GvCodigosUnicos.Rows
If Row.RowType = DataControlRowType.DataRow Then
Dim obj As New Modelos.MPolizaVentaWS
'DATOS DEL CLIENTE
obj.customer_name = ObjFactura.Cliente.Nombre
- obj.customer_last_name1 = "."
+ obj.customer_last_name1 = ""
obj.customer_last_name2 = ""
obj.customer_birthday = Nothing
obj.customer_phone = ObjFactura.Cliente.Telefono
obj.customer_email = ObjFactura.Cliente.Mail
obj.customer_gender = "03" 'OTRO GENERO
obj.customer_advertising = False
- obj.customer_car_brand = "01"
- obj.customer_car_model = "01"
+ obj.customer_car_brand = "00"
+ obj.customer_car_model = "00"
obj.customer_car_year = ObjFactura.Fecha.Year
'DATOS DE VENTA
@@ -23971,12 +23969,12 @@ Partial Class Ventas
obj.sale_type_service = "02" 'COMERCIAL
obj.sale_total = ObjFactura.Total
obj.sale_discount = ObjFactura.Descuento
- obj.sale_id = ObjFactura.CveVenta.ToString
+ obj.sale_id = String.Format("{0}{1}{2}", ObjFactura.Serie, ObjFactura.Folio, ObjFactura.CveVenta)
'DATOS DEL PRODUCTO
obj.product_code = Row.DataKey("IdProductoPolizaVirtual").ToString()
obj.product_unique_code = Row.FCTextBox("TxtCodigoUnico").Text 'se indique el código único de la batería. (SERIE LOTE)
- obj.product_sale_type = "0" & TipoPoliza 'VENTA
+ obj.product_sale_type = "01 " 'VENTA
Dim FechaUsado As DateTime = Row.DataKey("FechaAjuste").ToString().ToDateTime()