This commit is contained in:
2024-10-09 19:15:15 -07:00
25 changed files with 580 additions and 68 deletions

View File

@@ -136,8 +136,7 @@
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Referencia" > <asp:TemplateField HeaderText="Referencia" >
<ItemTemplate> <ItemTemplate>
&nbsp;<asp:Label ID="LblRef" runat="server" Text='<%# Eval("Referencia") %>'></asp:Label> &nbsp;<asp:Label ID="LblRef" runat="server" Text='<%# Eval("Referencia") %>'></asp:Label>
&nbsp;<asp:Label ID="Label1" runat="server" Text='<%# Eval("CveEntregaAlmacen") %>'></asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText=""> <asp:TemplateField HeaderText="">

View File

@@ -6676,6 +6676,28 @@ Public Class ClsContabilidad
Return Retorno Return Retorno
End Function End Function
Public Function GetAjusteFluctuacion(Opcion As Integer, Fecha As Date, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Conta_Banc_FluctuacionesVerificaciones")
With SqlAdapter.SelectCommand.Parameters
.Add("@Opcion", SqlDbType.Int).Value = Opcion
.Add("@Fecha", SqlDbType.Date).Value = Fecha
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
Me.OnError("Ocurrió un error al actualizar el tipo de cambio", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
#End Region #End Region
Public Function GetPolizas(Ejercicio As Integer, Periodo As Integer, TipoPoliza As Integer, CveSubProyecto As Integer, FolioPoliza As Integer, CveEmpresa As Integer) As Boolean Public Function GetPolizas(Ejercicio As Integer, Periodo As Integer, TipoPoliza As Integer, CveSubProyecto As Integer, FolioPoliza As Integer, CveEmpresa As Integer) As Boolean

View File

@@ -1766,7 +1766,7 @@ Public Class ClsVentas
Return Retorno Return Retorno
End Function End Function
Public Function GetRepPedidosSTF(CveSubProyecto As Integer, CveVendedor As Integer, CveEmpresa As Integer, Opcion As Integer, FechaInicio As Date, FechaFin As Date) As Boolean Public Function GetRepPedidosSTF(CveSubProyecto As Integer, CveVendedor As Integer, CveEmpresa As Integer, Opcion As Integer, FechaInicio As Date, FechaFin As Date, CveCliente As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_PedidosSTFRep") DataAdapter("PA_Vta_PedidosSTFRep")
@@ -1777,6 +1777,7 @@ Public Class ClsVentas
.Add("@Opcion", SqlDbType.Int).Value = Opcion .Add("@Opcion", SqlDbType.Int).Value = Opcion
.Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin .Add("@FechaFin", SqlDbType.Date).Value = FechaFin
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
End With End With
Try Try

View File

@@ -917,7 +917,14 @@ Public Class Timbrado
.NumParcialidad = VentaNumParcialidad, .NumParcialidad = VentaNumParcialidad,
.ObjetoImpuesto = ObjetoImpuesto} 'If(drr("MetodoPago").ToString = "PUE", 0, drr("NumParcialidad").ToString.ToEntero)} .ObjetoImpuesto = ObjetoImpuesto} 'If(drr("MetodoPago").ToString = "PUE", 0, drr("NumParcialidad").ToString.ToEntero)}
For Each drp As DataRow In dttpagosimpuestos.FiltraParametros(String.Format("FolioFiscal = '{0}'", VentaFolioFiscal.ToLower)).Rows
'dtTempdttpagosimpuestos se esta usando para el caso de que el objeto de impuesto del ps de la venta sea 01 (la consulta por default genera 02)
Dim dtTempdttpagosimpuestos As DataTable = dttpagosimpuestos.FiltraParametros(String.Format("FolioFiscal = '{0}'", VentaFolioFiscal.ToLower))
If dtTempdttpagosimpuestos IsNot Nothing AndAlso doc.ObjetoImpuesto = "02" AndAlso dtTempdttpagosimpuestos.Rows.Count = 0 Then
doc.ObjetoImpuesto = "01"
End If
For Each drp As DataRow In dtTempdttpagosimpuestos.Rows
doc.Impuestos.Add(New CFDIConceptosImpuestos With { doc.Impuestos.Add(New CFDIConceptosImpuestos With {
.TrasladooRetencion = drp("Tipo").ToString, .TrasladooRetencion = drp("Tipo").ToString,
.Base = drp("Base").ToString.ToDecimal.RoundSQL, .Base = drp("Base").ToString.ToDecimal.RoundSQL,

View File

@@ -279,8 +279,8 @@ Partial Class Bancos_ConciliacionesBancariasaspx
End If End If
End If End If
Next Next
If SumaSIGAbono <> SumaExcelAbono Or SumaSIGCargo <> SumaExcelCargo Then If SumaSIGCargo <> SumaExcelCargo OrElse SumaSIGAbono <> SumaExcelAbono Then
Alert("La suma de los importes no cuadran", TipoMensaje.MsgAdvertencia) Alert($"La suma de los importes no cuadran ({SumaSIGCargo}-{SumaExcelCargo}**{SumaSIGAbono}-{SumaExcelAbono})", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If End If
Dim ObjBancos As New ClsBancos Dim ObjBancos As New ClsBancos

View File

@@ -102,11 +102,11 @@
<asp:ListItem Value="-1" Text="Todos"></asp:ListItem> <asp:ListItem Value="-1" Text="Todos"></asp:ListItem>
<asp:ListItem Value="13" Text="Efectivo"></asp:ListItem> <asp:ListItem Value="13" Text="Efectivo"></asp:ListItem>
<asp:ListItem Value="3" Text="Cheque"></asp:ListItem> <asp:ListItem Value="3" Text="Cheque"></asp:ListItem>
<asp:ListItem Value="8" Text="Transferencias"></asp:ListItem>
<asp:ListItem Value="11" Text="Tarjeta de Debito"></asp:ListItem> <asp:ListItem Value="11" Text="Tarjeta de Debito"></asp:ListItem>
<asp:ListItem Value="12" Text="Tarjeta de Crédito"></asp:ListItem> <asp:ListItem Value="12" Text="Tarjeta de Crédito"></asp:ListItem>
<asp:ListItem Value="-2" Text="Tarjetas"></asp:ListItem> <asp:ListItem Value="-2" Text="Tarjetas"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
<asp:DropDownList ID="DDlMesesSinIntereses" runat="server" Visible="false" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="40px"> <asp:DropDownList ID="DDlMesesSinIntereses" runat="server" Visible="false" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="40px">
<asp:ListItem Value="-1">MSI</asp:ListItem> <asp:ListItem Value="-1">MSI</asp:ListItem>
<asp:ListItem Value="3">3M</asp:ListItem> <asp:ListItem Value="3">3M</asp:ListItem>
@@ -116,9 +116,7 @@
</asp:DropDownList> </asp:DropDownList>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="portlet-body" style="display: none"> <div class="portlet-body" style="display: none">

View File

@@ -6372,7 +6372,7 @@ Partial Class Compras_Compras
If DifSubTotales > 0 Or (Not CveCompraRefacturacion > 0 OrElse (ChkRefacNC.Checked)) Then If DifSubTotales > 0 Or (Not CveCompraRefacturacion > 0 OrElse (ChkRefacNC.Checked)) Then
'AF TipoAF 2 Es para las compras 'AF TipoAF 2 Es para las compras
DT = TmpDT.FiltraParametros("ISNULL(TipoAF,0) = 2 And ISNULL(AplicaCostoIndirecto,0) <> 1 ") DT = TmpDT.FiltraParametros("ISNULL(TipoAF,0) = 2 And ISNULL(AplicaCostoIndirecto,0) <> 1 ")
If DT.Rows.Count > 0 AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then If DT.Rows.Count > 0 AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("DEV", "Ant") Then
For Each Row2 As DataRow In DT.Rows For Each Row2 As DataRow In DT.Rows
importeMovimiento = If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, Row2("ImporteSinImpuestos").ToString.ToDecimal, Row2("Total").ToString.ToDecimal) importeMovimiento = If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, Row2("ImporteSinImpuestos").ToString.ToDecimal, Row2("Total").ToString.ToDecimal)
importeMN = importeMovimiento * tipoCambioActual * Multiplicador importeMN = importeMovimiento * tipoCambioActual * Multiplicador

View File

@@ -1513,7 +1513,7 @@ Partial Class Compras_Proveedores
GlobalDTCompProveedores(UsuarioActual.CveEmpresa) = Nothing GlobalDTCompProveedores(UsuarioActual.CveEmpresa) = Nothing
GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, -1) = Nothing GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, -1) = Nothing
Alert("El Proveedor se guardó correctamente. " & "<br />" & MsgCuentaContable, TipoMensaje.MsgInformacion, If(Request("CveFactura") Is Nothing, "document.location.href=""/Compras/CatProveedores.aspx""", "window.opener.location.href = window.opener.location.href; window.close();")) Alert("El Proveedor se guardó correctamente. " & "<br />" & MsgCuentaContable, TipoMensaje.MsgInformacion, If(Request("CveFactura") Is Nothing, "document.location.href=""/Compras/CatProveedores.aspx""", "if (window.opener && !window.opener.closed) { window.opener.location.href = window.opener.location.href; window.close(); }else{ alert('No se pudo recargar la pestaña origen, recargue manualmente si lo necesita.'); }"))
RecargaGlobalCuentasBancarias() RecargaGlobalCuentasBancarias()
End If End If
End If End If

View File

@@ -435,7 +435,7 @@
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Proveedor"> <asp:TemplateField HeaderText="Proveedor">
<ItemTemplate> <ItemTemplate>
<asp:HyperLink ID="HplProveedor" runat="server" CssClass="Texto" Target="_blank" rel="opener" Text='<%# Eval("NombreProveedor") %>'></asp:HyperLink> <asp:HyperLink ID="HplProveedor" runat="server" CssClass="Texto" Target="_blank" Text='<%# Eval("NombreProveedor") %>' rel="opener"></asp:HyperLink>
</ItemTemplate> </ItemTemplate>
<ItemStyle HorizontalAlign="Left" /> <ItemStyle HorizontalAlign="Left" />
</asp:TemplateField> </asp:TemplateField>

View File

@@ -3443,7 +3443,7 @@ Partial Class Inventarios_RecepcionAlmacen
Exit For Exit For
End If End If
Else Else
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCostoDetalle, TotalCostoDetalle, CveConceptoContableCosto, SerieFolio, SerieFolio, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveSubProyecto:=CveSubProyecto, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, CveOCDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCostoDetalle, TotalCostoDetalle, CveConceptoContableCosto, SerieFolio, SerieFolio, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveSubProyecto:=CveSubProyecto, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, CveOCDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero, Contabilizable:=EsContabilizable) Then
ErrorMovInv = True ErrorMovInv = True
Exit For Exit For
End If End If

View File

@@ -9219,7 +9219,7 @@ Partial Class OC_OC
Select row.Field(Of Decimal)(ColumnaSaldo)).Sum() Select row.Field(Of Decimal)(ColumnaSaldo)).Sum()
If saldoTotal > 0 Then If saldoTotal > 0 Then
Dim TotalAcumuladoTabla As Decimal = (DtDetalle.SUM("Total", $" CveSubProyecto = {ValCveSubProyecto} AND CveClasificacion = {ValCveClasificacion} ")) Dim TotalAcumuladoTabla As Decimal = (DtDetalle.SUM("Total", $" CveOrdenCompraDetalle is null AND CveSubProyecto = {ValCveSubProyecto} AND CveClasificacion = {ValCveClasificacion} "))
Dim Diferencia As Decimal = saldoTotal - TotalAcumuladoTabla - ValImporte Dim Diferencia As Decimal = saldoTotal - TotalAcumuladoTabla - ValImporte
If (Diferencia) < 0 Then If (Diferencia) < 0 Then

View File

@@ -437,6 +437,7 @@
} }
gantt.render(); gantt.render();
} }
var datosGant = []; var datosGant = [];
function loadGant() { function loadGant() {
gantt.config.date_format = "%Y-%m-%d %H:%i"; gantt.config.date_format = "%Y-%m-%d %H:%i";

View File

@@ -1220,7 +1220,7 @@ Partial Class OS_OrdenesServicios
Exit Sub Exit Sub
End If End If
UpGuardar.Visible = False BtnGuardar.Visible = False
End Sub End Sub
#End Region #End Region
@@ -3099,6 +3099,7 @@ Partial Class OS_OrdenesServicios
Dim ObjInventario As New ClsInventarios(ObjV.IniciaTransacSQL()) Dim ObjInventario As New ClsInventarios(ObjV.IniciaTransacSQL())
Dim ObjConta As New ClsContabilidad(ObjV.IniciaTransacSQL()) Dim ObjConta As New ClsContabilidad(ObjV.IniciaTransacSQL())
Dim GenerarRemisionMovimientos As Boolean = False Dim GenerarRemisionMovimientos As Boolean = False
Dim AplicaDevolucion As Boolean = False
If DdlTipoVenta.SelectedValue = "5" Then 'Consignación - Uso Material If DdlTipoVenta.SelectedValue = "5" Then 'Consignación - Uso Material
'genera una salida de almacen. 'genera una salida de almacen.
@@ -3188,7 +3189,6 @@ Partial Class OS_OrdenesServicios
'' otros opciones <> 5 '' otros opciones <> 5
If ProcesoOK Then If ProcesoOK Then
Dim AplicaDevolucion As Boolean = False
Dim StrCveVentasDetalle As New StringBuilder Dim StrCveVentasDetalle As New StringBuilder
For Each GvRow As GridViewRow In GvMU.Rows For Each GvRow As GridViewRow In GvMU.Rows
Dim CveVentaDetalle As Integer = GvRow.DataKey("CveVentaDetalle").ToEntero Dim CveVentaDetalle As Integer = GvRow.DataKey("CveVentaDetalle").ToEntero
@@ -3384,11 +3384,17 @@ Partial Class OS_OrdenesServicios
Alert("El material utilizado se guardó correctamente") Alert("El material utilizado se guardó correctamente")
End If End If
End If End If
Dim Contenido As String = $" OS #{LblFolio.Text}<br/> Hospital: {If(DdlSucursalCliente.Visible, DdlSucursalCliente.SelectedItem.Text, LblCliente.Text)} <br/>Folio {LblFolio.Text}<br/>"
'genera notificación
If AplicaDevolucion Then 'notif a almacen
EnviaNotificacion("listado productos")
End If
RegistraScript("$('#DivModalMaterialUtilizado').modal('hide');") RegistraScript("$('#DivModalMaterialUtilizado').modal('hide');")
CargaEventoBitacora() CargaEventoBitacora()
Else Else
ObjV.RollBack() ObjV.RollBack()
Alert("Se presento un error al guardar el material", TipoMensaje.MsgAdvertencia) Alert("Se presento un error al guardar el material", TipoMensaje.MsgAdvertencia)
End If End If
@@ -3396,6 +3402,28 @@ Partial Class OS_OrdenesServicios
End If End If
End Sub End Sub
Private Sub EnviaNotificacion(Contenido As String)
Dim ObjMail As New ClsSisMail()
Dim Asunto As String = "Notificación de recolección de Producto"
Dim CorreoDestino As String = ""
If ObjMail.SendMail(UsuarioActual.Empresa, CorreoDestino, Asunto, Contenido) Then
End If
End Sub
Private Sub EnviaNotificacionSMS(Tipo As Integer, Folio As String, FechaCirugía As DateTime, Hospital As String, Medico As String, Procedimiento As String, Técnico As String, Vendedor As String, Remision As String, dtMaterial As DataTable)
Dim ObjMail As New ClsSisMail()
Dim Asunto As String = "Notificación de recolección de Producto"
Dim CorreoDestino As String = ""
If ObjMail.SendMail(UsuarioActual.Empresa, CorreoDestino, Asunto, Contenido) Then
End If
End Sub
Private Function GuardarArchivoConfirmacion(ByRef transaccion As SqlTransaction, CveOSActual As Integer, CveVentaRemisionGenerada As Integer) As Boolean Private Function GuardarArchivoConfirmacion(ByRef transaccion As SqlTransaction, CveOSActual As Integer, CveVentaRemisionGenerada As Integer) As Boolean
Dim respuesta As Boolean = False Dim respuesta As Boolean = False

View File

@@ -23,7 +23,75 @@
width: 100%; width: 100%;
height: 600px; height: 600px;
} }
.fc-month-view .fc-day {
border-left: 4px solid #464646;
border-right: 4px solid #464646
}
.fc-month-view .fc-week {
border-left: 4px solid #464646;
border-right: 4px solid #464646;
border-top: 4px solid #464646;
}
.fc-month-view .fc-row.fc-week.fc-widget-content:last-of-type {
border-bottom: 4px solid #464646!important;
}
</style> </style>
<style>
.btn.newsubpro {
margin-left: 3px;
padding: 2px 4px;
}
</style>
<style>
.gantt-samples-banner_controls_bar.controls_bar {
margin: 0;
//position: absolute;
top: -30px;
width: 100%;
right: 0;
left: 0;
}
.controls_bar {
border-top: 1px solid #bababa;
border-bottom: 1px solid #bababa;
clear: both;
height: 28px;
background: #f1f1f1;
color: #494949;
font-family: Arial, sans-serif;
font-size: 13px;
padding-left: 10px;
line-height: 25px;
}
.gantt-samples-banner_controls_bar.controls_bar, .gantt_scale_line .gantt_scale_cell, .gantt_grid_scale .gantt_grid_head_cell, .gantt_grid_scale .gantt_grid_head_cell a, .gantt_grid_scale .gantt_grid_head_cell a:hover {
background-color: #95a5a6 !important;
color: #FFF !important;
}
.gantt_link_point {
display: none !important; /* Oculta los checkmarks (drag handles) */
}
#gantt_here {
scroll-behavior: smooth; /* Aplica un desplazamiento suave */
overflow-y: auto; /* Asegura que el desplazamiento vertical esté activo */
}
</style>
<link rel="stylesheet" href="/Metronic/assets/global/plugins/dhtmlxgantt/dhtmlxgantt.css" type="text/css">
</asp:Content> </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="E" runat="Server"> <asp:Content ID="Content2" ContentPlaceHolderID="E" runat="Server">
@@ -287,6 +355,61 @@
<%--Calendario Tab--%> <%--Calendario Tab--%>
<ajax:TabPanel ID="TabGrantt" runat="server" HeaderText="Cronograma"> <ajax:TabPanel ID="TabGrantt" runat="server" HeaderText="Cronograma">
<ContentTemplate> <ContentTemplate>
<asp:UpdatePanel ID="UPGat" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div>
<div class="gantt-samples-banner_controls_bar controls_bar">
<strong>Formato: &nbsp; </strong>
<label>
<input name="scales" onclick="zoom_tasks(this)" type="radio" value="week">
<span>Horas</span></label>
<label>
<input name="scales" onclick="zoom_tasks(this)" type="radio" value="trplweek" checked="true">
<span>Día</span></label>
<label>
<input name="scales" onclick="zoom_tasks(this)" type="radio" value="year">
<span>Mes</span></label>
<label>
<input name="scales" onclick="zoom_tasks(this)" type="radio" value="yearyear">
<span>año</span></label>
<div id="filter_hours" style="display: none;">
<span>&nbsp; &nbsp; | &nbsp; &nbsp; </span>
<strong>Mostrar: &nbsp; </strong>
<label>
<input name="scales_filter" onclick="set_scale_units(this)" type="radio" value="full_day">
<span>Dia Completo</span>
</label>
<label>
<input name="scales_filter" onclick="set_scale_units(this)" type="radio" value="work_hours">
<span>Horario de Oficina</span>
</label>
</div>
<div id="filter_days" style="">
<span>&nbsp; &nbsp; | &nbsp; &nbsp; </span>
<strong>Mostrar: &nbsp; </strong>
<label>
<input name="scales_filter" onclick="set_scale_units(this)" type="radio" value="full_week">
<span>Semana completa</span>
</label>
<label>
<input name="scales_filter" onclick="set_scale_units(this)" type="radio" value="work_week">
<span>Dias de Trabajo</span>
</label>
</div>
</div>
<div id="gantt_here" style='width: 100%; height: 100vh;'></div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPPGantt" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UPPGantt" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter"> <div class="portlet solid grey-cascade portlet-filter">
@@ -560,6 +683,7 @@
<script src="https://cdn.amcharts.com/lib/5/index.js"></script> <script src="https://cdn.amcharts.com/lib/5/index.js"></script>
<script src="https://cdn.amcharts.com/lib/5/xy.js"></script> <script src="https://cdn.amcharts.com/lib/5/xy.js"></script>
<script src="https://cdn.amcharts.com/lib/5/themes/Animated.js"></script> <script src="https://cdn.amcharts.com/lib/5/themes/Animated.js"></script>
<script src="/Metronic/assets/global/plugins/dhtmlxgantt/dhtmlxgantt.js"></script>
<script> <script>
// Create root element // Create root element
// https://www.amcharts.com/docs/v5/getting-started/#Root_element // https://www.amcharts.com/docs/v5/getting-started/#Root_element
@@ -1008,8 +1132,8 @@
slotEventOverlap: false, // No permitir la superposición en vistas de agenda slotEventOverlap: false, // No permitir la superposición en vistas de agenda
eventRender: function (event, element) { eventRender: function (event, element) {
element.css({ element.css({
'margin-bottom': '1px', 'margin-bottom': '2px',
'margin-left': '1px', 'margin-left': '2px',
'white-space': 'normal', // Permitir el ajuste de texto 'white-space': 'normal', // Permitir el ajuste de texto
'height': 'auto', // Ajustar la altura automáticamente 'height': 'auto', // Ajustar la altura automáticamente
'overflow': 'hidden' // Ocultar cualquier desbordamiento 'overflow': 'hidden' // Ocultar cualquier desbordamiento
@@ -1086,6 +1210,230 @@
} }
//Gant
let RCveEvento =<%= RCveEvento %>;
function NuevoEvento(CveEvento) {
$('.txtCveEvento').val(CveEvento);
$('.BtnopenmodalClickGant').click();
}
function zoom_tasks(node) {
switch (node.value) {
case "week":
gantt.config.scale_unit = "day";
gantt.config.date_scale = "%d %M";
gantt.config.scale_height = 60;
gantt.config.min_column_width = 30;
gantt.config.subscales = [
{ unit: "hour", step: 1, date: "%H" }
];
show_scale_options("hour");
break;
case "trplweek":
gantt.config.min_column_width = 70;
gantt.config.scale_unit = "day";
gantt.config.date_scale = "%d %M";
gantt.config.subscales = [];
gantt.config.scale_height = 35;
show_scale_options("day");
break;
case "month":
gantt.config.min_column_width = 70;
gantt.config.scale_unit = "week";
gantt.config.date_scale = "Week #%W";
gantt.config.subscales = [
{ unit: "day", step: 1, date: "%D" }
];
show_scale_options();
gantt.config.scale_height = 60;
break;
case "year":
gantt.config.min_column_width = 70;
gantt.config.scale_unit = "month";
gantt.config.date_scale = "%M";
gantt.config.scale_height = 60;
show_scale_options();
gantt.config.subscales = [
{ unit: "week", step: 1, date: "#%W" }
];
break;
case "yearyear":
gantt.config.min_column_width = 70;
gantt.config.scale_unit = "month";
gantt.config.date_scale = "%y %M";
gantt.config.scale_height = 60;
show_scale_options();
gantt.config.subscales = [
{ unit: "month", step: 1, date: "#%M" }
];
break;
}
set_scale_units();
gantt.render();
}
function show_scale_options(mode) {
var hourConf = document.getElementById("filter_hours"),
dayConf = document.getElementById("filter_days");
if (mode == 'day') {
hourConf.style.display = "none";
dayConf.style.display = "";
dayConf.getElementsByTagName("input")[0].checked = true;
} else if (mode == "hour") {
hourConf.style.display = "";
dayConf.style.display = "none";
hourConf.getElementsByTagName("input")[0].checked = true;
} else {
hourConf.style.display = "none";
dayConf.style.display = "none";
}
}
function set_scale_units(mode) {
if (mode && mode.getAttribute) {
mode = mode.getAttribute("value");
}
switch (mode) {
case "work_hours":
gantt.config.subscales = [
{ unit: "hour", step: 1, date: "%H" }
];
gantt.ignore_time = function (date) {
if (date.getHours() < 9 || date.getHours() > 16) {
return true;
} else {
return false;
}
};
break;
case "full_day":
gantt.config.subscales = [
{ unit: "hour", step: 3, date: "%H" }
];
gantt.ignore_time = null;
break;
case "work_week":
gantt.ignore_time = function (date) {
if (date.getDay() == 0 || date.getDay() == 6) {
return true;
} else {
return false;
}
};
break;
default:
gantt.ignore_time = null;
break;
}
gantt.render();
}
var datosGant = [];
function loadGant() {
gantt.config.date_format = "%Y-%m-%d %H:%i";
gantt.config.order_branch = true;
gantt.i18n.setLocale("es");
gantt.init("gantt_here");
gantt.config.drag_move = false; // Desactiva mover tareas
gantt.config.drag_resize = false; // Desactiva redimensionar tareas
gantt.config.drag_progress = false; // Desactiva mover la barra de progreso
//gantt.config.smart_scales = false;// Desactiva el salto automático entre escalas de tiempo
//gantt.config.scroll_size = 1;
// gantt.config.scroll_on_click = false; // Desactiva el scroll automático al hacer clic
//gantt.config.autosize = "xy";
//gantt.config.smart_rendering = false;
gantt.config.columns = [
//{ name: "text", label: "Contrato ", width: "*", min_width: 150, tree: true, resize: true, template: function (obj) { return "<a href=\"/Transportes/RepContratoDetalle.aspx?CveContrato=" + obj.id + "\" target=\"_Blank\">" + obj.text + " </a>" } },
//{ name: "start_date", label: "Inicio", min_width: 90, align: "center" },
//{ name: "end_date", label: "Fin", min_width: 90, align: "center" }
//{ name: "progress", label: "Avance", align: "center", template: function (obj) { return "" + (obj.progress * 100).toFixed(2) + " %" } },
//{ name: "duration", label: "Duración", align: "center" },
//{ name: "new", label: "<a onclick=\"NuevoEvento(" + RCveEvento + ");\" target=\"_Blank\"><i class='fa fa-plus'></i></a>", align: "center", template: function (obj) { return "<a onclick=\"NuevoEvento(" + obj.id + ");\" target=\"_Blank\"><i class='fa fa-plus'></i> </a>" } }
/*{name:"staff", label:"Holder(s)", template:function(obj){return obj.holder+"("+obj.progress+")"} },*/
//{ name: "add", label: "" }
];
gantt.parse({
data: datosGant
});
// Agregar evento para hover y mostrar tooltip
gantt.attachEvent("onMouseMove", function (id, e) {
if (id) {
var task = gantt.getTask(id);
// Mostrar el tooltip burbuja
var tooltip = document.getElementById("gantt_tooltip");
if (!tooltip) {
tooltip = document.createElement("div");
tooltip.id = "gantt_tooltip";
tooltip.style.position = "absolute";
tooltip.style.backgroundColor = "#fff";
tooltip.style.border = "1px solid #ccc";
tooltip.style.padding = "5px";
tooltip.style.borderRadius = "5px";
tooltip.style.boxShadow = "0 2px 5px rgba(0,0,0,0.2)";
tooltip.style.zIndex = "1000";
document.body.appendChild(tooltip);
}
tooltip.innerHTML = "<b>UNIDAD: </b> " + task.unidad + "<br/><b>CONTRATO: </b> " + task.text +
"<br/><b>DURACIÓN: </b> " + task.duracion;
// Posicionar el tooltip cerca del cursor
tooltip.style.left = (e.pageX + 15) + "px"; // Desplazado un poco a la derecha del cursor
tooltip.style.top = (e.pageY + 15) + "px"; // Desplazado un poco abajo del cursor
tooltip.style.display = "block";
} else {
var tooltip = document.getElementById("gantt_tooltip");
if (tooltip) {
tooltip.style.display = "none";
}
}
});
gantt.attachEvent("onTaskDblClick", function (id, e) {
// Cancelar el comportamiento predeterminado
return false;
});
}
gantt.attachEvent("onBeforeTaskMove", function (id, parent, tindex) {
console.log(tindex)
var task = gantt.getTask(id);
if (task.parent != parent)
return false;
return true;
});
gantt.attachEvent("onRowDragEnd", function (id, target, tindex) {
console.log(tindex)
debugger;
drag_id = null;
gantt.render();
});
gantt.attachEvent("onGanttScroll", function (left, top) {
// var step = 50; // Define cuánto avanzar con cada paso del scroll
//var newTop = top + step; // Incrementa el scroll vertical en 50 píxeles
//gantt.scrollTo(left, newTop); // Establece el nuevo valor de scroll vertical
console.log("Scroll vertical: ", top);
return false; // Previene el scroll predeterminado para que solo se aplique el manual
//return true;
});
loadGant();
</script> </script>

View File

@@ -39,9 +39,17 @@ Partial Class RepContratosCalendario
End Property End Property
#End Region #End Region
Public Property RCveEvento As Integer
Get
Return If(ViewState("RCveEvento") IsNot Nothing, ViewState("RCveEvento").ToString().ToEntero(), 0)
End Get
Set(value As Integer)
ViewState("RCveEvento") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then If Not IsPostBack Then
RCveEvento = 0
txtFechaI.Text = NowADS().FirstDayOfMonth.ToShortDateString() txtFechaI.Text = NowADS().FirstDayOfMonth.ToShortDateString()
txtFechaF.Text = GetLastDayOfMonth(NowADS()).ToShortDateString() txtFechaF.Text = GetLastDayOfMonth(NowADS()).ToShortDateString()
InicializaCombos() InicializaCombos()
@@ -83,16 +91,16 @@ Partial Class RepContratosCalendario
Private Sub CargaCronograma(Optional TipoVista As Integer = -1) Private Sub CargaCronograma(Optional TipoVista As Integer = -1)
If DtAvance IsNot Nothing Then If DtAvance IsNot Nothing Then
Dim separator As String = ""
Dim str As New StringBuilder()
str.AppendLine("datosGant=[")
Dim StrFiltro As String = "" Dim StrFiltro As String = ""
If DdlTipoUnidad.SelectedValue.ToEntero > 0 Then StrFiltro = " AND CveTipoActivoFijo = " & DdlTipoUnidad.SelectedValue If DdlTipoUnidad.SelectedValue.ToEntero > 0 Then StrFiltro = " AND CveTipoActivoFijo = " & DdlTipoUnidad.SelectedValue
Dim DtUnidades As DataTable = GlobalDTActivoFijos(UsuarioActual.CveEmpresa).FiltraParametros("Codigo <> '' AND MedidaVehicular IN (2,3) " & StrFiltro, Orderby:=" TipoActivoFijo ASC, CodigoNumeroOrden ASC", DistinctColumns:={"Codigo", "CveActivoFijo"}) Dim DtUnidades As DataTable = GlobalDTActivoFijos(UsuarioActual.CveEmpresa).FiltraParametros("Codigo <> '' AND MedidaVehicular IN (2,3) " & StrFiltro, Orderby:=" TipoActivoFijo ASC, CodigoNumeroOrden ASC", DistinctColumns:={"Codigo", "CveActivoFijo"})
'For Each Row As DataRow In DtAvance.Rows
' If String.IsNullOrEmpty(Row("CodigoAF").ToString()) Then
' Row("CodigoAF") = "Unidad no asignada"
' End If
'Next
Dim jsonData As New JArray() Dim jsonData As New JArray()
Dim jsonCategorias As New JArray() Dim jsonCategorias As New JArray()
@@ -117,6 +125,16 @@ Partial Class RepContratosCalendario
) )
jsonData.Add(obj) jsonData.Add(obj)
strAF.AppendFormat("{0},", Row("CveAF")) strAF.AppendFormat("{0},", Row("CveAF"))
'uniad contrato y duracion
Dim unidad As String = $"{Row("CodigoAF")}-{Row("NombreAF")}"
Dim duracion As String = $"{Row("FechaInicial").ToString.ToDate.ToString("dd/MM/yyyy HH:mm")} - {Row("FechaFinal").ToString.ToDate.ToString("dd/MM/yyyy HH:mm")}"
str.AppendLine(String.Format("{0}{{id: {1}, text: ""{2}"", start_date: ""{3:yyyy/MM/dd HH:mm}"", end_date: ""{4:yyyy/MM/dd HH:mm}"", parent: {5}, progress:{6}, open: true, unidad: ""{7}"",duracion: ""{8}""}}",
separator, Row("CveContrato"), Row("NumeroContrato").ToString().Replace("\\", "\\\\").Replace("""", "\"""), Row("FechaInicial"), Row("FechaFinal"), 0, 100, unidad, duracion))
separator = ","
Next Next
If TipoVista = 1 Then 'solo con viajes If TipoVista = 1 Then 'solo con viajes
@@ -134,11 +152,45 @@ Partial Class RepContratosCalendario
Dim FechaF = txtFechaF.Text.ToDateTime() Dim FechaF = txtFechaF.Text.ToDateTime()
Dim ScriptZoom = $"zoomAxis({FechaI.Year},{FechaI.Month - 1},{FechaI.Day},{FechaF.Year},{FechaF.Month - 1},{FechaF.Day});" Dim ScriptZoom = $"zoomAxis({FechaI.Year},{FechaI.Month - 1},{FechaI.Day},{FechaF.Year},{FechaF.Month - 1},{FechaF.Day});"
RegistraScript($"cargaDiagramaGrant({jsonData.ToString()},{jsonCategorias.ToString()},{TipoVista});{ScriptZoom}", "A1") RegistraScript($"cargaDiagramaGrant({jsonData.ToString()},{jsonCategorias.ToString()},{TipoVista});{ScriptZoom}", "A1")
str.AppendLine("];loadGant();")
RegistraScript(str.ToString())
UPPGantt.Update() UPPGantt.Update()
UPGat.Update()
End If End If
End Sub End Sub
'Public Sub loadEvento()
' Dim separator As String = ""
' Dim str As New StringBuilder()
' str.AppendLine("datosGant=[")
' Using oieve As New ClsOIEventos()
' If oieve.GetEventos2(RCveEvento, UsuarioActual.CveEmpresa) AndAlso oieve.DtResultados.Rows.Count > 0 Then
' Dim drow As System.Data.DataRow = oieve.DtResultados.Rows(0)
' LblAsunto.Text = drow("Asunto").ToString()
' End If
' If oieve.GetTareaConHijos(RCveEvento, UsuarioActual.CveEmpresa) Then
' For Each dr As System.Data.DataRow In oieve.DtResultados.Select("Nivel > 0")
' str.AppendLine(String.Format("{0}{{id: {1}, text: ""{2}"", start_date: ""{3:yyyy/MM/dd}"", end_date: ""{4:yyyy/MM/dd}"", parent: {5}, progress:{6}, open: true }}",
' separator, dr("CveEvento"), dr("Asunto").ToString().Replace("\\", "\\\\").Replace("""", "\"""), dr("FechaInicio"), dr("FechaFin"), If(dr("Nivel").ToString().ToEntero() <= 1, 0, dr("CveEventoPadre").ToString().ToEntero()), dr("Avance").ToString().ToDecimal() / 100))
' separator = ","
' Next
' End If
' End Using
' str.AppendLine("];loadGant();")
' RegistraScript(str.ToString())
' UpContenido.Update()
' ' { id: 2, text: "Direccion: evaluación de mercado", start_date: "2020/04/29 00:00", end_date: "2020/05/02 00:00",/*duration: 3,*/ parent: 1, progress: 0.25 }
'End Sub
Private Sub InicializaCalendar() Private Sub InicializaCalendar()
RegistraScript("InitCalendar();") RegistraScript("InitCalendar();")

View File

@@ -89,6 +89,7 @@ Partial Class Ventas_CatMotivosCancelacion
End If End If
End If End If
ObjVentas.Dispose() ObjVentas.Dispose()
GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa) = Nothing
RegistraScript("$('#DivMotivo').modal('hide');") RegistraScript("$('#DivMotivo').modal('hide');")

View File

@@ -1345,7 +1345,7 @@ Partial Class Ventas_ClientesAbonar
MsgError = "No se pudo insertar la póliza" MsgError = "No se pudo insertar la póliza"
End If End If
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, If(CveMoneda = 1 AndAlso TxtTC.Visible, Importe / TxtTC.Text.ToDecimal, Importe), If(CveMoneda = 2, (Importe * tipoCambioPago) - Importe, Importe), 227, ReferenciaVenta, TxtObservaciones.Text + If(TxtTC.Visible, $" TC:{TxtTC.Text}", If(CveMoneda = 2, $" TC:{tipoCambioPago}", "")), CveIE:=CveIE, CveCliente:=ViewState("CveCliente").ToString.ToEntero, ImporteME:=If(CveMoneda = 2, Importe, 0), CveVenta:=CveVenta, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, If(CveMoneda = 1 AndAlso TxtTC.Visible, Importe / TxtTC.Text.ToDecimal, Importe), If(CveMoneda = 2, (Importe * tipoCambioPago) - Importe, Importe), 332, ReferenciaVenta, TxtObservaciones.Text + If(TxtTC.Visible, $" TC:{TxtTC.Text}", If(CveMoneda = 2, $" TC:{tipoCambioPago}", "")), CveIE:=CveIE, CveCliente:=ViewState("CveCliente").ToString.ToEntero, ImporteME:=If(CveMoneda = 2, Importe, 0), CveVenta:=CveVenta, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then
MsgError = "No se pudo insertar la póliza" MsgError = "No se pudo insertar la póliza"
End If End If
Else Else

View File

@@ -2017,7 +2017,7 @@
<ContentTemplate> <ContentTemplate>
<asp:Button ID="BtnGuardar" runat="server" Text="Guardar" ValidationGroup="GrpGuardar" class="btn btn-primary" /> <asp:Button ID="BtnGuardar" runat="server" Text="Guardar" ValidationGroup="GrpGuardar" class="btn btn-primary" />
<asp:Button ID="BtnEliminar" runat="server" Text="Eliminar" class="btn btn-danger" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea eliminar el Producto/Servicio?" data-btn-ok-label="si" /> <asp:Button ID="BtnEliminar" runat="server" Text="Eliminar" class="btn btn-danger" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea eliminar el Producto/Servicio?" data-btn-ok-label="si" />
<asp:HyperLink Text="Cancelar" runat="server" NavigateUrl="/OS/RepOrdenesServicios.aspx" CssClass="btn default" /> <asp:HyperLink Text="Cancelar" runat="server" NavigateUrl="/Ventas/CatPS.aspx" CssClass="btn default" />
<%--<input type="button" value="Cancelar" onclick="javascript: window.close();" class="btn btn-Default" />--%> <%--<input type="button" value="Cancelar" onclick="javascript: window.close();" class="btn btn-Default" />--%>
<asp:ValidationSummary ID="VS" runat="server" DisplayMode="BulletList" ShowSummary="true" ValidationGroup="GrpGuardar" /> <asp:ValidationSummary ID="VS" runat="server" DisplayMode="BulletList" ShowSummary="true" ValidationGroup="GrpGuardar" />
</ContentTemplate> </ContentTemplate>

View File

@@ -282,9 +282,7 @@ Partial Class ProductosyServicios
'CargaFamilia(ViewState("CveSubFamilia").ToString.ToEntero) 'CargaFamilia(ViewState("CveSubFamilia").ToString.ToEntero)
CargaSucursaless() CargaSucursaless()
CargaImpuestosLocales() CargaImpuestosLocales()
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then CargaListaPrecios()
CargaListaPrecios()
End If
If UsuarioActual.TienePermisoProceso(122) Then If UsuarioActual.TienePermisoProceso(122) Then
BtnEliminar.Visible = False BtnEliminar.Visible = False
@@ -2986,16 +2984,18 @@ Partial Class ProductosyServicios
#Region "LISTA PRECIOS" #Region "LISTA PRECIOS"
Private Sub CargaListaPrecios() Private Sub CargaListaPrecios()
If UsuarioActual.TienePermisoProceso(389) Then 'si puede actualizar precios se muestra
Dim objPS As New ClsProductosServicios Dim objPS As New ClsProductosServicios
If objPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, -1, CveClasificacion:=-1, CvePS:=CvePS, If objPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, -1, CveClasificacion:=-1, CvePS:=CvePS,
CveProveedor:=-1, Estado:=-1, Marcas:="-1", CveModelo:=-1) Then CveProveedor:=-1, Estado:=-1, Marcas:="-1", CveModelo:=-1) Then
DtPreciosMultiple = objPS.DtResultados.Copy() DtPreciosMultiple = objPS.DtResultados.Copy()
GvMultiple.DataSource = DtPreciosMultiple GvMultiple.DataSource = DtPreciosMultiple
End If
objPS.Dispose()
DivListaPrecios.Visible = True
GvMultiple.DataBind()
End If End If
objPS.Dispose()
DivListaPrecios.Visible = True
GvMultiple.DataBind()
End Sub End Sub
Protected Sub GvMultiple_RowDataBound(sender As Object, e As GridViewRowEventArgs) Protected Sub GvMultiple_RowDataBound(sender As Object, e As GridViewRowEventArgs)

View File

@@ -292,7 +292,7 @@
<table width="100%"> <table width="100%">
<tr> <tr>
<td align="center"> <td align="center">
<asp:UpdatePanel runat="server"> <asp:UpdatePanel runat="server" >
<ContentTemplate> <ContentTemplate>
<asp:Button ID="BtnGuardar" Text="Guardar" CssClass="btn btn-primary" ValidationGroup="GrpGuardar" OnClick="BtnGuardar_Click" runat="server" /> <asp:Button ID="BtnGuardar" Text="Guardar" CssClass="btn btn-primary" ValidationGroup="GrpGuardar" OnClick="BtnGuardar_Click" runat="server" />
<asp:Button ID="ButBtnEliminar" Text="Eliminar" CssClass="btn btn-danger" OnClick="BtnEliminar_Click" runat="server" Visible="false" <asp:Button ID="ButBtnEliminar" Text="Eliminar" CssClass="btn btn-danger" OnClick="BtnEliminar_Click" runat="server" Visible="false"

View File

@@ -121,16 +121,16 @@ Partial Class Ventas_Promociones
End Set End Set
End Property End Property
Private Property EmpresaFnc382 As Boolean Private Property EmpresaGrupoDiaz As Boolean
Get Get
If ViewState("EmpresaFnc382") Is Nothing Then If ViewState("EmpresaGrupoDiaz") Is Nothing Then
ViewState("EmpresaFnc382") = False ViewState("EmpresaGrupoDiaz") = False
End If End If
Return Boolean.Parse(ViewState("EmpresaFnc382").ToString) Return Boolean.Parse(ViewState("EmpresaGrupoDiaz").ToString)
End Get End Get
Set(value As Boolean) Set(value As Boolean)
ViewState("EmpresaFnc382") = value ViewState("EmpresaGrupoDiaz") = value
End Set End Set
End Property End Property
@@ -157,10 +157,10 @@ Partial Class Ventas_Promociones
PorMinMasCostoVentaFnc129 = UsuarioActual.Empresa.Funcionalidad(129).ToDecimal PorMinMasCostoVentaFnc129 = UsuarioActual.Empresa.Funcionalidad(129).ToDecimal
PermisoAutorizPromocionPorcentaje = UsuarioActual.TienePermisoProceso(386) PermisoAutorizPromocionPorcentaje = UsuarioActual.TienePermisoProceso(386)
EmpresaFnc382 = If(UsuarioActual.Empresa.Funcionalidad(382) = "1", True, False) 'Grupo díaz EmpresaGrupoDiaz = If(UsuarioActual.Empresa.Funcionalidad(382) = "1", True, False) 'Grupo díaz
'EmpresaFnc382 = True ''Para pruebas 'EmpresaGrupoDiaz = True ''Para pruebas
If EmpresaFnc382 Then If EmpresaGrupoDiaz Then
DVModalClasificacion.Visible = False DVModalClasificacion.Visible = False
GvDatos.Columns(6).Visible = True GvDatos.Columns(6).Visible = True
GvDatos.Columns(7).Visible = True GvDatos.Columns(7).Visible = True
@@ -179,8 +179,18 @@ Partial Class Ventas_Promociones
ValidaPromosiones(False) ValidaPromosiones(False)
If EmpresaFnc382 AndAlso ChkEstatus.Checked = False AndAlso BloqueadoPromocionPorcentaje AndAlso Not PermisoAutorizPromocionPorcentaje Then If EmpresaGrupoDiaz Then
ChkEstatus.Enabled = False
If ChkEstatus.Checked = False AndAlso BloqueadoPromocionPorcentaje AndAlso Not PermisoAutorizPromocionPorcentaje Then
ChkEstatus.Enabled = False
End If
If ChkEstatus.Checked = True And Not PermisoAutorizPromocionPorcentaje Then
BtnGuardar.Visible = False
ButBtnEliminar.Visible = False
'UpBotones.Update()
End If
End If End If
Else Else
@@ -351,7 +361,7 @@ Partial Class Ventas_Promociones
Private Sub CargaDTUltimoCosto() Private Sub CargaDTUltimoCosto()
If EmpresaFnc382 Then If EmpresaGrupoDiaz Then
Dim DTPSUltimoCosto = New DataTable Dim DTPSUltimoCosto = New DataTable
Dim ObjInv As New ClsInventarios Dim ObjInv As New ClsInventarios
@@ -659,7 +669,7 @@ Partial Class Ventas_Promociones
Private Sub ValidaPromosiones(Bloquear As Boolean) Private Sub ValidaPromosiones(Bloquear As Boolean)
If Not EmpresaFnc382 Then If Not EmpresaGrupoDiaz Then
BloqueadoPromocionPorcentaje = False BloqueadoPromocionPorcentaje = False
Exit Sub Exit Sub
End If End If
@@ -808,6 +818,15 @@ Partial Class Ventas_Promociones
Private Sub GuardaPromocion() Private Sub GuardaPromocion()
If EmpresaGrupoDiaz Then
If DdlClientes.SelectedValue.ToEntero <= 0 AndAlso Not PermisoAutorizPromocionPorcentaje Then
Alert("Debe de seleccionar un cliente. Seleccione uno e intente de nuevo.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
ValidaPromosiones(True) ValidaPromosiones(True)
Dim CveCliente As Integer = If(DdlClientes.SelectedValue = "", -1, DdlClientes.SelectedValue.ToEntero) Dim CveCliente As Integer = If(DdlClientes.SelectedValue = "", -1, DdlClientes.SelectedValue.ToEntero)
@@ -858,8 +877,19 @@ Partial Class Ventas_Promociones
Private Sub ActualizaPromocion() Private Sub ActualizaPromocion()
Dim CveCliente As Integer = If(DdlClientes.SelectedValue = "", -1, DdlClientes.SelectedValue.ToEntero) Dim CveCliente As Integer = If(DdlClientes.SelectedValue = "", -1, DdlClientes.SelectedValue.ToEntero)
If EmpresaGrupoDiaz Then
If DdlClientes.SelectedValue.ToEntero <= 0 AndAlso Not PermisoAutorizPromocionPorcentaje Then
Alert("Debe de seleccionar un cliente. Seleccione uno e intente de nuevo.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
Dim ObjVentas As New ClsVentas Dim ObjVentas As New ClsVentas
Dim TieneError As Boolean = False Dim TieneError As Boolean = False
@@ -1079,7 +1109,7 @@ Partial Class Ventas_Promociones
TieneError = True TieneError = True
End If End If
If EmpresaFnc382 AndAlso EstatusOriginal = False AndAlso ChkEstatus.Checked And BloqueadoPromocionPorcentaje Then If EmpresaGrupoDiaz AndAlso EstatusOriginal = False AndAlso ChkEstatus.Checked And BloqueadoPromocionPorcentaje Then
Dim objGeneral As New ClsGenerales(ObjVentas.IniciaTransacSQL) Dim objGeneral As New ClsGenerales(ObjVentas.IniciaTransacSQL)
If Not objGeneral.AddHistorialBitacora(360, -1, -1, -1, -1, -1, -1, -1, "Se Autorizo con bloqueo", "No", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0, "", "", "", CvePromocion:=CvePromocion) Then If Not objGeneral.AddHistorialBitacora(360, -1, -1, -1, -1, -1, -1, -1, "Se Autorizo con bloqueo", "No", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0, "", "", "", CvePromocion:=CvePromocion) Then
@@ -1335,6 +1365,8 @@ Partial Class Ventas_Promociones
CargaGrid() CargaGrid()
RegistraScript("$('#DivAgregarPlantilla').modal('hide')") RegistraScript("$('#DivAgregarPlantilla').modal('hide')")
ValidaPromosiones(True)
End Sub End Sub
Private Function ValidaDTPlantilla(ByRef DTPlantilla As DataTable) As Boolean Private Function ValidaDTPlantilla(ByRef DTPlantilla As DataTable) As Boolean

View File

@@ -337,6 +337,7 @@ public partial class Ventas_RepAnticipo_NC_IXCDetalle : ClsPaginas
ConceptosTipoSaldo ConPreP = new ConceptosTipoSaldo(); ConceptosTipoSaldo ConPreP = new ConceptosTipoSaldo();
if (Gv.FCCheckBox("Chk").Checked) if (Gv.FCCheckBox("Chk").Checked)
{ {
Tipo = Gv.DataKey("Tipo").ToEntero();
if (Tipo == 2) if (Tipo == 2)
{ {
ConPreP = ClsPaginas.get_ObtenerCveConceptoPrePoliza(6, Gv.DataKey("CveMoneda").ToEntero(), false, 2); ConPreP = ClsPaginas.get_ObtenerCveConceptoPrePoliza(6, Gv.DataKey("CveMoneda").ToEntero(), false, 2);
@@ -354,10 +355,10 @@ public partial class Ventas_RepAnticipo_NC_IXCDetalle : ClsPaginas
} }
else if (Tipo == 3) else if (Tipo == 3)
{ {
ConPreP = ClsPaginas.get_ObtenerCveConceptoPrePoliza(18, Gv.DataKey("CveMoneda").ToEntero(), true,2); ConPreP = ClsPaginas.get_ObtenerCveConceptoPrePoliza(18, Gv.DataKey("CveMoneda").ToEntero(), false, 2);
CveIE = Gv.DataKey("CveIE").ToEntero(); CveIE = Gv.DataKey("CveIE").ToEntero();
Saldo = Gv.DataKey("Saldo").ToDecimal(); Saldo = Gv.DataKey("Saldo").ToDecimal();
SaldoAdmin = Saldo; SaldoAdmin = -Saldo;
} }
Saldo = -Saldo; // invertimos el saldo para que se haga negativo para que sea ABono Saldo = -Saldo; // invertimos el saldo para que se haga negativo para que sea ABono

View File

@@ -24,12 +24,16 @@
<li> <li>
<asp:LinkButton ID="LnkImprimirPedidos" runat="server" Visible="false" OnClick="LnkImprimirPedidos_Click"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> Imprimir Pedidos</asp:LinkButton> <asp:LinkButton ID="LnkImprimirPedidos" runat="server" Visible="false" OnClick="LnkImprimirPedidos_Click"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> Imprimir Pedidos</asp:LinkButton>
</li> </li>
<li>
<asp:LinkButton ID="LnkImprimirPedidosExcel" runat="server" Visible="false" OnClick="LnkImprimirPedidosExcel_Click"> <i class="fa fa-file-excel-o" aria-hidden="true" style="font-weight:bold;"></i> Excel Pedidos</asp:LinkButton>
</li>
<li> <li>
<asp:LinkButton runat="server" ID="BtnHorariosPedidos" OnClick="BtnHorariosPedidos_Click" data-toggle="tooltip" data-placement="left" title="Agregar Horario" Text="Horarios de Pedidos"></asp:LinkButton> <asp:LinkButton runat="server" ID="BtnHorariosPedidos" OnClick="BtnHorariosPedidos_Click" data-toggle="tooltip" data-placement="left" title="Agregar Horario" Text="Horarios de Pedidos"></asp:LinkButton>
</li> </li>
</ContentTemplate> </ContentTemplate>
<Triggers> <Triggers>
<asp:PostBackTrigger ControlID="LnkImprimirPedidos" /> <asp:PostBackTrigger ControlID="LnkImprimirPedidos" />
<asp:PostBackTrigger ControlID="LnkImprimirPedidosExcel" />
</Triggers> </Triggers>
</asp:UpdatePanel> </asp:UpdatePanel>
@@ -114,6 +118,11 @@
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div> </div>
<label class="col-md-1 ">Cliente:</label>
<div class="col-md-2">
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientes" Width="100%" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;"></ADS:Dropdownlost>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -33,9 +33,6 @@ Partial Class Ventas_RepPedidosSTF
End Set End Set
End Property End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then If Not IsPostBack Then
@@ -64,10 +61,13 @@ Partial Class Ventas_RepPedidosSTF
DdlVendedor.SelectedValueExist(UsuarioActual.CveVendedor) DdlVendedor.SelectedValueExist(UsuarioActual.CveVendedor)
DdlVendedor.Enabled = False DdlVendedor.Enabled = False
End If End If
DdlClientes.setEsWebService(True)
End Sub End Sub
Protected Sub CargaDatos() Protected Sub CargaDatos()
LnkImprimirPedidos.Visible = False LnkImprimirPedidos.Visible = False
LnkImprimirPedidosExcel.Visible = False
DatosGV = New DataTable DatosGV = New DataTable
@@ -75,6 +75,9 @@ Partial Class Ventas_RepPedidosSTF
Dim Opcion As Integer = 1 Dim Opcion As Integer = 1
Dim FechaInicio As Date = MinFecha Dim FechaInicio As Date = MinFecha
Dim FechaFin As Date = MaxFecha Dim FechaFin As Date = MaxFecha
Dim tCveCliente As Integer = DdlClientes.SelectedValue.ToEntero
LnkImprimirPedidos.Visible = False
DatosGV = New DataTable
If TabG.ActiveTabIndex = 1 Then ' entregados If TabG.ActiveTabIndex = 1 Then ' entregados
Opcion = 2 Opcion = 2
@@ -82,7 +85,7 @@ Partial Class Ventas_RepPedidosSTF
FechaFin = txtFechaF.Text.ToDate FechaFin = txtFechaF.Text.ToDate
Dim ObjVentas As New ClsVentas Dim ObjVentas As New ClsVentas
If ObjVentas.GetRepPedidosSTF(DdlSubProyecto.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Opcion, FechaInicio, FechaFin) Then If ObjVentas.GetRepPedidosSTF(DdlSubProyecto.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Opcion, FechaInicio, FechaFin, tCveCliente) Then
GvE.DataSource = ObjVentas.DtResultados GvE.DataSource = ObjVentas.DtResultados
End If End If
@@ -92,7 +95,7 @@ Partial Class Ventas_RepPedidosSTF
FechaInicio = txtFechaI.Text.ToDate FechaInicio = txtFechaI.Text.ToDate
FechaFin = txtFechaF.Text.ToDate FechaFin = txtFechaF.Text.ToDate
Dim ObjVentas As New ClsVentas Dim ObjVentas As New ClsVentas
If ObjVentas.GetRepPedidosSTF(DdlSubProyecto.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Opcion, FechaInicio, FechaFin) Then If ObjVentas.GetRepPedidosSTF(DdlSubProyecto.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Opcion, FechaInicio, FechaFin, tCveCliente) Then
DatosGV = ObjVentas.DtResultados DatosGV = ObjVentas.DtResultados
DatosGV.Columns.Add("CantidadOrg", GetType(Decimal)) DatosGV.Columns.Add("CantidadOrg", GetType(Decimal))
@@ -102,6 +105,7 @@ Partial Class Ventas_RepPedidosSTF
GvDatos.DataSource = DatosGV GvDatos.DataSource = DatosGV
If DatosGV IsNot Nothing AndAlso DatosGV.Rows.Count > 0 Then If DatosGV IsNot Nothing AndAlso DatosGV.Rows.Count > 0 Then
LnkImprimirPedidos.Visible = True LnkImprimirPedidos.Visible = True
LnkImprimirPedidosExcel.Visible = True
End If End If
End If End If
ObjVentas.Dispose() ObjVentas.Dispose()
@@ -375,7 +379,15 @@ Partial Class Ventas_RepPedidosSTF
End Sub End Sub
Protected Sub LnkImprimirPedidos_Click(sender As Object, e As EventArgs) Protected Sub LnkImprimirPedidos_Click(sender As Object, e As EventArgs)
ImprimirReporte("PDF")
End Sub
Protected Sub LnkImprimirPedidosExcel_Click(sender As Object, e As EventArgs)
ImprimirReporte("Excel")
End Sub
Private Sub ImprimirReporte(Formato As String)
Dim FechaI As String = txtFechaI.Text Dim FechaI As String = txtFechaI.Text
Dim FechaF As String = txtFechaF.Text Dim FechaF As String = txtFechaF.Text
If txtFechaI.Text = "" Then FechaI = "-1" If txtFechaI.Text = "" Then FechaI = "-1"
@@ -411,13 +423,13 @@ Partial Class Ventas_RepPedidosSTF
ImprimirPDF("Empresas/Grales/Formatos/RepPedidos.rdlc", DatosGV, params, "ReportePedidos") ImprimirPDF("Empresas/Grales/Formatos/RepPedidos.rdlc", DatosGV, params, "ReportePedidos", Formato)
Else Else
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia) Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
End If End If
End Sub End Sub
Protected Sub BtnEditarHorariosPedidos_Click(sender As Object, e As EventArgs) Protected Sub BtnEditarHorariosPedidos_Click(sender As Object, e As EventArgs)
Dim objSisEmpresas As New ClsSisEmpresas Dim objSisEmpresas As New ClsSisEmpresas
If objSisEmpresas.UpdateEmpresaFuncionalidad(546, $"{TxtHorarioDe.Text}|{TxtHorarioA.Text}", UsuarioActual.CveEmpresa) Then If objSisEmpresas.UpdateEmpresaFuncionalidad(546, $"{TxtHorarioDe.Text}|{TxtHorarioA.Text}", UsuarioActual.CveEmpresa) Then

View File

@@ -15240,14 +15240,15 @@ Partial Class Ventas
If ObjFactura.CveMoneda = 2 AndAlso CveMonedaAnticipo = 1 Then If ObjFactura.CveMoneda = 2 AndAlso CveMonedaAnticipo = 1 Then
Importe11MX = Importe11MX * tipoCambio Importe11MX = Importe11MX * tipoCambio
End If End If
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, Importe11MX, Importe11MX, 11, Referencia, Concepto, CveVenta:=row2.DataKey("CveVenta").ToEntero(), CveVentaAmortizacion:=ObjFactura.CveVenta, ImporteME:=If(tipoCambioAnticipo = 1, 0, importeMovimiento), CveCliente:=ObjFactura.CveCliente, CveIE:=CveIEAnticipo, CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza, TipoCambio:=tipoCambioAnticipo) Then Dim ConPrePAnt As ConceptosTipoSaldo = ObtenerCveConceptoPrePoliza(12, VentaActual.CveMoneda, True, 1)
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, Importe11MX, Importe11MX, ConPrePAnt.CveConcepto, Referencia, Concepto, CveVenta:=row2.DataKey("CveVenta").ToEntero(), CveVentaAmortizacion:=ObjFactura.CveVenta, ImporteME:=If(tipoCambioAnticipo = 1, 0, importeMovimiento), CveCliente:=ObjFactura.CveCliente, CveIE:=CveIEAnticipo, CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza, TipoCambio:=tipoCambioAnticipo) Then
ErrorPrepoliza = True ErrorPrepoliza = True
Exit For Exit For
End If End If
If row2.DataKey("CveMoneda").ToString.ToEntero = 2 Then If row2.DataKey("CveMoneda").ToString.ToEntero = 2 Then
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, ImporteAnticipo * tipoCambioAnticipo - ImporteAnticipo, ImporteAnticipo * tipoCambioAnticipo - ImporteAnticipo, 227, Referencia, Concepto, CveVenta:=row2.DataKey("CveVenta").ToEntero(), CveVentaAmortizacion:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIEAnticipo, ImporteME:=If(tipoCambioAnticipo = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza, TipoCambio:=tipoCambioAnticipo) Then If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, ImporteAnticipo * tipoCambioAnticipo - ImporteAnticipo, ImporteAnticipo * tipoCambioAnticipo - ImporteAnticipo, ConPrePAnt.CveConceptoComplementario, Referencia, Concepto, CveVenta:=row2.DataKey("CveVenta").ToEntero(), CveVentaAmortizacion:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIEAnticipo, ImporteME:=If(tipoCambioAnticipo = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza, TipoCambio:=tipoCambioAnticipo) Then
ErrorPrepoliza = True ErrorPrepoliza = True
Exit For Exit For
End If End If