Merge branch 'master' of http://agonzalez@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -97,6 +97,7 @@ Public Class ClsInventarios
|
||||
Public Property CveGrupoPS As Integer
|
||||
Public Property CveFlete As Integer
|
||||
Public Property CveCliente As Integer
|
||||
Public Property CveVendedor As Integer
|
||||
Public Property CveClienteSucursal As Integer
|
||||
Public Property NombreCliente As String
|
||||
Public Property CveProveedor As Integer
|
||||
@@ -823,6 +824,7 @@ Public Class ClsInventarios
|
||||
FolioInterno = dr("VentaAnticipo").ToString
|
||||
CveCliente = If(dr("CveCliente").ToString.ToEntero > 0, dr("CveCliente").ToString.ToEntero, -1)
|
||||
CveClienteSucursal = If(dr("CveClienteSucursal").ToString.ToEntero > 0, dr("CveClienteSucursal").ToString.ToEntero, -1)
|
||||
CveVendedor = If(dr("CveVendedor").ToString.ToEntero > 0, dr("CveVendedor").ToString.ToEntero, -1)
|
||||
NombreCliente = dr("Nombre").ToString
|
||||
CveProveedor = If(dr("CveProveedor").ToString.ToEntero > 0, dr("CveProveedor").ToString.ToEntero, -1)
|
||||
DepartamentoEntrega = dr("DepartamentoEntrega").ToString
|
||||
|
||||
@@ -3738,7 +3738,7 @@ Public Class ClsVentas
|
||||
|
||||
#Region "COMISIONES"
|
||||
|
||||
Public Function GetRepComisiones(FechaI As Date, FechaF As Date, CveSubProyecto As Integer, CveVendedor As Integer, CveCliente As Integer, CveUsuario As Integer, CveEmpresa As Integer, TipoSaldo As Integer) As Boolean
|
||||
Public Function GetRepComisiones(FechaI As Date, FechaF As Date, CveSubProyecto As Integer, CveVendedor As Integer, CveCliente As Integer, CveUsuario As Integer, CveEmpresa As Integer, TipoSaldo As Integer, Optional EsquemaNuevo As Boolean = False) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_RepComisiones119")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
@@ -3750,6 +3750,7 @@ Public Class ClsVentas
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@TipoSaldo", SqlDbType.Int).Value = TipoSaldo
|
||||
.Add("@EsquemaNuevo", SqlDbType.Bit).Value = EsquemaNuevo
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
|
||||
14409
Bin/Newtonsoft.Json.xml
14409
Bin/Newtonsoft.Json.xml
File diff suppressed because it is too large
Load Diff
@@ -168,7 +168,7 @@
|
||||
<div class="progress-info">
|
||||
|
||||
<div class="progress">
|
||||
<span runat="server" id="SPAvance1" style="width: 76%;" class="progress-bar progress-bar-success green-sharp">
|
||||
<span runat="server" id="SPAvance1" style="width:76%;" class="progress-bar progress-bar-success green-sharp">
|
||||
<%--<span runat="server" id="SPAvance2" class="sr-only">76% Avance</span>--%>
|
||||
</span>
|
||||
</div>
|
||||
@@ -220,7 +220,7 @@
|
||||
</div>
|
||||
<div class="progress-info">
|
||||
<div class="progress">
|
||||
<span runat="server" id="SPFaltante" style="width: 76%;" class="progress-bar progress-bar-success red-haze">
|
||||
<span runat="server" id="SPFaltante" style="width:76%;" class="progress-bar progress-bar-success red-haze">
|
||||
<%--<span class="sr-only">76% Avance</span>--%>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -52,8 +52,8 @@ Partial Class RepContratosObraAvances
|
||||
Dim TotalFaltante As Decimal = TotalContratos - TotalAvance
|
||||
|
||||
|
||||
Dim TotalAvancePorcentaje As Decimal = (TotalAvance * 100) / TotalContratos
|
||||
Dim TotalFaltantePorcentaje As Decimal = 100 - TotalAvancePorcentaje
|
||||
Dim TotalAvancePorcentaje As Decimal = ((TotalAvance * 100) / TotalContratos).RoundAD(2)
|
||||
Dim TotalFaltantePorcentaje As Decimal = (100 - TotalAvancePorcentaje).RoundAD(2)
|
||||
|
||||
|
||||
LtlGrafNumeroContratos.Text = NumeroContratos.ToString
|
||||
|
||||
@@ -88,7 +88,13 @@ Partial Class RepContratosObraAvancesDetalle
|
||||
|
||||
Dim AvanceImporte As Decimal = DTDatos(0)("AvanceImporte").ToString.ToDecimal
|
||||
Dim TotalContratos As Decimal = DTDatos(0)("Importe").ToString.ToDecimal
|
||||
Dim TotalAvancePorcentaje As Decimal = (AvanceImporte * 100) / TotalContratos
|
||||
|
||||
Dim TotalAvancePorcentaje As Decimal = 0
|
||||
If TotalContratos > 0 Then
|
||||
TotalAvancePorcentaje = (AvanceImporte * 100) / TotalContratos
|
||||
End If
|
||||
|
||||
|
||||
Dim TotalFaltantePorcentaje As Decimal = 100 - TotalAvancePorcentaje
|
||||
|
||||
Dim FechaFinal As Date = DTDatos(0)("FechaFinal").ToString.ToDate
|
||||
|
||||
@@ -191,6 +191,15 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
<div id="DivVendedor" runat="server" visible="false">
|
||||
<label class="col-md-1 truncate" style="width: 110px">Vendedor:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:Label ID="LblVendedor" runat="server" Text=""></asp:Label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" id="DivDepartamentoEntrega" runat="server" visible="False">
|
||||
<label class="col-md-1 truncate" style="width: 110px">
|
||||
|
||||
@@ -819,6 +819,12 @@ Partial Class Inventarios_EntradasSalidas
|
||||
|
||||
End If
|
||||
|
||||
If Mov.CveVendedor > 0 Then
|
||||
LblVendedor.Text = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Vendedor", String.Format("CveVendedor = {0}", Mov.CveVendedor))
|
||||
DivVendedor.Visible = True
|
||||
End If
|
||||
|
||||
|
||||
'carga personal
|
||||
If Mov.CvePersonal > 0 Then
|
||||
DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa, CvePersonal:=Mov.CvePersonal)
|
||||
|
||||
@@ -92,9 +92,16 @@
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExportar" runat="server"><i class="fa fa-ad-excel"></i> Generar Excel</asp:LinkButton>
|
||||
</li>
|
||||
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton runat="server" ID="LnkProyectado" OnClick="LnkProyectado_Click" Text="Cargar Proyecciones" />
|
||||
|
||||
<asp:LinkButton runat="server" ID="LnkProyectado" OnClick="LnkProyectado_Click" Text="Cargar Proyecciones" />
|
||||
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
|
||||
@@ -189,6 +189,7 @@
|
||||
<asp:BoundField HeaderText="Cantidad Solicitada" DataField="CantidadC" DataFormatString="{0:#,##0.##}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Cantidad Restante" DataField="CantidadF" DataFormatString="{0:#,##0.##}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Proveedor/Producto ó Servicio" DataField="CodigoPS" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Centro Costo" DataField="SubProyecto" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Total" DataField="Total" DataFormatString="{0:#,##0.##}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:TemplateField ItemStyle-Width="70px" HeaderText="Acción" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
|
||||
@@ -72,9 +72,9 @@ Partial Class RepNotasSinAlmacen
|
||||
Private Sub CargaPermisos()
|
||||
Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201)
|
||||
Dim TienePermisoDesmarcar As Boolean = UsuarioActual.TienePermisoProceso(278)
|
||||
GvVentas.Columns(4).Visible = TienePermisoImportes
|
||||
GvCompras.Columns(3).Visible = TienePermisoImportes
|
||||
GvCompras.Columns(4).Visible = TienePermisoDesmarcar
|
||||
GvVentas.Columns(5).Visible = TienePermisoImportes
|
||||
GvCompras.Columns(4).Visible = TienePermisoImportes
|
||||
GvCompras.Columns(5).Visible = TienePermisoDesmarcar
|
||||
End Sub
|
||||
Private Sub CargaCombos()
|
||||
TxtFechaF.Text = Date.Now.ToShortDateString
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<%@ WebHandler Language="C#" Class="TareasJam" %>
|
||||
|
||||
using System;
|
||||
using System.Web;
|
||||
<%@ WebHandler Language="C#" Class="TareasJam" %>
|
||||
|
||||
using System;
|
||||
using System.Web;
|
||||
using Extensiones;
|
||||
using System.Net;
|
||||
using System.IO;
|
||||
@@ -9,46 +9,49 @@ using System.Web.Services;
|
||||
using System.Web.Services.Protocols;
|
||||
using GemBox.Spreadsheet;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using ClosedXML;
|
||||
|
||||
public class TareasJam : IHttpHandler
|
||||
{
|
||||
|
||||
public void ProcessRequest(HttpContext context)
|
||||
{
|
||||
context.Response.ContentType = "text/plain";
|
||||
//context.Response.Write("Hello World");
|
||||
bool retorno = false;
|
||||
string Metodo = context.Request["Metodo"] ==null?"": context.Request["Metodo"];
|
||||
int CveEmpresa =context.Request["CveEmpresa"] ==null?0: context.Request["CveEmpresa"].ToEntero();
|
||||
switch (Metodo)
|
||||
using ClosedXML;
|
||||
|
||||
public class TareasJam : IHttpHandler
|
||||
{
|
||||
|
||||
public void ProcessRequest(HttpContext context)
|
||||
{
|
||||
context.Response.ContentType = "text/plain";
|
||||
//context.Response.Write("Hello World");
|
||||
bool retorno = false;
|
||||
string Metodo = context.Request["Metodo"] ==null?"": context.Request["Metodo"];
|
||||
int CveEmpresa =context.Request["CveEmpresa"] ==null?0: context.Request["CveEmpresa"].ToEntero();
|
||||
switch (Metodo)
|
||||
{
|
||||
case "TestConexion":
|
||||
retorno = PruebaConexionFTP("ftp://us2.hostedftp.com/", "agrojam", "A12345678");
|
||||
break;
|
||||
case "EjecutaThalamus":
|
||||
retorno =EjecutaThalamus(CveEmpresa);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (retorno)
|
||||
{
|
||||
context.Response.Write("True");
|
||||
|
||||
}else
|
||||
{
|
||||
context.Response.Write("False");
|
||||
|
||||
}
|
||||
case "EjecutaThalamus":
|
||||
retorno =EjecutaThalamus(CveEmpresa);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (retorno)
|
||||
{
|
||||
context.Response.Write("True");
|
||||
|
||||
}else
|
||||
{
|
||||
context.Response.Write("False");
|
||||
|
||||
}
|
||||
context.Response.End();
|
||||
|
||||
}
|
||||
private bool EjecutaThalamus(int CveEmpresa)
|
||||
{
|
||||
|
||||
|
||||
this.GuardaLog("EjecutaThalamus: Inicio. ");
|
||||
|
||||
bool Respuesta = false;
|
||||
StringBuilder SBLog = new StringBuilder();
|
||||
|
||||
@@ -96,6 +99,7 @@ public class TareasJam : IHttpHandler
|
||||
}
|
||||
catch (Exception ex) {
|
||||
SBLog.AppendLine("<b>Error al eliminar archivos</b>");
|
||||
this.GuardaLog("EjecutaThalamus: Error Eliminado arrchivo " + ex.Message + " ");
|
||||
}
|
||||
|
||||
|
||||
@@ -113,46 +117,60 @@ public class TareasJam : IHttpHandler
|
||||
SBLog.AppendLine("<b>Consultas</b><br>");
|
||||
SBLog.AppendLine("<table border='1'><tr><th>Consulta</th><th>Registros</th></tr>");
|
||||
|
||||
|
||||
|
||||
this.GuardaLog("EjecutaThalamus: Consultando Prodcutos. ");
|
||||
if (ObjGenerales.GetJAMCorveta(1))
|
||||
{
|
||||
DTProductos = ObjGenerales.DtResultados.Copy();
|
||||
SBLog.AppendLine($"<tr><td>Productos</td><td>{DTProductos.Rows.Count}</td></tr>");
|
||||
this.GuardaLog($"EjecutaThalamus: Consultando Prodcutos correcto {DTProductos.Rows.Count} registros. ");
|
||||
}
|
||||
else {
|
||||
ErrorProceso = true;
|
||||
SBLog.AppendLine($"<tr><td>Productos</td><td>Error al consultar</td></tr>");
|
||||
this.GuardaLog($"EjecutaThalamus: Consultando Prodcutos Error. ");
|
||||
}
|
||||
|
||||
this.GuardaLog($"EjecutaThalamus: Consultando Ventas. ");
|
||||
if (ObjGenerales.GetJAMCorveta(2) & ErrorProceso == false)
|
||||
{
|
||||
DTVentas = ObjGenerales.DtResultados.Copy();
|
||||
SBLog.AppendLine($"<tr>Ventas<td></td><td>{DTVentas.Rows.Count}</td></tr>");
|
||||
this.GuardaLog($"EjecutaThalamus: Consultando Ventas correcto {DTVentas.Rows.Count} registros. ");
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorProceso = true;
|
||||
SBLog.AppendLine($"<tr><td>Ventas</td><td>Error al consultar</td></tr>");
|
||||
this.GuardaLog($"EjecutaThalamus: Consultando Ventas Error. ");
|
||||
}
|
||||
|
||||
if (ObjGenerales.GetJAMCorveta(3) & ErrorProceso == false)
|
||||
this.GuardaLog($"EjecutaThalamus: Consultando Clientes. ");
|
||||
if (ObjGenerales.GetJAMCorveta(3) & ErrorProceso == false)
|
||||
{
|
||||
DTClientes = ObjGenerales.DtResultados.Copy();
|
||||
SBLog.AppendLine($"<tr><td>Clientes</td><td>{DTClientes.Rows.Count}</td></tr>");
|
||||
this.GuardaLog($"EjecutaThalamus: Consultando Clientes correco {DTClientes.Rows.Count} registros. ");
|
||||
|
||||
}
|
||||
else {
|
||||
ErrorProceso = true;
|
||||
SBLog.AppendLine($"<tr><td>Clientes</td><td>Error al consultar</td></tr>");
|
||||
this.GuardaLog($"EjecutaThalamus: Consultando Clientes Error. ");
|
||||
}
|
||||
|
||||
this.GuardaLog($"EjecutaThalamus: Consultando Almacenes. ");
|
||||
if (ObjGenerales.GetJAMCorveta(4) & ErrorProceso == false)
|
||||
{
|
||||
DTAlmacenes = ObjGenerales.DtResultados.Copy();
|
||||
SBLog.AppendLine($"<tr><td>Almacenes</td><td>{DTAlmacenes.Rows.Count}</td></tr>");
|
||||
this.GuardaLog($"EjecutaThalamus: Consultando Almacenes Correcto {DTAlmacenes.Rows.Count} registros. ");
|
||||
}
|
||||
else {
|
||||
ErrorProceso = true;
|
||||
SBLog.AppendLine($"<tr><td>Almacenes</td><td>Error al consultar</td></tr>");
|
||||
this.GuardaLog($"EjecutaThalamus: Consultando Almacenes Error. ");
|
||||
}
|
||||
|
||||
SBLog.AppendLine("</table>");
|
||||
@@ -166,12 +184,14 @@ public class TareasJam : IHttpHandler
|
||||
try
|
||||
{
|
||||
|
||||
this.GuardaLog($"EjecutaThalamus: Renombrando columnas tabla productos. ");
|
||||
DTProductos.Columns[0].ColumnName = "Código Producto Interno";
|
||||
DTProductos.Columns[1].ColumnName = "Nombre del Producto";
|
||||
DTProductos.Columns[2].ColumnName = "Presentación";
|
||||
DTProductos.AcceptChanges();
|
||||
|
||||
|
||||
this.GuardaLog($"EjecutaThalamus: Renombrando columnas tabla clientes. ");
|
||||
DTClientes.Columns[4].ColumnName = "address.countryId";
|
||||
DTClientes.Columns[5].ColumnName = "address.stateId";
|
||||
DTClientes.Columns[6].ColumnName = "address.city";
|
||||
@@ -189,6 +209,8 @@ public class TareasJam : IHttpHandler
|
||||
//DTClientes.Columns.RemoveAt(7);
|
||||
DTClientes.AcceptChanges();
|
||||
|
||||
|
||||
this.GuardaLog($"EjecutaThalamus: Renombrando columnas tabla ventas. ");
|
||||
DTVentas.Columns.RemoveAt(7);
|
||||
//DTVentas.Columns.RemoveAt(6);
|
||||
|
||||
@@ -197,13 +219,14 @@ public class TareasJam : IHttpHandler
|
||||
DTVentas.AcceptChanges();
|
||||
|
||||
|
||||
|
||||
this.GuardaLog($"EjecutaThalamus: Renombrando columnas tabla almacenes. ");
|
||||
DTAlmacenes.Columns[2].ColumnName = "Description";
|
||||
DTAlmacenes.Columns[3].ColumnName = "Stock Date";
|
||||
DTAlmacenes.AcceptChanges();
|
||||
|
||||
|
||||
|
||||
this.GuardaLog($"EjecutaThalamus: procesando tabla de ventas DTVentas.Clone() para asiganación de tipo de dato fecha. ");
|
||||
DataTable dtCloned = DTVentas.Clone();
|
||||
dtCloned.Columns[3].DataType = typeof(DateTime);
|
||||
|
||||
@@ -221,7 +244,7 @@ public class TareasJam : IHttpHandler
|
||||
|
||||
DTVentas.AcceptChanges();
|
||||
|
||||
|
||||
this.GuardaLog($"EjecutaThalamus: procesando tabla de ventas DTAlmacenes.Clone() para asiganación de tipo de dato fecha. ");
|
||||
dtCloned = DTAlmacenes.Clone();
|
||||
dtCloned.Columns[3].DataType = typeof(DateTime);
|
||||
|
||||
@@ -242,6 +265,7 @@ public class TareasJam : IHttpHandler
|
||||
catch (Exception e)
|
||||
{
|
||||
SBLog.AppendLine("<b>Error al renombrar columnas</b>");
|
||||
this.GuardaLog($"EjecutaThalamus: Error procesamiento de tablas " + e.StackTrace.ToString() + " ");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,6 +274,8 @@ public class TareasJam : IHttpHandler
|
||||
if (!ErrorProceso)
|
||||
{
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
this.GuardaLog($"EjecutaThalamus: llenando archivo excel ventas. ");
|
||||
int count = 2;
|
||||
var wbVentas = new ClosedXML.Excel.XLWorkbook(FormatoVentas);
|
||||
var wsVentas = wbVentas.Worksheet(1);
|
||||
@@ -259,12 +285,13 @@ public class TareasJam : IHttpHandler
|
||||
wsVentas.Cell(count, 1).Value = "'" + DRow["systemId"].ToString();
|
||||
wsVentas.Cell(count, 2).Value = DRow["Branch"].ToString();
|
||||
wsVentas.Cell(count, 3).Value = "'" + DRow["Code"].ToString();
|
||||
wsVentas.Cell(count, 4).Value = DRow["Sale Date"].ToString();
|
||||
wsVentas.Cell(count, 4).Value = DRow["Sale Date"].ToString();
|
||||
wsVentas.Cell(count, 5).Value = DRow["Quantity"].ToString();
|
||||
wsVentas.Cell(count, 6).Value = DRow["Amount"].ToString();
|
||||
wsVentas.Cell(count, 7).Value = DRow["Transaction ID"].ToString();
|
||||
count++;
|
||||
}
|
||||
this.GuardaLog($"EjecutaThalamus: guardando archivo excel ventas " + RutaVentas + " ");
|
||||
wbVentas.SaveAs(RutaVentas);
|
||||
|
||||
var wbAlmacenes = new ClosedXML.Excel.XLWorkbook(FormatoAlmacenes);
|
||||
@@ -272,14 +299,16 @@ public class TareasJam : IHttpHandler
|
||||
|
||||
count = 2;
|
||||
|
||||
this.GuardaLog($"EjecutaThalamus: llenando archivo excel almacenes. ");
|
||||
foreach (DataRow DRow in DTAlmacenes.Rows)
|
||||
{
|
||||
wsAlmacenes.Cell(count, 1).Value = "'" + DRow["Code"].ToString();
|
||||
wsAlmacenes.Cell(count, 2).Value = DRow["Quantity"].ToString();
|
||||
wsAlmacenes.Cell(count, 3).Value = DRow["Description"].ToString();
|
||||
wsAlmacenes.Cell(count, 4).Value = DRow["Stock Date"].ToString();
|
||||
wsAlmacenes.Cell(count, 4).Value = DRow["Stock Date"].ToString();
|
||||
count++;
|
||||
}
|
||||
this.GuardaLog($"EjecutaThalamus: guardando archivo excel alamcenes " + RutaAlmacenes + " ");
|
||||
wbAlmacenes.SaveAs(RutaAlmacenes);
|
||||
|
||||
var wbAClientes = new ClosedXML.Excel.XLWorkbook(FormatoClientes);
|
||||
@@ -287,6 +316,7 @@ public class TareasJam : IHttpHandler
|
||||
|
||||
count = 2;
|
||||
|
||||
this.GuardaLog($"EjecutaThalamus: llenando archivo excel clientes. ");
|
||||
foreach (DataRow DRow in DTClientes.Rows)
|
||||
{
|
||||
wsClientes.Cell(count, 1).Value = "'" + DRow["systemId"].ToString();
|
||||
@@ -306,13 +336,15 @@ public class TareasJam : IHttpHandler
|
||||
|
||||
count++;
|
||||
}
|
||||
|
||||
this.GuardaLog($"EjecutaThalamus: guardando archivo excel clientes " + RutaClientes + " ");
|
||||
wbAClientes.SaveAs(RutaClientes);
|
||||
|
||||
var wbProductos= new ClosedXML.Excel.XLWorkbook(FormatoProductos);
|
||||
var wsProductos = wbProductos.Worksheet(1);
|
||||
|
||||
count = 2;
|
||||
|
||||
this.GuardaLog($"EjecutaThalamus: llenando archivo excel productos. ");
|
||||
foreach (DataRow DRow in DTProductos.Rows)
|
||||
{
|
||||
wsProductos.Cell(count, 1).Value = "'" + DRow["Código Producto Interno"].ToString();
|
||||
@@ -321,6 +353,7 @@ public class TareasJam : IHttpHandler
|
||||
|
||||
count++;
|
||||
}
|
||||
this.GuardaLog($"EjecutaThalamus: guardando archivo excel productos " + RutaProductos + " ");
|
||||
wbProductos.SaveAs(RutaProductos);
|
||||
/////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -337,10 +370,13 @@ public class TareasJam : IHttpHandler
|
||||
SBLog.AppendLine("<b>Cargas</b><br>");
|
||||
SBLog.AppendLine("<table border='1'> <tr><th>Archivo</th><th>Estado</th></tr>");
|
||||
|
||||
|
||||
this.GuardaLog($"EjecutaThalamus: Cargando archivo excel productos a FTP. ");
|
||||
CargaProductos = CargarArchivos(FInfoProductos, FTPServer, TFPUsr, FTPPass);
|
||||
|
||||
if (CargaProductos)
|
||||
{
|
||||
this.GuardaLog($"EjecutaThalamus: Verificando archivo productos. ");
|
||||
CargaProductos = VerificarArchivo(FInfoProductos, FInfoProductos.Length, FTPServer, TFPUsr, FTPPass);
|
||||
}
|
||||
|
||||
@@ -355,9 +391,11 @@ public class TareasJam : IHttpHandler
|
||||
|
||||
if (CargaProductos)
|
||||
{
|
||||
this.GuardaLog($"EjecutaThalamus: Cargando archivo excel ventas a FTP. ");
|
||||
CargaVentas = CargarArchivos(FInfoVentas, $"{FTPServer}/Ventas", TFPUsr, FTPPass);
|
||||
if (CargaVentas)
|
||||
{
|
||||
this.GuardaLog($"EjecutaThalamus: Verificando archivo ventas. ");
|
||||
CargaVentas = VerificarArchivo(FInfoVentas, FInfoVentas.Length, $"{FTPServer}/Ventas", TFPUsr, FTPPass);
|
||||
}
|
||||
}
|
||||
@@ -373,9 +411,11 @@ public class TareasJam : IHttpHandler
|
||||
|
||||
if (CargaProductos & CargaVentas)
|
||||
{
|
||||
this.GuardaLog($"EjecutaThalamus: Cargando archivo excel clientes a FTP. ");
|
||||
CargaClientes = CargarArchivos(FInfoClientes, $"{FTPServer}/Clientes", TFPUsr, FTPPass);
|
||||
if (CargaClientes)
|
||||
{
|
||||
this.GuardaLog($"EjecutaThalamus: Verificando archivo clientes. ");
|
||||
CargaClientes = VerificarArchivo(FInfoClientes, FInfoClientes.Length, $"{FTPServer}/Clientes", TFPUsr, FTPPass);
|
||||
}
|
||||
}
|
||||
@@ -391,9 +431,11 @@ public class TareasJam : IHttpHandler
|
||||
|
||||
if (CargaProductos & CargaVentas & CargaClientes)
|
||||
{
|
||||
this.GuardaLog($"EjecutaThalamus: Cargando archivo excel almacenes a FTP. ");
|
||||
CargaAlmacenes = CargarArchivos(FInfoAlmacenes, $"{FTPServer}/Stock", TFPUsr, FTPPass);
|
||||
if (CargaClientes)
|
||||
{
|
||||
this.GuardaLog($"EjecutaThalamus: Verificando archivo almacenes. ");
|
||||
CargaAlmacenes = VerificarArchivo(FInfoAlmacenes, FInfoAlmacenes.Length, $"{FTPServer}/Stock", TFPUsr, FTPPass);
|
||||
}
|
||||
}
|
||||
@@ -429,8 +471,10 @@ public class TareasJam : IHttpHandler
|
||||
string Cuerpo = Respuesta ? $"<b>Correcto</b><br>Tarea de carga de archios Corteva realizada correctamente<br> {SBLog.ToString()}" : $"<b>Error</b><br> Error tarea de carga de archios Corteva<br> {SBLog.ToString()}" ;
|
||||
|
||||
|
||||
this.GuardaLog($"EjecutaThalamus: Enviado correo. ");
|
||||
MandaCorreo(Cuerpo, Respuesta, RutaProductos, RutaVentas, RutaClientes, RutaAlmacenes);
|
||||
|
||||
this.GuardaLog($"EjecutaThalamus: Tarea terminada se regresa respuesta {Respuesta.ToString()}. ");
|
||||
return Respuesta;
|
||||
|
||||
}
|
||||
@@ -461,15 +505,17 @@ public class TareasJam : IHttpHandler
|
||||
|
||||
|
||||
ClsSisMail Correo = new ClsSisMail();
|
||||
string Para = "julian@adssistemas.mx;rene.molina@adssistemas.mx;oscar.irigoyen@adssistemas.mx";
|
||||
//string Para = "oscar.irigoyen@adssistemas.mx";
|
||||
string Para = "julian@adssistemas.mx;rene.molina@adssistemas.mx;oscar.irigoyen@adssistemas.mx";
|
||||
// string Para = "oscar.irigoyen@adssistemas.mx";
|
||||
string Asunto = ErrorProceso ? $"Carga Layout Corteva {DateTime.Now.ToString("yyyy-MM-dd")}" : $"Carga Layout Corteva Error {DateTime.Now.ToString("yyyy-MM-dd")}";
|
||||
|
||||
Correo.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Cuerpo, Archivos:ListaArchivos);
|
||||
this.GuardaLog($"EjecutaThalamus: MandaCorreo() correo enviado. ");
|
||||
|
||||
}catch(Exception ex)
|
||||
{
|
||||
Extensiones.ModExtensiones.GuardaLog(null,$"Error Tareas Programadas 119 error enviar mail --> {ex.Message} ");
|
||||
this.GuardaLog($"EjecutaThalamus: MandaCorreo() Error {ex.StackTrace.ToString()}. ");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -480,6 +526,8 @@ public class TareasJam : IHttpHandler
|
||||
|
||||
if (FInfo.Exists)
|
||||
{
|
||||
this.GuardaLog($"EjecutaThalamus: CargarArchivos() Conectando a TFP. ");
|
||||
|
||||
FtpWebRequest request = (FtpWebRequest)WebRequest.Create($"{FTPServer}/{FInfo.Name}");
|
||||
request.Method = WebRequestMethods.Ftp.UploadFile;
|
||||
int tamanio = 1024;
|
||||
@@ -491,10 +539,12 @@ public class TareasJam : IHttpHandler
|
||||
{
|
||||
request.GetResponse();
|
||||
Conected = true;
|
||||
this.GuardaLog($"EjecutaThalamus: CargarArchivos() conexión a TFP correcta. ");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Extensiones.ModExtensiones.GuardaLog(null,$"Error Tareas Programadas 119 Conexión a servidor FTP archivo { FInfo.Name } {ex.Message} ");
|
||||
this.GuardaLog($"EjecutaThalamus: CargarArchivos() FTP Error Tareas Programadas 119 Conexión a servidor FTP archivo { FInfo.Name } {ex.Message}. ");
|
||||
}
|
||||
|
||||
if (Conected)
|
||||
@@ -517,16 +567,20 @@ public class TareasJam : IHttpHandler
|
||||
{
|
||||
Respuesta = false;
|
||||
Extensiones.ModExtensiones.GuardaLog(null,$"Error Tareas Programadas 119 cargando archivo { FInfo.Name } {ex.Message} ");
|
||||
this.GuardaLog($"EjecutaThalamus: CargarArchivos() Conectando a TFP Error Tareas Programadas 119 cargando archivo { FInfo.Name } {ex.Message}. ");
|
||||
}
|
||||
|
||||
|
||||
if (f is object)
|
||||
{
|
||||
f.Close();
|
||||
}
|
||||
|
||||
this.GuardaLog($"EjecutaThalamus: CargarArchivos() TFP cerrrando conxión. ");
|
||||
if (ftpStream is object)
|
||||
{
|
||||
ftpStream.Close();
|
||||
this.GuardaLog($"EjecutaThalamus: CargarArchivos() TFP conxión cerrada. ");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -553,6 +607,7 @@ public class TareasJam : IHttpHandler
|
||||
|
||||
try
|
||||
{
|
||||
this.GuardaLog($"EjecutaThalamus: VerificarArchivo() conectando a FTP .");
|
||||
FtpWebRequest request = (FtpWebRequest)WebRequest.Create($"{FTPServer}/{FInfo.Name}");
|
||||
request.Credentials = new NetworkCredential(FTPUsr, FTPPass);
|
||||
request.Method = WebRequestMethods.Ftp.GetFileSize;
|
||||
@@ -562,14 +617,20 @@ public class TareasJam : IHttpHandler
|
||||
respSize = (FtpWebResponse)request.GetResponse();
|
||||
long size = respSize.ContentLength;
|
||||
respSize.Close();
|
||||
|
||||
this.GuardaLog($"EjecutaThalamus: VerificarArchivo() tamaño local {Tamanio} ftp { size}. ");
|
||||
if (Tamanio == size)
|
||||
{
|
||||
Respuesta = true;
|
||||
this.GuardaLog($"EjecutaThalamus: VerificarArchivo() tamaño ok. ");
|
||||
}
|
||||
|
||||
}catch(Exception ex)
|
||||
{
|
||||
|
||||
Extensiones.ModExtensiones.GuardaLog(null,$"Error Tareas Programadas 119 verificando archivo { FInfo.Name } {ex.Message} ");
|
||||
this.GuardaLog($"EjecutaThalamus: VerificarArchivo() Error {ex.StackTrace.ToString()}. " );
|
||||
|
||||
Respuesta = false;
|
||||
}
|
||||
|
||||
@@ -592,7 +653,7 @@ public class TareasJam : IHttpHandler
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Extensiones.ModExtensiones.GuardaLog(null, $"Error Tareas Programadas 119 error Prueba de Conexión a servidor FTP archivo {ex.Message} ");
|
||||
Extensiones.ModExtensiones.GuardaLog(null, $"Error Tareas Programadas 119 error Prueba de Conexión a servidor FTP archivo {ex.Message}. ");
|
||||
}
|
||||
|
||||
return Respuesta;
|
||||
@@ -603,6 +664,6 @@ public class TareasJam : IHttpHandler
|
||||
public bool IsReusable
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -84,6 +84,13 @@
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-1" >Esquema Nuevo:</div>
|
||||
<div class="col-md-2" style="vertical-align:bottom;align-items:initial">
|
||||
<asp:CheckBox runat="server" ID ="ChkEsquemaNuevo" CssClass="md-checksd" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
|
||||
@@ -66,7 +66,7 @@ public partial class Ventas_RepComisionesJAM : ClsPaginas
|
||||
|
||||
GvDatos.Columns[15].Visible = UsuarioActual.TienePermisoProceso(201);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void Consulta()
|
||||
{
|
||||
@@ -108,18 +108,26 @@ public partial class Ventas_RepComisionesJAM : ClsPaginas
|
||||
else if (e.Row.DBCampo("CveVenta").ToEntero() < 1)
|
||||
{
|
||||
e.Row.CssClass = "SubTotales2";
|
||||
//e.Row.Cells[0].Text = e.Row.DBCampo("Vendedor").ToString();
|
||||
//e.Row.Cells[0].Text = e.Row.DBCampo("Vendedor").ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (e.Row.DBCampo("Transaccion").ToString() == "Pago")
|
||||
{
|
||||
if (e.Row.DBCampo("CveCategoria").ToEntero() < 1)
|
||||
{
|
||||
if (UsuarioActual.TienePermisoProceso(201))
|
||||
{
|
||||
e.Row.Cells[21].ToolTip = "No se encuentra dentro de alguna categoria especificada.";
|
||||
e.Row.Cells[22].ToolTip = "No se encuentra dentro de alguna categoria especificada.";
|
||||
else
|
||||
{
|
||||
if (e.Row.DBCampo("Transaccion").ToString() == "Pago")
|
||||
{
|
||||
if (e.Row.DBCampo("CveCategoria").ToEntero() < 1 && e.Row.DBCampo("Comision").ToDouble() == 0)
|
||||
{
|
||||
//if (UsuarioActual.TienePermisoProceso(201))
|
||||
//{
|
||||
// e.Row.Cells[21].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales.";
|
||||
// e.Row.Cells[22].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales.";
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
e.Row.Cells[21].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales.";
|
||||
e.Row.Cells[22].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales.";
|
||||
//}
|
||||
}else if (e.Row.DBCampo("CveCategoria").ToEntero() > 0 )
|
||||
{
|
||||
e.Row.Cells[21].ToolTip = $"El producto obtuvo la comision porque se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria",$"CveCategoria = {e.Row.DBCampo("CveCategoria").ToString()}")}.";
|
||||
e.Row.Cells[22].ToolTip = $"El producto obtuvo la comision porque se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {e.Row.DBCampo("CveCategoria").ToString()}")}.";
|
||||
}else if(e.Row.DBCampo("Comision").ToDouble() > 0)
|
||||
|
||||
@@ -7908,7 +7908,7 @@
|
||||
$get('HdnTotalVenta').value = FormatoNumero(totalVenta, 2);
|
||||
}
|
||||
|
||||
function chkAnt(t, txt, importe) {
|
||||
function chkAnt(t, txt, importe, AmorContrato = 0) {
|
||||
debugger;
|
||||
var totalAnt = 0;
|
||||
|
||||
@@ -7925,6 +7925,8 @@
|
||||
|
||||
if (SaldoCompra > 0) {
|
||||
|
||||
|
||||
|
||||
//if (SaldoCompra > importe) {
|
||||
// txt.value = importe.toFixed(2);
|
||||
// SaldoCompra = SaldoCompra - importe;
|
||||
@@ -7935,7 +7937,14 @@
|
||||
// //SaldoCompra = 0.00;
|
||||
// $get('HdnVentaSaldo').value = SaldoCompra;
|
||||
//}
|
||||
txt.value = importe.toFixed(2);
|
||||
|
||||
if(AmorContrato > 0){
|
||||
txt.value = AmorContrato.toFixed(2);
|
||||
}else{
|
||||
txt.value = importe.toFixed(2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
totalAnt = FnSumaValoresAnt();
|
||||
|
||||
|
||||
@@ -1314,6 +1314,7 @@ Partial Class Ventas
|
||||
#End Region
|
||||
|
||||
#Region "Propiedades Contratos"
|
||||
|
||||
Private Property DtContratos As DataTable
|
||||
Get
|
||||
Return If(IsNothing(ViewState("DtContratos")), Nothing, CType(ViewState("DtContratos"), DataTable))
|
||||
@@ -1403,6 +1404,59 @@ Partial Class Ventas
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Private Property PorAmortizacionAnticipo As Integer
|
||||
Get
|
||||
|
||||
If ViewState("PorAmortizacionAnticipo") Is Nothing Then
|
||||
Return 0
|
||||
Else
|
||||
Return CType(ViewState("PorAmortizacionAnticipo"), Integer)
|
||||
End If
|
||||
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("PorAmortizacionAnticipo") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
|
||||
Private Property AmortizacionSujeridaContrato As Decimal
|
||||
Get
|
||||
|
||||
If ViewState("AmortizacionSujeridaContrato") Is Nothing Then
|
||||
Return 0
|
||||
Else
|
||||
Return ViewState("AmortizacionSujeridaContrato").ToString.ToDecimal
|
||||
End If
|
||||
|
||||
End Get
|
||||
Set(value As Decimal)
|
||||
ViewState("AmortizacionSujeridaContrato") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property EscontratoObra As Boolean
|
||||
Get
|
||||
If ViewState("EscontratoObra") Is Nothing Then
|
||||
Return False
|
||||
Else
|
||||
Return Boolean.Parse(ViewState("EscontratoObra").ToString)
|
||||
End If
|
||||
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("EscontratoObra") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
#Region " PROPIEDADES NUEVAS | GUARDAR - IMPRESION "
|
||||
@@ -1454,6 +1508,14 @@ Partial Class Ventas
|
||||
ViewState("ObjFacturaNC") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
#Region " PROPIEDADES NUEVAS "
|
||||
@@ -3077,6 +3139,19 @@ Partial Class Ventas
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If DrContrato("CveContratoTipo").ToString.ToEntero.Contiene(30, 31) Then
|
||||
PorAmortizacionAnticipo = DrContrato("PorAmortizacionAnticipo").ToString.ToEntero
|
||||
EscontratoObra = True
|
||||
Else
|
||||
PorAmortizacionAnticipo = 0
|
||||
EscontratoObra = False
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
LbContratoImporteTotal.Text = DrContrato("ImporteTotal").ToString().FormatoNumero
|
||||
LbContratoImporteMinimo.Text = DrContrato("ImporteMin").ToString().FormatoNumero
|
||||
LbContratoImporteMaximo.Text = DrContrato("ImporteMax").ToString().FormatoNumero
|
||||
@@ -7228,6 +7303,9 @@ Partial Class Ventas
|
||||
|
||||
Protected Sub EmitirImprimirNew(Optional TipoDoctoViejo As String = "")
|
||||
|
||||
If Not ValidaVentaContratoObra() Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If ValidaPagosContado() Then
|
||||
Exit Sub
|
||||
@@ -8775,7 +8853,7 @@ Partial Class Ventas
|
||||
ObjFactura.NumeroPersonas = 0
|
||||
|
||||
|
||||
If ObjFactura.TipoDocto = "Ant" And DdlContratosModal.SelectedValue.ToEntero > 0 Then
|
||||
If ObjFactura.TipoDocto = "Ant" And DdlContratosModal.SelectedValue.ToEntero > 0 Or ObjFactura.TipoDocto = "Ing" And DdlContratosModal.SelectedValue.ToEntero > 0 Then
|
||||
CveContrato = DdlContratosModal.SelectedValue.ToEntero
|
||||
End If
|
||||
|
||||
@@ -13107,8 +13185,19 @@ Partial Class Ventas
|
||||
maxsaldo = total
|
||||
End If
|
||||
|
||||
|
||||
If DdlContratosModal.SelectedValue.ToEntero > 0 AndAlso AmortizacionSujeridaContrato > 0 Then
|
||||
|
||||
If AmortizacionSujeridaContrato > saldo Then
|
||||
AmortizacionSujeridaContrato = saldo
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
e.Row.FCLiteral("MonedaVenta").Text = saldo.FormatoNumero(2)
|
||||
e.Row.FCCheckBox("Chk" & e.Row.RowIndex).Attributes.Add("onclick", String.Format("chkAnt(this,{0},{1});", e.Row.FCTextBox("TxtAnticipo" & e.Row.RowIndex).ClientID, saldo))
|
||||
e.Row.FCCheckBox("Chk" & e.Row.RowIndex).Attributes.Add("onclick", String.Format("chkAnt(this,{0},{1},{2});", e.Row.FCTextBox("TxtAnticipo" & e.Row.RowIndex).ClientID, saldo, AmortizacionSujeridaContrato))
|
||||
e.Row.FCTextBox("TxtAnticipo" & e.Row.RowIndex).Attributes.Add("onKeyUp", String.Format("FnCambiaAnt({0},this,{1});", e.Row.FCCheckBox("Chk" & e.Row.RowIndex).ClientID, saldo))
|
||||
e.Row.FCTextBox("TxtTC" & e.Row.RowIndex).Attributes.Add("onKeyUp", String.Format("CambioTipoMoneda({0},{1},{2},{3},{4});", e.Row.FCCheckBox("Chk" & e.Row.RowIndex).ClientID, e.Row.DataKey("Saldo"), e.Row.FCTextBox("TxtAnticipo" & e.Row.RowIndex).ClientID, e.Row.FCTextBox("TxtTC" & e.Row.RowIndex).ClientID, e.Row.DataKey("CveMoneda")))
|
||||
|
||||
@@ -13145,7 +13234,7 @@ Partial Class Ventas
|
||||
|
||||
|
||||
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub BtnAceptarAnticipos_Click(sender As Object, e As System.EventArgs) Handles BtnAceptarAnticipos.Click
|
||||
Anticipos()
|
||||
@@ -25037,7 +25126,12 @@ Partial Class Ventas
|
||||
End Sub
|
||||
|
||||
Private Sub DdlTipoAmortizacionAnticipo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoAmortizacionAnticipo.SelectedIndexChanged
|
||||
|
||||
|
||||
ImporteSujeridoAnticipo(DdlTipoAmortizacionAnticipo.SelectedValue.ToEntero)
|
||||
|
||||
divAnticipoMsg.Visible = False
|
||||
|
||||
If DdlTipoAmortizacionAnticipo.SelectedValue.Contiene("1", "2") Then
|
||||
'cuando es amortización por descuento, debe tener seleccionado descuentos previamente registrados
|
||||
If DdlTipoAmortizacionAnticipo.SelectedValue = "1" AndAlso LblDescuentos.Text.ToDecimal <= 0 Then
|
||||
@@ -25059,6 +25153,34 @@ Partial Class Ventas
|
||||
DdlTipoRelacionAnticipo.SelectedValueExist("-1")
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub ImporteSujeridoAnticipo(TipoAmortizacion As Integer)
|
||||
|
||||
'TipoAmortizacion
|
||||
'1.-Anticpo como descuento se basa en subtotal
|
||||
'2.-Anticipo con notade credito se basa en total
|
||||
|
||||
AmortizacionSujeridaContrato = 0
|
||||
Dim Porcentaje As Decimal = PorAmortizacionAnticipo * 0.01D
|
||||
|
||||
If PorAmortizacionAnticipo > 0 AndAlso TipoAmortizacion > 0 Then
|
||||
|
||||
If TipoAmortizacion = 1 Then
|
||||
AmortizacionSujeridaContrato = (TxtSubTotal2.Text.ToDecimal * Porcentaje).RoundSQL(2)
|
||||
ElseIf TipoAmortizacion = 2 Then
|
||||
AmortizacionSujeridaContrato = (TxtTotal.Text.ToDecimal * Porcentaje).RoundSQL(2)
|
||||
End If
|
||||
|
||||
Else
|
||||
AmortizacionSujeridaContrato = 0
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub DdlMetodoPago33_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlMetodoPago33.SelectedIndexChanged
|
||||
@@ -27726,6 +27848,55 @@ Partial Class Ventas
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Function ValidaVentaContratoObra() As Boolean
|
||||
|
||||
Dim Respuesta As Boolean = False
|
||||
|
||||
If EscontratoObra Then
|
||||
|
||||
If DdlTipoComprobante.SelectedValue = "Ing" Then
|
||||
|
||||
If DdlEstimacionesObra.SelectedValue.ToEntero > 0 Then
|
||||
|
||||
Dim ImporteAmortizarFinal As Decimal = 0
|
||||
If GVAnticipos.Rows.Count > 0 Then
|
||||
Dim actualindex As Integer = 0
|
||||
For Each row2 As GridViewRow In GVAnticipos.Rows
|
||||
If row2.FCCheckBox("Chk" & row2.RowIndex).Checked Then
|
||||
ImporteAmortizarFinal = ImporteAmortizarFinal + row2.FCTextBox($"TxtAnticipo{actualindex}").Text.ToDecimal
|
||||
End If
|
||||
actualindex = actualindex + 1
|
||||
Next
|
||||
End If
|
||||
|
||||
If ImporteAmortizarFinal > 0 Then
|
||||
Respuesta = True
|
||||
Else
|
||||
Respuesta = False
|
||||
Alert("Debe de seleccioanr un importe de amortización.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
Else
|
||||
Respuesta = False
|
||||
Alert("Se selecciono un contrato de obra, para continuar seleccione una estimación.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
ElseIf DdlTipoComprobante.SelectedValue = "Ant" Then
|
||||
Respuesta = True
|
||||
Else
|
||||
Alert("Tipo de documento no valido para contratos de obra.", TipoMensaje.MsgAdvertencia)
|
||||
Respuesta = True
|
||||
End If
|
||||
|
||||
Else
|
||||
Respuesta = True
|
||||
End If
|
||||
|
||||
Return Respuesta
|
||||
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user