Merge branch 'master' of http://rpimienta@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -168,7 +168,7 @@
|
|||||||
<div class="progress-info">
|
<div class="progress-info">
|
||||||
|
|
||||||
<div class="progress">
|
<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 runat="server" id="SPAvance2" class="sr-only">76% Avance</span>--%>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -220,7 +220,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="progress-info">
|
<div class="progress-info">
|
||||||
<div class="progress">
|
<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 class="sr-only">76% Avance</span>--%>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -52,8 +52,8 @@ Partial Class RepContratosObraAvances
|
|||||||
Dim TotalFaltante As Decimal = TotalContratos - TotalAvance
|
Dim TotalFaltante As Decimal = TotalContratos - TotalAvance
|
||||||
|
|
||||||
|
|
||||||
Dim TotalAvancePorcentaje As Decimal = (TotalAvance * 100) / TotalContratos
|
Dim TotalAvancePorcentaje As Decimal = ((TotalAvance * 100) / TotalContratos).RoundAD(2)
|
||||||
Dim TotalFaltantePorcentaje As Decimal = 100 - TotalAvancePorcentaje
|
Dim TotalFaltantePorcentaje As Decimal = (100 - TotalAvancePorcentaje).RoundAD(2)
|
||||||
|
|
||||||
|
|
||||||
LtlGrafNumeroContratos.Text = NumeroContratos.ToString
|
LtlGrafNumeroContratos.Text = NumeroContratos.ToString
|
||||||
|
|||||||
@@ -88,7 +88,13 @@ Partial Class RepContratosObraAvancesDetalle
|
|||||||
|
|
||||||
Dim AvanceImporte As Decimal = DTDatos(0)("AvanceImporte").ToString.ToDecimal
|
Dim AvanceImporte As Decimal = DTDatos(0)("AvanceImporte").ToString.ToDecimal
|
||||||
Dim TotalContratos As Decimal = DTDatos(0)("Importe").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 TotalFaltantePorcentaje As Decimal = 100 - TotalAvancePorcentaje
|
||||||
|
|
||||||
Dim FechaFinal As Date = DTDatos(0)("FechaFinal").ToString.ToDate
|
Dim FechaFinal As Date = DTDatos(0)("FechaFinal").ToString.ToDate
|
||||||
|
|||||||
@@ -92,9 +92,16 @@
|
|||||||
<li>
|
<li>
|
||||||
<asp:LinkButton ID="LnkExportar" runat="server"><i class="fa fa-ad-excel"></i> Generar Excel</asp:LinkButton>
|
<asp:LinkButton ID="LnkExportar" runat="server"><i class="fa fa-ad-excel"></i> Generar Excel</asp:LinkButton>
|
||||||
</li>
|
</li>
|
||||||
|
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
<li>
|
<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>
|
</li>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|
||||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
<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 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="Cantidad Restante" DataField="CantidadF" DataFormatString="{0:#,##0.##}" ItemStyle-HorizontalAlign="Right" />
|
||||||
<asp:BoundField HeaderText="Proveedor/Producto ó Servicio" DataField="CodigoPS" ItemStyle-HorizontalAlign="Left" />
|
<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:BoundField HeaderText="Total" DataField="Total" DataFormatString="{0:#,##0.##}" ItemStyle-HorizontalAlign="Right" />
|
||||||
<asp:TemplateField ItemStyle-Width="70px" HeaderText="Acción" ItemStyle-HorizontalAlign="Center">
|
<asp:TemplateField ItemStyle-Width="70px" HeaderText="Acción" ItemStyle-HorizontalAlign="Center">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
|
|||||||
@@ -72,9 +72,9 @@ Partial Class RepNotasSinAlmacen
|
|||||||
Private Sub CargaPermisos()
|
Private Sub CargaPermisos()
|
||||||
Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201)
|
Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201)
|
||||||
Dim TienePermisoDesmarcar As Boolean = UsuarioActual.TienePermisoProceso(278)
|
Dim TienePermisoDesmarcar As Boolean = UsuarioActual.TienePermisoProceso(278)
|
||||||
GvVentas.Columns(4).Visible = TienePermisoImportes
|
GvVentas.Columns(5).Visible = TienePermisoImportes
|
||||||
GvCompras.Columns(3).Visible = TienePermisoImportes
|
GvCompras.Columns(4).Visible = TienePermisoImportes
|
||||||
GvCompras.Columns(4).Visible = TienePermisoDesmarcar
|
GvCompras.Columns(5).Visible = TienePermisoDesmarcar
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CargaCombos()
|
Private Sub CargaCombos()
|
||||||
TxtFechaF.Text = Date.Now.ToShortDateString
|
TxtFechaF.Text = Date.Now.ToShortDateString
|
||||||
|
|||||||
@@ -49,6 +49,9 @@ public class TareasJam : IHttpHandler
|
|||||||
private bool EjecutaThalamus(int CveEmpresa)
|
private bool EjecutaThalamus(int CveEmpresa)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
this.GuardaLog("EjecutaThalamus: Inicio. ");
|
||||||
|
|
||||||
bool Respuesta = false;
|
bool Respuesta = false;
|
||||||
StringBuilder SBLog = new StringBuilder();
|
StringBuilder SBLog = new StringBuilder();
|
||||||
|
|
||||||
@@ -96,6 +99,7 @@ public class TareasJam : IHttpHandler
|
|||||||
}
|
}
|
||||||
catch (Exception ex) {
|
catch (Exception ex) {
|
||||||
SBLog.AppendLine("<b>Error al eliminar archivos</b>");
|
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("<b>Consultas</b><br>");
|
||||||
SBLog.AppendLine("<table border='1'><tr><th>Consulta</th><th>Registros</th></tr>");
|
SBLog.AppendLine("<table border='1'><tr><th>Consulta</th><th>Registros</th></tr>");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
this.GuardaLog("EjecutaThalamus: Consultando Prodcutos. ");
|
||||||
if (ObjGenerales.GetJAMCorveta(1))
|
if (ObjGenerales.GetJAMCorveta(1))
|
||||||
{
|
{
|
||||||
DTProductos = ObjGenerales.DtResultados.Copy();
|
DTProductos = ObjGenerales.DtResultados.Copy();
|
||||||
SBLog.AppendLine($"<tr><td>Productos</td><td>{DTProductos.Rows.Count}</td></tr>");
|
SBLog.AppendLine($"<tr><td>Productos</td><td>{DTProductos.Rows.Count}</td></tr>");
|
||||||
|
this.GuardaLog($"EjecutaThalamus: Consultando Prodcutos correcto {DTProductos.Rows.Count} registros. ");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ErrorProceso = true;
|
ErrorProceso = true;
|
||||||
SBLog.AppendLine($"<tr><td>Productos</td><td>Error al consultar</td></tr>");
|
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)
|
if (ObjGenerales.GetJAMCorveta(2) & ErrorProceso == false)
|
||||||
{
|
{
|
||||||
DTVentas = ObjGenerales.DtResultados.Copy();
|
DTVentas = ObjGenerales.DtResultados.Copy();
|
||||||
SBLog.AppendLine($"<tr>Ventas<td></td><td>{DTVentas.Rows.Count}</td></tr>");
|
SBLog.AppendLine($"<tr>Ventas<td></td><td>{DTVentas.Rows.Count}</td></tr>");
|
||||||
|
this.GuardaLog($"EjecutaThalamus: Consultando Ventas correcto {DTVentas.Rows.Count} registros. ");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ErrorProceso = true;
|
ErrorProceso = true;
|
||||||
SBLog.AppendLine($"<tr><td>Ventas</td><td>Error al consultar</td></tr>");
|
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();
|
DTClientes = ObjGenerales.DtResultados.Copy();
|
||||||
SBLog.AppendLine($"<tr><td>Clientes</td><td>{DTClientes.Rows.Count}</td></tr>");
|
SBLog.AppendLine($"<tr><td>Clientes</td><td>{DTClientes.Rows.Count}</td></tr>");
|
||||||
|
this.GuardaLog($"EjecutaThalamus: Consultando Clientes correco {DTClientes.Rows.Count} registros. ");
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ErrorProceso = true;
|
ErrorProceso = true;
|
||||||
SBLog.AppendLine($"<tr><td>Clientes</td><td>Error al consultar</td></tr>");
|
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)
|
if (ObjGenerales.GetJAMCorveta(4) & ErrorProceso == false)
|
||||||
{
|
{
|
||||||
DTAlmacenes = ObjGenerales.DtResultados.Copy();
|
DTAlmacenes = ObjGenerales.DtResultados.Copy();
|
||||||
SBLog.AppendLine($"<tr><td>Almacenes</td><td>{DTAlmacenes.Rows.Count}</td></tr>");
|
SBLog.AppendLine($"<tr><td>Almacenes</td><td>{DTAlmacenes.Rows.Count}</td></tr>");
|
||||||
|
this.GuardaLog($"EjecutaThalamus: Consultando Almacenes Correcto {DTAlmacenes.Rows.Count} registros. ");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ErrorProceso = true;
|
ErrorProceso = true;
|
||||||
SBLog.AppendLine($"<tr><td>Almacenes</td><td>Error al consultar</td></tr>");
|
SBLog.AppendLine($"<tr><td>Almacenes</td><td>Error al consultar</td></tr>");
|
||||||
|
this.GuardaLog($"EjecutaThalamus: Consultando Almacenes Error. ");
|
||||||
}
|
}
|
||||||
|
|
||||||
SBLog.AppendLine("</table>");
|
SBLog.AppendLine("</table>");
|
||||||
@@ -166,12 +184,14 @@ public class TareasJam : IHttpHandler
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
|
this.GuardaLog($"EjecutaThalamus: Renombrando columnas tabla productos. ");
|
||||||
DTProductos.Columns[0].ColumnName = "Código Producto Interno";
|
DTProductos.Columns[0].ColumnName = "Código Producto Interno";
|
||||||
DTProductos.Columns[1].ColumnName = "Nombre del Producto";
|
DTProductos.Columns[1].ColumnName = "Nombre del Producto";
|
||||||
DTProductos.Columns[2].ColumnName = "Presentación";
|
DTProductos.Columns[2].ColumnName = "Presentación";
|
||||||
DTProductos.AcceptChanges();
|
DTProductos.AcceptChanges();
|
||||||
|
|
||||||
|
|
||||||
|
this.GuardaLog($"EjecutaThalamus: Renombrando columnas tabla clientes. ");
|
||||||
DTClientes.Columns[4].ColumnName = "address.countryId";
|
DTClientes.Columns[4].ColumnName = "address.countryId";
|
||||||
DTClientes.Columns[5].ColumnName = "address.stateId";
|
DTClientes.Columns[5].ColumnName = "address.stateId";
|
||||||
DTClientes.Columns[6].ColumnName = "address.city";
|
DTClientes.Columns[6].ColumnName = "address.city";
|
||||||
@@ -189,6 +209,8 @@ public class TareasJam : IHttpHandler
|
|||||||
//DTClientes.Columns.RemoveAt(7);
|
//DTClientes.Columns.RemoveAt(7);
|
||||||
DTClientes.AcceptChanges();
|
DTClientes.AcceptChanges();
|
||||||
|
|
||||||
|
|
||||||
|
this.GuardaLog($"EjecutaThalamus: Renombrando columnas tabla ventas. ");
|
||||||
DTVentas.Columns.RemoveAt(7);
|
DTVentas.Columns.RemoveAt(7);
|
||||||
//DTVentas.Columns.RemoveAt(6);
|
//DTVentas.Columns.RemoveAt(6);
|
||||||
|
|
||||||
@@ -197,13 +219,14 @@ public class TareasJam : IHttpHandler
|
|||||||
DTVentas.AcceptChanges();
|
DTVentas.AcceptChanges();
|
||||||
|
|
||||||
|
|
||||||
|
this.GuardaLog($"EjecutaThalamus: Renombrando columnas tabla almacenes. ");
|
||||||
DTAlmacenes.Columns[2].ColumnName = "Description";
|
DTAlmacenes.Columns[2].ColumnName = "Description";
|
||||||
DTAlmacenes.Columns[3].ColumnName = "Stock Date";
|
DTAlmacenes.Columns[3].ColumnName = "Stock Date";
|
||||||
DTAlmacenes.AcceptChanges();
|
DTAlmacenes.AcceptChanges();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
this.GuardaLog($"EjecutaThalamus: procesando tabla de ventas DTVentas.Clone() para asiganación de tipo de dato fecha. ");
|
||||||
DataTable dtCloned = DTVentas.Clone();
|
DataTable dtCloned = DTVentas.Clone();
|
||||||
dtCloned.Columns[3].DataType = typeof(DateTime);
|
dtCloned.Columns[3].DataType = typeof(DateTime);
|
||||||
|
|
||||||
@@ -221,7 +244,7 @@ public class TareasJam : IHttpHandler
|
|||||||
|
|
||||||
DTVentas.AcceptChanges();
|
DTVentas.AcceptChanges();
|
||||||
|
|
||||||
|
this.GuardaLog($"EjecutaThalamus: procesando tabla de ventas DTAlmacenes.Clone() para asiganación de tipo de dato fecha. ");
|
||||||
dtCloned = DTAlmacenes.Clone();
|
dtCloned = DTAlmacenes.Clone();
|
||||||
dtCloned.Columns[3].DataType = typeof(DateTime);
|
dtCloned.Columns[3].DataType = typeof(DateTime);
|
||||||
|
|
||||||
@@ -242,6 +265,7 @@ public class TareasJam : IHttpHandler
|
|||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
SBLog.AppendLine("<b>Error al renombrar columnas</b>");
|
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)
|
if (!ErrorProceso)
|
||||||
{
|
{
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
this.GuardaLog($"EjecutaThalamus: llenando archivo excel ventas. ");
|
||||||
int count = 2;
|
int count = 2;
|
||||||
var wbVentas = new ClosedXML.Excel.XLWorkbook(FormatoVentas);
|
var wbVentas = new ClosedXML.Excel.XLWorkbook(FormatoVentas);
|
||||||
var wsVentas = wbVentas.Worksheet(1);
|
var wsVentas = wbVentas.Worksheet(1);
|
||||||
@@ -259,12 +285,13 @@ public class TareasJam : IHttpHandler
|
|||||||
wsVentas.Cell(count, 1).Value = "'" + DRow["systemId"].ToString();
|
wsVentas.Cell(count, 1).Value = "'" + DRow["systemId"].ToString();
|
||||||
wsVentas.Cell(count, 2).Value = DRow["Branch"].ToString();
|
wsVentas.Cell(count, 2).Value = DRow["Branch"].ToString();
|
||||||
wsVentas.Cell(count, 3).Value = "'" + DRow["Code"].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, 5).Value = DRow["Quantity"].ToString();
|
||||||
wsVentas.Cell(count, 6).Value = DRow["Amount"].ToString();
|
wsVentas.Cell(count, 6).Value = DRow["Amount"].ToString();
|
||||||
wsVentas.Cell(count, 7).Value = DRow["Transaction ID"].ToString();
|
wsVentas.Cell(count, 7).Value = DRow["Transaction ID"].ToString();
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
this.GuardaLog($"EjecutaThalamus: guardando archivo excel ventas " + RutaVentas + " ");
|
||||||
wbVentas.SaveAs(RutaVentas);
|
wbVentas.SaveAs(RutaVentas);
|
||||||
|
|
||||||
var wbAlmacenes = new ClosedXML.Excel.XLWorkbook(FormatoAlmacenes);
|
var wbAlmacenes = new ClosedXML.Excel.XLWorkbook(FormatoAlmacenes);
|
||||||
@@ -272,14 +299,16 @@ public class TareasJam : IHttpHandler
|
|||||||
|
|
||||||
count = 2;
|
count = 2;
|
||||||
|
|
||||||
|
this.GuardaLog($"EjecutaThalamus: llenando archivo excel almacenes. ");
|
||||||
foreach (DataRow DRow in DTAlmacenes.Rows)
|
foreach (DataRow DRow in DTAlmacenes.Rows)
|
||||||
{
|
{
|
||||||
wsAlmacenes.Cell(count, 1).Value = "'" + DRow["Code"].ToString();
|
wsAlmacenes.Cell(count, 1).Value = "'" + DRow["Code"].ToString();
|
||||||
wsAlmacenes.Cell(count, 2).Value = DRow["Quantity"].ToString();
|
wsAlmacenes.Cell(count, 2).Value = DRow["Quantity"].ToString();
|
||||||
wsAlmacenes.Cell(count, 3).Value = DRow["Description"].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++;
|
count++;
|
||||||
}
|
}
|
||||||
|
this.GuardaLog($"EjecutaThalamus: guardando archivo excel alamcenes " + RutaAlmacenes + " ");
|
||||||
wbAlmacenes.SaveAs(RutaAlmacenes);
|
wbAlmacenes.SaveAs(RutaAlmacenes);
|
||||||
|
|
||||||
var wbAClientes = new ClosedXML.Excel.XLWorkbook(FormatoClientes);
|
var wbAClientes = new ClosedXML.Excel.XLWorkbook(FormatoClientes);
|
||||||
@@ -287,6 +316,7 @@ public class TareasJam : IHttpHandler
|
|||||||
|
|
||||||
count = 2;
|
count = 2;
|
||||||
|
|
||||||
|
this.GuardaLog($"EjecutaThalamus: llenando archivo excel clientes. ");
|
||||||
foreach (DataRow DRow in DTClientes.Rows)
|
foreach (DataRow DRow in DTClientes.Rows)
|
||||||
{
|
{
|
||||||
wsClientes.Cell(count, 1).Value = "'" + DRow["systemId"].ToString();
|
wsClientes.Cell(count, 1).Value = "'" + DRow["systemId"].ToString();
|
||||||
@@ -306,13 +336,15 @@ public class TareasJam : IHttpHandler
|
|||||||
|
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.GuardaLog($"EjecutaThalamus: guardando archivo excel clientes " + RutaClientes + " ");
|
||||||
wbAClientes.SaveAs(RutaClientes);
|
wbAClientes.SaveAs(RutaClientes);
|
||||||
|
|
||||||
var wbProductos= new ClosedXML.Excel.XLWorkbook(FormatoProductos);
|
var wbProductos= new ClosedXML.Excel.XLWorkbook(FormatoProductos);
|
||||||
var wsProductos = wbProductos.Worksheet(1);
|
var wsProductos = wbProductos.Worksheet(1);
|
||||||
|
|
||||||
count = 2;
|
count = 2;
|
||||||
|
this.GuardaLog($"EjecutaThalamus: llenando archivo excel productos. ");
|
||||||
foreach (DataRow DRow in DTProductos.Rows)
|
foreach (DataRow DRow in DTProductos.Rows)
|
||||||
{
|
{
|
||||||
wsProductos.Cell(count, 1).Value = "'" + DRow["Código Producto Interno"].ToString();
|
wsProductos.Cell(count, 1).Value = "'" + DRow["Código Producto Interno"].ToString();
|
||||||
@@ -321,6 +353,7 @@ public class TareasJam : IHttpHandler
|
|||||||
|
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
this.GuardaLog($"EjecutaThalamus: guardando archivo excel productos " + RutaProductos + " ");
|
||||||
wbProductos.SaveAs(RutaProductos);
|
wbProductos.SaveAs(RutaProductos);
|
||||||
/////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@@ -337,10 +370,13 @@ public class TareasJam : IHttpHandler
|
|||||||
SBLog.AppendLine("<b>Cargas</b><br>");
|
SBLog.AppendLine("<b>Cargas</b><br>");
|
||||||
SBLog.AppendLine("<table border='1'> <tr><th>Archivo</th><th>Estado</th></tr>");
|
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);
|
CargaProductos = CargarArchivos(FInfoProductos, FTPServer, TFPUsr, FTPPass);
|
||||||
|
|
||||||
if (CargaProductos)
|
if (CargaProductos)
|
||||||
{
|
{
|
||||||
|
this.GuardaLog($"EjecutaThalamus: Verificando archivo productos. ");
|
||||||
CargaProductos = VerificarArchivo(FInfoProductos, FInfoProductos.Length, FTPServer, TFPUsr, FTPPass);
|
CargaProductos = VerificarArchivo(FInfoProductos, FInfoProductos.Length, FTPServer, TFPUsr, FTPPass);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -355,9 +391,11 @@ public class TareasJam : IHttpHandler
|
|||||||
|
|
||||||
if (CargaProductos)
|
if (CargaProductos)
|
||||||
{
|
{
|
||||||
|
this.GuardaLog($"EjecutaThalamus: Cargando archivo excel ventas a FTP. ");
|
||||||
CargaVentas = CargarArchivos(FInfoVentas, $"{FTPServer}/Ventas", TFPUsr, FTPPass);
|
CargaVentas = CargarArchivos(FInfoVentas, $"{FTPServer}/Ventas", TFPUsr, FTPPass);
|
||||||
if (CargaVentas)
|
if (CargaVentas)
|
||||||
{
|
{
|
||||||
|
this.GuardaLog($"EjecutaThalamus: Verificando archivo ventas. ");
|
||||||
CargaVentas = VerificarArchivo(FInfoVentas, FInfoVentas.Length, $"{FTPServer}/Ventas", TFPUsr, FTPPass);
|
CargaVentas = VerificarArchivo(FInfoVentas, FInfoVentas.Length, $"{FTPServer}/Ventas", TFPUsr, FTPPass);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -373,9 +411,11 @@ public class TareasJam : IHttpHandler
|
|||||||
|
|
||||||
if (CargaProductos & CargaVentas)
|
if (CargaProductos & CargaVentas)
|
||||||
{
|
{
|
||||||
|
this.GuardaLog($"EjecutaThalamus: Cargando archivo excel clientes a FTP. ");
|
||||||
CargaClientes = CargarArchivos(FInfoClientes, $"{FTPServer}/Clientes", TFPUsr, FTPPass);
|
CargaClientes = CargarArchivos(FInfoClientes, $"{FTPServer}/Clientes", TFPUsr, FTPPass);
|
||||||
if (CargaClientes)
|
if (CargaClientes)
|
||||||
{
|
{
|
||||||
|
this.GuardaLog($"EjecutaThalamus: Verificando archivo clientes. ");
|
||||||
CargaClientes = VerificarArchivo(FInfoClientes, FInfoClientes.Length, $"{FTPServer}/Clientes", TFPUsr, FTPPass);
|
CargaClientes = VerificarArchivo(FInfoClientes, FInfoClientes.Length, $"{FTPServer}/Clientes", TFPUsr, FTPPass);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -391,9 +431,11 @@ public class TareasJam : IHttpHandler
|
|||||||
|
|
||||||
if (CargaProductos & CargaVentas & CargaClientes)
|
if (CargaProductos & CargaVentas & CargaClientes)
|
||||||
{
|
{
|
||||||
|
this.GuardaLog($"EjecutaThalamus: Cargando archivo excel almacenes a FTP. ");
|
||||||
CargaAlmacenes = CargarArchivos(FInfoAlmacenes, $"{FTPServer}/Stock", TFPUsr, FTPPass);
|
CargaAlmacenes = CargarArchivos(FInfoAlmacenes, $"{FTPServer}/Stock", TFPUsr, FTPPass);
|
||||||
if (CargaClientes)
|
if (CargaClientes)
|
||||||
{
|
{
|
||||||
|
this.GuardaLog($"EjecutaThalamus: Verificando archivo almacenes. ");
|
||||||
CargaAlmacenes = VerificarArchivo(FInfoAlmacenes, FInfoAlmacenes.Length, $"{FTPServer}/Stock", TFPUsr, FTPPass);
|
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()}" ;
|
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);
|
MandaCorreo(Cuerpo, Respuesta, RutaProductos, RutaVentas, RutaClientes, RutaAlmacenes);
|
||||||
|
|
||||||
|
this.GuardaLog($"EjecutaThalamus: Tarea terminada se regresa respuesta {Respuesta.ToString()}. ");
|
||||||
return Respuesta;
|
return Respuesta;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -461,15 +505,17 @@ public class TareasJam : IHttpHandler
|
|||||||
|
|
||||||
|
|
||||||
ClsSisMail Correo = new ClsSisMail();
|
ClsSisMail Correo = new ClsSisMail();
|
||||||
string Para = "julian@adssistemas.mx;rene.molina@adssistemas.mx;oscar.irigoyen@adssistemas.mx";
|
string Para = "julian@adssistemas.mx;rene.molina@adssistemas.mx;oscar.irigoyen@adssistemas.mx";
|
||||||
//string Para = "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")}";
|
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);
|
Correo.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Cuerpo, Archivos:ListaArchivos);
|
||||||
|
this.GuardaLog($"EjecutaThalamus: MandaCorreo() correo enviado. ");
|
||||||
|
|
||||||
}catch(Exception ex)
|
}catch(Exception ex)
|
||||||
{
|
{
|
||||||
Extensiones.ModExtensiones.GuardaLog(null,$"Error Tareas Programadas 119 error enviar mail --> {ex.Message} ");
|
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)
|
if (FInfo.Exists)
|
||||||
{
|
{
|
||||||
|
this.GuardaLog($"EjecutaThalamus: CargarArchivos() Conectando a TFP. ");
|
||||||
|
|
||||||
FtpWebRequest request = (FtpWebRequest)WebRequest.Create($"{FTPServer}/{FInfo.Name}");
|
FtpWebRequest request = (FtpWebRequest)WebRequest.Create($"{FTPServer}/{FInfo.Name}");
|
||||||
request.Method = WebRequestMethods.Ftp.UploadFile;
|
request.Method = WebRequestMethods.Ftp.UploadFile;
|
||||||
int tamanio = 1024;
|
int tamanio = 1024;
|
||||||
@@ -491,10 +539,12 @@ public class TareasJam : IHttpHandler
|
|||||||
{
|
{
|
||||||
request.GetResponse();
|
request.GetResponse();
|
||||||
Conected = true;
|
Conected = true;
|
||||||
|
this.GuardaLog($"EjecutaThalamus: CargarArchivos() conexión a TFP correcta. ");
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Extensiones.ModExtensiones.GuardaLog(null,$"Error Tareas Programadas 119 Conexión a servidor FTP archivo { FInfo.Name } {ex.Message} ");
|
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)
|
if (Conected)
|
||||||
@@ -517,16 +567,20 @@ public class TareasJam : IHttpHandler
|
|||||||
{
|
{
|
||||||
Respuesta = false;
|
Respuesta = false;
|
||||||
Extensiones.ModExtensiones.GuardaLog(null,$"Error Tareas Programadas 119 cargando archivo { FInfo.Name } {ex.Message} ");
|
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)
|
if (f is object)
|
||||||
{
|
{
|
||||||
f.Close();
|
f.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.GuardaLog($"EjecutaThalamus: CargarArchivos() TFP cerrrando conxión. ");
|
||||||
if (ftpStream is object)
|
if (ftpStream is object)
|
||||||
{
|
{
|
||||||
ftpStream.Close();
|
ftpStream.Close();
|
||||||
|
this.GuardaLog($"EjecutaThalamus: CargarArchivos() TFP conxión cerrada. ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -553,6 +607,7 @@ public class TareasJam : IHttpHandler
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
this.GuardaLog($"EjecutaThalamus: VerificarArchivo() conectando a FTP .");
|
||||||
FtpWebRequest request = (FtpWebRequest)WebRequest.Create($"{FTPServer}/{FInfo.Name}");
|
FtpWebRequest request = (FtpWebRequest)WebRequest.Create($"{FTPServer}/{FInfo.Name}");
|
||||||
request.Credentials = new NetworkCredential(FTPUsr, FTPPass);
|
request.Credentials = new NetworkCredential(FTPUsr, FTPPass);
|
||||||
request.Method = WebRequestMethods.Ftp.GetFileSize;
|
request.Method = WebRequestMethods.Ftp.GetFileSize;
|
||||||
@@ -562,14 +617,20 @@ public class TareasJam : IHttpHandler
|
|||||||
respSize = (FtpWebResponse)request.GetResponse();
|
respSize = (FtpWebResponse)request.GetResponse();
|
||||||
long size = respSize.ContentLength;
|
long size = respSize.ContentLength;
|
||||||
respSize.Close();
|
respSize.Close();
|
||||||
|
|
||||||
|
this.GuardaLog($"EjecutaThalamus: VerificarArchivo() tamaño local {Tamanio} ftp { size}. ");
|
||||||
if (Tamanio == size)
|
if (Tamanio == size)
|
||||||
{
|
{
|
||||||
Respuesta = true;
|
Respuesta = true;
|
||||||
|
this.GuardaLog($"EjecutaThalamus: VerificarArchivo() tamaño ok. ");
|
||||||
}
|
}
|
||||||
|
|
||||||
}catch(Exception ex)
|
}catch(Exception ex)
|
||||||
{
|
{
|
||||||
|
|
||||||
Extensiones.ModExtensiones.GuardaLog(null,$"Error Tareas Programadas 119 verificando archivo { FInfo.Name } {ex.Message} ");
|
Extensiones.ModExtensiones.GuardaLog(null,$"Error Tareas Programadas 119 verificando archivo { FInfo.Name } {ex.Message} ");
|
||||||
|
this.GuardaLog($"EjecutaThalamus: VerificarArchivo() Error {ex.StackTrace.ToString()}. " );
|
||||||
|
|
||||||
Respuesta = false;
|
Respuesta = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -592,7 +653,7 @@ public class TareasJam : IHttpHandler
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
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;
|
return Respuesta;
|
||||||
|
|||||||
@@ -7908,7 +7908,7 @@
|
|||||||
$get('HdnTotalVenta').value = FormatoNumero(totalVenta, 2);
|
$get('HdnTotalVenta').value = FormatoNumero(totalVenta, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
function chkAnt(t, txt, importe) {
|
function chkAnt(t, txt, importe, AmorContrato = 0) {
|
||||||
debugger;
|
debugger;
|
||||||
var totalAnt = 0;
|
var totalAnt = 0;
|
||||||
|
|
||||||
@@ -7925,6 +7925,8 @@
|
|||||||
|
|
||||||
if (SaldoCompra > 0) {
|
if (SaldoCompra > 0) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//if (SaldoCompra > importe) {
|
//if (SaldoCompra > importe) {
|
||||||
// txt.value = importe.toFixed(2);
|
// txt.value = importe.toFixed(2);
|
||||||
// SaldoCompra = SaldoCompra - importe;
|
// SaldoCompra = SaldoCompra - importe;
|
||||||
@@ -7935,7 +7937,14 @@
|
|||||||
// //SaldoCompra = 0.00;
|
// //SaldoCompra = 0.00;
|
||||||
// $get('HdnVentaSaldo').value = SaldoCompra;
|
// $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();
|
totalAnt = FnSumaValoresAnt();
|
||||||
|
|
||||||
|
|||||||
@@ -1314,6 +1314,7 @@ Partial Class Ventas
|
|||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "Propiedades Contratos"
|
#Region "Propiedades Contratos"
|
||||||
|
|
||||||
Private Property DtContratos As DataTable
|
Private Property DtContratos As DataTable
|
||||||
Get
|
Get
|
||||||
Return If(IsNothing(ViewState("DtContratos")), Nothing, CType(ViewState("DtContratos"), DataTable))
|
Return If(IsNothing(ViewState("DtContratos")), Nothing, CType(ViewState("DtContratos"), DataTable))
|
||||||
@@ -1403,6 +1404,59 @@ Partial Class Ventas
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
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
|
#End Region
|
||||||
|
|
||||||
#Region " PROPIEDADES NUEVAS | GUARDAR - IMPRESION "
|
#Region " PROPIEDADES NUEVAS | GUARDAR - IMPRESION "
|
||||||
@@ -1454,6 +1508,14 @@ Partial Class Ventas
|
|||||||
ViewState("ObjFacturaNC") = value
|
ViewState("ObjFacturaNC") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region " PROPIEDADES NUEVAS "
|
#Region " PROPIEDADES NUEVAS "
|
||||||
@@ -3077,6 +3139,19 @@ Partial Class Ventas
|
|||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
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
|
LbContratoImporteTotal.Text = DrContrato("ImporteTotal").ToString().FormatoNumero
|
||||||
LbContratoImporteMinimo.Text = DrContrato("ImporteMin").ToString().FormatoNumero
|
LbContratoImporteMinimo.Text = DrContrato("ImporteMin").ToString().FormatoNumero
|
||||||
LbContratoImporteMaximo.Text = DrContrato("ImporteMax").ToString().FormatoNumero
|
LbContratoImporteMaximo.Text = DrContrato("ImporteMax").ToString().FormatoNumero
|
||||||
@@ -7228,6 +7303,9 @@ Partial Class Ventas
|
|||||||
|
|
||||||
Protected Sub EmitirImprimirNew(Optional TipoDoctoViejo As String = "")
|
Protected Sub EmitirImprimirNew(Optional TipoDoctoViejo As String = "")
|
||||||
|
|
||||||
|
If Not ValidaVentaContratoObra() Then
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
If ValidaPagosContado() Then
|
If ValidaPagosContado() Then
|
||||||
Exit Sub
|
Exit Sub
|
||||||
@@ -8775,7 +8853,7 @@ Partial Class Ventas
|
|||||||
ObjFactura.NumeroPersonas = 0
|
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
|
CveContrato = DdlContratosModal.SelectedValue.ToEntero
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -13107,8 +13185,19 @@ Partial Class Ventas
|
|||||||
maxsaldo = total
|
maxsaldo = total
|
||||||
End If
|
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.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("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")))
|
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
|
End Sub
|
||||||
Protected Sub BtnAceptarAnticipos_Click(sender As Object, e As System.EventArgs) Handles BtnAceptarAnticipos.Click
|
Protected Sub BtnAceptarAnticipos_Click(sender As Object, e As System.EventArgs) Handles BtnAceptarAnticipos.Click
|
||||||
Anticipos()
|
Anticipos()
|
||||||
@@ -25037,7 +25126,12 @@ Partial Class Ventas
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub DdlTipoAmortizacionAnticipo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoAmortizacionAnticipo.SelectedIndexChanged
|
Private Sub DdlTipoAmortizacionAnticipo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoAmortizacionAnticipo.SelectedIndexChanged
|
||||||
|
|
||||||
|
|
||||||
|
ImporteSujeridoAnticipo(DdlTipoAmortizacionAnticipo.SelectedValue.ToEntero)
|
||||||
|
|
||||||
divAnticipoMsg.Visible = False
|
divAnticipoMsg.Visible = False
|
||||||
|
|
||||||
If DdlTipoAmortizacionAnticipo.SelectedValue.Contiene("1", "2") Then
|
If DdlTipoAmortizacionAnticipo.SelectedValue.Contiene("1", "2") Then
|
||||||
'cuando es amortización por descuento, debe tener seleccionado descuentos previamente registrados
|
'cuando es amortización por descuento, debe tener seleccionado descuentos previamente registrados
|
||||||
If DdlTipoAmortizacionAnticipo.SelectedValue = "1" AndAlso LblDescuentos.Text.ToDecimal <= 0 Then
|
If DdlTipoAmortizacionAnticipo.SelectedValue = "1" AndAlso LblDescuentos.Text.ToDecimal <= 0 Then
|
||||||
@@ -25059,6 +25153,34 @@ Partial Class Ventas
|
|||||||
DdlTipoRelacionAnticipo.SelectedValueExist("-1")
|
DdlTipoRelacionAnticipo.SelectedValueExist("-1")
|
||||||
End If
|
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
|
End Sub
|
||||||
|
|
||||||
Private Sub DdlMetodoPago33_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlMetodoPago33.SelectedIndexChanged
|
Private Sub DdlMetodoPago33_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlMetodoPago33.SelectedIndexChanged
|
||||||
@@ -27726,6 +27848,55 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
End Sub
|
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
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user