This commit is contained in:
2019-10-22 11:14:17 -07:00
parent 783596d79d
commit 7c16087ef3
11 changed files with 6334 additions and 5786 deletions

View File

@@ -261,7 +261,7 @@ Public Class ClsClientes
End Sub
Public Function GetClientes(CveCliente As Integer, Nombre As String, Codigo As String, NombreCorto As String, RFC As String, Telefono As String, Mail As String, CveSubProyecto As Integer,
CveEmpresa As Integer, Optional Estatus As Integer = 1, Optional Notificar As String = "-1", Optional CvePrecioLista As Integer = -1, Optional CveClienteClasificacion As Integer = -1,
Optional TipoCliente As Integer = 1, Optional CveVendedor As Integer = -1, Optional PermiteCreditoFiltro As Integer = -1) As Boolean
Optional TipoCliente As Integer = -1, Optional CveVendedor As Integer = -1, Optional PermiteCreditoFiltro As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_ClientesGet")

View File

@@ -2266,16 +2266,11 @@ Partial Class Bancos_IE
Exit Sub
End If
Dim ObjIE As New ClsBancos()
Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL)
Dim ObjComp As New ClsCompras(ObjIE.IniciaTransacSQL)
Dim ObjOC As New ClsOC(ObjIE.IniciaTransacSQL)
' Dim ObjContabilidad As New ClsContabilidad(ObjIE.IniciaTransacSQL)
Dim MsgError As String = ""
Dim CveConceptoContable As Integer = 30
Dim CveConceptoCompra As Integer = 10
@@ -2286,6 +2281,7 @@ Partial Class Bancos_IE
Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:<br><br>"
Dim Msg As New StringBuilder
Try
If CveIE = -1 Then
Dim CveCuentaDeposito As Integer = 0
@@ -2825,8 +2821,6 @@ Partial Class Bancos_IE
End If
End If
'IMPUESTOS
@@ -2852,14 +2846,18 @@ Partial Class Bancos_IE
Dim DTCuentas As DataTable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeCompraDevDinC)
Dim CveCuentaIVAxAcreditarDevDinC = 0
Dim CveCuentaIVAAcreditableDevDinC = 0
Dim IdCtaIVAXAcreditarDevDinC = DTCuentas.Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero
Dim IdCtaIVAAcreditableDevDinC = DTCuentas.Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero
Dim IdCtaIVAXAcreditarDevDinC = 0
Dim IdCtaIVAAcreditableDevDinC = 0
If DTCuentas IsNot Nothing AndAlso DTCuentas.Rows.Count > 0 Then
IdCtaIVAXAcreditarDevDinC = DTCuentas.Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero
IdCtaIVAAcreditableDevDinC = DTCuentas.Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero
End If
Dim IVADevMN As Decimal = 0
Dim IEPSDevMN As Decimal = 0
Dim PorcentajeDevolucion As Decimal = ((TxtImporte.Text.ToDecimal * 100D / TotalCompraDev) / 100).RoundSQL(2)
IVADev = Math.Round(IVADev * PorcentajeDevolucion, 2)
@@ -2868,7 +2866,6 @@ Partial Class Bancos_IE
Dim CveCuentaDevolucionIMPUESTOS As Integer = -1
Dim IdCtaIVADevolucionIMPUESTOS As Integer = -1
If DdlMoneda.SelectedValue.ToEntero > 1 AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119) Then
IVADevMN = IVADev
IEPSDevMN = IEPSDev
@@ -2877,7 +2874,6 @@ Partial Class Bancos_IE
IEPSDevMN = (IEPSDev * If(CveMonedaDev = 1, 1, TxtTipoCambio.Text.ToDecimal)).RoundSQL(2)
End If
Dim ErrorDevolucionImpuestos As Boolean = False
If IVADev > 0 Then
@@ -2949,8 +2945,6 @@ Partial Class Bancos_IE
End If
End If
Case "EGSCREDITO"
Dim ConceptoContable As Integer
@@ -2991,8 +2985,6 @@ Partial Class Bancos_IE
importeMovimiento = TxtImporte.Text.ToDecimal
importeMX = importeMovimiento
Case 46
If TxtInteresMoratorio.Text.ToDecimal > 0 Then
importeMovimiento = TxtInteresMoratorio.Text.ToDecimal
@@ -3064,8 +3056,6 @@ Partial Class Bancos_IE
End If
If Opcion.Contiene("EGSSINFACT") AndAlso CveSolicitudViatico > 0 AndAlso MsgError = "" Then
If Not ObjIE.UpdateSolicitudesViaticosIE(CveSolicitudViatico, CveIE) Then
MsgError = "Ocurrió un error al vincular el egreso con la solicitud de viatico."
@@ -3238,10 +3228,19 @@ Partial Class Bancos_IE
RegistraScript($"window.location.href = '/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=IE&CVEIE={0}", CveIE))}'", String.Format("Imprimir {0}", DdlTipoTransaccion.SelectedItem))
End If
End If
ObjIE.Commit()
End If
Catch ex As Exception
MsgError = "Ocurrió un error al guardar el IE"
ex.ToString().GuardaLog()
End Try
If MsgError = "" Then
ObjIE.Commit()
Else
ObjIE.RollBack()
Alert(MsgError, TipoMensaje.MsgError)
End If
If Msg.ToString <> "" Then
@@ -3264,7 +3263,6 @@ Partial Class Bancos_IE
AccionJS = String.Format("document.location.href=""{0}"";", HttpContext.Current.Request.Url.PathAndQuery)
End If
If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString.Contiene("EGSCREDITO") Then
AccionJS = $"document.location.href=""/Bancos/Creditos.aspx?CveCredito={Request("CveCredito")}"";"
Alert(Msg.ToString, TipoMensaje.MsgInformacion, AccionJS)
@@ -3272,18 +3270,15 @@ Partial Class Bancos_IE
Alert(Msg.ToString, TipoMensaje.MsgInformacion, String.Format("document.location.href=""{0}"";", HttpContext.Current.Request.Url.PathAndQuery))
End If
End If
End If
RecargaGlobalCuentasBancarias()
ObjIE.Dispose()
ObjMov.Dispose()
ObjOC.Dispose()
If ObjComp IsNot Nothing Then ObjComp.Dispose()
RecargaGlobalCuentasBancarias()
End Sub
#Region " NOTIFICACION PAGO "

View File

@@ -18,6 +18,7 @@
.pac-container.pac-logo {
z-index: 100000;
}
.modalPopup {
top: 132px !important;
}
@@ -25,7 +26,7 @@
</asp:Content>
<asp:Content ContentPlaceHolderID="H" ID="Content9" runat="server">
<li>
<a ID="BtnDir" OnClick="$('#dvConsulta').modal({ backdrop: 'static', keyboard: false });">
<a id="BtnDir" onclick="$('#dvConsulta').modal({ backdrop: 'static', keyboard: false });">
<i class='fa fa-search'></i><span>Ver Remisiones</span>
</a>
</li>
@@ -126,9 +127,9 @@
<asp:Button ID="BtnMostrarContrato" runat="server" Style="visibility: hidden; display: none;" />
<asp:Button ID="BtnCerrarContrato" runat="server" CssClass="btn btn-danger" Style="visibility: hidden; display: none;" />
<Ajax:ModalPopupExtender ID="MPContrato" runat="server" PopupControlID="PanelContrato" TargetControlID="BtnMostrarContrato"
<ajax:ModalPopupExtender ID="MPContrato" runat="server" PopupControlID="PanelContrato" TargetControlID="BtnMostrarContrato"
CancelControlID="BtnCerrarContrato" BackgroundCssClass="modalBackground">
</Ajax:ModalPopupExtender>
</ajax:ModalPopupExtender>
<asp:Panel ID="PanelContrato" runat="server" CssClass="modalPopup" align="center" Style="display: none; padding: 10px;">
<asp:UpdatePanel ID="UpContratos" runat="server" UpdateMode="Conditional">
@@ -145,22 +146,15 @@
<label for="<%= TxtNoRemolque.ClientID.ToString()%>">Número remolque:</label>
</div>
</div>
<div class="row">
<asp:Label style=" top: 0;margin-bottom: 0;font-size: 13px;color: #888888; opacity: 1;" runat="server" Text="Estatus"></asp:Label>
<asp:Label Style="top: 0; margin-bottom: 0; font-size: 13px; color: #888888; opacity: 1;" runat="server" Text="Estatus"></asp:Label>
<br />
<asp:DropDownList ID="DdlEstatus" DataValueField="CveEstatus" DataTextField="Estatus" runat="server" CssClass="form-control" Width="80%">
</asp:DropDownList>
</div>
<%--<asp:RadioButtonList ID="RblOpcionContrato" runat="server" CssClass="rbl" RepeatDirection="Horizontal" RepeatLayout="Table">
<asp:ListItem Text="Si" Value="2"></asp:ListItem>
<asp:ListItem Text="No" Value="1"></asp:ListItem>
</asp:RadioButtonList>--%>
<br />
<asp:LinkButton ID="BtnActualizarEstatus" onclick="BtnActualizarEstatus_Click" runat="server" CssClass="btn btn-success" Text="Aceptar" />
<asp:LinkButton ID="BtnCancelar" onclick="BtnCancelar_Click" runat="server" CssClass="btn btn-danger" Text="Cancelar" />
<asp:LinkButton ID="BtnActualizarEstatus" OnClick="BtnActualizarEstatus_Click" runat="server" CssClass="btn btn-success" Text="Aceptar" />
<asp:LinkButton ID="BtnCancelar" OnClick="BtnCancelar_Click" runat="server" CssClass="btn btn-danger" Text="Cancelar" />
&nbsp;
</div>
</ContentTemplate>

View File

@@ -42,14 +42,12 @@ Partial Class GPS_CatRemisionesVehiculos
Dim ObjTSoft As New ClsTSoft
If ObjTSoft.GetRemisiones(UsuarioActual.CveCliente) Then
GvRemisiones.DataSource = ObjTSoft.DtResultados
Else
GvRemisiones.DataSource = Nothing
End If
If ObjTSoft.GetEstatusRemisiones() Then
DdlEstatus.DataSource = ObjTSoft.DtResultados
End If
ObjTSoft.Dispose()
DdlEstatus.DataBind()
GvRemisiones.DataBind()
UPConsulta.Update()
@@ -91,16 +89,16 @@ Partial Class GPS_CatRemisionesVehiculos
UpContratos.Update()
End Sub
Protected Sub BtnActualizarEstatus_Click(sender As Object, e As EventArgs)
Dim ObjSoft As New ClsTSoft
Dim TrackingNo As String = If(TxtTracking.Text <> "", TxtTracking.Text, "-1")
Dim NumRemolque As String = If(TxtNoRemolque.Text <> "", TxtNoRemolque.Text, "-1")
Dim ObjSoft As New ClsTSoft
If ObjSoft.UpdateEstatusRemisiones(CveRemision, DdlEstatus.SelectedValue.ToEntero, TrackingNo, NumRemolque) Then
Alert("El estatus se actualizó correctamente")
End If
ObjSoft.Dispose()
TxtNoRemolque.Text = ""
TxtTracking.Text = ""
ObjSoft.Dispose()
CargaDatos()
RegistraScript("$('#C_BtnCerrarContrato').click();")
End Sub
@@ -108,17 +106,19 @@ Partial Class GPS_CatRemisionesVehiculos
RegistraScript("$('#C_BtnCerrarContrato').click();")
End Sub
Protected Sub imgHistorial_Click(sender As Object, e As EventArgs)
Dim ObjSoft As New ClsTSoft
Dim Boton = CType(sender, LinkButton)
Dim GvRow As GridViewRow = DirectCast(Boton.NamingContainer, GridViewRow)
CveRemision = Boton.CommandArgument.ToEntero
Dim ObjSoft As New ClsTSoft
If ObjSoft.GETRemisionesHistorial(GvRow.DataKey("FolioRemision").ToString, GvRow.DataKey("NoEconomico").ToString) Then
GVHistorico.DataSource = ObjSoft.DtResultados
End If
ObjSoft.Dispose()
H1.InnerText = $"Histórico Remisión: {GvRow.DataKey("FolioRemision").ToString} "
GVHistorico.DataBind()
UpHistorico.Update()
RegistraScript("$('#dvHistorico').modal();")
RegistraScript("$('#dvHistorico').modal('show');")
End Sub
End Class

View File

@@ -151,7 +151,7 @@
<div class="row" id="DivFactura" runat="server" visible="false">
<label class="col-md-1 truncate" style="width: 110px">Factura:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlFactura" runat="server" CssClass="form-control input-sm select2me" Style="max-width: 200px" DataTextField="SerieFolio" DataValueField="CveVenta">
<asp:DropDownList ID="DdlFactura" AutoPostBack="true" runat="server" CssClass="form-control input-sm select2me" Style="max-width: 200px" DataTextField="SerieFolio" DataValueField="CveVenta" OnSelectedIndexChanged="DdlFactura_SelectedIndexChanged">
</asp:DropDownList>
</div>
</div>
@@ -557,9 +557,6 @@
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div style="width: 70%" align="right">
<asp:Label ID="LbTotalMovimientos" Text="Total de Movimientos: 0" runat="server" />
@@ -567,15 +564,12 @@
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvM.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
<asp:UpdatePanel ID="UppGrid" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:HiddenField runat="server" ID="HdnCodAFEdit" Value="-1" ClientIDMode="Static" />
<asp:GridView ID="GvM" runat="server" GridLines="none" Width="70%"
CssClass="table table-hover ADScroller btn-xs" ShowHeader="True"
EmptyDataText="Aún no hay registros." DataKeyNames="No,CveMovimientoDetalle"
EmptyDataText="Aún no hay registros." DataKeyNames="No,CveMovimientoDetalle,CvePS,PU,Cantidad"
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="True" ShowHeaderWhenEmpty="True">
<Columns>
<asp:TemplateField HeaderText="" ItemStyle-Font-Size="6pt">
@@ -597,12 +591,16 @@
</ItemTemplate>
<ItemStyle Width="73px"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="Observaciones">
<ItemTemplate>
<asp:Literal ID="lblObservaciones" runat="server" Text='<%# Eval("Observaciones")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="PU">
<ItemTemplate>
<asp:Literal ID="lbPU" runat="server" Text='<%# Eval("PU", "{0:#,##0.######}")%>'> </asp:Literal>
</ItemTemplate>
<ItemStyle Width="43px"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
@@ -612,13 +610,22 @@
<ItemStyle Width="140px"></ItemStyle>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div class="row">
<div class="col-md-4">
<div id="DivTotal" runat="server" visible="false">
<div class="input-group">
<span class="input-group-addon">$</span>
<asp:TextBox ID="TxtTotal" ClientIDMode="Static" Text="0.00" CssClass="form-control input-sm" runat="server" Enabled="false" />
</div>
<ajax:FilteredTextBoxExtender ID="FTIRNC" runat="server" TargetControlID="TxtTotal" FilterType="Custom, Numbers" ValidChars=".," />
</div>
</div>
<div class="col-md-8"></div>
</div>
<br />
<div style="width: 100%; text-align: center;">
<asp:UpdatePanel runat="server">
<ContentTemplate>
@@ -628,10 +635,8 @@
<asp:Button ID="BtnContabilizar" runat="server" ValidationGroup="" Text="Contabilizar" Visible="False" CssClass="btn btn-primary" />
<asp:Button ID="BtnNuevo" runat="server" ValidationGroup="" Text="Nuevo" CssClass="btn btn-success" />
<asp:Button ID="BtnGeneraPrepoliza" runat="server" Visible="false" ValidationGroup="" Text="GeneraPrePoliza" CssClass="btn btn-success" />
<br />
<br />
<div runat="server" id="DivMensaje" visible="false">
<p>
<code>
@@ -642,14 +647,9 @@
</ContentTemplate>
</asp:UpdatePanel>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<%-- EMPIEZA: BITACORA --%>
<asp:UpdatePanel runat="server">
<ContentTemplate>
@@ -691,9 +691,7 @@
</div>
</div>
<br />
<div id="ModalBitacora" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
@@ -732,7 +730,6 @@
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<%-- TERMINA: BITACORA --%>
@@ -741,7 +738,6 @@
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Panel runat="server" DefaultButton="BtnGuardarCantidadEspecial">
<div id="ModalCantidad" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
@@ -758,7 +754,6 @@
<div class="row">
<div class="col-md-5" style="text-align: right;">
Cantidad
</div>
<div class="col-md-7">
<asp:TextBox ClientIDMode="Static" ID="TxtCantidadEspecial" Text="" runat="server"></asp:TextBox>
@@ -779,13 +774,9 @@
</div>
</div>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DivModalAgregar" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<asp:UpdatePanel ID="UpModalAgregar" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
@@ -857,10 +848,16 @@
</div>
</div>
<asp:Button ID="BtnGenerarRNC" runat="server" ClientIDMode="Static" Text="RNC" Style="display: none;" />
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
function GenerarRNC() {
$('#BtnGenerarRNC').click();
}
function CargaActivoFijo(CveAF, Codigo) {
$get("HdnCveActivoFijo").value = CveAF;
$get("HdnCodigoAF").value = Codigo;

View File

@@ -23,6 +23,14 @@ Partial Class Inventarios_RecepcionUsados
ViewState("DtMovimientos") = value
End Set
End Property
Public Property DtTamaños() As DataTable
Get
Return CType(ViewState("DtTamaños"), DataTable)
End Get
Set(value As DataTable)
ViewState("DtTamaños") = value
End Set
End Property
Public Property DtMovimientosEntradaInvFisico() As DataTable
@@ -261,6 +269,22 @@ Partial Class Inventarios_RecepcionUsados
ViewState("FolioCorreo") = value
End Set
End Property
Private Property ObjRemisionNC As Modelos.Factura
Get
Return CType(ViewState("ObjRemisionNC"), Modelos.Factura)
End Get
Set(value As Modelos.Factura)
ViewState("ObjRemisionNC") = value
End Set
End Property
Private Property ObjFactura As Modelos.Factura
Get
Return CType(ViewState("ObjFactura"), Modelos.Factura)
End Get
Set(value As Modelos.Factura)
ViewState("ObjFactura") = value
End Set
End Property
#End Region
@@ -337,6 +361,7 @@ Partial Class Inventarios_RecepcionUsados
PermisoVerImportes()
End If
CargaTamaños()
'DdlProducto2.setEsWebService(True)
'DdlProducto2.Attributes.Add("data-metodo", "getpsusados")
@@ -854,6 +879,29 @@ Partial Class Inventarios_RecepcionUsados
If Valido And AgregarUsado Then
If ObjFactura IsNot Nothing AndAlso Not EsDistribuidor Then
Dim RowDetalle As DataRow = ObjFactura.DtDetalle.FiltroPrimero($"CvePS={CvePS}")
If RowDetalle IsNot Nothing Then
'If RowDetalle("PU").ToString.ToDecimal().RoundSQL <> PU.RoundSQL Then
' Alert($"Los importes no coinciden", TipoMensaje.MsgAdvertencia)
' Exit Sub
'End If
Dim Puntos As Decimal = DtTamaños.FiltroPrimeroValor("Puntos", $"CvePSCargo={CvePS}").ToDecimal()
Dim CantidadPermitida As Double = Math.Ceiling(RowDetalle("Cantidad").ToString.ToDecimal() * Puntos)
If Cantidad > CantidadPermitida Then
Alert($"La cantidad es mayor a la permitida", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Else
Alert($"El producto no se encuentra en la factura", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
'VALIDA QUE LA SERIE NO SEA IGUAL AL CODIGO O CODIGOBARRAS
If SerieLote <> "" And (SerieLote.ToUpper = dr("Codigo").ToString.ToUpper Or SerieLote.ToUpper = dr("CodigoBarras").ToString.ToUpper) Then
@@ -931,10 +979,25 @@ Partial Class Inventarios_RecepcionUsados
End If
End Sub
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
If GvM.Rows.Count > 0 Then
'Dim CveMovimiento As Integer
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
If ObjRemisionNC IsNot Nothing Then
Dim sb As New StringBuilder()
sb.Append($"Se va a generar un documento de tipo 'Remisión de nota de crédito'.<br> Serie-Folio:<b>{ObjRemisionNC.SerieFolio}</b>.<br> ¿Esta seguro que desea guardar?:<br/>")
Alert(sb.ToString(), TipoMensaje.MsgConfirmacion, JSBtnAceptar:="GenerarRNC();", TextoConfirmacion:="&nbsp;&nbsp;&nbsp;&nbsp;Si&nbsp;&nbsp;&nbsp;&nbsp;", TextoCancelacion:="&nbsp;&nbsp;&nbsp;&nbsp;No&nbsp;&nbsp;&nbsp;&nbsp;")
Else
Guardar()
End If
End Sub
Private Sub BtnGenerarRNC_Click(sender As Object, e As EventArgs) Handles BtnGenerarRNC.Click
Guardar(True)
End Sub
Protected Sub Guardar(Optional GenerarRNC As Boolean = False)
If GvM.Rows.Count > 0 Then
Dim Msg As New StringBuilder()
Dim ObjInventario As New ClsInventarios
Dim ObjAcum As New ClsAcumuladores(ObjInventario.IniciaTransacSQL())
Dim ObjVentas As New ClsVentas(ObjInventario.IniciaTransacSQL())
@@ -955,7 +1018,6 @@ Partial Class Inventarios_RecepcionUsados
Dim CveCliente As Integer = CInt(IIf((DdlClientes.SelectedValue.ToEntero <= 0), -1, DdlClientes.SelectedValue.ToEntero))
Dim CveClienteSucursal As Integer = CInt(IIf((DdlClientesSucursales.SelectedValue.ToEntero <= 0), -1, DdlClientesSucursales.SelectedValue.ToEntero))
'cuando es APH
Dim tFolio As Integer = -1
If UsuarioActual.CveEmpresa = 48 And EsConsumoInterno = False Then tFolio = TxtFolio.Text.ToEntero
@@ -968,11 +1030,10 @@ Partial Class Inventarios_RecepcionUsados
If CveRemisionRecibida > 0 Then
CveVenta = CveRemisionRecibida
ElseIf EsDistribuidor AndAlso DdlFactura.SelectedValue.ToEntero() > 0 Then
ElseIf DdlFactura.SelectedValue.ToEntero() > 0 Then
CveVenta = DdlFactura.SelectedValue.ToEntero()
End If
'Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inv/ES", 53, 0, 0, 1, TxtFecha.Text.ToDate, $" {TxtObservaciones.Text}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3)
CveMovimiento = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, CveConcepto, 1, Fecha, tFolio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta,
CveSubProyecto, ActivoFijo, Guia:=TxtGuia.Text, Observaciones:=TxtObservaciones.Text, CvePersonal:=DdlPersonal.SelectedValue.ToEntero,
Recibio:=TxtResponsable.Text.Trim, CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, DepartamentoEntrega:=TxtDepartamentoEntrega.Text,
@@ -1010,9 +1071,6 @@ Partial Class Inventarios_RecepcionUsados
If EsDistribuidor Then
If Not ObjAcum.DistribuidorMovtosAdd(DdlClientes.SelectedValue.ToEntero, Dr("Cantidad").ToString.ToEntero(), Dr("CveTamaño").ToString.ToEntero, CveConceptoUsados, -1, UsuarioActual.CveUsuario,
UsuarioActual.CveEmpresa, 0, Dr("Observaciones").ToString, CveMovimiento:=CveMovimiento) Then
'CveCliente As Integer, Cantidad As Integer, CveTamaño As Integer, CveConcepto As Integer, CveVenta As Integer, CveUsuario As Integer,
'CveEmpresa As Integer, ImporteCompras As Decimal, Observaciones As String
Mensaje = "Error al guardar Movimientos de distribuidor"
ErrorMovInv = True
Exit For
@@ -1023,17 +1081,13 @@ Partial Class Inventarios_RecepcionUsados
If Not ErrorMovInv Then
Dim Msg As New StringBuilder
Msg.AppendFormat("<br/>El Movimiento se registro con el Folio: <b>{0}</b>", ObjInventario.Folio)
Msg.AppendFormat("<br/><br/> <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Movimiento</a> ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimiento)))
' If ObjContaAC IsNot Nothing Then ObjContaAC.AjustaPoliza(IDPoliza)
If IDPoliza > 0 Then Msg = Msg.AppendFormat("<br/><br/> <a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IDPoliza)
ObjInventario.Commit() ' aplica los movimientos insertados
'If ObjContaAC IsNot Nothing Then ObjContaAC.Commit()
Alert(Msg.ToString, TipoMensaje.MsgInformacion)
'Limpia Valores cuando inserta de campos especiales
If UsuarioActual.CveEmpresa = 66 Then
@@ -1042,38 +1096,49 @@ Partial Class Inventarios_RecepcionUsados
EnvioCorreo()
UPDatos.Update()
LimpiarMovimiento()
Else
ObjInventario.RollBack() 'deshace lo insertado
CveMovimiento = 0
' If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
Alert("ocurrió un Error al registrar los movimientos", TipoMensaje.MsgError)
' RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
End If
End If
CargaGVM(DtMovimientos.FiltraParametros("Estatus <> 'E' "))
End If
End If
Catch ex As Exception
ObjInventario.RollBack() 'deshace lo insertado
CveMovimiento = 0
' If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
Alert("Ocurrió un Error inesperado en el registro" & ex.Message, TipoMensaje.MsgError)
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
End Try
ObjInventario.Dispose() 'elimino la instancia
' If ObjContaAC IsNot Nothing Then ObjContaAC.Dispose()
ObjInventario.Dispose()
ObjAcum.Dispose()
ObjVentas.Dispose()
If Not ErrorMovInv AndAlso GenerarRNC AndAlso ObjRemisionNC IsNot Nothing Then
CargaDTDetalleRNC()
Dim Resp = ObjRemisionNC.EmitirFactura(False)
For Each mensaje As String In Resp.Mensajes
Msg.AppendFormat("<br>{0}", mensaje)
Next
Alert(Msg.ToString, If(Resp.CveVenta > 0, TipoMensaje.MsgInformacion, TipoMensaje.MsgAdvertencia))
ElseIf Not ErrorMovInv Then
Alert(Msg.ToString, TipoMensaje.MsgInformacion)
End If
Else
Alert("No hay ningun registro para generar el movimiento. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgError)
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
End If
LimpiarMovimiento()
CargaGVM(DtMovimientos.FiltraParametros("Estatus <> 'E' "))
End Sub
#End Region
@@ -1183,17 +1248,13 @@ Partial Class Inventarios_RecepcionUsados
Private Sub VisualizaPU(Opcion As Boolean)
txtPrecio.Visible = Opcion
End Sub
Private Sub VisualizaPUExtranjero(Opcion As Boolean)
End Sub
Private Sub VisualizaAF(Opcion As Boolean)
End Sub
Private Sub SiguienteFolio()
Dim Inv As New ClsInventarios
@@ -1205,50 +1266,24 @@ Partial Class Inventarios_RecepcionUsados
End Sub
Protected Sub DdlProducto2_SelectedIndexChanged(sender As Object, e As EventArgs)
ElProductoChange()
CambiarProducto()
End Sub
Private Sub ElProductoChange()
Private Sub CambiarProducto()
EscondeColumnasGVM(DtMovimientos.FiltraParametros("Estatus <> 'E' "))
If DdlProducto2.SelectedValue.ToEntero > 0 Then
Dim MetodoInventario As Integer = GlobalDTPS(UsuarioActual.CveEmpresa, DdlProducto2.SelectedValue.ToEntero).FiltroPrimeroValor("Inv_CveMetodoInventario", "").ToEntero ' ("Inv_CveMetodoInventario = 6", "PS")
End If
DdlUnidad.Items.Clear()
DdlUnidad.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProducto2.SelectedValue.ToEntero, -1)
DdlUnidad.DataBind()
HdnCveTamaño.Value = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTamaño", $"CvePS = { DdlProducto2.SelectedValue.ToEntero }")
Dim ObjAcum As New ClsAcumuladores
Dim CveTamaño As Integer = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTamaño", $"CvePS = { DdlProducto2.SelectedValue.ToEntero }").ToEntero
HdnCveTamaño.Value = CveTamaño.ToString
If ObjAcum.TamañoGet(-1, UsuarioActual.CveEmpresa) Then
Dim DtTamaños As DataTable = ObjAcum.DtResultados
HdnCveTamaño.Value = DtTamaños.FiltroPrimeroValor("CveTamaño", $"CvePSCargo = { DdlProducto2.SelectedValue }")
'LblMoldalCveTamanio.Text = DtTamaños.FiltroPrimeroValor("CveTamaño", $"CvePSCargo = { DdlProducto2.SelectedValue }")
'LblMoldalTamanio.Text = DtTamaños.FiltroPrimeroValor("Tamaño", $"CvePSCargo = { DdlProducto2.SelectedValue }")
HdnCveTamaño.Value = ObjAcum.DtResultados.FiltroPrimeroValor("CveTamaño", $"CvePSCargo = { DdlProducto2.SelectedValue }")
End If
'123123123
'If ObjAcum.TamañoGet(CveTamaño, UsuarioActual.CveEmpresa) AndAlso ObjAcum.DtResultados.Rows.Count > 0 Then
'End If
ObjAcum.Dispose()
UPDatos.Update()
UPDatos.Update()
End Sub
#End Region
@@ -1261,9 +1296,7 @@ Partial Class Inventarios_RecepcionUsados
End Sub
Private Sub EscondeColumnasGVM(DtTemp As DataTable)
Dim TienePermisoImportes = UsuarioActual.TienePermisoProceso(201)
'Dim TienePermisoImportes = UsuarioActual.TienePermisoProceso(201)
If DtTemp IsNot Nothing AndAlso DtTemp.Rows.Count > 0 Then
If DtTemp.MAX("SerieLote").ToString <> "" Then
@@ -1280,6 +1313,10 @@ Partial Class Inventarios_RecepcionUsados
If DtTemp.SUM("CostoIndirecto") > 0 Then
End If
Dim Total = DtTemp.SUM("Total")
TxtTotal.Text = Total.FormatoNumero(2)
End If
End Sub
@@ -1643,9 +1680,8 @@ Partial Class Inventarios_RecepcionUsados
#Region "DDL CLIENTE / CLIENTE SUCURSAL - SELECTED INDEX CHANGED"
Private Sub InicializaClientes()
DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltraParametros("EsDistribuidor = 1")
DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa) '.FiltraParametros("EsDistribuidor = 1")
DdlClientes.DataBind()
DdlClientes.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlClientes.SelectedValue = "-1"
@@ -1666,6 +1702,9 @@ Partial Class Inventarios_RecepcionUsados
Private Sub CambiaCliente()
DivClienteSucursal.Visible = False
DdlClientesSucursales.Items.Clear()
Me.EsDistribuidor = CBool(GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("EsDistribuidor", $"CveCliente = {DdlClientes.SelectedValue.ToEntero()}"))
CargaSucursalesCliente()
CargaFacturasCliente()
@@ -1675,11 +1714,10 @@ Partial Class Inventarios_RecepcionUsados
DivFactura.Visible = True
Dim CveCliente As Integer = DdlClientes.SelectedValue.ToEntero()
If CveCliente > 0 Then
Me.EsDistribuidor = True
Dim ObjVentas As New ClsVentas
If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "-1", "-1", -1, "-1", CveCliente, -1, -1, -1, "-1", "-1", "-1", CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
DdlFactura.DataSource = ObjVentas.DtResultados.Copy()
If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "Ing", "-1", -1, "-1", CveCliente, -1, -1, -1, "-1", "-1", "-1", CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
DdlFactura.DataSource = ObjVentas.DtResultados.FiltraParametros("", "", {"CveVenta", "SerieFolio"})
End If
ObjVentas.Dispose()
@@ -1842,7 +1880,7 @@ Partial Class Inventarios_RecepcionUsados
'DdlClasificacion.SelectedValueExist(DtMovimientos.Rows(GvRow.RowIndex)("CveClasificacion").ToString)
DdlProducto2.SelectedValueExist(DtMovimientos.Rows(GvRow.RowIndex)("CvePS").ToString)
ElProductoChange()
CambiarProducto()
'LblMoldalTamanio.Text = DtMovimientos.Rows(GvRow.RowIndex)("Tamaño").ToString
DdlUnidad.SelectedValueExist(DtMovimientos.Rows(GvRow.RowIndex)("UnidadMedida").ToString)
@@ -1944,4 +1982,433 @@ Partial Class Inventarios_RecepcionUsados
UpGenerales.Update()
End Sub
Protected Sub DdlFactura_SelectedIndexChanged(sender As Object, e As EventArgs)
If Not EsDistribuidor AndAlso Me.CveRemisionRecibida <= 0 Then
If ObjRemisionNC IsNot Nothing Then
ObjRemisionNC.Dispose()
ObjRemisionNC = Nothing
End If
If ObjFactura IsNot Nothing Then
ObjFactura.Dispose()
ObjFactura = Nothing
End If
Dim CveVenta As Integer = DdlFactura.SelectedValue.ToEntero()
ObjFactura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, DirectorioServidor:=Server.MapPath("/"))
If ObjFactura IsNot Nothing Then
CreaRemisionNC(ObjFactura.CveCliente, ObjFactura.CveSubProyecto, ObjFactura.CveMoneda)
DivTotal.Visible = True
End If
End If
UPDatos.Update()
End Sub
Private Sub CreaRemisionNC(CveCliente As Integer, CveSubProyecto As Integer, CveMoneda As Integer)
ObjRemisionNC = New Modelos.Factura(UsuarioActual)
Dim Folio As String = ""
Dim Serie As String = ""
Dim ObjFolios As New ClsGralFolios()
If ObjFolios.GetFolios("RNC", UsuarioActual.CveEmpresa) Then
Dim DT As DataTable = ObjFolios.DtResultados.FiltraParametros(String.Format(" Estado = 'Activo' AND CveSubProyecto = {0}", CveSubProyecto))
If DT.Rows.Count > 0 Then
Serie = DT.Rows(0)("Serie").ToString()
Folio = DT.Rows(0)("FActual").ToString()
End If
DT.Dispose()
End If
ObjFolios.Dispose()
ObjRemisionNC.TipoMensajeRespuesta = Modelos.TipoMensajeRespuesta.HTML
ObjRemisionNC.Serie = Serie
ObjRemisionNC.Folio = Folio.ToEntero()
ObjRemisionNC.Version = "3.3"
ObjRemisionNC.FolioFiscal = ""
ObjRemisionNC.CveUsuario = UsuarioActual.CveUsuario
ObjRemisionNC.CveEmpresa = UsuarioActual.CveEmpresa
ObjRemisionNC.TipoCambio = 1
ObjRemisionNC.ConvertirPesos = False
ObjRemisionNC.CveMoneda = CveMoneda
ObjRemisionNC.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", String.Format("CveMoneda = {0} ", CveMoneda))
ObjRemisionNC.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", String.Format("CveMoneda = {0} ", CveMoneda))
ObjRemisionNC.TipoDocto = "RNC"
ObjRemisionNC.RefDocto = ""
ObjRemisionNC.CveMesa = -1
ObjRemisionNC.Fecha = Now
ObjRemisionNC.CvePrePoliza = -1
ObjRemisionNC.FechaPago = Now
ObjRemisionNC.MotivoDescuento = ""
ObjRemisionNC.FechaEjecucion = Now
ObjRemisionNC.UsuarioCreo = UsuarioActual.Usuario
ObjRemisionNC.CveCondicionEntrega = -1
ObjRemisionNC.CondicionEntrega = ""
ObjRemisionNC.NumeroCuenta = ""
ObjRemisionNC.CondicionesPago = 0
ObjRemisionNC.FormaPago = 0
ObjRemisionNC.PedidoContrato = ""
ObjRemisionNC.NumeroContrato = ""
ObjRemisionNC.DescripcionContrato = ""
ObjRemisionNC.CveCorte = -1
ObjRemisionNC.TipoDocumento = "Remisión"
ObjRemisionNC.Alfa1 = ""
ObjRemisionNC.Alfa2 = ""
ObjRemisionNC.Alfa3 = ""
ObjRemisionNC.CveContrato = -1
ObjRemisionNC.ConvertirPesos = False
ObjRemisionNC.CveSubProyecto = CveSubProyecto
ObjRemisionNC.CveSubProyectoCobranza = CveSubProyecto
ObjRemisionNC.CveSubProyectoEjecucion = CveSubProyecto
ObjRemisionNC.SubProyecto = New Modelos.SubProyectoModel(GlobalDTSubProyectos(-1).FiltroPrimero(String.Format("CveSubProyecto = {0}", CveSubProyecto)))
ObjRemisionNC.SubProyectoMatriz = New Modelos.SubProyectoModel(GlobalDTSubProyectos(-1, CveSubProyecto:=-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal=1"))
'CLIENTE
ObjRemisionNC.CveCliente = CveCliente
ObjRemisionNC.SetCliente()
ObjRemisionNC.CveAlmacen = -1
Dim ObjCliente As New ClsClientes
If ObjCliente.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1, TipoCliente:=-1) Then
If ObjCliente.DtResultados.Rows.Count > 0 Then
ObjRemisionNC.CveFormaPago33 = ObjCliente.CveFormaPago33
ObjRemisionNC.FormaPago33 = GlobalDTVtaFormaPago.FiltroPrimeroValor("FormaPago", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33))
ObjRemisionNC.FormaPagoSAT33 = GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33))
ObjRemisionNC.CveMetodoPago33 = ObjCliente.CveMetodoPago33
ObjRemisionNC.MetodoPago33 = GlobalDTVtaMetodoPago.FiltroPrimeroValor("MetodoPago", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33))
ObjRemisionNC.ClaveMetodoPagoSAT = GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33))
ObjRemisionNC.CveUsoCFDI = ObjCliente.CveUsoCFDI
ObjRemisionNC.UsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI))
ObjRemisionNC.ClaveUsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI))
ObjRemisionNC.CveMetodoPago = ObjCliente.CveMetodoPago
If GlobalDTMetodosPago.FiltraParametros(String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago)).Rows.Count > 0 Then
ObjRemisionNC.MetodoPago = GlobalDTMetodosPago.FiltraParametros(String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago)).Rows(0)("MetodoPago").ToString
Else
ObjRemisionNC.CveMetodoPago = 1
ObjRemisionNC.MetodoPago = "Efectivo"
End If
End If
End If
If ObjCliente.GetSucursales(CveCliente) Then
If ObjCliente.DtResultados.Rows.Count > 0 Then
ObjRemisionNC.CveClienteSucursal = If(String.IsNullOrEmpty(ObjCliente.DtResultados.FiltroPrimeroValor("CveClienteSucursal", "Estatus = 'Activo'")), -1, ObjCliente.DtResultados.FiltroPrimeroValor("CveClienteSucursal", "Estatus = 'Activo'").ToEntero())
Else
ObjRemisionNC.CveClienteSucursal = -1
End If
End If
ObjCliente.Dispose()
'DETALLES
ObjRemisionNC.DtDetalle = CreaDTDetalleRNC()
'VALIDA PROMOCIONES Y EXISTENCIAS
Dim ObjVentas As New ClsVentas
If ObjVentas.GetPromocionesPS(-1, Now, CveSubProyecto, ObjRemisionNC.CveCliente, ObjRemisionNC.CveVendedor, UsuarioActual.CveEmpresa) Then
ObjRemisionNC.DtPromociones = ObjVentas.DtResultados.Copy()
End If
ObjVentas.Dispose()
ObjRemisionNC.Observaciones = ""
ObjRemisionNC.OrdenCompra = ""
ObjRemisionNC.PedidoContrato = ""
ObjRemisionNC.ObservacionesAlmacen = ""
End Sub
Private Function AddPSRNC(ByRef TmpDT As DataTable, Cantidad As Decimal, CveUM As Integer, UM As String, CveClasificacion As Integer, Clasificacion As String, CvePS As Integer, PS As String, Obs As String,
PU As Decimal, Descuento As Decimal,
CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String,
Optional SerieLote As String = "", Optional TiempoEntrega As String = "", Optional EntregaDirecta As Integer = 0,
Optional CveContratoDetalle As Integer = 0, Optional CveVentaDetalle As Integer = 0, Optional CveMovimientoDetallePedido As Integer = 0,
Optional CveOrdenCompraDetalle As Integer = 0, Optional CveVentaDetalleRemision As Integer = 0, Optional CveVentaDetalleCotizacion As Integer = 0,
Optional CuentaPredial As String = "", Optional RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0, Optional EsCargo As Boolean = False, Optional PorcentajeIVA As Decimal = 0D) As Boolean
Dim Retorno As Boolean = False
If Not CvePS > 0 Then
Alert("Ocurrió un error al cargar la información del producto a agregar. Por favor verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
Return False
End If
If (Obs.Length + PS.Length > 1000) Then
Alert(String.Format("El Nombre y observación del producto tiene longitud de {0} caracteres y excede los 1000 caracteres permitidos.", Obs.Length + PS.Length), TipoMensaje.MsgAdvertencia)
Return False
End If
Dim Row As DataRow = Nothing
Dim TotalCalculableImpuestos As Decimal = 0
PU = Math.Round(PU, 6) ' el precio unitario puede llevar hasta 6 decimales permitidos
Row = TmpDT.NewRow()
Row("CveProyecto") = CveProyecto
Row("Proyecto") = Proyecto
Row("CveSubProyecto") = CveSubProyecto
Row("SubProyecto") = SubProyecto
Row("SerieLote") = SerieLote
Row("TiempoEntrega") = TiempoEntrega
Row("Orden") = TmpDT.Rows.Count + 1
Row("Cantidad") = Cantidad
Row("CveUM") = CveUM
Row("UM") = UM
Row("CveClasificacion") = CveClasificacion
Row("Clasificacion") = Clasificacion
Row("CvePS") = CvePS
Row("Obs") = Obs
Dim DrPS As DataRow = Nothing
DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("") ' Estado = -1
If DrPS Is Nothing Then
Alert("Ocurrió un error al cargar la información del Producto. Por favor vuelva a intentar.", TipoMensaje.MsgAdvertencia)
Return False
End If
DrPS("IEPSPorcentaje") = 0
'verifica si tiene ventaminima
If Cantidad > 0 AndAlso DrPS("VentaMinima").ToString.ToDecimal > 0 Then
'verifico que la cantidad sea multiplo de venta minima, es decir ventaminima =5, solo puede vender 5,10,15...
If Cantidad Mod DrPS("VentaMinima").ToString.ToDecimal <> 0 Then
Alert(String.Format("El producto se vende solo en cantidades de {0}", DrPS("VentaMinima").ToString))
Return False
End If
End If
TotalCalculableImpuestos = (Cantidad * (PU)) - Descuento
Row("PU") = PU
Row("Codigo") = DrPS("Codigo")
Row("NoIdentificacion") = DrPS("Codigo")
Row("ClaveSATFraccionArancelaria") = DrPS("ClaveSATFraccionArancelaria")
Row("ClaveSATUnidadAduana") = DrPS("ClaveSATUnidadAduana")
Row("ClaveSATFraccionArancelariaDescripcion") = DrPS("ClaveSATFraccionArancelariaDescripcion")
Row("ClaveSATUnidadAduanaDescripcion") = DrPS("ClaveSATUnidadAduanaDescripcion")
Row("Consec") = TmpDT.Rows.Count + 1
Row("PS") = DrPS("PS")
Row("CodigoPS") = DrPS("PSCodigo").ToString
Row("CveTipoPS") = DrPS("CveTipoPS")
Row("CveTipoInvPS") = DrPS("Inv_CveMetodoInventario")
Row("CveTamaño") = DrPS("CveTamaño")
If CveClasificacion <= 0 Then Row("CveClasificacion") = DrPS("CveClasificacion")
If Clasificacion = "" Then Row("Clasificacion") = DrPS("Clasificacion")
Row("PorcentajeIVA") = PorcentajeIVA
Row("IVA") = Row("PorcentajeIVA")
Row("ImporteIVA") = Math.Round(Row("PorcentajeIVA").ToString.ToDecimal * TotalCalculableImpuestos, 2)
Row("ImporteRetIVA") = 0
Row("ImporteRetISR") = 0
Row("PorcentajeRetIVA") = 0
Row("PorcentajeRetISR") = 0
Row("PorcentajeIEPS") = DrPS("IEPSPorcentaje")
Row("ImporteIEPS") = Math.Round(DrPS("IEPSPorcentaje").ToString.ToDecimal * TotalCalculableImpuestos, 2)
Row("IEPS") = Row("ImporteIEPS")
Row("Descuento") = Math.Round(Descuento, 2)
Row("TipoDescuento") = 0
Row("Total") = (Cantidad * PU)
Row("TotalImporte") = Math.Round(Cantidad * PU, 2)
'Row("AsientoContableVentas") = DrPS("AsientoContableVentas")
' Row("IdCtaContVentas") = IdCtaContable
' Row("AplicaParaConcepto") = AplicaParaConcepto
Row("SATClaveProdServ") = DrPS("SATClavePS")
Row("SATClaveUM") = DrPS("SATClaveUnidadMedida")
Row("EntregaDirecta") = EntregaDirecta
'Contratos
Row("CveContratoDetalle") = CveContratoDetalle
Row("CveVentaDetalle") = CveVentaDetalle
Row("CveMovimientoDetallePedido") = CveVentaDetalle
Row("CveOrdenCompraDetalle") = CveOrdenCompraDetalle
Row("CveVentaDetalleRemision") = CveVentaDetalleRemision
Row("CveVentaDetalleCotizacion") = CveVentaDetalleCotizacion
Row("CveVentaDetallePedido2") = CveVentaDetallePedido2
Row("CuentaPredial") = CuentaPredial
Row("EsCargo") = EsCargo
'RECARGAR GV
TmpDT.Rows.Add(Row)
TmpDT.AcceptChanges()
Retorno = True
Return Retorno
End Function
Protected Function CreaDTDetalleRNC() As DataTable
Dim TmpDT = New DataTable
TmpDT.Columns.Add("CveVenta", GetType(Integer))
TmpDT.Columns.Add("Consec", GetType(Integer))
TmpDT.Columns.Add("Cantidad", GetType(Decimal))
TmpDT.Columns.Add("Codigo", GetType(String))
TmpDT.Columns.Add("CveUM", GetType(Integer))
TmpDT.Columns.Add("UM", GetType(String))
TmpDT.Columns.Add("SATClaveUM", GetType(String))
TmpDT.Columns.Add("CveClasificacion", GetType(Integer))
TmpDT.Columns.Add("Clasificacion", GetType(String))
TmpDT.Columns.Add("CvePS", GetType(Integer))
TmpDT.Columns.Add("PS", GetType(String))
TmpDT.Columns.Add("CodigoPS", GetType(String))
TmpDT.Columns.Add("SATClaveProdServ", GetType(String))
TmpDT.Columns.Add("NoIdentificacion", GetType(String))
TmpDT.Columns.Add("CveTipoPS", GetType(Integer))
TmpDT.Columns.Add("CveTipoInvPS", GetType(Integer))
TmpDT.Columns.Add("SerieLote", GetType(String))
TmpDT.Columns.Add("CuentaPredial", GetType(String))
TmpDT.Columns.Add("Obs", GetType(String))
TmpDT.Columns.Add("TiempoEntrega", GetType(String))
TmpDT.Columns.Add("PU", GetType(Decimal))
TmpDT.Columns.Add("IVA", GetType(Decimal))
TmpDT.Columns.Add("ImporteIVA", GetType(Decimal))
TmpDT.Columns.Add("PorcentajeIVA", GetType(Decimal))
TmpDT.Columns.Add("ImporteRetIVA", GetType(Decimal))
TmpDT.Columns.Add("ImporteRetISR", GetType(Decimal))
TmpDT.Columns.Add("PorcentajeRetIVA", GetType(Decimal))
TmpDT.Columns.Add("PorcentajeRetISR", GetType(Decimal))
TmpDT.Columns.Add("ImporteIEPS", GetType(Decimal))
TmpDT.Columns.Add("IEPS", GetType(Decimal))
TmpDT.Columns.Add("PorcentajeIEPS", GetType(Decimal))
TmpDT.Columns.Add("Descuento", GetType(Decimal))
TmpDT.Columns.Add("TipoDescuento", GetType(Integer))
TmpDT.Columns.Add("TotalImporte", GetType(Decimal))
TmpDT.Columns.Add("Total", GetType(Decimal))
'Para uso del módulo contable
TmpDT.Columns.Add("AsientoContableVentas", GetType(Integer))
TmpDT.Columns.Add("IdCtaContVentas", GetType(Integer))
TmpDT.Columns.Add("AplicaParaConcepto", GetType(Boolean))
TmpDT.Columns.Add("CveProyecto", GetType(Integer))
TmpDT.Columns.Add("Proyecto", GetType(String))
TmpDT.Columns.Add("CveSubProyecto", GetType(Integer))
TmpDT.Columns.Add("SubProyecto", GetType(String))
TmpDT.Columns.Add("CveVentaDetallePadre", GetType(Integer))
'TipoDescuento: 1 = Descuento * PU; 2 = Descuento por Total del concepto
TmpDT.Columns.Add("CvePresupuestoIngreso", GetType(Integer))
TmpDT.Columns.Add("CveFuenteRecaudacion", GetType(Integer))
'Contratos
TmpDT.Columns.Add("CveContratoDetalle", GetType(Integer))
'Remisiones a Facturas
TmpDT.Columns.Add("CveVentaDetalle", GetType(Integer))
TmpDT.Columns.Add("CveVentaDetalleRemision", GetType(Integer))
TmpDT.Columns.Add("CveVentaDetalleCotizacion", GetType(Integer))
'Pedido2 a Facturas
TmpDT.Columns.Add("CveVentaDetallePedido2", GetType(Integer))
TmpDT.Columns.Add("Origen", GetType(Integer))
'Ordenes Servicio
TmpDT.Columns.Add("CveOS", GetType(Integer))
TmpDT.Columns.Add("CveOSDetalle", GetType(Integer))
TmpDT.Columns.Add("SeFacturara", GetType(Integer))
TmpDT.Columns.Add("Folio", GetType(Integer))
TmpDT.Columns.Add("Estatus", GetType(String))
'Ordenamiento
TmpDT.Columns.Add("Orden", GetType(Integer))
TmpDT.Columns.Add("TipoDocto", GetType(String))
'OC
TmpDT.Columns.Add("CveOrdenCompraDetalle", GetType(Integer))
TmpDT.Columns.Add("EntregaDirecta", GetType(Integer))
TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
TmpDT.Columns.Add("CantidadFacturadaRem", GetType(Decimal))
TmpDT.Columns.Add("CantidadFacturadaCot", GetType(Decimal))
TmpDT.Columns.Add("CantidadFacturadaPed2", GetType(Decimal))
TmpDT.Columns.Add("CantidadInventario", GetType(Decimal))
TmpDT.Columns.Add("ClaveSATFraccionArancelaria", GetType(String))
TmpDT.Columns.Add("ClaveSATUnidadAduana", GetType(String))
TmpDT.Columns.Add("ClaveSATFraccionArancelariaDescripcion", GetType(String))
TmpDT.Columns.Add("ClaveSATUnidadAduanaDescripcion", GetType(String))
TmpDT.Columns.Add("CveTamaño", GetType(Integer))
TmpDT.Columns.Add("EsCargo", GetType(Boolean))
Return TmpDT
End Function
Protected Sub CargaDTDetalleRNC()
For Each Row As GridViewRow In GvM.Rows
If Row.RowType = DataControlRowType.DataRow Then
Dim CvePS As Integer = Row.DataKey("CvePS").ToEntero()
Dim Cantidad As Decimal = Row.DataKey("Cantidad").ToDecimal()
Dim PU As Decimal = Row.DataKey("PU").ToDecimal()
Dim SubTotal As Decimal = Cantidad * PU
Dim CveUnidadMedida As Integer = 0
Dim CveClasificacion As Integer = 0
Dim UnidadMedida As String = ""
Dim Clasificacion As String = ""
Dim PS As String = ""
Dim PorcentajeIVA As Decimal = 0D
Dim IVA As Decimal = 0D
If CvePS > 0 Then
If SubTotal > 0 Then
Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS).Rows(0)
If Dr IsNot Nothing Then
CveUnidadMedida = Dr("CveUnidadMedida").ToString.ToEntero
CveClasificacion = Dr("CveClasificacion").ToString.ToEntero
PS = Dr("PSCodigo").ToString
UnidadMedida = Dr("UnidadMedida").ToString
Clasificacion = Dr("Clasificacion").ToString
End If
PorcentajeIVA = 0.16D
IVA = SubTotal * PorcentajeIVA
End If
End If
AddPSRNC(ObjRemisionNC.DtDetalle, Cantidad, CveUnidadMedida, UnidadMedida, CveClasificacion, Clasificacion, CvePS, PS, "Inv/RecepcionUsados", SubTotal, 0, -1, "",
ObjRemisionNC.CveSubProyecto, ObjRemisionNC.SubProyecto.SubProyecto, PorcentajeIVA:=PorcentajeIVA)
End If
Next
Dim TotalImporte As Decimal = ObjRemisionNC.DtDetalle.SUM("TotalImporte").ToDecimal()
Dim ImporteIVA As Decimal = ObjRemisionNC.DtDetalle.SUM("ImporteIVA").ToDecimal()
Dim ImporteRetIVA As Decimal = ObjRemisionNC.DtDetalle.SUM("ImporteRetIVA").ToDecimal()
Dim ImporteRetISR As Decimal = ObjRemisionNC.DtDetalle.SUM("ImporteRetISR").ToDecimal()
Dim ImporteIEPS As Decimal = ObjRemisionNC.DtDetalle.SUM("ImporteIEPS").ToDecimal()
Dim Descuento As Decimal = ObjRemisionNC.DtDetalle.SUM("Descuento").ToDecimal()
Dim Amortizacion As Decimal = 0
Dim Total As Decimal = (TotalImporte + ImporteIVA + ImporteIEPS) - (ImporteRetIVA + ImporteRetISR + Descuento + Amortizacion)
'DETALLES
ObjRemisionNC.SubTotal = TotalImporte
ObjRemisionNC.Descuento = Descuento
ObjRemisionNC.Amortizacion = Amortizacion
ObjRemisionNC.IVA = ImporteIVA
ObjRemisionNC.RetIVA = ImporteRetIVA
ObjRemisionNC.RetISR = ImporteRetISR
ObjRemisionNC.IEPS = ImporteIEPS
ObjRemisionNC.Total = Total
ObjRemisionNC.TotalOtrosConceptos = 0
End Sub
Protected Sub CargaTamaños()
Dim objAcum As New ClsAcumuladores
If objAcum.TamañoGet(-1, UsuarioActual.Empresa.CveEmpresa) Then
DtTamaños = objAcum.DtResultados.Copy()
End If
objAcum.Dispose()
End Sub
End Class

File diff suppressed because one or more lines are too long

View File

@@ -274,6 +274,7 @@
<label class="col-md-2">Cancelacion:</label>
<div class="col-md-4">
<asp:TextBox ID="TxtMotivoCancelacion" CssClass="form-control input-sm" runat="server" Enabled="false" Width="365px" TextMode="MultiLine" Rows="2"></asp:TextBox>&nbsp;
</div>
</div>
</div>
@@ -586,6 +587,7 @@
<div class="row">
<div class="col-md-1" style="max-width: 60px;">
Cliente:
</div>
<div class="col-md-2">
<asp:DropDownList ID="Ddlcliente" OnSelectedIndexChanged="Ddlcliente_SelectedIndexChanged" AppendDataBoundItems="true" AutoPostBack="true" CssClass="select2me" Width="100%" DataTextField="Nombre" DataValueField="CveCliente" runat="server"></asp:DropDownList>
@@ -594,6 +596,7 @@
</div>
<div class="col-md-1" style="max-width: 75px;">
Vendedor:
</div>
<div class="col-md-2">
<div style="width: 90% !important; float: left;">
@@ -608,6 +611,7 @@
</div>
<div runat="server" id="DivLugarEntregaDirecta1" visible="false" class="col-md-2" style="max-width: 120px;">
Lugar Entrega:
</div>
<div runat="server" id="DivLugarEntregaDirecta2" visible="false" class="col-md-2">
<asp:DropDownList ID="DdlDireccionEnvio" CssClass="select2me" runat="server" Width="300px" Visible="false" DataTextField="DireccionEnvio" DataValueField="CveDireccionEnvio"></asp:DropDownList>
@@ -722,6 +726,7 @@
<tr>
<th scope="col">Cantidad</th>
<th scope="col" id="ThComercializadora" runat="server" visible="false">Tipo OC
<br />
</th>
@@ -810,6 +815,7 @@
<asp:HiddenField ID="HdnCveCuentaComprometido" runat="server" ClientIDMode="Static" />
<img alt="POA" width="15px" height="15px" src="/Imagenes/Money_add.png" style="cursor: pointer;" onclick="$get('divPOA').style.display='';PosicionaObjeto('HplMaq','divPOA');" />
</td>
<td>
</ContentTemplate>
</asp:UpdatePanel>
@@ -862,7 +868,7 @@
<ajax:ValidatorCalloutExtender ID="VCECant" runat="server" HighlightCssClass="vco" TargetControlID="RFVCantEdit" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="LtlCantidad" runat="server" Text='<%# Eval("Cantidad", "{0:#,###.######}")%>' style="width:100%"></asp:Label>
<asp:Label ID="LtlCantidad" runat="server" Text='<%# Eval("Cantidad", "{0:#,###.######}")%>' Style="width: 100%"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
@@ -1045,6 +1051,50 @@
<asp:UpdatePanel ID="UpIvas" runat="server" class="text-right" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-6">
<div class="row" id="RowCotizaciones" runat="server" visible="false">
<div class="col-md-12 ">
<div class="portlet light xspadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<%--<i class="fa fa-users font-green"></i>--%>
<span class="caption-subject bold uppercase">Cotizaciones Rapidas</span>
</div>
<div class="actions">
<div class="btn-group">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:LinkButton ID="LnkAddCotEva" CssClass="caption-subject bold" runat="server" Text=" <i class='fa fa-commenting font-green' style='font-weight: 700 !important;' ><span class='caption-subject bold'>Agregar</span></i>" Style="cursor: pointer;" ToolTip="Observaciones"></asp:LinkButton><br />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
<div class="portlet-body">
<asp:UpdatePanel ID="UpBitacoraEva" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvBitacoraEva" runat="server" AutoGenerateColumns="False" EmptyDataText="No se han capturado cotizaciones rapidas" CssClass="table table-striped table-hover Widthall" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Descripción" DataField="Descripcion" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Fecha" DataField="FechaIng" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="175px" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="Usuario" DataField="Usuario" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField HeaderText="Archivo" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="50px">
<ItemTemplate>
<asp:LinkButton ID="LinkArchivo" Visible="false" runat="server" Text="<i class='fa fa-download' aria-hidden='true'></i>" OnClick="DownloadFile"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div style="display: inline-block;">
<table border="0" rules="none" class="TextTab well ">
<tr class="text-right">
@@ -1122,14 +1172,13 @@
</tr>
</table>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:HiddenField ID="HdnEditCveActivoFijo" runat="server" ClientIDMode="Static" />
<asp:HiddenField ID="HdnEditCodigo" runat="server" ClientIDMode="Static" />
</div>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="LbAgregar" EventName="Click" />
@@ -1151,6 +1200,7 @@
<asp:HyperLink ID="hplAgregarCotizacion" Font-Size="13" CssClass="Texto thickbox" runat="server" Text="<i class='fa fa-plus'></i>&nbsp;Agregar Cotizacion" Style="cursor: pointer;" ToolTip="Agregar Cotizacion"></asp:HyperLink>
&nbsp;&nbsp;
<asp:HyperLink ID="hplEnviarCorreo" Font-Size="13" CssClass="Texto thickbox" runat="server" Text="<i class='fa fa-envelope'></i>&nbsp;Enviar cotización por correo" Style="cursor: pointer;" ToolTip="Enviar cotización por correo"></asp:HyperLink>
</div>
@@ -1424,6 +1474,7 @@
<td style="text-align: center;">
<asp:Panel runat="server" ID="PnlUsuarioAsignado" Visible="False">
Asignar a:
<asp:DropDownList ID="DdlUsuariosAsignado" CssClass="select2me" Width="200px" DataTextField="Nombre" DataValueField="CveUsuario" runat="server"></asp:DropDownList>
</asp:Panel>
<asp:Button ID="BtnGuardar" CssClass="btn btn-primary" Style="margin-top: 5px;" runat="server" Text="Guardar" Width="170px" ValidationGroup="GrpGuardar" />
@@ -1462,28 +1513,25 @@
<a name="pie_de_pagina"></a>
<div class="row" id="RowBitacora">
<div class="row">
<div class="col-md-12 ">
<div class="portlet light xspadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<%--<i class="fa fa-users font-green"></i>--%>
<span class="caption-subject bold uppercase">Bitácora</span>
</div>
<div class="actions">
<div class="btn-group">
<asp:UpdatePanel ID="UpAccionesBitacora" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:HyperLink ID="ImgAddObs" CssClass="caption-subject bold" data-toggle="modal" data-target="#ModalBitacora" runat="server" Text=" <i class='fa fa-commenting font-green' style='font-weight: 700 !important;' ><span class='caption-subject bold'>Agregar</span></i>" Style="cursor: pointer;" ToolTip="Observaciones"></asp:HyperLink><br />
<asp:LinkButton ID="ImgAddObs" CssClass="caption-subject bold" runat="server" Text=" <i class='fa fa-commenting font-green' style='font-weight: 700 !important;' ><span class='caption-subject bold'>Agregar</span></i>" Style="cursor: pointer;" ToolTip="Observaciones"></asp:LinkButton><br />
<asp:HyperLink ID="HlEvento" CssClass="thickbox caption-subject bold" runat="server" Text=" <i class='fa fa-calendar-plus-o font-green' style='font-weight: 700 !important;' >Agendar</i>" Visible="false" Style="cursor: pointer;" ToolTip="Agendar"></asp:HyperLink>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
<div class="portlet-body">
<asp:UpdatePanel ID="UPEventoBitacora" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvEB" runat="server" AutoGenerateColumns="False" EmptyDataText="No se han capturado comentarios o bitácora" CssClass="table table-striped table-hover Widthall" GridLines="None">
@@ -1495,16 +1543,13 @@
<asp:BoundField HeaderText="Prioridad" DataField="Prioridad" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Archivo" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="50px">
<ItemTemplate>
<asp:LinkButton ID="LinkArchivo" Visible="false" runat="server" CssClass="Texto" OnClick="DownloadFile">
<asp:Image ImageUrl="/Imagenes/Abajo.png" ID="ImgArchivo" runat="server" />
</asp:LinkButton>
<asp:LinkButton ID="LinkArchivo" Visible="false" runat="server" Text="<i class='fa fa-download' aria-hidden='true'></i>" OnClick="DownloadFile"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
@@ -1538,20 +1583,20 @@
<div id="ModalBitacora" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header ">
<asp:UpdatePanel runat="server" ID="UpTituloBitacora" UpdateMode="Conditional" class="modal-header">
<ContentTemplate>
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Bitácora</h4>
</div>
<h4 class="modal-title" runat="server" id="HBitacora">Bitácora</h4>
</ContentTemplate>
</asp:UpdatePanel>
<div class="modal-body">
<asp:UpdatePanel runat="server" ID="UPAddEventoBitacora" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-8">
<label>Bitácora/Observaciones</label>
<label runat="server" id="LblBitacora">Bitácora/Observaciones</label>
<br />
<asp:TextBox CssClass="form-control" ID="TxtEventoDescripcion" class="Widthall" runat="server" TextMode="MultiLine" Columns="60" Rows="4"></asp:TextBox>
<br />
@@ -1562,35 +1607,8 @@
</div>
</div>
<div>
<asp:HiddenField runat="server" ID="HdnEsCotizacion" Value="0" />
</div>
<%-- <table>
<tr>
<td></td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td width="100px">Subir Archivo:</td>
</tr>
<tr>
<td>
<asp:Literal ID="LtSubirArchivoInfo" Text="" runat="server" />
<asp:HiddenField ID="HdnArchivoEstatus" runat="server" ClientIDMode="Static" Value="" />
<asp:TextBox runat="server" ID="TxtArchivo" Width="300px" Visible="false" />
<ajax:AsyncFileUpload ID="AFU" runat="server" OnClientUploadComplete="uploadComplete" OnClientUploadError="uploadError" Width="300px" UploaderStyle="Modern" UploadingBackColor="#CCFFFF" />
</td>
</tr>
</table>--%>
</ContentTemplate>
</asp:UpdatePanel>
</div>
@@ -1654,6 +1672,7 @@
<tr class="Titulos">
<td style="width: 760px;">Programa Operativo</td>
<td style="float: right; padding-right: 3px;">Importe:
<asp:TextBox ID="TxtImporte" ClientIDMode="Static" runat="server" Width="50px" CssClass="alineanum" Enabled="false"></asp:TextBox>
</td>
<td style="padding-right: 4px;" valign="top">
@@ -1664,15 +1683,19 @@
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr style="height: 30px;">
<td style="float: left;">Fuente F:
<asp:DropDownList ID="CboFuenteFinanciamiento" runat="server" DataTextField="FuenteFinanciamiento" DataValueField="CveFuenteFinanciamiento" Width="100px"></asp:DropDownList>
</td>
<td style="float: left;">Unidad Admtiva:
<asp:DropDownList ID="CboUnidadAdministrativa" runat="server" DataTextField="UnidadAdministrativa" DataValueField="CveUnidadAdministrativa" Width="100px"></asp:DropDownList>
</td>
<td style="float: left;">Tipo Gasto:
<asp:DropDownList ID="CboTipoGasto" runat="server" DataTextField="TipoGasto" DataValueField="CveTipoGasto" Width="100px"></asp:DropDownList>
</td>
<td style="float: left;">Clasificador:
<asp:DropDownList ID="CboClasificacionOG" runat="server" DataTextField="CodigoClasificacion" DataValueField="CveClasificacion" Width="100px"></asp:DropDownList>
</td>
<td style="float: right;">
@@ -2357,6 +2380,7 @@
<div id="AccionContrato" runat="server">
<p>
Tipo de Clasificación:
</p>
<asp:RadioButtonList ID="RblOpcionClasificacion" runat="server" CssClass="rbl" RepeatDirection="Vertical" RepeatLayout="Table">
<asp:ListItem Text="Compra de Material para Venta" Value="1"></asp:ListItem>
@@ -2365,6 +2389,7 @@
<asp:LinkButton ID="BtnIniciarContrato" runat="server" CssClass="btn btn-success" Text="Aceptar" />
&nbsp;
</div>
</ContentTemplate>

View File

@@ -174,6 +174,14 @@ Partial Class OC
ViewState("NumCotizacionesGanadoras") = value
End Set
End Property
Private Property NumCotizacionesEvaluar As Integer
Get
NumCotizacionesEvaluar = IfNull(ViewState("NumCotizacionesEvaluar"), "-1", ViewState("NumCotizacionesEvaluar")).ToString().ToEntero()
End Get
Set(value As Integer)
ViewState("NumCotizacionesEvaluar") = value
End Set
End Property
Private Property ProveedoresCotizacion As ArrayList
Get
ProveedoresCotizacion = DirectCast(ViewState("ProveedoresCotizacion"), ArrayList)
@@ -964,7 +972,7 @@ Partial Class OC
DtDetalle.Columns.Add("CveContratoDetalle", GetType(Integer))
DtDetalle.Columns.Add("CantidadNoEditable", GetType(Double))
DtDetalle.Columns.Add("CveOrdenCompraDetalle", GetType(Integer))
'DtDetalle.Columns.Add("CveOrdenCompraDetalle", GetType(Integer))
' DtDetalle.Columns.Add("ClasificacionOG", GetType(String))
@@ -1223,9 +1231,11 @@ Partial Class OC
DdlPrioridad.SelectedValueExist(objOC.Prioridad.ToString)
ChkCotizacion.Checked = objOC.RequiereCotizacion
If ChkCotizacion.Checked AndAlso UsuarioActual.Empresa.Funcionalidad(565) = "1" Then
ChkCotizacion.Enabled = False
End If
tabCotizaciones.Enabled = objOC.RequiereCotizacion
tabCotizaciones.UpdatePanelID = uppOpciones.ID
TxtGuia.Text = objOC.Guia
@@ -1576,6 +1586,11 @@ Partial Class OC
'CARGA MOVTOS DE ALMACEN
InicializaMovtosAlmacen()
If UsuarioActual.Empresa.Funcionalidad(565) = "1" And pCveOrdenCompra > 0 And TipoOC.ToUpper() = "REQ" Then
RowCotizaciones.Visible = True
UpIvas.Update()
End If
uppEstatus.Update()
End Sub
@@ -2058,6 +2073,12 @@ Partial Class OC
Private Function ValidaGuardar() As Boolean
Dim TieneError = False
'Entrega Directa requiere Cliente y Vendedor
If ChkEntregaDirecta.Checked And Ddlcliente.SelectedValue.ToEntero <= 0 Then
Alert("Al ser una Entrega Directa es necesario seleccionar un cliente, por favor seleccione uno.")
Return True
End If
'VALIDA QUE TENGA REGISTROS
If Not GvD.Rows.Count > 0 Then
Alert(String.Format("La {0} debe de tener registros", TipoLargo), TipoMensaje.MsgAdvertencia)
@@ -2196,14 +2217,22 @@ Partial Class OC
End If
'VALIDA QUE TENGA LAS COTIZACIONES QUE DEBEN TENER
If UsuarioActual.Empresa.Funcionalidad(565) = "1" AndAlso CveConfianzaProveedor > 0 AndAlso (TipoOC.ToUpper = "REQ" And CveEstatusFinalOK = CboE.SelectedValue.ToEntero) Then
If UsuarioActual.Empresa.Funcionalidad(565) = "1" AndAlso (TipoOC.ToUpper = "REQ" And CveEstatusFinalOK = CboE.SelectedValue.ToEntero) Then
If CveConfianzaProveedor > 0 Then
'SUMA EL TOTAL DE COTIZACIONES
For Each GvRow As GridViewRow In GvBitacoraEva.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
Me.NumCotizacionesEvaluar += 1
End If
Next
If CveConfianzaProveedor = 1 AndAlso Me.NumCotizaciones < 1 Then
Alert("Para el proveedor seleccionado es necesario terner al menos 1 cotización.", TipoMensaje.MsgAdvertencia)
Me.NumCotizacionesEvaluar += Me.NumCotizaciones
If CveConfianzaProveedor = 1 AndAlso Me.NumCotizacionesEvaluar < 1 Then
Alert("Para el proveedor seleccionado es necesario tener al menos 1 cotización.", TipoMensaje.MsgAdvertencia)
TieneError = True
ElseIf CveConfianzaProveedor = 2 AndAlso Me.NumCotizaciones < 2 Then
Alert("Para el proveedor seleccionado es necesario terner al menos 2 cotizaciones", TipoMensaje.MsgAdvertencia)
ElseIf CveConfianzaProveedor = 2 AndAlso Me.NumCotizacionesEvaluar < 2 Then
Alert("Para el proveedor seleccionado es necesario tener al menos 2 cotizaciones", TipoMensaje.MsgAdvertencia)
TieneError = True
End If
@@ -2222,12 +2251,6 @@ Partial Class OC
End Function
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
'Entrega Directa requiere Cliente y Vendedor
If ChkEntregaDirecta.Checked And Ddlcliente.SelectedValue.ToEntero <= 0 Then
Alert("Al ser una Entrega Directa es necesario seleccionar un cliente, por favor seleccione uno.")
Exit Sub
End If
'VALIDACIONES PARA GUARDAR
If ValidaGuardar() Then Exit Sub
@@ -4501,18 +4524,48 @@ Partial Class OC
End If
End If
End Sub
Protected Sub GvBitacoraEva_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvBitacoraEva.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("Archivo").ToString.Trim <> "" AndAlso CveOrdenCompra > 0 Then
e.Row.FCLinkButton("LinkArchivo").Visible = True
e.Row.FCLinkButton("LinkArchivo").CommandArgument = String.Format("OI\{0}", e.Row.DBCampo("Archivo").ToString)
ScriptManager.GetCurrent(Me).RegisterPostBackControl(e.Row.FCLinkButton("LinkArchivo")) 'Registro un evento Postbacktrigger, que recargue toda la pagina para que funcione
End If
End If
End Sub
Protected Sub LnkAddCotEva_Click(sender As Object, e As EventArgs) Handles LnkAddCotEva.Click
HdnEsCotizacion.Value = "1"
ChkEventoPrioridad.Visible = False
HBitacora.InnerText = "Cotización"
LblBitacora.InnerText = "Cotización"
UPAddEventoBitacora.Update()
UpTituloBitacora.Update()
RegistraScript("$('#ModalBitacora').modal('show');")
End Sub
Protected Sub ImgAddObs_Click(sender As Object, e As EventArgs) Handles ImgAddObs.Click
HdnEsCotizacion.Value = "0"
ChkEventoPrioridad.Visible = True
HBitacora.InnerText = "Bitácora"
LblBitacora.InnerText = "Bitácora/Observaciones"
UPAddEventoBitacora.Update()
UpTituloBitacora.Update()
RegistraScript("$('#ModalBitacora').modal('show');")
End Sub
Protected Sub BtnGuardarEventoBitacora_Click(sender As Object, e As EventArgs) Handles BtnGuardarEventoBitacora.Click
If CveOrdenCompra > 0 Then
GuardaBitacora()
GuardaBitacora(HdnEsCotizacion.Value.ToEntero() > 0)
Else
AgregaBitacoraTemporal()
End If
End Sub
#Region " GUARDA DIRECTO "
Private Sub GuardaBitacora()
Private Sub GuardaBitacora(Optional EsCotizacion As Boolean = False)
Dim ObjEventoBitacora As New ClsOIEventos
Dim FileExtension As String = ""
Dim Filesgral As List(Of Archivo) = Anexo.getfiles().Archivos
@@ -4523,7 +4576,7 @@ Partial Class OC
Next
Dim descripcion As String = TxtEventoDescripcion.Text.Trim
Dim Prioridad As Integer = If(ChkEventoPrioridad.Checked, 3, 1)
Dim Prioridad As Integer = If(EsCotizacion, 4, If(ChkEventoPrioridad.Checked, 3, 1))
If ObjEventoBitacora.AddEventoBitacora(descripcion, String.Format("{0}", FileExtension), UsuarioActual.CveUsuario, CveEmpresaActual, CveOC:=CveOrdenCompra, Prioridad:=Prioridad) Then
@@ -4535,7 +4588,7 @@ Partial Class OC
TxtEventoDescripcion.Text = ""
Anexo.Text = "[]"
ChkEventoPrioridad.Checked = False
Alert("La bitácora/observación se guardó correctamente", TipoMensaje.MsgInformacion)
Alert($"La {If(EsCotizacion, "cotización", "bitácora/observación")} se guardó correctamente", TipoMensaje.MsgInformacion)
RegistraScript("$('#ModalBitacora').modal('hide')", "hidemodal")
'obtener el Evento de bitacora para enviar el correo
@@ -4562,7 +4615,8 @@ Partial Class OC
If ObjEventoBitacora.DtResultados.FiltraParametros("CveTipoEvento IN (6,2) AND CvePrioridad=3").Rows.Count > 0 Then
DivEventoUrgente.Visible = True
End If
GvEB.DataSource = ObjEventoBitacora.DtResultados.FiltraParametros("CveTipoEvento IN (6,2)")
GvEB.DataSource = ObjEventoBitacora.DtResultados.FiltraParametros("CveTipoEvento IN (6,2) AND CvePrioridad <> 4")
GvBitacoraEva.DataSource = ObjEventoBitacora.DtResultados.FiltraParametros("CvePrioridad = 4")
Else
GvEB.DataSource = Nothing
End If
@@ -4570,7 +4624,9 @@ Partial Class OC
ObjEventoBitacora.Dispose()
GvEB.DataBind()
GvBitacoraEva.DataBind()
UPEventoBitacora.Update()
UpIvas.Update()
End Sub
#End Region
@@ -4703,7 +4759,7 @@ Partial Class OC
option72.Visible = True
DivFolioAdicional.Visible = True
generarAnticipo.Visible = True
Ddlcliente.DataSource = GlobalDTCliente(CveEmpresaActual).FiltraParametros(" Estatus = 'Activo' ")
Ddlcliente.DataSource = GlobalDTCliente(CveEmpresaActual)
Ddlcliente.DataBind()
Ddlcliente.Items.Insert(0, New ListItem(" - ", "-1"))
DdlVendedor.DataSource = GlobalDTVendedores(CveEmpresaActual)

View File

@@ -4641,6 +4641,8 @@ Partial Class PV
End If
ObjCliente.Dispose()
RecargaGlobalCliente()
End Sub
#End Region
@@ -4823,6 +4825,18 @@ Partial Class PV
ObjPS.Dispose()
End Sub
Private Sub RecargaGlobalCliente()
Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDTCliente)
Hilo.Start()
End Sub
Private Sub GeneraGlobalDTCliente()
Dim Objclientes As New ClsClientes
If Objclientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1, Estatus:=-1, TipoCliente:=-1) Then
Application("GlobalDTCliente") = Objclientes.DtResultados
End If
Objclientes.Dispose()
End Sub
#End Region
#Region "CLASIFICACIONES DETALLES"

View File

@@ -16776,7 +16776,7 @@ Partial Class Ventas
End Sub
Private Sub GeneraGlobalDTCliente()
Dim Objclientes As New ClsClientes
If Objclientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1, Estatus:=-1) Then
If Objclientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1, Estatus:=-1,TipoCliente:=-1) Then
Application("GlobalDTCliente") = Objclientes.DtResultados
End If
Objclientes.Dispose()