Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -3738,7 +3738,7 @@ Public Class ClsVentas
|
||||
|
||||
#Region "COMISIONES"
|
||||
|
||||
Public Function GetRepComisiones(FechaI As Date, FechaF As Date, CveSubProyecto As Integer, CveVendedor As Integer, CveCliente As Integer, CveUsuario As Integer, CveEmpresa As Integer, TipoSaldo As Integer) As Boolean
|
||||
Public Function GetRepComisiones(FechaI As Date, FechaF As Date, CveSubProyecto As Integer, CveVendedor As Integer, CveCliente As Integer, CveUsuario As Integer, CveEmpresa As Integer, TipoSaldo As Integer, Optional EsquemaNuevo As Boolean = False) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_RepComisiones119")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
@@ -3750,6 +3750,7 @@ Public Class ClsVentas
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@TipoSaldo", SqlDbType.Int).Value = TipoSaldo
|
||||
.Add("@EsquemaNuevo", SqlDbType.Bit).Value = EsquemaNuevo
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
|
||||
14409
Bin/Newtonsoft.Json.xml
14409
Bin/Newtonsoft.Json.xml
File diff suppressed because it is too large
Load Diff
@@ -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)
|
||||
|
||||
@@ -7908,7 +7908,7 @@
|
||||
$get('HdnTotalVenta').value = FormatoNumero(totalVenta, 2);
|
||||
}
|
||||
|
||||
function chkAnt(t, txt, importe) {
|
||||
function chkAnt(t, txt, importe, AmorContrato = 0) {
|
||||
debugger;
|
||||
var totalAnt = 0;
|
||||
|
||||
@@ -7925,6 +7925,8 @@
|
||||
|
||||
if (SaldoCompra > 0) {
|
||||
|
||||
|
||||
|
||||
//if (SaldoCompra > importe) {
|
||||
// txt.value = importe.toFixed(2);
|
||||
// SaldoCompra = SaldoCompra - importe;
|
||||
@@ -7935,7 +7937,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 "
|
||||
@@ -3077,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
|
||||
@@ -7228,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
|
||||
@@ -8775,7 +8853,7 @@ Partial Class Ventas
|
||||
ObjFactura.NumeroPersonas = 0
|
||||
|
||||
|
||||
If ObjFactura.TipoDocto = "Ant" And DdlContratosModal.SelectedValue.ToEntero > 0 Then
|
||||
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
|
||||
|
||||
@@ -13107,8 +13185,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")))
|
||||
|
||||
@@ -13145,7 +13234,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()
|
||||
@@ -25037,7 +25126,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
|
||||
@@ -25059,6 +25153,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
|
||||
@@ -27726,6 +27848,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