Cambios en facturacion masiva de contratos
This commit is contained in:
@@ -43,6 +43,8 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
|||||||
ActualizaPrePoliza(context)
|
ActualizaPrePoliza(context)
|
||||||
Case "getpersonal"
|
Case "getpersonal"
|
||||||
getpersonal(context)
|
getpersonal(context)
|
||||||
|
Case "getcontratos"
|
||||||
|
GetContratos(context)
|
||||||
Case "GettingCURP"
|
Case "GettingCURP"
|
||||||
context.Response.Write(GettingCURP(context.Request("Curp").ToString(), context.Request("year").ToString().ToEntero()))
|
context.Response.Write(GettingCURP(context.Request("Curp").ToString(), context.Request("year").ToString().ToEntero()))
|
||||||
Case "ValidaCURP"
|
Case "ValidaCURP"
|
||||||
@@ -1080,4 +1082,38 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
|||||||
Return retorno
|
Return retorno
|
||||||
End Function
|
End Function
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
#Region "Get Contratos"
|
||||||
|
Private Function GetContratos(ByVal context As HttpContext) As String
|
||||||
|
Dim retorno As String = ""
|
||||||
|
Dim DtRetorno As DataTable = Nothing
|
||||||
|
|
||||||
|
Dim usuario As Usuario = UsuarioActual(context)
|
||||||
|
Dim CveEmpresa As String
|
||||||
|
If IsNothing(usuario) Then
|
||||||
|
context.Response.Write("")
|
||||||
|
Else
|
||||||
|
CveEmpresa = usuario.CveEmpresa
|
||||||
|
Dim Name = IfNull(context.Request("Name"), "-1").ToString
|
||||||
|
|
||||||
|
Dim dt As DataTable = DirectCast(context.Application("GlobalDTContratos"), DataTable).FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa))
|
||||||
|
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
||||||
|
DtRetorno = dt.FiltraParametros(String.Format("NumeroContrato like '%{0}%'", Name))
|
||||||
|
End If
|
||||||
|
dt.Dispose()
|
||||||
|
End If
|
||||||
|
|
||||||
|
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
|
||||||
|
DtRetorno.Columns("CveContrato").ColumnName = "id"
|
||||||
|
DtRetorno.Columns("NumeroContrato").ColumnName = "text"
|
||||||
|
retorno = JsonConvert.SerializeObject(DtRetorno).ToString
|
||||||
|
context.Response.Write(retorno)
|
||||||
|
Else
|
||||||
|
context.Response.Write("[]")
|
||||||
|
End If
|
||||||
|
|
||||||
|
DtRetorno.Dispose()
|
||||||
|
Return retorno
|
||||||
|
End Function
|
||||||
|
#End Region
|
||||||
End Class
|
End Class
|
||||||
@@ -256,13 +256,17 @@
|
|||||||
<table runat="server" id="TableDatosCabecera" visible="false" width="100%">
|
<table runat="server" id="TableDatosCabecera" visible="false" width="100%">
|
||||||
<tr>
|
<tr>
|
||||||
<td style="width: 250px;">Importe Contratado: $
|
<td style="width: 250px;">Importe Contratado: $
|
||||||
|
|
||||||
<asp:Label ID="LblImporte" Font-Size="18px" Font-Bold="True" runat="server" Text=""></asp:Label></td>
|
<asp:Label ID="LblImporte" Font-Size="18px" Font-Bold="True" runat="server" Text=""></asp:Label></td>
|
||||||
<td style="width: 225px;">Facturado: $
|
<td style="width: 225px;">Facturado: $
|
||||||
|
|
||||||
<asp:Label ID="LblFacturado" Font-Size="18px" Font-Bold="True" runat="server" Text="0.00"></asp:Label></td>
|
<asp:Label ID="LblFacturado" Font-Size="18px" Font-Bold="True" runat="server" Text="0.00"></asp:Label></td>
|
||||||
<td style="width: 225px;">Por Facturar: $
|
<td style="width: 225px;">Por Facturar: $
|
||||||
|
|
||||||
<asp:Label ID="LblPorFacturar" Font-Size="18px" Font-Bold="True" runat="server" Text="0.00"></asp:Label></td>
|
<asp:Label ID="LblPorFacturar" Font-Size="18px" Font-Bold="True" runat="server" Text="0.00"></asp:Label></td>
|
||||||
<td style="text-align: right"><a runat="server" id="LinkArchivo" target="_blank" visible="false">Descargar Contrato<img alt="Descargar Contrato" height="20px" src="/Imagenes/DownPDF.png" /></a></td>
|
<td style="text-align: right"><a runat="server" id="LinkArchivo" target="_blank" visible="false">Descargar Contrato<img alt="Descargar Contrato" height="20px" src="/Imagenes/DownPDF.png" /></a></td>
|
||||||
<td runat="server" id="TablaUtilidad" visible="false">Utilidad:
|
<td runat="server" id="TablaUtilidad" visible="false">Utilidad:
|
||||||
|
|
||||||
<asp:Label ID="LblUtilidad" Font-Size="18px" Font-Bold="True" runat="server" Text=""></asp:Label></td>
|
<asp:Label ID="LblUtilidad" Font-Size="18px" Font-Bold="True" runat="server" Text=""></asp:Label></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -632,6 +636,7 @@
|
|||||||
<div class="row" style="display: none;">
|
<div class="row" style="display: none;">
|
||||||
<div class="col-md-4 truncate">
|
<div class="col-md-4 truncate">
|
||||||
Fecha Venc.:
|
Fecha Venc.:
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||||
@@ -744,10 +749,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12" style="vertical-align: middle;" align="center">
|
||||||
|
<div style="z-index: 5; position: relative;">
|
||||||
|
<div id="DivAdvertencia" clientidmode="Static" runat="server" class="alert alert-warning" style="padding: 5px; margin-bottom: 5px; padding-right: 25px;">
|
||||||
|
<button type="button" class="close" data-dismiss="alert" style="margin-top: 5px;" aria-hidden="true"></button>
|
||||||
|
<asp:Literal Text="En las observaciones se puede generar una plantilla a partir de diferentes etiquetas: {DIA},{MES},{AÑO},{TC}" runat="server" ID="LtlAdvertencia"></asp:Literal>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="row" runat="server" id="DivImpuestosLocales">
|
<div class="row" runat="server" id="DivImpuestosLocales">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="portlet smmallpadding light bordered">
|
<div class="portlet smmallpadding light bordered">
|
||||||
@@ -808,6 +819,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="row" style="display: none;">
|
<div class="row" style="display: none;">
|
||||||
<label class="col-md-2 truncate">Importe:</label>
|
<label class="col-md-2 truncate">Importe:</label>
|
||||||
<div class="col-md-10">
|
<div class="col-md-10">
|
||||||
@@ -1577,6 +1591,7 @@
|
|||||||
<div style="z-index: 5; position: relative;">
|
<div style="z-index: 5; position: relative;">
|
||||||
<div class="alert alert-warning" style="padding: 5px; margin-bottom: 5px; padding-right: 25px;">
|
<div class="alert alert-warning" style="padding: 5px; margin-bottom: 5px; padding-right: 25px;">
|
||||||
<strong style="font-size: 15px; margin-right: 15px;">Nota:</strong> Incluye gastos manuales, salidas de almacén de suministros y de facturas.
|
<strong style="font-size: 15px; margin-right: 15px;">Nota:</strong> Incluye gastos manuales, salidas de almacén de suministros y de facturas.
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1742,10 +1757,11 @@
|
|||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<div id="DivHajusteAF" runat="server" visible="False" class="col-md-8" style="text-align: right;">
|
<div id="DivHajusteAF" runat="server" visible="False" class="col-md-8" style="text-align: right;">
|
||||||
Tipo:
|
Tipo:
|
||||||
<asp:DropDownList runat="server" ID="DdlEsInterno" Width="120px" CssClass="select2me">
|
|
||||||
<asp:ListItem Value="1">Es Interno</asp:ListItem>
|
<asp:DropDownList runat="server" ID="DdlEsInterno" Width="120px" CssClass="select2me">
|
||||||
<asp:ListItem Value="2">Es Externo</asp:ListItem>
|
<asp:ListItem Value="1">Es Interno</asp:ListItem>
|
||||||
</asp:DropDownList>
|
<asp:ListItem Value="2">Es Externo</asp:ListItem>
|
||||||
|
</asp:DropDownList>
|
||||||
<asp:Button runat="server" ID="BtnAlmacenEsInterno" Text="Actualizar" OnClick="BtnAlmacenEsInterno_Click" CssClass="btn btn-primary" />
|
<asp:Button runat="server" ID="BtnAlmacenEsInterno" Text="Actualizar" OnClick="BtnAlmacenEsInterno_Click" CssClass="btn btn-primary" />
|
||||||
</div>
|
</div>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
@@ -1754,6 +1770,7 @@
|
|||||||
|
|
||||||
<div id="DivSinRegistrosAlmacen" runat="server" visible="false" class="col-md-4" style="text-align: center;">
|
<div id="DivSinRegistrosAlmacen" runat="server" visible="false" class="col-md-4" style="text-align: center;">
|
||||||
Aun no se han registrado Activos Fijos.
|
Aun no se han registrado Activos Fijos.
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -1889,7 +1906,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group form-md-line-input input-iconright" style="width:500px;">
|
<div class="form-group form-md-line-input input-iconright" style="width: 500px;">
|
||||||
<asp:TextBox ID="TxtCorreoNotificacion" CssClass="form-control" runat="server" MaxLength="300"></asp:TextBox>
|
<asp:TextBox ID="TxtCorreoNotificacion" CssClass="form-control" runat="server" MaxLength="300"></asp:TextBox>
|
||||||
<ajax:FilteredTextBoxExtender ID="FTECorreoNotificacion" runat="server" FilterType="Numbers, LowercaseLetters, UppercaseLetters, Custom" ValidChars=".;@_-ñ" TargetControlID="TxtCorreoNotificacion" />
|
<ajax:FilteredTextBoxExtender ID="FTECorreoNotificacion" runat="server" FilterType="Numbers, LowercaseLetters, UppercaseLetters, Custom" ValidChars=".;@_-ñ" TargetControlID="TxtCorreoNotificacion" />
|
||||||
<asp:RegularExpressionValidator ID="REVCorreoNotif" runat="server" CssClass="help-block errorimput" ValidationExpression="(([a-zA-Z0-9ñÑ_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)(\s*;\s*|\s*$))*" ControlToValidate="TxtCorreoNotificacion" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Correo de aviso de notificación de pedido o devolución''</b> no es válido, por favor ingrése uno correcto."></asp:RegularExpressionValidator>
|
<asp:RegularExpressionValidator ID="REVCorreoNotif" runat="server" CssClass="help-block errorimput" ValidationExpression="(([a-zA-Z0-9ñÑ_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)(\s*;\s*|\s*$))*" ControlToValidate="TxtCorreoNotificacion" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Correo de aviso de notificación de pedido o devolución''</b> no es válido, por favor ingrése uno correcto."></asp:RegularExpressionValidator>
|
||||||
@@ -1965,6 +1982,7 @@
|
|||||||
|
|
||||||
<asp:Button ID="BtnCancelar" CssClass="btn btn-default" runat="server" Text="Cancelar" OnClientClick="javascript:window.location.href='/Contratos/Contratos.aspx';return false" />
|
<asp:Button ID="BtnCancelar" CssClass="btn btn-default" runat="server" Text="Cancelar" OnClientClick="javascript:window.location.href='/Contratos/Contratos.aspx';return false" />
|
||||||
|
|
||||||
|
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
</div>
|
</div>
|
||||||
@@ -2066,6 +2084,7 @@
|
|||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<label>
|
<label>
|
||||||
Bitácora/Observaciones
|
Bitácora/Observaciones
|
||||||
|
|
||||||
</label>
|
</label>
|
||||||
<br />
|
<br />
|
||||||
<asp:TextBox CssClass="form-control" ID="TxtEventoDescripcion" class="Widthall" runat="server" TextMode="MultiLine" Columns="60" Rows="8"></asp:TextBox>
|
<asp:TextBox CssClass="form-control" ID="TxtEventoDescripcion" class="Widthall" runat="server" TextMode="MultiLine" Columns="60" Rows="8"></asp:TextBox>
|
||||||
|
|||||||
@@ -1204,8 +1204,11 @@ Partial Class Contratos_Default
|
|||||||
|
|
||||||
#Region " GUARDAR "
|
#Region " GUARDAR "
|
||||||
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
|
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
|
||||||
Dim ObjContratos As New ClsContratos
|
|
||||||
Dim ObjInventarios As New ClsInventarios(ObjContratos.IniciaTransacSQL)
|
If DdlContratista.SelectedValue.ToEntero = -1 And DdlCliente.SelectedValue.ToEntero = -1 Then
|
||||||
|
Alert("Debe seleccionar con quién está haciendo el contrato. Proveedor o Cliente", TipoMensaje.MsgAdvertencia)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
Dim TieneError = False
|
Dim TieneError = False
|
||||||
Dim Modificado = False
|
Dim Modificado = False
|
||||||
@@ -1221,6 +1224,10 @@ Partial Class Contratos_Default
|
|||||||
Maximo = txtMaximo.Text.ToDouble
|
Maximo = txtMaximo.Text.ToDouble
|
||||||
Total = TxtTotal.Text.ToDouble
|
Total = TxtTotal.Text.ToDouble
|
||||||
|
|
||||||
|
If DdlTipoContrato.SelectedValue = "25" AndAlso DdlPeriodo.SelectedValue.ToEntero() <= 0 Then
|
||||||
|
Alert("Debe seleccionar el periodo de facturación.", TipoMensaje.MsgAdvertencia)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
If DdlMoneda.SelectedIndex > 0 Then
|
If DdlMoneda.SelectedIndex > 0 Then
|
||||||
If TxtTipoCambio.Text.Trim.Length = 0 Or TxtTipoCambio.Text.Trim.ToDouble = 0.0 Then
|
If TxtTipoCambio.Text.Trim.Length = 0 Or TxtTipoCambio.Text.Trim.ToDouble = 0.0 Then
|
||||||
@@ -1229,13 +1236,18 @@ Partial Class Contratos_Default
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If CveContrato > 0 Then
|
||||||
'Crear Contrato
|
|
||||||
If Not CveContrato > 0 Then
|
|
||||||
If DdlContratista.SelectedValue.ToEntero = -1 And DdlCliente.SelectedValue.ToEntero = -1 Then
|
If DdlContratista.SelectedValue.ToEntero = -1 And DdlCliente.SelectedValue.ToEntero = -1 Then
|
||||||
Alert("Debe seleccionar con quién está haciendo el contrato. Proveedor o Cliente", TipoMensaje.MsgAdvertencia)
|
Alert("Debe seleccionar con quién está haciendo el contrato. Proveedor o Cliente", TipoMensaje.MsgAdvertencia)
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim ObjContratos As New ClsContratos
|
||||||
|
Dim ObjInventarios As New ClsInventarios(ObjContratos.IniciaTransacSQL)
|
||||||
|
|
||||||
|
'Crear Contrato
|
||||||
|
If Not CveContrato > 0 Then
|
||||||
|
|
||||||
CveContrato = ObjContratos.AddContratos(TxtNumeroContrato.Text, TxtDescripcionContrato.Text, TxtNumeroLicitacion.Text.Trim, DdlContratista.SelectedValue.ToEntero, DdlCliente.SelectedValue.ToEntero, -1, TxtFechaInicial.Text.ToDate, TxtFechaFinal.Text.ToDate,
|
CveContrato = ObjContratos.AddContratos(TxtNumeroContrato.Text, TxtDescripcionContrato.Text, TxtNumeroLicitacion.Text.Trim, DdlContratista.SelectedValue.ToEntero, DdlCliente.SelectedValue.ToEntero, -1, TxtFechaInicial.Text.ToDate, TxtFechaFinal.Text.ToDate,
|
||||||
TxtUbicacion.Text, TxtResponsable.Text, DdlSubProyectoContrato.SelectedValue.ToEntero, TxtPorIVA.Text.ToDouble, TxtPorAnticipo.Text.ToDouble, TxtPorAmortizacionAnticipo.Text.ToDouble,
|
TxtUbicacion.Text, TxtResponsable.Text, DdlSubProyectoContrato.SelectedValue.ToEntero, TxtPorIVA.Text.ToDouble, TxtPorAnticipo.Text.ToDouble, TxtPorAmortizacionAnticipo.Text.ToDouble,
|
||||||
@@ -1323,18 +1335,9 @@ Partial Class Contratos_Default
|
|||||||
TieneError = True
|
TieneError = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Else
|
Else
|
||||||
Modificado = True
|
Modificado = True
|
||||||
If DdlContratista.SelectedValue.ToEntero = -1 And DdlCliente.SelectedValue.ToEntero = -1 Then
|
|
||||||
Alert("Debe seleccionar con quién está haciendo el contrato. Proveedor o Cliente", TipoMensaje.MsgAdvertencia)
|
|
||||||
Exit Sub
|
|
||||||
End If
|
|
||||||
Dim ArchivoUpdate As String = "-1"
|
Dim ArchivoUpdate As String = "-1"
|
||||||
|
|
||||||
If Session("FileExtension").ToString <> "" Then
|
If Session("FileExtension").ToString <> "" Then
|
||||||
@@ -1433,16 +1436,8 @@ Partial Class Contratos_Default
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'If Not TieneError Then
|
|
||||||
' TieneError = GuardarAlmacen(ObjInventarios)
|
|
||||||
'End If
|
|
||||||
|
|
||||||
If TieneError Then
|
If TieneError Then
|
||||||
ObjContratos.RollBack()
|
ObjContratos.RollBack()
|
||||||
Else
|
Else
|
||||||
@@ -1461,7 +1456,6 @@ Partial Class Contratos_Default
|
|||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
UpGral.Update()
|
UpGral.Update()
|
||||||
ObjContratos.Dispose()
|
ObjContratos.Dispose()
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
@@ -34,14 +34,11 @@
|
|||||||
<div class="titlefiltros caption ">
|
<div class="titlefiltros caption ">
|
||||||
<ul class="list-inline" style="font-size: 12px;">
|
<ul class="list-inline" style="font-size: 12px;">
|
||||||
<li>Cliente:
|
<li>Cliente:
|
||||||
<asp:DropDownList ID="DdlCliente" runat="server" AppendDataBoundItems="true" DataTextField="NombreComercial" DataValueField="CveCliente" CssClass="form-control input-sm select2me" Style="width: 250px !important;">
|
<ADS:Dropdownlost ID="DdlCliente" runat="server" Width="230px" CssStyle="width: 100%;" UsaWebService="true" AppendDataBoundItems="true" CssClass="select2me" data-metodo="getcliente" DataTextField="NombreComercial" DataValueField="CveCliente"></ADS:Dropdownlost>
|
||||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
|
||||||
</asp:DropDownList>
|
|
||||||
</li>
|
</li>
|
||||||
<li>Contrato:
|
<li>Contrato:
|
||||||
<asp:DropDownList ID="DdlContrato" Width="230px" AppendDataBoundItems="true" runat="server" DataTextField="NumeroContrato" DataValueField="CveContrato" CssClass="form-control input-sm select2me">
|
<ADS:Dropdownlost ID="DdlContrato" runat="server" Width="230px" CssStyle="width: 100%;" UsaWebService="true" AppendDataBoundItems="true" CssClass="select2me" data-metodo="getcontratos" DataTextField="NumeroContrato" DataValueField="CveContrato">
|
||||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
</ADS:Dropdownlost>
|
||||||
</asp:DropDownList>
|
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
Sucursal:
|
Sucursal:
|
||||||
|
|||||||
@@ -111,8 +111,9 @@ Partial Class Contratos_FacturacionMasiva
|
|||||||
If Not IsPostBack Then
|
If Not IsPostBack Then
|
||||||
FolioVigentes = False
|
FolioVigentes = False
|
||||||
CargaCombos()
|
CargaCombos()
|
||||||
txtFechaI.Text = DateTime.Today.ToString("d")
|
Dim FechaRef = DateTime.Now
|
||||||
txtFechaF.Text = DateTime.Today.ToString("d")
|
txtFechaI.Text = $"01/{FechaRef.Month}/{FechaRef.Year}"
|
||||||
|
txtFechaF.Text = txtFechaI.Text.ToDate().AddMonths(1).ToString("dd/MM/yyyy")
|
||||||
CargaDatos(-1, -1)
|
CargaDatos(-1, -1)
|
||||||
CreaDTVentas()
|
CreaDTVentas()
|
||||||
Mensaje = ""
|
Mensaje = ""
|
||||||
@@ -131,11 +132,44 @@ Partial Class Contratos_FacturacionMasiva
|
|||||||
ValidaFolio()
|
ValidaFolio()
|
||||||
|
|
||||||
Dim ObjContratos As New ClsContratos
|
Dim ObjContratos As New ClsContratos
|
||||||
If ObjContratos.CicloComercialGet(CveContrato, CveCliente, -1, UsuarioActual.CveEmpresa, txtFechaI.Text.ToDateTime, txtFechaF.Text.ToDateTime, DdlSucursal.SelectedValue.ToEntero) Then
|
Try
|
||||||
DTCicloComercial = ObjContratos.DtResultados().FiltraParametros($"FueFacturado = 0")
|
If ObjContratos.CicloComercialGet(CveContrato, CveCliente, -1, UsuarioActual.CveEmpresa, txtFechaI.Text.ToDateTime, txtFechaF.Text.ToDateTime, DdlSucursal.SelectedValue.ToEntero) Then
|
||||||
GvCiclosComerciales.DataSource = DTCicloComercial
|
DTCicloComercial = ObjContratos.DtResultados.Clone
|
||||||
End If
|
|
||||||
|
For Each Row As DataRow In ObjContratos.DtResultados().FiltraParametros($"FueFacturado = 0").Rows
|
||||||
|
|
||||||
|
If Row("Observaciones").ToString().Contains("{DIA}") Then
|
||||||
|
Row("Observaciones") = Row("Observaciones").ToString().Replace("{DIA}", DateTime.Now.Day.ToString())
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Row("Observaciones").ToString().Contains("{MES}") Then
|
||||||
|
Dim fecha As DateTime = DateTime.Now
|
||||||
|
Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat
|
||||||
|
Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper()
|
||||||
|
|
||||||
|
Row("Observaciones") = Row("Observaciones").ToString().Replace("{MES}", nombreMes)
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Row("Observaciones").ToString().Contains("{AÑO}") Then
|
||||||
|
Row("Observaciones") = Row("Observaciones").ToString().Replace("{AÑO}", DateTime.Now.Year.ToString())
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Row("Observaciones").ToString().Contains("{TC}") Then
|
||||||
|
Row("Observaciones") = Row("Observaciones").ToString().Replace("{TC}", GlobalTipoCambio(Now).FormatoNumero)
|
||||||
|
End If
|
||||||
|
|
||||||
|
DTCicloComercial.Rows.Add(Row.ItemArray)
|
||||||
|
Next
|
||||||
|
|
||||||
|
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
DTCicloComercial = Nothing
|
||||||
|
OnError("Ocurrió un error al obtener las facturas a realizar", ex)
|
||||||
|
End Try
|
||||||
ObjContratos.Dispose()
|
ObjContratos.Dispose()
|
||||||
|
|
||||||
|
GvCiclosComerciales.DataSource = DTCicloComercial
|
||||||
GvCiclosComerciales.DataBind()
|
GvCiclosComerciales.DataBind()
|
||||||
UpGv.Update()
|
UpGv.Update()
|
||||||
End Sub
|
End Sub
|
||||||
@@ -175,13 +209,8 @@ Partial Class Contratos_FacturacionMasiva
|
|||||||
|
|
||||||
For Each row As GridViewRow In GvCiclosComerciales.Rows
|
For Each row As GridViewRow In GvCiclosComerciales.Rows
|
||||||
If row.FCCheckBox("chkDis").Checked Then
|
If row.FCCheckBox("chkDis").Checked Then
|
||||||
Dim fecha As DateTime = DateTime.Now ', row.DataKey("FechaVenc").ToString.ToDateTime()
|
|
||||||
Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat
|
|
||||||
Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper()
|
|
||||||
|
|
||||||
Dim Etiqueta As String = String.Format("{0} - {1}", nombreMes, fecha.Year)
|
Dim Resp = EmitirImprimir(row.DataKey("CveCicloComercial").ToString.ToEntero)
|
||||||
|
|
||||||
Dim Resp = EmitirImprimir(row.DataKey("CveCicloComercial").ToString.ToEntero, Etiqueta)
|
|
||||||
|
|
||||||
For Each Msg In Resp.Mensajes
|
For Each Msg In Resp.Mensajes
|
||||||
sb.AppendFormat("{0}</br></br>", Msg)
|
sb.AppendFormat("{0}</br></br>", Msg)
|
||||||
@@ -212,10 +241,10 @@ Partial Class Contratos_FacturacionMasiva
|
|||||||
EjecutarFacturacion()
|
EjecutarFacturacion()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function EmitirImprimir(pCveCicloComercial As Integer, Etiqueta As String) As Modelos.Factura.MMensajeFactura
|
Private Function EmitirImprimir(pCveCicloComercial As Integer) As Modelos.Factura.MMensajeFactura
|
||||||
Dim Resp As New Modelos.Factura.MMensajeFactura
|
Dim Resp As New Modelos.Factura.MMensajeFactura
|
||||||
ViewState("CveCicloComercial") = pCveCicloComercial
|
ViewState("CveCicloComercial") = pCveCicloComercial
|
||||||
CreaObjetosVenta(Etiqueta)
|
CreaObjetosVenta()
|
||||||
If ObjFactura Is Nothing Or ObjFactura.Cliente Is Nothing Then
|
If ObjFactura Is Nothing Or ObjFactura.Cliente Is Nothing Then
|
||||||
Alert("Ocurrió un error al procesar los datos de la Venta.", TipoMensaje.MsgError)
|
Alert("Ocurrió un error al procesar los datos de la Venta.", TipoMensaje.MsgError)
|
||||||
ObjFactura = Nothing
|
ObjFactura = Nothing
|
||||||
@@ -438,7 +467,7 @@ Partial Class Contratos_FacturacionMasiva
|
|||||||
TmpDT.Columns.Add("CveTamaño", GetType(Integer))
|
TmpDT.Columns.Add("CveTamaño", GetType(Integer))
|
||||||
TmpDT.Columns.Add("EsCargo", GetType(Boolean))
|
TmpDT.Columns.Add("EsCargo", GetType(Boolean))
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CreaObjetosVenta(Etiqueta As String, Optional VistaPrevia As Boolean = False)
|
Private Sub CreaObjetosVenta(Optional VistaPrevia As Boolean = False)
|
||||||
Dim ObjFolios As New ClsGralFolios()
|
Dim ObjFolios As New ClsGralFolios()
|
||||||
Dim Folio As String = ""
|
Dim Folio As String = ""
|
||||||
Dim Serie As String = ""
|
Dim Serie As String = ""
|
||||||
@@ -472,7 +501,7 @@ Partial Class Contratos_FacturacionMasiva
|
|||||||
ObjFactura.MetodoPago = "Efectivo"
|
ObjFactura.MetodoPago = "Efectivo"
|
||||||
ObjFactura.FechaPago = DateTime.Today
|
ObjFactura.FechaPago = DateTime.Today
|
||||||
ObjFactura.MotivoDescuento = ""
|
ObjFactura.MotivoDescuento = ""
|
||||||
ObjFactura.Observaciones = Etiqueta + " " + TxtObservaciones.Text + " " + DR("Observaciones").ToString
|
ObjFactura.Observaciones = TxtObservaciones.Text + " " + DR("Observaciones").ToString
|
||||||
ObjFactura.FechaEjecucion = DateTime.Today
|
ObjFactura.FechaEjecucion = DateTime.Today
|
||||||
'ObjFactura.ClaveMetodoPagoSAT = GlobalDTMetodosPago.FiltroPrimeroValor("ClaveSAT", $"CveMetodoPago = {1}")
|
'ObjFactura.ClaveMetodoPagoSAT = GlobalDTMetodosPago.FiltroPrimeroValor("ClaveSAT", $"CveMetodoPago = {1}")
|
||||||
ObjFactura.UsuarioCreo = UsuarioActual.Usuario
|
ObjFactura.UsuarioCreo = UsuarioActual.Usuario
|
||||||
@@ -553,9 +582,9 @@ Partial Class Contratos_FacturacionMasiva
|
|||||||
DtR("CodigoPS") = row("CodigoPS")
|
DtR("CodigoPS") = row("CodigoPS")
|
||||||
DtR("SATClaveProdServ") = row("SATClaveProdServ")
|
DtR("SATClaveProdServ") = row("SATClaveProdServ")
|
||||||
DtR("NoIdentificacion") = row("NoIdentificacion")
|
DtR("NoIdentificacion") = row("NoIdentificacion")
|
||||||
DtR("CveTipoPS") = DrPS("CveTipoPS")
|
DtR("CveTipoPS") = drPS("CveTipoPS")
|
||||||
DtR("CveTipoInvPS") = DrPS("Inv_CveMetodoInventario")
|
DtR("CveTipoInvPS") = drPS("Inv_CveMetodoInventario")
|
||||||
DtR("Obs") = Etiqueta + " " + TxtObservaciones.Text + " " + row("Observacion").ToString
|
DtR("Obs") = TxtObservaciones.Text + " " + row("Observacion").ToString
|
||||||
DtR("PU") = row("PU")
|
DtR("PU") = row("PU")
|
||||||
DtR("IVA") = row("PorcentajeIVA")
|
DtR("IVA") = row("PorcentajeIVA")
|
||||||
DtR("PorcentajeIVA") = row("PorcentajeIVA")
|
DtR("PorcentajeIVA") = row("PorcentajeIVA")
|
||||||
|
|||||||
Reference in New Issue
Block a user