Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -1279,7 +1279,7 @@ Public Class ClsInventarios
|
||||
Optional CveSeccionAlmacen As Integer = -1, Optional Serie As String = "", Optional Lote As String = "", Optional FechaCaducidad As Date = MinFecha,
|
||||
Optional Observaciones As String = "", Optional CveMovimientoDetalleEntrada As Integer = -1, Optional PUTC As Decimal = -1,
|
||||
Optional CostoIndirecto As Decimal = 0, Optional CveCompraDetalle As Integer = -1, Optional CveOrdenCompraDetalle As Integer = -1, Optional CveVentaDetalle As Integer = -1,
|
||||
Optional CveContratoDetalle As Integer = -1, Optional CveUsuarioModifico As Integer = -1, Optional EsInterno As Integer = -1) As Boolean
|
||||
Optional CveContratoDetalle As Integer = -1, Optional CveUsuarioModifico As Integer = -1, Optional EsInterno As Integer = -1, Optional CveVentaDetallePadre As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Inv_MovimientosDetalleAdd")
|
||||
@@ -1305,6 +1305,7 @@ Public Class ClsInventarios
|
||||
.Add("@CveContratoDetalle", SqlDbType.Int).Value = CveContratoDetalle
|
||||
.Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
|
||||
.Add("@EsInterno", SqlDbType.Int).Value = EsInterno
|
||||
.Add("@CveVentaDetallePadre", SqlDbType.Int).Value = CveVentaDetallePadre
|
||||
|
||||
.Add("@CveMovimientoDetalle", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||
End With
|
||||
|
||||
@@ -1810,6 +1810,18 @@ Partial Class PopUpVerFactura
|
||||
End If
|
||||
End If
|
||||
|
||||
'SI ES TIPO RELACION 07- APLICACION DE ANTICIPOS
|
||||
If dtVentas(0)("CveTipoRelacion").ToString.ToEntero = 7 Then
|
||||
Dim RowTipoRelacion As DataRow = GlobalDTVtaTiposRelacion().FiltroPrimero($"CveTipoRelacion = {dtVentas(0)("CveTipoRelacion").ToString.ToEntero}")
|
||||
|
||||
Vta.Timbre.CFDIRelacionados.TipoRelacion = RowTipoRelacion("SATClaveTipoRelacion").ToString()
|
||||
Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = RowTipoRelacion("SATTipoRelacion").ToString()
|
||||
|
||||
If ObjVentas.GetVentasRelacionadas(CveVenta, UsuarioActual.CveEmpresa) Then
|
||||
Vta.DtDocumentosRelacionados = ObjVentas.DtResultados.FiltraParametros("FolioFiscal IS NOT NULL")
|
||||
End If
|
||||
End If
|
||||
|
||||
'End If
|
||||
|
||||
'If Vta.TipoDocto.Contiene("Egs", "Dev", "Ant") Then
|
||||
|
||||
@@ -1231,8 +1231,12 @@
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
|
||||
<ajax:TabPanel ID="TabHis" runat="server" HeaderText="Historial de Ventas">
|
||||
<ajax:TabPanel ID="TabHis" runat="server">
|
||||
<HeaderTemplate>
|
||||
<span>Historial de Ventas</span>
|
||||
</HeaderTemplate>
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="portlet light xspadding bordered">
|
||||
@@ -1343,8 +1347,7 @@
|
||||
<asp:PostBackTrigger ControlID="BtnPDFHistorial" />
|
||||
</Triggers>
|
||||
<ContentTemplate>
|
||||
|
||||
|
||||
<asp:Button ID="BtnHistorialVentas" runat="server" ClientIDMode="Static" Text="HistorialVentas" Style="display: none;" OnClick="BtnHistorialVentas_Click" />
|
||||
<asp:GridView ID="GVHistorial" runat="server" DataKeyNames="CveVenta, Folio, TipoDocto" AutoGenerateColumns="False" EmptyDataText="No se encontraron Ventas en el Cliente" ToolTip="Listado de Historial de Ventas" CssClass="table table-striped table-advance table-hover" Style="text-align: center; min-width: 783px; width: 100%;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Tipo" DataField="TipoDocto" ItemStyle-HorizontalAlign="Center" />
|
||||
@@ -1560,12 +1563,14 @@
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
|
||||
<ajax:TabPanel ID="TabCxC" runat="server" HeaderText="Cuentas x Cobrar">
|
||||
<ajax:TabPanel ID="TabCxC" runat="server">
|
||||
<HeaderTemplate>
|
||||
<span>Cuentas x Cobrar</span>
|
||||
</HeaderTemplate>
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:UpdatePanel ID="UpImprimir" runat="server">
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-7">
|
||||
|
||||
@@ -1582,6 +1587,7 @@
|
||||
<div class="portlet-body">
|
||||
<asp:UpdatePanel ID="UpParametros" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnCargaCxC" runat="server" ClientIDMode="Static" Text="CargaCxC" Style="display: none;" OnClick="BtnCargaCxC_Click" />
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
|
||||
@@ -2169,7 +2175,7 @@
|
||||
|
||||
<asp:UpdatePanel ID="UpAnticipos" runat="server">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:Button ID="BtnCargaAnticipos" runat="server" ClientIDMode="Static" Text="CargaAnt" Style="display: none;" OnClick="BtnCargaAnticipos_Click" />
|
||||
<div class="row col-md-12" align="right">
|
||||
<input type="text" id="TxtBusquedaAnticipos" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaAnticipos','{0}')", GVAnticipos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaAnticipos','{0}')", GVAnticipos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
@@ -2298,7 +2304,10 @@
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
|
||||
<ajax:TabPanel ID="TabBancos" runat="server" HeaderText="Bancos">
|
||||
<ajax:TabPanel ID="TabBancos" runat="server">
|
||||
<HeaderTemplate>
|
||||
<span>Bancos</span>
|
||||
</HeaderTemplate>
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="portlet light xspadding bordered ">
|
||||
@@ -2442,55 +2451,61 @@
|
||||
</div>
|
||||
|
||||
<div class="table-scrollable">
|
||||
<asp:GridView ID="GvBancos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontró Historial de Abonos"
|
||||
CssClass="table table-striped table-advance table-hover ScrollAD" data-sort="false" BorderWidth="1" BorderColor="#D3D3D3" GridLines="None" DataKeyNames="SerieFolioCP">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Factura" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HplFactura" CssClass="Texto" runat="server" Text='<%# Eval("SerieFolio")%>' NavigateUrl='<%# Eval("CveVenta", "/Ventas/Ventas.aspx?CveVenta={0}")%>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="Fecha Venta" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:TemplateField HeaderText="Fecha Vencimiento" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFechaVenci" runat="server" Text='<%# Eval("FechaVencimiento", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Cheque" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HplCheque" Visible="False" runat="server" CssClass="Texto" Text='<%# Eval("FolioCobro")%>' NavigateUrl='<%# Eval("CveIE", "/Bancos/IE.aspx?CveIE={0}") %>'></asp:HyperLink>
|
||||
<asp:UpdatePanel ID="UpBancos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnCargaBancos" runat="server" ClientIDMode="Static" Text="CargaBancos" Style="display: none;" OnClick="BtnCargaBancos_Click" />
|
||||
|
||||
<asp:GridView ID="GvBancos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontró Historial de Abonos"
|
||||
CssClass="table table-striped table-advance table-hover ScrollAD" data-sort="false" BorderWidth="1" BorderColor="#D3D3D3" GridLines="None" DataKeyNames="SerieFolioCP">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Factura" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HplFactura" CssClass="Texto" runat="server" Text='<%# Eval("SerieFolio")%>' NavigateUrl='<%# Eval("CveVenta", "/Ventas/Ventas.aspx?CveVenta={0}")%>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="Fecha Venta" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:TemplateField HeaderText="Fecha Vencimiento" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFechaVenci" runat="server" Text='<%# Eval("FechaVencimiento", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Cheque" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HplCheque" Visible="False" runat="server" CssClass="Texto" Text='<%# Eval("FolioCobro")%>' NavigateUrl='<%# Eval("CveIE", "/Bancos/IE.aspx?CveIE={0}") %>'></asp:HyperLink>
|
||||
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Abonado" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlImp" runat="server" Text='<%# Eval("ImporteAbonado", "{0:N2}")%>'></asp:Literal>
|
||||
<asp:Literal ID="LtlMon" runat="server" Text='<%# Eval("MonedaVenta")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Archivos</HeaderTemplate>
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HplXML" runat="server" Visible="false" Target="_blank"><i class='fa fa-file-excel-o' style="font-weight:bold;"></i></asp:HyperLink>
|
||||
<asp:HyperLink ID="HplPDF" runat="server" Visible="false" Target="_blank"><i class='fa fa-file-pdf-o' style="font-weight:bold;"></i></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Reenviar Complemento</HeaderTemplate>
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
<ItemTemplate>
|
||||
<%-- <a id="HLSendMail" runat="server" class="Texto" visible="false">
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Abonado" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlImp" runat="server" Text='<%# Eval("ImporteAbonado", "{0:N2}")%>'></asp:Literal>
|
||||
<asp:Literal ID="LtlMon" runat="server" Text='<%# Eval("MonedaVenta")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Archivos</HeaderTemplate>
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HplXML" runat="server" Visible="false" Target="_blank"><i class='fa fa-file-excel-o' style="font-weight:bold;"></i></asp:HyperLink>
|
||||
<asp:HyperLink ID="HplPDF" runat="server" Visible="false" Target="_blank"><i class='fa fa-file-pdf-o' style="font-weight:bold;"></i></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Reenviar Complemento</HeaderTemplate>
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
<ItemTemplate>
|
||||
<%-- <a id="HLSendMail" runat="server" class="Texto" visible="false">
|
||||
<i class="fa fa-envelope fa-2" aria-hidden="true"></i>
|
||||
</a>--%>
|
||||
<asp:LinkButton ID="LnkSendMail" CssClass="Texto" OnClick="LnkSendMail_Click" runat="server" Visible="false"> <i class="fa fa-envelope fa-2" aria-hidden="true"></i></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
</asp:GridView>
|
||||
<asp:LinkButton ID="LnkSendMail" CssClass="Texto" OnClick="LnkSendMail_Click" runat="server" Visible="false"> <i class="fa fa-envelope fa-2" aria-hidden="true"></i></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="text-right ">
|
||||
<asp:LinkButton ID="BtnVerMasBancos" runat="server" Text="Ver Más" OnClick="BtnVerMasBancos_Click" class="btn btn-primary" />
|
||||
@@ -6525,7 +6540,7 @@
|
||||
$.fn.dataTable.tables({ visible: true, api: true }).columns.adjust();
|
||||
});
|
||||
|
||||
<%-- $("C_Tab_TabAlta_TxtTelefono").inputmask("mask", {
|
||||
<%-- $("C_Tab_TabAlta_TxtTelefono").inputmask("mask", {
|
||||
"mask": "(999) 999-9999"
|
||||
});
|
||||
|
||||
@@ -6534,6 +6549,18 @@
|
||||
"mask": "(999) 999-9999"
|
||||
});
|
||||
});--%>
|
||||
|
||||
if (<%= Me.CveCliente %> > 0) {
|
||||
//CARGA EL HISTORIAL DE VENTAS
|
||||
$("#C_Tab_TabHis_tab").click(function () { CargaHistorialVentas(); });
|
||||
//CARGA EL CXC
|
||||
$("#C_Tab_TabCxC_tab").click(function () { CargaCxC(); });
|
||||
//CARGA ANTICIPOS
|
||||
$("#C_Tab_TabAnticipos_tab").click(function () { CargaAnticipos(); });
|
||||
//CARGA BANCOS
|
||||
$("#C_Tab_TabBancos_tab").click(function () { CargaBancos(); });
|
||||
}
|
||||
|
||||
}
|
||||
$(document).on('mouseenter', ".truncate", function () {
|
||||
var $this = $(this);
|
||||
@@ -6706,6 +6733,23 @@
|
||||
$get("HdnCuenta").value = op;
|
||||
$("#BtnCargarCuentas").click();
|
||||
}
|
||||
|
||||
function CargaCxC() {
|
||||
$('#BtnCargaCxC').click();
|
||||
}
|
||||
|
||||
function CargaAnticipos() {
|
||||
$('#BtnCargaAnticipos').click();
|
||||
}
|
||||
|
||||
function CargaBancos() {
|
||||
$('#BtnCargaBancos').click();
|
||||
}
|
||||
|
||||
function CargaHistorialVentas() {
|
||||
$('#BtnHistorialVentas').click();
|
||||
}
|
||||
|
||||
function LimpiaModal() {
|
||||
$('#<%= TxtEnvioDireccion.ClientID %>').val('');
|
||||
$('#<%= TxtEnvioNoExt.ClientID %>').val('');
|
||||
|
||||
@@ -25,9 +25,9 @@ Partial Class Clientes
|
||||
Private Opcion As Integer
|
||||
<PersistenceModeAttribute(PersistenceMode.InnerProperty)>
|
||||
Public ReadOnly Property RowStyle As TableItemStyle
|
||||
Private ReadOnly Property CveCliente As Integer
|
||||
Public ReadOnly Property CveCliente As Integer
|
||||
Get
|
||||
Return ViewState("CveCliente").ToString().ToEntero()
|
||||
Return If(IsNothing(ViewState("CveCliente")), "-1", ViewState("CveCliente").ToString()).ToEntero()
|
||||
End Get
|
||||
End Property
|
||||
Private Property DTCuentasBancos As DataTable
|
||||
@@ -1400,6 +1400,7 @@ Partial Class Clientes
|
||||
HeedarContable.Attributes.Remove("onclick")
|
||||
UpFiscalContable.Update()
|
||||
End Sub
|
||||
|
||||
Private Function CargaDatos() As Boolean
|
||||
Dim watch As New Diagnostics.Stopwatch()
|
||||
watch.Start()
|
||||
@@ -1413,15 +1414,11 @@ Partial Class Clientes
|
||||
CargaDdlSucursalCliente()
|
||||
CargaDocumentosVenta(CveCliente)
|
||||
|
||||
Dim RetSC As Boolean = CargaSucursalesCliente()
|
||||
Dim RetCC As Boolean = CargaCotizaciones()
|
||||
CargaHistorial()
|
||||
CargaResumenHistorial()
|
||||
Dim RetCxC As Boolean = CargaCxC()
|
||||
CargaAnticipos()
|
||||
Dim RetSC As Boolean = CargaSucursalesCliente()
|
||||
|
||||
|
||||
CargaPersonalAsignado()
|
||||
CargaUsuariosPortal()
|
||||
CargaBancos()
|
||||
CargaOrdenesServiciosCliente()
|
||||
CargaImpuestosLocales()
|
||||
CargaCuentasContablesDdls()
|
||||
@@ -2059,6 +2056,8 @@ Partial Class Clientes
|
||||
End If
|
||||
ObjMovtos.Dispose()
|
||||
GvBancos.DataBind()
|
||||
|
||||
UpBancos.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvBancos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvBancos.RowDataBound
|
||||
@@ -10627,5 +10626,32 @@ Partial Class Clientes
|
||||
|
||||
CargaDispositivos(DdlEstatusDispositivos.SelectedValue.ToEntero())
|
||||
End Sub
|
||||
Protected Sub BtnCargaCxC_Click(sender As Object, e As EventArgs)
|
||||
If CveCliente > 0 Then
|
||||
CargaCxC()
|
||||
UpDatos.Update()
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub BtnHistorialVentas_Click(sender As Object, e As EventArgs)
|
||||
If CveCliente > 0 Then
|
||||
CargaCotizaciones()
|
||||
CargaHistorial()
|
||||
CargaResumenHistorial()
|
||||
|
||||
UpnHistorial.Update()
|
||||
UpDatos.Update()
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub BtnCargaAnticipos_Click(sender As Object, e As EventArgs)
|
||||
If CveCliente > 0 Then
|
||||
CargaAnticipos()
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub BtnCargaBancos_Click(sender As Object, e As EventArgs)
|
||||
If CveCliente > 0 Then
|
||||
CargaBancos()
|
||||
UpDatos.Update()
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
|
||||
@@ -6216,7 +6216,7 @@ Partial Class Ventas
|
||||
Dim ValorAutorizacion As String = UsuarioActual.Empresa.Funcionalidad(595)
|
||||
|
||||
'OBLIGAR PAGO DE CONTADO SI EL CLIENTE NO PERMITE CREDITO
|
||||
If UsuarioActual.Empresa.Funcionalidad(570) = "1" AndAlso Me.PermiteCredito = False AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem") AndAlso CveVenta <= 0 Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(570) = "1" AndAlso Me.PermiteCredito = False AndAlso ((DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem") AndAlso CveVenta < 1) OrElse (DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Cot") AndAlso EsCreaApartirDe)) Then
|
||||
RBLPago.SelectedValue = "2"
|
||||
RBLPago.Items(0).Enabled = False
|
||||
RBLPago_SelectedIndexChanged(Nothing, Nothing)
|
||||
@@ -6234,12 +6234,14 @@ Partial Class Ventas
|
||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Rem"))
|
||||
LnkPedido2SinFacturar.Visible = False
|
||||
LnkCotizaciones.Visible = False
|
||||
BtnsFacturar.Visible = False
|
||||
End If
|
||||
UPCondicionesPago.Update()
|
||||
'CARGAR CREDITO DISPONIBLE AL GENERAR UNA FACTURA
|
||||
End If
|
||||
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Cot", "PA") AndAlso CveVenta <= 0 AndAlso RBLPago.SelectedValue = "1" AndAlso PermiteCredito Then
|
||||
'FUNCIONALIDAD 702 - NO VERIFICAR LIMITE DE CRÉDITO Y CANDADOS DE VENTA
|
||||
If Not UsuarioActual.Empresa.Funcionalidad(702) = "1" Then
|
||||
RBLPago.SelectedValue = "1"
|
||||
RBLPago_SelectedIndexChanged(Nothing, Nothing)
|
||||
@@ -6252,7 +6254,7 @@ Partial Class Ventas
|
||||
LblCreditoDisponible.Text = CreditoDispo.FormatoNumero
|
||||
If PorcentajeCredito > 80 Then TrPorcentajeCredito.Visible = True : LblPorcentajeCredito.Text = $"{PorcentajeCredito.FormatoNumero}%"
|
||||
|
||||
If Not UsuarioActual.TienePermisoProceso(268) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "PA") Then
|
||||
If Not UsuarioActual.TienePermisoProceso(268) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "PA") AndAlso (Not UsuarioActual.Empresa.Funcionalidad(702).Contiene("2")) Then
|
||||
Dim Vta As New ClsVentas
|
||||
Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa)
|
||||
Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón: <br> <br> {0}", Vta.SerieVenta)
|
||||
@@ -6288,8 +6290,9 @@ Partial Class Ventas
|
||||
' el cliente tiene crédito disponible, no tiene bloqueo
|
||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("PA"))
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(60) Then DdlTipoComprobante.SelectedValueExistInsert("Ing", "Ingresos") 'puede facturar
|
||||
If UsuarioActual.TienePermisoProceso(199) Then DdlTipoComprobante.SelectedValueExistInsert("Rem", "Remisión") ' puede remisionar
|
||||
If UsuarioActual.TienePermisoProceso(60) Then DdlTipoComprobante.SelectedValueExistInsert("Ing", "Ingresos") 'puede facturar
|
||||
|
||||
DdlTipoComprobante.SelectedValueExist(UsuarioActual.CveTipoDocumento)
|
||||
|
||||
TxtFechaPago.Text = If(DdlTipoComprobante.SelectedValue = "Rem", Now.AddDays(PlazoCobranzaRemision), Now.AddDays(PlazoCobranza)).ToShortDateString
|
||||
@@ -6301,7 +6304,7 @@ Partial Class Ventas
|
||||
'GENERAR AUTORIZACION SI TIENE EXCEDIO EL LIMITE DE CREDITO
|
||||
Select Case ValorAutorizacion
|
||||
Case "1" 'CREAR DOCUMENTO DE AUTORIZACION PA
|
||||
If Not UsuarioActual.TienePermisoProceso(268) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing", "Ant", "PA") Then
|
||||
If Not UsuarioActual.TienePermisoProceso(268) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing", "Ant", "PA") AndAlso Not (UsuarioActual.Empresa.Funcionalidad(702).Contiene("2")) Then
|
||||
|
||||
'VERIFICAR CANDADOS DE VENTA, REMISIONES SIN FACTURAR, FACTURAS QUE NO TENGAN VENCIDAS
|
||||
Dim Vta As New ClsVentas
|
||||
@@ -6311,6 +6314,7 @@ Partial Class Ventas
|
||||
If Opcion > 0 Then
|
||||
If Opcion = 1 Then
|
||||
BtnEmitirImprimir.Visible = False
|
||||
BtnsFacturar.Visible = False
|
||||
End If
|
||||
If Alertas Then Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
|
||||
Else
|
||||
@@ -6387,7 +6391,7 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
'Puede hacer pedido
|
||||
If Me.CveVenta <= 0 Then
|
||||
If CveVenta <= 0 Then
|
||||
If Not UsuarioActual.TienePermisoProceso(177) Then
|
||||
If DdlTipoComprobante.Items.FindByValue("Pd2") IsNot Nothing Then
|
||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Pd2"))
|
||||
@@ -7645,36 +7649,40 @@ Partial Class Ventas
|
||||
'No exceder el limite de credito, Si no tiene contrato limita el credito, si tiene no hace nada. Si no tiene remisiones tampoco hace nada.
|
||||
If (Not CveContrato > 0 Or CveContratoTipo.Contiene(28)) AndAlso (Not NuevaFactura = 1) AndAlso RBLPago.SelectedValue = "1" AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") AndAlso RemisionesLista.Count <= 0 AndAlso TxtTotal.Text.ToDecimal > 0 AndAlso Not CvePedidoA > 0 Then
|
||||
'If UsuarioActual.Empresa.Funcionalidad(518) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(185) Then
|
||||
Dim ObjVentas As New ClsVentas
|
||||
|
||||
If ObjVentas.ObtenerCreditoRestante(CveCliente, DdlSucursalCliente.SelectedValue.ToEntero()) Then
|
||||
If ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||
If Not UsuarioActual.Empresa.Funcionalidad(702) = "1" Then
|
||||
Dim ObjVentas As New ClsVentas
|
||||
|
||||
If DdlSucursalCliente.SelectedValue.ToEntero() > 0 Then
|
||||
If ObjVentas.DtResultados(0)("LimiteRestanteSucursal").ToString().ToDecimal - If(TxtTipoCambio.Visible, TxtTotal.Text.ToDecimal * TxtTipoCambio.Text.ToDecimal, TxtTotal.Text.ToDecimal) < 0 Then
|
||||
ObjVentas.Dispose()
|
||||
Alert("Se está excediendo el límite de credito permitido de la Sucursal del Cliente.", TipoMensaje.MsgInformacion)
|
||||
Exit Sub
|
||||
If ObjVentas.ObtenerCreditoRestante(CveCliente, DdlSucursalCliente.SelectedValue.ToEntero()) Then
|
||||
If ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
If DdlSucursalCliente.SelectedValue.ToEntero() > 0 Then
|
||||
If ObjVentas.DtResultados(0)("LimiteRestanteSucursal").ToString().ToDecimal - If(TxtTipoCambio.Visible, TxtTotal.Text.ToDecimal * TxtTipoCambio.Text.ToDecimal, TxtTotal.Text.ToDecimal) < 0 Then
|
||||
ObjVentas.Dispose()
|
||||
Alert("Se está excediendo el límite de credito permitido de la Sucursal del Cliente.", TipoMensaje.MsgInformacion)
|
||||
Exit Sub
|
||||
End If
|
||||
Else
|
||||
If ObjVentas.DtResultados(0)("LimiteRestanteCliente").ToString().ToDecimal - If(TxtTipoCambio.Visible, TxtTotal.Text.ToDecimal * TxtTipoCambio.Text.ToDecimal, TxtTotal.Text.ToDecimal) < 0 Then
|
||||
ObjVentas.Dispose()
|
||||
Alert("Se está excediendo el límite de credito permitido del Cliente.", TipoMensaje.MsgInformacion)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
Else
|
||||
If ObjVentas.DtResultados(0)("LimiteRestanteCliente").ToString().ToDecimal - If(TxtTipoCambio.Visible, TxtTotal.Text.ToDecimal * TxtTipoCambio.Text.ToDecimal, TxtTotal.Text.ToDecimal) < 0 Then
|
||||
ObjVentas.Dispose()
|
||||
Alert("Se está excediendo el límite de credito permitido del Cliente.", TipoMensaje.MsgInformacion)
|
||||
Exit Sub
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
Alert("Ocurrio un error al obtener el limite de credito del cliente", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Else
|
||||
ObjVentas.Dispose()
|
||||
Alert("Ocurrio un error al obtener el limite de credito del cliente", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
Else
|
||||
ObjVentas.Dispose()
|
||||
Alert("Ocurrio un error al obtener el limite de credito del cliente", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
|
||||
'End If
|
||||
End If
|
||||
|
||||
@@ -8196,7 +8204,7 @@ Partial Class Ventas
|
||||
Dim CveVentaAnterior As Integer = Me.CveVenta
|
||||
|
||||
GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjFactura, TmpDT, ObjFactura.CveNCaVincular, ObjContPaq, ObjBancos, ObjOS,
|
||||
ObjEventos, ObjCGame, ObjClientes, EsNCAmortizacion:=EsNCAmortizacion)
|
||||
ObjEventos, ObjCGame, ObjClientes, EsNCAmortizacion:=EsNCAmortizacion, CveAnticipoPadre:=CveAnticipoPadre)
|
||||
|
||||
'Agregamos las OCs a la tabla
|
||||
If ObjFactura.CveVenta > 0 AndAlso ErrorList.Count = 0 AndAlso DTOrdenesCompraPS IsNot Nothing AndAlso DTOrdenesCompraPS.Rows.Count > 0 AndAlso ErrorList.Count = 0 Then
|
||||
@@ -11171,7 +11179,7 @@ Partial Class Ventas
|
||||
#Region " GUARDAR - VENTA, PREPOLIZAS, INV, ESTIMACIONES, AC, NOTA DE CRÉDITO "
|
||||
Private Sub GuardarVenta(ByRef ObjVentas As ClsVentas, ByRef ObjConta As ClsContabilidad, ByRef ObjInventario As ClsInventarios, ByRef ObjContr As ClsContratos, factura As Modelos.Factura, ByRef TmpDTDetalle As DataTable, CveNCaVincular As Integer,
|
||||
ByRef objContPaqi As ClsContPAQi, Optional ByRef ObjBancos As ClsBancos = Nothing, Optional ByRef ObjOS As ClsOS = Nothing, ByRef Optional ObjEventos As ClsOIEventos = Nothing, ByRef Optional ObjCGame As ClsCGame = Nothing,
|
||||
ByRef Optional ObjCliente As ClsClientes = Nothing, Optional EsNCAmortizacion As Boolean = False, Optional NCDescuento As Boolean = False, Optional ListaNCDescuento As List(Of Modelos.Factura) = Nothing)
|
||||
ByRef Optional ObjCliente As ClsClientes = Nothing, Optional EsNCAmortizacion As Boolean = False, Optional NCDescuento As Boolean = False, Optional ListaNCDescuento As List(Of Modelos.Factura) = Nothing, Optional CveAnticipoPadre As Integer = -1)
|
||||
|
||||
Dim Msgok As New StringBuilder
|
||||
Dim CveAlmacenTraspasoOrigen As Integer = -1
|
||||
@@ -11277,7 +11285,7 @@ Partial Class Ventas
|
||||
FormaPaqueteria:=RblPaqueteria.SelectedValue.ToEntero, FacturarSucursal:=factura.FacturarSucursal, VentaDesglosaIEPS:=factura.VentaDesglosaIEPS, RFCReceptor:=RFCReceptor, Adjunto:=Adjunto, DevolucionImportePagado:=factura.DevolucionImportePagado) Then
|
||||
ErrorList.Add("Ocurrió un error al Generar la Venta.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
|
||||
Else
|
||||
If factura.TipoDocto.Contiene("Dev", "Egs") OrElse DtVentasNC IsNot Nothing OrElse CveEstatusRefacturacion > 0 Then
|
||||
If factura.TipoDocto.Contiene("Dev", "Egs") OrElse DtVentasNC IsNot Nothing OrElse CveEstatusRefacturacion > 0 OrElse CveAnticipoPadre > 0 Then
|
||||
If DtVentasNC IsNot Nothing Then
|
||||
For Each row As DataRow In DtVentasNC.Rows
|
||||
If Not row("CveVenta").ToString().ToEntero() = -1 Then
|
||||
@@ -11287,6 +11295,7 @@ Partial Class Ventas
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
'SI ES REFACTURACION DEBE AGREGAR LA VENTA ANTERIOR COMO RELACIONADA TAMBIEN
|
||||
If Not CveVenta = -1 Then
|
||||
If Not ObjVentas.AddVentasRelacionadas(ObjVentas.CveVenta, CveVenta) Then
|
||||
ErrorList.Add("Ocurrió un error al relacionar las ventas entre si comuníquese a Soporte Técnico")
|
||||
@@ -11298,6 +11307,14 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
'SI TIENE UN ANTICIPO TAMBIEN DEBE RELACIONARLO
|
||||
If CveAnticipoPadre > 0 Then
|
||||
If Not ObjVentas.AddVentasRelacionadas(ObjVentas.CveVenta, CveAnticipoPadre) Then
|
||||
ErrorList.Add("Ocurrió un error al relacionar las ventas entre si comuníquese a Soporte Técnico")
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -18142,7 +18159,7 @@ Partial Class Ventas
|
||||
|
||||
End Sub
|
||||
Private Sub SetPermisos()
|
||||
If CveVenta < 1 Then
|
||||
If CveVenta < 1 OrElse EsCreaApartirDe Then
|
||||
'Puede cotizar
|
||||
If Not UsuarioActual.TienePermisoProceso(59) Then
|
||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Cot"))
|
||||
@@ -18933,13 +18950,6 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not OcurrioError AndAlso ConSalida Then
|
||||
'Esquema viejo, evitamos que aparezca por surtir
|
||||
If Not ObjInventario.ActualizarEsDevolucionVenta(ObjFactura.CveVenta, 2) Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
@@ -19108,6 +19118,23 @@ Partial Class Ventas
|
||||
'COMIENZA: VENTADETALLE
|
||||
'CUANDO SEA SALIDA VA POR LA VENTA DETALLE DE LA FACTURA DE LA REMISION - OJO!! SOLO FUNCIONA HASTA ORITA QUE SE HACE SALIDA SOLO CUANDO SE FACTURA LA REMISION
|
||||
Dim CveVentaDetalle = If(ConceptoEntrada.Contiene(3, 40), TmpDT.FiltroPrimeroValor("CveVentaDetalle", $"Consec={Consec}").ToEntero(), MovDet("CveVentaDetalle").ToString().ToEntero())
|
||||
Dim CveVentaDetallePadre As Integer = -1
|
||||
|
||||
'If ConceptoEntrada = 3 Then
|
||||
' CveVentaDetalle = TmpDT.FiltroPrimeroValor("CveVentaDetalle", $"Consec={Consec}").ToEntero()
|
||||
'ElseIf ConceptoEntrada = 40 Then
|
||||
' CveVentaDetalle = MovDet("CveVentaDetalle").ToString().ToEntero()
|
||||
' CveVentaDetallePadre = TmpDT.FiltroPrimeroValor("CveVentaDetalle", $"Consec={Consec}").ToEntero()
|
||||
' 'CUANDO LA VENTADETALLE NO TENGA VALOR DEBE MARCAR ERROR, NUEVA RESTRICCION DE ALMACEN
|
||||
' If CveVentaDetallePadre < 0 Then
|
||||
' Alert("no se encontro la venta detalle nueva. Por favor comuniquese con atención SIG.", TipoMensaje.ToastError)
|
||||
' OcurrioError = True
|
||||
' Exit For
|
||||
' End If
|
||||
'Else
|
||||
' CveVentaDetalle = MovDet("CveVentaDetalle").ToString().ToEntero()
|
||||
'End If
|
||||
|
||||
'CUANDO LA VENTADETALLE NO TENGA VALOR DEBE MARCAR ERROR, NUEVA RESTRICCION DE ALMACEN
|
||||
If CveVentaDetalle < 0 Then
|
||||
Alert("no se encontro la venta detalle. Por favor comuniquese con atención SIG.", TipoMensaje.ToastError)
|
||||
@@ -19128,7 +19155,7 @@ Partial Class Ventas
|
||||
CveMovimientoDetalleEntrada = MovDet("CveMovimientoDetalle").ToString().ToEntero()
|
||||
End If
|
||||
|
||||
If ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, PU, -1, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, CveVentaDetalle:=CveVentaDetalle, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada) Then
|
||||
If ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, PU, -1, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, CveVentaDetalle:=CveVentaDetalle, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada, CveVentaDetallePadre:=CveVentaDetallePadre) Then
|
||||
ContadorMovtosDetalles += 1
|
||||
Else
|
||||
OcurrioError = True
|
||||
@@ -23101,7 +23128,7 @@ Partial Class Ventas
|
||||
RequiereAlmacenDestino = True
|
||||
DdlAlmacenAsignado.Items.Clear()
|
||||
DdlAlmacenAsignado.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
|
||||
DdlAlmacenAsignado.SelectedValue = "-1"
|
||||
DdlAlmacenAsignado.SelectedValueExist("-1")
|
||||
DdlAlmacenAsignado.DataBind()
|
||||
DdlAlmacenAsignado.Items.Insert(0, New ListItem("Almacen", DbRowVenta("CveAlmacenTraspasoOrigen").ToString()))
|
||||
DdlAlmacenAsignado.SelectedValueExist(DbRowVenta("CveAlmacenTraspasoOrigen").ToString())
|
||||
@@ -29831,6 +29858,8 @@ Partial Class Ventas
|
||||
GvPS.Columns(17).Visible = True
|
||||
GvPS.Columns(18).Visible = True
|
||||
|
||||
SetPermisos()
|
||||
|
||||
CambiaTipoDocto()
|
||||
CambiaSucursalGeneral(RecargarPartidas:=False)
|
||||
CargaAnticipos(CveCliente)
|
||||
|
||||
Reference in New Issue
Block a user