Merge branch 'master' of http://jperez@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -42,6 +42,9 @@ Public Class CalendarEvent
|
||||
|
||||
Public Property CveSubProyectoUsuarioAtendio As Integer
|
||||
|
||||
Public Property CveCompra As Integer
|
||||
Public Property SerieFolioCompra As String
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
@@ -2488,12 +2488,12 @@ Public Class ClsOIEventos
|
||||
Optional RecurrenciaTipo As Integer = -1, Optional Frecuencia As Integer = -1, Optional DiasSemana As String = "-1", Optional Dia As Integer = -1, Optional Mes As Integer = -1,
|
||||
Optional RecurrenciaFin As String = "-1", Optional CveTipoEvento As Integer = 2, Optional Importe As Double = -1,
|
||||
Optional CveEmpresaCRM As Integer = -1, Optional CveContactoCRM As Integer = -1, Optional CveAcercamientoCRM As Integer = -1, Optional CveTipoProcesoCRM As Integer = -1, Optional CveEtapaProcesoCRM As Integer = -1,
|
||||
Optional CveSubProyecto As Integer = -1, Optional CveUsuarioPara As Integer = -1) As Boolean
|
||||
Optional CveSubProyecto As Integer = -1, Optional CveUsuarioPara As Integer = -1, Optional CveCompra As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
Retorno = AddEvento(CveTipoEvento, CveAgendaTipo, Asunto, Descripcion, Prioridad, CveUsuarioPara, CveUsuarioIng, FechaInicio, FechaFin, -1, -1, "-1", CveUsuarioIng, CveEmpresa, CveActivoFijo, CveIE, CveProspecto, CveCliente, CveOS, CveOC,
|
||||
CvePersonal, CveProveedor, CveEventoPadre:=CveEventoPadre, RecurrenciaTipo:=RecurrenciaTipo, Frecuencia:=Frecuencia, DiasSemana:=DiasSemana, Dia:=Dia, Mes:=Mes, RecurrenciaFin:=RecurrenciaFin, Importe:=Importe,
|
||||
CveEmpresaCRM:=CveEmpresaCRM, CveContactoCRM:=CveContactoCRM, CveAcercamientoCRM:=CveAcercamientoCRM, CveTipoProcesoCRM:=CveTipoProcesoCRM, CveEtapaProcesoCRM:=CveEtapaProcesoCRM, CveSubProyecto:=CveSubProyecto)
|
||||
CveEmpresaCRM:=CveEmpresaCRM, CveContactoCRM:=CveContactoCRM, CveAcercamientoCRM:=CveAcercamientoCRM, CveTipoProcesoCRM:=CveTipoProcesoCRM, CveEtapaProcesoCRM:=CveEtapaProcesoCRM, CveSubProyecto:=CveSubProyecto, CveCompra:=CveCompra)
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
@@ -196,6 +196,8 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
|
||||
cevent.NombreProveedor = dr("NombreProveedor").ToString
|
||||
cevent.NomprePersonal = dr("NomprePersonal").ToString
|
||||
|
||||
cevent.CveCompra = dr("CveCompra").ToString.ToEntero
|
||||
cevent.SerieFolioCompra = dr("SerieFolioCompra").ToString
|
||||
|
||||
cevent.CveOS = dr("CveOS").ToString.ToEntero
|
||||
cevent.CveOSDetalle = dr("CveOSDetalle").ToString.ToEntero
|
||||
|
||||
@@ -1408,7 +1408,7 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
BtnGuardarAcercamiento.Visible = false;
|
||||
BtnEliminarAcercamiento.Visible = false;
|
||||
|
||||
DivAccionesBitacoraActividades.Visible = false;
|
||||
DivAccionesBitacoraActividades.Visible = true;
|
||||
DivAccionesBitacoraArchivos.Visible = false;
|
||||
|
||||
LnkCerrarAcercamiento.Visible = false;
|
||||
|
||||
@@ -3014,8 +3014,9 @@
|
||||
<i class="fa fa-commenting font-green"></i>
|
||||
<span class="caption-subject bold">Agregar</span>
|
||||
</div>--%>
|
||||
<asp:HyperLink ID="ImgAddObs" CssClass="caption-subject bold" data-toggle="modal" data-target="#ModalBitacora" runat="server" Text=" <i class='fa fa-commenting font-green' ></i><span class='caption-subject bold'>Agregar</span>" Style="font-weight: 700 !important;cursor: pointer;" ToolTip="Observaciones"></asp:HyperLink><br />
|
||||
<asp:HyperLink ID="HlEvento" CssClass="thickbox caption-subject bold" runat="server" Text=" <i class='fa fa-calendar-plus-o font-green' ></i>Agendar" Visible="false" Style="font-weight: 700 !important;cursor: pointer;" ToolTip="Agendar"></asp:HyperLink><br />
|
||||
<asp:HyperLink ID="ImgAddObs" CssClass="caption-subject bold font-green" data-toggle="modal" data-target="#ModalBitacora" runat="server" Text=" <i class='fa fa-commenting font-green' ></i><span class='caption-subject bold'>Agregar</span>" Style="font-weight: 700 !important;cursor: pointer;" ToolTip="Observaciones"></asp:HyperLink><br />
|
||||
<asp:HyperLink ID="HlEvento" CssClass="thickbox caption-subject bold font-green" runat="server" Text=" <i class='fa fa-calendar-plus-o font-green' ></i>Agendar"
|
||||
Visible="false" Style="font-weight: 700 !important;cursor: pointer;" ToolTip="Agendar"></asp:HyperLink><br />
|
||||
<asp:Literal ID="LtlTareaNueva" runat="server"></asp:Literal>
|
||||
<UserControl:TareaNueva runat="server" ID="TareaNueva" />
|
||||
|
||||
|
||||
@@ -1296,6 +1296,8 @@ Partial Class Compras_Compras
|
||||
DivEsNoDeducible.Visible = True
|
||||
DivActualizarVincular.Visible = True
|
||||
DVModalAnticipoFechaEjecucion.Visible = True
|
||||
HlEvento.Visible = True
|
||||
HlEvento.NavigateUrl = "/OI/PopUpAgenda.aspx?CveTipoEvento=2&CveCompra=" & CveCompra & "&TB_iframe=true&height=370&width=600;"
|
||||
Else
|
||||
|
||||
ViewState("CveProveedor") = -1
|
||||
|
||||
@@ -3044,8 +3044,14 @@
|
||||
<i class="fa fa-commenting font-green"></i>
|
||||
<span class="caption-subject bold">Agregar</span>
|
||||
</div>--%>
|
||||
<asp:HyperLink ID="ImgAddObs" CssClass="caption-subject bold" data-toggle="modal" data-target="#ModalBitacora" runat="server" Text=" <i class='fa fa-commenting font-green' ></i><span class='caption-subject bold'>Agregar</span>" Style="font-weight: 700 !important;cursor: pointer;" ToolTip="Observaciones"></asp:HyperLink><br />
|
||||
<asp:HyperLink ID="HlEvento" CssClass="thickbox caption-subject bold" runat="server" Visible="false" Style="cursor: pointer; text-decoration: none;" ToolTip="Agendar"><i class='fa fa-calendar-plus-o font-green' style='font-weight: 700 !important;' ></i> <span class="caption-subject bold font-green">Agendar</span></asp:HyperLink>
|
||||
<asp:HyperLink ID="ImgAddObs" CssClass="caption-subject bold font-green" data-toggle="modal" data-target="#ModalBitacora" runat="server" Text=" <i class='fa fa-commenting font-green' ></i><span class='caption-subject bold'>Agregar</span>" Style="font-weight: 700 !important;cursor: pointer;" ToolTip="Observaciones"></asp:HyperLink><br />
|
||||
<asp:HyperLink ID="HlEvento" CssClass="thickbox caption-subject bold" runat="server" Visible="false" Style="cursor: pointer; text-decoration: none;" ToolTip="Agendar">
|
||||
<i class='fa fa-calendar-plus-o font-green' style='font-weight: 700 !important;' ></i> <span class="caption-subject bold font-green">Agendar</span>
|
||||
</asp:HyperLink><br />
|
||||
<asp:Literal ID="LtlTareaNueva" runat="server" Visible="false"></asp:Literal>
|
||||
<UserControl:TareaNueva runat="server" ID="TareaNueva" />
|
||||
<script> function OnAddedTareaNueva() { $('.btnupEventoBitacora').click(); }</script>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -3055,6 +3061,7 @@
|
||||
|
||||
<asp:UpdatePanel ID="UPEventoBitacora" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="btnupEventoBitacora" OnClick="btnupEventoBitacora_Click" UseSubmitBehavior="false" CssClass="hidden btnupEventoBitacora mysmallbtn" runat="server" Text="Button" />
|
||||
<asp:GridView ID="GvEB" runat="server" AutoGenerateColumns="False" EmptyDataText="No se han capturado comentarios o bitácora" CssClass="table table-striped table-advance table-hover Widthall" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
|
||||
@@ -536,9 +536,13 @@ Partial Class Compras_Proveedores
|
||||
End If
|
||||
HlEvento.Visible = True
|
||||
HlEvento.NavigateUrl = "/OI/PopUpAgenda.aspx?CveTipoEvento=2&CveProveedor=" & CveProveedor & "&TB_iframe=true&height=370&width=600;"
|
||||
LtlTareaNueva.Visible = True
|
||||
LtlTareaNueva.Text = String.Format("<a class=""caption-subject bold font-green"" onclick=""OpenModalNewTareaUserControl(1,-1,{{CveProveedor:{0}}});""> <i class=""fa fa-plus""'></i> Tarea</a>", CveProveedor)
|
||||
|
||||
CargaRepresentantes()
|
||||
|
||||
|
||||
|
||||
Else
|
||||
'Configuración de Modalidad Insert
|
||||
|
||||
@@ -2776,6 +2780,9 @@ Partial Class Compras_Proveedores
|
||||
ObjEventoBitacora.Dispose()
|
||||
GvEB.DataBind()
|
||||
End Sub
|
||||
Protected Sub btnupEventoBitacora_Click(sender As Object, e As EventArgs)
|
||||
CargaEventoBitacora()
|
||||
End Sub
|
||||
|
||||
Protected Sub DownloadFile(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Dim filePath As String = String.Format("{0}{1}", UsuarioActual.Empresa.Ruta, CType(sender, LinkButton).CommandArgument)
|
||||
|
||||
@@ -45,7 +45,6 @@ Partial Class Compras_ReembolsosComprobaciones
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Private Property CvePrePolizaComprobacion As Integer
|
||||
Get
|
||||
Return ViewState("CvePrePolizaComprobacion").ToString.ToEntero
|
||||
@@ -54,23 +53,7 @@ Partial Class Compras_ReembolsosComprobaciones
|
||||
ViewState("CvePrePolizaComprobacion") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property IdCuentaBancaria As Integer
|
||||
Get
|
||||
Return ViewState("IdCuentaBancaria").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("IdCuentaBancaria") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CveCuentaBancaria As Integer
|
||||
Get
|
||||
Return ViewState("CveCuentaBancaria").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveCuentaBancaria") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property NumeroReembolso As String
|
||||
Get
|
||||
NumeroReembolso = ViewState("NumeroReembolso").ToString
|
||||
@@ -105,12 +88,10 @@ Partial Class Compras_ReembolsosComprobaciones
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
TxtImporte.Attributes.Add("disabled", "disabled")
|
||||
TxtAboneA.Enabled = False
|
||||
CveCuentaBancaria = -1
|
||||
ViewState("CveMoneda") = 1
|
||||
CveMonedaPago = 1
|
||||
TipoCambioPago = 1
|
||||
@@ -335,7 +316,6 @@ Partial Class Compras_ReembolsosComprobaciones
|
||||
|
||||
If dr IsNot Nothing Then
|
||||
CveMonedaPago = dr("CveMoneda").ToString.ToEntero
|
||||
IdCuentaBancaria = dr("IdCtaContable").ToString.ToEntero
|
||||
End If
|
||||
|
||||
If HdnTipoTransaccion.Value = "Egs" Then
|
||||
@@ -468,24 +448,16 @@ Partial Class Compras_ReembolsosComprobaciones
|
||||
Dim ObjIE As New ClsBancos()
|
||||
Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL)
|
||||
Dim MsgError As String = ""
|
||||
|
||||
Dim CveIEExcedente As Integer = -1
|
||||
Dim CvePrePolizaExcedente As Integer = 0
|
||||
|
||||
Dim CveIERegistrado As Integer = 0
|
||||
Dim CveIECajaChica As Integer = 0
|
||||
Dim CvePrePolizaIERegistrado As Integer = 0
|
||||
Dim IdPoliza As Integer = 0
|
||||
|
||||
Dim CveIEPago As Integer = 0
|
||||
Dim CvePrePolizaPago As Integer = 0
|
||||
Dim CvePrePolizaPagoOriginal As Integer = 0
|
||||
Dim IdCtaPersonal As Integer = -1
|
||||
|
||||
Dim CvePersonal As Integer = If(DdlPersonal.Visible AndAlso DdlPersonal.SelectedValue.ToEntero > 0, DdlPersonal.SelectedValue.ToEntero, 0)
|
||||
If CvePersonal > 0 Then
|
||||
IdCtaPersonal = GlobalDTRHPersonal(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContPersonal", String.Format("CvePersonal = {0}", CvePersonal)).ToEntero
|
||||
End If
|
||||
|
||||
Dim tipoCambio As Decimal = 1
|
||||
Dim drp As DataRow = DtCheques.FiltroPrimero($"CveIE = {DDlCheques.SelectedValue.ToEntero}")
|
||||
@@ -503,17 +475,13 @@ Partial Class Compras_ReembolsosComprobaciones
|
||||
Dim concepto As String = "Compras: "
|
||||
|
||||
For Each Gvr As GridViewRow In GvCxP.Rows
|
||||
|
||||
Dim chkPago As CheckBox = Gvr.FCCheckBox("Chk")
|
||||
|
||||
If chkPago.Checked Then
|
||||
concepto = concepto & $" {Gvr.DataKey("SerieFolio").ToString }"
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
Dim filesgral As List(Of Archivo) = Anexo.getfiles().Archivos
|
||||
|
||||
Dim filemove As String = ""
|
||||
Dim Comprobante As String = ""
|
||||
Dim ComprobanteIE = ""
|
||||
@@ -533,12 +501,12 @@ Partial Class Compras_ReembolsosComprobaciones
|
||||
Dim FolioIENew = ObjIE.GetNextFolio(If(CveCajaChica > 0, CveCajaChica, CvePersonal), 8).ToString
|
||||
CveIECajaChica = ObjIE.AddBancos_IE(CveCajaChica, 8, If(ChkReembolsarSinBancos.Checked, TxtFechaPrePoliza.Text.ToDate, TxtFechaDocumento.Text.Trim.ToDate), FolioIENew, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), TxtImporteVinculado.Text.ToDecimal, CveMoneda, 0, TxtObservaciones.Text.Trim, "", False, False, -1, CvePrePolizaIERegistrado, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked Or CveCajaChica > 0, True, False))
|
||||
'AGREGO PREPOLIZA IE BANCOS
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaIERegistrado, True, TxtImporteVinculado.Text.ToDecimal, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), 30, TxtObservaciones.Text, TxtFechaDocumento.Text.ToDate, IdCuentaBancaria, -1, CveIE:=CveIECajaChica, ImporteME:=If(tipoCambio = 1, 0, TxtImporteVinculado.Text.ToDecimal), ImporteMX:=TxtImporteVinculado.Text.ToDecimal * tipoCambio) Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaIERegistrado, True, TxtImporteVinculado.Text.ToDecimal, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), 30, TxtObservaciones.Text, TxtFechaDocumento.Text.ToDate, 0, -1, CveIE:=CveIECajaChica, ImporteME:=If(tipoCambio = 1, 0, TxtImporteVinculado.Text.ToDecimal), ImporteMX:=TxtImporteVinculado.Text.ToDecimal * tipoCambio) Then
|
||||
MsgError = "Error al registrar detalle de concepto bancario"
|
||||
End If
|
||||
Else
|
||||
'AGREGO PREPOLIZA FyE
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaIERegistrado, True, TxtImporteVinculado.Text.ToDecimal, TxtObservaciones.Text, 29, TxtObservaciones.Text, TxtFechaDocumento.Text.ToDate, IdCtaPersonal, -1, CvePersonal:=CvePersonal, CveIE:=CveIERegistrado, ImporteME:=If(tipoCambio = 1, 0, TxtImporteVinculado.Text.ToDecimal), ImporteMX:=TxtImporteVinculado.Text.ToDecimal * tipoCambio) Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaIERegistrado, True, TxtImporteVinculado.Text.ToDecimal, TxtObservaciones.Text, 29, TxtObservaciones.Text, TxtFechaDocumento.Text.ToDate, 0, -1, CvePersonal:=CvePersonal, CveIE:=CveIERegistrado, ImporteME:=If(tipoCambio = 1, 0, TxtImporteVinculado.Text.ToDecimal), ImporteMX:=TxtImporteVinculado.Text.ToDecimal * tipoCambio) Then
|
||||
MsgError = "Error al registrar detalle de concepto bancario"
|
||||
End If
|
||||
End If
|
||||
@@ -560,13 +528,12 @@ Partial Class Compras_ReembolsosComprobaciones
|
||||
Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue)
|
||||
If dr IsNot Nothing Then
|
||||
CveMonedaPago = dr("CveMoneda").ToString.ToEntero
|
||||
IdCuentaBancaria = dr("IdCtaContable").ToString.ToEntero
|
||||
End If
|
||||
|
||||
If ChkChequeExcedente.Checked Then
|
||||
CvePrePolizaExcedente = ObjMov.AddPrePolizas("Compras/Comprobaciones3", 9, TxtImporte.Text.ToDecimal, TxtImporte.Text.ToDecimal, CveMoneda, TxtFechaDocumento.Text.ToDate, If(TxtObservaciones.Text.Trim = "", concepto, TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
CveIEExcedente = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.ToDate, TxtFolio.Text.Trim, TxtAboneA.Text, TxtImporte.Text.ToDecimal, CveMoneda, 0.0, TxtObservaciones.Text, "", ChkAbonoCuenta.Checked, True, -1, CvePrePolizaExcedente, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked, True, False))
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaExcedente, True, TxtImporte.Text.ToDecimal, TxtObservaciones.Text, If(CveCajaChica > 0, 30, 29), TxtObservaciones.Text, TxtFechaDocumento.Text.ToDate, If(CveCajaChica > 0, IdCuentaBancaria, IdCtaPersonal), -1, CveIE:=CveIEExcedente, CvePersonal:=CvePersonal, CveCompra:=-1, CveProveedor:=-1, ImporteME:=If(tipoCambio = 1, 0, TxtImporte.Text.ToDecimal), ImporteMX:=TxtImporte.Text.ToDecimal * tipoCambio) Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaExcedente, True, TxtImporte.Text.ToDecimal, TxtObservaciones.Text, If(CveCajaChica > 0, 30, 29), TxtObservaciones.Text, TxtFechaDocumento.Text.ToDate, 0, -1, CveIE:=CveIEExcedente, CvePersonal:=CvePersonal, CveCompra:=-1, CveProveedor:=-1, ImporteME:=If(tipoCambio = 1, 0, TxtImporte.Text.ToDecimal), ImporteMX:=TxtImporte.Text.ToDecimal * tipoCambio) Then
|
||||
MsgError = "Error al registrar detalle de concepto bancario"
|
||||
End If
|
||||
|
||||
@@ -590,7 +557,7 @@ Partial Class Compras_ReembolsosComprobaciones
|
||||
End If
|
||||
|
||||
'AGREGO PREPOLIZA IE BANCOS
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaIERegistrado, True, TxtImporte.Text.ToDecimal, TxtObservaciones.Text, 30, TxtObservaciones.Text, TxtFechaDocumento.Text.ToDate, IdCuentaBancaria, -1, CveIE:=CveIERegistrado, CvePersonal:=CvePersonal, CveCompra:=-1, CveProveedor:=-1, ImporteME:=If(tipoCambio = 1, 0, TxtImporte.Text.ToDecimal), ImporteMX:=TxtImporte.Text.ToDecimal * tipoCambio) Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaIERegistrado, True, TxtImporte.Text.ToDecimal, TxtObservaciones.Text, 30, TxtObservaciones.Text, TxtFechaDocumento.Text.ToDate, 0, -1, CveIE:=CveIERegistrado, CvePersonal:=CvePersonal, CveCompra:=-1, CveProveedor:=-1, ImporteME:=If(tipoCambio = 1, 0, TxtImporte.Text.ToDecimal), ImporteMX:=TxtImporte.Text.ToDecimal * tipoCambio) Then
|
||||
MsgError = "Error al registrar detalle de concepto bancario"
|
||||
End If
|
||||
|
||||
@@ -600,7 +567,7 @@ Partial Class Compras_ReembolsosComprobaciones
|
||||
CveIECajaChica = ObjIE.AddBancos_IE(CveCajaChica, 8, TxtFechaDocumento.Text.Trim.ToDate, FolioIENew, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), TxtImporte.Text.ToDecimal, CveMoneda, 0, TxtObservaciones.Text.Trim, "", False, False, -1, CvePrePolizaIERegistrado, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked Or CveCajaChica > 0, True, False))
|
||||
|
||||
'AGREGO PREPOLIZA IE BANCOS
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaIERegistrado, False, TxtImporte.Text.ToDecimal, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), 30, TxtObservaciones.Text, TxtFechaDocumento.Text.ToDate, IdCuentaBancaria, -1, CveIE:=CveIECajaChica, ImporteME:=If(tipoCambio = 1, 0, TxtImporte.Text.ToDecimal), ImporteMX:=TxtImporte.Text.ToDecimal * tipoCambio, Contabilizable:=Not UsaSimplificacionCajaChica) Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaIERegistrado, False, TxtImporte.Text.ToDecimal, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), 30, TxtObservaciones.Text, TxtFechaDocumento.Text.ToDate, 0, -1, CveIE:=CveIECajaChica, ImporteME:=If(tipoCambio = 1, 0, TxtImporte.Text.ToDecimal), ImporteMX:=TxtImporte.Text.ToDecimal * tipoCambio, Contabilizable:=Not UsaSimplificacionCajaChica) Then
|
||||
MsgError = "Error al registrar detalle de concepto bancario"
|
||||
End If
|
||||
Else
|
||||
@@ -609,7 +576,7 @@ Partial Class Compras_ReembolsosComprobaciones
|
||||
Importe28 = TxtTotal.Text.ToDecimal
|
||||
End If
|
||||
'AGREGO PREPOLIZA FyE
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaIERegistrado, False, Importe28, TxtObservaciones.Text, 28, TxtObservaciones.Text, TxtFechaDocumento.Text.ToDate, IdCtaPersonal, -1, CvePersonal:=CvePersonal, CveIE:=CveIERegistrado, ImporteME:=If(tipoCambio = 1, 0, TxtImporte.Text.ToDecimal), ImporteMX:=Importe28 * tipoCambio, Contabilizable:=If(CveCajaChica > 0 Or CvePersonal > 0, Not UsaSimplificacionCajaChica, True)) Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaIERegistrado, False, Importe28, TxtObservaciones.Text, 28, TxtObservaciones.Text, TxtFechaDocumento.Text.ToDate, 0, -1, CvePersonal:=CvePersonal, CveIE:=CveIERegistrado, ImporteME:=If(tipoCambio = 1, 0, TxtImporte.Text.ToDecimal), ImporteMX:=Importe28 * tipoCambio, Contabilizable:=If(CveCajaChica > 0 Or CvePersonal > 0, Not UsaSimplificacionCajaChica, True)) Then
|
||||
MsgError = "Error al registrar detalle de concepto bancario"
|
||||
End If
|
||||
End If
|
||||
@@ -624,12 +591,12 @@ Partial Class Compras_ReembolsosComprobaciones
|
||||
CveIECajaChica = ObjIE.AddBancos_IE(CveCajaChica, 2, If(ChkReembolsarSinBancos.Checked, TxtFechaPrePoliza.Text.ToDate, TxtFechaDocumento.Text.Trim.ToDate), FolioIENew, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), TxtImporte.Text.ToDecimal, CveMoneda, 0, TxtObservaciones.Text.Trim, "", False, False, -1, CvePrePolizaIERegistrado, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked Or CveCajaChica > 0, True, False))
|
||||
'8
|
||||
'AGREGO PREPOLIZA IE BANCOS
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaIERegistrado, True, TxtImporte.Text.ToDecimal, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), 30, TxtObservaciones.Text, TxtFechaDocumento.Text.ToDate, IdCuentaBancaria, -1, CveIE:=CveIECajaChica, ImporteME:=If(tipoCambio = 1, 0, TxtImporte.Text.ToDecimal), ImporteMX:=TxtImporte.Text.ToDecimal * tipoCambio) Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaIERegistrado, True, TxtImporte.Text.ToDecimal, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), 30, TxtObservaciones.Text, TxtFechaDocumento.Text.ToDate, 0, -1, CveIE:=CveIECajaChica, ImporteME:=If(tipoCambio = 1, 0, TxtImporte.Text.ToDecimal), ImporteMX:=TxtImporte.Text.ToDecimal * tipoCambio) Then
|
||||
MsgError = "Error al registrar detalle de concepto bancario"
|
||||
End If
|
||||
Else
|
||||
'AGREGO PREPOLIZA FyE
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaIERegistrado, True, TxtImporteVinculado.Text.ToDecimal, TxtObservaciones.Text, 29, TxtObservaciones.Text, TxtFechaDocumento.Text.ToDate, IdCtaPersonal, -1, CvePersonal:=CvePersonal, CveIE:=CveIERegistrado, ImporteME:=If(tipoCambio = 1, 0, TxtImporte.Text.ToDecimal), ImporteMX:=TxtImporte.Text.ToDecimal * tipoCambio) Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaIERegistrado, True, TxtImporteVinculado.Text.ToDecimal, TxtObservaciones.Text, 29, TxtObservaciones.Text, TxtFechaDocumento.Text.ToDate, 0, -1, CvePersonal:=CvePersonal, CveIE:=CveIERegistrado, ImporteME:=If(tipoCambio = 1, 0, TxtImporte.Text.ToDecimal), ImporteMX:=TxtImporte.Text.ToDecimal * tipoCambio) Then
|
||||
MsgError = "Error al registrar detalle de concepto bancario"
|
||||
End If
|
||||
End If
|
||||
@@ -643,8 +610,6 @@ Partial Class Compras_ReembolsosComprobaciones
|
||||
Dim PorcentajePago As Decimal = 1
|
||||
|
||||
Dim FechaMovimiento As Date = TxtFechaDocumento.Text.ToDate
|
||||
Dim IdCtaProveedor As Integer = 0
|
||||
Dim IdCtaOtrosProductos As Integer = 0
|
||||
Dim CvePrePolizaUnificar As Integer = 0
|
||||
Dim SeUnifico = False
|
||||
'inserto las compras que voy a pagar
|
||||
@@ -656,12 +621,6 @@ Partial Class Compras_ReembolsosComprobaciones
|
||||
Dim Referencia As String = gvr.DataKey("SerieFolio").ToString
|
||||
Dim ImportePagar, ImporteOriginal As Decimal
|
||||
|
||||
If gvr.DataKey("CveTipoConcepto").ToEntero = 2 Then
|
||||
IdCtaProveedor = gvr.DataKey("IdCtaContAcreedor").ToEntero
|
||||
Else
|
||||
IdCtaProveedor = gvr.DataKey("IdCtaContProveedores").ToEntero
|
||||
End If
|
||||
|
||||
Dim CompraActual As New Compra
|
||||
CompraActual.CveCompra = gvr.DataKey("CveCompra").ToEntero
|
||||
CompraActual.CveTipoConceptoProveedor = gvr.DataKey("CveTipoConcepto").ToEntero
|
||||
@@ -728,7 +687,7 @@ Partial Class Compras_ReembolsosComprobaciones
|
||||
If Not ChkReembolsarSinBancos.Checked AndAlso (Not HdnCheque.Value.ToEntero > 0 Or Not UsuarioActual.CveEmpresa.Contiene(119, 158) AndAlso Not ChkMesSiguiente.Checked) Then
|
||||
'Si es caja chica metemos el concepto 30, si es funcionario metemos 29
|
||||
ImporteMovto += Pago.OtroGastoIngreso ' si ajuste, sedebe de aplicar en su contraparte
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, ImporteMovto, Referencia, If(CveCajaChica > 0, 30, 29), ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(CveCajaChica > 0, IdCuentaBancaria, IdCtaPersonal), -1, CveIE:=CveIEPago, CveIEDevolucion:=If(CveCajaChica > 0, If(DDlCheques.SelectedValue.ToEntero = -1, CveIECajaChica, DDlCheques.SelectedValue.ToEntero), -1), CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, ImporteMovto), ImporteMX:=ImporteMovto * tipoCambio, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, Contabilizable:=If(CveCajaChica > 0 Or CvePersonal > 0, Not UsaSimplificacionCajaChica, True)) Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, ImporteMovto, ImporteMovto * tipoCambio, If(CveCajaChica > 0, 30, 29), Referencia, ConceptoMovimiento, CveIE:=CveIEPago, CveIEDevolucion:=If(CveCajaChica > 0, If(DDlCheques.SelectedValue.ToEntero = -1, CveIECajaChica, DDlCheques.SelectedValue.ToEntero), -1), CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, ImporteMovto), CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, Contabilizable:=If(CveCajaChica > 0 Or CvePersonal > 0, Not UsaSimplificacionCajaChica, True)) Then
|
||||
MsgError = "Detalle"
|
||||
End If
|
||||
End If
|
||||
@@ -739,13 +698,13 @@ Partial Class Compras_ReembolsosComprobaciones
|
||||
If MsgError = "" AndAlso UsuarioActual.Empresa.Funcionalidad(506) = "1" And CbPermitirExcedente.Checked = True And SaldoExcedente > 0 Then
|
||||
If DDlPermitirExcedente.SelectedValue = "1" Then
|
||||
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, SaldoExcedente, Referencia, 132, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaOtrosProductos, -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, SaldoExcedente), ImporteMX:=SaldoExcedente * tipoCambio, CvePersonal:=CvePersonal, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal) Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, SaldoExcedente, SaldoExcedente * tipoCambio, 132, Referencia, ConceptoMovimiento, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, SaldoExcedente), CvePersonal:=CvePersonal, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal) Then
|
||||
MsgError = "Detalle Reembolso Personal"
|
||||
End If
|
||||
|
||||
ElseIf DDlPermitirExcedente.SelectedValue = "2" Then
|
||||
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, SaldoExcedente, Referencia, 29, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaPersonal, -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, SaldoExcedente), ImporteMX:=SaldoExcedente * tipoCambio, CvePersonal:=CvePersonal, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal) Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, SaldoExcedente, SaldoExcedente * tipoCambio, 29, Referencia, ConceptoMovimiento, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, SaldoExcedente), CvePersonal:=CvePersonal, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal) Then
|
||||
MsgError = "Detalle Reembolso Personal Excedente"
|
||||
End If
|
||||
End If
|
||||
@@ -788,7 +747,7 @@ Partial Class Compras_ReembolsosComprobaciones
|
||||
Pago.CveMonedaPago = CveMoneda
|
||||
Pago.CvePersonal = CvePersonal
|
||||
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaExcedente, True, ImporteMovto, Referencia, 30, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCuentaBancaria, -1, CveIE:=CveIEExcedente, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, ImporteMovto), ImporteMX:=ImporteMovto * tipoCambio, CveCuenta:=CveCuentaBancaria) Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaExcedente, True, ImporteMovto, ImporteMovto * tipoCambio, 30, Referencia, ConceptoMovimiento, CveIE:=CveIEExcedente, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, ImporteMovto)) Then
|
||||
MsgError = "no se pudo insertar el detalle de la poliza"
|
||||
End If
|
||||
|
||||
@@ -798,7 +757,7 @@ Partial Class Compras_ReembolsosComprobaciones
|
||||
|
||||
'Otros Ingresos
|
||||
If ChkAjusteOI.Checked Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaExcedente, True, gvr.FCTextBox("TxtComision").Text.ToDecimal, Referencia, 0, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaProveedor, -1, CveIE:=CveIERegistrado, CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveSubProyecto:=gvr.DataKey("CveSubProyecto").ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.FCTextBox("TxtComision").Text.ToDecimal), ImporteMX:=gvr.FCTextBox("TxtComision").Text.ToDecimal * tipoCambio) Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaExcedente, True, gvr.FCTextBox("TxtComision").Text.ToDecimal, gvr.FCTextBox("TxtComision").Text.ToDecimal * tipoCambio, 78, Referencia, ConceptoMovimiento, CveIE:=CveIERegistrado, CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveSubProyecto:=gvr.DataKey("CveSubProyecto").ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.FCTextBox("TxtComision").Text.ToDecimal)) Then
|
||||
MsgError = "no se pudo insertar el detalle de la poliza de otros ingresos"
|
||||
End If
|
||||
End If
|
||||
@@ -838,15 +797,19 @@ Partial Class Compras_ReembolsosComprobaciones
|
||||
Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError)
|
||||
End If
|
||||
End If
|
||||
Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1"
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
AutoConta = False
|
||||
End If
|
||||
|
||||
If MsgError = "" AndAlso ObjMov.ValidacionPrePolizaCuadre(CvePrePolizaPago, 1) Then
|
||||
If MsgError = "" AndAlso ObjMov.ValidacionPrePolizaCuadre(CvePrePolizaPago, 1, AutoConta:=AutoConta) Then
|
||||
If ObjMov.ValorPolizaDescuadre > 0 Then
|
||||
GuardaLogAD($"Compras/ReembolsosComprobaciones | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePolizaPago}", "LogPrePolizas")
|
||||
MsgError = ObjMov.MensajePolizaDescuadre
|
||||
End If
|
||||
End If
|
||||
|
||||
If MsgError = "" AndAlso CvePrePolizaExcedente > 0 AndAlso ObjMov.ValidacionPrePolizaCuadre(CvePrePolizaExcedente, 1) Then
|
||||
If MsgError = "" AndAlso CvePrePolizaExcedente > 0 AndAlso ObjMov.ValidacionPrePolizaCuadre(CvePrePolizaExcedente, 1, AutoConta:=AutoConta) Then
|
||||
If ObjMov.ValorPolizaDescuadre > 0 Then
|
||||
GuardaLogAD($"Compras/ReembolsosComprobaciones | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePolizaExcedente}", "LogPrePolizas")
|
||||
MsgError = ObjMov.MensajePolizaDescuadre
|
||||
@@ -855,50 +818,17 @@ Partial Class Compras_ReembolsosComprobaciones
|
||||
|
||||
If MsgError.Trim = "" Then
|
||||
|
||||
Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1"
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
AutoConta = False
|
||||
End If
|
||||
|
||||
'Conta ContPAQ AUTOMATICA
|
||||
If UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError.Trim = "" Then
|
||||
If CvePrePolizaIERegistrado > 0 Then
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
|
||||
If IdCtaPersonal > 0 Or DdlCajaChica.Visible Then
|
||||
If IdCtaProveedor > 0 Then
|
||||
If Not ObjMov.ContabilizarPrePoliza(CvePrePolizaIERegistrado, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
|
||||
MsgError = "Ocurrio un Error al contabilizar, pongase en contacto con Soporte Técnico"
|
||||
End If
|
||||
Else
|
||||
MsgError = "No tiene cuenta contable de proveedor"
|
||||
End If
|
||||
Else
|
||||
MsgError = "No tiene cuenta contable de personal"
|
||||
End If
|
||||
Else
|
||||
If Not ObjMov.ContabilizarPrePoliza(CvePrePolizaIERegistrado, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
|
||||
MsgError = "Ocurrio un Error al contabilizar, pongase en contacto con Soporte Técnico"
|
||||
End If
|
||||
If Not ObjMov.ContabilizarPrePoliza(CvePrePolizaIERegistrado, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
|
||||
MsgError = "Ocurrio un Error al contabilizar, pongase en contacto con Soporte Técnico"
|
||||
End If
|
||||
End If
|
||||
|
||||
If ChkChequeExcedente.Checked Then
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
|
||||
If IdCuentaBancaria > 0 Then
|
||||
If IdCtaProveedor > 0 Then
|
||||
If Not ObjMov.ContabilizarPrePoliza(CvePrePolizaIERegistrado, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
|
||||
MsgError = "Ocurrio un Error al contabilizar, pongase en contacto con Soporte Técnico"
|
||||
End If
|
||||
Else
|
||||
MsgError = "No tiene cuenta contable de proveedor"
|
||||
End If
|
||||
Else
|
||||
MsgError = "No tiene cuenta contable de personal"
|
||||
End If
|
||||
Else
|
||||
If Not ObjMov.ContabilizarPrePoliza(CvePrePolizaIERegistrado, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
|
||||
MsgError = "Ocurrio un Error al contabilizar, pongase en contacto con Soporte Técnico"
|
||||
End If
|
||||
If Not ObjMov.ContabilizarPrePoliza(CvePrePolizaIERegistrado, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
|
||||
MsgError = "Ocurrio un Error al contabilizar, pongase en contacto con Soporte Técnico"
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -1190,7 +1120,6 @@ Partial Class Compras_ReembolsosComprobaciones
|
||||
|
||||
'If dr IsNot Nothing Then
|
||||
' CveMoneda = dr("CveMoneda").ToString.ToEntero
|
||||
' IdCuentaBancaria = dr("IdCtaContable").ToString.ToEntero
|
||||
'End If
|
||||
|
||||
'If HdnTipoTransaccion.Value = "Egs" Then
|
||||
|
||||
@@ -2006,10 +2006,10 @@
|
||||
<Width>2.35552in</Width>
|
||||
</TablixColumn>
|
||||
<TablixColumn>
|
||||
<Width>0.76635in</Width>
|
||||
<Width>0.67141in</Width>
|
||||
</TablixColumn>
|
||||
<TablixColumn>
|
||||
<Width>0.57354in</Width>
|
||||
<Width>0.66848in</Width>
|
||||
</TablixColumn>
|
||||
<TablixColumn>
|
||||
<Width>0.59047in</Width>
|
||||
@@ -2415,7 +2415,7 @@
|
||||
<FontFamily>Myriad Pro</FontFamily>
|
||||
<FontSize>7.5pt</FontSize>
|
||||
<FontWeight>Normal</FontWeight>
|
||||
<Format>#,0.00</Format>
|
||||
<Format>#,0.000</Format>
|
||||
</Style>
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
@@ -2557,7 +2557,9 @@
|
||||
</Style>
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
<Style />
|
||||
<Style>
|
||||
<TextAlign>Center</TextAlign>
|
||||
</Style>
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>CodigoObjetoImpuesto</rd:DefaultName>
|
||||
@@ -2571,6 +2573,7 @@
|
||||
<PaddingBottom>2pt</PaddingBottom>
|
||||
</Style>
|
||||
</Textbox>
|
||||
<rd:Selected>true</rd:Selected>
|
||||
</CellContents>
|
||||
</TablixCell>
|
||||
<TablixCell>
|
||||
|
||||
@@ -1877,7 +1877,7 @@
|
||||
|
||||
|
||||
//Muestra nombre de la empresa si esta tarea sea asigno desde EmpresaCRM
|
||||
if (event.CveEmpresaCRM > 0 || event.CveAcercamientoCRM > 0 || event.CvePersonal > 0 || event.CveCliente > 0 || event.CveProveedor > 0 ) {
|
||||
if (event.CveEmpresaCRM > 0 || event.CveAcercamientoCRM > 0 || event.CvePersonal > 0 || event.CveCliente > 0 || event.CveProveedor > 0 || event.CveCompra > 0) {
|
||||
|
||||
$("#<%=LnkTituloLink.ClientID%>").css("display", "");
|
||||
|
||||
@@ -1907,6 +1907,13 @@
|
||||
$("#<%=LnkTituloLink.ClientID%>").attr("href", "/Compras/Proveedores.aspx?CveProveedor=" + event.CveProveedor);
|
||||
}
|
||||
|
||||
if (event.CveCompra > 0) {
|
||||
$("#<%=LnkTituloLink.ClientID%>").text("Comppra: " + event.SerieFolioCompra);
|
||||
$("#<%=LnkTituloLink.ClientID%>").attr("href", "/Compras/Compras.aspx?CveCompra=" + event.CveCompra);
|
||||
}
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
$("#<%=LnkTituloLink.ClientID%>").css("display", "none")
|
||||
|
||||
@@ -3940,7 +3940,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
Else
|
||||
|
||||
Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={DdlAlmacen.SelectedValue.ToEntero}").ToEntero
|
||||
Dim tCveConcepto As Integer = 69
|
||||
Dim tCveConcepto As Integer = 69
|
||||
If ObjInventario.CveConcepto = 37 Then
|
||||
tCveConcepto = 181
|
||||
End If
|
||||
@@ -3955,12 +3955,12 @@ Partial Class Inventarios_EntradasSalidas
|
||||
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, MovAlmacen, DtCostos.SUMD("Total").RoundSQL, DtCostos.SUMD("Total").RoundSQL, 68, Concepto, Concepto, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimiento, Contabilizable:=Contabilizable) Then
|
||||
ErrorMovInv = True
|
||||
|
||||
@@ -827,7 +827,14 @@ Partial Class OC_OC
|
||||
|
||||
DdlSubProyecto.Items.Clear()
|
||||
' aqui tiene otras condiciones especiales
|
||||
DdlSubProyecto.DataSource = DtEstatusUsuarios.FiltraParametros("", "", {"CveSubProyecto", "SubProyecto"}) 'If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, CveEmpresaActual, -1, 1), GlobalDTSubProyectos(-1, -1, CveEmpresaActual, 1)) ' DtEstatusUsuarios.FiltraParametros("", "", {"CveSubProyecto", "SubProyecto"})
|
||||
If CveOrdenCompra <> Nothing AndAlso CveOrdenCompra > 0 Then
|
||||
DdlSubProyecto.DataSource = DtEstatusUsuarios.FiltraParametros("", "", {"CveSubProyecto", "SubProyecto"})
|
||||
Else
|
||||
DdlSubProyecto.DataSource = DtEstatusUsuarios.FiltraParametros(" SPEstatus = 1 ", "", {"CveSubProyecto", "SubProyecto"})
|
||||
End If
|
||||
|
||||
|
||||
|
||||
DdlSubProyecto.DataBind()
|
||||
DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
DdlSubProyectoContrato.Items.Clear()
|
||||
@@ -1959,7 +1966,14 @@ Partial Class OC_OC
|
||||
Dim Filtro As String = If(DdlProyecto.SelectedValue.ToEntero > 0 AndAlso UsuarioActual.Empresa.Tipo_CentroCosto.Contiene(4, 5), String.Format("CveProyecto = {0}", DdlProyecto.SelectedValue.ToEntero), "")
|
||||
|
||||
DdlSubProyecto.Items.Clear()
|
||||
DdlSubProyecto.DataSource = DtEstatusUsuarios.FiltraParametros(Filtro, "", {"CveSubProyecto", "SubProyecto"}) 'If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, DdlProyecto.SelectedValue.ToEntero, CveEmpresaActual, -1, 1), GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero, -1, CveEmpresaActual, 1)) 'DtEstatusUsuarios.FiltraParametros(Filtro, "", {"CveSubProyecto", "SubProyecto"}) ' GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero)
|
||||
|
||||
If CveOrdenCompra <> Nothing AndAlso CveOrdenCompra > 0 Then
|
||||
DdlSubProyecto.DataSource = DtEstatusUsuarios.FiltraParametros(Filtro, "", {"CveSubProyecto", "SubProyecto"})
|
||||
Else
|
||||
DdlSubProyecto.DataSource = DtEstatusUsuarios.FiltraParametros(" SPEstatus = 1 ").FiltraParametros(Filtro, "", {"CveSubProyecto", "SubProyecto"})
|
||||
'DdlSubProyecto.DataSource = DtEstatusUsuarios.FiltraParametros(" SPEstatus = 1 ", "", {"CveSubProyecto", "SubProyecto"})
|
||||
End If
|
||||
|
||||
DdlSubProyecto.DataBind()
|
||||
|
||||
DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
@@ -2543,6 +2557,12 @@ Partial Class OC_OC
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If TipoOC.ToUpper = "REQ" AndAlso CveEstatusFinalOK = CboE.SelectedValue.ToEntero AndAlso DdlProveedores.SelectedValue.ToEntero <= 0 Then
|
||||
Alert("Debe seleccionar un proveedor.", TipoMensaje.MsgAdvertencia)
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
'VALIDA QUE TENGA LAS COTIZACIONES QUE DEBEN TENER
|
||||
If UsuarioActual.Empresa.Funcionalidad(565) = "1" AndAlso (TipoOC.ToUpper = "REQ" And CveEstatusFinalOK = CboE.SelectedValue.ToEntero) Then
|
||||
If CveConfianzaProveedor > 0 Then
|
||||
@@ -3030,13 +3050,13 @@ Partial Class OC_OC
|
||||
' Exit For
|
||||
'End If
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -DiferenciaInvOC, SerieFolio, 177, SerieFolio, Fecha, 0, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=-DiferenciaInvOC, CveOCDetalle:=CveOCDetalle, CveSubProyecto:=tCveSubProyecto) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -DiferenciaInvOC, -DiferenciaInvOC, 177, SerieFolio, SerieFolio, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, CveOCDetalle:=CveOCDetalle, CveSubProyecto:=tCveSubProyecto) Then
|
||||
TieneError = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteME, SerieFolio, 228, SerieFolio, Fecha, 0, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=ImporteME, ImporteME:=ImporteME, TipoCambio:=TCInvOC, CveOCDetalle:=CveOCDetalle) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMEComp, SerieFolio, 229, SerieFolio, Fecha, 0, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=ImporteMEComp, ImporteME:=ImporteME, TipoCambio:=TCInvOC, CveOCDetalle:=CveOCDetalle) Then
|
||||
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteME, ImporteME, 228, SerieFolio, SerieFolio, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteME:=ImporteME, TipoCambio:=TCInvOC, CveOCDetalle:=CveOCDetalle) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMEComp, ImporteMEComp, 229, SerieFolio, SerieFolio, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteME:=ImporteME, TipoCambio:=TCInvOC, CveOCDetalle:=CveOCDetalle) Then
|
||||
TieneError = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -4038,19 +4058,6 @@ Partial Class OC_OC
|
||||
IEPSPS = DrPS("IEPSPorcentaje").ToString.ToDecimal
|
||||
IEPSPSIVA = If(DrPS("IEPSGrabaIVA").ToString = "True", DrPS("IEPSPorcentaje").ToString.ToDecimal, 0)
|
||||
|
||||
If CvePS <> CvePSAnterior Or Not CveOrdenCompra > 0 Then
|
||||
RetISR = DrPS("RetISR").ToString.ToDecimal
|
||||
RetIVA = DrPS("RetIVA").ToString.ToDecimal
|
||||
If Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2) = 0.08 Then
|
||||
RetIVA = RetIVA / 2
|
||||
End If
|
||||
'If IvaPS = -1 Then 'IVA DE LA SUCURSAL
|
||||
' IvaPS = GlobalDTSubProyectos(-1, gvr.FCDropDownList("DdlSubProyectoEdit").SelectedValue.ToEntero).FiltroPrimeroValor("IVA").ToDecimal
|
||||
'End If
|
||||
|
||||
' IEPSPSIVA = If(DrPS("IEPSGrabaIVA").ToString = "True", DrPS("IEPSPorcentaje").ToString.ToDecimal, 0)
|
||||
End If
|
||||
|
||||
If DdlProveedores.SelectedValue.ToEntero > 0 Then
|
||||
'Si es Proveedor Extranjero el IVA es 0%
|
||||
Dim drProv As DataRow = GlobalDTCompProveedores(CveEmpresaActual, CveProveedor:=DdlProveedores.SelectedValue.ToEntero).FiltroPrimero("")
|
||||
@@ -4065,6 +4072,17 @@ Partial Class OC_OC
|
||||
End If
|
||||
End If
|
||||
|
||||
If CvePS <> CvePSAnterior Or Not CveOrdenCompra > 0 Then
|
||||
RetISR = DrPS("RetISR").ToString.ToDecimal
|
||||
RetIVA = DrPS("RetIVA").ToString.ToDecimal
|
||||
If Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2) = 0.08 Then
|
||||
RetIVA = RetIVA / 2
|
||||
End If
|
||||
IvaPS = -1
|
||||
End If
|
||||
|
||||
|
||||
|
||||
CveSubProyecto = gvr.FCDropDownList("DdlSubProyectoEdit").SelectedValue.ToEntero
|
||||
SubProyecto = gvr.FCDropDownList("DdlSubProyectoEdit").SelectedItem.Text
|
||||
|
||||
@@ -8122,12 +8140,12 @@ Partial Class OC_OC
|
||||
PU = ObjOC.DtResultados.FiltroPrimeroValor("Importe228").ToDecimal * TCAjuste
|
||||
ImporteCI176 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteCI228").ToDecimal
|
||||
Importe176 = Importe228 + Importe229
|
||||
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, 1, -Importe228, lblFolio.Text, 228, Concepto, Now, 0, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=-Importe228, ImporteME:=-Importe228, CveOCDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToString.ToEntero, TipoCambio:=TCAjuste, CveMovimientoAlmacen:=CveMovimientoAlmacen) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, 1, -Importe229, lblFolio.Text, 229, Concepto, Now, 0, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=-Importe229, ImporteME:=-Importe228, CveOCDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToString.ToEntero, TipoCambio:=TCAjuste, CveMovimientoAlmacen:=CveMovimientoAlmacen) Then
|
||||
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, 1, -Importe228, -Importe228, 228, lblFolio.Text, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteME:=-Importe228, CveOCDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToString.ToEntero, TipoCambio:=TCAjuste, CveMovimientoAlmacen:=CveMovimientoAlmacen) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, 1, -Importe229, -Importe229, 229, lblFolio.Text, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteME:=-Importe228, CveOCDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToString.ToEntero, TipoCambio:=TCAjuste, CveMovimientoAlmacen:=CveMovimientoAlmacen) Then
|
||||
ErrorPrepoliza = True
|
||||
Exit For
|
||||
Else
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, 1, Importe176, lblFolio.Text, 176, Concepto, Now, 0, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=Importe176, ImporteME:=Importe176, CveOCDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimientoAlmacen) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, 1, Importe176, Importe176, 176, lblFolio.Text, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteME:=Importe176, CveOCDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimientoAlmacen) Then
|
||||
ErrorPrepoliza = True
|
||||
Exit For
|
||||
Else
|
||||
@@ -8145,7 +8163,7 @@ Partial Class OC_OC
|
||||
''-pesos a dólares
|
||||
CveMonedaOC = 2
|
||||
TCAjuste = TxtTCCambioMoneda.Text.ToDecimal
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -Importe176, lblFolio.Text, 176, Concepto, Now, 0, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=-Importe176, ImporteME:=-Importe176, CveOCDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimientoAlmacen) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -Importe176, -Importe176, 176, lblFolio.Text, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteME:=-Importe176, CveOCDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimientoAlmacen) Then
|
||||
ErrorPrepoliza = True
|
||||
Exit For
|
||||
Else
|
||||
@@ -8162,17 +8180,16 @@ Partial Class OC_OC
|
||||
PU = Importe176PU
|
||||
If Not ConservaPU Then PU = Importe176PU / TCAjuste
|
||||
|
||||
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Importe228, lblFolio.Text, 228, Concepto, Now, 0, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=Importe228, ImporteME:=Importe228, CveOCDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToString.ToEntero, TipoCambio:=TCAjuste, CveMovimientoAlmacen:=CveMovimientoAlmacen) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Importe229, lblFolio.Text, 229, Concepto, Now, 0, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=Importe229, ImporteME:=Importe228, CveOCDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToString.ToEntero, TipoCambio:=TCAjuste, CveMovimientoAlmacen:=CveMovimientoAlmacen) Then
|
||||
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Importe228, Importe228, 228, lblFolio.Text, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteME:=Importe228, CveOCDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToString.ToEntero, TipoCambio:=TCAjuste, CveMovimientoAlmacen:=CveMovimientoAlmacen) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Importe229, Importe229, 229, lblFolio.Text, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteME:=Importe228, CveOCDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToString.ToEntero, TipoCambio:=TCAjuste, CveMovimientoAlmacen:=CveMovimientoAlmacen) Then
|
||||
ErrorPrepoliza = True
|
||||
Exit For
|
||||
Else
|
||||
If difcosto <> 0 Then
|
||||
Dim tcveSub As Integer = DtDetalle.MAX("CveSubProyecto").ToEntero
|
||||
Dim tcveClasif As Integer = DtDetalle.MAX("CveClasificacion").ToEntero
|
||||
Dim IdCtaContable69 As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {tcveClasif}").ToString.ToEntero
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, difcosto, lblFolio.Text, 69, Concepto, Now, IdCtaContable69, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=difcosto, ImporteME:=difcosto, CveOCDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToString.ToEntero, TipoCambio:=TCAjuste, CveSubProyecto:=tcveSub, CveClasificacion:=tcveClasif, CveMovimientoAlmacen:=CveMovimientoAlmacen) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, difcosto, difcosto, 69, lblFolio.Text, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteME:=difcosto, CveOCDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToString.ToEntero, TipoCambio:=TCAjuste, CveSubProyecto:=tcveSub, CveClasificacion:=tcveClasif, CveMovimientoAlmacen:=CveMovimientoAlmacen) Then
|
||||
ErrorPrepoliza = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
@@ -334,6 +334,10 @@ Partial Class OI_PopUpAgenda
|
||||
CargaContarto(Request("CveContrato").ToEntero)
|
||||
End If
|
||||
|
||||
If Request("CveCompra") IsNot Nothing AndAlso IsNumeric(Request("CveCompra")) AndAlso Request("CveCompra").ToEntero > 0 Then
|
||||
CargaCompra(CveCompra:=Request("CveCompra").ToEntero)
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If Request("CveEvento") IsNot Nothing AndAlso IsNumeric(Request("CveEvento")) AndAlso Request("CveEvento").ToEntero > 0 Then
|
||||
@@ -355,6 +359,9 @@ Partial Class OI_PopUpAgenda
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub Tarea() '1
|
||||
CveTipoEvento = 1
|
||||
|
||||
@@ -684,6 +691,12 @@ Partial Class OI_PopUpAgenda
|
||||
CveUsuario = Request("CveUsuario").ToEntero
|
||||
End If
|
||||
|
||||
|
||||
Dim CveCompra As Integer = -1
|
||||
If Request("CveCompra") IsNot Nothing AndAlso IsNumeric(Request("CveCompra")) AndAlso Request("CveCompra").ToEntero > 0 Then
|
||||
CveCompra = Request("CveCompra").ToEntero
|
||||
End If
|
||||
|
||||
'------------------------------------------
|
||||
'Recorrro Grid para obtener el usuario PARA
|
||||
For Each RowPara As GridViewRow In GVUsuarios.Rows
|
||||
@@ -710,7 +723,7 @@ Partial Class OI_PopUpAgenda
|
||||
Alert("La Nueva Tarea se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
ElseIf CveTipoEvento = 2 Then
|
||||
If ObjEventos.AddEventoAgenda(CveAgendaTipo, Asunto, Descripcion, Prioridad, FechaInicio.ToDateTime, FechaFin.ToDateTime, CveUsuarioIng, CveEmpresa, CveActivoFijo, CveIE, CveProspecto, CveCliente, CveOS, CveOC, CvePersonal, CveProveedor) Then
|
||||
If ObjEventos.AddEventoAgenda(CveAgendaTipo, Asunto, Descripcion, Prioridad, FechaInicio.ToDateTime, FechaFin.ToDateTime, CveUsuarioIng, CveEmpresa, CveActivoFijo, CveIE, CveProspecto, CveCliente, CveOS, CveOC, CvePersonal, CveProveedor, CveCompra:=CveCompra) Then
|
||||
Alert("La Nueva Agenda se guardó correctamente.", TipoMensaje.MsgInformacion, "self.parent.tb_remove();self.parent.location.reload();")
|
||||
End If
|
||||
ElseIf CveTipoEvento = 3 Then
|
||||
@@ -1260,13 +1273,13 @@ Partial Class OI_PopUpAgenda
|
||||
End Sub
|
||||
Private Sub CargaProveedor(CveProveedor As Integer)
|
||||
|
||||
'Dim ObjClaves As New ClsCompProveedores
|
||||
' hacerlo con el global dt
|
||||
'If ObjClaves.GetProveedores(CveProveedor, "-1", "-1", "-1", "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) Then
|
||||
' If ObjClaves.DtResultados.Rows.Count > 0 Then
|
||||
' LtlAgenda.Text = ObjClaves.CveProveedor & " - " & ObjClaves.NombreComercial
|
||||
' End If
|
||||
'End If
|
||||
Dim ObjClaves As New ClsCompProveedores
|
||||
|
||||
If ObjClaves.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, CveProveedor, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
|
||||
If ObjClaves.DtResultados.Rows.Count > 0 Then
|
||||
LtlAgenda.Text = ObjClaves.CveProveedor & " - " & ObjClaves.NombreComercial
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Private Sub CargaUsuario(CveUsuario As Integer)
|
||||
@@ -1290,6 +1303,16 @@ Partial Class OI_PopUpAgenda
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaCompra(CveCompra As Integer)
|
||||
Dim objCompra As New ClsCompras
|
||||
|
||||
If objCompra.GetCompras(CveCompra, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa) Then
|
||||
Dim dr As DataRow = objCompra.DtResultados.Rows(0)
|
||||
LtlAgenda.Text = $" Compra: {dr("SerieFolio").ToString}"
|
||||
End If
|
||||
objCompra.Dispose()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
|
||||
@@ -502,8 +502,8 @@ Partial Class Sistemas_DefinicionEmpresa
|
||||
TxtPlantillaVenta.Text = .PlantillaMailVenta
|
||||
TxtAsunto.Text = .AsuntoPlantillaMailVenta
|
||||
|
||||
TxtPlantillaCotizacion.Text = .AsuntoPlantillaMailVentaCotizacion
|
||||
TxtAsuntoCotizacion.Text = .PlantillaMailVentaCotizacion
|
||||
TxtPlantillaCotizacion.Text = .PlantillaMailVentaCotizacion
|
||||
TxtAsuntoCotizacion.Text = .AsuntoPlantillaMailVentaCotizacion
|
||||
|
||||
'NUEVOS
|
||||
TxtAreaGeografica.Text = .AreaGeografica
|
||||
@@ -914,7 +914,7 @@ Partial Class Sistemas_DefinicionEmpresa
|
||||
If TextoError = "" Then
|
||||
ObjEmpresas.Commit()
|
||||
If ObjContPAQ IsNot Nothing Then ObjContPAQ.Commit()
|
||||
Alert(TextoOK, TipoMensaje.MsgInformacion, "document.location.href=""/Sistemas/Empresa2.aspx"";")
|
||||
Alert(TextoOK, TipoMensaje.MsgInformacion, "document.location.href=""/Sistemas/DefinicionEmpresa.aspx"";")
|
||||
Session("FileUpload") = ""
|
||||
CargaDatos()
|
||||
UpDatos.Update()
|
||||
|
||||
@@ -4853,11 +4853,17 @@
|
||||
<i class="fa fa-commenting font-green"></i>
|
||||
<span class="caption-subject bold">Agregar</span>
|
||||
</div>--%>
|
||||
<asp:HyperLink ID="ImgAddObs" CssClass="caption-subject bold" data-toggle="modal" data-target="#ModalBitacora" runat="server" Text=" <i class='fa fa-commenting font-green' ></i><span class='caption-subject bold'>Agregar</span>" Style="font-weight: 700 !important; cursor: pointer;" ToolTip="Observaciones"></asp:HyperLink><br />
|
||||
<asp:HyperLink ID="HlEvento" CssClass="thickbox caption-subject bold" runat="server" Text=" <i class='fa fa-calendar-plus-o font-green' ></i>Agendar" Visible="false" Style="font-weight: 700 !important; cursor: pointer;" ToolTip="Agendar"></asp:HyperLink><br />
|
||||
|
||||
<asp:HyperLink ID="ImgAddObs" CssClass="caption-subject bold font-green" data-toggle="modal" data-target="#ModalBitacora" runat="server"
|
||||
Text=" <i class='fa fa-commenting font-green' ></i><span class='caption-subject bold'>Agregar</span>" Style="font-weight: 700 !important; cursor: pointer " ToolTip="Observaciones"></asp:HyperLink><br />
|
||||
|
||||
<asp:HyperLink ID="HlEvento" CssClass="thickbox caption-subject bold font-green" runat="server"
|
||||
Text="" Visible="false" Style="font-weight: 700 !important; cursor: pointer" ToolTip="Agendar" ><i class='fa fa-calendar-plus-o font-green' ></i>Agendar</asp:HyperLink><br />
|
||||
|
||||
<asp:Literal ID="LtlTareaNueva" runat="server"></asp:Literal>
|
||||
<UserControl:TareaNueva runat="server" ID="TareaNueva" />
|
||||
<script> function OnAddedTareaNueva() { $('.btnupEventoBitacora').click(); }</script>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1333,7 +1333,6 @@
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit"
|
||||
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
<asp:LinkButton ID="ImgEPyME" Visible="false" runat="server" AlternateText="Editar" CausesValidation="False" CssClass="btn btn-circle btn-sm green" OnClick="Edit_Click" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%--18--%>
|
||||
@@ -6332,113 +6331,6 @@
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
<div id="DivAddVenta" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpVenta" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabelVenta">Registrar Producto/Servicio</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtCantidadPyME" runat="server" ClientIDMode="Static" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender6" runat="server" TargetControlID="TxtCantidadPyME" FilterType=" Numbers" />
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtCantidadPyME" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtCantidadPyME.ClientID.ToString()%>">Cantidad:</label>
|
||||
</div>
|
||||
<asp:UpdatePanel runat="server" ID="UpClasificacionPyME" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div id="DivAddClasificacionPyME" runat="server" class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlClasificacionPyME" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Width="50%">
|
||||
<asp:ListItem Selected="True" Text="Seleccione la Clasificación (Todas)" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<label for="<%= DdlClasificacionPyME.ClientID.ToString()%>">Clasificacion:</label>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="<%= DdlPSPyME.ClientID.ToString()%>">Producto/Servicio:</label>
|
||||
<ADS:Dropdownlost runat="server" ID="DdlPSPyME" CssStyle="width: 100%;" CssClass=" form-control input-sm DdlPS" IncluyeTodos="false" CssClassDdl="select2me form-control" DataTextField="PSCodigo" DataValueField="CvePS" data-onresult="CargaExistenciaAlmacenes" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<br />
|
||||
<div id="DivAddUMPyME" runat="server" class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlUMPyME" AppendDataBoundItems="true" CssClass="form-control input-sm select2me " runat="server" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida" Style="width: 50%; max-width: 150px;"></asp:DropDownList>
|
||||
<label for="<%= DdlUMPyME.ClientID.ToString()%>">Unidad de Medida:</label>
|
||||
</div>
|
||||
<br />
|
||||
<div>
|
||||
<label>Observación:</label>
|
||||
<br />
|
||||
<asp:TextBox ID="TxtObsPyME" runat="server" CssClass="form-control input-sm" Height="50" TextMode="MultiLine" CausesValidation="true" MaxLength="500"></asp:TextBox>
|
||||
</div>
|
||||
<div id="divproyectos" runat="server">
|
||||
<asp:UpdatePanel ID="UPPProyecto" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="form-group form-md-line-input input-iconright" id="divProyectoPyME" runat="server">
|
||||
<asp:Label ID="LblProyectoPyME" runat="server" for="<%= DdlProyectoPyME.ClientID.ToString()%>">Proyecto:</asp:Label>
|
||||
<asp:DropDownList ID="DdlProyectoPyME" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Proyecto" DataValueField="CveProyecto" Width="50%">
|
||||
<asp:ListItem Selected="true" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:Label ID="LblSubProyectoPyME" runat="server" for="<%= DdlSubProyectoPyME.ClientID.ToString()%>">SubProyecto:</asp:Label>
|
||||
<asp:DropDownList ID="DdlSubProyectoPyME" CssClass="form-control input-sm select2me" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="50%">
|
||||
<asp:ListItem Selected="true" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtPrecioPyME" runat="server" CausesValidation="true" lang="nb" ClientIDMode="Static" MaxLength="12" ValidationGroup="GrpAddVenta" CssClass="form-control"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender5" runat="server" TargetControlID="TxtPrecioPyME" FilterType="Custom, Numbers" ValidChars="." />
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtPrecioPyME" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Precio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtPrecioPyME.ClientID.ToString()%>">Precio:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtDescuentoPyME" runat="server" Enabled="false" CausesValidation="true" lang="nb" ClientIDMode="Static" MaxLength="12" CssClass="form-control"></asp:TextBox>
|
||||
<label for="<%= TxtDescuentoPyME.ClientID.ToString()%>">Descuento:</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<asp:Label ID="LblTot" runat="server">Total: $</asp:Label>
|
||||
<asp:Label ID="LblTotalPyME" runat="server" ClientIDMode="Static" Text="0.00"></asp:Label>
|
||||
</div>
|
||||
<div class="col-md-6" align="right" id="divagregrarotrops" runat="server">
|
||||
<label>Agregar otro Producto:</label>
|
||||
<asp:CheckBox ID="ChkAgregar" runat="server" Checked="true" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:Button ClientIDMode="Static" ID="LnkAgregarPyME" runat="server" CssClass="btn btn-primary" Enabled="false" Text="Agregar" ValidationGroup="GrpAddVenta" />
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<asp:UpdatePanel UpdateMode="conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:Button Text="text" ID="BtnReordenar" ClientIDMode="static" Style="display: none" runat="server" />
|
||||
|
||||
@@ -74,15 +74,6 @@ Partial Class Ventas
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property idCuentaContabilizacion As Integer
|
||||
Get
|
||||
Return ViewState("idCuentaContabilizacion").ToString().ToEntero()
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("idCuentaContabilizacion") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CuentasContablesInvalidas As StringBuilder
|
||||
Get
|
||||
Return CType(ViewState("CuentasContablesInvalidas"), StringBuilder)
|
||||
@@ -2385,7 +2376,6 @@ Partial Class Ventas
|
||||
Me.CveVendedorContrato = -1
|
||||
Me.CveVendedorEmpresaCRM = -1
|
||||
Me.EsGarantia = False
|
||||
idCuentaContabilizacion = 1
|
||||
CveEmpresaCRM = 0
|
||||
CveAcercamientoCRM = 0
|
||||
EstatusCliente = False
|
||||
@@ -2553,8 +2543,6 @@ Partial Class Ventas
|
||||
LblUsuario.Text = UsuarioActual.Usuario
|
||||
LblFechaRegistro.Text = Now.ToShortDateString()
|
||||
|
||||
TxtPrecioPyME.Attributes.Add("onKeyUp ", "RecalculaPyME();")
|
||||
TxtCantidadPyME.Attributes.Add("onKeyUp ", "RecalculaPyME();")
|
||||
ImgDescPU.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '0'; $get('LblPrecio1').style.display = ''; $get('LblTotalPS1').style.display = 'none'; $get('LblSubTotal1').style.display = 'none'; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = ''; $get('BtnAplicarDescG').style.display = 'none'; $get('TrMotivoDescuento').style.display = '';")
|
||||
ImgDescConcepto.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '1'; $get('LblPrecio1').style.display = 'none'; $get('LblTotalPS1').style.display = ''; $get('LblSubTotal1').style.display = 'none'; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = ''; $get('BtnAplicarDescG').style.display = 'none'; $get('TrMotivoDescuento').style.display = '';")
|
||||
ImgDescTotal.Visible = False
|
||||
@@ -2583,9 +2571,6 @@ Partial Class Ventas
|
||||
TabAlmacen.Enabled = UsuarioActual.Empresa.UsaInventarios
|
||||
TxtPorDescP.Attributes.Add("onKeyUp", "CalculaDescuento();")
|
||||
TxtDescP.Attributes.Add("onKeyUp", "CalculaDescuento();")
|
||||
TxtCantidadPyME.Attributes.Add("onkeypress", "cambiaFoco('TxtPrecioPyME')")
|
||||
TxtObsPyME.Attributes.Add("onkeypress", "cambiaFoco('TxtPrecioPyME')")
|
||||
TxtPrecioPyME.Attributes.Add("onkeypress", "CallServerMethod(event)")
|
||||
|
||||
CreaDTmpC()
|
||||
CreaDTmpF()
|
||||
@@ -2599,7 +2584,6 @@ Partial Class Ventas
|
||||
CargaPS(-1, DdlPSMercancia)
|
||||
CargaPS(-1, DdlPSFlete)
|
||||
'CargaPSRemision(-1, DdlPSRemision)
|
||||
CargaPSPyME(-1, DdlPSPyME)
|
||||
|
||||
CreaDTVentas()
|
||||
CargaMetodosPago()
|
||||
@@ -2648,11 +2632,6 @@ Partial Class Ventas
|
||||
HdnCveCliente.Value = Request("CveCliente")
|
||||
CargaCliente(CveCliente)
|
||||
VerificarContrato(True)
|
||||
ElseIf Request("CveFactura") IsNot Nothing AndAlso IsNumeric(Request("CveFactura")) AndAlso Request("CveFactura").ToEntero() > 0 AndAlso Request("CveCliente") IsNot Nothing AndAlso IsNumeric(Request("CveCliente")) AndAlso Request("CveCliente").ToEntero() > 0 Then
|
||||
ViewState("CveCliente") = Request("CveCliente")
|
||||
ViewState("CveFactura") = Request("CveFactura").ToEntero()
|
||||
Dim RFC As String = CargaFactura(CveFactura)
|
||||
CargaCliente(CveCliente)
|
||||
Else
|
||||
ViewState("CveCliente") = -1
|
||||
HdnCveCliente.Value = "-1"
|
||||
@@ -3216,10 +3195,7 @@ Partial Class Ventas
|
||||
|
||||
CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyectoHeader, LblSubProyecto, AplicaTodos:="")
|
||||
DdlSubProyecto.SelectedValueExist(DdlSubProyectoDatos.SelectedValue)
|
||||
CargarCentrosDeCosto(DdlProyectoPyME, DdlSubProyectoPyME, LblProyectoPyME, LblSubProyectoPyME, AplicaTodos:="")
|
||||
DdlProyectoPyME.SelectedValueExist(DdlSubProyectoDatos.SelectedValue)
|
||||
BrSubProyecto.Visible = DdlProyecto.Visible
|
||||
divProyectoPyME.Visible = DdlProyecto.Visible
|
||||
|
||||
If UsuarioActual.CveEmpresa.Contiene(172, 173) Then
|
||||
LnkAddVenta.Visible = True
|
||||
@@ -3242,10 +3218,6 @@ Partial Class Ventas
|
||||
Gvr.FCLinkButton("imgEPyME").Visible = True
|
||||
Next
|
||||
LnkAddVenta.Visible = True
|
||||
divproyectos.Visible = False
|
||||
|
||||
DivAddClasificacionPyME.Visible = False
|
||||
DivAddUMPyME.Visible = False
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.CvePlataforma = 2 Then
|
||||
@@ -3264,10 +3236,6 @@ Partial Class Ventas
|
||||
Gvr.FCLinkButton("imgEPyME").Visible = True
|
||||
Next
|
||||
LnkAddVenta.Visible = True
|
||||
divproyectos.Visible = False
|
||||
|
||||
DivAddClasificacionPyME.Visible = False
|
||||
DivAddUMPyME.Visible = False
|
||||
End If
|
||||
|
||||
TabVentaAF.Visible = (UsuarioActual.CveRol = 1)
|
||||
@@ -5517,7 +5485,6 @@ Partial Class Ventas
|
||||
ImgDescTotal.Attributes.Clear()
|
||||
ImgDescConcepto.Attributes.Clear()
|
||||
LbAgregar.Enabled = False
|
||||
LnkAgregarPyME.Enabled = False
|
||||
DdlCuentasTerminal.Enabled = False
|
||||
|
||||
For Each Row As GridViewRow In GvPS.Rows
|
||||
@@ -6172,12 +6139,7 @@ Partial Class Ventas
|
||||
|
||||
DdlProyecto.DataSource = dtt
|
||||
DdlProyecto.DataBind()
|
||||
|
||||
DdlProyectoPyME.DataSource = dtt
|
||||
DdlProyectoPyME.DataBind()
|
||||
|
||||
CveSubProyecto = GetSubProyectoSucursal()
|
||||
|
||||
CargaSubProyecto(CveSubProyecto)
|
||||
|
||||
End Sub
|
||||
@@ -6275,7 +6237,6 @@ Partial Class Ventas
|
||||
If CveSubProyecto > 0 Then DdlSubProyecto.SelectedValueExist(CveSubProyecto)
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaEmpresaCRM(CveEmpresaCRM As Integer)
|
||||
Dim ObjCRM As New ClsCRM
|
||||
If ObjCRM.GetEmpresasCRM(UsuarioActual.CveEmpresa, CveEmpresaCRM) Then
|
||||
@@ -6320,12 +6281,8 @@ Partial Class Ventas
|
||||
trCRM3.Visible = True
|
||||
|
||||
LblTituloPorletCliente.Text = "EMPRESA CRM"
|
||||
|
||||
tdTelefonoGen.Visible = False
|
||||
tdTxtTelefonoGen.Visible = False
|
||||
|
||||
|
||||
|
||||
End If
|
||||
Me.CveVendedorEmpresaCRM = ObjCRM.DtResultados.Rows(0)("CveVendedorAsignado").ToString().ToEntero()
|
||||
|
||||
@@ -6750,13 +6707,10 @@ Partial Class Ventas
|
||||
tdVigencia.Visible = DdlTipoComprobante.SelectedValue.Contiene("Cot")
|
||||
tdFechaVigencia.Visible = DdlTipoComprobante.SelectedValue.Contiene("Cot")
|
||||
|
||||
|
||||
LbAgregar.Enabled = True
|
||||
LnkAgregarPyME.Enabled = True
|
||||
|
||||
CargarAlmacenes()
|
||||
|
||||
|
||||
CargaDocumentacionCliente()
|
||||
|
||||
If UsuarioActual.CveEmpresa.Contiene(72, 80, 1, 119) Then
|
||||
@@ -7697,7 +7651,6 @@ Partial Class Ventas
|
||||
Retorno = LimiteRestanteSucursal
|
||||
PorcentajeCredito = PorcentajeSaldoSucursal
|
||||
End If
|
||||
|
||||
Else
|
||||
Retorno = ObjVentasAplciar.DtResultados(0)("LimiteRestanteCliente").ToString().ToDecimal
|
||||
PorcentajeCredito = ObjVentasAplciar.DtResultados(0)("PorcentajeSaldoCliente").ToString().ToDecimal
|
||||
@@ -7722,9 +7675,6 @@ Partial Class Ventas
|
||||
DdlSubProyectoEjecucion.DataSource = dtt.FiltraParametros("EsSucursal = True ")
|
||||
DdlSubProyectoEjecucion.DataBind()
|
||||
|
||||
DdlSubProyectoPyME.DataSource = dtt
|
||||
DdlSubProyectoPyME.DataBind()
|
||||
|
||||
DdlSubProyectoFiltroAF.DataSource = dtt
|
||||
DdlSubProyectoFiltroAF.DataBind()
|
||||
DdlSubProyectoFiltroAF.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
@@ -7734,14 +7684,11 @@ Partial Class Ventas
|
||||
Private Sub CargaClasificaciones()
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC Then
|
||||
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, UsoClasificacion:=1).FiltraParametros(" Codigo = '' OR Codigo IS NULL ", Orderby:="Clasificacion")
|
||||
DdlClasificacionPyME.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, UsoClasificacion:=1).FiltraParametros(" Codigo = '' OR Codigo IS NULL ", Orderby:="Clasificacion")
|
||||
Else
|
||||
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros("UsoClasificacion IN (1,3) and Estado = 1", Orderby:="Clasificacion")
|
||||
DdlClasificacionPyME.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, UsoClasificacion:=1).FiltraParametros("", Orderby:="Clasificacion")
|
||||
End If
|
||||
'DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
|
||||
DdlClasificacion.DataBind()
|
||||
DdlClasificacionPyME.DataBind()
|
||||
End Sub
|
||||
Private Sub CargaPS(CveClasificacion As Integer, Objeto As ADServerControl.Dropdownlost, Optional AplicaParaVenta As Boolean = True)
|
||||
|
||||
@@ -10098,7 +10045,6 @@ Partial Class Ventas
|
||||
|
||||
If UsuarioActual.CveEmpresa = 140 Then
|
||||
AutoConta = True
|
||||
idCuentaContabilizacion = 10
|
||||
End If
|
||||
|
||||
Try
|
||||
@@ -13814,7 +13760,6 @@ Partial Class Ventas
|
||||
Dim CveCuentaContabilizacion As Integer = 1
|
||||
Dim tipoCambio As Decimal
|
||||
Dim TCPago As Decimal = 1
|
||||
|
||||
Dim CuentasContablesInvalidasSIG As New StringBuilder
|
||||
|
||||
If ObjFactura.TipoDocto = "Ing" Or ObjFactura.TipoDocto = "Ant" Or ObjFactura.TipoDocto = "Com" Then
|
||||
@@ -13866,6 +13811,11 @@ Partial Class Ventas
|
||||
SeContabiliza = False
|
||||
End If
|
||||
|
||||
Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1"
|
||||
If UsuarioActual.CveEmpresa = 119 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ant", "Rem", "RNC", "Cot", "Ped", "Pd2", "PA", "Egs", "Dev") Then
|
||||
AutoConta = False
|
||||
End If
|
||||
|
||||
Dim UsaComplementariaClientes As Boolean = True
|
||||
|
||||
If ObjConta.GetPlantillaConceptos(ObjFactura.CveEmpresa, CvePlantilaPoliza) Then
|
||||
@@ -14159,7 +14109,7 @@ Partial Class Ventas
|
||||
End If
|
||||
Next
|
||||
|
||||
If Not ErrorPrepoliza AndAlso ObjConta.ValidacionPrePolizaCuadre(ObjFactura.CvePrePoliza, 5) Then
|
||||
If Not ErrorPrepoliza AndAlso ObjConta.ValidacionPrePolizaCuadre(ObjFactura.CvePrePoliza, 5, AutoConta:=AutoConta) Then
|
||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||
'ErrorPrepoliza = True
|
||||
GuardaLogAD($"Ventas/Ventas-ProcesoPrePolizas | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{ObjFactura.CvePrePoliza}", "LogPrePolizas")
|
||||
@@ -14232,7 +14182,7 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
If ObjConta.ValidacionPrePolizaCuadre(ObjFactura.CvePrePoliza, 2) Then
|
||||
If ObjConta.ValidacionPrePolizaCuadre(ObjFactura.CvePrePoliza, 2, AutoConta:=AutoConta) Then
|
||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||
GuardaLogAD($"Ventas/Ventas-ProcesoPrePolizas | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{ObjFactura.CvePrePoliza}", "LogPrePolizas")
|
||||
End If
|
||||
@@ -14973,7 +14923,7 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
If ObjConta.ValidacionPrePolizaCuadre(ObjFactura.CvePrePoliza, 2) Then
|
||||
If ObjConta.ValidacionPrePolizaCuadre(ObjFactura.CvePrePoliza, 2, AutoConta:=AutoConta) Then
|
||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||
If ObjConta.ValorPolizaDescuadre = 2 Then
|
||||
ErrorPrepoliza = True
|
||||
@@ -16409,7 +16359,7 @@ Partial Class Ventas
|
||||
|
||||
|
||||
End Sub
|
||||
Private Function AgregarPrePolizasXTrasladar(ObjConta As ClsContabilidad, CvePrePoliza As Integer, PorcentajeAmortizacion As Decimal, TipoCambio As Decimal, ByRef CuentasContablesInvalidas As StringBuilder, ByRef idCuentaContabilizacion As Integer, ByRef CveCuentaContabilizacion As Integer, Importe13 As Decimal, Importe8 As Decimal, Importe9 As Decimal) As Boolean
|
||||
Private Function AgregarPrePolizasXTrasladar(ObjConta As ClsContabilidad, CvePrePoliza As Integer, PorcentajeAmortizacion As Decimal, TipoCambio As Decimal, ByRef CuentasContablesInvalidas As StringBuilder, ByRef CveCuentaContabilizacion As Integer, Importe13 As Decimal, Importe8 As Decimal, Importe9 As Decimal) As Boolean
|
||||
Dim ImporteMovimiento As Decimal
|
||||
Dim ImporteMX As Decimal
|
||||
Dim FechaMovimiento As Date = Now
|
||||
@@ -16449,7 +16399,7 @@ Partial Class Ventas
|
||||
|
||||
End Function
|
||||
'Charlie
|
||||
Private Function AgregarPrePolizasTrasladadas(ObjConta As ClsContabilidad, CvePrePoliza As Integer, PorcentajeAmortizacion As Decimal, TipoCambio As Decimal, ByRef CuentasContablesInvalidas As StringBuilder, ByRef idCuentaContabilizacion As Integer, Optional ByRef CuentasContablesInvalidasSIG As StringBuilder = Nothing, Optional ByRef CveCuentaContabilizacion As Integer = Nothing) As Boolean
|
||||
Private Function AgregarPrePolizasTrasladadas(ObjConta As ClsContabilidad, CvePrePoliza As Integer, PorcentajeAmortizacion As Decimal, TipoCambio As Decimal, ByRef CuentasContablesInvalidas As StringBuilder, Optional ByRef CuentasContablesInvalidasSIG As StringBuilder = Nothing, Optional ByRef CveCuentaContabilizacion As Integer = Nothing) As Boolean
|
||||
|
||||
Dim ImporteMovimiento As Decimal
|
||||
Dim ImporteMX As Decimal
|
||||
@@ -17556,9 +17506,6 @@ Partial Class Ventas
|
||||
DdlPS.Attributes.Remove("data-cvesubproyecto")
|
||||
DdlPS.Attributes.Add("data-cvesubproyecto", DdlSubProyectoDatos.SelectedValue)
|
||||
|
||||
DdlPSPyME.Attributes.Remove("data-cvesubproyecto")
|
||||
DdlPSPyME.Attributes.Add("data-cvesubproyecto", DdlSubProyectoDatos.SelectedValue)
|
||||
|
||||
UpPS.Update()
|
||||
End Sub
|
||||
Private Sub RecargaSucursalPartidas()
|
||||
@@ -18379,50 +18326,6 @@ Partial Class Ventas
|
||||
UPCondicionesPago.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub AgregarPSPYME()
|
||||
If Modalidad = "A" Then
|
||||
|
||||
Dim CveProyecto As Integer = IIf(DdlProyectoPyME.SelectedValue <> "-1", DdlProyectoPyME.SelectedValue, "0").ToString().ToEntero()
|
||||
Dim Proyecto As String = IIf(DdlProyectoPyME.SelectedValue <> "-1", DdlProyectoPyME.SelectedItem.Text, "").ToString()
|
||||
|
||||
Dim CveSubProyecto As Integer = IIf(DdlSubProyectoPyME.SelectedValue <> "-1", DdlSubProyectoPyME.SelectedValue, "0").ToString().ToEntero()
|
||||
Dim SubProyecto As String = IIf(DdlSubProyectoPyME.SelectedValue <> "-1", DdlSubProyectoPyME.SelectedItem.Text, "").ToString()
|
||||
|
||||
Dim PU As Decimal = TxtPrecioPyME.Text.ToDecimal()
|
||||
Dim Cantidad As Decimal = TxtCantidadPyME.Text.ToDecimal()
|
||||
|
||||
Dim CvePS As Integer = DdlPSPyME.SelectedValue.ToEntero()
|
||||
|
||||
Dim Descuento As Modelos.VentaDescuentos = CalcularDescuentos(CvePS, Cantidad, PU)
|
||||
|
||||
AgregarProductoServicio(Cantidad, DdlUMPyME.SelectedValue.ToEntero(), DdlUMPyME.SelectedItem.Text, DdlClasificacionPyME.SelectedValue.ToEntero(), DdlClasificacionPyME.SelectedItem.Text,
|
||||
CvePS, DdlPSPyME.SelectedText, TxtObsPyME.Text, PU, Descuento.ImporteDescuento, CveProyecto, Proyecto, CveSubProyecto, SubProyecto)
|
||||
|
||||
CalculaUsados()
|
||||
CalculaTotalesVenta()
|
||||
|
||||
ElseIf Modalidad = "U" Then
|
||||
|
||||
Dim ErrorEdit As Boolean = True
|
||||
Dim Contador As Integer = 0
|
||||
For Each row As DataRow In TmpDT.Rows
|
||||
If row("Consec").ToString().ToEntero() = Index Then
|
||||
ErrorEdit = False
|
||||
Exit For
|
||||
End If
|
||||
Contador = Contador + 1
|
||||
Next
|
||||
If ErrorEdit = True Then
|
||||
Exit Sub
|
||||
Else
|
||||
TmpDT.AcceptChanges()
|
||||
TmpDT.Rows.RemoveAt(Contador)
|
||||
TmpDT.AcceptChanges()
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Private Sub LimpiaAgregar()
|
||||
TxtCantidad.Text = ""
|
||||
TxtNumTurnos.Text = ""
|
||||
@@ -19801,11 +19704,11 @@ Partial Class Ventas
|
||||
If ObjClientes.GetClientes(-1, Nombre, Codigo, NombreCorto, RFC, Telefono, Mail, -1, UsuarioActual.CveEmpresa, TipoCliente:=-1) Then
|
||||
If ObjClientes.DtResultados.Rows.Count > 0 Then
|
||||
If UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario = 77 AndAlso Not ObjClientes.CveCliente.Contiene(10450, 10460, 10458) Then
|
||||
TrEmitir.Visible = False : BtnCrearApartirDe.Enabled = False : LbAgregar.Enabled = False : LnkAgregarPyME.Enabled = False : BtnBuscarCliente.Enabled = False : BtnEmitirImprimir.Visible = False : TrVistaPrevia.Visible = False
|
||||
TrEmitir.Visible = False : BtnCrearApartirDe.Enabled = False : LbAgregar.Enabled = False : BtnBuscarCliente.Enabled = False : BtnEmitirImprimir.Visible = False : TrVistaPrevia.Visible = False
|
||||
UpFacturar.Update()
|
||||
Exit Sub
|
||||
ElseIf UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario = 21 AndAlso Not ObjClientes.CveCliente.Contiene(27448) Then
|
||||
TrEmitir.Visible = False : BtnCrearApartirDe.Enabled = False : LbAgregar.Enabled = False : LnkAgregarPyME.Enabled = False : BtnBuscarCliente.Enabled = False : BtnEmitirImprimir.Visible = False : TrVistaPrevia.Visible = False
|
||||
TrEmitir.Visible = False : BtnCrearApartirDe.Enabled = False : LbAgregar.Enabled = False : BtnBuscarCliente.Enabled = False : BtnEmitirImprimir.Visible = False : TrVistaPrevia.Visible = False
|
||||
UpFacturar.Update()
|
||||
Exit Sub
|
||||
Else
|
||||
@@ -21582,7 +21485,6 @@ Partial Class Ventas
|
||||
DdlSubProyecto.Enabled = True
|
||||
TxtPrecio.Enabled = True
|
||||
LbAgregar.Enabled = True
|
||||
LnkAgregarPyME.Enabled = True
|
||||
ImgDescTotal.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '2'; $get('LblPrecio1').style.display = 'none'; $get('LblTotalPS1').style.display = 'none'; $get('LblSubTotal1').style.display = ''; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = 'none'; $get('BtnAplicarDescG').style.display = ''; $get('TrMotivoDescuento').style.display = '';")
|
||||
LblSubTotal1.Text = TxtSubTotal.Text
|
||||
LblAmort.Text = TxtSubTotal.Text
|
||||
@@ -23613,425 +23515,6 @@ Partial Class Ventas
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "CargaFactura"
|
||||
Private Function CargaFactura(CveFactura As Integer) As String
|
||||
Dim RFC As String = ""
|
||||
|
||||
Dim XMLDoc As New XmlDocument
|
||||
Dim Archivo As String = String.Format("{0}Ventas\{1}\{2}", UsuarioActual.Empresa.Ruta, Request("RFC"), $"{Request("CveFactura")}.xml")
|
||||
If IO.File.Exists(Archivo) Then
|
||||
|
||||
Dim Validada As Boolean = True
|
||||
|
||||
|
||||
LbAgregar.Visible = False
|
||||
|
||||
|
||||
If Validada Then
|
||||
|
||||
XMLDoc.Load(Archivo)
|
||||
|
||||
CreaDTConceptos()
|
||||
CargaConceptosXML(XMLDoc)
|
||||
|
||||
CargaComprobanteXML(XMLDoc)
|
||||
Select Case TipoComprobante
|
||||
Case "ingreso" : DdlTipoComprobante.SelectedValue = "Ing"
|
||||
Case "egreso" : DdlTipoComprobante.SelectedValue = "Egs"
|
||||
End Select
|
||||
|
||||
Dim Descuentos As Decimal = 0
|
||||
|
||||
|
||||
RFC = ReceptorRFC
|
||||
TxtFecha.Text = Fecha
|
||||
TxtFolio.Text = FolioXML.ToString()
|
||||
If (FolioXML <> "") Then
|
||||
ViewState("ExFolioFactura") = True
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Dim IVA As Decimal
|
||||
IVA = TrasladoIVA
|
||||
|
||||
If Not UsuarioActual.TienePermisoProceso(130) Then
|
||||
TxtFolio.Enabled = False
|
||||
End If
|
||||
|
||||
DdlTipoComprobante.Enabled = False
|
||||
TxtFecha.Enabled = False
|
||||
ImgFecha.Enabled = False
|
||||
TxtSubTotal.Enabled = False
|
||||
TxtSubTotal2.Enabled = False
|
||||
TxtIVA.Enabled = False
|
||||
'TxtTotal.Enabled = False
|
||||
RegistraScript("SetDisabledTxtTotal(true);")
|
||||
If TxtFolio.Text.Trim = "" Then TxtFolio.Enabled = True
|
||||
|
||||
TxtIVA.Text = IVA.FormatoNumero
|
||||
TxtRetIVA.Text = RetencionIVA.FormatoNumero
|
||||
LblDescuentos.Text = Descuentos.FormatoNumero
|
||||
TxtFecha.Text = Fecha.ToDate.ToShortDateString
|
||||
|
||||
Dim Msg As String = ""
|
||||
|
||||
'PRUEBA
|
||||
'http://rm/Compras/Compras.aspx?CveFactura=122518 Emp: 48
|
||||
|
||||
'tTotal = Math.Round(SubTotal2 + IVA - RetencionIVA - RetencionISR + IEPS + OtrosImpuestos, 2)
|
||||
|
||||
Dim AjustaUltimoConcepto = False
|
||||
|
||||
'en otro impuesto lo esta registrando en ajuste en automatico
|
||||
If OtrosImpuestos > 0 Then
|
||||
AjustaUltimoConcepto = True
|
||||
End If
|
||||
|
||||
If RFC = "CFE370814QI0" Then ' RFC de CFE, se hace un ajuste por diferencia para sacar el DAP
|
||||
'OtrosImpuestos = Total - (SubTotal2 + IVA)
|
||||
'este importe lo vamos a meter al gasto
|
||||
'AjustaImporteUltimoConcepto(OtrosImpuestos)
|
||||
OtrosImpuestos = 1
|
||||
AjustaUltimoConcepto = True
|
||||
'SubTotal2 = SubTotal
|
||||
End If
|
||||
|
||||
Dim SubTotalReal As Decimal = Math.Round(Total + RetencionISR + RetencionIVA - IVA + Descuentos, 2) ' NO se incluye otros impuestos para ajustar esa cifra
|
||||
Dim DiferenciaTotales As Decimal = SubTotalReal - Math.Round(SubTotalConceptos, 2)
|
||||
ViewState("Folio") = FolioXML
|
||||
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert("No se encontró la factura", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
'GvPS.DataSource = 'DTConceptos
|
||||
'GvPS.DataBind()
|
||||
|
||||
|
||||
|
||||
|
||||
Return RFC
|
||||
End Function
|
||||
Private Sub CreaDTConceptos()
|
||||
DTConceptos = New DataTable
|
||||
DTConceptos.Columns.Add("Consec", GetType(Integer))
|
||||
DTConceptos.Columns.Add("Cantidad", GetType(Decimal))
|
||||
DTConceptos.Columns.Add("UM", GetType(String))
|
||||
DTConceptos.Columns.Add("CveClasificacion", GetType(Integer))
|
||||
DTConceptos.Columns.Add("PS", GetType(String))
|
||||
DTConceptos.Columns.Add("PU", GetType(Decimal))
|
||||
DTConceptos.Columns.Add("Descuento", GetType(Decimal))
|
||||
DTConceptos.Columns.Add("IVA", GetType(Decimal))
|
||||
DTConceptos.Columns.Add("Total", GetType(Decimal))
|
||||
End Sub
|
||||
Private Sub CargaConceptosXML(XMLDoc As XmlDocument)
|
||||
Dim i As Integer = 0
|
||||
Dim node As XmlNode
|
||||
Dim PU As Decimal = 0
|
||||
Dim Descuento As Double = 0
|
||||
Dim CveUM As Integer = 0
|
||||
Dim UMM As String = "No Aplica"
|
||||
Dim tCvePS As Integer = 0
|
||||
Dim TipoPS As Integer = 0
|
||||
Dim tCveClasif As Integer = -1
|
||||
Dim Clasif As String = "Sin Clasificación"
|
||||
Dim tPSCodigo As String = "-"
|
||||
Dim tPSDescripcion As String = "-"
|
||||
Dim PSS As String = ""
|
||||
Dim Obs As String = ""
|
||||
Dim SubTotalTemp = 0.0D
|
||||
|
||||
'GLOBALS
|
||||
Dim DtUM = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).AsEnumerable
|
||||
Dim DtUMAlias = GlobalDTUnidadesMedidaAlias(UsuarioActual.CveEmpresa).AsEnumerable
|
||||
'Dim DtPS = GlobalDTProductosServicios(UsuarioActual.CveEmpresa).AsEnumerable
|
||||
Dim DtPS = GlobalDTPS(UsuarioActual.CveEmpresa).AsEnumerable
|
||||
Dim DtPSAlias = GlobalDTProductosServiciosAlias(UsuarioActual.CveEmpresa).AsEnumerable
|
||||
|
||||
''AGREGA EN TABLA TEMPORAL
|
||||
'Dim DtPSTemp = TmpDT.Clone
|
||||
'Dim Row As DataRow = Nothing
|
||||
|
||||
|
||||
For i = 0 To XMLDoc.DocumentElement.ChildNodes(2).ChildNodes.Count - 1
|
||||
|
||||
' INICIALIZA VALORES
|
||||
PU = 0
|
||||
Descuento = 0
|
||||
CveUM = 0
|
||||
UMM = "No Aplica"
|
||||
tCvePS = 0
|
||||
TipoPS = 0
|
||||
tCveClasif = -1
|
||||
Clasif = "Sin Clasificación"
|
||||
tPSCodigo = "-"
|
||||
tPSDescripcion = "-"
|
||||
PSS = ""
|
||||
Obs = ""
|
||||
Total = 0
|
||||
|
||||
|
||||
'CARGA NODO ACTUAL
|
||||
node = XMLDoc.DocumentElement.ChildNodes(2).ChildNodes(i)
|
||||
|
||||
'CARGA PU
|
||||
PU = ValorXML(node, "valorUnitario").ToDecimal
|
||||
|
||||
'SI PU >= TOTAL AND CANTIDAD > 0 : PU / CANTIDAD, por si tiene descuento en el importe y el valor unitario es mayor, lo ajusta
|
||||
If ValorXML(node, "cantidad").ToDecimal > 0 AndAlso ValorXML(node, "valorUnitario").ToDecimal >= (ValorXML(node, "importe").ToDecimal / ValorXML(node, "cantidad").ToDecimal) Then
|
||||
PU = ValorXML(node, "importe").ToDecimal / ValorXML(node, "cantidad").ToDecimal
|
||||
End If
|
||||
If ValorXML(node, "cantidad").ToDecimal > 0 AndAlso ValorXML(node, "valorUnitario").ToDouble <= 0 And ValorXML(node, "importe").ToDouble > 0 Then
|
||||
PU = ValorXML(node, "importe").ToDecimal / ValorXML(node, "cantidad").ToDecimal
|
||||
End If
|
||||
|
||||
|
||||
'OBTIENE DESCUENTO
|
||||
If ValorXML(node, "descuento") IsNot Nothing Then Descuento = ValorXML(node, "descuento").Trim.ToDouble
|
||||
|
||||
'OBTIENE TOTAL
|
||||
If ValorXML(node, "importe") IsNot Nothing Then Total = ValorXML(node, "importe").Trim.ToDecimal
|
||||
|
||||
'OBTIENE SUBTOTAL
|
||||
SubTotalTemp += If(Total > 0, Total, PU * ValorXML(node, "cantidad").ToDecimal)
|
||||
|
||||
|
||||
'OBTIENE UM
|
||||
If ValorXML(node, "unidad") IsNot Nothing Then UMM = ValorXML(node, "unidad").Trim
|
||||
'BUSCA UM EN CATALOGO
|
||||
UMM = UMM.ToUpper.Replace(".", "").Replace(",", "")
|
||||
Dim fUM = (From u In DtUM
|
||||
Where String.Compare(u!UnidadMedida.ToString().ToUpper.Trim, UMM, CultureInfo.CurrentCulture, CompareOptions.IgnoreNonSpace) = 0 OrElse
|
||||
String.Compare(u!Abreviatura.ToString().ToUpper.Trim, UMM, CultureInfo.CurrentCulture, CompareOptions.IgnoreNonSpace) = 0
|
||||
Select CveUnidadMedida = u!CveUnidadMedida, UnidadMedida = u!UnidadMedida).FirstOrDefault()
|
||||
If fUM IsNot Nothing AndAlso fUM.CveUnidadMedida.ToString().ToEntero() > 0 Then
|
||||
CveUM = fUM.CveUnidadMedida.ToString().ToEntero()
|
||||
UMM = fUM.UnidadMedida.ToString()
|
||||
Else
|
||||
|
||||
'BUSCA UM EN ALIAS
|
||||
Dim fUMAlias = (From u In DtUMAlias
|
||||
Where String.Compare(u!UnidadMedidaAlias.ToString().ToUpper.Trim, UMM, CultureInfo.CurrentCulture, CompareOptions.IgnoreNonSpace) = 0
|
||||
Select u!CveUnidadMedida, u!UnidadMedida).FirstOrDefault()
|
||||
|
||||
If fUMAlias IsNot Nothing Then
|
||||
CveUM = fUMAlias.CveUnidadMedida.ToString().ToEntero()
|
||||
UMM = fUMAlias.UnidadMedida.ToString()
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
'se le puso una condicion de que ignorara los acentos, porque en la bd, marcaria error porque no distingue acentos
|
||||
'CONCEPTO PRUEBA "TRABAJOS DE CONSTRUCCION", RM/Compras/Compras.aspx?CveFactura=13402&RFC=ECO061206QW7
|
||||
'' u!PS.ToString().ToUpper.Trim = PSS
|
||||
|
||||
|
||||
'BUSCA PS
|
||||
|
||||
PSS = ValorXML(node, "descripcion").ToUpper.Trim.Replace(vbCrLf, " ").Replace(vbLf, " ").Replace("'", "''").Replace(" ", " ")
|
||||
If PSS.Length > 844 Then
|
||||
PSS = PSS.Substring(0, 844) '844,por ser el numero de caracteres aceptados en la columna de la BD
|
||||
End If
|
||||
tPSCodigo = PSS
|
||||
|
||||
'BUSCA PS EN CATALOGO
|
||||
Dim fPS = (From u In DtPS
|
||||
Where String.Compare(u!PS.ToString().ToUpper.Trim, PSS, CultureInfo.CurrentCulture, CompareOptions.IgnoreNonSpace) = 0
|
||||
Select u!CvePS, u!CveClasificacion, u!Clasificacion, u!CveTipoPS, u!PSCodigo).FirstOrDefault()
|
||||
|
||||
If fPS IsNot Nothing Then
|
||||
PSS = fPS.PSCodigo.ToString()
|
||||
tCvePS = fPS.CvePS.ToString().ToEntero()
|
||||
TipoPS = fPS.CveTipoPS.ToString().ToEntero()
|
||||
tCveClasif = fPS.CveClasificacion.ToString().ToEntero()
|
||||
Clasif = fPS.Clasificacion.ToString()
|
||||
tPSCodigo = fPS.PSCodigo.ToString()
|
||||
Else
|
||||
'BUSCA PS EN ALIAS
|
||||
Dim fPSAlias = (From u In DtPSAlias
|
||||
Where String.Compare(u!PSAlias.ToString().ToUpper.Trim, PSS, CultureInfo.CurrentCulture, CompareOptions.IgnoreNonSpace) = 0
|
||||
Select u!CvePS, u!PS, u!CveClasificacion, u!Clasificacion, u!CveTipoPS, u!PSCodigo).FirstOrDefault()
|
||||
If fPSAlias IsNot Nothing Then
|
||||
Obs = PSS
|
||||
PSS = fPSAlias.PS.ToString()
|
||||
tCvePS = fPSAlias.CvePS.ToString().ToEntero()
|
||||
TipoPS = fPSAlias.CveTipoPS.ToString().ToEntero()
|
||||
tCveClasif = fPSAlias.CveClasificacion.ToString().ToEntero()
|
||||
Clasif = fPSAlias.Clasificacion.ToString()
|
||||
tPSCodigo = fPSAlias.PSCodigo.ToString()
|
||||
Else
|
||||
tCvePS = 20168
|
||||
End If
|
||||
End If
|
||||
|
||||
'PARA GLUYAS
|
||||
If UsuarioActual.CveEmpresa = 66 Then
|
||||
tPSCodigo = String.Format("{1} - {0}", ValorXML(node, "descripcion").ToUpper.Trim.Replace(vbCrLf, " ").Replace(vbLf, " ").Replace("'", "''"), ValorXML(node, "noIdentificacion").Trim)
|
||||
End If
|
||||
|
||||
'' AGREGA PS
|
||||
'AGREGA A TMPDT
|
||||
'AddPS(ValorXML(node, "cantidad").ToDouble, CveUM, UMM, tCveClasif, Clasif, tCvePS, PSS, TipoPS, "-1", "SE", "SE", Obs, PU, Total, 0, 0, PSCodigo:=tPSCodigo, TCalculaTotales:=False)
|
||||
AgregarProductoServicio(ValorXML(node, "cantidad").ToDecimal, CveUM, UMM, tCveClasif, Clasif, tCvePS, PSS, Obs, PU, 0, 0, "", 0, "")
|
||||
|
||||
|
||||
Next
|
||||
|
||||
CalculaTotalesVenta()
|
||||
'AddPS2(False)
|
||||
|
||||
|
||||
'Dim SubTotalConceptos = Math.Round(SubTotalTemp, 2)
|
||||
'TmpDT = DtPSTemp.Copy
|
||||
'DtPSTemp.Dispose()
|
||||
|
||||
End Sub
|
||||
Private Sub CargaComprobanteXML(XMLDoc As XmlDocument)
|
||||
Dim nodo As XmlNode = XMLDoc.DocumentElement
|
||||
|
||||
_SerieXML = ValorXML(nodo, "serie")
|
||||
If _SerieXML <> "" Then _SerieXML = _SerieXML
|
||||
|
||||
_Version = ValorXML(nodo, "version")
|
||||
_FolioXML = ValorXML(nodo, "folio")
|
||||
_Fecha = ValorXML(nodo, "fecha")
|
||||
SubTotal = ValorXML(nodo, "subTotal").ToDecimal
|
||||
Total = ValorXML(nodo, "total").ToDecimal
|
||||
'Descuentos = ValorXML(nodo, "descuento").ToDecimal
|
||||
_Moneda = ValorXML(nodo, "Moneda")
|
||||
_TipoComprobante = ValorXML(nodo, "tipoDeComprobante")
|
||||
|
||||
|
||||
Dim Prefijo As String = If(XMLDoc.DocumentElement.Prefix = "", "cfd", XMLDoc.DocumentElement.Prefix)
|
||||
Dim cfdVer As String = "http://www.sat.gob.mx/cfd/3"
|
||||
Dim namespaces As New XmlNamespaceManager(XMLDoc.NameTable)
|
||||
|
||||
If Prefijo.ToLower <> "cfdi" Then cfdVer = "http://www.sat.gob.mx/cfd/2"
|
||||
namespaces.AddNamespace(Prefijo, cfdVer)
|
||||
namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital")
|
||||
namespaces.AddNamespace("implocal", "http://www.sat.gob.mx/implocal")
|
||||
namespaces.AddNamespace("registrofiscal", "http://www.sat.gob.mx/registrofiscal")
|
||||
|
||||
Dim node As XmlNode
|
||||
node = XMLDoc.SelectSingleNode(String.Format("//{0}:Emisor", Prefijo), namespaces)
|
||||
|
||||
If node IsNot Nothing AndAlso node.ChildNodes.Count > 0 Then
|
||||
EmisorRFC = ValorXML(node, "RFC")
|
||||
'EmisorNombre = ValorXML(node, "nombre")
|
||||
End If
|
||||
node = XMLDoc.SelectSingleNode(String.Format("//{0}:Receptor", Prefijo), namespaces)
|
||||
If node IsNot Nothing AndAlso node.ChildNodes.Count > 0 Then
|
||||
ReceptorRFC = ValorXML(node, "RFC")
|
||||
End If
|
||||
|
||||
node = XMLDoc.SelectSingleNode(String.Format("//{0}:Impuestos", Prefijo), namespaces)
|
||||
If node IsNot Nothing AndAlso node.ChildNodes.Count > 0 Then
|
||||
Dim nodeRetenciones As XmlNodeList = XMLDoc.SelectNodes(String.Format("//{0}:Retencion", Prefijo), namespaces)
|
||||
|
||||
TotalRetenciones = ValorXML(node, "totalImpuestosRetenidos", "0").ToDecimal
|
||||
|
||||
For Each retencion As XmlNode In nodeRetenciones
|
||||
If retencion.Attributes("impuesto").Value = "IVA" Then
|
||||
RetencionIVA += retencion.Attributes("importe").Value.ToDecimal
|
||||
End If
|
||||
If retencion.Attributes("impuesto").Value = "ISR" Then
|
||||
RetencionISR += retencion.Attributes("importe").Value.ToDecimal
|
||||
End If
|
||||
' Do something.
|
||||
Next
|
||||
SumaTotalRetenciones += RetencionIVA
|
||||
SumaTotalRetenciones += RetencionISR
|
||||
|
||||
TotalTraslados = ValorXML(node, "totalImpuestosTrasladados", "0").ToDecimal
|
||||
|
||||
Dim nodeTraslados As XmlNodeList = XMLDoc.SelectNodes(String.Format("//{0}:Traslado", Prefijo), namespaces)
|
||||
For Each traslado As XmlNode In nodeTraslados
|
||||
If traslado.Attributes("impuesto").Value = "IVA" Then
|
||||
TrasladoIVA += traslado.Attributes("importe").Value.ToDecimal
|
||||
End If
|
||||
If traslado.Attributes("impuesto").Value = "IEPS" Then
|
||||
TrasladoIEPS += traslado.Attributes("importe").Value.ToDecimal
|
||||
End If
|
||||
'If traslado.Attributes("impuesto").Value = "ISR" Then
|
||||
' TrasladoISR = traslado.Attributes("importe").Value
|
||||
'End If
|
||||
' Do something.
|
||||
Next
|
||||
SumaTotalTraslados += TrasladoIVA
|
||||
SumaTotalTraslados += TrasladoIEPS
|
||||
End If
|
||||
|
||||
Dim nodeComp As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:Complemento", Prefijo), namespaces)
|
||||
If node IsNot Nothing AndAlso node.ChildNodes.Count > 0 Then
|
||||
|
||||
Dim nodeTFD As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:TimbreFiscalDigital", "tfd"), namespaces)
|
||||
|
||||
_TFDUUID = ValorXML(nodeTFD, "UUID", "")
|
||||
|
||||
Dim nodeRF As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:CFDIRegistroFiscal ", "registrofiscal"), namespaces)
|
||||
If nodeRF IsNot Nothing Then
|
||||
_FolioXML = ValorXML(nodeRF, "folio").TrimStart("0"c)
|
||||
End If
|
||||
|
||||
node = node.SelectSingleNode(String.Format("//{0}:ImpuestosLocales", "implocal"), namespaces)
|
||||
|
||||
|
||||
If node IsNot Nothing AndAlso node.ChildNodes.Count > 0 Then
|
||||
OtrosImpuestos = ValorXML(node, "TotaldeTraslados", "0").ToDecimal
|
||||
|
||||
If RetencionIVA <= 0 AndAlso ValorXML(node, "TotaldeRetenciones", "0").ToDouble > 0 Then RetencionIVA = ValorXML(node, "TotaldeRetenciones", "0").ToDecimal
|
||||
|
||||
|
||||
'For Each retencion As XmlNode In nodeImpLocales
|
||||
' If retencion.Attributes("impuesto").Value = "IVA" Then
|
||||
' RetencionIVA += retencion.Attributes("importe").Value.ToDouble
|
||||
' End If
|
||||
' If retencion.Attributes("impuesto").Value = "ISR" Then
|
||||
' RetencionISR += retencion.Attributes("importe").Value.ToDouble
|
||||
' End If
|
||||
' ' Do something.
|
||||
'Next
|
||||
' SumaTotalRetenciones += RetencionIVA
|
||||
' SumaTotalRetenciones += RetencionISR
|
||||
|
||||
'TotalTraslados = ValorXML(node, "totalImpuestosTrasladados", "0").ToDouble
|
||||
|
||||
'Dim nodeTraslados As XmlNodeList = XMLDoc.SelectNodes(String.Format("//{0}:Traslado", Prefijo), namespaces)
|
||||
'For Each traslado As XmlNode In nodeTraslados
|
||||
' If traslado.Attributes("impuesto").Value = "IVA" Then
|
||||
' TrasladoIVA += traslado.Attributes("importe").Value.ToDouble
|
||||
' End If
|
||||
' If traslado.Attributes("impuesto").Value = "IEPS" Then
|
||||
' TrasladoIEPS += traslado.Attributes("importe").Value.ToDouble
|
||||
' End If
|
||||
' 'If traslado.Attributes("impuesto").Value = "ISR" Then
|
||||
' ' TrasladoISR = traslado.Attributes("importe").Value
|
||||
' 'End If
|
||||
' ' Do something.
|
||||
'Next
|
||||
'SumaTotalTraslados += TrasladoIVA
|
||||
'SumaTotalTraslados += TrasladoIEPS
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
Private Function ValorXML(n As XmlNode, Campo As String, Optional Retorno As String = "") As String
|
||||
Dim o As XmlNode = n.Attributes.Cast(Of XmlAttribute)().SingleOrDefault(Function(a) String.Compare(a.Name, Campo, True) = 0)
|
||||
If o Is Nothing Then
|
||||
Return Retorno
|
||||
Else
|
||||
Return o.Value
|
||||
End If
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
#Region "Metodos Viejos"
|
||||
Private Sub GeneraPDF(FechaFactura As DateTime, FolioFiscal As String, NoSerieCertificado As String, FechaCertificacion As DateTime, NoSerieCertificadoContribuyente As String,
|
||||
DTConceptos As DataTable, SelloCFDi As String, SelloSAT As String, CBB As String, Folio As String, RutaXML As String, EsVistaPrevia As Boolean, MuestraAlert As Boolean, Optional MR As ReportViewer = Nothing)
|
||||
@@ -25399,7 +24882,6 @@ Partial Class Ventas
|
||||
ImgDescTotal.Attributes.Clear()
|
||||
ImgDescConcepto.Attributes.Clear()
|
||||
LbAgregar.Enabled = False
|
||||
LnkAgregarPyME.Enabled = False
|
||||
divcondicionespago.Visible = False
|
||||
|
||||
BtnEmitirImprimir.Text = "Guardar"
|
||||
@@ -25622,198 +25104,6 @@ Partial Class Ventas
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "P Y M E"
|
||||
Private Sub LnkAddVenta_Click(sender As Object, e As EventArgs) Handles LnkAddVenta.Click
|
||||
Modalidad = "A"
|
||||
LnkAgregarPyME.Text = "Agregar"
|
||||
TxtCantidadPyME.Text = "1"
|
||||
TxtObsPyME.Text = ""
|
||||
TxtPrecioPyME.Text = "0.00"
|
||||
TxtDescuentoPyME.Text = "0.00"
|
||||
LblTotalPyME.Text = "0.00"
|
||||
If Not UsuarioActual.Empresa.Funcionalidad(141).ToString() = "1" Then
|
||||
DdlPSPyME.SelectedValue = "-1"
|
||||
Else
|
||||
DdlPSPyME.SelectedValue = ""
|
||||
DdlPSPyME.SelectedText = ""
|
||||
End If
|
||||
DdlClasificacionPyME.SelectedIndex = -1
|
||||
DdlProyectoPyME.SelectedIndex = -1
|
||||
DdlSubProyectoPyME.SelectedIndex = -1
|
||||
DdlUMPyME.Items.Clear()
|
||||
ChkAgregar.Checked = True
|
||||
divagregrarotrops.Visible = True
|
||||
UpVenta.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "DivAddVenta"))
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub Edit_Click(sender As Object, e As EventArgs)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
Modalidad = "U"
|
||||
Index = GvRow.DataKey("Consec").ToEntero()
|
||||
LnkAgregarPyME.Text = "Actualizar"
|
||||
DdlClasificacionPyME.SelectedValueExist(GvRow.DataKey("CveClasificacion"))
|
||||
CargaPSPyME(DdlClasificacionPyME.SelectedValue.ToEntero(), DdlPSPyME)
|
||||
UpClasificacionPyME.Update()
|
||||
If Not UsuarioActual.Empresa.Funcionalidad(141).ToString() = "1" Then
|
||||
DdlPSPyME.SelectedValue = GvRow.DataKey("CvePS")
|
||||
Else
|
||||
DdlPSPyME.SelectedValue = GvRow.DataKey("CvePS")
|
||||
DdlPSPyME.SelectedText = GvRow.DataKey("PS")
|
||||
End If
|
||||
DdlPSPyMEIndexChange()
|
||||
DdlProyectoPyME.SelectedValueExist(GvRow.DataKey("CveProyecto"))
|
||||
CargaSubProyecto()
|
||||
DdlSubProyectoPyME.SelectedValueExist(GvRow.DataKey("CveSubProyecto"))
|
||||
DdlUMPyME.SelectedValueExist(GvRow.DataKey("CveUM"))
|
||||
TxtCantidadPyME.Text = GvRow.DataKey("Cantidad")
|
||||
TxtObsPyME.Text = GvRow.DataKey("Obs")
|
||||
TxtPrecioPyME.Text = GvRow.DataKey("PU")
|
||||
TotAnt = GvRow.DataKey("Total").ToDecimal
|
||||
LblTotalPyME.Text = GvRow.DataKey("Total")
|
||||
ChkAgregar.Checked = False
|
||||
divagregrarotrops.Visible = False
|
||||
UpVenta.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "DivAddVenta"), "EdicionVenta")
|
||||
End Sub
|
||||
|
||||
Private Sub LnkAgregarPyME_Click(sender As Object, e As EventArgs) Handles LnkAgregarPyME.Click
|
||||
AgregarPSPYME()
|
||||
|
||||
If ChkAgregar.Checked = True And Modalidad = "A" Then
|
||||
LnkAgregarPyME.Text = "Agregar"
|
||||
TxtCantidadPyME.Text = ""
|
||||
TxtObsPyME.Text = ""
|
||||
TxtPrecioPyME.Text = "0.00"
|
||||
LblTotalPyME.Text = "0.00"
|
||||
If Not UsuarioActual.Empresa.Funcionalidad(141).ToString() = "1" Then
|
||||
DdlPSPyME.SelectedValue = "-1"
|
||||
Else
|
||||
DdlPSPyME.SelectedValue = ""
|
||||
DdlPSPyME.SelectedText = ""
|
||||
End If
|
||||
DdlClasificacionPyME.SelectedIndex = -1
|
||||
DdlProyectoPyME.SelectedIndex = -1
|
||||
DdlSubProyectoPyME.SelectedIndex = -1
|
||||
DdlUMPyME.Items.Clear()
|
||||
UpVenta.Update()
|
||||
RegistraScript("displayToastr(1);", "display")
|
||||
Else
|
||||
If Modalidad = "A" Then RegistraScript("displayToastr(1);", "display1")
|
||||
If Modalidad = "U" Then RegistraScript("displayToastr(2);", "display2")
|
||||
RegistraScript("ClosePopup();", "AddUpdatePS")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub DdlPSPyME_selectedindexchange(sender As Object, e As EventArgs) Handles DdlPSPyME.selectedindexchange
|
||||
DdlPSPyMEIndexChange()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaPSPyME(CveClasificacion As Integer, Objeto As ADServerControl.Dropdownlost)
|
||||
|
||||
Objeto.setEsWebService(True)
|
||||
|
||||
Objeto.Attributes.Add("data-cvesubproyecto", DdlSubProyectoDatos.SelectedValue)
|
||||
Objeto.ddlWS.Attributes.Add("data-cveclasificacion", CveClasificacion.ToString())
|
||||
Objeto.ddlWS.Attributes.Add("data-pagina", "ventas/ventas")
|
||||
Objeto.ddlWS.Attributes.Add("data-Estatus", "1")
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub DdlPSPyMEIndexChange()
|
||||
If CveCliente > 0 OrElse DdlPSPyME.SelectedValue = "-2" Then
|
||||
If DdlPSPyME.SelectedValue IsNot Nothing AndAlso DdlPSPyME.SelectedValue.ToEntero() > 0 Then
|
||||
Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPSPyME.SelectedValue.ToEntero()).FiltroPrimero("")
|
||||
|
||||
If drPS IsNot Nothing Then
|
||||
'HdnUnidadMedida.Value = PS.Rows(0)("CveUnidadMedida").ToString()
|
||||
HdnPS.Value = drPS("PS").ToString()
|
||||
HdnCodigoPS.Value = drPS("PSCodigo").ToString()
|
||||
HdnTipoPS.Value = drPS("CveTipoPS").ToString()
|
||||
HdnTipoInv.Value = drPS("Inv_CveMetodoInventario").ToString()
|
||||
HdnAplicaIEPS.Value = drPS("AplicaIEPS").ToString()
|
||||
HdnPorcentajeIEPS.Value = drPS("IEPSPorcentaje").ToString()
|
||||
DdlUMPyME.Items.Clear()
|
||||
If UsuarioActual.Empresa.UsaInventarios Then
|
||||
DdlUMPyME.DataSource = GlobalDTProductosServiciosEquivalencias(DdlPSPyME.SelectedValue.ToEntero(), -1, UsuarioActual.CveEmpresa)
|
||||
Else
|
||||
DdlUMPyME.DataSource = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa)
|
||||
End If
|
||||
DdlUMPyME.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
DdlUMPyME.SelectedValue = "-1"
|
||||
DdlUMPyME.DataBind()
|
||||
DdlUMPyME.SelectedValueExist(drPS("CveUnidadMedida").ToString())
|
||||
|
||||
'LblUnidadMedida.Text = PS.Rows(0)("UnidadMedida").ToString()
|
||||
TxtPrecioPyME.Text = drPS("Precio").ToString().FormatoNumero(2).Replace(","c, "")
|
||||
|
||||
Dim Cantidad As Decimal = TxtCantidadPyME.Text.ToDecimal()
|
||||
Dim PU As Decimal = TxtPrecioPyME.Text.ToDecimal()
|
||||
|
||||
Dim ObjDescuento As Modelos.VentaDescuentos = CalcularDescuentos(DdlPSPyME.SelectedValue.ToEntero(), Cantidad, PU)
|
||||
|
||||
TxtDescuentoPyME.Text = ObjDescuento.ImporteDescuento.FormatoNumero(2).Replace(","c, "")
|
||||
|
||||
LblTotalPyME.Text = ((Cantidad * PU) - ObjDescuento.ImporteDescuento).FormatoNumero(2).Replace(","c, "")
|
||||
|
||||
If UsuarioActual.CveEmpresa = 80 Then
|
||||
'busca el precio de la sucursal
|
||||
Dim ObjPS As New ClsProductosServicios
|
||||
If ObjPS.GetPSSucursales(DdlPSPyME.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa, DdlSubProyectoDatos.SelectedValue.ToEntero()) Then
|
||||
Dim dtt As DataTable = ObjPS.DtResultados
|
||||
Dim drPrecio As DataRow = dtt.FiltroPrimero("")
|
||||
|
||||
If drPrecio IsNot Nothing Then
|
||||
TxtPrecioPyME.Text = drPrecio("Importe").ToString().ToDouble.ToString("N4")
|
||||
End If
|
||||
dtt.Dispose()
|
||||
End If
|
||||
|
||||
ObjPS.Dispose()
|
||||
End If
|
||||
|
||||
'If IsNumeric(TxtCantidad.Text.Trim) Then
|
||||
' LblTotalPyME.Text = (TxtCantidad.Text.Trim.ToDouble * TxtPrecio.Text.ToDouble).ToString().FormatoNumero(2)
|
||||
'End If
|
||||
HdnIVAPS.Value = If(drPS("IVA").ToString() = "-1", ViewState("IVA"), drPS("IVA").ToString()).ToString()
|
||||
HdnIVARetAPS.Value = drPS("RetIVA").ToString()
|
||||
HdnAsientoContable.Value = drPS("AsientoContableVentas").ToString()
|
||||
HdnAplicaParaConcepto.Value = drPS("AplicaParaConcepto").ToString()
|
||||
HdnCodigo.Value = drPS("Codigo").ToString()
|
||||
If DdlClasificacionPyME.SelectedIndex = 0 Then
|
||||
If drPS("CveClasificacion").ToString() IsNot Nothing Then
|
||||
DdlClasificacionPyME.SelectedValueExist(drPS("CveClasificacion").ToString())
|
||||
Else
|
||||
Alert("El Productos/Servicio no tiene asignada una Clasificación.")
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
'RegistraScript("Recalcula();")
|
||||
'PS.Dispose()
|
||||
ElseIf DdlPSPyME.SelectedValue = "-2" Then
|
||||
CargaPSPyME(-1, DdlPSPyME)
|
||||
End If
|
||||
Else
|
||||
Alert("Es necesario seleccionar el cliente al cual se le va a facturar.", TipoMensaje.MsgAdvertencia, "AbrirVentana(""/Ventas/PopUpBuscarClientes.aspx?Opt=Fact"", 800, 547, ""N"", ""PopUpBuscar"")")
|
||||
End If
|
||||
|
||||
UpVenta.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub DdlClasificacionPyME_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlClasificacionPyME.SelectedIndexChanged
|
||||
CargaPSPyME(DdlClasificacionPyME.SelectedValue.ToEntero(), DdlPSPyME)
|
||||
UpClasificacionPyME.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "REORDENAR"
|
||||
Protected Sub BtnReordenar_Click(sender As Object, e As EventArgs) Handles BtnReordenar.Click
|
||||
Dim sArray As String()
|
||||
@@ -30636,7 +29926,6 @@ Partial Class Ventas
|
||||
DdlSubProyecto.Enabled = True
|
||||
TxtPrecio.Enabled = True
|
||||
LbAgregar.Enabled = True
|
||||
LnkAgregarPyME.Enabled = True
|
||||
ImgDescTotal.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '2'; $get('LblPrecio1').style.display = 'none'; $get('LblTotalPS1').style.display = 'none'; $get('LblSubTotal1').style.display = ''; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = 'none'; $get('BtnAplicarDescG').style.display = ''; $get('TrMotivoDescuento').style.display = '';")
|
||||
LblSubTotal1.Text = TxtSubTotal.Text
|
||||
LblAmort.Text = TxtSubTotal.Text
|
||||
@@ -32378,7 +31667,6 @@ Partial Class Ventas
|
||||
DdlSubProyecto.Enabled = True
|
||||
TxtPrecio.Enabled = True
|
||||
LbAgregar.Enabled = True
|
||||
LnkAgregarPyME.Enabled = True
|
||||
|
||||
ImgDescPU.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '0'; $get('LblPrecio1').style.display = ''; $get('LblTotalPS1').style.display = 'none'; $get('LblSubTotal1').style.display = 'none'; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = ''; $get('BtnAplicarDescG').style.display = 'none'; $get('TrMotivoDescuento').style.display = '';")
|
||||
ImgDescConcepto.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '1'; $get('LblPrecio1').style.display = 'none'; $get('LblTotalPS1').style.display = ''; $get('LblSubTotal1').style.display = 'none'; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = ''; $get('BtnAplicarDescG').style.display = 'none'; $get('TrMotivoDescuento').style.display = '';")
|
||||
|
||||
Reference in New Issue
Block a user