This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2019-12-11 18:53:36 -07:00
12 changed files with 363 additions and 100 deletions

View File

@@ -700,7 +700,7 @@ Public Class ClsAcumuladores
#Region "GARANTIAS DETALLES"
Public Function AddGarantiasDetalle(CveVentaDetalle As Integer, CveFolioGarantia As Integer, CveTipoUso As Integer,
Public Function AddGarantiasDetalle(CveVentaDetalle As Integer, CvePS As Integer, CveFolioGarantia As Integer, CveTipoUso As Integer,
CodigoEnsamble As String, CodigoLinea As String, CodigoInspeccion As String,
CveTipoDefecto As Integer, NumPoliza As String, Importe As Double,
Consecutivo As String) As Boolean
@@ -708,6 +708,7 @@ Public Class ClsAcumuladores
SqlDataAdapter("PA_Acum_GarantiasDetalleAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveVentaDetalle", SqlDbType.Int).Value = CveVentaDetalle
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@CveFolioGarantia", SqlDbType.Int).Value = CveFolioGarantia
.Add("@CveTipoUso", SqlDbType.Int).Value = CveTipoUso
.Add("@CodigoEnsamble", SqlDbType.VarChar).Value = CodigoEnsamble
@@ -893,6 +894,33 @@ Public Class ClsAcumuladores
End Function
Public Function GetRepInicadorDiario(FechaInicio As Date, FechaFin As Date, CveSubProeycto As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
SqlDataAdapter("PA_Acum_RepInicadorDiarioGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin
.Add("@CveSubProeycto", SqlDbType.Int).Value = CveSubProeycto
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As SqlException
OnError("Ocurrió un error al consultar los datos. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
#Region " IDisposable Support "

View File

@@ -4581,6 +4581,7 @@ Public Class ClsPaginas
PaginaDict.Add("/Acumuladores/CatTiposUso.aspx".ToUpper(), 1034)
PaginaDict.Add("/Acumuladores/CatFoliosGarantia.aspx".ToUpper(), 1035)
PaginaDict.Add("/Acumuladores/CatGarantiasMeses.aspx".ToUpper(), 1036)
PaginaDict.Add("/Acumuladores/RepIndicadorDiario.aspx".ToUpper(), 2055)
'PaginaDict.Add("/Acumuladores/EntradasUsados.aspx".ToUpper(), 543)
PaginaDict.Add("/Acumuladores/EntradasUsadosResumenRep.aspx".ToUpper(), 1032)

View File

@@ -2344,13 +2344,14 @@ Public Class ClsVentas
#Region " ANTICIPOS/NOTASCREDITO - VENTAS "
Public Function GetVentasAntNC(CveVenta As Integer, CveVentaNC As Integer) As Boolean
Public Function GetVentasAntNC(CveVenta As Integer, CveVentaNC As Integer, Optional AplicaAmortizacion As Boolean = False) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasAntNCGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
.Add("@CveVentaNC", SqlDbType.Int).Value = CveVentaNC
.Add("@AplicaAmortizacion", SqlDbType.Bit).Value = AplicaAmortizacion
End With
Try

View File

@@ -491,6 +491,10 @@ Namespace Modelos
If ObjVentas.GetVentasAntNC(-1, CveVenta) Then
Me.DtNCVinculadas = ObjVentas.DtResultados.Copy()
End If
If ObjVentas.GetVentasAntNC(-1, CveVenta, AplicaAmortizacion:=EsNCAmortizacion) Then
Me.DtAnticipos = ObjVentas.DtResultados.Copy()
End If
End If
End If
@@ -501,12 +505,6 @@ Namespace Modelos
ObjVentas.Dispose()
'Dim ObjMovtos As New ClsMovimientos()
'If ObjMovtos.GetAnticiposNCIxCCliente(CveCliente, CveMoneda) Then
' Me.DtAnticipos = ObjMovtos.DtResultados.FiltraParametros($"Saldo > 0 AND SaldoSubtotal > 0 {If(CveVenta < 0, "AND Tipo = 'Ant'", "")} {If(TipoDocto = "Ant", "AND Tipo = 'NC'", "")}")
'End If
'ObjMovtos.Dispose()
If Me.RealizarDevolucionAlmacen Then
Me.CveAlmacenDevolucion = Me.CveAlmacenDevolucionVenta
End If
@@ -1349,7 +1347,7 @@ Namespace Modelos
'Ajustes'
If DtAjustes IsNot Nothing AndAlso DtAjustes.Rows.Count > 0 Then
For Each Dr As DataRow In DtAjustes.Rows
If Not ObjAcum.AddGarantiasDetalle(Dr("CveVentaDetalle").ToString.ToEntero, Dr("CveFolioGarantia").ToString.ToEntero, Dr("CveTipoUso").ToString.ToEntero,
If Not ObjAcum.AddGarantiasDetalle(Dr("CveVentaDetalle").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("CveFolioGarantia").ToString.ToEntero, Dr("CveTipoUso").ToString.ToEntero,
Dr("CodigoEnsamble").ToString, Dr("CodigoLinea").ToString, Dr("CodigoInspeccion").ToString, Dr("CveTipoDefecto").ToString.ToEntero,
Dr("NumPoliza").ToString, Dr("Importe").ToString.ToDouble, Dr("Consecutivo").ToString) Then
ErrorList.Add("Ocurrió un error al agregar la garantia detalle.")
@@ -2335,12 +2333,12 @@ Namespace Modelos
Exit Select
End If
If ObjFactura.TipoDocto = "Ing" AndAlso ValorMultiplicador = -1 Then
For Each row2 As DataRow In ObjFactura.DtAntNCVinculadas.Rows
If ObjFactura.TipoDocto.Contiene("Ing", "Egs") AndAlso ValorMultiplicador = -1 Then
For Each row2 As DataRow In ObjFactura.DtAnticipos.Rows
If row2("CveConceptoContable").ToString().ToEntero = 11 Then
importeMovimiento = row2("Importe").ToString().ToDecimal * ValorMultiplicador '- ((row2.FCTextBox("TxtAnticipo" & row2.RowIndex).Text.ToDecimal / row2.DataKey("TotalAnticipo").ToDecimal) * row2.DataKey("IVAAnticipo").ToDecimal)
If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}"
CveIEAnticipo = -1
IdCtaContable = ObjFactura.Cliente.IdCtaContAnticipos
CveCuenta = ObjFactura.Cliente.CveCuentaAnticipos
CveSubProyectoContabilizar = CveSubProyectoVenta
@@ -2358,38 +2356,40 @@ Namespace Modelos
Next
End If
'cuando es anticipo
' cuando es amortización de nota de crédito, y es la nc
' cuando es amortización por descuento, y es el ingreso
' cuando es amortización en cero
If ObjFactura.CveTipoAmortizacionAnticipo = 2 AndAlso ObjFactura.TipoDocto.Contiene("Egs") OrElse
ObjFactura.CveTipoAmortizacionAnticipo = 1 AndAlso ObjFactura.TipoDocto.Contiene("Ing") OrElse
ObjFactura.CveTipoAmortizacionAnticipo = 3 Then
For Each row2 As DataRow In ObjFactura.DtAnticipos.Rows
If row2("CveConceptoContable").ToString().ToEntero = 3 Then
CveIEAnticipo = row2("CveIE").ToString.ToEntero
importeMovimiento = row2("Importe").ToString().ToDecimal() '- ((row2.FCTextBox("TxtAnticipo" & row2.RowIndex).Text.ToDecimal / row2.DataKey("TotalAnticipo").ToDecimal) * row2.DataKey("IVAAnticipo").ToDecimal)
If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}"
IdCtaContable = ObjFactura.Cliente.IdCtaContAnticipos
CveCuenta = ObjFactura.Cliente.CveCuentaAnticipos
CveSubProyectoContabilizar = CveSubProyectoVenta
If importeMovimiento <> 0 Then
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=row2("CveVenta").ToString.ToEntero,
CveVentaAmortizacion:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIEAnticipo,
ImporteMX:=importeMovimiento * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuenta,
CveSubProyecto:=CveSubProyectoContabilizar) Then
ErrorPrepoliza = True
Exit For
Else
ObjFactura.SeGuardoPrePoliza = True
End If
End If
End If
Next
If ValorMultiplicador = 1 Then
'cuando es anticipo
' cuando es amortización de nota de crédito, y es la nc
' cuando es amortización por descuento, y es el ingreso
' cuando es amortización en cero
If ObjFactura.CveTipoAmortizacionAnticipo = 2 AndAlso ObjFactura.TipoDocto.Contiene("Egs") OrElse
ObjFactura.CveTipoAmortizacionAnticipo = 1 AndAlso ObjFactura.TipoDocto.Contiene("Ing") OrElse
ObjFactura.CveTipoAmortizacionAnticipo = 3 Then
For Each row2 As DataRow In ObjFactura.DtAnticipos.Rows
If row2("CveConceptoContable").ToString().ToEntero = 11 Then
CveIEAnticipo = -1
importeMovimiento = row2("Importe").ToString().ToDecimal()
If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}"
IdCtaContable = ObjFactura.Cliente.IdCtaContAnticipos
CveCuenta = ObjFactura.Cliente.CveCuentaAnticipos
CveSubProyectoContabilizar = CveSubProyectoVenta
If importeMovimiento <> 0 Then
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta,
CveVentaAmortizacion:=row2("CveVenta").ToString.ToEntero, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIEAnticipo,
ImporteMX:=importeMovimiento * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuenta,
CveSubProyecto:=CveSubProyectoContabilizar) Then
ErrorPrepoliza = True
Exit For
Else
ObjFactura.SeGuardoPrePoliza = True
End If
End If
End If
Next
End If
End If
'Cuando la funcionalidad de amortizacion en PS esta activa
If Not ErrorPrepoliza Then
DT = TmpDTDetalle.FiltraParametros($"CvePS = {ObjFactura.CvePSAmortizacion}")
@@ -2667,7 +2667,7 @@ Namespace Modelos
importeMovimiento = 0
Case 150 'Descuento sobre ventas
If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then
If ObjFactura.TipoDocto.Contiene("Egs", "Dev") AndAlso Not EsNCAmortizacion Then
Dim ConceptoContableAplicar = 150
Dim CveVentaAplicar = ObjFactura.CveVenta
@@ -3859,7 +3859,7 @@ Namespace Modelos
End If
If ObjFactura.TipoDocto = "Ant" AndAlso ObjFactura.SaldoAmortizado > 0 Then
Retorno.Mensaje = "La factura no se puede cancelar debido a que esta amortizada."
Retorno.Mensaje = "La factura no se puede cancelar debido a que tiene pagos vinculados."
Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia
Return Retorno
@@ -5554,6 +5554,7 @@ Namespace Modelos
Public Property CveVentaRelacion As Integer = -1
Public Property ImporteRelacion As Decimal
Public Property EsNCAmortizacion As Boolean
#End Region
@@ -9746,6 +9747,119 @@ Namespace Modelos
Public Property RequierePersonal As Boolean
Public Property EsAcumulador As Boolean
End Class
#End Region
#Region "P O L I Z A - V I R T U A L"
Public Class MPolizaVentaLTHWSD
Public Property customer_name As String
Public Property customer_last_name1 As String
Public Property customer_last_name2 As String
Public Property customer_birthday As DateTime
Public Property customer_phone As String
Public Property customer_email As String
Public Property customer_gender As String
Public Property customer_advertising As Boolean
Public Property sale_date As DateTime
Public Property sale_paidby As String
Public Property sale_type As String
Public Property sale_type_service As String
Public Property product_code As String
Public Property product_unique_code As String
Public Property product_sale_type As String
Public Property used_product As Boolean
Public Property used_brand As String
Public Property used_bci As String
Public Property used_month As Integer
Public Property used_year As Integer
Public Property used_sale_date As DateTime
Public Property customer_car_brand As String
Public Property customer_car_model As String
Public Property customer_car_year As Integer
Public Property sale_discount As Decimal
Public Property sale_id As String
End Class
Public Class MPolizaVentaWS
Public Property customer_name As String
Public Property customer_last_name1 As String
Public Property customer_last_name2 As String
Public Property customer_birthday As DateTime
Public Property customer_phone As String
Public Property customer_email As String
Public Property customer_gender As String
Public Property customer_advertising As Boolean
Public Property sale_date As DateTime
Public Property sale_paidby As String
Public Property sale_type As String
Public Property sale_type_service As String
Public Property sale_total As Decimal
Public Property product_code As String
Public Property product_unique_code As String
Public Property product_sale_type As String
Public Property used_product As Boolean
Public Property used_brand As String
Public Property used_bci As String
Public Property used_month As Integer
Public Property used_year As Integer
Public Property used_sale_date As DateTime
Public Property customer_car_brand As String
Public Property customer_car_model As String
Public Property customer_car_year As Integer
Public Property sale_discount As Decimal
Public Property sale_id As String
End Class
Public Class MIndicador
Sub New(Optional UsaValoresPrueba As Boolean = False)
If UsaValoresPrueba Then
Dim Index As Integer = 0
For Each p As Reflection.PropertyInfo In Me.GetType().GetProperties()
Index = Index + 1
p.SetValue(Me, Convert.ChangeType(Index, p.PropertyType), Nothing)
Next
End If
End Sub
Public Property v_b_optima As Integer
Public Property v_b_fullpower As Integer
Public Property v_b_hitec As Integer
Public Property v_b_agm As Integer
Public Property v_b_suv As Integer
Public Property v_b_taxi As Integer
Public Property v_b_america As Integer
Public Property v_b_lth As Integer
Public Property v_b_cronos As Integer
Public Property v_b_diener As Integer
Public Property v_b_heavyduty As Integer
Public Property v_m_lth As Integer
Public Property v_o_filtros As Integer
Public Property v_o_lub1 As Integer
Public Property v_o_lubgalon As Integer
Public Property v_o_lub5 As Integer
Public Property v_o_aa As Integer
Public Property v_o_aaa As Integer
Public Property g_b_optima As Integer
Public Property g_b_fullpower As Integer
Public Property g_b_hitec As Integer
Public Property g_b_agm As Integer
Public Property g_b_suv As Integer
Public Property g_b_taxi As Integer
Public Property g_b_america As Integer
Public Property g_b_lth As Integer
Public Property g_b_cronos As Integer
Public Property g_b_diener As Integer
Public Property g_b_heavyduty As Integer
Public Property g_m_lth As Integer
Public Property a_b_optima As Integer
Public Property a_b_fullpower As Integer
Public Property a_b_hitec As Integer
Public Property a_b_agm As Integer
Public Property a_b_suv As Integer
Public Property a_b_taxi As Integer
Public Property a_b_america As Integer
Public Property a_b_lth As Integer
Public Property a_b_cronos As Integer
Public Property a_b_diener As Integer
Public Property a_b_heavyduty As Integer
End Class
#End Region
End Namespace

View File

@@ -371,15 +371,15 @@ Partial Class General_SaldosIniciales
Exit Sub
End If
If Not dt.Columns(12).ColumnName = "Servicio" Then
Alert("El nombre de la treceava columna debe ser 'Servicio'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
'If Not dt.Columns(12).ColumnName = "Servicio" Then
' Alert("El nombre de la treceava columna debe ser 'Servicio'. Favor de corregirlo", TipoMensaje.MsgError)
' Exit Sub
'End If
If Not dt.Columns(13).ColumnName = "Conversion Unidad" Then
Alert("El nombre de la catorceava columna debe ser 'Conversion Unidad'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
'If Not dt.Columns(13).ColumnName = "Conversion Unidad" Then
' Alert("El nombre de la catorceava columna debe ser 'Conversion Unidad'. Favor de corregirlo", TipoMensaje.MsgError)
' Exit Sub
'End If
ElseIf RblFormato.SelectedValue = "6" Then
If Not dt.Columns(0).ColumnName = "Código" Then
@@ -669,8 +669,8 @@ Partial Class General_SaldosIniciales
Dim IEPS As Decimal = Row("IEPS").ToString.ToDecimal
Dim Tamaño As String = Row("Tamaño").ToString.Trim
Dim SATClavePS As String = Row("Código SAT").ToString.Trim
Dim Clasificacion2 As String = Row("Servicio").ToString.Trim
Dim Litraje As Double = Row("Conversion Unidad").ToString.ToDouble
Dim Clasificacion2 As String = If(dt.Columns.Contains("Servicio"), Row("Servicio").ToString.Trim, "")
Dim Litraje As Double = If(dt.Columns.Contains("Conversion Unidad"), Row("Conversion Unidad").ToString.ToDouble, 0)
Dim RinTamaño As String = If(Row.Table.Columns.Contains("Tamaño de Rin"), Row("Tamaño de Rin").ToString.Trim, "")
Dim Medida As String = If(Row.Table.Columns.Contains("Medida"), Row("Medida").ToString.Trim, "")
Dim SATClaveUnidadMedida As String = If(Row.Table.Columns.Contains("Clave Unidad"), Row("Clave Unidad").ToString.Trim, "")

View File

@@ -336,7 +336,7 @@
<div id="DivVirtualAdvertencia" visible="false" 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>
<strong style="font-size: 20px; margin-right: 25px;">Información: </strong>
<asp:Literal Text="" runat="server" ID="Literal1"></asp:Literal>
<asp:Literal Text="La mercancía sera trasladada al almacén virtual" runat="server"></asp:Literal>
</div>
</div>
</div>

View File

@@ -99,6 +99,7 @@ Partial Class RH_CatPersonalRequerido
End Sub
Private Sub CargaDepartamento()
DdlDepartamento.Items.Clear()
DdlDepartamento.DataSource = GlobalDTDepartamentos.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
DdlDepartamento.DataBind()
End Sub

View File

@@ -105,7 +105,8 @@
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GVRegDatos" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron registros" ToolTip="Listado de Personal" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" Style="margin-top: -10px; text-align: center;" GridLines="None">
<asp:GridView ID="GVRegDatos" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron registros" ToolTip="Listado de Personal" DataKeyNames="SubProyecto"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" Style="margin-top: -2px; text-align: center;" GridLines="None">
<Columns>
<asp:BoundField HeaderText ="Proyecto" DataField="proyecto" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText ="Subproyecto" DataField="Subproyecto" ItemStyle-HorizontalAlign="Left" />

View File

@@ -108,7 +108,8 @@ Partial Class Ventas_RepIndiceRotacionPersonal
Protected Sub GVRegDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GVRegDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowType = DataControlRowType.DataRow Then
If Not (e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5) Then
Dim sPorcentaje As String = e.Row.DBCampo("IRP").Trim
@@ -124,12 +125,15 @@ Partial Class Ventas_RepIndiceRotacionPersonal
e.Row.FCLabel("LblIrp").CssClass = "label label-success"
ElseIf (porcentaje > 15.0 And porcentaje <= 30.0) Then
e.Row.FCLabel("LblIrp").CssClass = "label label-warning"
End If
End If
End If
End If
If e.Row.DataKey("SubProyecto").ToString.Trim = "" Then
e.Row.CssClass = "SubTotales"
' e.Row.Attributes.Add("class", "SubTotales")
End If
End If

View File

@@ -1071,7 +1071,7 @@ Partial Class PV
CargaSucursales()
CargaClasificaciones()
CargaPS(-1, DdlPS)
CargaPS(-1, DdlPSAjuste)
CargaPS(-1, DdlPSAjuste, AplicaAlmacen:=False)
CargaEmpresa()
CreaDTVentas()
CargaMetodosPago()
@@ -1866,7 +1866,7 @@ Partial Class PV
End If
DdlClasificacion.DataBind()
End Sub
Private Sub CargaPS(CveClasificacion As Integer, Objeto As ADServerControl.Dropdownlost)
Private Sub CargaPS(CveClasificacion As Integer, Objeto As ADServerControl.Dropdownlost, Optional AplicaAlmacen As Boolean = True)
Objeto.setEsWebService(UsuarioActual.Empresa.Funcionalidad(141).ToString = "1")
If Not UsuarioActual.Empresa.Funcionalidad(141).ToString = "1" Then
Objeto.ddl.Items.Clear()
@@ -1877,7 +1877,11 @@ Partial Class PV
Else
Objeto.Attributes.Add("data-cvesubproyecto", DdlSubProyectoDatos.SelectedValue)
Objeto.ddlWS.Attributes.Add("data-cveclasificacion", CveClasificacion.ToString)
Objeto.ddlWS.Attributes.Add("data-pagina", "ventas/ventas")
If AplicaAlmacen Then
Objeto.ddlWS.Attributes.Add("data-pagina", "ventas/ventas")
Else
Objeto.ddlWS.Attributes.Add("data-pagina", "-1")
End If
Objeto.ddlWS.Attributes.Add("data-Estatus", "1")
End If
End Sub

View File

@@ -1003,8 +1003,8 @@
</table>
<%--</asp:Panel>--%>
<asp:GridView ID="GvPS" GridLines="None" runat="server" data-tableheader="#tbps" ShowHeader="true" AutoGenerateColumns="False"
DataKeyNames="Consec,CvePS,Total, IEPS, CveClasificacion,CveUM,CveProyecto,CveSubProyecto,TipoDocto,PS,Obs,Cantidad,PU,Descuento,IVA,CantidadInventario,CantidadFacturadaRem,CveVentaDetalle"
<asp:GridView ID="GvPS" GridLines="None" runat="server" data-tableheader="#tbps" ShowHeader="true" AutoGenerateColumns="False"
DataKeyNames="Consec,CvePS,Total, IEPS, CveClasificacion,CveUM,CveProyecto,CveSubProyecto,TipoDocto,PS,Obs,Cantidad,PU,Descuento,IVA,CantidadInventario,CantidadFacturadaRem,CveVentaDetalle"
CssClass="table table-striped table-advance table-hover Widthall Sortable mysmallbtn ScrollAD" Style="min-width: 980px;">
<Columns>
<%--0--%>
@@ -1287,12 +1287,12 @@
<div class="col-md-6 ">
<div class="row">
<div class="col-md-6">
<table id="TbDescuentosRNC" border="0" rules="none" class="well TextTab" style="float: right;" runat="server" visible="false">
<table id="TbDescuentosRNC" border="0" rules="none" class="well TextTab" style="float: right;" runat="server" visible="false">
<tr align="right">
<td style="border: 1px none white"><b>Descuentos. RNC.:</b></td>
<td>
<asp:Label ID="LblDescuentosRNC" ClientIDMode="Static" runat="server" Style="text-align: right;" Text="0.00" Width="78px"></asp:Label></td>
<td align="right">&nbsp;<asp:LinkButton ID="LnkDescuentosRNC" runat="server" OnClick="LnkDescuentosRNC_Click" Text="<i class='fa fa-tag fa-lg font-green'></i>" AlternateText="Aplicacion de RNC" Style="cursor: pointer;" />
<td align="right">&nbsp;<asp:LinkButton ID="LnkDescuentosRNC" runat="server" OnClick="LnkDescuentosRNC_Click" Text="<i class='fa fa-tag fa-lg font-green'></i>" AlternateText="Aplicacion de RNC" Style="cursor: pointer;" />
</td>
</tr>
<tr align="right">
@@ -5873,8 +5873,7 @@
<div class="col-md-2">
</div>
<div class="col-md-4">
<asp:Button ID = "BtnModalAplicarRemisionesNC" runat="server" OnClick="BtnModalAplicarRemisionesNC_Click" class="btn btn-primary" data-toggle="modal" data-target="#ModalAplicarRemisionesNC"/>
<asp:Button ID="BtnModalAplicarRemisionesNC" Text="Aplicar Remisiones" runat="server" OnClick="BtnModalAplicarRemisionesNC_Click" class="btn btn-primary" />
</div>
<div class="col-md-6">
</div>
@@ -6354,7 +6353,7 @@
</div>
</div>
<%--APLICAR REMISIONES DE NC--%>
<div id="ModalAplicarDescuentoNC" class="modal ADS fade" role="dialog">
<asp:UpdatePanel ID="UpDescNC" class="modal-dialog rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
@@ -7544,28 +7543,34 @@
$('#divAgregarCliente').modal('hide');
}
function CompararNC() {
var TotalRem = ToDouble(document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').value);
var TotalNC = ToDouble(document.getElementById('<%= TxtNCImporte.ClientID %>').value);
if (TotalRem == TotalNC) {
document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').style.border = "2px solid #04B431";
document.getElementById('<%= TxtNCImporte.ClientID %>').style.border = "2px solid #04B431";
document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').style.color = "";
document.getElementById('<%= TxtNCImporte.ClientID %>').style.color = "";
}
else {
document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').style.border = "2px solid #ff0000";
document.getElementById('<%= TxtNCImporte.ClientID %>').style.border = "2px solid #ff0000";
document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').style.color = "#ff0000";
document.getElementById('<%= TxtNCImporte.ClientID %>').style.color = "#ff0000";
}
var ValidarRNC = false;
function AplicarValidarRNC(Valor)
{
ValidarRNC = Valor;
}
function CompararNC() {
if (ValidarRNC) {
var TotalRem = ToDouble(document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').value);
var TotalNC = ToDouble(document.getElementById('<%= TxtNCImporte.ClientID %>').value);
function CerrarModalRemNC() {
if ('<%= UsuarioActual.Empresa.Funcionalidad(344) %>' == '1') {
if (TotalRem == TotalNC) {
document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').style.border = "2px solid #04B431";
document.getElementById('<%= TxtNCImporte.ClientID %>').style.border = "2px solid #04B431";
document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').style.color = "";
document.getElementById('<%= TxtNCImporte.ClientID %>').style.color = "";
} else {
document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').style.border = "2px solid #ff0000";
document.getElementById('<%= TxtNCImporte.ClientID %>').style.border = "2px solid #ff0000";
document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').style.color = "#ff0000";
document.getElementById('<%= TxtNCImporte.ClientID %>').style.color = "#ff0000";
}
}
}
function CerrarModalRemNC() {
if ('<%= UsuarioActual.Empresa.Funcionalidad(344) %>' == '1') {
AplicarValidarRNC(true);
CompararNC();
}
$('#ModalAplicarRemisionesNC').modal('hide');

View File

@@ -8,6 +8,7 @@ Imports System.Xml
Imports Microsoft.Reporting.WebForms
Imports System.Security.Cryptography.X509Certificates
Imports System.Globalization
Imports System.Net.Http
Partial Class Ventas
Inherits ClsPaginas
@@ -6731,6 +6732,12 @@ Partial Class Ventas
End If
End If
End If
'ENVIAR POLIZA VIRTUAL
If ErrorList.Count = 0 Then
If UsuarioActual.Empresa.Funcionalidad(576) = "1" Then
GeneraPolizaVentaWS(ObjFactura)
End If
End If
If ObjFactura.CveVenta > 0 AndAlso ErrorList.Count = 0 Then
@@ -7597,7 +7604,6 @@ Partial Class Ventas
'ObjFactura.AnticipoPosicion = DdlAmortizacionConceptos.SelectedValue.ToEntero
'ObjFactura.AnticipoEnSubTotal = If(ChkAnticipoEnSubTotal.Checked, True, False)
'ObjFactura.CveTipoRelacion = DdlTipoRelacion.SelectedValue.ToEntero
'ObjFactura.CveTipoAmortizacionAnticipo = DdlTipoAmortizacionAnticipo.SelectedValue.ToEntero
'ObjFactura.SerieFolio = String.Format("{0}-{1}", LblSerie.Text, TxtFolio.Text)
@@ -20928,9 +20934,11 @@ Partial Class Ventas
Protected Sub BtnAplicarNC_Click(sender As Object, e As EventArgs)
If UsuarioActual.Empresa.Funcionalidad(344) = "1" Then
If TxtImportesRemisionesNC.Text.ToDecimal() <> TxtNCImporte.Text.ToDecimal() Then
Alert($"Los importes no coinciden", TipoMensaje.MsgAdvertencia)
Exit Sub
If ListaRemisionesNC IsNot Nothing AndAlso ListaRemisionesNC.Count > 0 Then
If TxtImportesRemisionesNC.Text.ToDecimal() <> TxtNCImporte.Text.ToDecimal() Then
Alert($"Los importes no coinciden", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
End If
DdlTipoComprobante.SelectedValue = "Egs"
@@ -23802,6 +23810,102 @@ Partial Class Ventas
Protected Sub BtnModalAplicarRemisionesNC_Click(sender As Object, e As EventArgs)
CargaRNC()
RegistraScript("$('#ModalAplicarRemisionesNC').modal()")
RegistraScript("$('#ModalAplicarRemisionesNC').modal({backdrop: 'static', keyboard: false });")
End Sub
Protected Function GeneraPolizaVentaWS(ObjFactura As Modelos.Factura) As Boolean
Dim obj As New Modelos.MPolizaVentaWS
'DATOS DEL CLIENTE
obj.customer_name = ObjFactura.Cliente.Nombre
obj.customer_last_name1 = ""
obj.customer_last_name2 = ""
obj.customer_birthday = Nothing
obj.customer_phone = ObjFactura.Cliente.Telefono
obj.customer_email = ObjFactura.Cliente.Mail
obj.customer_gender = "03" 'OTRO GENERO
obj.customer_advertising = False
obj.customer_car_brand = "00"
obj.customer_car_model = "00"
obj.customer_car_year = ObjFactura.Fecha.Year
'DATOS DE VENTA
obj.sale_date = Now
obj.sale_paidby = "01"
obj.sale_type = "01" 'PISO
obj.sale_type_service = "01" 'PARTICULAR
obj.sale_total = ObjFactura.Total
obj.sale_discount = ObjFactura.SubTotal
obj.sale_id = ObjFactura.CveVenta.ToString()
'DATOS DEL PRODUCTO
obj.product_code = "174925"
obj.product_unique_code = "65047187"
obj.product_sale_type = "02" 'AJUSTE
'DATOS DE USADO
obj.used_product = True
obj.used_brand = "01"
obj.used_bci = "25"
obj.used_month = 1
obj.used_year = 2015
obj.used_sale_date = ObjFactura.Fecha
Return False
'EnviarPolizaVentaWS(obj)
End Function
Protected Sub EnviarPolizaVentaWS(obj As Modelos.MPolizaVentaWS)
Dim Retorno As String = "[]"
Dim User As String = "cslth.2809@jcilink.com"
Dim Password As String = "ff31580a95f36b51ad27f970428b77a5a9245076"
Try
Using wc As New HttpClient()
Dim Url = New Uri("http://polizavirtual.com.mx/webservice/api/Venta")
Dim Parametros = New List(Of KeyValuePair(Of String, String))
Parametros.Add(New KeyValuePair(Of String, String)("User", User))
Parametros.Add(New KeyValuePair(Of String, String)("password", Password))
Parametros.Add(New KeyValuePair(Of String, String)("customer_name", obj.customer_name))
Parametros.Add(New KeyValuePair(Of String, String)("customer_last_name1", obj.customer_last_name1))
Parametros.Add(New KeyValuePair(Of String, String)("customer_last_name2", obj.customer_last_name1))
Parametros.Add(New KeyValuePair(Of String, String)("customer_birthday", obj.customer_birthday.ToString("yyyy-MM-dd HH:mm:ss")))
Parametros.Add(New KeyValuePair(Of String, String)("customer_phone", obj.customer_phone))
Parametros.Add(New KeyValuePair(Of String, String)("customer_email", obj.customer_email))
Parametros.Add(New KeyValuePair(Of String, String)("customer_gender", obj.customer_gender))
Parametros.Add(New KeyValuePair(Of String, String)("customer_advertising", obj.customer_advertising.ToString()))
Parametros.Add(New KeyValuePair(Of String, String)("sale_date", obj.sale_date.ToString("yyyy-MM-dd HH:mm:ss")))
Parametros.Add(New KeyValuePair(Of String, String)("sale_paidby", obj.sale_paidby))
Parametros.Add(New KeyValuePair(Of String, String)("sale_type", obj.sale_type))
Parametros.Add(New KeyValuePair(Of String, String)("sale_type_service", obj.sale_type_service))
Parametros.Add(New KeyValuePair(Of String, String)("product_code", obj.product_code))
Parametros.Add(New KeyValuePair(Of String, String)("product_unique_code", obj.product_unique_code))
Parametros.Add(New KeyValuePair(Of String, String)("product_sale_type", obj.product_sale_type))
Parametros.Add(New KeyValuePair(Of String, String)("sale_total", obj.sale_total.ToString()))
Parametros.Add(New KeyValuePair(Of String, String)("used_product", obj.used_product.ToString()))
Parametros.Add(New KeyValuePair(Of String, String)("used_brand", obj.used_brand))
Parametros.Add(New KeyValuePair(Of String, String)("used_bci", obj.used_bci))
Parametros.Add(New KeyValuePair(Of String, String)("used_month", obj.used_month.ToString()))
Parametros.Add(New KeyValuePair(Of String, String)("used_year", obj.used_year.ToString()))
Parametros.Add(New KeyValuePair(Of String, String)("used_sale_date", obj.used_sale_date.ToString("yyyy-MM-dd HH:mm:ss")))
Parametros.Add(New KeyValuePair(Of String, String)("customer_car_brand", obj.customer_car_brand.ToString()))
Parametros.Add(New KeyValuePair(Of String, String)("customer_car_model", obj.customer_car_model.ToString()))
Parametros.Add(New KeyValuePair(Of String, String)("customer_car_year", obj.customer_car_year.ToString()))
Parametros.Add(New KeyValuePair(Of String, String)("sale_discount", obj.sale_discount.ToString()))
Parametros.Add(New KeyValuePair(Of String, String)("sale_id", obj.sale_id.ToString()))
Dim content As New FormUrlEncodedContent(Parametros)
Dim response = wc.PostAsync(Url, content).Result
Retorno = response.Content.ReadAsStringAsync().Result
End Using
Catch ex As Exception
ex.GuardaLog(ex.Message)
End Try
End Sub
End Class