This commit is contained in:
2020-01-27 20:27:57 -07:00
9 changed files with 290 additions and 60 deletions

View File

@@ -839,13 +839,14 @@ Public Class ClsAcumuladores
End Try
Return Retorno
End Function
Public Function UpdateEnvioPolizaVirutal(CvePolizaVirtual As Integer, Envio As Boolean, FechaEnvio As DateTime) As Boolean
Public Function UpdateEnvioPolizaVirutal(CvePolizaVirtual As Integer, Envio As Boolean, FechaEnvio As DateTime, CodigoUnico As String) As Boolean
Dim Retorno As Boolean = False
SqlDataAdapter("PA_Vta_PolizaVirtualEnvioUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePolizaVirtual", SqlDbType.Int).Value = CvePolizaVirtual
.Add("@Envio", SqlDbType.TinyInt).Value = Envio
.Add("@FechaEnvio", SqlDbType.DateTime).Value = FechaEnvio
.Add("@FechaEnvio", SqlDbType.DateTime).Value = FechaEnvio
.Add("@CodigoUnico", SqlDbType.VarChar).Value = CodigoUnico
End With
Try
SqlAdapter.Fill(Data)

View File

@@ -2927,6 +2927,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("FechaInicial", Fecha))
params.Add(New ReportParameter("FechaFinal", Today.ToString))
params.Add(New ReportParameter("Sucursal", "Sucursal"))
params.Add(New ReportParameter("Cliente", NombreCliente))
ImprimirPDF(String.Format("Empresas/{0}/Formatos/RepUsadosEntradas.rdlc", UsuarioActual.CveEmpresa), DtMovimientos, params, "Reporte entrada usados", "PDF", "DsInventarios")

View File

@@ -20,6 +20,9 @@
<TablixColumn>
<Width>1.99729cm</Width>
</TablixColumn>
<TablixColumn>
<Width>2.54cm</Width>
</TablixColumn>
<TablixColumn>
<Width>2.3148cm</Width>
</TablixColumn>
@@ -152,12 +155,13 @@
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<ColSpan>4</ColSpan>
<ColSpan>5</ColSpan>
</CellContents>
</TablixCell>
<TablixCell />
<TablixCell />
<TablixCell />
<TablixCell />
<TablixCell>
<CellContents>
<Textbox Name="Textbox22">
@@ -199,7 +203,7 @@
</TablixCells>
</TablixRow>
<TablixRow>
<Height>0.6cm</Height>
<Height>0.86458cm</Height>
<TablixCells>
<TablixCell>
<CellContents>
@@ -391,6 +395,44 @@
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox40">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Referencia Movto</Value>
<Style>
<FontFamily>Verdana</FontFamily>
<FontSize>8pt</FontSize>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox40</rd:DefaultName>
<Style>
<Border>
<Style>None</Style>
</Border>
<BottomBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</BottomBorder>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox2">
@@ -647,11 +689,12 @@
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<ColSpan>3</ColSpan>
<ColSpan>4</ColSpan>
</CellContents>
</TablixCell>
<TablixCell />
<TablixCell />
<TablixCell />
<TablixCell>
<CellContents>
<Textbox Name="Textbox21">
@@ -887,6 +930,38 @@
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="ReferenciaAdmin">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!ReferenciaAdmin.Value</Value>
<Style>
<FontFamily>Verdana</FontFamily>
<FontSize>7pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>ReferenciaAdmin</rd:DefaultName>
<Style>
<Border>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="SubProyecto">
@@ -1128,6 +1203,40 @@
</TablixCell>
<TablixCell />
<TablixCell />
<TablixCell>
<CellContents>
<Textbox Name="Textbox42">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value />
<Style>
<FontFamily>Verdana</FontFamily>
<FontSize>7pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Right</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox42</rd:DefaultName>
<Style>
<Border>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox12">
@@ -1282,6 +1391,7 @@
<TablixMember />
<TablixMember />
<TablixMember />
<TablixMember />
</TablixMembers>
</TablixColumnHierarchy>
<TablixRowHierarchy>
@@ -1319,8 +1429,8 @@
<KeepTogether>true</KeepTogether>
<DataSetName>DataSet1</DataSetName>
<Top>0.06345cm</Top>
<Height>3cm</Height>
<Width>20.37044cm</Width>
<Height>3.26458cm</Height>
<Width>22.91044cm</Width>
<Style>
<Border>
<Style>None</Style>
@@ -1328,10 +1438,10 @@
</Style>
</Tablix>
</ReportItems>
<Height>1.2061in</Height>
<Height>1.31025in</Height>
<Style />
</Body>
<Width>8.01986in</Width>
<Width>9.01986in</Width>
<Page>
<PageHeader>
<Height>1.14931in</Height>
@@ -1620,6 +1730,10 @@
<DataField>SubProyecto</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="ReferenciaAdmin">
<DataField>ReferenciaAdmin</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
</Fields>
<rd:DataSetInfo>
<rd:DataSetName>DataSet</rd:DataSetName>

View File

@@ -229,8 +229,8 @@
<Sizing>FitProportional</Sizing>
<Top>5.8661in</Top>
<Left>0.03915in</Left>
<Height>1.10236in</Height>
<Width>1.10236in</Width>
<Height>1.1811in</Height>
<Width>1.1811in</Width>
<ZIndex>5</ZIndex>
<Style>
<Border>

View File

@@ -1449,8 +1449,8 @@
<Sizing>FitProportional</Sizing>
<Top>3.09526in</Top>
<Left>0.15526in</Left>
<Height>1.13682in</Height>
<Width>1.49755in</Width>
<Height>1.1811in</Height>
<Width>1.1811in</Width>
<ZIndex>6</ZIndex>
<Style>
<Border>
@@ -1733,7 +1733,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox10</rd:DefaultName>
<Top>4.69042in</Top>
<Top>4.81542in</Top>
<Left>0.09346in</Left>
<Height>2.35306in</Height>
<Width>7.84119in</Width>
@@ -1769,7 +1769,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>ImporteLetra</rd:DefaultName>
<Top>4.24597in</Top>
<Top>4.37097in</Top>
<Left>0.09346in</Left>
<Height>0.24069in</Height>
<Width>7.88716in</Width>

View File

@@ -2833,6 +2833,7 @@
<div class="form-group form-md-line-input input-iconright">
<ADS:DropDownLost ID="DdlPSAjuste" CssStyle="width: 100%;" CssClass=" form-control input-sm DdlPS" IncluyeTodos="false" CssClassDdl="select2me form-control" runat="server" CausesValidation="true" DataTextField="PSCodigo" DataValueField="CvePS" Onselectedindexchange="DdlPSAjuste_selectedindexchange" >
</ADS:DropDownLost>
<asp:HiddenField ID="HdnPSAjusteMarca" ClientIDMode="Static" runat="server" Value="-1" />
<label for="<%= DdlPSAjuste.ClientID.ToString()%>">Producto/Servicio a Recibir:</label>
</div>
</div>
@@ -2876,11 +2877,9 @@
</div>
<div class="row">
<div class="col-md-8">
<div class="form-group form-md-line-input input-iconright">
<div id="DivCodEnsamble" runat="server" class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCodEnsamble" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<asp:RegularExpressionValidator ID="REVCodEnsamble" runat="server" ControlToValidate="TxtCodEnsamble" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Ensamble''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" ValidationExpression="^[0-9][A-HJ-M]([[0-2][0-9]|3[0-1])[0-9A-Z][ACEN][2-5]$"></asp:RegularExpressionValidator>
<%--<asp:RequiredFieldValidator ID="RFVCodEnsamble" runat="server" ControlToValidate="TxtCodEnsamble" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Folio''</b> es necesario, por favor ingréselo." ValidationGroup="VGMAjuste"></asp:RequiredFieldValidator>--%
<%--<ajax:ValidatorCalloutExtender ID="VCECodEnsamble" runat="server" HighlightCssClass="vco" TargetControlID="RFVCodEnsamble"></ajax:ValidatorCalloutExtender>--%>
<asp:CustomValidator id="CVCodEnsamble" runat="server" ControlToValidate="TxtCodEnsamble" ClientValidationFunction="ValidarCodigoEnsamble" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Ensamble''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" />
<label for="<%= TxtCodEnsamble.ClientID.ToString()%>">Cod.Ensamble:</label>
</div>
</div>
@@ -2899,9 +2898,7 @@
<div class="col-md-8">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCodLinea" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<asp:RegularExpressionValidator ID="REVCodLinea" runat="server" ControlToValidate="TxtCodLinea" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Linea''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" ValidationExpression="^[*]$"></asp:RegularExpressionValidator>
<%--<asp:RequiredFieldValidator ID="RFVCodLinea" runat="server" ControlToValidate="TxtCodLinea" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod. Linea''</b> es necesario, por favor ingréselo." ValidationGroup="VGMAjuste"></asp:RequiredFieldValidator>--%>
<%--<ajax:ValidatorCalloutExtender ID="VCECodLinea" runat="server" HighlightCssClass="vco" TargetControlID="RFVCodLinea"></ajax:ValidatorCalloutExtender>--%>
<asp:CustomValidator id="CVCodLinea" runat="server" ControlToValidate="TxtCodLinea" ClientValidationFunction="ValidarCodigoLinea" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Linea''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" />
<label for="<%= TxtCodLinea.ClientID.ToString()%>">Cod.Linea:</label>
</div>
</div>
@@ -2985,14 +2982,8 @@
<ajax:FilteredTextBoxExtender ID="FTBEImporteAjuste" runat="server" TargetControlID="TxtImporteAjuste" FilterType="Custom, Numbers" ValidChars="." />
<label for="<%= TxtImporteAjuste.ClientID.ToString()%>">Importe:</label>
</div>
</div>
<div class="col-md-2">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPagarCliente" CssClass="form-control" runat="server" Enabled="false" MaxLength="50"></asp:TextBox>
<label for="<%= TxtPagarCliente.ClientID.ToString()%>">Importe:</label>
</div>
</div>
<div class="col-md-2">
</div>
<div class="col-md-4">
<asp:Button ID="BtnCalcularImporteAjuste" CssClass="btn green-haze btn-outline btn-circle btn-sm" OnClick="BtnCalcularImporteAjuste_Click" runat="server" Text="Recalcular" />
</div>
</div>
@@ -3023,6 +3014,26 @@
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
function ValidarCodigoEnsamble(source, arguments) {
var CveMarca = HdnPSAjusteMarca.value;
if (CveMarca == "1086") {
var re = new RegExp("^[0-9]+$");
arguments.IsValid = re.test(parseInt(arguments.Value));
} else {
var re = new RegExp("^[0-9][A-HJ-M]([[0-2][0-9]|3[0-1])[0-9A-Z][ACEN][2-5]$");
arguments.IsValid = re.test(arguments.Value);
}
}
function ValidarCodigoLinea(source, arguments) {
var CveMarca = HdnPSAjusteMarca.value;
if (CveMarca == "1086") {
var re = new RegExp("^[0-9]+$");
arguments.IsValid = re.test(parseInt(arguments.Value));
} else {
var re = new RegExp("^[*]$");
arguments.IsValid = re.test(arguments.Value);
}
}
function CalculaMesesUso() {
$get("BtnCalculaMesesUso").click();

View File

@@ -2330,9 +2330,6 @@ Partial Class PV
If Retorno.CveVenta > 0 Then
Dim SbAlert As New StringBuilder
SbAlert.AppendFormat("{0}<br>", Retorno.Mensajes(Retorno.Mensajes.Count - 1))
DescargarFactura(Retorno.CveVenta, UsuarioActual.CveEmpresa)
SbAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta)))
@@ -2343,6 +2340,9 @@ Partial Class PV
Alert(Mensaje, If(Retorno.TieneError, TipoMensaje.MsgError, TipoMensaje.MsgInformacion), If(Retorno.TieneError, "", Retorno.LigaPV))
Next
Dim facBytes = DescargarFactura(Retorno.CveVenta, UsuarioActual.CveEmpresa)
ImprimirbytesPDF(facBytes, ObjFactura.SerieFolio)
End If
End If
@@ -2354,7 +2354,7 @@ Partial Class PV
Using httpClient = New HttpClient()
httpClient.Timeout = New TimeSpan(0, 15, 0)
Using request = New HttpRequestMessage(HttpMethod.Get, Url)
request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CveUsuario={2}", CveEmpresa, DateTime.UtcNow.Ticks, UsuarioActual.CveUsuario)))
request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CveUsuario=100", CveEmpresa, DateTime.UtcNow.Ticks)))
Dim response = httpClient.SendAsync(request).Result
If GetBytes AndAlso response.StatusCode = Net.HttpStatusCode.OK Then
File = response.Content.ReadAsByteArrayAsync().Result
@@ -5246,14 +5246,7 @@ Partial Class PV
DdlTipoUso.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlTipoUso.DataBind()
'si la marca es optima, el codigo cambia a solo numerico
If CveMarca = 1086 Then
REVCodEnsamble.ValidationExpression = "^[0-9]$"
REVCodLinea.ValidationExpression = "^[0-9]$"
Else
REVCodEnsamble.ValidationExpression = "^[0-9][A-HJ-M]([[0-2][0-9]|3[0-1])[0-9A-Z][ACEN][2-5]$"
REVCodLinea.ValidationExpression = "^[*]$"
End If
HdnPSAjusteMarca.Value = CveMarca.ToString()
End If
@@ -5261,6 +5254,8 @@ Partial Class PV
TxtPUFactura.Text = ""
End If
CalculaPorcentajeAjuste()
End Sub
@@ -5528,13 +5523,7 @@ Partial Class PV
TmpDTPolizaVirtual.Columns.Add("CveBCIUsado", GetType(Integer))
End Sub
Private Function AddPolizaVirtual(CvePS As Integer) As Boolean
Dim Retorno As Boolean = False
'Dim CvePS As Integer = DdlPS.SelectedValue.ToEntero()
Dim Cantidad As Decimal = TxtCantidad.Text.ToDecimal()
Dim PU As Decimal = TxtPrecio.Text.ToDecimal()
Dim Descuento As Decimal = TxtDescuento.Text.ToDecimal()
Dim ImporteAjuste As Decimal = TxtImporteAjuste.Text.ToDecimal().RoundSQL(2)
Dim Retorno As Boolean = True
If Modalidad = "U" Then
If TmpDTRecepcionUsados.Rows.Count > 0 Then
@@ -5551,18 +5540,35 @@ Partial Class PV
End If
End If
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
If DrPS IsNot Nothing Then
'SOLO DEBE AGREGAR POLIZA VIRTUAL SI ES ACUMULADOR
If Not DrPS("CveClasificacion").ToString().ToEntero().Contiene(20520, 20522, 20513, 20511, 20521, 20512, 20514, 20229) Then
Return Retorno
End If
Else
Retorno = False
Return Retorno
End If
Dim Cantidad As Decimal = TxtCantidad.Text.ToDecimal()
Dim PU As Decimal = TxtPrecio.Text.ToDecimal()
Dim Descuento As Decimal = TxtDescuento.Text.ToDecimal()
Dim ImporteAjuste As Decimal = TxtImporteAjuste.Text.ToDecimal().RoundSQL(2)
Dim Total As Decimal = ((Cantidad * PU) - Descuento).RoundSQL(2)
Dim TipoServicio As Integer = DdlTipoServicio.SelectedValue.ToEntero()
Dim FechaUsado As DateTime = TxtFechaAjuste.Text.ToDateTime()
Dim CveModeloAuto As Integer = DdlModeloAuto.SelectedValue.ToEntero()
Dim AnioVehiculo As Integer = TxtAnioVehiculo.Text.ToEntero()
Dim TipoPoliza As Integer = 1
Dim TipoPoliza As Integer = 1 'VENTA
If ChkAjuste.Checked Then
If Total = ImporteAjuste Then
TipoPoliza = 3
TipoPoliza = 3 'GARANTIA
Else
TipoPoliza = 2
TipoPoliza = 2 'AJUSTE
End If
End If
@@ -5574,7 +5580,7 @@ Partial Class PV
For Each GvRow As GridViewRow In GvRecepcionUsados.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
If GvRow.FCTextBox("TxtCantidad").Text.ToDecimal() > 0 Then
CvePS = GvRow.DataKey("CvePSCargo").ToEntero()
CvePSUsado = GvRow.DataKey("CvePSCargo").ToEntero()
CveBCIUsado = GvRow.FCDropDownList("DdlBCIUsado").SelectedValue.ToEntero()
Exit For

View File

@@ -357,14 +357,18 @@
<asp:LinkButton runat="server" ID="LnkImprimirFormatoCicovisa" Visible="false" OnClick="LnkImprimirFormatoCicovisa_Click">Imprimir Formato Cicovisa</asp:LinkButton>
</li>
<li>
<asp:LinkButton runat="server" ID="LnkEnviarPolizaVirtual" Visible="false" OnClick="LnkEnviarPolizaVirtual_Click">Enviar Poliza Virtual</asp:LinkButton>
<asp:LinkButton runat="server" ID="LnkEnviarPolizaVirtual" Visible="false" OnClick="LnkEnviarPolizaVirtual_Click">Enviar Póliza Virtual</asp:LinkButton>
</li>
<%-- <li>
<asp:LinkButton runat="server" ID="LnkDescargarFacturaPrueba" OnClick="LnkDescargarFacturaPrueba_Click">Descargar Factura Prueba</asp:LinkButton>
</li>--%>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="LnkImprimir" EventName="Click" />
<asp:PostBackTrigger ControlID="BtnContabilizar" />
<asp:PostBackTrigger ControlID="BtnContabilizar" />
<asp:PostBackTrigger ControlID="LnkImprimirFormatoCicovisa" />
<%-- <asp:PostBackTrigger ControlID="LnkDescargarFacturaPrueba" />--%>
<%-- <asp:PostBackTrigger ControlID="LbDescargarExcel" />--%>
</Triggers>
</asp:UpdatePanel>
@@ -620,7 +624,7 @@
<td><b>Fecha:</b></td>
<td>
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 117px !important; padding: 0px;">
<asp:TextBox ID="TxtFecha" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<asp:TextBox ID="TxtFecha" runat="server" AutoPostBack="true" CssClass="form-control" CausesValidation="true" MaxLength="10" OnTextChanged="TxtFecha_TextChanged"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFecha" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>

View File

@@ -4297,6 +4297,10 @@ Partial Class Ventas
End If
End If
If UsuarioActual.CveEmpresa = 48 Then
TxtFecha.AutoPostBack = True
End If
CargaCodigoUnico()
UpPS.Update()
@@ -24038,8 +24042,16 @@ Partial Class Ventas
Dim Retorno As Boolean = False
Dim Respuesta As String = "[]"
Dim User As String = "cslth.7777@lth.com"
Dim Password As String = "ff31580a95f36b51ad27f970428b77a5a9245076"
Dim User As String = ""
Dim Password As String = ""
If UsuarioActual.Empresa.FacturaProduccion Then
User = "cslth.2809@jcilink.com"
Password = "ff31580a95f36b51ad27f970428b77a5a9245076"
Else
User = "cslth.7777@lth.com"
Password = "ff31580a95f36b51ad27f970428b77a5a9245076"
End If
Try
Using wc As New HttpClient()
@@ -24086,22 +24098,28 @@ Partial Class Ventas
If resp.Count > 0 Then
Dim Msg As New StringBuilder()
Msg.AppendFormat("Mensaje Poliza Virtual: {0}", resp(0)("Descripcion").ToString())
Msg.AppendFormat("Mensaje Póliza Virtual: {0}", resp(0)("Descripcion").ToString())
If resp(0)("Codigo").ToString().Contiene("500", "501", "502", "503", "504", "505", "506", "507", "508") Then
Retorno = True
Dim ObjAcum As New ClsAcumuladores
If ObjAcum.UpdateEnvioPolizaVirutal(CvePolizaVirtual, True, Now) Then
If ObjAcum.UpdateEnvioPolizaVirutal(CvePolizaVirtual, True, Now, obj.product_unique_code) Then
Alert(Msg.ToString(), TipoMensaje.MsgInformacion)
End If
ObjAcum.Dispose()
Else
Dim ObjAcum As New ClsAcumuladores
If ObjAcum.UpdateEnvioPolizaVirutal(CvePolizaVirtual, False, Now) Then
If ObjAcum.UpdateEnvioPolizaVirutal(CvePolizaVirtual, False, Now, obj.product_unique_code) Then
Alert(Msg.ToString(), TipoMensaje.MsgAdvertencia)
End If
ObjAcum.Dispose()
End If
Dim ObjEventos As New ClsOIEventos()
If Not ObjEventos.AddEventoBitacora(Msg.ToString(), "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=Me.CveVenta) Then
ErrorList.Add("Ocurrió un error al agregar la bitacora de Póliza Virtual.")
End If
ObjEventos.Dispose()
Else
Alert("No se envió la poliza virtual", TipoMensaje.MsgAdvertencia)
End If
@@ -24166,4 +24184,79 @@ Partial Class Ventas
End Sub
Protected Sub TxtFecha_TextChanged(sender As Object, e As EventArgs)
'SI USUARIO USA AMORTIZACIÓN CONTABLE, se carga las tablas para usarlas mas adelante
If UsuarioActual.CveEmpresa = 48 AndAlso UsuarioActual.Empresa.UsaAC Then
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Rem"))
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Cot"))
DdlTipoComprobante.Items.Add(New ListItem("Compromisos", "Com"))
DdlTipoComprobante.Items.Add(New ListItem("Orden Pago", "OP"))
Dim AC As New ClsAC
If AC.GetPresupuestoIngresos(-1, TxtFecha.Text.ToDateTime().Year, True, UsuarioActual.CveEmpresa) Then
DdlFuenteRecaudacion.DataSource = AC.DtResultados()
DTPresupuestoIngresos = AC.DtResultados()
ViewState("DTFuenteRecaudacion") = AC.DtResultados()
'GenerarPolizasAC()
End If
AC.Dispose()
'columna de Fuente de recaudacion
GvPS.Columns(21).Visible = True
nomostrar.Visible = True
nomostrar2.Visible = True
'GvPS.Width = 1250
DdlFuenteRecaudacion.DataBind()
Else
TFuenteRecaudacion.Visible = False
End If
End Sub
'Protected Sub LnkDescargarFacturaPrueba_Click(sender As Object, e As EventArgs)
' 'Dim Hilo As New System.Threading.Thread(Sub() DescargarFactura(Me.CveVenta, UsuarioActual.CveEmpresa))
' 'Hilo.Start()
' Dim facBytes = DescargarFactura(Me.CveVenta, UsuarioActual.CveEmpresa)
' ImprimirbytesPDF(facBytes, "Factura")
'End Sub
'Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer) As Byte()
' Dim Url = New Uri(String.Format("{0}Compras/PopUpVerFactura.aspx?P={1}", "https://sig.adssistemas.mx/", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta))))
' Dim File As Byte() = Nothing
' Try
' Using httpClient = New HttpClient()
' httpClient.Timeout = New TimeSpan(0, 15, 0)
' Using request = New HttpRequestMessage(HttpMethod.Get, Url)
' request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CVEUSUARIO=100", CveEmpresa, DateTime.UtcNow.Ticks)))
' Dim response = httpClient.SendAsync(request).Result
' If response.StatusCode = Net.HttpStatusCode.OK Then
' File = response.Content.ReadAsByteArrayAsync().Result
' End If
' End Using
' End Using
' Catch ex As Exception
' File = Nothing
' OnError("Ocurrió un error al descargar la factura", ex)
' End Try
' Return File
'End Function
'Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer, Optional GetBytes As Boolean = True) As Byte()
' Dim Url = New Uri(String.Format("http://{0}:{1}/Compras/PopUpVerFactura.aspx?P={2}", HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port, Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta))))
' Dim File As Byte() = Nothing
' Try
' Using httpClient = New HttpClient()
' httpClient.Timeout = New TimeSpan(0, 15, 0)
' Using request = New HttpRequestMessage(HttpMethod.Get, Url)
' request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CveUsuario=100", CveEmpresa, DateTime.UtcNow.Ticks)))
' Dim response = httpClient.SendAsync(request).Result
' If GetBytes AndAlso response.StatusCode = Net.HttpStatusCode.OK Then
' File = response.Content.ReadAsByteArrayAsync().Result
' End If
' End Using
' End Using
' Catch ex As Exception
' File = Nothing
' OnError("Ocurrió un error al descargar la factura", ex)
' End Try
' Return File
'End Function
End Class