Merge branch 'master' of http://jperez@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -2866,44 +2866,37 @@ Partial Class ProductosyServicios
|
||||
End Function
|
||||
|
||||
Private Function GuardarProductosEquivalenteEnFranquicia(ObjPS As ClsProductosServicios, Agregar As Boolean) As Boolean
|
||||
Dim EmpresasFranquicia = ObtenerFranquiciasInt()
|
||||
For Each Franquicia As Integer In EmpresasFranquicia
|
||||
Dim CvePSPagina As Integer = GlobalDTPS(Franquicia).FiltroPrimeroValor("CvePS", String.Format("Codigo = '{0}'", TxtCodigo.Text.Trim)).ToEntero
|
||||
Dim CvePSAdicional As Integer = GlobalDTPS(Franquicia).FiltroPrimeroValor("CvePS", String.Format("PS = '{0}'", DdlPSAdicional.SelectedItem.Text)).ToEntero
|
||||
If UsuarioActual.Empresa.Funcionalidad(563) <> "" Then
|
||||
|
||||
If CvePSPagina <= 0 Then
|
||||
Alert(String.Format("El producto de la página no existe en la franquicia: '{0}'", GlobalDTEmpresas(Franquicia).FiltroPrimeroValor("Empresa")), TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
Dim StrEmpresas As String = UsuarioActual.Empresa.Funcionalidad(563)
|
||||
Dim EmpresasFranquicia As List(Of Integer) = StrEmpresas.Split(","c).ToList().ConvertAll(Function(x) Convert.ToInt32(x))
|
||||
For Each Franquicia As Integer In EmpresasFranquicia
|
||||
Dim CvePSPagina As Integer = GlobalDTPS(Franquicia).FiltroPrimeroValor("CvePS", String.Format("Codigo = '{0}'", TxtCodigo.Text.Trim)).ToEntero
|
||||
Dim CvePSAdicional As Integer = GlobalDTPS(Franquicia).FiltroPrimeroValor("CvePS", String.Format("PS = '{0}'", DdlPSAdicional.SelectedItem.Text)).ToEntero
|
||||
|
||||
If CvePSPagina <= 0 Then
|
||||
Alert(String.Format("El producto adicional no existe en la franquicia: '{0}'", GlobalDTEmpresas(Franquicia).FiltroPrimeroValor("Empresa")), TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
If Agregar Then
|
||||
If Not ObjPS.AddPSAdicionales(CvePSPagina, CvePSAdicional, If(TxtCantidadPSAdicional.Visible, TxtCantidadPSAdicional.Text.ToDecimal, 0)) Then
|
||||
Return True
|
||||
If CvePSPagina <= 0 Then
|
||||
Alert(String.Format("El producto de la página no existe en la franquicia: '{0}'", GlobalDTEmpresas(Franquicia).FiltroPrimeroValor("Empresa")), TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
Else
|
||||
Dim PSAnterior As String = GlobalDTPS(Franquicia).FiltroPrimeroValor("PS", String.Format("CvePS = '{0}'", CvePSAdicional))
|
||||
Dim CvePSAnterio As Integer = GlobalDTPS(Franquicia).FiltroPrimeroValor("CvePS", String.Format("PS = '{0}'", PSAnterior)).ToEntero
|
||||
|
||||
If Not ObjPS.UpdatePSAdicionales(CvePSPagina, CvePSAdicional, CvePSAnterio, If(TxtCantidadPSAdicional.Visible, TxtCantidadPSAdicional.Text.ToDecimal, 0)) Then
|
||||
Return True
|
||||
If CvePSPagina <= 0 Then
|
||||
Alert(String.Format("El producto adicional no existe en la franquicia: '{0}'", GlobalDTEmpresas(Franquicia).FiltroPrimeroValor("Empresa")), TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
If Agregar Then
|
||||
If Not ObjPS.AddPSAdicionales(CvePSPagina, CvePSAdicional, If(TxtCantidadPSAdicional.Visible, TxtCantidadPSAdicional.Text.ToDecimal, 0)) Then
|
||||
Return True
|
||||
End If
|
||||
Else
|
||||
Dim PSAnterior As String = GlobalDTPS(Franquicia).FiltroPrimeroValor("PS", String.Format("CvePS = '{0}'", CvePSAdicional))
|
||||
Dim CvePSAnterio As Integer = GlobalDTPS(Franquicia).FiltroPrimeroValor("CvePS", String.Format("PS = '{0}'", PSAnterior)).ToEntero
|
||||
|
||||
If Not ObjPS.UpdatePSAdicionales(CvePSPagina, CvePSAdicional, CvePSAnterio, If(TxtCantidadPSAdicional.Visible, TxtCantidadPSAdicional.Text.ToDecimal, 0)) Then
|
||||
Return True
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Private Function ObtenerFranquiciasInt() As Integer()
|
||||
Dim FranquiciasStr As String = UsuarioActual.Empresa.Funcionalidad(137)
|
||||
Dim Franquicias = FranquiciasStr.Split(","c)
|
||||
Dim ReturnFranquicias(Franquicias.Length) As Integer
|
||||
Dim Contador As Integer = 0
|
||||
For Each Franquicia In Franquicias
|
||||
ReturnFranquicias(Contador) = Franquicia.ToEntero
|
||||
Contador += 1
|
||||
Next
|
||||
Return ReturnFranquicias
|
||||
End Function
|
||||
End Class
|
||||
|
||||
@@ -84,6 +84,13 @@
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-1" >Esquema Nuevo:</div>
|
||||
<div class="col-md-2" style="vertical-align:bottom;align-items:initial">
|
||||
<asp:CheckBox runat="server" ID ="ChkEsquemaNuevo" CssClass="md-checksd" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
|
||||
@@ -66,7 +66,7 @@ public partial class Ventas_RepComisionesJAM : ClsPaginas
|
||||
|
||||
GvDatos.Columns[15].Visible = UsuarioActual.TienePermisoProceso(201);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void Consulta()
|
||||
{
|
||||
@@ -108,18 +108,26 @@ public partial class Ventas_RepComisionesJAM : ClsPaginas
|
||||
else if (e.Row.DBCampo("CveVenta").ToEntero() < 1)
|
||||
{
|
||||
e.Row.CssClass = "SubTotales2";
|
||||
//e.Row.Cells[0].Text = e.Row.DBCampo("Vendedor").ToString();
|
||||
//e.Row.Cells[0].Text = e.Row.DBCampo("Vendedor").ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (e.Row.DBCampo("Transaccion").ToString() == "Pago")
|
||||
{
|
||||
if (e.Row.DBCampo("CveCategoria").ToEntero() < 1)
|
||||
{
|
||||
if (UsuarioActual.TienePermisoProceso(201))
|
||||
{
|
||||
e.Row.Cells[21].ToolTip = "No se encuentra dentro de alguna categoria especificada.";
|
||||
e.Row.Cells[22].ToolTip = "No se encuentra dentro de alguna categoria especificada.";
|
||||
else
|
||||
{
|
||||
if (e.Row.DBCampo("Transaccion").ToString() == "Pago")
|
||||
{
|
||||
if (e.Row.DBCampo("CveCategoria").ToEntero() < 1 && e.Row.DBCampo("Comision").ToDouble() == 0)
|
||||
{
|
||||
//if (UsuarioActual.TienePermisoProceso(201))
|
||||
//{
|
||||
// e.Row.Cells[21].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales.";
|
||||
// e.Row.Cells[22].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales.";
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
e.Row.Cells[21].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales.";
|
||||
e.Row.Cells[22].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales.";
|
||||
//}
|
||||
}else if (e.Row.DBCampo("CveCategoria").ToEntero() > 0 )
|
||||
{
|
||||
e.Row.Cells[21].ToolTip = $"El producto obtuvo la comision porque se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria",$"CveCategoria = {e.Row.DBCampo("CveCategoria").ToString()}")}.";
|
||||
e.Row.Cells[22].ToolTip = $"El producto obtuvo la comision porque se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {e.Row.DBCampo("CveCategoria").ToString()}")}.";
|
||||
}else if(e.Row.DBCampo("Comision").ToDouble() > 0)
|
||||
|
||||
@@ -2743,8 +2743,17 @@
|
||||
<ContentTemplate>
|
||||
|
||||
<div id="DivEstimaciones" runat="server" visible="true">
|
||||
Contrato:
|
||||
<asp:DropDownList ID="DdlContrato" runat="server" AppendDataBoundItems="true" Width="350px" AutoPostBack="true" DataTextField="NumeroContrato" DataValueField="CveContrato"></asp:DropDownList>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Contrato:</td>
|
||||
<td><asp:DropDownList ID="DdlContrato" runat="server" AppendDataBoundItems="true" Width="350px" AutoPostBack="true" DataTextField="NumeroContrato" DataValueField="CveContrato" CssClass="select2me" ></asp:DropDownList></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
<asp:HyperLink ID="HLContrato" Target="_blank" CssClass="Texto" runat="server" Text="" Font-Bold="true"></asp:HyperLink>
|
||||
<asp:GridView ID="GvEst" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron Estimaciones para este cliente" Width="100%" DataKeyNames="CveContrato,CveFamilias,CveSubFamilias,CveContratoAvance,Name,Importe,NumeroContrato,CveSubProyecto,FechaInicial" SelectedRowStyle-BackColor="#CCFF66" CssClass="table GvEst table-advance table-hover" Style="text-align: center;" GridLines="None">
|
||||
<Columns>
|
||||
@@ -2781,13 +2790,22 @@
|
||||
|
||||
<div id="ContratoDetalles" class="row" runat="server" visible="false">
|
||||
<div class="col-md-12">
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-1">
|
||||
<asp:Label runat="server" Text="Contrato:"></asp:Label>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<asp:DropDownList runat="server" ID="DdlContratosModal" AutoPostBack="true" CssClass=" form-control input-sm select2me text-left" Width="400px" DataTextField="ContratoCompleto" DataValueField="CveContrato" />
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
|
||||
<div class="col-md-6">
|
||||
<table>
|
||||
<tr>
|
||||
<td><asp:Label runat="server" Text="Contrato:"></asp:Label></td>
|
||||
<td><asp:DropDownList runat="server" ID="DdlContratosModal" AutoPostBack="true" CssClass=" form-control input-sm select2me text-left" Width="400px" DataTextField="ContratoCompleto" DataValueField="CveContrato" /></td>
|
||||
</tr>
|
||||
<tr runat="server" id="DVEstimacionesObra" visible="false">
|
||||
<td> Estimacion:</td>
|
||||
<td> <asp:DropDownList ID="DdlEstimacionesObra" runat="server" AppendDataBoundItems="true" Width="400px" AutoPostBack="true" DataTextField="NumeroEstimacion" DataValueField="CveEstimacion" CssClass="select2me"></asp:DropDownList> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-6 display4 bold" style="font-size: 16px;">
|
||||
Saldo: $<asp:Literal Text="" ID="LtContratoImporteSaldo" runat="server" />
|
||||
</div>
|
||||
@@ -2801,6 +2819,7 @@
|
||||
<asp:ListItem Text="Venta" Value="2" Selected="True" />
|
||||
<asp:ListItem Text="Suministro" Value="1" />
|
||||
<%--<asp:ListItem Text="Consignación" Value="3" Enabled="false" />--%>
|
||||
<asp:ListItem Text="Obra" Value="4" />
|
||||
</asp:RadioButtonList>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
@@ -4295,6 +4314,7 @@
|
||||
<asp:RadioButtonList ID="RblOpcionContrato" runat="server" CssClass="rbl" RepeatDirection="Horizontal" RepeatLayout="Table">
|
||||
<asp:ListItem Text="Si" Value="2"></asp:ListItem>
|
||||
<asp:ListItem Text="No" Value="1"></asp:ListItem>
|
||||
|
||||
</asp:RadioButtonList>
|
||||
|
||||
<asp:LinkButton ID="BtnIniciarContrato" runat="server" CssClass="btn btn-success" Text="Aceptar" />
|
||||
@@ -7910,7 +7930,7 @@
|
||||
$get('HdnTotalVenta').value = FormatoNumero(totalVenta, 2);
|
||||
}
|
||||
|
||||
function chkAnt(t, txt, importe) {
|
||||
function chkAnt(t, txt, importe, AmorContrato = 0) {
|
||||
debugger;
|
||||
var totalAnt = 0;
|
||||
|
||||
@@ -7927,6 +7947,8 @@
|
||||
|
||||
if (SaldoCompra > 0) {
|
||||
|
||||
|
||||
|
||||
//if (SaldoCompra > importe) {
|
||||
// txt.value = importe.toFixed(2);
|
||||
// SaldoCompra = SaldoCompra - importe;
|
||||
@@ -7937,7 +7959,14 @@
|
||||
// //SaldoCompra = 0.00;
|
||||
// $get('HdnVentaSaldo').value = SaldoCompra;
|
||||
//}
|
||||
txt.value = importe.toFixed(2);
|
||||
|
||||
if(AmorContrato > 0){
|
||||
txt.value = AmorContrato.toFixed(2);
|
||||
}else{
|
||||
txt.value = importe.toFixed(2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
totalAnt = FnSumaValoresAnt();
|
||||
|
||||
|
||||
@@ -1314,6 +1314,7 @@ Partial Class Ventas
|
||||
#End Region
|
||||
|
||||
#Region "Propiedades Contratos"
|
||||
|
||||
Private Property DtContratos As DataTable
|
||||
Get
|
||||
Return If(IsNothing(ViewState("DtContratos")), Nothing, CType(ViewState("DtContratos"), DataTable))
|
||||
@@ -1403,6 +1404,59 @@ Partial Class Ventas
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Private Property PorAmortizacionAnticipo As Integer
|
||||
Get
|
||||
|
||||
If ViewState("PorAmortizacionAnticipo") Is Nothing Then
|
||||
Return 0
|
||||
Else
|
||||
Return CType(ViewState("PorAmortizacionAnticipo"), Integer)
|
||||
End If
|
||||
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("PorAmortizacionAnticipo") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
|
||||
Private Property AmortizacionSujeridaContrato As Decimal
|
||||
Get
|
||||
|
||||
If ViewState("AmortizacionSujeridaContrato") Is Nothing Then
|
||||
Return 0
|
||||
Else
|
||||
Return ViewState("AmortizacionSujeridaContrato").ToString.ToDecimal
|
||||
End If
|
||||
|
||||
End Get
|
||||
Set(value As Decimal)
|
||||
ViewState("AmortizacionSujeridaContrato") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property EscontratoObra As Boolean
|
||||
Get
|
||||
If ViewState("EscontratoObra") Is Nothing Then
|
||||
Return False
|
||||
Else
|
||||
Return Boolean.Parse(ViewState("EscontratoObra").ToString)
|
||||
End If
|
||||
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("EscontratoObra") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
#Region " PROPIEDADES NUEVAS | GUARDAR - IMPRESION "
|
||||
@@ -1454,6 +1508,14 @@ Partial Class Ventas
|
||||
ViewState("ObjFacturaNC") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
#Region " PROPIEDADES NUEVAS "
|
||||
@@ -3030,7 +3092,13 @@ Partial Class Ventas
|
||||
TieneContrato = True
|
||||
LnkOCs.Visible = True
|
||||
UpnTools.Update()
|
||||
|
||||
|
||||
|
||||
Else
|
||||
BtnEstimacion.Visible = True
|
||||
GvEst.Visible = True
|
||||
|
||||
DdlContratosOC.Items.Clear()
|
||||
DdlContratosOC.DataSource = DtContratos
|
||||
DdlContratosOC.DataBind()
|
||||
@@ -3071,6 +3139,19 @@ Partial Class Ventas
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If DrContrato("CveContratoTipo").ToString.ToEntero.Contiene(30, 31) Then
|
||||
PorAmortizacionAnticipo = DrContrato("PorAmortizacionAnticipo").ToString.ToEntero
|
||||
EscontratoObra = True
|
||||
Else
|
||||
PorAmortizacionAnticipo = 0
|
||||
EscontratoObra = False
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
LbContratoImporteTotal.Text = DrContrato("ImporteTotal").ToString().FormatoNumero
|
||||
LbContratoImporteMinimo.Text = DrContrato("ImporteMin").ToString().FormatoNumero
|
||||
LbContratoImporteMaximo.Text = DrContrato("ImporteMax").ToString().FormatoNumero
|
||||
@@ -3214,6 +3295,7 @@ Partial Class Ventas
|
||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Cot"))
|
||||
End If
|
||||
|
||||
DVEstimacionesObra.Visible = False
|
||||
Select Case RBLTipoContrato.SelectedValue.ToEntero()
|
||||
Case 1
|
||||
DdlTipoComprobante.Items.Insert(0, New ListItem("Pedido", "Ped"))
|
||||
@@ -3226,7 +3308,35 @@ Partial Class Ventas
|
||||
DdlTipoComprobante.Items.Insert(0, New ListItem("Pedido de Consignación", "PeC"))
|
||||
DdlTipoComprobante.SelectedValue = "PeC"
|
||||
DdlTipoComprobante.Enabled = False
|
||||
|
||||
Case 4
|
||||
|
||||
TabGenerales.Enabled = True
|
||||
DVEstimacionesObra.Visible = True
|
||||
DdlEstimacionesObra.Items.Clear()
|
||||
Dim Con As New ClsContratos
|
||||
If Con.GetContratosAvanceEstimacionVentas(DdlContratosModal.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa) Then
|
||||
DdlEstimacionesObra.DataSource = Con.DtResultados
|
||||
Else
|
||||
DdlEstimacionesObra.DataSource = Nothing
|
||||
End If
|
||||
|
||||
Con.Dispose()
|
||||
|
||||
DdlEstimacionesObra.DataBind()
|
||||
DdlEstimacionesObra.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
BtnCargarContratoDetalles.Visible = False
|
||||
BtnCancelarContratoDetalles.Visible = False
|
||||
BtnCalcularTotalesContrato.Visible = False
|
||||
|
||||
BtnEstimacion.Visible = False
|
||||
GvEst.Visible = False
|
||||
GvContratoDetalles.Visible = False
|
||||
|
||||
End Select
|
||||
UPEstimaciones.Update()
|
||||
Updatetabs.Update()
|
||||
|
||||
ChkPSOC.Checked = False
|
||||
CambiaTipoDocto()
|
||||
@@ -3560,6 +3670,7 @@ Partial Class Ventas
|
||||
UpContratos.Update()
|
||||
End Sub
|
||||
Private Sub DdlContratoModalSelectIndex()
|
||||
|
||||
If Not DdlContratosModal.SelectedValue.ToEntero() > 0 Then
|
||||
GvContratoDetalles.DataBind()
|
||||
UpContratos.Update()
|
||||
@@ -7192,6 +7303,9 @@ Partial Class Ventas
|
||||
|
||||
Protected Sub EmitirImprimirNew(Optional TipoDoctoViejo As String = "")
|
||||
|
||||
If Not ValidaVentaContratoObra() Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If ValidaPagosContado() Then
|
||||
Exit Sub
|
||||
@@ -8785,6 +8899,13 @@ Partial Class Ventas
|
||||
ObjFactura.CveCorte = CveCorte
|
||||
ObjFactura.CveMesa = -1
|
||||
ObjFactura.NumeroPersonas = 0
|
||||
|
||||
|
||||
If ObjFactura.TipoDocto = "Ant" And DdlContratosModal.SelectedValue.ToEntero > 0 Or ObjFactura.TipoDocto = "Ing" And DdlContratosModal.SelectedValue.ToEntero > 0 Then
|
||||
CveContrato = DdlContratosModal.SelectedValue.ToEntero
|
||||
End If
|
||||
|
||||
|
||||
ObjFactura.CveContrato = If(CveContrato > 0, CveContrato, CvePresupuesto)
|
||||
|
||||
ObjFactura.CveClienteSucursal = DdlSucursalCliente.SelectedValue.ToEntero()
|
||||
@@ -10556,6 +10677,14 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
|
||||
If ErrorList.Count = 0 AndAlso RBLTipoContrato.SelectedValue = "4" And DdlEstimacionesObra.SelectedValue.ToEntero > 0 Then
|
||||
|
||||
If Not ObjContr.UpdateContratosAvanceEstimacionVentas(DdlEstimacionesObra.SelectedValue.ToEntero, ObjFactura.CveVenta, UsuarioActual.CveEmpresa) Then
|
||||
ErrorList.Add("Ocurrió un error al actualizar la estimación")
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If ErrorList.Count = 0 Then
|
||||
'prepoliza
|
||||
GuardarVentaPrePolizas(ObjConta, factura, TmpDTDetalle, CveNCaVincular, objContPaqi, ObjBancos, ObjVentas, ObjEventos:=ObjEventos, EsNCAmortizacion:=EsNCAmortizacion, NCDescuento:=NCDescuento, ListaNCDescuento:=ListaNCDescuento, ObjInventario:=ObjInventario)
|
||||
@@ -13121,8 +13250,19 @@ Partial Class Ventas
|
||||
maxsaldo = total
|
||||
End If
|
||||
|
||||
|
||||
If DdlContratosModal.SelectedValue.ToEntero > 0 AndAlso AmortizacionSujeridaContrato > 0 Then
|
||||
|
||||
If AmortizacionSujeridaContrato > saldo Then
|
||||
AmortizacionSujeridaContrato = saldo
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
e.Row.FCLiteral("MonedaVenta").Text = saldo.FormatoNumero(2)
|
||||
e.Row.FCCheckBox("Chk" & e.Row.RowIndex).Attributes.Add("onclick", String.Format("chkAnt(this,{0},{1});", e.Row.FCTextBox("TxtAnticipo" & e.Row.RowIndex).ClientID, saldo))
|
||||
e.Row.FCCheckBox("Chk" & e.Row.RowIndex).Attributes.Add("onclick", String.Format("chkAnt(this,{0},{1},{2});", e.Row.FCTextBox("TxtAnticipo" & e.Row.RowIndex).ClientID, saldo, AmortizacionSujeridaContrato))
|
||||
e.Row.FCTextBox("TxtAnticipo" & e.Row.RowIndex).Attributes.Add("onKeyUp", String.Format("FnCambiaAnt({0},this,{1});", e.Row.FCCheckBox("Chk" & e.Row.RowIndex).ClientID, saldo))
|
||||
e.Row.FCTextBox("TxtTC" & e.Row.RowIndex).Attributes.Add("onKeyUp", String.Format("CambioTipoMoneda({0},{1},{2},{3},{4});", e.Row.FCCheckBox("Chk" & e.Row.RowIndex).ClientID, e.Row.DataKey("Saldo"), e.Row.FCTextBox("TxtAnticipo" & e.Row.RowIndex).ClientID, e.Row.FCTextBox("TxtTC" & e.Row.RowIndex).ClientID, e.Row.DataKey("CveMoneda")))
|
||||
|
||||
@@ -13159,7 +13299,7 @@ Partial Class Ventas
|
||||
|
||||
|
||||
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub BtnAceptarAnticipos_Click(sender As Object, e As System.EventArgs) Handles BtnAceptarAnticipos.Click
|
||||
Anticipos()
|
||||
@@ -18141,25 +18281,53 @@ Partial Class Ventas
|
||||
BtnEstimacion.Visible = True
|
||||
End If
|
||||
|
||||
'If RblOpcionContrato.SelectedValue = "3" Then
|
||||
|
||||
|
||||
' GvEst.DataSource = Nothing
|
||||
' GvEst.DataBind()
|
||||
' BtnEstimacion.Visible = False
|
||||
|
||||
' BtnCargarContratoDetalles.Visible = False
|
||||
' BtnCancelarContratoDetalles.Visible = False
|
||||
|
||||
' UPEstimaciones.Update()
|
||||
|
||||
'End If
|
||||
|
||||
End Sub
|
||||
Private Sub CargaDatosEstimaciones(CveCliente As Integer)
|
||||
If CveVenta > 0 Then
|
||||
Exit Sub
|
||||
End If
|
||||
Dim Con As New ClsContratos
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
If Con.GetEstimacionesPorFacturar(-1, CveCliente, DdlContrato.SelectedValue.ToEntero(), 0, UsuarioActual.CveEmpresa) Then
|
||||
GvEst.DataSource = Con.DtResultados
|
||||
If Con.DtResultados.Rows.Count > 0 Then
|
||||
'BtnEstimacion.Visible = True
|
||||
DdlContrato.Items.Clear()
|
||||
DdlContrato.Items.Add(New ListItem("Todos", "-1"))
|
||||
DdlContrato.DataSource = Con.DtResultados.FiltraParametros("CveContrato > 0", "NumeroContrato", DistinctColumns:={"CveContrato", "NumeroContrato"})
|
||||
GvEst.DataSource = Con.DtResultados
|
||||
If Con.DtResultados.Rows.Count > 0 Then
|
||||
'BtnEstimacion.Visible = True
|
||||
DdlContrato.Items.Clear()
|
||||
DdlContrato.Items.Add(New ListItem("Todos", "-1"))
|
||||
DdlContrato.DataSource = Con.DtResultados.FiltraParametros("CveContrato > 0", "NumeroContrato", DistinctColumns:={"CveContrato", "NumeroContrato"})
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
UPEstimaciones.Update()
|
||||
Con.Dispose()
|
||||
DdlContrato.DataBind()
|
||||
GvEst.DataBind()
|
||||
|
||||
|
||||
UPEstimaciones.Update()
|
||||
Con.Dispose()
|
||||
DdlContrato.DataBind()
|
||||
GvEst.DataBind()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
Protected Sub GVEst_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEst.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
@@ -25062,7 +25230,12 @@ Partial Class Ventas
|
||||
End Sub
|
||||
|
||||
Private Sub DdlTipoAmortizacionAnticipo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoAmortizacionAnticipo.SelectedIndexChanged
|
||||
|
||||
|
||||
ImporteSujeridoAnticipo(DdlTipoAmortizacionAnticipo.SelectedValue.ToEntero)
|
||||
|
||||
divAnticipoMsg.Visible = False
|
||||
|
||||
If DdlTipoAmortizacionAnticipo.SelectedValue.Contiene("1", "2") Then
|
||||
'cuando es amortización por descuento, debe tener seleccionado descuentos previamente registrados
|
||||
If DdlTipoAmortizacionAnticipo.SelectedValue = "1" AndAlso LblDescuentos.Text.ToDecimal <= 0 Then
|
||||
@@ -25084,6 +25257,34 @@ Partial Class Ventas
|
||||
DdlTipoRelacionAnticipo.SelectedValueExist("-1")
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub ImporteSujeridoAnticipo(TipoAmortizacion As Integer)
|
||||
|
||||
'TipoAmortizacion
|
||||
'1.-Anticpo como descuento se basa en subtotal
|
||||
'2.-Anticipo con notade credito se basa en total
|
||||
|
||||
AmortizacionSujeridaContrato = 0
|
||||
Dim Porcentaje As Decimal = PorAmortizacionAnticipo * 0.01D
|
||||
|
||||
If PorAmortizacionAnticipo > 0 AndAlso TipoAmortizacion > 0 Then
|
||||
|
||||
If TipoAmortizacion = 1 Then
|
||||
AmortizacionSujeridaContrato = (TxtSubTotal2.Text.ToDecimal * Porcentaje).RoundSQL(2)
|
||||
ElseIf TipoAmortizacion = 2 Then
|
||||
AmortizacionSujeridaContrato = (TxtTotal.Text.ToDecimal * Porcentaje).RoundSQL(2)
|
||||
End If
|
||||
|
||||
Else
|
||||
AmortizacionSujeridaContrato = 0
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub DdlMetodoPago33_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlMetodoPago33.SelectedIndexChanged
|
||||
@@ -27751,6 +27952,55 @@ Partial Class Ventas
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Function ValidaVentaContratoObra() As Boolean
|
||||
|
||||
Dim Respuesta As Boolean = False
|
||||
|
||||
If EscontratoObra Then
|
||||
|
||||
If DdlTipoComprobante.SelectedValue = "Ing" Then
|
||||
|
||||
If DdlEstimacionesObra.SelectedValue.ToEntero > 0 Then
|
||||
|
||||
Dim ImporteAmortizarFinal As Decimal = 0
|
||||
If GVAnticipos.Rows.Count > 0 Then
|
||||
Dim actualindex As Integer = 0
|
||||
For Each row2 As GridViewRow In GVAnticipos.Rows
|
||||
If row2.FCCheckBox("Chk" & row2.RowIndex).Checked Then
|
||||
ImporteAmortizarFinal = ImporteAmortizarFinal + row2.FCTextBox($"TxtAnticipo{actualindex}").Text.ToDecimal
|
||||
End If
|
||||
actualindex = actualindex + 1
|
||||
Next
|
||||
End If
|
||||
|
||||
If ImporteAmortizarFinal > 0 Then
|
||||
Respuesta = True
|
||||
Else
|
||||
Respuesta = False
|
||||
Alert("Debe de seleccioanr un importe de amortización.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
Else
|
||||
Respuesta = False
|
||||
Alert("Se selecciono un contrato de obra, para continuar seleccione una estimación.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
ElseIf DdlTipoComprobante.SelectedValue = "Ant" Then
|
||||
Respuesta = True
|
||||
Else
|
||||
Alert("Tipo de documento no valido para contratos de obra.", TipoMensaje.MsgAdvertencia)
|
||||
Respuesta = True
|
||||
End If
|
||||
|
||||
Else
|
||||
Respuesta = True
|
||||
End If
|
||||
|
||||
Return Respuesta
|
||||
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user