Merge branch 'master' of http://oirigoyen@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -64,20 +64,20 @@
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveAutorizacion,CveCliente,CveVendedor,Importe"
|
||||
EmptyDataText="No se encontraron autorizaciones" ToolTip="Listado de autorizaciones"
|
||||
EmptyDataText="No se encontraron autorizaciones" ToolTip=""
|
||||
CssClass="table table-striped table-advance table-hover ScrollAD mysmallbtn" data-sort="true" Width="100%" GridLines="None">
|
||||
<Columns>
|
||||
<asp:HyperLinkField DataTextField="NombreComercial" Target="_blank" HeaderText="Cliente" DataNavigateUrlFields="CveCliente" DataNavigateUrlFormatString="/Ventas/Clientes.aspx?CveCliente={0}" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="20%" />
|
||||
<asp:BoundField DataField="Vendedor" HeaderText="Vendedor" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="15%" />
|
||||
<asp:BoundField DataField="Importe" ItemStyle-Width="15%" HeaderText="Importe" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField DataField="LimiteCredito" ItemStyle-Width="15%" HeaderText="Limite Credito" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField DataField="Saldo" ItemStyle-Width="15%" HeaderText="Saldo" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField DataField="FechaIng" ItemStyle-Width="10%" HeaderText="Fecha de Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
|
||||
<asp:BoundField DataField="Vendedor" HeaderText="Vendedor" ItemStyle-Width="15%" />
|
||||
<asp:BoundField DataField="Importe" ItemStyle-Width="15%" HeaderText="Importe" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField DataField="LimiteCredito" ItemStyle-Width="10%" HeaderText="Limite Credito" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField DataField="Saldo" ItemStyle-Width="10%" HeaderText="Saldo" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField DataField="FechaIng" ItemStyle-Width="10%" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
|
||||
<asp:BoundField DataField="TipoAutorizacionTexto" HeaderText="Tipo" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" />
|
||||
<asp:BoundField DataField="DiasVencidos" ItemStyle-Width="15%" HeaderText="Dias Vencidos" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:N0}" />
|
||||
<asp:BoundField DataField="TipoDocumento" HeaderText="Tipo Documento" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" />
|
||||
<asp:BoundField DataField="DiasVencidos" ItemStyle-Width="5%" HeaderText="Dias Vencidos" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:N0}" />
|
||||
<asp:BoundField DataField="TipoDocumento" HeaderText="Tipo" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
|
||||
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%">
|
||||
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblEstatus" Text='<%# Eval("Estatus") %>' runat="server"></asp:Label>
|
||||
</ItemTemplate>
|
||||
|
||||
@@ -24,21 +24,25 @@ Partial Class Ventas_CatAutorizacionLimites
|
||||
#End Region
|
||||
|
||||
Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
CargaCombos()
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region "CARGAS"
|
||||
Private Sub CargaCombos()
|
||||
Dim EsWS = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
|
||||
If Not IsPostBack Then
|
||||
CargaCombos()
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region "CARGAS"
|
||||
Private Sub CargaCombos()
|
||||
|
||||
DdlCliente.setEsWebService(True)
|
||||
DdlClienteFiltro.setEsWebService(True)
|
||||
|
||||
'Dim EsWS = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
|
||||
'If EsWS Then
|
||||
DdlCliente.setEsWebService(True)
|
||||
DdlClienteFiltro.setEsWebService(True)
|
||||
Else
|
||||
DdlCliente.setEsWebService(False)
|
||||
DdlCliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
|
||||
' DdlCliente.setEsWebService(True)
|
||||
' DdlClienteFiltro.setEsWebService(True)
|
||||
'Else
|
||||
' DdlCliente.setEsWebService(False)
|
||||
' DdlCliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
|
||||
' DdlCliente.DataBind()
|
||||
' DdlCliente.ddl.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -494,7 +494,7 @@
|
||||
<tr align="left" id="TrServicioDomicilio" runat="server" visible="false">
|
||||
<td><b>Servicio a Domicilio:</b> </td>
|
||||
<td>
|
||||
<asp:CheckBox ID="ChkServicioDomicilio" runat="server" CssClass="make-switchsd" data-size="small" Text="" ClientIDMode="Static" />
|
||||
<asp:CheckBox ID="ChkServicioDomicilio" runat="server" AutoPostBack="true" OnCheckedChanged="ChkServicioDomicilio_CheckedChanged" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -928,7 +928,7 @@
|
||||
</div>
|
||||
<div class=" col-sm-8">
|
||||
<div class="Widthall" style="overflow-x: auto;">
|
||||
<asp:GridView ID="GvInv" runat="server" AutoGenerateColumns="false" DataKeyNames="Origen,CvePS" EmptyDataText="Aun no hay registros." ShowHeaderWhenEmpty="True" Width="100%" HeaderStyle-CssClass="Titulos" CssClass="table table-striped table-hover" Style="text-align: center;" GridLines="None">
|
||||
<asp:GridView ID="GvInv" runat="server" AutoGenerateColumns="false" DataKeyNames="Consec,Origen,CodigoPS,CvePS,Serie,AplicaSerie" EmptyDataText="Aun no hay registros." ShowHeaderWhenEmpty="True" Width="100%" HeaderStyle-CssClass="Titulos" CssClass="table table-striped table-hover" Style="text-align: center;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
@@ -2790,21 +2790,22 @@
|
||||
<div class="col-md-4">
|
||||
<label>Año:</label>
|
||||
<br />
|
||||
<asp:TextBox ID="TxtAnioVehiculo" type="number" runat="server" Height="100%" Width="100%" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtAnioVehiculo" type="number" runat="server" Height="100%" Width="100%" CssClass="form-control" ></asp:TextBox>
|
||||
<asp:CustomValidator ID="CVAnio" runat="server" ClientValidationFunction="ValidaAnioVehiculo" ValidateEmptyText="true" ControlToValidate="TxtAnioVehiculo" Display="Dynamic" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Año''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:CustomValidator>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<label>Usado:</label>
|
||||
<br />
|
||||
<asp:DropDownList ID="DdlRecepcionUsados" CssClass="form-control input-sm select2me" runat="server" CausesValidation="true" DataTextField="CodigoPS" DataValueField="CvePSCargo" Width="100%" OnSelectedIndexChanged="DdlRecepcionUsados_SelectedIndexChanged" AutoPostBack="true">
|
||||
<asp:DropDownList ID="DdlRecepcionUsados" CssClass="form-control input-sm select2me" runat="server" DataTextField="CodigoPS" DataValueField="CvePSCargo" Width="100%" OnSelectedIndexChanged="DdlRecepcionUsados_SelectedIndexChanged" AutoPostBack="true">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label>BCI:</label>
|
||||
<br />
|
||||
<asp:DropDownList ID="DdlBCIUsado" CssClass="form-control input-sm select2me" runat="server" CausesValidation="true" DataTextField="BCI" DataValueField="CveBCIUsado" Width="100%">
|
||||
</asp:DropDownList>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@@ -2813,6 +2814,7 @@
|
||||
<asp:DropDownList ID="DdlMarcaUsado" CssClass="form-control input-sm select2me" runat="server" DataTextField="Marca" DataValueField="CveMarcaUsado" Width="100%">
|
||||
<asp:ListItem Selected="True" Text="Seleccione la Marca" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:CustomValidator ID="RFVMarcaUsado" runat="server" ClientValidationFunction="ValidaMarcaUsado" ControlToValidate="DdlMarcaUsado" Display="Dynamic" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Marca''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:CustomValidator>
|
||||
<label for="<%= DdlMarcaUsado.ClientID.ToString()%>">Marca:</label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2969,6 +2971,8 @@
|
||||
<asp:DropDownList ID="DdlBCIAjuste" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="BCI" DataValueField="CveBCIUsado" Width="100%" AutoPostBack="true">
|
||||
</asp:DropDownList>
|
||||
<label for="<%= DdlBCIAjuste.ClientID.ToString()%>">BCI:</label>
|
||||
<asp:RequiredFieldValidator ID="RFVBCIAjuste" runat="server" ControlToValidate="DdlBCIAjuste" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''BCI''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEBCIAjuste" runat="server" HighlightCssClass="vco" TargetControlID="RFVBCIAjuste" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
@@ -3135,8 +3139,7 @@
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpAgregar" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<%-- <asp:Button ID="BtnCalculaMesesUso" Text="" OnClick="BtnCalculaMesesUso_Click" ClientIDMode="Static" Style="display: none;" runat="server" />--%>
|
||||
<asp:Button ClientIDMode="Static" ID="LnkAgregarPS" OnClick="LnkAgregarPS_Click" runat="server" CssClass="btn btn-primary" Text="Agregar" ValidationGroup="GrpAddVenta" UseSubmitBehavior="false" />
|
||||
<asp:Button ID="LnkAgregarPS" OnClick="LnkAgregarPS_Click" runat="server" CssClass="btn btn-primary" Text="Agregar" ValidationGroup="GrpAddVenta" />
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
@@ -3176,6 +3179,26 @@
|
||||
}
|
||||
});
|
||||
|
||||
function ValidaMarcaUsado(val, args) {
|
||||
//VALIDA SOLO SI SE SELECCIONO UN USADO
|
||||
var cveUsado = ToDouble($get("C_DdlRecepcionUsados").value);
|
||||
if (cveUsado > 0) {
|
||||
args.IsValid = (ToDouble(args.Value) > 0);
|
||||
} else {
|
||||
args.IsValid = true;
|
||||
}
|
||||
}
|
||||
|
||||
function ValidaAnioVehiculo(val, args) {
|
||||
//VALIDA SOLO SI SE SELECCIONO UN USADO
|
||||
var cveUsado = ToDouble($get("C_DdlRecepcionUsados").value);
|
||||
if (cveUsado > 0) {
|
||||
args.IsValid = (ToDouble(args.Value) > 0);
|
||||
} else {
|
||||
args.IsValid = true;
|
||||
}
|
||||
}
|
||||
|
||||
function ValidarCodigoEnsamble(source, arguments) {
|
||||
let CveMarca = HdnPSAjusteMarca.value;
|
||||
let CveClasificacion = HdnPSAjusteClasificacion.value;
|
||||
|
||||
@@ -3067,7 +3067,7 @@ Partial Class PV
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
'SERIE ALMACEN
|
||||
If e.Row.DBCampo("CveTipoInvPS").ToEntero = 5 Then
|
||||
If e.Row.DBCampo("CveTipoInvPS").ToEntero = 5 OrElse CBool(e.Row.DBCampo("AplicaSerie")) Then
|
||||
If CveVenta > 0 Then
|
||||
e.Row.FCLiteral("LtlSerie").Visible = True
|
||||
Else
|
||||
@@ -3198,6 +3198,27 @@ Partial Class PV
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ChkServicioDomicilio.Checked AndAlso ddlAlmacen.SelectedValue.ToEntero() <= 0 Then
|
||||
Alert("Debe seleccionar un almacen de servicio a domicilio.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ChkServicioDomicilio.Checked AndAlso GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked) <= 0 Then
|
||||
Alert("Debe tener producto seleccionados para servicio a domicilio.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ChkServicioDomicilio.Checked AndAlso GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked) > 0 Then
|
||||
For Each GvRow As GridViewRow In GvInv.Rows
|
||||
If GvRow.RowType = DataControlRowType.DataRow Then
|
||||
If String.IsNullOrEmpty(GvRow.FCTextBox("TxtSerie").Text.Trim) AndAlso CBool(GvRow.DataKey("AplicaSerie")) Then
|
||||
Alert(String.Format("El producto {0} requiere serie.", GvRow.DataKey("CodigoPS")), TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
'VALIDA PRECIO AL AGREGAR A ALMACEN
|
||||
If Not UsuarioActual.TienePermisoProceso(169) Then
|
||||
If Not CveContrato > 0 Then
|
||||
@@ -3463,255 +3484,274 @@ Partial Class PV
|
||||
#Region "OBJETO VENTA"
|
||||
|
||||
Private Sub CreaObjetosVenta(Optional VistaPrevia As Boolean = False)
|
||||
|
||||
If Me.CveVenta > 0 Then
|
||||
ObjFactura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False)
|
||||
Else
|
||||
ObjFactura = New Modelos.Factura(UsuarioActual)
|
||||
ObjFactura.CvePrePoliza = -1
|
||||
End If
|
||||
|
||||
ObjFactura.CveUsuario = UsuarioActual.CveUsuario
|
||||
ObjFactura.CveEmpresa = UsuarioActual.CveEmpresa
|
||||
ObjFactura.TipoCambio = TxtTipoCambio.Text.Trim.ToDecimal
|
||||
ObjFactura.TipoCambioDolares = TxtTipoCambioDlls.Text.Trim.ToDecimal
|
||||
ObjFactura.ConvertirPesos = ChkConvertirDoctoPesos.Checked
|
||||
ObjFactura.ConvertirDolares = ChkConvertirDolares.Checked
|
||||
ObjFactura.CveMoneda = DdlMoneda.SelectedValue.ToEntero
|
||||
ObjFactura.Moneda = DdlMoneda.SelectedItem.Text
|
||||
ObjFactura.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {DdlMoneda.SelectedValue}")
|
||||
ObjFactura.TipoDocto = If(IfNull(ViewState("CveRemision"), 0).ToString.ToEntero > 0, "Ing", DdlTipoComprobante.SelectedValue)
|
||||
'ObjFactura.RefDocto = TxtDocto.Text.Trim
|
||||
ObjFactura.Folio = If(EstablecioFolio Or VistaPrevia Or (CveVenta > 0 And (NuevaFactura.Contiene(0, 2))), TxtFolio.Text.Trim.ToEntero, -1)
|
||||
'ObjFactura.Folio = If(ExFolioFactura, FolioXML.ToEntero, -1)
|
||||
ObjFactura.Serie = If(VistaPrevia, "VistaPrevia", LblSerie.Text)
|
||||
ObjFactura.Fecha = New Date(TxtFecha.Text.Trim.ToDate.Year, TxtFecha.Text.Trim.ToDate.Month, TxtFecha.Text.Trim.ToDate.Day, Now.Hour, Now.Minute, Now.Second)
|
||||
ObjFactura.CveMetodoPago = DdlMetodoPago.SelectedValue.ToEntero
|
||||
ObjFactura.MetodoPago = DdlMetodoPago.SelectedItem.Text
|
||||
ObjFactura.ClaveMetodoPagoSAT = GlobalDTMetodosPago.FiltroPrimeroValor("ClaveSAT", $"CveMetodoPago = {DdlMetodoPago.SelectedValue}")
|
||||
ObjFactura.FechaVencimiento = TxtFechaPago.Text.ToDate
|
||||
|
||||
ObjFactura.CveMetodoPago33 = DdlMetodoPago33.SelectedValue.ToEntero
|
||||
ObjFactura.MetodoPago33 = If(DdlMetodoPago33.SelectedValue.ToEntero > 0, DdlMetodoPago33.SelectedItem.Text, "")
|
||||
ObjFactura.ClaveMetodoPagoSAT = GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", $"CveMetodoPago = {DdlMetodoPago33.SelectedValue}")
|
||||
|
||||
ObjFactura.CveFormaPago33 = DdlFormaPago33.SelectedValue.ToEntero
|
||||
ObjFactura.FormaPago33 = If(DdlFormaPago33.SelectedValue.ToEntero > 0, DdlFormaPago33.SelectedItem.Text, "")
|
||||
ObjFactura.FormaPagoSAT33 = GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", $"CveFormaPago = {DdlFormaPago33.SelectedValue}")
|
||||
|
||||
ObjFactura.CveUsoCFDI = DdlUsoCFDI.SelectedValue.ToEntero
|
||||
ObjFactura.UsoCFDI = If(DdlUsoCFDI.SelectedValue.ToEntero > 0, DdlUsoCFDI.SelectedItem.Text, "")
|
||||
ObjFactura.ClaveUsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", $"CveUsoCFDI = {DdlUsoCFDI.SelectedValue}")
|
||||
|
||||
ObjFactura.UsuarioCreo = LblUsuario.Text.Trim
|
||||
|
||||
ObjFactura.CveCondicionEntrega = If(DdlFormaEntrega.SelectedItem IsNot Nothing, DdlFormaEntrega.SelectedValue.ToEntero, -1)
|
||||
ObjFactura.CondicionEntrega = If(DdlFormaEntrega.SelectedItem IsNot Nothing, DdlFormaEntrega.SelectedItem.Text, "")
|
||||
ObjFactura.CondicionesPago = If(RBLPago.SelectedValue = "2", 0, If(RBLPago.SelectedValue = "1", 1, 2)) ' 0 - Contado, 1 - Credito, 2 - termianl
|
||||
ObjFactura.FormaPago = DdlFormaPago.SelectedValue.ToEntero
|
||||
|
||||
Select Case ObjFactura.TipoDocto
|
||||
Case "Ing"
|
||||
ObjFactura.TipoDocumento = "Factura"
|
||||
Case "Rem"
|
||||
ObjFactura.TipoDocumento = "Remision"
|
||||
Case "Cot"
|
||||
ObjFactura.TipoDocumento = "Cotizacion"
|
||||
Case "Egs"
|
||||
ObjFactura.TipoDocumento = "Nota de Crédito"
|
||||
Case "Dev"
|
||||
ObjFactura.TipoDocumento = "Nota de Devolución"
|
||||
Case Else
|
||||
ObjFactura.TipoDocumento = ""
|
||||
End Select
|
||||
|
||||
|
||||
ObjFactura.Fech1 = Now
|
||||
ObjFactura.Fech2 = Now
|
||||
ObjFactura.Fech3 = Now
|
||||
ObjFactura.Alfa1 = ""
|
||||
ObjFactura.Alfa2 = ""
|
||||
ObjFactura.Alfa3 = ""
|
||||
ObjFactura.Num1 = 0
|
||||
ObjFactura.Num2 = 0
|
||||
ObjFactura.Num3 = DdlOrdenPago.SelectedValue.ToDouble
|
||||
ObjFactura.FechaPago = TxtFechaPago.Text.ToDate
|
||||
|
||||
ObjFactura.CveCorte = CveCorte
|
||||
ObjFactura.CveMesa = -1
|
||||
ObjFactura.NumeroPersonas = 0
|
||||
ObjFactura.CveContrato = If(CveContrato > 0, CveContrato, CvePresupuesto)
|
||||
ObjFactura.CveClienteSucursal = DdlSucursalCliente.SelectedValue.ToEntero
|
||||
ObjFactura.Entrega = Entrega
|
||||
ObjFactura.Vigencia = Now
|
||||
|
||||
ObjFactura.CveVentaPadre = If(CveDevolucion > 0, CveDevolucion, CvePedido)
|
||||
ObjFactura.CveVendedor = DdlVendedor.SelectedValue.ToEntero
|
||||
If DdlVendedor.SelectedValue.ToEntero > 0 AndAlso Not UsuarioActual.TienePermisoProceso(161) Then
|
||||
DdlVendedor.Enabled = False
|
||||
End If
|
||||
|
||||
ObjFactura.FechaEjecucion = Now
|
||||
|
||||
ObjFactura.CveSucursalEjecucion = DdlSubProyectoDatos.SelectedValue.ToEntero
|
||||
ObjFactura.CveSucursalCobranza = -1
|
||||
|
||||
ObjFactura.CveSubProyecto = DdlSubProyectoDatos.SelectedValue.ToEntero
|
||||
ObjFactura.CveSubProyectoEjecucion = DdlSubProyectoDatos.SelectedValue.ToEntero
|
||||
ObjFactura.CveSubProyectoCobranza = -1
|
||||
|
||||
ObjFactura.AtencionA = If(ObjFactura.TipoDocto = "Cot", TxtAtencionA.Text, "-1")
|
||||
ObjFactura.MotivoDescuento = TxtMotivoDescuento.Text.Trim
|
||||
ObjFactura.Observaciones = TxtObsFact.Text.Trim
|
||||
ObjFactura.Det_OrdenCompra = ""
|
||||
ObjFactura.Det_FechaOrdenCompra = MinFecha.ToShortDateString
|
||||
ObjFactura.MonedaAbreviatura = ""
|
||||
|
||||
'Totales, Y se llena TmpDTImpuestos
|
||||
ObjFactura.SubTotal = TxtSubTotal.Text.ToDecimal
|
||||
ObjFactura.Descuento = LblDescuentos.Text.Trim.ToDecimal
|
||||
ObjFactura.Amortizacion = LblAmortizacion.Text.Trim.ToDecimal
|
||||
ObjFactura.IVA = TxtIVA.Text.ToDecimal
|
||||
ObjFactura.RetIVA = TxtRetIVA.Text.ToDecimal
|
||||
ObjFactura.RetISR = TxtRetISR.Text.ToDecimal
|
||||
ObjFactura.IEPS = TxtIEPS.Text.ToDecimal
|
||||
ObjFactura.Total = TxtTotal.Text.ToDecimal
|
||||
|
||||
ObjFactura.DtDeduccion = New DataTable
|
||||
|
||||
'OTROS
|
||||
ObjFactura.Det_FechaOrdenCompra = ""
|
||||
ObjFactura.Det_OrdenCompra = ""
|
||||
|
||||
ObjFactura.CveNCaVincular = DdlNCFactura.SelectedValue.ToEntero
|
||||
|
||||
If ObjFactura.CveMoneda <> 1 AndAlso ChkConvertirDoctoPesos.Checked Then
|
||||
ObjFactura.TipoCambio = TxtTipoCambio.Text.Trim.ToDecimal
|
||||
ObjFactura.CveMoneda = 1
|
||||
|
||||
ObjFactura.Moneda = "Pesos"
|
||||
ObjFactura.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {ObjFactura.CveMoneda}")
|
||||
End If
|
||||
|
||||
If ObjFactura.CveMoneda <> 2 AndAlso ChkConvertirDolares.Checked Then
|
||||
ObjFactura.TipoCambio = TxtTipoCambioDlls.Text.Trim.ToDecimal
|
||||
ObjFactura.CveMoneda = 2
|
||||
|
||||
ObjFactura.Moneda = "Dólares"
|
||||
ObjFactura.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {ObjFactura.CveMoneda}")
|
||||
End If
|
||||
|
||||
'Se agrega CveVenta -1
|
||||
For Each Row As DataRow In TmpDT.Rows
|
||||
Row("CveVenta") = ObjFactura.CveVenta
|
||||
Next
|
||||
|
||||
|
||||
'DETALLES
|
||||
ObjFactura.DtDetalle = TmpDT
|
||||
ObjFactura.DtFirmas = DTmpF
|
||||
|
||||
'CLIENTE
|
||||
ObjFactura.CveCliente = CveCliente
|
||||
ObjFactura.SetCliente()
|
||||
|
||||
'SUCURSAL
|
||||
ObjFactura.CveSucursal = DdlSubProyectoDatos.SelectedValue.ToEntero
|
||||
ObjFactura.SetSubProyectoMatriz(Me)
|
||||
ObjFactura.SetSubProyecto(Me)
|
||||
ObjFactura.ClienteSucursal = New Modelos.SucursalModel
|
||||
ObjFactura.ClienteSucursal.NoExt = CliNoExt
|
||||
ObjFactura.ClienteSucursal.NoInt = CliNoInt
|
||||
ObjFactura.ClienteSucursal.Localidad = CliLocalidad
|
||||
ObjFactura.ClienteSucursal.Direccion = LblDireccion.Text
|
||||
ObjFactura.ClienteSucursal.Colonia = LblColonia.Text
|
||||
ObjFactura.ClienteSucursal.Municipio = LblCiudad.Text
|
||||
ObjFactura.ClienteSucursal.Estado = LblEstado.Text
|
||||
ObjFactura.ClienteSucursal.CP = LblCP.Text
|
||||
ObjFactura.ClienteSucursal.Pais = CliPais
|
||||
ObjFactura.ClienteSucursal.CorreoSucursal = CliCorreoCot.ToString
|
||||
ObjFactura.ClienteSucursal.TelefonoSucursal = LblTelefono.Text
|
||||
ObjFactura.ClienteSucursal.Sucursal = DdlSucursalCliente.SelectedItem.Text
|
||||
|
||||
ObjFactura.DtDetalle = TmpDT
|
||||
ObjFactura.DtPagos = DtPagos
|
||||
ObjFactura.DtPromociones = DtPromociones
|
||||
|
||||
Dim FM As New Modelos.FemsaFactura
|
||||
Dim TmpDT7Eleven As New DataTable
|
||||
Dim TmpDTComplementosTimbrado As New DataTable
|
||||
|
||||
PrepararTimbrado(FM, TmpDT7Eleven, TmpDTComplementosTimbrado)
|
||||
|
||||
ObjFactura.FemsaFactura = FM
|
||||
|
||||
ObjFactura.Timbre = PreParaTimbre(ObjFactura)
|
||||
|
||||
ObjFactura.DtAjustes = TmpDTAjustes
|
||||
|
||||
ObjFactura.DtRecepcionUsados = TmpDTRecepcionUsados
|
||||
|
||||
ObjFactura.DtPolizasVirtuales = TmpDTPolizaVirtual
|
||||
|
||||
ObjFactura.GenerarPDFFactura = False
|
||||
|
||||
Dim CveTipoAlmacen As Integer = If(TmpDTAjustes IsNot Nothing AndAlso TmpDTAjustes.Rows.Count > 0, 6, 22)
|
||||
If GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros($"CveTipoAlmacen = {CveTipoAlmacen} AND CveSubProyecto= {DdlSubProyectoDatos.SelectedValue}").Rows.Count > 0 Then
|
||||
ObjFactura.CveAlmacenRecepcionUsados = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros($"CveTipoAlmacen = {CveTipoAlmacen} AND CveSubProyecto= {DdlSubProyectoDatos.SelectedValue}").Rows(0)("CveAlmacen").ToString.ToEntero
|
||||
End If
|
||||
|
||||
'If Not ddlAlmacen.SelectedValue.ToEntero > 0 AndAlso ddlAlmacen.Items.Count > 1 AndAlso UsuarioActual.Empresa.Funcionalidad(531).ToString = "1" Then
|
||||
' ddlAlmacen.SelectedIndex = 1
|
||||
'End If
|
||||
|
||||
If ddlAlmacen.SelectedValue.ToEntero > 0 Then
|
||||
ObjFactura.CveAlmacen = ddlAlmacen.SelectedValue.ToEntero
|
||||
|
||||
If Not DtInv.Columns.Contains("Seleccionado") Then
|
||||
DtInv.Columns.Add("Seleccionado", GetType(Integer))
|
||||
Try
|
||||
If Me.CveVenta > 0 Then
|
||||
ObjFactura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False)
|
||||
Else
|
||||
ObjFactura = New Modelos.Factura(UsuarioActual)
|
||||
ObjFactura.CvePrePoliza = -1
|
||||
End If
|
||||
|
||||
For Each Gvr As GridViewRow In GvInv.Rows
|
||||
Dim Dr As DataRow = DtInv.Select($"CvePS={Gvr.DataKey("CvePS")}")(0)
|
||||
If Gvr.FCCheckBox("cbInv").Checked AndAlso ddlAlmacen.SelectedValue.ToEntero > 0 Then
|
||||
Dr("Seleccionado") = 1
|
||||
Else
|
||||
Dr("Seleccionado") = 0
|
||||
End If
|
||||
ObjFactura.CveUsuario = UsuarioActual.CveUsuario
|
||||
ObjFactura.CveEmpresa = UsuarioActual.CveEmpresa
|
||||
ObjFactura.TipoCambio = TxtTipoCambio.Text.Trim.ToDecimal
|
||||
ObjFactura.TipoCambioDolares = TxtTipoCambioDlls.Text.Trim.ToDecimal
|
||||
ObjFactura.ConvertirPesos = ChkConvertirDoctoPesos.Checked
|
||||
ObjFactura.ConvertirDolares = ChkConvertirDolares.Checked
|
||||
ObjFactura.CveMoneda = DdlMoneda.SelectedValue.ToEntero
|
||||
ObjFactura.Moneda = DdlMoneda.SelectedItem.Text
|
||||
ObjFactura.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {DdlMoneda.SelectedValue}")
|
||||
ObjFactura.TipoDocto = If(IfNull(ViewState("CveRemision"), 0).ToString.ToEntero > 0, "Ing", DdlTipoComprobante.SelectedValue)
|
||||
'ObjFactura.RefDocto = TxtDocto.Text.Trim
|
||||
ObjFactura.Folio = If(EstablecioFolio Or VistaPrevia Or (CveVenta > 0 And (NuevaFactura.Contiene(0, 2))), TxtFolio.Text.Trim.ToEntero, -1)
|
||||
'ObjFactura.Folio = If(ExFolioFactura, FolioXML.ToEntero, -1)
|
||||
ObjFactura.Serie = If(VistaPrevia, "VistaPrevia", LblSerie.Text)
|
||||
ObjFactura.Fecha = New Date(TxtFecha.Text.Trim.ToDate.Year, TxtFecha.Text.Trim.ToDate.Month, TxtFecha.Text.Trim.ToDate.Day, Now.Hour, Now.Minute, Now.Second)
|
||||
ObjFactura.CveMetodoPago = DdlMetodoPago.SelectedValue.ToEntero
|
||||
ObjFactura.MetodoPago = DdlMetodoPago.SelectedItem.Text
|
||||
ObjFactura.ClaveMetodoPagoSAT = GlobalDTMetodosPago.FiltroPrimeroValor("ClaveSAT", $"CveMetodoPago = {DdlMetodoPago.SelectedValue}")
|
||||
ObjFactura.FechaVencimiento = TxtFechaPago.Text.ToDate
|
||||
|
||||
ObjFactura.CveMetodoPago33 = DdlMetodoPago33.SelectedValue.ToEntero
|
||||
ObjFactura.MetodoPago33 = If(DdlMetodoPago33.SelectedValue.ToEntero > 0, DdlMetodoPago33.SelectedItem.Text, "")
|
||||
ObjFactura.ClaveMetodoPagoSAT = GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", $"CveMetodoPago = {DdlMetodoPago33.SelectedValue}")
|
||||
|
||||
ObjFactura.CveFormaPago33 = DdlFormaPago33.SelectedValue.ToEntero
|
||||
ObjFactura.FormaPago33 = If(DdlFormaPago33.SelectedValue.ToEntero > 0, DdlFormaPago33.SelectedItem.Text, "")
|
||||
ObjFactura.FormaPagoSAT33 = GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", $"CveFormaPago = {DdlFormaPago33.SelectedValue}")
|
||||
|
||||
ObjFactura.CveUsoCFDI = DdlUsoCFDI.SelectedValue.ToEntero
|
||||
ObjFactura.UsoCFDI = If(DdlUsoCFDI.SelectedValue.ToEntero > 0, DdlUsoCFDI.SelectedItem.Text, "")
|
||||
ObjFactura.ClaveUsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", $"CveUsoCFDI = {DdlUsoCFDI.SelectedValue}")
|
||||
|
||||
ObjFactura.UsuarioCreo = LblUsuario.Text.Trim
|
||||
|
||||
ObjFactura.CveCondicionEntrega = If(DdlFormaEntrega.SelectedItem IsNot Nothing, DdlFormaEntrega.SelectedValue.ToEntero, -1)
|
||||
ObjFactura.CondicionEntrega = If(DdlFormaEntrega.SelectedItem IsNot Nothing, DdlFormaEntrega.SelectedItem.Text, "")
|
||||
ObjFactura.CondicionesPago = If(RBLPago.SelectedValue = "2", 0, If(RBLPago.SelectedValue = "1", 1, 2)) ' 0 - Contado, 1 - Credito, 2 - termianl
|
||||
ObjFactura.FormaPago = DdlFormaPago.SelectedValue.ToEntero
|
||||
|
||||
Select Case ObjFactura.TipoDocto
|
||||
Case "Ing"
|
||||
ObjFactura.TipoDocumento = "Factura"
|
||||
Case "Rem"
|
||||
ObjFactura.TipoDocumento = "Remision"
|
||||
Case "Cot"
|
||||
ObjFactura.TipoDocumento = "Cotizacion"
|
||||
Case "Egs"
|
||||
ObjFactura.TipoDocumento = "Nota de Crédito"
|
||||
Case "Dev"
|
||||
ObjFactura.TipoDocumento = "Nota de Devolución"
|
||||
Case Else
|
||||
ObjFactura.TipoDocumento = ""
|
||||
End Select
|
||||
|
||||
|
||||
ObjFactura.Fech1 = Now
|
||||
ObjFactura.Fech2 = Now
|
||||
ObjFactura.Fech3 = Now
|
||||
ObjFactura.Alfa1 = ""
|
||||
ObjFactura.Alfa2 = ""
|
||||
ObjFactura.Alfa3 = ""
|
||||
ObjFactura.Num1 = 0
|
||||
ObjFactura.Num2 = 0
|
||||
ObjFactura.Num3 = DdlOrdenPago.SelectedValue.ToDouble
|
||||
ObjFactura.FechaPago = TxtFechaPago.Text.ToDate
|
||||
|
||||
ObjFactura.CveCorte = CveCorte
|
||||
ObjFactura.CveMesa = -1
|
||||
ObjFactura.NumeroPersonas = 0
|
||||
ObjFactura.CveContrato = If(CveContrato > 0, CveContrato, CvePresupuesto)
|
||||
ObjFactura.CveClienteSucursal = DdlSucursalCliente.SelectedValue.ToEntero
|
||||
ObjFactura.Entrega = Entrega
|
||||
ObjFactura.Vigencia = Now
|
||||
|
||||
ObjFactura.CveVentaPadre = If(CveDevolucion > 0, CveDevolucion, CvePedido)
|
||||
ObjFactura.CveVendedor = DdlVendedor.SelectedValue.ToEntero
|
||||
If DdlVendedor.SelectedValue.ToEntero > 0 AndAlso Not UsuarioActual.TienePermisoProceso(161) Then
|
||||
DdlVendedor.Enabled = False
|
||||
End If
|
||||
|
||||
ObjFactura.FechaEjecucion = Now
|
||||
|
||||
ObjFactura.CveSucursalEjecucion = DdlSubProyectoDatos.SelectedValue.ToEntero
|
||||
ObjFactura.CveSucursalCobranza = -1
|
||||
|
||||
ObjFactura.CveSubProyecto = DdlSubProyectoDatos.SelectedValue.ToEntero
|
||||
ObjFactura.CveSubProyectoEjecucion = DdlSubProyectoDatos.SelectedValue.ToEntero
|
||||
ObjFactura.CveSubProyectoCobranza = -1
|
||||
|
||||
ObjFactura.AtencionA = If(ObjFactura.TipoDocto = "Cot", TxtAtencionA.Text, "-1")
|
||||
ObjFactura.MotivoDescuento = TxtMotivoDescuento.Text.Trim
|
||||
ObjFactura.Observaciones = TxtObsFact.Text.Trim
|
||||
ObjFactura.Det_OrdenCompra = ""
|
||||
ObjFactura.Det_FechaOrdenCompra = MinFecha.ToShortDateString
|
||||
ObjFactura.MonedaAbreviatura = ""
|
||||
|
||||
'Totales, Y se llena TmpDTImpuestos
|
||||
ObjFactura.SubTotal = TxtSubTotal.Text.ToDecimal
|
||||
ObjFactura.Descuento = LblDescuentos.Text.Trim.ToDecimal
|
||||
ObjFactura.Amortizacion = LblAmortizacion.Text.Trim.ToDecimal
|
||||
ObjFactura.IVA = TxtIVA.Text.ToDecimal
|
||||
ObjFactura.RetIVA = TxtRetIVA.Text.ToDecimal
|
||||
ObjFactura.RetISR = TxtRetISR.Text.ToDecimal
|
||||
ObjFactura.IEPS = TxtIEPS.Text.ToDecimal
|
||||
ObjFactura.Total = TxtTotal.Text.ToDecimal
|
||||
|
||||
ObjFactura.DtDeduccion = New DataTable
|
||||
|
||||
'OTROS
|
||||
ObjFactura.Det_FechaOrdenCompra = ""
|
||||
ObjFactura.Det_OrdenCompra = ""
|
||||
|
||||
ObjFactura.CveNCaVincular = DdlNCFactura.SelectedValue.ToEntero
|
||||
|
||||
If ObjFactura.CveMoneda <> 1 AndAlso ChkConvertirDoctoPesos.Checked Then
|
||||
ObjFactura.TipoCambio = TxtTipoCambio.Text.Trim.ToDecimal
|
||||
ObjFactura.CveMoneda = 1
|
||||
|
||||
ObjFactura.Moneda = "Pesos"
|
||||
ObjFactura.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {ObjFactura.CveMoneda}")
|
||||
End If
|
||||
|
||||
If ObjFactura.CveMoneda <> 2 AndAlso ChkConvertirDolares.Checked Then
|
||||
ObjFactura.TipoCambio = TxtTipoCambioDlls.Text.Trim.ToDecimal
|
||||
ObjFactura.CveMoneda = 2
|
||||
|
||||
ObjFactura.Moneda = "Dólares"
|
||||
ObjFactura.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {ObjFactura.CveMoneda}")
|
||||
End If
|
||||
|
||||
'Se agrega CveVenta -1
|
||||
For Each Row As DataRow In TmpDT.Rows
|
||||
Row("CveVenta") = ObjFactura.CveVenta
|
||||
Next
|
||||
|
||||
DtInv.AcceptChanges()
|
||||
|
||||
ObjFactura.DtInventario = DtInv.FiltraParametros("Seleccionado = 1")
|
||||
End If
|
||||
'DETALLES
|
||||
ObjFactura.DtDetalle = TmpDT
|
||||
ObjFactura.DtFirmas = DTmpF
|
||||
|
||||
ObjFactura.ServicioDomicilio = ChkServicioDomicilio.Checked
|
||||
'CLIENTE
|
||||
ObjFactura.CveCliente = CveCliente
|
||||
ObjFactura.SetCliente()
|
||||
|
||||
'VALIDA ENTREGA POR ADELANTADO
|
||||
If UsuarioActual.Empresa.Funcionalidad(145) = "1" Then
|
||||
'INCRUSTAMOS ALMACEN ENTREGA POR ADELANTADO CUANDO SEA REMISION Y NO TRAIGA ASIGNADO POR EL USUARIO
|
||||
If ObjFactura.CveAlmacenTraspasoDestino <= 0 And ObjFactura.TipoDocto = "Rem" Then
|
||||
If ObjFactura.ServicioDomicilio Then
|
||||
ObjFactura.CveAlmacenServicioDomicilio = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveTipoAlmacen = 29 AND CveSubProyecto = {DdlSubProyectoDatos.SelectedValue}").ToString.ToEntero
|
||||
ObjFactura.DtInventario = TmpDT.Copy.FiltraParametros("CveTipoPS = 2")
|
||||
'SUCURSAL
|
||||
ObjFactura.CveSucursal = DdlSubProyectoDatos.SelectedValue.ToEntero
|
||||
ObjFactura.SetSubProyectoMatriz(Me)
|
||||
ObjFactura.SetSubProyecto(Me)
|
||||
ObjFactura.ClienteSucursal = New Modelos.SucursalModel
|
||||
ObjFactura.ClienteSucursal.NoExt = CliNoExt
|
||||
ObjFactura.ClienteSucursal.NoInt = CliNoInt
|
||||
ObjFactura.ClienteSucursal.Localidad = CliLocalidad
|
||||
ObjFactura.ClienteSucursal.Direccion = LblDireccion.Text
|
||||
ObjFactura.ClienteSucursal.Colonia = LblColonia.Text
|
||||
ObjFactura.ClienteSucursal.Municipio = LblCiudad.Text
|
||||
ObjFactura.ClienteSucursal.Estado = LblEstado.Text
|
||||
ObjFactura.ClienteSucursal.CP = LblCP.Text
|
||||
ObjFactura.ClienteSucursal.Pais = CliPais
|
||||
ObjFactura.ClienteSucursal.CorreoSucursal = CliCorreoCot.ToString
|
||||
ObjFactura.ClienteSucursal.TelefonoSucursal = LblTelefono.Text
|
||||
ObjFactura.ClienteSucursal.Sucursal = DdlSucursalCliente.SelectedItem.Text
|
||||
|
||||
ObjFactura.DtDetalle = TmpDT
|
||||
ObjFactura.DtPagos = DtPagos
|
||||
ObjFactura.DtPromociones = DtPromociones
|
||||
|
||||
Dim FM As New Modelos.FemsaFactura
|
||||
Dim TmpDT7Eleven As New DataTable
|
||||
Dim TmpDTComplementosTimbrado As New DataTable
|
||||
|
||||
PrepararTimbrado(FM, TmpDT7Eleven, TmpDTComplementosTimbrado)
|
||||
|
||||
ObjFactura.FemsaFactura = FM
|
||||
|
||||
ObjFactura.Timbre = PreParaTimbre(ObjFactura)
|
||||
|
||||
ObjFactura.DtAjustes = TmpDTAjustes
|
||||
|
||||
ObjFactura.DtRecepcionUsados = TmpDTRecepcionUsados
|
||||
|
||||
ObjFactura.DtPolizasVirtuales = TmpDTPolizaVirtual
|
||||
|
||||
ObjFactura.GenerarPDFFactura = False
|
||||
|
||||
Dim CveTipoAlmacen As Integer = If(TmpDTAjustes IsNot Nothing AndAlso TmpDTAjustes.Rows.Count > 0, 6, 22)
|
||||
If GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros($"CveTipoAlmacen = {CveTipoAlmacen} AND CveSubProyecto= {DdlSubProyectoDatos.SelectedValue}").Rows.Count > 0 Then
|
||||
ObjFactura.CveAlmacenRecepcionUsados = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros($"CveTipoAlmacen = {CveTipoAlmacen} AND CveSubProyecto= {DdlSubProyectoDatos.SelectedValue}").Rows(0)("CveAlmacen").ToString.ToEntero
|
||||
End If
|
||||
|
||||
'If Not ddlAlmacen.SelectedValue.ToEntero > 0 AndAlso ddlAlmacen.Items.Count > 1 AndAlso UsuarioActual.Empresa.Funcionalidad(531).ToString = "1" Then
|
||||
' ddlAlmacen.SelectedIndex = 1
|
||||
'End If
|
||||
|
||||
If ddlAlmacen.SelectedValue.ToEntero > 0 Then
|
||||
ObjFactura.CveAlmacen = ddlAlmacen.SelectedValue.ToEntero
|
||||
|
||||
If Not DtInv.Columns.Contains("Seleccionado") Then
|
||||
DtInv.Columns.Add("Seleccionado", GetType(Integer))
|
||||
End If
|
||||
|
||||
ObjFactura.CveAlmacenTraspasoDestino = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveTipoAlmacen = 10 AND CveSubProyecto = {DdlSubProyectoDatos.SelectedValue}").ToString.ToEntero
|
||||
For Each Gvr As GridViewRow In GvInv.Rows
|
||||
Dim Dr As DataRow = DtInv.Select($"CvePS={Gvr.DataKey("CvePS")}")(0)
|
||||
If Gvr.FCCheckBox("cbInv").Checked AndAlso ddlAlmacen.SelectedValue.ToEntero > 0 Then
|
||||
Dr("Seleccionado") = 1
|
||||
Else
|
||||
Dr("Seleccionado") = 0
|
||||
End If
|
||||
Next
|
||||
|
||||
DtInv.AcceptChanges()
|
||||
|
||||
ObjFactura.DtInventario = DtInv.FiltraParametros("Seleccionado = 1")
|
||||
End If
|
||||
|
||||
'SI LA SUCURSAL NO TIENE ENTREGA POR ADELANTADO
|
||||
If ObjFactura.CveAlmacenTraspasoDestino <= 0 And ObjFactura.TipoDocto = "Rem" Then
|
||||
ObjFactura.ErrorList.Add("Ocurrió un error al seleccionar el almacen de entrega por adelantado de la sucursal.")
|
||||
ObjFactura.ServicioDomicilio = ChkServicioDomicilio.Checked
|
||||
|
||||
'VALIDA ENTREGA POR ADELANTADO
|
||||
If UsuarioActual.Empresa.Funcionalidad(145) = "1" Then
|
||||
'INCRUSTAMOS ALMACEN ENTREGA POR ADELANTADO CUANDO SEA REMISION Y NO TRAIGA ASIGNADO POR EL USUARIO
|
||||
If ObjFactura.CveAlmacenTraspasoDestino <= 0 And ObjFactura.TipoDocto = "Rem" Then
|
||||
If ObjFactura.ServicioDomicilio Then
|
||||
ObjFactura.CveAlmacenServicioDomicilio = ddlAlmacen.SelectedValue.ToEntero() 'GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveTipoAlmacen = 29 AND CveSubProyecto = {DdlSubProyectoDatos.SelectedValue}").ToString.ToEntero
|
||||
|
||||
'PREPARA DT INVENTARIO
|
||||
Dim DtInv = TmpDT.Copy.FiltraParametros("CveTipoPS = 2")
|
||||
For Each GvRow As GridViewRow In GvInv.Rows
|
||||
If GvRow.RowType = DataControlRowType.DataRow Then
|
||||
Dim filtro = DtInv.Select(String.Format("CvePS = {0} AND Consec = {1}", GvRow.DataKey("CvePS"), GvRow.DataKey("Consec")))
|
||||
If filtro IsNot Nothing AndAlso filtro.Length > 0 Then
|
||||
Dim Row = filtro(0)
|
||||
Row("Serie") = GvRow.FCTextBox("TxtSerie").Text.Trim
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
ObjFactura.DtInventario = DtInv
|
||||
End If
|
||||
|
||||
ObjFactura.CveAlmacenTraspasoDestino = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveTipoAlmacen = 10 AND CveSubProyecto = {DdlSubProyectoDatos.SelectedValue}").ToString.ToEntero
|
||||
|
||||
End If
|
||||
|
||||
'SI LA SUCURSAL NO TIENE ENTREGA POR ADELANTADO
|
||||
If ObjFactura.CveAlmacenTraspasoDestino <= 0 And ObjFactura.TipoDocto = "Rem" Then
|
||||
ObjFactura.ErrorList.Add("Ocurrió un error al seleccionar el almacen de entrega por adelantado de la sucursal.")
|
||||
End If
|
||||
|
||||
'SI LA SUCURSAL NO TIENE SERVICIO A DOMICILIO
|
||||
If ObjFactura.ServicioDomicilio AndAlso ObjFactura.CveAlmacenServicioDomicilio <= 0 And ObjFactura.TipoDocto = "Rem" Then
|
||||
ObjFactura.ErrorList.Add("No existe un almacen configurado como 'Servicio a Domicilio' en esta sucursal.")
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
'SI LA SUCURSAL NO TIENE SERVICIO A DOMICILIO
|
||||
If ObjFactura.ServicioDomicilio AndAlso ObjFactura.CveAlmacenServicioDomicilio <= 0 And ObjFactura.TipoDocto = "Rem" Then
|
||||
ObjFactura.ErrorList.Add("No existe un almacen configurado como 'Servicio a Domicilio' en esta sucursal.")
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al generar la venta", ex)
|
||||
If ObjFactura IsNot Nothing Then
|
||||
ObjFactura.Dispose()
|
||||
ObjFactura = Nothing
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
@@ -4133,6 +4173,8 @@ Partial Class PV
|
||||
CambiaSucursal()
|
||||
End If
|
||||
ObjSubProyectos.Dispose()
|
||||
|
||||
ChkServicioDomicilio_CheckedChanged(ChkServicioDomicilio, EventArgs.Empty)
|
||||
End Sub
|
||||
Protected Sub DdlTipoComprobante_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlTipoComprobante.SelectedIndexChanged
|
||||
CambiaTipoComprobante()
|
||||
@@ -4310,6 +4352,8 @@ Partial Class PV
|
||||
TmpDT.Columns.Add("EliminarDB", GetType(Boolean))
|
||||
TmpDT.Columns("EliminarDB").DefaultValue = False
|
||||
|
||||
TmpDT.Columns.Add("AplicaSerie", GetType(Boolean))
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CreaDTmpC()
|
||||
@@ -4346,6 +4390,8 @@ Partial Class PV
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim AplicaSerie = CBool(GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("AplicaSerie"))
|
||||
|
||||
If TmpDT.FiltraParametros("AsientoContableVentas <> '" & AsientoContableVentas.ToString & "'").Rows.Count = 0 Then
|
||||
Dim Row As DataRow = Nothing
|
||||
Row = TmpDT.NewRow()
|
||||
@@ -4380,6 +4426,7 @@ Partial Class PV
|
||||
Row("SubProyecto") = SubProyecto
|
||||
Row("Serie") = Serie
|
||||
Row("TiempoEntrega") = TiempoEntrega
|
||||
Row("AplicaSerie") = AplicaSerie
|
||||
|
||||
TmpDT.Rows.Add(Row)
|
||||
GvPS.DataSource = TmpDT.FiltraParametros("EliminarDB = False")
|
||||
@@ -4596,6 +4643,7 @@ Partial Class PV
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
TotalCalculableImpuestos = (Cantidad * (PU)) - Descuento
|
||||
|
||||
If Modalidad = "A" Then
|
||||
@@ -4671,6 +4719,7 @@ Partial Class PV
|
||||
Row("CveVentaDetallePedido2") = CveVentaDetallePedido2
|
||||
Row("CuentaPredial") = CuentaPredial
|
||||
Row("EsCargo") = EsCargo
|
||||
Row("AplicaSerie") = DrPS("AplicaSerie")
|
||||
|
||||
If EsCargo AndAlso ConsecPSPadre >= 0 Then
|
||||
Row("ConsecPSPadre") = ConsecPSPadre
|
||||
@@ -5036,6 +5085,8 @@ Partial Class PV
|
||||
End If
|
||||
End If
|
||||
Me.CveVentaDetalle = -1
|
||||
|
||||
UpAgregar.Update()
|
||||
End Sub
|
||||
Private Function AgregarPS() As Boolean
|
||||
Dim CveVentaDetalle As Integer = Me.CveVentaDetalle
|
||||
@@ -5278,6 +5329,8 @@ Partial Class PV
|
||||
DtInv = TmpDT.Copy.FiltraParametros("CveTipoPS = 2")
|
||||
CargaGVInv(DtInv)
|
||||
|
||||
ChkServicioDomicilio_CheckedChanged(ChkServicioDomicilio, EventArgs.Empty)
|
||||
|
||||
UpContado.Update()
|
||||
UpPS.Update()
|
||||
RegistraScript("BorraDescuentos();", "BorraDescuentos")
|
||||
@@ -5864,24 +5917,23 @@ Partial Class PV
|
||||
|
||||
Dim Index = Row.RowIndex
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
Dim Existencia = ObjInventarios.GetExistenciasPSSerie("", ddlAlmacen.SelectedValue.ToEntero, UsuarioActual.CveEmpresa)
|
||||
Dim ExistenciaActual = DtInv.SUM("Cantidad", String.Format("Serie = '{0}'", Row.FCTextBox("TxtSerie").Text.ToString))
|
||||
Dim Existencia = ObjInventarios.GetExistenciasPSSerie(Row.FCTextBox("TxtSerie").Text.ToString.Trim, ddlAlmacen.SelectedValue.ToEntero, UsuarioActual.CveEmpresa)
|
||||
ObjInventarios.Dispose()
|
||||
|
||||
'Valida Existencia
|
||||
If Existencia - ExistenciaActual <= 0 Then
|
||||
If Existencia <= 0 Then
|
||||
Alert(String.Format("Not hay existencia suficiente del producto con la Serie: <b>{0}</b>. Por favor rectifique y vuelva a intentar", Row.FCTextBox("TxtSerie").Text.ToString), TipoMensaje.MsgAdvertencia)
|
||||
Row.FCTextBox("TxtSerie").Text = ""
|
||||
Row.FCHiddenField("HdnSerie").Value = ""
|
||||
TmpDT.Rows(Index)("Serie") = ""
|
||||
DtInv.Rows(Index)("Serie") = ""
|
||||
Else
|
||||
Row.FCHiddenField("HdnSerie").Value = Row.FCTextBox("TxtSerie").Text
|
||||
TmpDT.Rows(Index)("Serie") = Row.FCTextBox("TxtSerie").Text
|
||||
DtInv.Rows(Index)("Serie") = Row.FCTextBox("TxtSerie").Text
|
||||
End If
|
||||
|
||||
TmpDT.AcceptChanges()
|
||||
DtInv = TmpDT.Copy.FiltraParametros("CveTipoPS = 2")
|
||||
DtInv.AcceptChanges()
|
||||
|
||||
|
||||
ObjInventarios.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Function ValidaSerieINV() As Boolean
|
||||
@@ -6716,10 +6768,19 @@ Partial Class PV
|
||||
|
||||
TxtPUFactura.Text = PrecioSugerido.FormatoNumero(2)
|
||||
|
||||
DdlBCIAjuste.Items.Clear()
|
||||
If DTBCIUsados IsNot Nothing AndAlso CveTamanio > 0 Then
|
||||
DdlBCIAjuste.Items.Clear()
|
||||
DdlBCIAjuste.DataSource = DTBCIUsados.FiltraParametros($"CveTamaño={CveTamanio}")
|
||||
DdlBCIAjuste.DataBind()
|
||||
DdlBCIAjuste.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
RFVAnio.Enabled = True
|
||||
If CveTamanio = 16 Then 'motobaterias
|
||||
DdlBCIAjuste.Items.Insert(0, New ListItem(" - ", "0"))
|
||||
RFVAnio.Enabled = False
|
||||
End If
|
||||
UPPDatosUsado.Update() ''refresca el RFV
|
||||
Else
|
||||
DdlBCIAjuste.Items.Insert(0, New ListItem(" - ", "0"))
|
||||
End If
|
||||
|
||||
DdlTipoUso.Items.Clear()
|
||||
@@ -7804,11 +7865,49 @@ Partial Class PV
|
||||
Response.Redirect($"~/Ventas/PV.aspx")
|
||||
End Sub
|
||||
Protected Sub DdlRecepcionUsados_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
Dim DrTamanio As DataRow = GlobalDTAcumTamaños.FiltroPrimero($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CvePSCargo = {DdlRecepcionUsados.SelectedValue}")
|
||||
|
||||
DdlBCIUsado.DataSource = DTBCIUsados.FiltraParametros(String.Format("CveTamaño = {0}", DrTamanio("CveTamaño")))
|
||||
If DdlRecepcionUsados.SelectedValue.ToEntero() > 0 Then
|
||||
Dim DrTamanio As DataRow = GlobalDTAcumTamaños.FiltroPrimero($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CvePSCargo = {DdlRecepcionUsados.SelectedValue}")
|
||||
DdlBCIUsado.DataSource = DTBCIUsados.FiltraParametros(String.Format("CveTamaño = {0}", DrTamanio("CveTamaño")))
|
||||
Else
|
||||
DdlBCIUsado.Items.Clear()
|
||||
DdlBCIUsado.DataSource = Nothing
|
||||
End If
|
||||
DdlBCIUsado.DataBind()
|
||||
|
||||
UpModalVenta.Update()
|
||||
UpAddVenta.Update()
|
||||
End Sub
|
||||
Protected Sub ChkServicioDomicilio_CheckedChanged(sender As Object, e As EventArgs)
|
||||
If ChkServicioDomicilio.Checked Then
|
||||
PreparaServicioDomicilio()
|
||||
Else
|
||||
ddlAlmacen.Items.Clear()
|
||||
ddlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyectoDatos.SelectedValue.ToEntero}")
|
||||
ddlAlmacen.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
|
||||
ddlAlmacen.DataBind()
|
||||
If GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyectoDatos.SelectedValue.ToEntero}").Rows.Count > 0 Then
|
||||
ddlAlmacen.SelectedValueExist(UsuarioActual.CveAlmacen)
|
||||
End If
|
||||
|
||||
For Each GvRow As GridViewRow In GvInv.Rows
|
||||
If GvRow.RowType = DataControlRowType.DataRow Then
|
||||
GvRow.FCCheckBox("cbInv").Enabled = True
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
UpINV.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub PreparaServicioDomicilio()
|
||||
ddlAlmacen.Items.Clear()
|
||||
ddlAlmacen.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveTipoAlmacen:=29).FiltraParametros($"CveSubProyecto = {DdlSubProyectoDatos.SelectedValue}")
|
||||
ddlAlmacen.DataBind()
|
||||
|
||||
For Each GvRow As GridViewRow In GvInv.Rows
|
||||
If GvRow.RowType = DataControlRowType.DataRow Then
|
||||
GvRow.FCCheckBox("cbInv").Checked = True
|
||||
GvRow.FCCheckBox("cbInv").Enabled = False
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@@ -183,8 +183,8 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div id="DivFacturas" style="overflow-y: auto; width: 760px; max-height: 215px;">
|
||||
<asp:GridView ID="GV" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron registros" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" Style="text-align: center;" GridLines="None">
|
||||
<div id="DivFacturas" style="overflow-y: auto; width: 760px; max-height: 165px;">
|
||||
<asp:GridView ID="GV" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron registros" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Tipo</HeaderTemplate>
|
||||
@@ -210,30 +210,36 @@
|
||||
<asp:Literal ID="LtlNombre" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Pedido/OC</HeaderTemplate>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Sucursal</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlPedidoContrato" runat="server"></asp:Literal>
|
||||
<asp:Literal ID="LtlSucursal" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Total</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlTotal" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Sucursal</HeaderTemplate>
|
||||
<HeaderTemplate>Mon</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlSucursal" runat="server"></asp:Literal>
|
||||
<asp:Literal ID="LtlMon" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Estatus</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEstatus" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Pedido/OC</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlPedidoContrato" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>XML</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
|
||||
@@ -151,19 +151,10 @@ Partial Class PopUpBuscarFolio
|
||||
|
||||
Protected Sub GV_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GV.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
'If e.Row.RowIndex = 0 Then
|
||||
' e.Row.Cells(0).Width = Unit.Pixel(38)
|
||||
' e.Row.Cells(1).Width = Unit.Pixel(65)
|
||||
' e.Row.Cells(2).Width = Unit.Pixel(70)
|
||||
' e.Row.Cells(3).Width = Unit.Pixel(250)
|
||||
' 'e.Row.Cells(4).Width = Unit.Pixel(75)
|
||||
' e.Row.Cells(4).Width = Unit.Pixel(75)
|
||||
' e.Row.Cells(5).Width = Unit.Pixel(100)
|
||||
' e.Row.Cells(6).Width = Unit.Pixel(100)
|
||||
'End If
|
||||
|
||||
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Left
|
||||
'e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Right
|
||||
|
||||
Dim Liga As String = String.Format("<a class='Texto' href='javascript:Ir(""{0}"");'>", e.Row.DBCampo("CveVenta"))
|
||||
If UsuarioActual.CveEmpresa = 140 AndAlso e.Row.DBCampo("TipoDocto").Contiene("Rem") Then
|
||||
@@ -171,11 +162,12 @@ Partial Class PopUpBuscarFolio
|
||||
End If
|
||||
|
||||
e.Row.FCLiteral("LtlTipo").Text = String.Format("<div class='truncate' style='width:27px;'>{0}{1}</a></div>", Liga, e.Row.DBCampo("TipoDocto"))
|
||||
e.Row.FCLiteral("LtlFolio").Text = String.Format("<div class='truncate' style='width:56px;'>{0}{1}</a></div>", Liga, e.Row.DBCampo("Folio"))
|
||||
e.Row.FCLiteral("LtlFolio").Text = String.Format("<div class='truncate' style='width:95px;'>{0}{1}</a></div>", Liga, e.Row.DBCampo("Folio"))
|
||||
e.Row.FCLiteral("LtlFecha").Text = String.Format("<div class='truncate' style='width:64px;'>{0}{1}</a></div>", Liga, e.Row.DBCampo("Fecha").ToDate.ToShortDateString)
|
||||
e.Row.FCLiteral("LtlNombre").Text = String.Format("<div class='truncate' style='width:200px;'>{0}{1}</a></div>", Liga, e.Row.DBCampo("Nombre"))
|
||||
'e.Row.FCLiteral("LtlSubTotal").Text = Liga & e.Row.DBCampo("SubTotal").FormatoNumero & " </a>"
|
||||
e.Row.FCLiteral("LtlTotal").Text = String.Format("<div class='truncate' style='width:56px;'>{0}{1}</a></div>", Liga, e.Row.DBCampo("Total").FormatoNumero)
|
||||
e.Row.FCLiteral("LtlMon").Text = String.Format("<div class='truncate' style='width:30px;'>{0}{1}</a></div>", Liga, e.Row.DBCampo("Abreviatura"))
|
||||
e.Row.FCLiteral("LtlSucursal").Text = String.Format("<div class='truncate' style='width:80px;'>{0}{1}</a></div>", Liga, e.Row.DBCampo("SubProyecto"))
|
||||
e.Row.FCLiteral("LtlEstatus").Text = String.Format("<div class='truncate' style='width:80px;'>{0}{1}</a></div>", Liga, e.Row.DBCampo("EstatusFactura"))
|
||||
e.Row.FCLiteral("LtlPedidoContrato").Text = String.Format("<div class='truncate' style='width:80px;'>{0}{1}</a></div>", Liga, e.Row.DBCampo("PedidoContrato"))
|
||||
|
||||
@@ -65,12 +65,10 @@ Partial Class Ventas_RepAuxiliarFacturas
|
||||
End Sub
|
||||
|
||||
#Region "C A R G A - C O M B O S"
|
||||
Private Sub CargaClientes()
|
||||
DdlClientes.ddl.Items.Clear()
|
||||
DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
|
||||
DdlClientes.DataBind()
|
||||
DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
'Private Sub CargaClientes()
|
||||
|
||||
' DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
'End Sub
|
||||
|
||||
Protected Sub DdlTipoComprobante_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
DdlEstatus.Items.Clear()
|
||||
@@ -139,7 +137,7 @@ Partial Class Ventas_RepAuxiliarFacturas
|
||||
|
||||
Private Sub CargaCombos()
|
||||
'Cargo Clientes
|
||||
CargaClientes()
|
||||
'CargaClientes()
|
||||
|
||||
'Cargo Proyectos
|
||||
DdlProyecto.DataSource = GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1)
|
||||
|
||||
@@ -130,12 +130,15 @@
|
||||
</ADS:Dropdownlost>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1">Contrato: </label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList CssClass="table-group-action-input form-control input-inline input-small input-sm select2me" ID="DdlContrato" DataTextField="ContratoCompleto" DataValueField="CveContrato" runat="server">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1 ">Vendedor:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:ListBox ID="DdlVendedor" SelectionMode="Multiple" data-text="Todos" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" CssClass="ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server"></asp:ListBox>
|
||||
<%-- <asp:DropDownList ID="DdlVendedor" runat="server" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>--%>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -188,13 +191,13 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1 ">Vendedor:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:ListBox ID="DdlVendedor" SelectionMode="Multiple" data-text="Todos" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" CssClass="ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server"></asp:ListBox>
|
||||
<%-- <asp:DropDownList ID="DdlVendedor" runat="server" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>--%>
|
||||
</div>
|
||||
<label class="col-md-1">Contrato: </label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList CssClass="table-group-action-input form-control input-inline input-small input-sm select2me" ID="DdlContrato" DataTextField="ContratoCompleto" DataValueField="CveContrato" runat="server">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -232,7 +235,7 @@
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
<asp:Label Text="Fecha Vencimiento" runat="server" CausesValidation="false"> </asp:Label>
|
||||
<asp:Label Text="F. Vencimiento" runat="server" CausesValidation="false"> </asp:Label>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFechaVencimiento" runat="server" Text='<%# Eval("FechaVencimiento", "{0:d}") %>'></asp:Literal>
|
||||
@@ -287,7 +290,7 @@
|
||||
<asp:Literal ID="LtlIVA" runat="server" Text='<%# Eval("IVA", "{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="10%" >
|
||||
<HeaderTemplate>
|
||||
<asp:Label Text="Total" runat="server" CausesValidation="false"> </asp:Label>
|
||||
</HeaderTemplate>
|
||||
|
||||
@@ -66,7 +66,7 @@ Partial Class Ventas_RepVentasUtilidad
|
||||
'Cargo categorias
|
||||
DdlCategoria.DataSource = GlobalDTGralCategorias(UsuarioActual.CveEmpresa)
|
||||
DdlCategoria.DataBind()
|
||||
|
||||
DdlCategoria.Items.Insert(0, New ListItem("Todas", "-1"))
|
||||
|
||||
'Cargo Clasificaciones
|
||||
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
|
||||
@@ -164,7 +164,7 @@ Partial Class Ventas_RepVentasUtilidad
|
||||
Dim Sucursales As String = IIf(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM).ToString
|
||||
Dim Vendedores As String = IIf(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM).ToString
|
||||
|
||||
If ObjVentas.GetReporteVentasUtilidad(Vendedores, DdlClientes.SelectedValue.ToEntero, Sucursales, FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, DdlCategoria.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, DdlMarcas.SelectedValue.ToEntero) Then
|
||||
If ObjVentas.GetReporteVentasUtilidad(Vendedores, DdlClientes.SelectedValue.ToEntero, Sucursales, FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, DdlCategoria.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, DdlMarcas.SelectedValue.ToEntero, -1) Then
|
||||
DtVentas = ObjVentas.DtResultados
|
||||
GvDatos.DataSource = ObjVentas.DtResultados
|
||||
GvDatos.DataBind()
|
||||
@@ -315,7 +315,7 @@ Partial Class Ventas_RepVentasUtilidad
|
||||
Dim Sucursales As String = IIf(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM).ToString
|
||||
Dim Vendedores As String = IIf(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM).ToString
|
||||
|
||||
If ObjVentas.GetReporteVentasUtilidad(Vendedores, DdlClientes.SelectedValue.ToEntero, Sucursales, FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, DdlCategoria.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, DdlMarcas.SelectedValue.ToEntero) Then
|
||||
If ObjVentas.GetReporteVentasUtilidad(Vendedores, DdlClientes.SelectedValue.ToEntero, Sucursales, FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, DdlCategoria.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, DdlMarcas.SelectedValue.ToEntero, -1) Then
|
||||
|
||||
Dim FechaInicio As String = txtFechaI.Text
|
||||
Dim FechaFin As String = txtFechaF.Text
|
||||
|
||||
@@ -178,7 +178,7 @@ Partial Class Ventas_RepVentasUtilidadDetalle
|
||||
Dim Vendedores As String = IIf(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM).ToString
|
||||
|
||||
If ObjVentas.GetReporteVentasUtilidadDetalle(Vendedores, If(CveVenta = -1, Orden, CveVenta), DdlClientes.SelectedValue.ToEntero, Sucursales,
|
||||
FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, DdlMarcas.SelectedValue.ToEntero) Then
|
||||
FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, -1, DdlClasificacion.SelectedValue.ToEntero, DdlMarcas.SelectedValue.ToEntero, -1) Then
|
||||
DtVentas = ObjVentas.DtResultados
|
||||
GvDatos.DataSource = ObjVentas.DtResultados
|
||||
GvDatos.DataBind()
|
||||
@@ -299,7 +299,7 @@ Partial Class Ventas_RepVentasUtilidadDetalle
|
||||
Dim Sucursales As String = IIf(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM).ToString
|
||||
Dim Vendedores As String = IIf(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM).ToString
|
||||
If ObjVentas.GetReporteVentasUtilidadDetalle(Vendedores, CveVenta, DdlClientes.SelectedValue.ToEntero, Sucursales,
|
||||
FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, ddlmarcas.selectedvalue.toentero) Then
|
||||
FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, -1, DdlClasificacion.SelectedValue.ToEntero, DdlMarcas.SelectedValue.ToEntero, -1) Then
|
||||
|
||||
Dim FechaInicio As String = txtFechaI.Text
|
||||
Dim FechaFin As String = txtFechaF.Text
|
||||
@@ -361,7 +361,7 @@ Partial Class Ventas_RepVentasUtilidadDetalle
|
||||
Dim Sucursales As String = IIf(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM).ToString
|
||||
Dim Vendedores As String = IIf(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM).ToString
|
||||
If ObjVentas.GetReporteVentasUtilidadDetalle(Vendedores, CveVenta, DdlClientes.SelectedValue.ToEntero, Sucursales,
|
||||
FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, DdlMarcas.SelectedValue.ToEntero) Then
|
||||
FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, -1, DdlClasificacion.SelectedValue.ToEntero, DdlMarcas.SelectedValue.ToEntero, -1) Then
|
||||
|
||||
Dim FechaInicio As String = txtFechaI.Text
|
||||
Dim FechaFin As String = txtFechaF.Text
|
||||
|
||||
@@ -178,6 +178,16 @@
|
||||
<div class="col-md-2">
|
||||
<asp:Dropdownlist runat="server" ID="DdlMarcas" CssStyle="width: 100%;" CssClass="form-control input-small input-sm select2me" Width="100%" DataTextField="Marca" DataValueField="CveMarca" />
|
||||
</div>
|
||||
<div class="col-md-1 truncate" id="divgarantia1" runat="server" visible="false">
|
||||
Garantía:
|
||||
</div>
|
||||
<div class="col-md-2" id="divgarantia2" runat="server" visible="false">
|
||||
<asp:Dropdownlist runat="server" ID="DdlGarantia" CssStyle="width: 100%;" CssClass="form-control input-small input-sm select2me" Width="100%">
|
||||
<asp:ListItem Text="Todos" Value="-1" Selected="True"></asp:ListItem>
|
||||
<asp:ListItem Text="Si" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="No" Value="0"></asp:ListItem>
|
||||
</asp:Dropdownlist>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -71,6 +71,7 @@ Partial Class Ventas_RepVentasUtilidadPadre
|
||||
'Cargo categorias
|
||||
DdlCategoria.DataSource = GlobalDTGralCategorias(UsuarioActual.CveEmpresa)
|
||||
DdlCategoria.DataBind()
|
||||
DdlCategoria.Items.Insert(0, New ListItem("Todas", "-1"))
|
||||
|
||||
'Cargo Clasificaciones
|
||||
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
|
||||
@@ -90,6 +91,12 @@ Partial Class Ventas_RepVentasUtilidadPadre
|
||||
DdlPS.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End If
|
||||
|
||||
'garantia
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
divgarantia1.visible = True
|
||||
divgarantia2.visible = True
|
||||
End If
|
||||
|
||||
DdlMarcas.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa)
|
||||
DdlMarcas.DataBind()
|
||||
DdlMarcas.Items.Insert(0, New ListItem("Todas", "-1"))
|
||||
@@ -125,7 +132,7 @@ Partial Class Ventas_RepVentasUtilidadPadre
|
||||
If ObjVentas.GetReportePadreVentasUtilidad(If(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM), DdlClientesWS.SelectedValue.ToEntero,
|
||||
If(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM), txtFechaI.Text.ToDate, txtFechaF.Text.ToDate,
|
||||
UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, DdlPS.SelectedValue.ToEntero, DdlCategoria.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero,
|
||||
DdlMarcas.SelectedValue.ToEntero) Then
|
||||
DdlMarcas.SelectedValue.ToEntero, DdlGarantia.SelectedValue.ToEntero) Then
|
||||
GvDatos.DataSource = ObjVentas.DtResultados
|
||||
DtDatos = ObjVentas.DtResultados
|
||||
End If
|
||||
|
||||
@@ -3341,7 +3341,7 @@
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<asp:DropDownList ID="DdlCuentaEfectivo" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVCuenta" runat="server" ControlToValidate="DdlCuentaEfectivo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAgregarPago"></asp:RequiredFieldValidator>
|
||||
<asp:CustomValidator ID="RFVCuenta" runat="server" ClientValidationFunction="ValidaCuentaEfectivo" ControlToValidate="DdlCuentaEfectivo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAgregarPago"></asp:CustomValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOCuenta" runat="server" HighlightCssClass="vco" TargetControlID="RFVCuenta" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
@@ -3349,7 +3349,7 @@
|
||||
|
||||
<div class="chequesie1">
|
||||
<div class="row">
|
||||
<label class="col-md-2">Credito:</label>
|
||||
<label class="col-md-2">Crédito:</label>
|
||||
<div class="col-md-4 input-icon">
|
||||
<i style="margin: 0px;">$</i>
|
||||
<asp:TextBox ID="TxtImporteCredito" CssClass="form-control input-sm " runat="server" MaxLength="12" Width="100px" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox>
|
||||
@@ -3357,7 +3357,7 @@
|
||||
</div>
|
||||
<div class="col-md-6" runat="server" id="DivDdlCuentaTarjetaCredito" style="margin-right: -40px">
|
||||
<asp:DropDownList ID="DdlCuentaTarjetaCredito" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="DdlCuentaTarjetaCredito" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAgregarPago"></asp:RequiredFieldValidator>
|
||||
<asp:CustomValidator ID="RequiredFieldValidator1" runat="server" ClientValidationFunction="ValidaCuentaCredito" ControlToValidate="DdlCuentaTarjetaCredito" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAgregarPago"></asp:CustomValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender5" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator1" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<div class="col-md-3" runat="server" id="DivMesesSinIntereses" visible="false" style="text-align: right;">
|
||||
@@ -3377,7 +3377,7 @@
|
||||
|
||||
<div class="chequesie1">
|
||||
<div class="row">
|
||||
<label class="col-md-2">Debito:</label>
|
||||
<label class="col-md-2">Débito:</label>
|
||||
<div class="col-md-4 input-icon">
|
||||
<i style="margin: 0px;">$</i>
|
||||
<asp:TextBox ID="TxtImporteDebito" CssClass="form-control input-sm " runat="server" MaxLength="12" Width="100px" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox>
|
||||
@@ -3385,7 +3385,7 @@
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<asp:DropDownList ID="DdlCuentaTarjetaDebito" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="DdlCuentaTarjetaDebito" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAgregarPago"></asp:RequiredFieldValidator>
|
||||
<asp:CustomValidator ID="RequiredFieldValidator4" runat="server" ClientValidationFunction="ValidaCuentaDebito" ControlToValidate="DdlCuentaTarjetaDebito" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAgregarPago"></asp:CustomValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender9" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator4" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
@@ -3400,7 +3400,7 @@
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<asp:DropDownList ID="DdlCuentaCheque" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="DdlCuentaCheque" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAgregarPago"></asp:RequiredFieldValidator>
|
||||
<asp:CustomValidator ID="RequiredFieldValidator3" runat="server" ClientValidationFunction="ValidaCuentaCheque" ControlToValidate="DdlCuentaCheque" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAgregarPago"></asp:CustomValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender11" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator3" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
@@ -3416,7 +3416,7 @@
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<asp:DropDownList ID="DdlCuentaTransferencia" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVTransferencia" runat="server" ControlToValidate="DdlCuentaTransferencia" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAgregarPago"></asp:RequiredFieldValidator>
|
||||
<asp:CustomValidator ID="RFVTransferencia" runat="server" ClientValidationFunction="ValidaCuentaTransferencia" ControlToValidate="DdlCuentaTransferencia" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAgregarPago"></asp:CustomValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCETransferencia" runat="server" HighlightCssClass="vco" TargetControlID="RFVTransferencia" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
@@ -3480,6 +3480,8 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<asp:HiddenField ID="HdnCambioFaltante" runat="server" Value="1" ClientIDMode="Static" />
|
||||
<%--<asp:HiddenField ID="HdnPagadoContado" runat="server" Value="0" ClientIDMode="Static" />--%>
|
||||
</div>
|
||||
<label id="lblCambio" class="col-md-2">Cambio:</label>
|
||||
<div class="col-md-4 input-icon">
|
||||
@@ -7749,6 +7751,7 @@
|
||||
<asp:ListItem Value="1" Text="Importe"></asp:ListItem>
|
||||
<asp:ListItem Value="2" Text="Vencimiento"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVTipoAut" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlTipoAutorizacion" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo''</b> es necesario, por favor ingréselo." ValidationGroup="VgmGuardarAut"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlTipoAutorizacion.ClientID.ToString()%>">Tipo Autorización:</label>
|
||||
</div>
|
||||
<div id="DivDiasVencidos" runat="server" visible="false" class="row">
|
||||
@@ -7836,6 +7839,61 @@
|
||||
$("#BtnDirClienteValidar").click();
|
||||
}
|
||||
|
||||
function ValidaCuentaEfectivo(val, args) {
|
||||
//VALIDA SOLO SI EL IMPORTE ES MAYOR A CERO
|
||||
var totalPago = ToDouble($get("TxtImporteEfectivo").value);
|
||||
if (totalPago > 0) {
|
||||
args.IsValid = (ToDouble(args.Value) > 0);
|
||||
}else
|
||||
{
|
||||
args.IsValid = true;
|
||||
}
|
||||
}
|
||||
|
||||
function ValidaCuentaCredito(val, args) {
|
||||
//VALIDA SOLO SI EL IMPORTE ES MAYOR A CERO
|
||||
var totalPago = ToDouble($get("TxtImporteCredito").value);
|
||||
if (totalPago > 0) {
|
||||
args.IsValid = (ToDouble(args.Value) > 0);
|
||||
}else
|
||||
{
|
||||
args.IsValid = true;
|
||||
}
|
||||
}
|
||||
|
||||
function ValidaCuentaDebito(val, args) {
|
||||
//VALIDA SOLO SI EL IMPORTE ES MAYOR A CERO
|
||||
var totalPago = ToDouble($get("TxtImporteDebito").value);
|
||||
if (totalPago > 0) {
|
||||
args.IsValid = (ToDouble(args.Value) > 0);
|
||||
}else
|
||||
{
|
||||
args.IsValid = true;
|
||||
}
|
||||
}
|
||||
|
||||
function ValidaCuentaCheque(val, args) {
|
||||
//VALIDA SOLO SI EL IMPORTE ES MAYOR A CERO
|
||||
var totalPago = ToDouble($get("TxtImporteCheque").value);
|
||||
if (totalPago > 0) {
|
||||
args.IsValid = (ToDouble(args.Value) > 0);
|
||||
}else
|
||||
{
|
||||
args.IsValid = true;
|
||||
}
|
||||
}
|
||||
|
||||
function ValidaCuentaTransferencia(val, args) {
|
||||
//VALIDA SOLO SI EL IMPORTE ES MAYOR A CERO
|
||||
var totalPago = ToDouble($get("TxtImporteTransferencia").value);
|
||||
if (totalPago > 0) {
|
||||
args.IsValid = (ToDouble(args.Value) > 0);
|
||||
}else
|
||||
{
|
||||
args.IsValid = true;
|
||||
}
|
||||
}
|
||||
|
||||
//FUNCIONES PARA COMERCIO EXTERIOR
|
||||
function CalculaTotalUSD(TotalUSD, ValorUnitario, TxtCantidad) {
|
||||
TotalUSD.innerText = FormatoNumero(ToDouble(ValorUnitario.value) * ToDouble(TxtCantidad.value), 2);
|
||||
@@ -8868,14 +8926,16 @@
|
||||
} catch (e) { }
|
||||
|
||||
var total = totalEfectivo + totalCredito + totalDebito + totalCheque + totalTransferencia + TotalOtrosContado + totalRNC + totalAmortizado + totalProntoPago;
|
||||
var totalVenta = ToDouble($get('TxtTotal').value);
|
||||
var totalVenta = ToDouble($get('TxtTotal').value);// - ToDouble($get('HdnPagadoContado').value);
|
||||
|
||||
if (total > totalVenta) {
|
||||
lblCambio.innerHTML = "Cambio:"
|
||||
lblCambio.innerHTML = "Cambio:";
|
||||
HdnCambioFaltante.value = "1";
|
||||
$get("TxtCambio").value = FormatoNumero(total - totalVenta);
|
||||
} else {
|
||||
if ('<%= UsuarioActual.Empresa.Funcionalidad(531) %>' == '1') {
|
||||
lblCambio.innerHTML = "Faltante:"
|
||||
lblCambio.innerHTML = "Faltante:";
|
||||
HdnCambioFaltante.value = "2";
|
||||
$get("TxtCambio").value = FormatoNumero(total - totalVenta, 2);
|
||||
} else {
|
||||
$get("TxtCambio").value = "$0.00"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user