Merge branch 'master' of http://agonzalez@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -758,11 +758,12 @@ Public Class ClsAcumuladores
|
|||||||
End Try
|
End Try
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
Public Function GetGarantiasPolizaVirtual(CveVenta As Integer) As Boolean
|
Public Function GetGarantiasPolizaVirtual(CveVenta As Integer, CveEmpresa As Integer) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
SqlDataAdapter("PA_Acum_GarantiasPolizaVirtualGet")
|
SqlDataAdapter("PA_Acum_GarantiasPolizaVirtualGet")
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
|
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
End With
|
End With
|
||||||
Try
|
Try
|
||||||
SqlAdapter.Fill(Data)
|
SqlAdapter.Fill(Data)
|
||||||
|
|||||||
@@ -907,8 +907,10 @@
|
|||||||
<td runat="server" id="tdT5" visible="false">
|
<td runat="server" id="tdT5" visible="false">
|
||||||
<asp:Label Text="" ID="LbIVAOriginal" runat="server" />
|
<asp:Label Text="" ID="LbIVAOriginal" runat="server" />
|
||||||
</td>
|
</td>
|
||||||
<td runat="server" id="tdIVA6" visible="false">
|
<td runat="server" id="tdIVA6" visible="false" class="label label-sm label-success" style="color:white!important" >
|
||||||
<asp:LinkButton runat="server" ID="LnkActivaIva6" Text="" ToolTip="Ret IVA Servicios" OnClick="LnkActivaIva6_Click"><i class="fa fa-usd" aria-hidden="true"></i></asp:LinkButton>
|
|
||||||
|
<asp:LinkButton runat="server" ID="LnkActivaIva6" Text="" ToolTip="Ret IVA Servicios" OnClick="LnkActivaIva6_Click" style="color:white!important" >Deglose 6%</asp:LinkButton>
|
||||||
|
<%--<asp:LinkButton runat="server" ID="LnkActivaIva6" Text="" ToolTip="Ret IVA Servicios" OnClick="LnkActivaIva6_Click"><i class="fa fa-usd" aria-hidden="true"></i></asp:LinkButton>--%>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<%--<td align="left" runat="server" id="TdIVA" visible="false">
|
<%--<td align="left" runat="server" id="TdIVA" visible="false">
|
||||||
|
|||||||
@@ -1026,9 +1026,16 @@ Partial Class Compras_Compras
|
|||||||
ViewState("SubTotal2Original") = value
|
ViewState("SubTotal2Original") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Private Property IVAOriginal As Double
|
Private Property IVAOriginal As Double
|
||||||
Get
|
Get
|
||||||
|
|
||||||
|
If ViewState("IVAOriginal") Is Nothing Then
|
||||||
|
Return 0
|
||||||
|
Else
|
||||||
Return ViewState("IVAOriginal").ToString.ToDouble
|
Return ViewState("IVAOriginal").ToString.ToDouble
|
||||||
|
End If
|
||||||
|
|
||||||
End Get
|
End Get
|
||||||
Set(value As Double)
|
Set(value As Double)
|
||||||
ViewState("IVAOriginal") = value
|
ViewState("IVAOriginal") = value
|
||||||
@@ -2087,7 +2094,11 @@ Partial Class Compras_Compras
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
DdlRetIVAConcepto.Items.Add(New ListItem("Arrendamiento", "4"))
|
DdlRetIVAConcepto.Items.Add(New ListItem("Arrendamiento", "4"))
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(577).ToEntero = 1 Then
|
||||||
DdlRetIVAConcepto.Items.Add(New ListItem("Ret IVA Servicios", "5"))
|
DdlRetIVAConcepto.Items.Add(New ListItem("Ret IVA Servicios", "5"))
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -2237,15 +2248,15 @@ Partial Class Compras_Compras
|
|||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(577).ToString = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(577).ToString = "1" Then
|
||||||
|
|
||||||
'If UsuarioActual.CveRol = 1 Then
|
|
||||||
' Alert("Ok funcionalidad 577")
|
|
||||||
'End If
|
|
||||||
|
|
||||||
|
|
||||||
If RetencionIVA = 0 And IVAOriginal > 0 Then
|
If RetencionIVA = 0 And IVAOriginal > 0 Then
|
||||||
For Each dRow As DataRow In TmpDT.Rows
|
For Each dRow As DataRow In TmpDT.Rows
|
||||||
If dRow("CveTipoPS").ToString.ToEntero = 1 Then
|
If dRow("CveTipoPS").ToString.ToEntero = 1 Then
|
||||||
tdIVA6.Visible = True
|
|
||||||
|
'comentado para reubicar el boton
|
||||||
|
'tdIVA6.Visible = True
|
||||||
|
|
||||||
|
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
@@ -17025,7 +17036,8 @@ Partial Class Compras_Compras
|
|||||||
If RetencionIVA = 0 And IVAOriginal > 0 Then
|
If RetencionIVA = 0 And IVAOriginal > 0 Then
|
||||||
For Each dRow As DataRow In TmpDT.Rows
|
For Each dRow As DataRow In TmpDT.Rows
|
||||||
If dRow("CveTipoPS").ToString.ToEntero = 1 Then
|
If dRow("CveTipoPS").ToString.ToEntero = 1 Then
|
||||||
tdIVA6.Visible = True
|
'Comnetado para reubicar el boton
|
||||||
|
'tdIVA6.Visible = True
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
@@ -19305,7 +19317,7 @@ Partial Class Compras_Compras
|
|||||||
|
|
||||||
DdlRetIVAConcepto.SelectedValueExist("5")
|
DdlRetIVAConcepto.SelectedValueExist("5")
|
||||||
|
|
||||||
LblRetIVA.Text = "0.06%"
|
LblRetIVA.Text = "6.0%"
|
||||||
|
|
||||||
RetencionIVA = TmpDT.SUMD("RetIVA")
|
RetencionIVA = TmpDT.SUMD("RetIVA")
|
||||||
TxtRetIVA.Text = RetencionIVA.ToString("###,###,###.00")
|
TxtRetIVA.Text = RetencionIVA.ToString("###,###,###.00")
|
||||||
|
|||||||
@@ -2815,6 +2815,9 @@ Partial Class Compras_eFacturas
|
|||||||
CveProveedor = gvRow.DataKey("CveProveedor").ToEntero
|
CveProveedor = gvRow.DataKey("CveProveedor").ToEntero
|
||||||
Dim ObjCompras As New ClsCompras
|
Dim ObjCompras As New ClsCompras
|
||||||
|
|
||||||
|
|
||||||
|
Dim TieneRegistros As Boolean = False
|
||||||
|
|
||||||
If ObjCompras.GetCompararComplementoPago(gvRow.DataKey("CveProveedor").ToEntero, Monto, nodePagos2.InnerXml.Replace("pago10:", ""), UsuarioActual.CveEmpresa) Then
|
If ObjCompras.GetCompararComplementoPago(gvRow.DataKey("CveProveedor").ToEntero, Monto, nodePagos2.InnerXml.Replace("pago10:", ""), UsuarioActual.CveEmpresa) Then
|
||||||
GvVincularPago.DataSource = ObjCompras.DtResultados
|
GvVincularPago.DataSource = ObjCompras.DtResultados
|
||||||
|
|
||||||
@@ -2822,7 +2825,7 @@ Partial Class Compras_eFacturas
|
|||||||
SerieFolioIE = ObjCompras.DtResultados.Rows(0)("SerieFolio").ToString
|
SerieFolioIE = ObjCompras.DtResultados.Rows(0)("SerieFolio").ToString
|
||||||
DivVincularPagoManualmente.Visible = False
|
DivVincularPagoManualmente.Visible = False
|
||||||
BtnVincularPago.Visible = True
|
BtnVincularPago.Visible = True
|
||||||
|
TieneRegistros = True
|
||||||
Else
|
Else
|
||||||
DivVincularPagoManualmente.Visible = True
|
DivVincularPagoManualmente.Visible = True
|
||||||
BtnVincularPago.Visible = False
|
BtnVincularPago.Visible = False
|
||||||
@@ -2835,6 +2838,7 @@ Partial Class Compras_eFacturas
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
For Each drow As DataRow In ObjCompras.DtResultados.FiltraParametros("CveIE > 0 AND FechaDocumento IS NOT NULL", "", {"FechaDocumento"}).Rows
|
For Each drow As DataRow In ObjCompras.DtResultados.FiltraParametros("CveIE > 0 AND FechaDocumento IS NOT NULL", "", {"FechaDocumento"}).Rows
|
||||||
|
|
||||||
Dim FechaDocumento As Date = drow("FechaDocumento").ToString.ToDate
|
Dim FechaDocumento As Date = drow("FechaDocumento").ToString.ToDate
|
||||||
@@ -2873,12 +2877,18 @@ Partial Class Compras_eFacturas
|
|||||||
TextoDiferenciaImporte = $"<b> - IE ${ImporteIES.FormatoNumero}</b> <div style='color:red'><strong>Diferencia { DiferenciaImportes.FormatoNumero() }</strong></div>"
|
TextoDiferenciaImporte = $"<b> - IE ${ImporteIES.FormatoNumero}</b> <div style='color:red'><strong>Diferencia { DiferenciaImportes.FormatoNumero() }</strong></div>"
|
||||||
BtnVincularPago.Visible = False
|
BtnVincularPago.Visible = False
|
||||||
MSGComplemento = MSGComplemento & $" Existe una diferencia mayor a $5.00 ({Math.Abs(DiferenciaImportes)})"
|
MSGComplemento = MSGComplemento & $" Existe una diferencia mayor a $5.00 ({Math.Abs(DiferenciaImportes)})"
|
||||||
|
|
||||||
|
If TieneRegistros AndAlso UsuarioActual.TienePermisoProceso(286) Then
|
||||||
|
DivVincularPagoManualmente.Visible = True
|
||||||
|
End If
|
||||||
|
|
||||||
Else
|
Else
|
||||||
'BtnVincularPago.Visible = True
|
'BtnVincularPago.Visible = True
|
||||||
'TextoDiferenciaImporte = ""
|
'TextoDiferenciaImporte = ""
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
LblSerieFolioPago.Text = $"{SeriePago}-{FolioPago}"
|
LblSerieFolioPago.Text = $"{SeriePago}-{FolioPago}"
|
||||||
LblImportePago.Text = Monto.ToString("###,###,###.00") 'ImportePago.FormatoNumero
|
LblImportePago.Text = Monto.ToString("###,###,###.00") 'ImportePago.FormatoNumero
|
||||||
LblPagosCantidad.Text = PagosCantidad.ToString
|
LblPagosCantidad.Text = PagosCantidad.ToString
|
||||||
@@ -2893,7 +2903,7 @@ Partial Class Compras_eFacturas
|
|||||||
Else
|
Else
|
||||||
LblMensajeComlementoError.Text = ""
|
LblMensajeComlementoError.Text = ""
|
||||||
DVMensajecomplementoError.Visible = False
|
DVMensajecomplementoError.Visible = False
|
||||||
|
DivVincularPagoManualmente.Visible = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -815,7 +815,8 @@
|
|||||||
<asp:UpdatePanel ID="UpTurno" runat="server" UpdateMode="Conditional" Visible="false" class="portlet light xspadding bordered whitoutcol" style="width: 20%; display: flex; flex-direction: row; color: white; background-color: #c49f47">
|
<asp:UpdatePanel ID="UpTurno" runat="server" UpdateMode="Conditional" Visible="false" class="portlet light xspadding bordered whitoutcol" style="width: 20%; display: flex; flex-direction: row; color: white; background-color: #c49f47">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<div id="DivTurno" runat="server" style="width: 100%; text-align: center;">
|
<div id="DivTurno" runat="server" style="width: 100%; text-align: center;">
|
||||||
Turno: <asp:Label runat="server" ID="LblTurno"></asp:Label>
|
Turno:
|
||||||
|
<asp:Label runat="server" ID="LblTurno"></asp:Label>
|
||||||
</div>
|
</div>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
@@ -1229,7 +1230,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<asp:UpdatePanel ID="UpRemisiones" runat="server" UpdateMode="Conditional" RenderMode="Inline">
|
<asp:UpdatePanel ID="UpRemisiones" runat="server" UpdateMode="Conditional" RenderMode="Inline">
|
||||||
@@ -1248,7 +1248,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
|
|
||||||
<asp:UpdatePanel ID="UpAntNC" runat="server" UpdateMode="Conditional" RenderMode="Inline">
|
<asp:UpdatePanel ID="UpAntNC" runat="server" UpdateMode="Conditional" RenderMode="Inline">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
|
|
||||||
@@ -1291,9 +1290,32 @@
|
|||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-6 ">
|
<div class="col-md-6 ">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div id="DivCodigosUnicos" class="row" runat="server" visible="false">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<asp:UpdatePanel ID="UpCodigosUnicos" runat="server" UpdateMode="Conditional" RenderMode="Inline">
|
||||||
|
<ContentTemplate>
|
||||||
|
<div class="col-md-12">
|
||||||
|
<asp:GridView ID="GvCodigosUnicos" runat="server" CssClass="table table-striped table-hover Widthall" AutoGenerateColumns="False"
|
||||||
|
DataKeyNames="SerieLote,IdProductoPolizaVirtual,FechaAjuste,IdModelo,CveBCIUsado" ClientIDMode="Static" EmptyDataText="" GridLines="None">
|
||||||
|
<Columns>
|
||||||
|
<asp:TemplateField HeaderText="Código Único">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:TextBox ID="TxtCodigoUnico" runat="server" Text='<%# Eval("SerieLote") %>' />
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
</Columns>
|
||||||
|
</asp:GridView>
|
||||||
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="col-md-6">
|
<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">
|
<tr align="right">
|
||||||
@@ -1312,6 +1334,8 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<table border="0" rules="none" class="well TextTab" style="float: right;">
|
<table border="0" rules="none" class="well TextTab" style="float: right;">
|
||||||
<tr align="right">
|
<tr align="right">
|
||||||
@@ -1511,7 +1535,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4294,6 +4294,8 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
CargaCodigoUnico()
|
||||||
|
|
||||||
UpPS.Update()
|
UpPS.Update()
|
||||||
UpContado.Update()
|
UpContado.Update()
|
||||||
UpEstatus.Update()
|
UpEstatus.Update()
|
||||||
@@ -5015,6 +5017,8 @@ Partial Class Ventas
|
|||||||
|
|
||||||
TrVistaPrevia.Visible = True
|
TrVistaPrevia.Visible = True
|
||||||
|
|
||||||
|
TxtFechaPago.Text = If(DdlTipoComprobante.SelectedValue = "Rem", Now.AddDays(PlazoCobranzaRemision), Now.AddDays(PlazoCobranza)).ToShortDateString
|
||||||
|
|
||||||
If Not (ModalidadEdicion AndAlso DdlTipoComprobante.SelectedValue = "Rem") Then
|
If Not (ModalidadEdicion AndAlso DdlTipoComprobante.SelectedValue = "Rem") Then
|
||||||
CargaRestriccionesCreditoCliente(True, Me.CveVenta)
|
CargaRestriccionesCreditoCliente(True, Me.CveVenta)
|
||||||
End If
|
End If
|
||||||
@@ -16362,17 +16366,17 @@ Partial Class Ventas
|
|||||||
Private Sub BtnEditarRemision_Click(sender As Object, e As EventArgs) Handles BtnEditarRemision.Click
|
Private Sub BtnEditarRemision_Click(sender As Object, e As EventArgs) Handles BtnEditarRemision.Click
|
||||||
Dim OcurrioError As Boolean = False
|
Dim OcurrioError As Boolean = False
|
||||||
Dim ObjVentas As New ClsVentas
|
Dim ObjVentas As New ClsVentas
|
||||||
|
ObjVentas.IniciaTransacSQL()
|
||||||
|
|
||||||
Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
|
Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
|
||||||
Dim ObjBancos As New ClsBancos(ObjVentas.IniciaTransacSQL())
|
Dim ObjBancos As New ClsBancos(ObjVentas.IniciaTransacSQL())
|
||||||
Dim ObjCGame As New ClsCGame(ObjVentas.IniciaTransacSQL())
|
Dim ObjCGame As New ClsCGame(ObjVentas.IniciaTransacSQL())
|
||||||
Dim ObjAC As ClsContPAQi = Nothing
|
Dim ObjAC As ClsContPAQi = Nothing
|
||||||
|
|
||||||
Dim Moneda As Integer = DdlMoneda.SelectedValue.ToEntero
|
Dim Moneda As Integer = DdlMoneda.SelectedValue.ToEntero
|
||||||
Dim TipoCambio As Double = TxtTipoCambio.Text.ToDouble
|
Dim TipoCambio As Double = TxtTipoCambio.Text.ToDouble
|
||||||
EditoRemision = True
|
EditoRemision = True
|
||||||
'Dim SubTotal, Descuento, IVA, RetIVA, RetISR, IEPS, Total As Decimal
|
Try
|
||||||
ObjVentas.IniciaTransacSQL()
|
|
||||||
|
|
||||||
|
|
||||||
'CONVERTIR REMISION - TIPO MONEDA -DOLARES A PESOS
|
'CONVERTIR REMISION - TIPO MONEDA -DOLARES A PESOS
|
||||||
If DdlMoneda.SelectedValue.ToEntero <> 2 AndAlso ChkConvertirDolares.Checked Then
|
If DdlMoneda.SelectedValue.ToEntero <> 2 AndAlso ChkConvertirDolares.Checked Then
|
||||||
|
|
||||||
@@ -16533,11 +16537,16 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If Not OcurrioError Then
|
If Not OcurrioError Then
|
||||||
If RegeneracionPolizas(ObjVentas, ObjAC) Then
|
If RegeneracionPolizas(ObjVentas, ObjAC, ObjConta, ObjBancos) Then
|
||||||
OcurrioError = True
|
OcurrioError = True
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
OcurrioError = True
|
||||||
|
OnError("Ocurrió un error al actualizar la remisión", ex)
|
||||||
|
End Try
|
||||||
|
|
||||||
If OcurrioError Then
|
If OcurrioError Then
|
||||||
ObjVentas.RollBack()
|
ObjVentas.RollBack()
|
||||||
Alert("Ocurrió un error al guardar los cambios. Por favor intente de nuevo.", TipoMensaje.MsgError)
|
Alert("Ocurrió un error al guardar los cambios. Por favor intente de nuevo.", TipoMensaje.MsgError)
|
||||||
@@ -17342,19 +17351,22 @@ Partial Class Ventas
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub BtnAgregarCliente_Click(sender As Object, e As EventArgs) Handles BtnAgregarCliente.Click
|
Private Sub BtnAgregarCliente_Click(sender As Object, e As EventArgs) Handles BtnAgregarCliente.Click
|
||||||
Dim CvePreioLista As Integer = -1
|
Dim CvePrecioLista As Integer = -1
|
||||||
If DdlSubProyectoDatos.SelectedValue.ToEntero > 0 Then
|
If DdlSubProyectoDatos.SelectedValue.ToEntero > 0 Then
|
||||||
Dim Dr As DataRow = GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa).Rows(0)
|
Dim Dr As DataRow = GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa).Rows(0)
|
||||||
If Dr IsNot Nothing Then
|
If Dr IsNot Nothing Then
|
||||||
If Dr("CvePrecioLista").ToString.ToEntero > 0 Then
|
If Dr("CvePrecioLista").ToString.ToEntero > 0 Then
|
||||||
CvePreioLista = Dr("CvePrecioLista").ToString.ToEntero
|
CvePrecioLista = Dr("CvePrecioLista").ToString.ToEntero
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim ObjCliente As New ClsClientes
|
Dim ObjCliente As New ClsClientes
|
||||||
|
|
||||||
If ObjCliente.AgregarClienteNoFrecuente(TxtNombreCliente.Text.Trim, TxtDireccionCliente.Text.Trim, TxtNumExtCliente.Text.Trim, TxtNumIntCliente.Text.Trim, TxtColoniaCliente.Text.Trim, TxtLocalidadCliente.Text.Trim, TxtCiudadCliente.Text.Trim, TxtEstadoCliente.Text.Trim, TxtPaisCliente.Text.Trim, TxtRFCCliente.Text.Trim, TxtCPCliente.Text.Trim, TxtTelefonoCliente.Text.Trim, TxtCorreoCliente.Text.Trim, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", CvePreioLista) Then
|
If ObjCliente.AgregarClienteNoFrecuente(TxtNombreCliente.Text.Trim, TxtDireccionCliente.Text.Trim, TxtNumExtCliente.Text.Trim, TxtNumIntCliente.Text.Trim,
|
||||||
|
TxtColoniaCliente.Text.Trim, TxtLocalidadCliente.Text.Trim, TxtCiudadCliente.Text.Trim, TxtEstadoCliente.Text.Trim,
|
||||||
|
TxtPaisCliente.Text.Trim, TxtRFCCliente.Text.Trim, TxtCPCliente.Text.Trim, TxtTelefonoCliente.Text.Trim, TxtCorreoCliente.Text.Trim,
|
||||||
|
DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", -1, -1, CvePrecioLista:=CvePrecioLista) Then
|
||||||
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
||||||
RegistraScript("hideDivEC();")
|
RegistraScript("hideDivEC();")
|
||||||
ViewState("CveCliente") = ObjCliente.DtResultados(0)("CveCliente").ToString.ToEntero
|
ViewState("CveCliente") = ObjCliente.DtResultados(0)("CveCliente").ToString.ToEntero
|
||||||
@@ -17446,34 +17458,26 @@ Partial Class Ventas
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
Private Function RegeneracionPolizas(ByRef ObjVentas As ClsVentas, ByRef ObjAC As ClsContPAQi) As Boolean
|
Private Function RegeneracionPolizas(ByRef ObjVentas As ClsVentas, ByRef ObjAC As ClsContPAQi, ByRef ObjConta As ClsContabilidad, ObjBancos As ClsBancos) As Boolean
|
||||||
Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
|
|
||||||
Dim ObjBancos As New ClsBancos(ObjVentas.IniciaTransacSQL())
|
|
||||||
|
|
||||||
Dim CvePlantillaPoliza As Integer
|
|
||||||
|
|
||||||
Dim ErrorCancelar As Boolean = False
|
Dim ErrorCancelar As Boolean = False
|
||||||
Dim Mensaje As String = ""
|
Dim Mensaje As String = ""
|
||||||
|
|
||||||
CreaObjetosVenta()
|
CreaObjetosVenta()
|
||||||
|
|
||||||
If UsuarioActual.Empresa.UsaAC Then
|
If UsuarioActual.Empresa.UsaAC Then
|
||||||
ObjAC = New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL()
|
ObjAC = New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then
|
'REMOVEMOS LOS CONCEPTOS DE LA PREPOLIZA
|
||||||
CvePlantillaPoliza = 7
|
ErrorCancelar = Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, -1, CveVenta, 2)
|
||||||
ElseIf ObjFactura.TipoDocto.Contiene("Ing", "Rem", "Ant") Then
|
|
||||||
CvePlantillaPoliza = 4
|
|
||||||
Else
|
|
||||||
CvePlantillaPoliza = 4
|
|
||||||
End If
|
|
||||||
|
|
||||||
'Removemos los conceptos de la prepoliza
|
|
||||||
ObjConta.RemovePrePolizasDetalle(CvePrePoliza, -1, CveVenta, 2)
|
|
||||||
|
|
||||||
ObjFactura.CveVenta = CveVenta
|
ObjFactura.CveVenta = CveVenta
|
||||||
ObjFactura.CvePrePoliza = CvePrePoliza
|
ObjFactura.CvePrePoliza = CvePrePoliza
|
||||||
ErrorCancelar = ProcesoPrepolizas(ObjConta, ObjFactura, -1, TmpDT, ObjAC, 1, ObjBancos, ObjVentas)
|
|
||||||
|
'VUELVE A GENERAR LAS PREPOLIZAS
|
||||||
|
If Not ErrorCancelar Then ErrorCancelar = ProcesoPrepolizas(ObjConta, ObjFactura, -1, TmpDT, ObjAC, 1, ObjBancos, ObjVentas)
|
||||||
|
|
||||||
If Not ErrorCancelar Then ErrorCancelar = GuardarVentaImpuestosLocales(ObjVentas, ObjConta, ObjFactura, 1)
|
If Not ErrorCancelar Then ErrorCancelar = GuardarVentaImpuestosLocales(ObjVentas, ObjConta, ObjFactura, 1)
|
||||||
|
|
||||||
Return ErrorCancelar
|
Return ErrorCancelar
|
||||||
@@ -23901,15 +23905,21 @@ Partial Class Ventas
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#Region "P O L I Z A - V I R T U A L"
|
#Region "P O L I Z A - V I R T U A L"
|
||||||
Protected Sub GeneraPolizaVentaWS(ObjFactura As Modelos.Factura)
|
Private Sub CargaCodigoUnico()
|
||||||
Dim DtUsados As DataTable = Nothing
|
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DdlTipoComprobante.SelectedValue = "Rem" Then
|
||||||
Dim ObjAcum As New ClsAcumuladores
|
Dim ObjAcum As New ClsAcumuladores
|
||||||
If ObjAcum.GetGarantiasPolizaVirtual(ObjFactura.CveVenta) Then
|
If ObjAcum.GetGarantiasPolizaVirtual(Me.CveVenta, UsuarioActual.CveEmpresa) AndAlso ObjAcum.DtResultados.Rows.Count > 0 Then
|
||||||
DtUsados = ObjAcum.DtResultados.Copy()
|
GvCodigosUnicos.DataSource = ObjAcum.DtResultados
|
||||||
|
DivCodigosUnicos.Visible = True
|
||||||
End If
|
End If
|
||||||
ObjAcum.Dispose()
|
ObjAcum.Dispose()
|
||||||
|
GvCodigosUnicos.DataBind()
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
Protected Sub GeneraPolizaVentaWS(ObjFactura As Modelos.Factura)
|
||||||
Try
|
Try
|
||||||
For Each Row As DataRow In DtUsados.Rows
|
For Each Row As GridViewRow In GvCodigosUnicos.Rows
|
||||||
|
If Row.RowType = DataControlRowType.DataRow Then
|
||||||
Dim obj As New Modelos.MPolizaVentaWS
|
Dim obj As New Modelos.MPolizaVentaWS
|
||||||
'DATOS DEL CLIENTE
|
'DATOS DEL CLIENTE
|
||||||
obj.customer_name = ObjFactura.Cliente.Nombre
|
obj.customer_name = ObjFactura.Cliente.Nombre
|
||||||
@@ -23934,21 +23944,22 @@ Partial Class Ventas
|
|||||||
obj.sale_id = String.Format("{0}{1}{2}", ObjFactura.Serie, ObjFactura.Folio, ObjFactura.CveVenta)
|
obj.sale_id = String.Format("{0}{1}{2}", ObjFactura.Serie, ObjFactura.Folio, ObjFactura.CveVenta)
|
||||||
|
|
||||||
'DATOS DEL PRODUCTO
|
'DATOS DEL PRODUCTO
|
||||||
obj.product_code = Row("IdProductoPolizaVirtual").ToString()
|
obj.product_code = Row.DataKey("IdProductoPolizaVirtual").ToString()
|
||||||
obj.product_unique_code = Row("SerieLote").ToString() 'se indique el código único de la batería. (SERIE LOTE)
|
obj.product_unique_code = Row.FCTextBox("TxtCodigoUnico").Text 'se indique el código único de la batería. (SERIE LOTE)
|
||||||
obj.product_sale_type = "01 " 'VENTA
|
obj.product_sale_type = "01 " 'VENTA
|
||||||
|
|
||||||
Dim FechaUsado As DateTime = Row("FechaAjuste").ToString().ToDateTime()
|
Dim FechaUsado As DateTime = Row.DataKey("FechaAjuste").ToString().ToDateTime()
|
||||||
|
|
||||||
'DATOS DE USADO
|
'DATOS DE USADO
|
||||||
obj.used_product = True
|
obj.used_product = True
|
||||||
obj.used_brand = Row("IdModelo").ToString() 'MARCAR DEL USADO
|
obj.used_brand = Row.DataKey("IdModelo").ToString() 'MARCAR DEL USADO
|
||||||
obj.used_bci = Row("CveBCIUsado").ToString() 'VALOR DEL BCI
|
obj.used_bci = Row.DataKey("IdBCI").ToString() 'VALOR DEL BCI
|
||||||
obj.used_month = FechaUsado.Month
|
obj.used_month = FechaUsado.Month
|
||||||
obj.used_year = FechaUsado.Year
|
obj.used_year = FechaUsado.Year
|
||||||
obj.used_sale_date = FechaUsado
|
obj.used_sale_date = FechaUsado
|
||||||
|
|
||||||
EnviarPolizaVentaWS(obj)
|
EnviarPolizaVentaWS(obj)
|
||||||
|
End If
|
||||||
Next
|
Next
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
OnError("Ocurrió un error al generar la poliza virtual", ex)
|
OnError("Ocurrió un error al generar la poliza virtual", ex)
|
||||||
|
|||||||
Reference in New Issue
Block a user