This commit is contained in:
Oscar Irigoyen
2022-10-03 06:46:53 -07:00
8 changed files with 252 additions and 177 deletions

View File

@@ -5603,7 +5603,7 @@ Public Class ClsVentas
End Function End Function
Public Function GetLineasAdicionalesSaldo(CveLineaAdicional As Integer, CveCliente As Integer, CveProveedor As Integer, CveMoneda As Integer, CveEmpresa As Integer, Optional ConSaldo As Integer = -1) As Boolean Public Function GetLineasAdicionalesSaldo(CveLineaAdicional As Integer, CveCliente As Integer, CveProveedor As Integer, CveMoneda As Integer, CveEmpresa As Integer, Optional ConSaldo As Integer = -1, Optional FechaVencimientoConsulta As DateTime = MaxFecha) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_LineasAdicionalesSaldoGet") DataAdapter("PA_Vta_LineasAdicionalesSaldoGet")
@@ -5615,6 +5615,7 @@ Public Class ClsVentas
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@ConSaldo", SqlDbType.Int).Value = ConSaldo .Add("@ConSaldo", SqlDbType.Int).Value = ConSaldo
.Add("@FechaVencimientoConsulta", SqlDbType.Date).Value = FechaVencimientoConsulta
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)

View File

@@ -25,10 +25,18 @@
<DataField>CodigoPS</DataField> <DataField>CodigoPS</DataField>
<rd:TypeName>System.String</rd:TypeName> <rd:TypeName>System.String</rd:TypeName>
</Field> </Field>
<Field Name="Inicial">
<DataField>Inicial</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="E_Almacen"> <Field Name="E_Almacen">
<DataField>E_Almacen</DataField> <DataField>E_Almacen</DataField>
<rd:TypeName>System.String</rd:TypeName> <rd:TypeName>System.String</rd:TypeName>
</Field> </Field>
<Field Name="E_Pub">
<DataField>E_Pub</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="E_Traspaso"> <Field Name="E_Traspaso">
<DataField>E_Traspaso</DataField> <DataField>E_Traspaso</DataField>
<rd:TypeName>System.String</rd:TypeName> <rd:TypeName>System.String</rd:TypeName>
@@ -37,6 +45,10 @@
<DataField>E_Compra</DataField> <DataField>E_Compra</DataField>
<rd:TypeName>System.String</rd:TypeName> <rd:TypeName>System.String</rd:TypeName>
</Field> </Field>
<Field Name="E_Otros">
<DataField>E_Otros</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="S_Almacen"> <Field Name="S_Almacen">
<DataField>S_Almacen</DataField> <DataField>S_Almacen</DataField>
<rd:TypeName>System.String</rd:TypeName> <rd:TypeName>System.String</rd:TypeName>
@@ -537,17 +549,18 @@
</TablixCell> </TablixCell>
<TablixCell> <TablixCell>
<CellContents> <CellContents>
<Textbox Name="TipoAgrupador"> <Textbox Name="Inicial">
<CanGrow>true</CanGrow> <CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether> <KeepTogether>true</KeepTogether>
<Paragraphs> <Paragraphs>
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>0</Value> <Value>=Fields!Inicial.Value</Value>
<Style> <Style>
<FontSize>7pt</FontSize> <FontSize>7pt</FontSize>
<FontWeight>=IIF(Fields!CvePSCargo.Value &gt; 0, "Default","Bold")</FontWeight> <FontWeight>=IIF(Fields!CvePSCargo.Value &gt; 0, "Default","Bold")</FontWeight>
<Format>#,0;(#,0)</Format>
</Style> </Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
@@ -556,7 +569,7 @@
</Style> </Style>
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>TipoAgrupador</rd:DefaultName> <rd:DefaultName>Inicial</rd:DefaultName>
<Style> <Style>
<Border> <Border>
<Color>=IIF(Fields!CvePSCargo.Value &gt; 0, "White","Silver")</Color> <Color>=IIF(Fields!CvePSCargo.Value &gt; 0, "White","Silver")</Color>
@@ -610,18 +623,18 @@
</TablixCell> </TablixCell>
<TablixCell> <TablixCell>
<CellContents> <CellContents>
<Textbox Name="Paqueteria1"> <Textbox Name="E_Pub">
<CanGrow>true</CanGrow> <CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether> <KeepTogether>true</KeepTogether>
<Paragraphs> <Paragraphs>
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>0</Value> <Value>=Fields!E_Pub.Value</Value>
<Style> <Style>
<FontSize>7pt</FontSize> <FontSize>7pt</FontSize>
<FontWeight>=IIF(Fields!CvePSCargo.Value &gt; 0, "Default","Bold")</FontWeight> <FontWeight>=IIF(Fields!CvePSCargo.Value &gt; 0, "Default","Bold")</FontWeight>
<Format>d</Format> <Format>#,0;(#,0)</Format>
</Style> </Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
@@ -630,7 +643,7 @@
</Style> </Style>
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Paqueteria1</rd:DefaultName> <rd:DefaultName>E_Pub</rd:DefaultName>
<Style> <Style>
<Border> <Border>
<Color>=IIF(Fields!CvePSCargo.Value &gt; 0, "White","Silver")</Color> <Color>=IIF(Fields!CvePSCargo.Value &gt; 0, "White","Silver")</Color>
@@ -721,18 +734,18 @@
</TablixCell> </TablixCell>
<TablixCell> <TablixCell>
<CellContents> <CellContents>
<Textbox Name="Fecha"> <Textbox Name="E_Otros">
<CanGrow>true</CanGrow> <CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether> <KeepTogether>true</KeepTogether>
<Paragraphs> <Paragraphs>
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>0</Value> <Value>=Fields!E_Otros.Value</Value>
<Style> <Style>
<FontSize>7pt</FontSize> <FontSize>7pt</FontSize>
<FontWeight>=IIF(Fields!CvePSCargo.Value &gt; 0, "Default","Bold")</FontWeight> <FontWeight>=IIF(Fields!CvePSCargo.Value &gt; 0, "Default","Bold")</FontWeight>
<Format>d</Format> <Format>#,0;(#,0)</Format>
</Style> </Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
@@ -741,7 +754,7 @@
</Style> </Style>
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Fecha</rd:DefaultName> <rd:DefaultName>E_Otros</rd:DefaultName>
<Style> <Style>
<Border> <Border>
<Color>=IIF(Fields!CvePSCargo.Value &gt; 0, "White","Silver")</Color> <Color>=IIF(Fields!CvePSCargo.Value &gt; 0, "White","Silver")</Color>

View File

@@ -2959,7 +2959,7 @@
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label for="<%= TxtFechaAjuste.ClientID.ToString()%>">Fecha Vigencia:</label> <label for="<%= TxtFechaVigencia.ClientID.ToString()%>">Fecha Vigencia:</label>
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100% !important; padding: 0px;"> <div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100% !important; padding: 0px;">
<asp:TextBox ID="TxtFechaVigencia" CssClass="form-control input-sm ADSMaskDate" Width="100%" runat="server"></asp:TextBox> <asp:TextBox ID="TxtFechaVigencia" CssClass="form-control input-sm ADSMaskDate" Width="100%" runat="server"></asp:TextBox>
<span class="input-group-btn "> <span class="input-group-btn ">
@@ -3174,6 +3174,7 @@
</span> </span>
<ajax:MaskedEditExtender ID="MEEFechaAjuste" runat="server" TargetControlID="TxtFechaAjuste" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender> <ajax:MaskedEditExtender ID="MEEFechaAjuste" runat="server" TargetControlID="TxtFechaAjuste" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEEFechaAjuste" TargetControlID="TxtFechaAjuste" PopupButtonID="LnkFechaAjuste" PopupPosition="BottomLeft" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender> <ajax:CalendarExtender runat="server" ID="CEEFechaAjuste" TargetControlID="TxtFechaAjuste" PopupButtonID="LnkFechaAjuste" PopupPosition="BottomLeft" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
<asp:CompareValidator ID="CVFechaAJuste" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpAddVenta"></asp:CompareValidator>
<asp:RequiredFieldValidator ID="RFVFechaAjuste" runat="server" ControlToValidate="TxtFechaAjuste" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RFVFechaAjuste" runat="server" ControlToValidate="TxtFechaAjuste" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEFechaAjuste" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaAjuste"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCEFechaAjuste" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaAjuste"></ajax:ValidatorCalloutExtender>
</div> </div>

View File

@@ -7130,12 +7130,22 @@ Partial Class PV
'End Sub 'End Sub
Private Function CalculaMesesUso() As Boolean Private Function CalculaMesesUso() As Boolean
Dim FechaI As Date = TxtFechaAjuste.Text.ToDate.AddDays(1) Dim FechaI As Date = Now
If IsDate(TxtFechaAjuste.Text) Then
FechaI = TxtFechaAjuste.Text.ToDate.AddDays(1)
Else
TxtMesesUso.Text = ""
Alert("La fecha de ajuste no tiene el formato correcto", TipoMensaje.MsgAdvertencia)
Return False
End If
Dim FechaF As Date = Now Dim FechaF As Date = Now
If FechaI.AddDays(-1) > FechaF Then If FechaI.AddDays(-1) > FechaF Then
TxtMesesUso.Text = ""
TxtFechaAjuste.Text = FechaF.ToString("dd/MM/yyyy") TxtFechaAjuste.Text = FechaF.ToString("dd/MM/yyyy")
Alert("La fecha de ajuste debe ser menor a la fecha actual", TipoMensaje.ToastAdventencia) Alert("La fecha de ajuste debe ser menor a la fecha actual", TipoMensaje.MsgAdvertencia)
Return False Return False
End If End If

View File

@@ -59,7 +59,7 @@
<tr align="left"> <tr align="left">
<td class="text-right"><b>Folio:</b></td> <td class="text-right"><b>Folio:</b></td>
<td> <td>
<asp:TextBox ID="TxtFolio" runat="server" MaxLength="12" Width="230px" Height="30px" autofocus></asp:TextBox> <asp:TextBox ID="TxtFolio" runat="server" MaxLength="12" Width="230px" Height="30px"></asp:TextBox>
</td> </td>
<td class="text-right"><b>Folio Fiscal (UUID):</b></td> <td class="text-right"><b>Folio Fiscal (UUID):</b></td>
<td> <td>

View File

@@ -26,6 +26,8 @@ Partial Class PopUpBuscarFolio
CargaClasificaciones() CargaClasificaciones()
CargaPS(-1) CargaPS(-1)
'CargaCodigoCliente() 'CargaCodigoCliente()
RegistraScript($"$('#{TxtFolio.ClientID}').focus();", "A1")
End If End If
End Sub End Sub

View File

@@ -713,6 +713,15 @@
</asp:UpdatePanel> </asp:UpdatePanel>
</td> </td>
</tr> </tr>
<tr id="TrLineaAdicional" runat="server" visible="false">
<td align="left"><b>Linea Adicional:</b></td>
<td align="left">
<asp:DropDownList ID="DdlLineaAdicional" DataTextField="InfoGeneral" DataValueField="CveLineaAdicional" AutoPostBack="true" CssClass=" form-control input-sm select2me" runat="server" Width="80%" OnSelectedIndexChanged="DdlLineaAdicional_SelectedIndexChanged">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:LinkButton runat="server" Visible="false" ID="LnkUpdateLineaAdicional" OnClick="LnkUpdateLineaAdicional_Click" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea actualizar la linea adicional de crédito de la factura?" data-btn-ok-label="si" Text="<i class='fa fa-check' style='color:green'></i>" CssClass="btn btn-default btn-circle btn-xs" ToolTip="Actualizar Linea adicional" />
</td>
</tr>
<tr align="left" id="TrAlmacenOrigen" runat="server" visible="False"> <tr align="left" id="TrAlmacenOrigen" runat="server" visible="False">
<td> <td>
<asp:Label runat="server" ToolTip="Almacen Asignado" Font-Bold="true" Text="Almacen O:"></asp:Label> <asp:Label runat="server" ToolTip="Almacen Asignado" Font-Bold="true" Text="Almacen O:"></asp:Label>
@@ -2406,7 +2415,8 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div> </div>
</div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="portlet light xspadding bordered whitoutcol" style="width: 100%;"> <div class="portlet light xspadding bordered whitoutcol" style="width: 100%;">
@@ -2417,12 +2427,12 @@
</div> </div>
<div class="actions"> <div class="actions">
<div class="btn-group"> <div class="btn-group">
</div> </div>
</div> </div>
<div class="tools"> <div class="tools">
Emitir <asp:CheckBox ID="ChkEmitirComercioExterior" runat="server" CssClass="chksino" Text=" " OnCheckedChanged="ChkEmitirComercioExterior_CheckedChanged" AutoPostBack="true" /> Emitir
<asp:CheckBox ID="ChkEmitirComercioExterior" runat="server" CssClass="chksino" Text=" " OnCheckedChanged="ChkEmitirComercioExterior_CheckedChanged" AutoPostBack="true" />
<a href="javascript:;" onclick="CargaComercioExterior()" class="expand"></a> <a href="javascript:;" onclick="CargaComercioExterior()" class="expand"></a>
</div> </div>
</div> </div>
@@ -2431,8 +2441,8 @@
<ContentTemplate> <ContentTemplate>
<div class="form-body"> <div class="form-body">
<%-- <div class="row rowpadding"> <%-- <div class="row rowpadding">
<label class="col-md-2">Emitir:</label> <label class="col-md-2">Emitir:</label>
<div class="col-md-10"> <div class="col-md-10">
@@ -3443,17 +3453,7 @@
</div> </div>
<div class="portlet-body formnombottom"> <div class="portlet-body formnombottom">
<table border="0" width="100%"> <table border="0" width="100%">
<tr id="TrLineaAdicional" runat="server" visible="false">
<td align="left">Linea Adicional:</td>
<td align="left">
<asp:DropDownList ID="DdlLineaAdicional" DataTextField="InfoGeneral" DataValueField="CveLineaAdicional" AutoPostBack="true" CssClass=" form-control input-sm select2me" runat="server" Width="200px" OnSelectedIndexChanged="DdlLineaAdicional_SelectedIndexChanged">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td align="left">
<asp:LinkButton runat="server" Visible="false" ID="LnkUpdateLineaAdicional" OnClick="LnkUpdateLineaAdicional_Click" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea actualizar la linea adicional de crédito de la factura?" data-btn-ok-label="si" Text="<i class='fa fa-check' style='color:green'></i>" CssClass="btn btn-default btn-circle btn-xs" ToolTip="Actualizar Linea adicional" />
</td>
</tr>
<tr id="TrFormaEntrega" runat="server" visible="false"> <tr id="TrFormaEntrega" runat="server" visible="false">
<td align="left">Forma de entrega:</td> <td align="left">Forma de entrega:</td>
<td align="left"> <td align="left">
@@ -7825,7 +7825,7 @@
</div> </div>
</div> </div>
<div class="tools"> <div class="tools">
<%-- <a href="javascript:;" class="collapse"></a>--%> <%-- <a href="javascript:;" class="collapse"></a>--%>
</div> </div>
</div> </div>
<div class="portlet-body form-horizontal form-row-sepe formnombottom"> <div class="portlet-body form-horizontal form-row-sepe formnombottom">

View File

@@ -2249,12 +2249,12 @@ Partial Class Ventas
End Set End Set
End Property End Property
Private Property CveClasificacionLineaAdicional As Integer Private Property CveCategoriaLineaAdicional As Integer
Get Get
Return IfNull(ViewState("CveClasificacionLineaAdicional"), "-1", ViewState("CveClasificacionLineaAdicional")).ToString().ToEntero() Return IfNull(ViewState("CveCategoriaLineaAdicional"), "-1", ViewState("CveCategoriaLineaAdicional")).ToString().ToEntero()
End Get End Get
Set(value As Integer) Set(value As Integer)
ViewState("CveClasificacionLineaAdicional") = value ViewState("CveCategoriaLineaAdicional") = value
End Set End Set
End Property End Property
@@ -3173,6 +3173,7 @@ Partial Class Ventas
'TabE.Visible = False 'TabE.Visible = False
LnkOCs.Visible = False LnkOCs.Visible = False
GvPS.Columns(8).Visible = False GvPS.Columns(8).Visible = False
DdlSubProyecto.Visible = False
TrEdit.Visible = True TrEdit.Visible = True
ThProyecto.Visible = False ThProyecto.Visible = False
@@ -3194,6 +3195,7 @@ Partial Class Ventas
TabE.Visible = False TabE.Visible = False
LnkOCs.Visible = False LnkOCs.Visible = False
GvPS.Columns(8).Visible = False GvPS.Columns(8).Visible = False
DdlSubProyecto.Visible = False
TrEdit.Visible = False TrEdit.Visible = False
ThProyecto.Visible = False ThProyecto.Visible = False
@@ -8844,16 +8846,32 @@ Partial Class Ventas
'VALIDAR LINEAS ADICIONALES 'VALIDAR LINEAS ADICIONALES
If UsuarioActual.Empresa.Funcionalidad(705) = "1" AndAlso DdlLineaAdicional.SelectedValue.ToEntero() > 0 Then If UsuarioActual.Empresa.Funcionalidad(705) = "1" AndAlso DdlLineaAdicional.SelectedValue.ToEntero() > 0 Then
'VERIFICA QUE LA CLASIFICACION DE LOS PRODUCTOS DEBE SER LA MISMA DE LA LINEA ADICIONAL 'VERIFICA QUE LA CATEGORIA DE LOS PRODUCTOS DEBE SER LA MISMA DE LA LINEA ADICIONAL
If TmpDT IsNot Nothing AndAlso Me.CveClasificacionLineaAdicional > 0 Then If TmpDT IsNot Nothing AndAlso Me.CveCategoriaLineaAdicional > 0 Then
For Each Row As DataRow In TmpDT.FiltraParametros("", DistinctColumns:={"CveClasificacion", "Clasificacion"}).Rows For Each Row As DataRow In TmpDT.FiltraParametros("", DistinctColumns:={"CveClasificacion"}).Rows
If Me.CveClasificacionLineaAdicional <> Row("CveClasificacion").ToString().ToEntero() Then Dim RowClasificacion = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=Row("CveClasificacion").ToString().ToEntero()).FiltroPrimero("")
Alert($"La clasificación '{Row("Clasificacion")}' no pertenece a la linea adicional.", TipoMensaje.MsgAdvertencia)
If RowClasificacion IsNot Nothing Then
Dim CveCategoria As Integer = RowClasificacion("CveCategoria").ToString().ToEntero()
Dim Categoria As String = RowClasificacion("Categoria").ToString()
If Me.CveCategoriaLineaAdicional <> CveCategoria Then
Alert($"La categoría '{Categoria}' no pertenece a la linea adicional.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Else
Alert($"No se encontro la clasificación.", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If End If
Next Next
End If End If
'SI NO ES A CREDITO NO SELECCIONAR LINEA ADICIONAL
If RBLPago.SelectedValue <> "1" Then
Alert($"La linea adicional debe ser utilizada en una venta a crédito.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If Me.SaldoLineaAdicional <= 0 Then If Me.SaldoLineaAdicional <= 0 Then
Alert("El saldo de la linea adicional debe ser mayor a cero", TipoMensaje.MsgAdvertencia) Alert("El saldo de la linea adicional debe ser mayor a cero", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
@@ -12906,7 +12924,7 @@ Partial Class Ventas
ErrorList.Add("Ocurrió un error al actualizar el estatus del pedidoA") ErrorList.Add("Ocurrió un error al actualizar el estatus del pedidoA")
Else Else
'Remision 'Remision
If Not ObjEventos.AddEventoBitacora($"Remisionado de autorización en: <a href='/Ventas/Ventas.aspx?CveVenta={ObjFactura.CveVenta}' target='_blank' class='Texto'>{ObjFactura.Folio}</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CvePedidoA) Then If Not ObjEventos.AddEventoBitacora($"Remisionado de autorización en: <a href='/Ventas/Ventas.aspx?CveVenta={ObjFactura.CveVenta}' target='_blank' class='Texto'>{ObjFactura.SerieFolio}</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CvePedidoA) Then
ErrorList.Add("Ocurrió un error al agregar bitácora de Autorización") ErrorList.Add("Ocurrió un error al agregar bitácora de Autorización")
End If End If
End If End If
@@ -14682,13 +14700,22 @@ Partial Class Ventas
ErrorPrepoliza = True ErrorPrepoliza = True
End If End If
'Factura If CveRemision > 0 Then
If Not ObjEventos.AddEventoBitacora($"Remisión facturada : <a href='/Ventas/Ventas.aspx?CveVenta={CveRemision}' target='_blank' class='Texto'>{ObjFactura.Folio}</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=ObjFactura.CveVenta) Then If ObjVentas.GetVenta(CveRemision, UsuarioActual.CveEmpresa, VerificaAlmacen:=False) Then
Dim SerieFolioRem As String = ObjVentas.DtResultados.Rows(0)("SerieFolio").ToString()
'Factura
If Not ObjEventos.AddEventoBitacora($"Venta facturada de Remisión: <a href='/Ventas/Ventas.aspx?CveVenta={CveRemision}' target='_blank' class='Texto'>{SerieFolioRem}</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=ObjFactura.CveVenta) Then
ErrorPrepoliza = True
End If
Else
ErrorPrepoliza = True
End If
Else
ErrorPrepoliza = True ErrorPrepoliza = True
End If End If
'Remision 'Remision
If Not ObjEventos.AddEventoBitacora($"Facturación de remisión en: <a href='/Ventas/Ventas.aspx?CveVenta={ObjFactura.CveVenta}' target='_blank' class='Texto'>{ObjFactura.Folio}</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveRemision) Then If Not ObjEventos.AddEventoBitacora($"Remisión facturada en Venta: <a href='/Ventas/Ventas.aspx?CveVenta={ObjFactura.CveVenta}' target='_blank' class='Texto'>{ObjFactura.SerieFolio}</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveRemision) Then
ErrorPrepoliza = True ErrorPrepoliza = True
End If End If
Next Next
@@ -18067,14 +18094,14 @@ Partial Class Ventas
Using ObjVentas As New ClsVentas Using ObjVentas As New ClsVentas
If CveVenta > 0 Then If CveVenta > 0 Then
If ObjVentas.GetLineasAdicionalesSaldo(-1, CveCliente, -1, DdlMoneda.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa, ConSaldo:=-1) Then If ObjVentas.GetLineasAdicionalesSaldo(-1, CveCliente, -1, DdlMoneda.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa, ConSaldo:=-1, FechaVencimientoConsulta:=MinFecha) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then If ObjVentas.DtResultados.Rows.Count > 0 Then
TrLineaAdicional.Visible = True TrLineaAdicional.Visible = True
DdlLineaAdicional.DataSource = ObjVentas.DtResultados.FiltraParametros($"Saldo > 0 OR CveLineaAdicional = {Me.CveLineaAdicionalVenta}") DdlLineaAdicional.DataSource = ObjVentas.DtResultados.FiltraParametros($"(Saldo > 0 AND FechaVencimiento <= '{Now.ToString("dd/MM/yyyy")}') OR CveLineaAdicional = {Me.CveLineaAdicionalVenta}")
End If End If
End If End If
Else Else
If ObjVentas.GetLineasAdicionalesSaldo(-1, CveCliente, -1, DdlMoneda.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa, ConSaldo:=1) Then If ObjVentas.GetLineasAdicionalesSaldo(-1, CveCliente, -1, DdlMoneda.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa, ConSaldo:=1, FechaVencimientoConsulta:=Now) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then If ObjVentas.DtResultados.Rows.Count > 0 Then
TrLineaAdicional.Visible = True TrLineaAdicional.Visible = True
DdlLineaAdicional.DataSource = ObjVentas.DtResultados DdlLineaAdicional.DataSource = ObjVentas.DtResultados
@@ -18095,6 +18122,7 @@ Partial Class Ventas
End If End If
UpParametros.Update()
UPCondicionesPago.Update() UPCondicionesPago.Update()
End Sub End Sub
@@ -26969,93 +26997,94 @@ Partial Class Ventas
End Sub End Sub
Private Sub CargaRNC(Optional CveVentaUsado As Integer = -1, Optional CargarBonificaciones As Boolean = False, Optional CargarSoloGarantias As Boolean = False) Private Sub CargaRNC(Optional CveVentaUsado As Integer = -1, Optional CargarBonificaciones As Boolean = False, Optional CargarSoloGarantias As Boolean = False)
Dim DtNC As DataTable = Nothing Dim DtNC As DataTable = Nothing
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
Dim ObjMovtos As New ClsMovimientos() Dim ObjMovtos As New ClsMovimientos()
If ObjMovtos.GetAnticiposNCIxCCliente(CveCliente, CveMoneda:=-1) Then If ObjMovtos.GetAnticiposNCIxCCliente(CveCliente, CveMoneda:=-1) Then
DtNC = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'RNC' AND CveVenta > 0 and Saldo > 0", "Moneda,Fecha,Folio") DtNC = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'RNC' AND CveVenta > 0 and Saldo > 0", "Moneda,Fecha,Folio")
End If
ObjMovtos.Dispose()
Me.TmpDTRNCBonificacionesSeleccionadas = Nothing
If DtNC IsNot Nothing Then
Me.TmpDTRNCBonificacionesCliente = DtNC.FiltraParametros("TipoRNC = 2")
Me.TmpDTRNCBonificacionesCliente.Columns.Add("ImporteBonificacion", GetType(Decimal))
Me.TmpDTRNCBonificacionesCliente.Columns.Add("IVABonificacion", GetType(Decimal))
Me.TmpDTRNCBonificacionesCliente.Columns.Add("CveVentaRNCCargo", GetType(Integer))
If CargarBonificaciones Then
'Me.TmpDTRNCBonificacionesSeleccionadas = Me.TmpDTRNCBonificacionesCliente.Copy()
CargaBonificaciones(-1, True)
End If End If
ObjMovtos.Dispose()
If CargarSoloGarantias Then Me.TmpDTRNCBonificacionesSeleccionadas = Nothing
GvRemisionesNC.DataSource = DtNC.FiltraParametros("TipoRNC = 1 AND EsGarantia = True")
Else
GvRemisionesNC.DataSource = DtNC.FiltraParametros("TipoRNC = 1 AND EsGarantia = False")
End If
GvRemisionesNC.DataBind()
'GvRemisionesNCBon.DataSource = Me.TmpDTRNCBonificacionesSeleccionadas If DtNC IsNot Nothing Then
'GvRemisionesNCBon.DataBind() Me.TmpDTRNCBonificacionesCliente = DtNC.FiltraParametros("TipoRNC = 2")
Dim SaldoMaximoUtilizable As Decimal = 0 Me.TmpDTRNCBonificacionesCliente.Columns.Add("ImporteBonificacion", GetType(Decimal))
Me.TmpDTRNCBonificacionesCliente.Columns.Add("IVABonificacion", GetType(Decimal))
Me.TmpDTRNCBonificacionesCliente.Columns.Add("CveVentaRNCCargo", GetType(Integer))
If CargarSoloGarantias Then If CargarBonificaciones Then
Dim SaldoMaximo As Decimal = DtNC.SUMD("Saldo", "TipoRNC = 1 AND EsGarantia = True") 'Me.TmpDTRNCBonificacionesSeleccionadas = Me.TmpDTRNCBonificacionesCliente.Copy()
If SaldoMaximo > 0 Then CargaBonificaciones(-1, True)
SaldoMaximoUtilizable = SaldoMaximo
Else
SaldoMaximoUtilizable = 0
End If End If
Else
Dim ObjAcum As New ClsAcumuladores
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2)
DivSMU.Visible = True
Dim SaldoMaximo As Decimal = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal() If CargarSoloGarantias Then
GvRemisionesNC.DataSource = DtNC.FiltraParametros("TipoRNC = 1 AND EsGarantia = True")
Else
GvRemisionesNC.DataSource = DtNC.FiltraParametros("TipoRNC = 1 AND EsGarantia = False")
End If
GvRemisionesNC.DataBind()
'GvRemisionesNCBon.DataSource = Me.TmpDTRNCBonificacionesSeleccionadas
'GvRemisionesNCBon.DataBind()
Dim SaldoMaximoUtilizable As Decimal = 0
If CargarSoloGarantias Then
Dim SaldoMaximo As Decimal = DtNC.SUMD("Saldo", "TipoRNC = 1 AND EsGarantia = True")
If SaldoMaximo > 0 Then If SaldoMaximo > 0 Then
SaldoMaximoUtilizable = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal() SaldoMaximoUtilizable = SaldoMaximo
Else Else
SaldoMaximoUtilizable = 0 SaldoMaximoUtilizable = 0
End If End If
Else Else
SaldoMaximoUtilizable = 0 Dim ObjAcum As New ClsAcumuladores
End If If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
ObjAcum.Dispose() Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2)
End If DivSMU.Visible = True
If CveVentaUsado > 0 Then Dim SaldoMaximo As Decimal = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
DivSMU.Visible = True If SaldoMaximo > 0 Then
'Dim FacUsado As New Modelos.Factura(UsuarioActual, CveVentaUsado, UsuarioActual.CveEmpresa, CargaDatosCliente:=False, CargaDatosRelacionados:=False) SaldoMaximoUtilizable = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
Dim DtDetalleUsado As DataTable = Nothing Else
Using ObjVentas As New ClsVentas SaldoMaximoUtilizable = 0
If ObjVentas.GetVentaDetalle(CveVentaUsado) Then End If
DtDetalleUsado = ObjVentas.DtResultados.Copy()
Else
SaldoMaximoUtilizable = 0
End If End If
End Using ObjAcum.Dispose()
End If
If DtDetalleUsado IsNot Nothing Then If CveVentaUsado > 0 Then
Dim SaldoMaximoUsadosFactura As Decimal = DtDetalleUsado.SUM("Total", "EsCargo = True").ToDecimal() + DtDetalleUsado.SUM("ImporteIVA", "EsCargo = True").ToDecimal() DivSMU.Visible = True
If SaldoMaximoUtilizable < SaldoMaximoUsadosFactura Then 'Dim FacUsado As New Modelos.Factura(UsuarioActual, CveVentaUsado, UsuarioActual.CveEmpresa, CargaDatosCliente:=False, CargaDatosRelacionados:=False)
Dim DtDetalleUsado As DataTable = Nothing
Using ObjVentas As New ClsVentas
If ObjVentas.GetVentaDetalle(CveVentaUsado) Then
DtDetalleUsado = ObjVentas.DtResultados.Copy()
End If
End Using
If DtDetalleUsado IsNot Nothing Then
Dim SaldoMaximoUsadosFactura As Decimal = DtDetalleUsado.SUM("Total", "EsCargo = True").ToDecimal() + DtDetalleUsado.SUM("ImporteIVA", "EsCargo = True").ToDecimal()
If SaldoMaximoUtilizable < SaldoMaximoUsadosFactura Then
HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString()
LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUtilizable)
Else
HdnSaldoMaximoUsados.Value = SaldoMaximoUsadosFactura.ToString()
LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUsadosFactura)
End If
Else
HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString() HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString()
LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUtilizable) LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUtilizable)
Else
HdnSaldoMaximoUsados.Value = SaldoMaximoUsadosFactura.ToString()
LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUsadosFactura)
End If End If
Else Else
HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString() HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString()
LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUtilizable) LtlSMU.Text = SaldoMaximoUtilizable.FormatoNumero(2)
End If End If
Else Else
HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString() HdnSaldoMaximoUsados.Value = "0"
LtlSMU.Text = SaldoMaximoUtilizable.FormatoNumero(2) LtlSMU.Text = "0"
End If End If
Else
HdnSaldoMaximoUsados.Value = "0"
LtlSMU.Text = "0"
End If End If
UpModalRemisionesNC.Update() UpModalRemisionesNC.Update()
@@ -27064,81 +27093,83 @@ Partial Class Ventas
Private Sub CargaRNCDesc(Optional CargarBonificaciones As Boolean = False, Optional CargarSoloGarantias As Boolean = False) Private Sub CargaRNCDesc(Optional CargarBonificaciones As Boolean = False, Optional CargarSoloGarantias As Boolean = False)
Dim DtNC As DataTable = Nothing Dim DtNC As DataTable = Nothing
Dim ObjMovtos As New ClsMovimientos() If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
If ObjMovtos.GetAnticiposNCIxCCliente(CveCliente, CveMoneda:=-1) Then Dim ObjMovtos As New ClsMovimientos()
DtNC = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'RNC' AND CveVenta > 0 and Saldo > 0", "Moneda,Fecha,Folio") If ObjMovtos.GetAnticiposNCIxCCliente(CveCliente, CveMoneda:=-1) Then
End If DtNC = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'RNC' AND CveVenta > 0 and Saldo > 0", "Moneda,Fecha,Folio")
ObjMovtos.Dispose()
Me.TmpDTRNCBonificacionesSeleccionadas = Nothing
If DtNC IsNot Nothing Then
Me.TmpDTRNCBonificacionesCliente = DtNC.FiltraParametros("TipoRNC = 2")
Me.TmpDTRNCBonificacionesCliente.Columns.Add("ImporteBonificacion", GetType(Decimal))
Me.TmpDTRNCBonificacionesCliente.Columns.Add("IVABonificacion", GetType(Decimal))
Me.TmpDTRNCBonificacionesCliente.Columns.Add("CveVentaRNCCargo", GetType(Integer))
If CargarBonificaciones Then
'Me.TmpDTRNCBonificacionesSeleccionadas = Me.TmpDTRNCBonificacionesCliente.Copy()
CargaBonificacionesDesc("-1", True)
End If End If
ObjMovtos.Dispose()
If CargarSoloGarantias Then Me.TmpDTRNCBonificacionesSeleccionadas = Nothing
GvDescNCCargos.DataSource = DtNC.FiltraParametros("TipoRNC = 1 AND EsGarantia = True")
Else
GvDescNCCargos.DataSource = DtNC.FiltraParametros("TipoRNC = 1 AND EsGarantia = False")
End If
GvDescNCCargos.DataBind()
Dim SaldoMaximoCliente As Decimal = 0 If DtNC IsNot Nothing Then
Dim SaldoEntregado As Decimal = 0 Me.TmpDTRNCBonificacionesCliente = DtNC.FiltraParametros("TipoRNC = 2")
Me.TmpDTRNCBonificacionesCliente.Columns.Add("ImporteBonificacion", GetType(Decimal))
Me.TmpDTRNCBonificacionesCliente.Columns.Add("IVABonificacion", GetType(Decimal))
Me.TmpDTRNCBonificacionesCliente.Columns.Add("CveVentaRNCCargo", GetType(Integer))
If CargarSoloGarantias Then If CargarBonificaciones Then
Dim SaldoMaximo As Decimal = DtNC.SUMD("Saldo", "TipoRNC = 1 AND EsGarantia = True") 'Me.TmpDTRNCBonificacionesSeleccionadas = Me.TmpDTRNCBonificacionesCliente.Copy()
If SaldoMaximo > 0 Then CargaBonificacionesDesc("-1", True)
SaldoMaximoCliente = SaldoMaximo
Else
SaldoMaximoCliente = 0
End If End If
Else
Dim ObjAcum As New ClsAcumuladores
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2)
DivSMU.Visible = True
Dim SaldoMaximo As Decimal = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal() If CargarSoloGarantias Then
GvDescNCCargos.DataSource = DtNC.FiltraParametros("TipoRNC = 1 AND EsGarantia = True")
Else
GvDescNCCargos.DataSource = DtNC.FiltraParametros("TipoRNC = 1 AND EsGarantia = False")
End If
GvDescNCCargos.DataBind()
Dim SaldoMaximoCliente As Decimal = 0
Dim SaldoEntregado As Decimal = 0
If CargarSoloGarantias Then
Dim SaldoMaximo As Decimal = DtNC.SUMD("Saldo", "TipoRNC = 1 AND EsGarantia = True")
If SaldoMaximo > 0 Then If SaldoMaximo > 0 Then
SaldoMaximoCliente = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal() SaldoMaximoCliente = SaldoMaximo
Else Else
SaldoMaximoCliente = 0 SaldoMaximoCliente = 0
End If End If
Dim RowEntregado As DataRow = ObjAcum.DtResultados.Rows(1)
SaldoEntregado = RowEntregado("ValorConImpuestos").ToString().ToDecimal()
Else Else
SaldoMaximoCliente = 0 Dim ObjAcum As New ClsAcumuladores
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2)
DivSMU.Visible = True
Dim SaldoMaximo As Decimal = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
If SaldoMaximo > 0 Then
SaldoMaximoCliente = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
Else
SaldoMaximoCliente = 0
End If
Dim RowEntregado As DataRow = ObjAcum.DtResultados.Rows(1)
SaldoEntregado = RowEntregado("ValorConImpuestos").ToString().ToDecimal()
Else
SaldoMaximoCliente = 0
End If
ObjAcum.Dispose()
End If End If
ObjAcum.Dispose()
End If
Dim SaldoMaximoUsadosFactura As Decimal = Me.TmpDT.SUM("Total", "EsCargo = True").ToDecimal() + Me.TmpDT.SUM("ImporteIVA", "EsCargo = True").ToDecimal() Dim SaldoMaximoUsadosFactura As Decimal = Me.TmpDT.SUM("Total", "EsCargo = True").ToDecimal() + Me.TmpDT.SUM("ImporteIVA", "EsCargo = True").ToDecimal()
If SaldoMaximoCliente > 0 AndAlso SaldoMaximoCliente < SaldoMaximoUsadosFactura Then If SaldoMaximoCliente > 0 AndAlso SaldoMaximoCliente < SaldoMaximoUsadosFactura Then
SaldoMaximoUsadosFactura = SaldoMaximoCliente SaldoMaximoUsadosFactura = SaldoMaximoCliente
End If End If
Dim SaldoMaximoUtilizable = If(SaldoMaximoUsadosFactura < SaldoEntregado, SaldoMaximoUsadosFactura, SaldoEntregado) Dim SaldoMaximoUtilizable = If(SaldoMaximoUsadosFactura < SaldoEntregado, SaldoMaximoUsadosFactura, SaldoEntregado)
If SaldoMaximoUtilizable > 0 Then
HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString()
LblSaldoMaximoUsados.Text = String.Format("{0:N2}", SaldoMaximoUtilizable)
Else
HdnSaldoMaximoUsados.Value = "0"
LblSaldoMaximoUsados.Text = String.Format("{0:N2}", 0)
End If
If SaldoMaximoUtilizable > 0 Then
HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString()
LblSaldoMaximoUsados.Text = String.Format("{0:N2}", SaldoMaximoUtilizable)
Else Else
HdnSaldoMaximoUsados.Value = "0" HdnSaldoMaximoUsados.Value = "0"
LblSaldoMaximoUsados.Text = String.Format("{0:N2}", 0) LblSaldoMaximoUsados.Text = "0"
End If End If
Else
HdnSaldoMaximoUsados.Value = "0"
LblSaldoMaximoUsados.Text = "0"
End If End If
UpDescNC.Update() UpDescNC.Update()
@@ -35289,35 +35320,52 @@ Partial Class Ventas
RBLPago.Enabled = False RBLPago.Enabled = False
Using ObjVentas As New ClsVentas Using ObjVentas As New ClsVentas
If ObjVentas.GetLineasAdicionalesSaldo(DdlLineaAdicional.SelectedValue.ToEntero(), CveCliente, -1, DdlMoneda.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa) Then If ObjVentas.GetLineasAdicionalesSaldo(DdlLineaAdicional.SelectedValue.ToEntero(), CveCliente, -1, DdlMoneda.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa, FechaVencimientoConsulta:=MinFecha) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then If ObjVentas.DtResultados.Rows.Count > 0 Then
TxtFechaPago.Text = ObjVentas.DtResultados.Rows(0)("FechaVencimiento").ToString().ToDateTime().ToString("dd/MM/yyyy") TxtFechaPago.Text = ObjVentas.DtResultados.Rows(0)("FechaVencimiento").ToString().ToDateTime().ToString("dd/MM/yyyy")
Me.SaldoLineaAdicional = ObjVentas.DtResultados.Rows(0)("Saldo").ToString().ToDecimal() Me.SaldoLineaAdicional = ObjVentas.DtResultados.Rows(0)("Saldo").ToString().ToDecimal()
Me.CveClasificacionLineaAdicional = ObjVentas.DtResultados.Rows(0)("CveClasificacionPS").ToString().ToEntero() Me.CveCategoriaLineaAdicional = ObjVentas.DtResultados.Rows(0)("CveCategoria").ToString().ToEntero()
Me.CveMonedaLineaAdicional = ObjVentas.DtResultados.Rows(0)("CveMoneda").ToString().ToEntero() Me.CveMonedaLineaAdicional = ObjVentas.DtResultados.Rows(0)("CveMoneda").ToString().ToEntero()
End If End If
End If End If
End Using End Using
Else Else
Me.SaldoLineaAdicional = 0 Me.SaldoLineaAdicional = 0
Me.CveClasificacionLineaAdicional = 0 Me.CveCategoriaLineaAdicional = 0
End If End If
UpParametros.Update()
UPCondicionesPago.Update() UPCondicionesPago.Update()
End Sub End Sub
Protected Sub LnkUpdateLineaAdicional_Click(sender As Object, e As EventArgs) Protected Sub LnkUpdateLineaAdicional_Click(sender As Object, e As EventArgs)
'VALIDAR LINEAS ADICIONALES 'VALIDAR LINEAS ADICIONALES
If UsuarioActual.Empresa.Funcionalidad(705) = "1" AndAlso DdlLineaAdicional.SelectedValue.ToEntero() > 0 Then If UsuarioActual.Empresa.Funcionalidad(705) = "1" AndAlso DdlLineaAdicional.SelectedValue.ToEntero() > 0 Then
'VERIFICA QUE LA CLASIFICACION DE LOS PRODUCTOS DEBE SER LA MISMA DE LA LINEA ADICIONAL 'VERIFICA QUE LA CATEGORIA DE LOS PRODUCTOS DEBE SER LA MISMA DE LA LINEA ADICIONAL
If TmpDT IsNot Nothing AndAlso Me.CveClasificacionLineaAdicional > 0 Then If TmpDT IsNot Nothing AndAlso Me.CveCategoriaLineaAdicional > 0 Then
For Each Row As DataRow In TmpDT.FiltraParametros("", DistinctColumns:={"CveClasificacion", "Clasificacion"}).Rows For Each Row As DataRow In TmpDT.FiltraParametros("", DistinctColumns:={"CveClasificacion"}).Rows
If Me.CveClasificacionLineaAdicional <> Row("CveClasificacion").ToString().ToEntero() Then Dim RowClasificacion = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=Row("CveClasificacion").ToString().ToEntero()).FiltroPrimero("")
Alert($"La clasificación '{Row("Clasificacion")}' no pertenece a la linea adicional.", TipoMensaje.MsgAdvertencia)
If RowClasificacion IsNot Nothing Then
Dim CveCategoria As Integer = RowClasificacion("CveCategoria").ToString().ToEntero()
Dim Categoria As String = RowClasificacion("Categoria").ToString()
If Me.CveCategoriaLineaAdicional <> CveCategoria Then
Alert($"La categoría '{Categoria}' no pertenece a la linea adicional.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Else
Alert($"No se encontro la clasificación.", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If End If
Next Next
End If End If
'SI NO ES A CREDITO NO SELECCIONAR LINEA ADICIONAL
If RBLPago.SelectedValue <> "1" Then
Alert($"La linea adicional debe ser utilizada en una venta a crédito.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If Me.SaldoLineaAdicional <= 0 Then If Me.SaldoLineaAdicional <= 0 Then
Alert("El saldo de la linea adicional debe ser mayor a cero", TipoMensaje.MsgAdvertencia) Alert("El saldo de la linea adicional debe ser mayor a cero", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub