This commit is contained in:
2023-03-27 08:38:44 -07:00
21 changed files with 2401 additions and 2083 deletions

View File

@@ -3141,9 +3141,9 @@
</div>
<div class="row">
<div class="col-md-8">
<div id="DivCodEnsamble" runat="server" class="form-group form-md-line-input input-iconright">
<div runat="server" class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCodEnsamble" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<asp:CustomValidator ID="CVCodEnsamble" runat="server" ControlToValidate="TxtCodEnsamble" ValidateEmptyText="true" Display="None" ClientValidationFunction="ValidarCodigoEnsamble" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Ensamble''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" />
<asp:CustomValidator ID="CVCodEnsamble" runat="server" ControlToValidate="TxtCodEnsamble" ClientValidationFunction="ValidarCodigoEnsamble" ValidateEmptyText="true" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Ensamble''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" />
<label for="<%= TxtCodEnsamble.ClientID.ToString()%>">Cod.Ensamble:</label>
</div>
</div>
@@ -3162,7 +3162,7 @@
<div class="col-md-8">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCodLinea" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<asp:CustomValidator ID="CVCodLinea" runat="server" ControlToValidate="TxtCodLinea" ClientValidationFunction="ValidarCodigoLinea" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Linea''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" />
<asp:CustomValidator ID="CVCodLinea" runat="server" ControlToValidate="TxtCodLinea" ClientValidationFunction="ValidarCodigoLinea" ValidateEmptyText="true" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Linea''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" />
<label for="<%= TxtCodLinea.ClientID.ToString()%>">Cod.Linea:</label>
</div>
</div>
@@ -3185,7 +3185,7 @@
<div class="col-md-8">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCodInspeccion" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<asp:CustomValidator ID="CVCodInspeccion" runat="server" ControlToValidate="TxtCodInspeccion" ClientValidationFunction="ValidarCodigoInspeccion" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Inspección''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" />
<asp:CustomValidator ID="CVCodInspeccion" runat="server" ControlToValidate="TxtCodInspeccion" ClientValidationFunction="ValidarCodigoInspeccion" ValidateEmptyText="true" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Inspección''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" />
<%-- <asp:RegularExpressionValidator ID="REVCodInspeccion" runat="server" ControlToValidate="TxtCodInspeccion" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod. Inspección''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" ValidationExpression="^[A-L][0-9][1-9A-Z][A-HJ-M]$"></asp:RegularExpressionValidator>--%>
<%--<asp:RequiredFieldValidator ID="RFVCodInspeccion" runat="server" ControlToValidate="TxtCodInspeccion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod. Inspeccion''</b> es necesario, por favor ingréselo." ValidationGroup="VGMAjuste"></asp:RequiredFieldValidator>--%>
<%--<ajax:ValidatorCalloutExtender ID="VCECodInspeccion" runat="server" HighlightCssClass="vco" TargetControlID="RFVCodInspeccion"></ajax:ValidatorCalloutExtender>--%>

View File

@@ -287,17 +287,17 @@ Partial Class RepVentaDetalle
DdlGrupo.DataBind()
End Sub
Private Sub CargaCombos()
Private Sub CargaCombos()
CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:=DivProyecto)
CargaClientes()
'DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
txtFechaI.Text = Now.FirstDayOfMonth.ToShortDateString
txtFechaF.Text = Now.LastDayOfMonth.ToShortDateString
'Vendedor
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
CargaClientes()
'DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
txtFechaI.Text = Now.FirstDayOfMonth.ToShortDateString
txtFechaF.Text = Now.LastDayOfMonth.ToShortDateString
'Vendedor
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa, VendedorTipo:=-1).FiltraParametros("VendedorTipo in (1,4)") 'vendedores y vendedores de piso
DdlVendedor.DataBind()
DdlVendedor.Items.Insert(0, New ListItem("Sin Vendedor", "-2"))
@@ -312,7 +312,7 @@ Partial Class RepVentaDetalle
'Carga Clasificacion Cliente
DdlClienteClasificacion.DataSource = GlobalDTClienteClasificaciones(UsuarioActual.CveEmpresa)
DdlClienteClasificacion.DataBind()
DdlClienteClasificacion.Items.Insert(0, New ListItem("Todos", "-1"))
DdlClienteClasificacion.Items.Insert(0, New ListItem("Todos", "-1"))
DdlClienteClasificacion.Items.Insert(0, New ListItem("Sin Giro", "-2"))
@@ -342,7 +342,7 @@ Partial Class RepVentaDetalle
End Sub
Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyecto.SelectedIndexChanged
CargarSubProyecto(DdlSubProyecto, DdlProyecto.SelectedValue)
CargarSubProyecto(DdlSubProyecto, DdlProyecto.SelectedValue)
End Sub
Protected Sub DdlClienteClasificacion_SelectedIndexChanged(sender As Object, e As EventArgs)

View File

@@ -592,6 +592,7 @@
<asp:UpdatePanel ID="UpParametros" runat="server" UpdateMode="Conditional" class="portlet light xspadding .nolineheight bordered whitoutcol" style="width: 310px;">
<ContentTemplate>
<asp:HiddenField ID="HdnCargarInventario" runat="server" ClientIDMode="Static" Value="True" />
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
@@ -698,7 +699,7 @@
<td>
<asp:UpdatePanel ID="UPPVentas" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:DropDownList ID="DdlVendedor" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" Width="200px">
<asp:DropDownList ID="DdlVendedor" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" Width="100%">
<asp:ListItem Selected="true" Text="Sin asignar" Value="0"></asp:ListItem>
</asp:DropDownList>
</ContentTemplate>
@@ -728,7 +729,7 @@
<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:DropDownList ID="DdlLineaAdicional" DataTextField="InfoGeneral" DataValueField="CveLineaAdicional" AutoPostBack="true" CssClass=" form-control input-sm select2me" runat="server" Width="100%" 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" />
@@ -1719,7 +1720,6 @@
<asp:UpdatePanel ID="UpINV" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:HiddenField ID="HdnCargarInventario" runat="server" ClientIDMode="Static" Value="True"/>
<asp:Button ID="BtnCargarInventario" runat="server" ClientIDMode="Static" Text="" Style="display: none;" OnClick="BtnCargarInventario_Click" />
<div class="portlet box purpleAlmacen" id="DivSalidaAlmacen" runat="server">
<div class="portlet-title">
@@ -9497,10 +9497,12 @@
step: 30
});
if(HdnCargarInventario.value == 'True'){
if(HdnCargarInventario.value == 'True'){
$("#TabAlmacen_tab .ajax__tab_inner").click(function () {
CargaMovimientosInventario();
});
}else {
$("#TabAlmacen_tab .ajax__tab_inner").unbind();
}
}

View File

@@ -2401,6 +2401,7 @@ Partial Class Ventas
ViewState("ClienteRetISR") = 0
ViewState("CvePrecioLista") = 0
ViewState("CvePrecioListaCliente") = 0
HdnCargarInventario.Value = "True"
Me.CveVendedorVenta = -1
Me.CveVendedorCliente = -1
Me.CveVendedorClienteSucursal = -1
@@ -2851,8 +2852,7 @@ Partial Class Ventas
'REMOVER EVENTO PARA RECARGAR ALMACEN
HdnCargarInventario.Value = "False"
'spanAlmacen.Attributes.Remove("onclick")
Tab.ActiveTabIndex = 1
Updatetabs.Update()
UpParametros.Update()
End If
'Modalidad Devoluciones y Refacturacion
@@ -9461,22 +9461,106 @@ Partial Class Ventas
End If
If UsuarioActual.Empresa.Funcionalidad(705) = "1" AndAlso DdlLineaAdicional.SelectedValue.ToEntero() > 0 Then
'VERIFICA QUE LA MONEDA DE LA LINEA ADICIONAL SEA LA MISMA QUE LA VENTA
If Me.CveMonedaLineaAdicional <> ObjFactura.CveMoneda Then
TmpDT = TmpDTError.Copy()
CalculaTotalesVenta(RecalcularTotalOriginal:=False)
Alert("La moneda de la linea adicional de crédito debe ser la misma que la factura.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
'VERIFICA QUE EL SALDO DISPONIBLE SEA MENOR AL IMPORTE
If ObjFactura.TipoDocto = "Rem" AndAlso Me.SaldoLineaAdicional < ObjFactura.Total Then
TmpDT = TmpDTError.Copy()
CalculaTotalesVenta(RecalcularTotalOriginal:=False)
Alert("El saldo de la linea adicional debe ser mayor o igual al de la remisión", TipoMensaje.MsgAdvertencia)
Exit Sub
If ObjFactura.TipoDocto = "Ing" Then
If Me.CveMonedaLineaAdicional <> ObjFactura.CveMoneda Then
'SI LA LINEA ESTA EN PESOS Y LA FACTURA ESTA EN DOLARES
If Me.CveMonedaLineaAdicional = 1 AndAlso ObjFactura.CveMoneda = 2 Then
Dim SaldoUSD As Decimal = SaldoIngresosLineaAdicional / TxtTipoCambio.Text.ToDecimal()
If SaldoUSD < ObjFactura.Total Then
TmpDT = TmpDTError.Copy()
CalculaTotalesVenta(RecalcularTotalOriginal:=False)
Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
'SI LA LINEA ESTA EN DOLARES Y LA FACTURA ESTA EN PESOS
If Me.CveMonedaLineaAdicional = 2 AndAlso ObjFactura.CveMoneda = 1 Then
Dim SaldoMXN As Decimal = SaldoIngresosLineaAdicional * TxtTipoCambio.Text.ToDecimal()
If SaldoMXN < ObjFactura.Total Then
TmpDT = TmpDTError.Copy()
CalculaTotalesVenta(RecalcularTotalOriginal:=False)
Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
Else
'SI LA LINEA Y LA FACTURA TIENEN LA MISMA MONEDA
If Me.SaldoIngresosLineaAdicional < ObjFactura.Total Then
TmpDT = TmpDTError.Copy()
CalculaTotalesVenta(RecalcularTotalOriginal:=False)
Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
End If
If ObjFactura.TipoDocto = "Rem" Then
If Me.CveMonedaLineaAdicional <> ObjFactura.CveMoneda Then
'SI LA LINEA ESTA EN PESOS Y LA FACTURA ESTA EN DOLARES
If Me.CveMonedaLineaAdicional = 1 AndAlso ObjFactura.CveMoneda = 2 Then
Dim SaldoUSD As Decimal = SaldoLineaAdicional / TxtTipoCambio.Text.ToDecimal()
If SaldoUSD < ObjFactura.Total Then
TmpDT = TmpDTError.Copy()
CalculaTotalesVenta(RecalcularTotalOriginal:=False)
Alert("El saldo de la linea adicional debe ser mayor o igual al de la remisión", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
'SI LA LINEA ESTA EN DOLARES Y LA FACTURA ESTA EN PESOS
If Me.CveMonedaLineaAdicional = 2 AndAlso ObjFactura.CveMoneda = 1 Then
Dim SaldoMXN As Decimal = SaldoLineaAdicional * TxtTipoCambio.Text.ToDecimal()
If SaldoMXN < ObjFactura.Total Then
TmpDT = TmpDTError.Copy()
CalculaTotalesVenta(RecalcularTotalOriginal:=False)
Alert("El saldo de la linea adicional debe ser mayor o igual al de la remisión", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
Else
'SI LA LINEA Y LA FACTURA TIENEN LA MISMA MONEDA
If Me.SaldoLineaAdicional < ObjFactura.Total Then
TmpDT = TmpDTError.Copy()
CalculaTotalesVenta(RecalcularTotalOriginal:=False)
Alert("El saldo de la linea adicional debe ser mayor o igual al de la remisión", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
End If
'VERIFICA QUE LA MONEDA DE LA LINEA ADICIONAL SEA LA MISMA QUE LA VENTA
'If Me.CveMonedaLineaAdicional <> ObjFactura.CveMoneda Then
' TmpDT = TmpDTError.Copy()
' CalculaTotalesVenta(RecalcularTotalOriginal:=False)
' Alert("La moneda de la linea adicional de crédito debe ser la misma que la factura.", TipoMensaje.MsgAdvertencia)
' Exit Sub
'Else
' If ObjFactura.TipoDocto = "Ing" AndAlso Me.SaldoIngresosLineaAdicional < ObjFactura.Total Then
' TmpDT = TmpDTError.Copy()
' CalculaTotalesVenta(RecalcularTotalOriginal:=False)
' Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
' Exit Sub
' End If
'End If
'VERIFICA QUE EL SALDO DISPONIBLE SEA MENOR AL IMPORTE
'If ObjFactura.TipoDocto = "Rem" AndAlso Me.SaldoLineaAdicional < ObjFactura.Total Then
' TmpDT = TmpDTError.Copy()
' CalculaTotalesVenta(RecalcularTotalOriginal:=False)
' Alert("El saldo de la linea adicional debe ser mayor o igual al de la remisión", TipoMensaje.MsgAdvertencia)
' Exit Sub
'End If
If ObjFactura.TipoDocto = "Ing" AndAlso (DtRemisionesPS Is Nothing OrElse DtRemisionesPS.Rows.Count = 0) Then
TmpDT = TmpDTError.Copy()
CalculaTotalesVenta(RecalcularTotalOriginal:=False)
@@ -9484,12 +9568,6 @@ Partial Class Ventas
Exit Sub
End If
If ObjFactura.TipoDocto = "Ing" AndAlso Me.SaldoIngresosLineaAdicional < ObjFactura.Total Then
TmpDT = TmpDTError.Copy()
CalculaTotalesVenta(RecalcularTotalOriginal:=False)
Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
'If Not CveEmpresaCRM > 0 Then
@@ -14198,14 +14276,26 @@ Partial Class Ventas
End If
ElseIf AplicoNCFacturaActual AndAlso ChkAplicaNCAnticipo.Checked Then
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, Importe251, Referencia, 251, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=ObjFactura.CveCliente, ImporteMX:=ImporteMN251, ImporteME:=If(Dr("TCCambioValuacion").ToString().ToDecimal = 1, 0, Importe251), CveSubProyecto:=CveSubProyectoContabilizar, CveVentaAmortizacion:=ObjFactura.CveVenta, TipoCambio:=Dr("TCCambioValuacion").ToString().ToDecimal, TipoCambioPago:=tipoCambio) Then
Dim CveConceptoPagoNC As Integer = 251
If ObjFactura.CveMoneda > 1 Then
CveConceptoPagoNC = 301
End If
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, Importe251, Referencia, CveConceptoPagoNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=ObjFactura.CveCliente, ImporteMX:=ImporteMN251, ImporteME:=If(Dr("TCCambioValuacion").ToString().ToDecimal = 1, 0, Importe251), CveSubProyecto:=CveSubProyectoContabilizar, CveVentaAmortizacion:=ObjFactura.CveVenta, TipoCambio:=Dr("TCCambioValuacion").ToString().ToDecimal, TipoCambioPago:=tipoCambio) Then
ErrorPrepoliza = True
Exit For
End If
End If
Else
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, Importe251, Referencia, 251, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=ObjFactura.CveCliente, ImporteMX:=ImporteMN251, ImporteME:=If(Dr("TCCambioValuacion").ToString().ToDecimal = 1, 0, Importe251), CveSubProyecto:=CveSubProyectoContabilizar, CveVentaAmortizacion:=ObjFactura.CveVenta, TipoCambio:=Dr("TCCambioValuacion").ToString().ToDecimal, TipoCambioPago:=tipoCambio) Then
Dim CveConceptoPagoNC As Integer = 251
If ObjFactura.CveMoneda > 1 Then
CveConceptoPagoNC = 301
End If
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, Importe251, Referencia, CveConceptoPagoNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=ObjFactura.CveCliente, ImporteMX:=ImporteMN251, ImporteME:=If(Dr("TCCambioValuacion").ToString().ToDecimal = 1, 0, Importe251), CveSubProyecto:=CveSubProyectoContabilizar, CveVentaAmortizacion:=ObjFactura.CveVenta, TipoCambio:=Dr("TCCambioValuacion").ToString().ToDecimal, TipoCambioPago:=tipoCambio) Then
ErrorPrepoliza = True
Exit For
End If
@@ -14317,7 +14407,12 @@ Partial Class Ventas
End If
End If
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, importeMovimientoDev, Referencia, 251, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVentaDevolucion, CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=ObjFactura.CveVenta, ImporteMX:=importeMXDev, ImporteME:=If(tipoCambio = 1, 0, importeMovimientoDev), CveSubProyecto:=CveSubProyectoContabilizar) Then
Dim CveConceptoPagoNC As Integer = 251
If ObjFactura.CveMoneda > 1 Then
CveConceptoPagoNC = 301
End If
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, importeMovimientoDev, Referencia, CveConceptoPagoNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVentaDevolucion, CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=ObjFactura.CveVenta, ImporteMX:=importeMXDev, ImporteME:=If(tipoCambio = 1, 0, importeMovimientoDev), CveSubProyecto:=CveSubProyectoContabilizar) Then
ErrorPrepoliza = True
Exit For
End If
@@ -14526,7 +14621,12 @@ Partial Class Ventas
If importeMovimiento <> 0 Then
If ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, importeMovimiento, Referencia, 251, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=row2.DataKey("CveVentaNC").ToString().ToEntero(), CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=ObjFactura.CveVenta, ImporteMX:=importeMovimiento * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=Contabilizable) Then
Dim CveConceptoPagoNC As Integer = 251
If ObjFactura.CveMoneda > 1 Then
CveConceptoPagoNC = 301
End If
If ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, importeMovimiento, Referencia, CveConceptoPagoNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=row2.DataKey("CveVentaNC").ToString().ToEntero(), CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=ObjFactura.CveVenta, ImporteMX:=importeMovimiento * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=Contabilizable) Then
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, importeMovimiento, Referencia, 91, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=row2.DataKey("CveVentaNC").ToString().ToEntero(), ImporteMX:=importeMovimiento * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=Contabilizable) Then
ErrorPrepoliza = True
Exit For
@@ -14647,7 +14747,13 @@ Partial Class Ventas
If sumaAmorticaciones <> 0 Then
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, sumaAmorticaciones, Referencia, 251, Concepto, FechaMovimiento, IdCtaContClientes, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=sumaAmorticaciones * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=Contabilizable) Then
Dim CveConceptoPagoNC As Integer = 251
If ObjFactura.CveMoneda > 1 Then
CveConceptoPagoNC = 301
End If
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, sumaAmorticaciones, Referencia, CveConceptoPagoNC, Concepto, FechaMovimiento, IdCtaContClientes, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=sumaAmorticaciones * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=Contabilizable) Then
ErrorPrepoliza = True
Else
ViewState("SeGuardoPrePoliza") = True
@@ -18806,10 +18912,12 @@ Partial Class Ventas
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "PA") AndAlso UsuarioActual.Empresa.Funcionalidad(705) = "1" Then
DdlLineaAdicional.DataSource = Nothing
Dim TCConsulta As Decimal = TxtTipoCambio.Text.ToDecimal()
Using ObjVentas As New ClsVentas
'SI ES VENTA EXISTENTE , SI SE VA EDITAR SOLO MOSTRAR LAS CON SALDO, FECHA DE VENCIMIENTO VIGENTE O LA LINEA ACTUAL
If CveVenta > 0 Then
If ObjVentas.GetLineasAdicionalesSaldo(-1, CveCliente, -1, -1, UsuarioActual.CveEmpresa, ConSaldo:=-1, FechaVencimientoConsulta:=MinFecha) Then
If ObjVentas.GetLineasAdicionalesSaldo(-1, CveCliente, -1, -1, UsuarioActual.CveEmpresa, TipoCambioConsulta:=TCConsulta, ConSaldo:=-1, FechaVencimientoConsulta:=MinFecha) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then
TrLineaAdicional.Visible = True
DdlLineaAdicional.DataSource = ObjVentas.DtResultados.FiltraParametros($"(Saldo > 0 AND FechaVencimiento <= '{Now.ToString("dd/MM/yyyy")}') OR CveLineaAdicional = {Me.CveLineaAdicionalVenta}")
@@ -18818,14 +18926,14 @@ Partial Class Ventas
Else
'SI SE ESTA FACTURANDO UNA REMISION DEBE SELECCIONAR LA LINEA ADICIONAL DE ESTA
If Me.CveLineaAdicionalVenta > 0 Then
If ObjVentas.GetLineasAdicionalesSaldo(Me.CveLineaAdicionalVenta, CveCliente, -1, -1, UsuarioActual.CveEmpresa, ConSaldo:=-1, FechaVencimientoConsulta:=MinFecha) Then
If ObjVentas.GetLineasAdicionalesSaldo(Me.CveLineaAdicionalVenta, CveCliente, -1, -1, UsuarioActual.CveEmpresa, TipoCambioConsulta:=TCConsulta, ConSaldo:=-1, FechaVencimientoConsulta:=MinFecha) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then
TrLineaAdicional.Visible = True
DdlLineaAdicional.DataSource = ObjVentas.DtResultados
End If
End If
Else
If ObjVentas.GetLineasAdicionalesSaldo(-1, CveCliente, -1, -1, UsuarioActual.CveEmpresa, ConSaldo:=1, FechaVencimientoConsulta:=Now) Then
If ObjVentas.GetLineasAdicionalesSaldo(-1, CveCliente, -1, -1, UsuarioActual.CveEmpresa, TipoCambioConsulta:=TCConsulta, ConSaldo:=1, FechaVencimientoConsulta:=Now) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then
TrLineaAdicional.Visible = True
DdlLineaAdicional.DataSource = ObjVentas.DtResultados
@@ -24775,15 +24883,30 @@ Partial Class Ventas
If SaldoVenta <> 0 Then
If UsuarioActual.TienePermisoProceso(269) AndAlso Not DevolucionAlmacen = 2 Then
If UsuarioActual.TienePermisoProceso(269) Then
DivDevAlm.Visible = True
TieneAlmacen = True
End If
If UsuarioActual.Empresa.Funcionalidad(567) = "1" Then
DivDevAlm.Visible = True
TieneAlmacen = True
If UsuarioActual.Empresa.Funcionalidad(567) = "1" Then
ChkDevAlm.Checked = True
ChkDevAlm.Enabled = False
End If
ChkDevAlm.Checked = True
ChkDevAlm.Enabled = False
End If
If (CveVenta > 0 AndAlso DdlTipoComprobante.SelectedValue <> "Cot") AndAlso Not AplicaDevolucion Then
Using ObjInv As New ClsInventarios
If ObjInv.GetInv_Mov(Me.CveVenta, UsuarioActual.CveEmpresa) AndAlso ObjInv.DtResultados.Rows.Count > 0 Then
Dim RowInv As DataRow = ObjInv.DtResultados.FiltroPrimero("CveConcepto IN (3,40)")
If RowInv IsNot Nothing Then
CveAlmacenDevolucion = RowInv("CveAlmacen").ToString().ToEntero()
End If
End If
End Using
End If
End If
End If
@@ -32910,9 +33033,9 @@ Partial Class Ventas
'REMOVER EVENTO PARA RECARGAR ALMACEN
'spanAlmacen.Attributes.Remove("onclick")
Tab.ActiveTabIndex = 1
HdnCargarInventario.Value = "False"
Updatetabs.Update()
UpParametros.Update()
UpnTools.Update()
@@ -36441,8 +36564,10 @@ Partial Class Ventas
RBLPago.SelectedValue = "1"
RBLPago.Enabled = False
Dim TCConsulta As Decimal = TxtTipoCambio.Text.ToDecimal()
Using ObjVentas As New ClsVentas
If ObjVentas.GetLineasAdicionalesSaldo(DdlLineaAdicional.SelectedValue.ToEntero(), CveCliente, -1, -1, UsuarioActual.CveEmpresa, FechaVencimientoConsulta:=MinFecha) Then
If ObjVentas.GetLineasAdicionalesSaldo(DdlLineaAdicional.SelectedValue.ToEntero(), CveCliente, -1, -1, UsuarioActual.CveEmpresa, TipoCambioConsulta:=TCConsulta, FechaVencimientoConsulta:=MinFecha) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then
Dim RowLinea As DataRow = ObjVentas.DtResultados.Rows(0)
If RowLinea IsNot Nothing Then
@@ -36552,16 +36677,36 @@ Partial Class Ventas
Exit Sub
End If
'VERIFICA QUE EL SALDO DISPONIBLE SEA MENOR AL IMPORTE
If Me.SaldoLineaAdicional < TxtTotal.Text.ToDecimal() Then
Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim TotalDocumento As Decimal = TxtTotal.Text.ToDecimal()
'VERIFICA QUE LA MONEDA DE LA LINEA ADICIONAL SEA LA MISMA QUE LA VENTA
'VERIFICA QUE EL SALDO DISPONIBLE SEA MENOR AL IMPORTE
If Me.CveMonedaLineaAdicional <> DdlMoneda.SelectedValue.ToEntero() Then
Alert("La moneda de la linea adicional de crédito debe ser la misma que la factura.", TipoMensaje.MsgAdvertencia)
Exit Sub
'SI LA LINEA ESTA EN PESOS Y LA FACTURA ESTA EN DOLARES
If Me.CveMonedaLineaAdicional = 1 AndAlso DdlMoneda.SelectedValue.ToEntero() = 2 Then
Dim SaldoUSD As Decimal = SaldoLineaAdicional / TxtTipoCambio.Text.ToDecimal()
If SaldoUSD < TotalDocumento Then
Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
'SI LA LINEA ESTA EN DOLARES Y LA FACTURA ESTA EN PESOS
If Me.CveMonedaLineaAdicional = 2 AndAlso DdlMoneda.SelectedValue.ToEntero() = 1 Then
Dim SaldoMXN As Decimal = SaldoLineaAdicional * TxtTipoCambio.Text.ToDecimal()
If SaldoMXN < TotalDocumento Then
Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
Else
'SI LA LINEA Y LA FACTURA TIENEN LA MISMA MONEDA
If Me.SaldoLineaAdicional < TotalDocumento Then
Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
End If
@@ -36601,7 +36746,7 @@ Partial Class Ventas
'Tab.ActiveTabIndex = 1
HdnCargarInventario.Value = "False"
'Updatetabs.Update()
UpINV.Update()
UpParametros.Update()
End Sub
Protected Sub LBAplicaDevolucion_Click(sender As Object, e As EventArgs)