Merge branch 'master' of http://jperez@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -70,7 +70,7 @@
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveMeta,CveVendedor,CveMarca,CveClasificacion,CveClasificacionSup,Vendedor,MesAño,Marca,Clasificacion,MetaCantidad,MetaImporte" EmptyDataText="No se encontraron metas registradas" ToolTip="Listado de Metas Vendedor" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center; width: 100%" GridLines="None">
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveMeta,CveVendedor,CveMarca,CveClasificacion,CveClasificacionSup,Vendedor,MesAño,Marca,Clasificacion,MetaCantidad,MetaImporte" EmptyDataText="No se encontraron metas registradas" ToolTip="Listado de Metas Vendedor" CssClass="table table-striped table-advance table-hover" Style=" width: 100%" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Vendedor" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
@@ -122,7 +122,7 @@
|
||||
<ajax:ValidatorCalloutExtender ID="VCMesAño" runat="server" HighlightCssClass="vco" TargetControlID="RFVMesAño" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Meta Cantidad">
|
||||
<asp:TemplateField HeaderText="Meta" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlMetaCantidad" runat="server" Text='<%# Eval("MetaCantidad", "{0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
@@ -132,9 +132,9 @@
|
||||
<ajax:ValidatorCalloutExtender ID="VCMetaCantidad" runat="server" HighlightCssClass="vco" TargetControlID="RFVMetaCantidad" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Meta Importe">
|
||||
<asp:TemplateField HeaderText="$ Meta" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlMetaImporte" runat="server" Text='<%# Eval("MetaImporte", "{0}") %>'></asp:Literal>
|
||||
<asp:Literal ID="LtlMetaImporte" runat="server" Text='<%# Eval("MetaImporte", "{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtMetaImporte" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("MetaImporte") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>
|
||||
|
||||
@@ -15,6 +15,7 @@ Partial Class CatMetasVendedores
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
txtMesAnio.Text = Now.FirstDayOfMonth.ToShortDateString
|
||||
CargaDatosModal()
|
||||
CargaCombos()
|
||||
CargaDatos()
|
||||
@@ -87,7 +88,7 @@ Partial Class CatMetasVendedores
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If BtnAgregarMetaVendedor.Text = "Agregar" Then
|
||||
If ObjVentas.AddMetasVendedores(DdlVendedores.SelectedValue.ToEntero, TxtFechaI.Text, DdlMarcas.SelectedValue.ToEntero, TxtMetaCantidad.Text.ToEntero,
|
||||
TxtMetaImporte.Text.ToDecimal, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacionSup.SelectedValue.ToEntero) Then
|
||||
TxtMetaImporte.Text.ToDecimal, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacionSup.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
Alert("Se agregó la meta al vendedor")
|
||||
Else
|
||||
Alert("No se pudo agregar la meta al vendedor", TipoMensaje.MsgError)
|
||||
@@ -279,105 +280,75 @@ Partial Class CatMetasVendedores
|
||||
Dim ProductosNoCargados As New StringBuilder()
|
||||
Dim RowsCargados As Integer = 0
|
||||
Dim RowsNoCargados As Integer = 0
|
||||
Dim ObjMetas As New ClsVentas
|
||||
'ObjPS.IniciaTransacSQL()
|
||||
Dim ObjMetas As New ClsVentas
|
||||
Dim Correcto As Boolean = True
|
||||
ObjMetas.IniciaTransacSQL()
|
||||
Try
|
||||
Dim DtVendedores As DataTable = GlobalDTVendedores(UsuarioActual.CveEmpresa)
|
||||
Dim DtClasificaciones As DataTable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
|
||||
Dim DtClasificaciones2 As DataTable = GlobalDTClasificaciones2(UsuarioActual.CveEmpresa)
|
||||
|
||||
For Each row As DataRow In dt.Rows
|
||||
Dim Correcto As Boolean = False
|
||||
Dim TieneError As Boolean = False
|
||||
Dim CveVendedor As Integer = DtVendedores.FiltroPrimeroValor("CveVendedor", String.Format("Vendedor LIKE '%{0}%'", row("Vendedor").ToString().TrimStart().TrimEnd())).ToEntero
|
||||
Dim CveClasificacion As Integer = DtClasificaciones.FiltroPrimeroValor("CveClasificacion", String.Format("Clasificacion='{0}'", row("Clasificación Superior").ToString().TrimStart().TrimEnd())).ToEntero
|
||||
Dim CveClasificacion2 As Integer = DtClasificaciones2.FiltroPrimeroValor("CveClasificacion", String.Format("Clasificacion='{0}'", row("Clasificación").ToString().TrimStart().TrimEnd())).ToEntero
|
||||
Dim CveMarca As Integer = DtMarcas.FiltroPrimeroValor("CveMarca", String.Format("Marca='{0}'", row("Marca").ToString().TrimStart().TrimEnd())).ToEntero
|
||||
|
||||
Dim Mes As Decimal = row("Mes").ToString().ToDecimal()
|
||||
Dim Anio As Decimal = row("Año").ToString().ToDecimal()
|
||||
Dim Cantidad As Decimal = row("Cantidad").ToString().ToDecimal()
|
||||
Dim Importe As Decimal = row("Importe").ToString().ToDecimal()
|
||||
|
||||
Dim FechaRef As New DateTime(Anio, Mes, 1)
|
||||
If CveVendedor > 0 AndAlso CveVendedor > 0 AndAlso CveClasificacion > 0 AndAlso CveClasificacion2 > 0 AndAlso CveMarca > 0 Then
|
||||
Correcto = ObjMetas.AddMetasVendedores(CveVendedor, FechaRef, CveMarca, Cantidad, Importe, CveClasificacion2, CveClasificacion)
|
||||
If Correcto Then
|
||||
RowsCargados += 1
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not Correcto Then
|
||||
RowsNoCargados += 1
|
||||
End If
|
||||
Dim DtClasificaciones2 As DataTable = GlobalDTClasificaciones2(UsuarioActual.CveEmpresa)
|
||||
|
||||
|
||||
For Each row As DataRow In dt.Rows
|
||||
|
||||
If Correcto Then
|
||||
Dim TieneError As Boolean = False
|
||||
Dim CveVendedor As Integer = DtVendedores.FiltroPrimeroValor("CveVendedor", String.Format("trim(Vendedor) LIKE '%{0}%'", row("Vendedor").ToString().TrimStart().TrimEnd())).ToEntero
|
||||
Dim CveClasificacion As Integer = DtClasificaciones.FiltroPrimeroValor("CveClasificacion", String.Format("trim(Clasificacion)='{0}'", row("Clasificación Superior").ToString().TrimStart().TrimEnd())).ToEntero
|
||||
Dim CveClasificacion2 As Integer = DtClasificaciones2.FiltroPrimeroValor("CveClasificacion", String.Format("trim(Clasificacion)='{0}'", row("Clasificación").ToString().TrimStart().TrimEnd())).ToEntero
|
||||
Dim CveMarca As Integer = DtMarcas.FiltroPrimeroValor("CveMarca", String.Format("Marca='{0}'", row("Marca").ToString().TrimStart().TrimEnd())).ToEntero
|
||||
|
||||
Dim Mes As Decimal = row("Mes").ToString().ToDecimal()
|
||||
Dim Anio As Decimal = row("Año").ToString().ToDecimal()
|
||||
Dim Cantidad As Decimal = row("Cantidad").ToString().ToDecimal()
|
||||
Dim Importe As Decimal = row("Importe").ToString().ToDecimal()
|
||||
|
||||
Dim FechaRef As New DateTime(Anio, Mes, 1)
|
||||
If CveVendedor > 0 AndAlso CveVendedor > 0 AndAlso CveClasificacion > 0 AndAlso CveClasificacion2 > 0 AndAlso CveMarca > 0 Then
|
||||
Correcto = ObjMetas.AddMetasVendedores(CveVendedor, FechaRef, CveMarca, Cantidad, Importe, CveClasificacion2, CveClasificacion, UsuarioActual.CveEmpresa)
|
||||
If Correcto Then
|
||||
RowsCargados += 1
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not Correcto Then
|
||||
RowsNoCargados += 1
|
||||
End If
|
||||
End If
|
||||
|
||||
Next
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al cargar los precios.", ex)
|
||||
Finally
|
||||
ObjMarcas.Dispose()
|
||||
|
||||
Dim MensajeFinal As New StringBuilder()
|
||||
If RowsNoCargados = 0 AndAlso RowsCargados > 0 Then
|
||||
MensajeFinal.Append("Las metas se cargaron correctamente. <br/><br/>")
|
||||
End If
|
||||
If RowsCargados > 0 Then
|
||||
MensajeFinal.Append("Se cargaron <b>" & RowsCargados & "</b> metas correctamente.")
|
||||
End If
|
||||
If RowsNoCargados > 0 Then
|
||||
MensajeFinal.Append("No se pudieron actualizar <b>" & RowsNoCargados & "</b> metas. <br/>")
|
||||
End If
|
||||
|
||||
Alert(MensajeFinal.ToString())
|
||||
Dim MensajeFinal As New StringBuilder()
|
||||
|
||||
If Correcto Then
|
||||
ObjMetas.Commit()
|
||||
If RowsNoCargados = 0 AndAlso RowsCargados > 0 Then
|
||||
MensajeFinal.Append("Las metas se cargaron correctamente. <br/><br/>")
|
||||
End If
|
||||
If RowsCargados > 0 Then
|
||||
MensajeFinal.Append("Se cargaron <b>" & RowsCargados & "</b> metas correctamente.")
|
||||
End If
|
||||
If RowsNoCargados > 0 Then
|
||||
MensajeFinal.Append("No se pudieron actualizar <b>" & RowsNoCargados & "</b> metas. <br/>")
|
||||
End If
|
||||
|
||||
Alert(MensajeFinal.ToString())
|
||||
Else
|
||||
ObjMetas.RollBack()
|
||||
If RowsNoCargados > 0 Then
|
||||
MensajeFinal.Append("No se pudieron actualizar <b>" & RowsNoCargados & "</b> metas. <br/>")
|
||||
End If
|
||||
Alert(MensajeFinal.ToString())
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
End Try
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable
|
||||
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
|
||||
Dim excelFile As ExcelFile = ExcelFile.Load(flatFilePath)
|
||||
|
||||
Dim unnamed As Integer = 0
|
||||
Dim cols As Integer
|
||||
Dim columns As String()
|
||||
Dim curRow As Integer = 0
|
||||
Dim curCol As Integer = 0
|
||||
Dim dataTable As DataTable = New DataTable()
|
||||
Dim worksheet As ExcelWorksheet = excelFile.Worksheets(0)
|
||||
|
||||
For cols = 0 To worksheet.Rows(0).AllocatedCells.Count - 1
|
||||
|
||||
If firstRowHasHeaders Then
|
||||
|
||||
If worksheet.Rows(0).Cells(cols).Value IsNot Nothing Then
|
||||
dataTable.Columns.Add(worksheet.Rows(0).Cells(cols).Value.ToString())
|
||||
Else
|
||||
dataTable.Columns.Add("Unnamed Column " & (System.Threading.Interlocked.Increment(unnamed)))
|
||||
End If
|
||||
|
||||
curRow = 1
|
||||
Else
|
||||
dataTable.Columns.Add("Column " & (cols + 1))
|
||||
End If
|
||||
Next
|
||||
|
||||
While curRow < worksheet.Rows.Count
|
||||
columns = New String(cols - 1) {}
|
||||
|
||||
For curCol = 0 To cols - 1
|
||||
|
||||
If worksheet.Rows(curRow).Cells(curCol).Value Is Nothing Then
|
||||
columns(curCol) = ""
|
||||
Else
|
||||
columns(curCol) = worksheet.Rows(curRow).Cells(curCol).Value.ToString()
|
||||
End If
|
||||
Next
|
||||
|
||||
dataTable.Rows.Add(columns)
|
||||
curRow += 1
|
||||
End While
|
||||
|
||||
Return dataTable
|
||||
End Function
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -187,11 +187,18 @@
|
||||
<asp:TextBox ID="TxtTotal" runat="server" CssClass="form-control input-sm" Visible="false" MaxLength="12" Width="140px" placeholder="Total" Enabled="false" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" runat="server" id="rowComisiones">
|
||||
<label class="col-md-2" runat="server" id="lblpagocomisiones">Otros Ingresos:</label>
|
||||
<div class="col-md-3">
|
||||
<div class="row">
|
||||
<div class="col-md-2" runat="server" id="rowComisiones1">Otros Ingresos:</div>
|
||||
<div class="col-md-3" runat="server" id="rowComisiones2">
|
||||
<asp:CheckBox ID="ChkAjusteOI" runat="server" AutoPostBack="true" />
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-2" runat="server" id="DvLiquidacion1" visible="false">Liquidación:</div>
|
||||
<div class="col-md-3" runat="server" id="DvLiquidacion2" visible="false">
|
||||
<asp:CheckBox ID="ChkLiquidacion" OnCheckedChanged="ChkLiquidacion_CheckedChanged" runat="server" AutoPostBack="true" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<asp:UpdatePanel ID="UpCuentaDeposito" UpdateMode="Conditional" runat="server">
|
||||
@@ -264,6 +271,8 @@
|
||||
DataKeyNames="TipoDocto,CveVenta,CveCliente,SerieFolio,Original,SubTotal,IVA,IEPS,RetIVA,RetISR,Num3,CveSubProyecto,CveMoneda,Saldo,TipoCambio, RFC,UUID,Fecha,PorcentajeIVA,DescuentoProntoPago,CveTipoRetencion,Descuento,ClaveMetodoPagoSAT"
|
||||
CssClass="table table-striped table-advance table-hover Widthall" Style="text-align: center;" GridLines="None">
|
||||
<Columns>
|
||||
|
||||
<%--0--%>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
<input type="checkbox" id="ChkAll" onclick="CheckAll();" />
|
||||
@@ -272,58 +281,84 @@
|
||||
<asp:CheckBox ID="Chk" CssClass="chkgv" runat="server"></asp:CheckBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%--1--%>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<HeaderTemplate>Venta</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HplF" CssClass="Texto" NavigateUrl='<%# Eval("CveVenta", "/Ventas/Ventas.aspx?CveVenta={0}")%>' Text='<%# Eval("SerieFolio")%>' runat="server"></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="Tipo Docto" DataField="TipoDocto" ItemStyle-HorizontalAlign="Center" />
|
||||
<%--<asp:HyperLinkField DataNavigateUrlFields="CveCompra" DataNavigateUrlFormatString="/Compras/Compras.aspx?CveCompra={0}" DataTextField="SerieFolio" HeaderText="Factura" ControlStyle-CssClass="Texto" />--%>
|
||||
<%--2--%>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>Fecha Venta</HeaderTemplate>
|
||||
<HeaderTemplate>Tipo<br> Docto</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlTipoDocto" runat="server" Text='<%# Eval("TipoDocto") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%--3--%>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>Fecha<br> Venta</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%--4--%>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>Fecha Vencimiento</HeaderTemplate>
|
||||
<HeaderTemplate>Fecha <br> Vencimiento</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFechaVenci" runat="server" Text='<%# Eval("FechaVencimiento", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%--5--%>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>Días Vencidos</HeaderTemplate>
|
||||
<HeaderTemplate>Días<br> Vencidos</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlDiasVencido" runat="server" Text='<%# Eval("DiasVencidos", "{0}") %>'></asp:Literal>
|
||||
<asp:Literal ID="LtlDiasVencido" runat="server" Text='<%# Eval("DiasVencidos", "{0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="Método de Pago" DataField="ClaveMetodoPagoSAT" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Forma de Pago" DataField="FormaPago" ItemStyle-HorizontalAlign="Left" />
|
||||
<%--6--%>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<HeaderTemplate>Método<br> de Pago</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlMetodoPago" runat="server" Text='<%# Eval("ClaveMetodoPagoSAT", "{0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%--7--%>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<HeaderTemplate>Forma<br> de Pago</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFormaPago" runat="server" Text='<%# Eval("FormaPago", "{0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%--8--%>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
|
||||
<HeaderTemplate>Monto Compra</HeaderTemplate>
|
||||
<HeaderTemplate>Monto <br> Compra</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlSaldoOriginal" runat="server" Text='<%# Eval("Original", "{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%--9--%>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate></HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="LtlMoneda" runat="server" Text='<%# Eval("TMoneda", "{0}") %>' Style="text-decoration: none" Enabled="false" ForeColor="#333333"></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%--10--%>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Abonado</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlAbonado" runat="server" Text='<%# Eval("Abonado", "{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%--11--%>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Saldo</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlSaldo" runat="server" Text='<%# Eval("Saldo", "{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%--12--%>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>Abonar</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
@@ -331,6 +366,7 @@
|
||||
<asp:RangeValidator ID="RVAbonar" runat="server" Enabled="false" Type="Currency" MinimumValue="0" MaximumValue='<%# Eval("Saldo", "{0:N2}") %>' ErrorMessage="*" ControlToValidate="TxtAbonar" Display="Dynamic"></asp:RangeValidator>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%--13--%>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>Ot. Ing.</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
@@ -338,33 +374,96 @@
|
||||
<asp:RangeValidator ID="RVComision" runat="server" Enabled="false" ErrorMessage="*" ControlToValidate="TxtComision" Display="Dynamic" Type="Double"></asp:RangeValidator>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%--14--%>
|
||||
<asp:TemplateField Visible="false" ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>Descuento Pronto Pago</HeaderTemplate>
|
||||
<HeaderTemplate>Descuento<br>Pronto Pago</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlDescuentoProntoPago" runat="server" Text='<%# Eval("DescuentoProntoPago", "{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Generar NC" Visible="false" >
|
||||
<%--15--%>
|
||||
<asp:TemplateField Visible="false" >
|
||||
<HeaderTemplate>Generar<br> NC</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="ChkGenerarNC" CssClass="chkgv" runat="server" Visible="false" Enabled="false"></asp:CheckBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
<%--16--%>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>Col. 1</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtLiquidacionCol1" Width="50px" runat="server" Style="text-align: right;" ></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%--17--%>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>Col. 2</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtLiquidacionCol2" Width="50px" runat="server" Style="text-align: right;" ></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%--18--%>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>Col. 3</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtLiquidacionCol3" Width="50px" runat="server" Style="text-align: right;" ></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%--19--%>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>Col. 4</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtLiquidacionCol4" Width="50px" runat="server" Style="text-align: right;" ></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%--20--%>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>Col. 5</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtLiquidacionCol5" Width="50px" runat="server" Style="text-align: right;" ></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%--21--%>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>Col. 6</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtLiquidacionCol6" Width="50px" runat="server" Style="text-align: right;" ></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%--22--%>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>Col. 7</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtLiquidacionCol7" Width="50px" runat="server" Style="text-align: right;" ></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%--23--%>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>Total<br>Liquidación</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtLiquidacionCol8" Width="50px" runat="server" Style="text-align: right;" onkeypress="return disablekeys();"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<%--24--%>
|
||||
<asp:TemplateField ItemStyle-Width="300px">
|
||||
<HeaderTemplate>Auxiliar</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlAux" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%--25--%>
|
||||
<asp:TemplateField Visible="False">
|
||||
<HeaderTemplate>CveVenta</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HplF2" CssClass="btn-success" Text='<%# Eval("CveVenta")%>' runat="server"></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
<%--26--%>
|
||||
<asp:TemplateField >
|
||||
<HeaderTemplate>Complemento Pago</HeaderTemplate>
|
||||
<HeaderTemplate>Complemento<br> Pago</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal runat="server" ID="LtlComplemento" Text="<i class='fa fa-check text-success ' aria-hidden='true'></i>" ></asp:Literal>
|
||||
</ItemTemplate>
|
||||
@@ -508,7 +607,7 @@
|
||||
<script type="text/javascript">
|
||||
var Ventas = '';
|
||||
|
||||
function FnSuma(t, txt, importe) {
|
||||
function FnSuma(t, txt, importe, CveVenta) {
|
||||
|
||||
var chkPesosBancos = $get("ChkPagarPesos");
|
||||
var chkDolaresBancos = $get("ChkPagarDolares");
|
||||
@@ -518,6 +617,14 @@
|
||||
txt.value = FormatoNumero(importe, 2);
|
||||
} else {
|
||||
txt.value = "";
|
||||
|
||||
let ClsSelLiquidacionVenta = ".ClsSelLiquidacionVenta" + CveVenta;
|
||||
let ClsSelLiquidacionVentaTotal = ".ClsSelLiquidacionVentaTotal" + CveVenta;
|
||||
|
||||
$(ClsSelLiquidacionVenta).val('');
|
||||
$(ClsSelLiquidacionVentaTotal).val('');
|
||||
|
||||
|
||||
}
|
||||
//if (typeof t2 === "undefined") {
|
||||
|
||||
@@ -548,6 +655,8 @@
|
||||
var facDolares = false;
|
||||
var div = document.getElementById("DivTC")
|
||||
|
||||
let totalLiquidacion = 0.0;
|
||||
|
||||
if ($get('TxtTC') != null) {
|
||||
tc = ToDouble($get('TxtTC').value);
|
||||
}
|
||||
@@ -602,6 +711,22 @@
|
||||
}
|
||||
$get('TxtObservaciones').value = $get('HdnObs').value + ' Ventas: ' + Ventas;
|
||||
|
||||
|
||||
|
||||
|
||||
$(".ClsSelLiquidacion").each(function () {
|
||||
|
||||
let valorString = $(this).val();
|
||||
valorString = valorString.replace(/,/g, '');
|
||||
|
||||
if (valorString.trim().length > 0) {
|
||||
totalLiquidacion = totalLiquidacion + parseFloat(valorString);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
if ($get('TxtOtrosImportes') != null) {
|
||||
if (pagoMultiple != 0) {
|
||||
$get('TxtOtrosImportes').value = FormatoNumero(Comision, 2);
|
||||
@@ -612,12 +737,12 @@
|
||||
|
||||
}
|
||||
else {
|
||||
return Importe + parseFloat(Comision);
|
||||
return Importe + parseFloat(Comision) - totalLiquidacion;
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
return Importe
|
||||
return Importe - totalLiquidacion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -790,5 +915,44 @@
|
||||
TipoCambioActual = TipoCambioTxt;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function SumaLiquidacion(txt, CveVenta, pagoMultiple, monedaPago) {
|
||||
|
||||
let ClsSelLiquidacionVenta = ".ClsSelLiquidacionVenta" + CveVenta;
|
||||
let ClsSelLiquidacionVentaTotal = ".ClsSelLiquidacionVentaTotal" + CveVenta;
|
||||
let Total = 0.0;
|
||||
|
||||
|
||||
$( ClsSelLiquidacionVenta).each(function () {
|
||||
|
||||
let valorString = $(this).val();
|
||||
valorString = valorString.replace(/,/g, '');
|
||||
|
||||
if (valorString.trim().length > 0) {
|
||||
Total = Total + parseFloat(valorString);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$(ClsSelLiquidacionVentaTotal).each(function () {
|
||||
$(this).val(Total);
|
||||
FormatoMoneda2($(this));
|
||||
});
|
||||
|
||||
|
||||
FormatoMoneda(txt);
|
||||
|
||||
var Suma = SumaValores(pagoMultiple, monedaPago);
|
||||
$get('TxtImporte').value = FormatoNumero(Suma, 2);
|
||||
|
||||
}
|
||||
|
||||
function disablekeys()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
@@ -257,7 +257,7 @@ Partial Class Ventas_ClientesAbonar
|
||||
|
||||
IdCuentaBancaria = 0
|
||||
|
||||
TxtOtrosImportes.Attributes.Add("onKeyUp", String.Format("FnSuma(this,{0},{1});", "TxtTotal", 0))
|
||||
TxtOtrosImportes.Attributes.Add("onKeyUp", String.Format("FnSuma(this,{0},{1},-1);", "TxtTotal", 0))
|
||||
|
||||
If CveMoneda > 0 Then LbTipoMoneda.Text = String.Format("Pago en {0}", GlobalDTMonedas.FiltraParametros(String.Format("CveMoneda = {0}", CveMoneda)).Rows(0)("Moneda"))
|
||||
|
||||
@@ -292,6 +292,12 @@ Partial Class Ventas_ClientesAbonar
|
||||
|
||||
RVTxtFechaDocumento.MaximumValue = Now.ToString("dd/MM/yyyy")
|
||||
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(590) = "1" Then
|
||||
DvLiquidacion1.Visible = True
|
||||
DvLiquidacion2.Visible = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If (CveMonedaFiltro = 2 And ChkPagarPesos.Checked) Then
|
||||
@@ -497,6 +503,7 @@ Partial Class Ventas_ClientesAbonar
|
||||
End Sub
|
||||
|
||||
Protected Sub GvCxC_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCxC.RowDataBound
|
||||
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
Dim moneda As Integer = 0
|
||||
If e.Row.RowIndex = 0 Then
|
||||
@@ -507,6 +514,19 @@ Partial Class Ventas_ClientesAbonar
|
||||
e.Row.Cells(3).Visible = False
|
||||
e.Row.Cells(4).Visible = False
|
||||
e.Row.BackColor = Drawing.Color.LightGray
|
||||
|
||||
|
||||
e.Row.FCTextBox("TxtLiquidacionCol1").Visible = False
|
||||
e.Row.FCTextBox("TxtLiquidacionCol2").Visible = False
|
||||
e.Row.FCTextBox("TxtLiquidacionCol3").Visible = False
|
||||
e.Row.FCTextBox("TxtLiquidacionCol4").Visible = False
|
||||
e.Row.FCTextBox("TxtLiquidacionCol5").Visible = False
|
||||
e.Row.FCTextBox("TxtLiquidacionCol6").Visible = False
|
||||
e.Row.FCTextBox("TxtLiquidacionCol7").Visible = False
|
||||
e.Row.FCTextBox("TxtLiquidacionCol8").Visible = False
|
||||
|
||||
|
||||
|
||||
End If
|
||||
If e.Row.RowIndex = 1 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(25)
|
||||
@@ -548,9 +568,9 @@ Partial Class Ventas_ClientesAbonar
|
||||
End Select
|
||||
|
||||
If e.Row.DBCampo("DescuentoProntoPago").ToDecimal() > 0 Then
|
||||
e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("FnSuma(this,{0},{1}); FnCambia({2},this,{1},0,{3},{4}); FnSeleccionaNC({5},{6},{0});", e.Row.FCTextBox("TxtAbonar").ClientID, e.Row.DBCampo("Saldo"), e.Row.FCCheckBox("Chk").ClientID, CveMonedaFiltro, moneda, e.Row.FCCheckBox("Chk").ClientID, e.Row.FCCheckBox("ChkGenerarNC").ClientID))
|
||||
e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("FnSuma(this,{0},{1},{5}); FnCambia({2},this,{1},0,{3},{4}); FnSeleccionaNC({5},{6},{0});", e.Row.FCTextBox("TxtAbonar").ClientID, e.Row.DBCampo("Saldo"), e.Row.FCCheckBox("Chk").ClientID, CveMonedaFiltro, moneda, e.Row.FCCheckBox("Chk").ClientID, e.Row.FCCheckBox("ChkGenerarNC").ClientID, e.Row.DBCampo("CveVenta")))
|
||||
Else
|
||||
e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("FnSuma(this,{0},{1}); FnCambia({2},this,{1},0,{3},{4});", e.Row.FCTextBox("TxtAbonar").ClientID, e.Row.DBCampo("Saldo"), e.Row.FCCheckBox("Chk").ClientID, CveMonedaFiltro, moneda))
|
||||
e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("FnSuma(this,{0},{1},{5}); FnCambia({2},this,{1},0,{3},{4},{5});", e.Row.FCTextBox("TxtAbonar").ClientID, e.Row.DBCampo("Saldo"), e.Row.FCCheckBox("Chk").ClientID, CveMonedaFiltro, moneda, e.Row.DBCampo("CveVenta")))
|
||||
End If
|
||||
|
||||
If Not UsuarioActual.Empresa.Funcionalidad(536) = "1" Then
|
||||
@@ -578,9 +598,32 @@ Partial Class Ventas_ClientesAbonar
|
||||
|
||||
If e.Row.DBCampo("DescuentoProntoPago").ToDecimal() > 0 AndAlso e.Row.DBCampo("DiasVencidos").ToEntero() <= 0 Then
|
||||
e.Row.FCCheckBox("ChkGenerarNC").Visible = True
|
||||
e.Row.FCCheckBox("ChkGenerarNC").Attributes.Add("onclick", String.Format("FnSuma(this,{0},{1}); FnCambia({2},this,{1},0,{3},{4}); FnEditarImporte({2}, {0});", e.Row.FCTextBox("TxtAbonar").ClientID, e.Row.DBCampo("Saldo").ToDecimal - e.Row.DBCampo("DescuentoProntoPago").ToDecimal, e.Row.FCCheckBox("ChkGenerarNC").ClientID, CveMonedaFiltro, moneda))
|
||||
e.Row.FCCheckBox("ChkGenerarNC").Attributes.Add("onclick", String.Format("FnSuma(this,{0},{1},{5}); FnCambia({2},this,{1},0,{3},{4}); FnEditarImporte({2}, {0});", e.Row.FCTextBox("TxtAbonar").ClientID, e.Row.DBCampo("Saldo").ToDecimal - e.Row.DBCampo("DescuentoProntoPago").ToDecimal, e.Row.FCCheckBox("ChkGenerarNC").ClientID, CveMonedaFiltro, moneda, e.Row.DBCampo("CveVenta")))
|
||||
End If
|
||||
|
||||
e.Row.FCTextBox("TxtLiquidacionCol1").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}")
|
||||
e.Row.FCTextBox("TxtLiquidacionCol2").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}")
|
||||
e.Row.FCTextBox("TxtLiquidacionCol3").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}")
|
||||
e.Row.FCTextBox("TxtLiquidacionCol4").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}")
|
||||
e.Row.FCTextBox("TxtLiquidacionCol5").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}")
|
||||
e.Row.FCTextBox("TxtLiquidacionCol6").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}")
|
||||
e.Row.FCTextBox("TxtLiquidacionCol7").Attributes.Add("class", $"ClsSelLiquidacion ClsSelLiquidacionVenta{e.Row.DBCampo("CveVenta").ToEntero}")
|
||||
e.Row.FCTextBox("TxtLiquidacionCol8").Attributes.Add("class", $"ClsSelLiquidacionVentaTotal{e.Row.DBCampo("CveVenta").ToEntero}")
|
||||
|
||||
|
||||
e.Row.FCTextBox("TxtLiquidacionCol1").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})")
|
||||
e.Row.FCTextBox("TxtLiquidacionCol2").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})")
|
||||
e.Row.FCTextBox("TxtLiquidacionCol3").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})")
|
||||
e.Row.FCTextBox("TxtLiquidacionCol4").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})")
|
||||
e.Row.FCTextBox("TxtLiquidacionCol5").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})")
|
||||
e.Row.FCTextBox("TxtLiquidacionCol6").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})")
|
||||
e.Row.FCTextBox("TxtLiquidacionCol7").Attributes.Add("onkeyup", $"SumaLiquidacion(this,{e.Row.DBCampo("CveVenta").ToString},{CveMonedaFiltro},{ moneda})")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Else
|
||||
e.Row.FCTextBox("TxtAbonar").Visible = False
|
||||
e.Row.FCTextBox("TxtComision").Visible = False
|
||||
@@ -823,7 +866,9 @@ Partial Class Ventas_ClientesAbonar
|
||||
|
||||
'inserto las ventas que voy a pagar
|
||||
For Each gvr As GridViewRow In GvCxC.Rows
|
||||
|
||||
If gvr.FCCheckBox("Chk").Checked Then
|
||||
|
||||
Dim ObjFactura As Modelos.Factura = Nothing
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
@@ -861,6 +906,7 @@ Partial Class Ventas_ClientesAbonar
|
||||
If gvr.DataKey("TipoDocto") = "Ant" AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119, 158) Then EsAnticipoEspecial = True
|
||||
|
||||
If dtConceptos IsNot Nothing Then
|
||||
|
||||
For Each Row As DataRow In dtConceptos.Rows
|
||||
|
||||
Dim ConceptoContable = Row("CveConcepto").ToString.ToEntero
|
||||
@@ -1487,7 +1533,84 @@ Partial Class Ventas_ClientesAbonar
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
|
||||
Dim ImporteLiquidacion1 As Decimal = gvr.FCTextBox("TxtLiquidacionCol1").Text.ToDecimal
|
||||
Dim ImporteLiquidacion2 As Decimal = gvr.FCTextBox("TxtLiquidacionCol2").Text.ToDecimal
|
||||
Dim ImporteLiquidacion3 As Decimal = gvr.FCTextBox("TxtLiquidacionCol3").Text.ToDecimal
|
||||
Dim ImporteLiquidacion4 As Decimal = gvr.FCTextBox("TxtLiquidacionCol4").Text.ToDecimal
|
||||
Dim ImporteLiquidacion5 As Decimal = gvr.FCTextBox("TxtLiquidacionCol5").Text.ToDecimal
|
||||
Dim ImporteLiquidacion6 As Decimal = gvr.FCTextBox("TxtLiquidacionCol6").Text.ToDecimal
|
||||
Dim ImporteLiquidacion7 As Decimal = gvr.FCTextBox("TxtLiquidacionCol7").Text.ToDecimal
|
||||
|
||||
Dim CveClasificacionCol1 As Integer = 21267
|
||||
Dim CveClasificacionCol2 As Integer = 21229
|
||||
Dim CveClasificacionCol3 As Integer = 21520
|
||||
Dim CveClasificacionCol4 As Integer = 21519
|
||||
Dim CveClasificacionCol5 As Integer = 21547
|
||||
Dim CveClasificacionCol6 As Integer = 21572
|
||||
Dim CveClasificacionCol7 As Integer = 21571
|
||||
|
||||
Dim CveSubProyectoLiquidacion As Integer = gvr.DataKey("CveSubProyecto").ToEntero
|
||||
|
||||
Dim CveConceptoLiquidacion As Integer = 51
|
||||
|
||||
If ImporteLiquidacion1 <> 0 Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiquidacion1, "Liquidacion Col 1", CveConceptoLiquidacion, "Liquidacion Col 2", Now, -1, -1, CveIE, gvr.FCHyperLink("HplF2").Text.ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiquidacion1 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol1) Then
|
||||
MsgError = "No se pudo insertar la póliza"
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
|
||||
If ImporteLiquidacion2 <> 0 Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiquidacion2, "Liquidacion Col 2", CveConceptoLiquidacion, "Liquidacion Col 2", Now, -1, -1, CveIE, gvr.FCHyperLink("HplF2").Text.ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiquidacion2 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol2) Then
|
||||
MsgError = "No se pudo insertar la póliza"
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
|
||||
If ImporteLiquidacion3 <> 0 Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiquidacion3, "Liquidacion Col 4", CveConceptoLiquidacion, "Liquidacion Col 3", Now, -1, -1, CveIE, gvr.FCHyperLink("HplF2").Text.ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiquidacion3 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol3) Then
|
||||
MsgError = "No se pudo insertar la póliza"
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If ImporteLiquidacion4 <> 0 Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiquidacion4, "Liquidacion Col 4", CveConceptoLiquidacion, "Liquidacion Col 4", Now, -1, -1, CveIE, gvr.FCHyperLink("HplF2").Text.ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiquidacion4 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol4) Then
|
||||
MsgError = "No se pudo insertar la póliza"
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If ImporteLiquidacion5 <> 0 Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiquidacion5, "Liquidacion Col 5", CveConceptoLiquidacion, "Liquidacion Col 5", Now, -1, -1, CveIE, gvr.FCHyperLink("HplF2").Text.ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiquidacion5 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol5) Then
|
||||
MsgError = "No se pudo insertar la póliza"
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
|
||||
If ImporteLiquidacion6 <> 0 Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiquidacion6, "Liquidacion Col 6", CveConceptoLiquidacion, "Liquidacion Col 6", Now, -1, -1, CveIE, gvr.FCHyperLink("HplF2").Text.ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiquidacion6 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol6) Then
|
||||
MsgError = "No se pudo insertar la póliza"
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
|
||||
If ImporteLiquidacion7 <> 0 Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiquidacion7, "Liquidacion Col 7", CveConceptoLiquidacion, "Liquidacion Col 7", Now, -1, -1, CveIE, gvr.FCHyperLink("HplF2").Text.ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiquidacion7 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol7) Then
|
||||
MsgError = "No se pudo insertar la póliza"
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End If
|
||||
If gvr.FCCheckBox("ChkGenerarNC").Checked AndAlso ObjFactura IsNot Nothing Then
|
||||
ObjFactura.DescuentoProntoPago = gvr.DataKey("DescuentoProntoPago").ToDecimal()
|
||||
@@ -3136,4 +3259,46 @@ Partial Class Ventas_ClientesAbonar
|
||||
Calendario.EndDate = DateTime.Now
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
#Region "LIQUIDACION"
|
||||
|
||||
Protected Sub ChkLiquidacion_CheckedChanged(sender As Object, e As EventArgs)
|
||||
|
||||
|
||||
If ChkLiquidacion.Checked Then
|
||||
'16-23
|
||||
GvCxC.Columns(16).Visible = True
|
||||
GvCxC.Columns(17).Visible = True
|
||||
GvCxC.Columns(18).Visible = True
|
||||
GvCxC.Columns(19).Visible = True
|
||||
GvCxC.Columns(20).Visible = True
|
||||
GvCxC.Columns(21).Visible = True
|
||||
GvCxC.Columns(22).Visible = True
|
||||
GvCxC.Columns(23).Visible = True
|
||||
|
||||
GvCxC.Columns(26).Visible = False
|
||||
|
||||
Else
|
||||
GvCxC.Columns(16).Visible = False
|
||||
GvCxC.Columns(17).Visible = False
|
||||
GvCxC.Columns(18).Visible = False
|
||||
GvCxC.Columns(19).Visible = False
|
||||
GvCxC.Columns(20).Visible = False
|
||||
GvCxC.Columns(21).Visible = False
|
||||
GvCxC.Columns(22).Visible = False
|
||||
GvCxC.Columns(23).Visible = False
|
||||
|
||||
GvCxC.Columns(26).Visible = True
|
||||
|
||||
|
||||
End If
|
||||
|
||||
UPVentas.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Metas de Vendedores
|
||||
Scorecard Ventas
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
@@ -144,59 +144,86 @@
|
||||
CssClass="table table-advance Widthall ScrollAD" data-sort="true" ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
|
||||
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Grupo" ItemStyle-HorizontalAlign="Left">
|
||||
<asp:TemplateField HeaderText="Grupo" ItemStyle-HorizontalAlign="Left" HeaderStyle-Width="250px">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="HlkGrupo" runat="server" Target="_blank" Text='<%# Eval("Titulo").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Real Mes" ItemStyle-HorizontalAlign="Center">
|
||||
<asp:TemplateField HeaderText="Real" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblRealMes" runat="server" Target="_blank" Text='<%# Eval("RealMes").ToString() %>'> </asp:Label>
|
||||
<asp:Label ID="lblRealMes" runat="server" Target="_blank" Text='<%# Eval("RealMes", "{0:#,###}").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Real Mes %" ItemStyle-HorizontalAlign="Center">
|
||||
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>
|
||||
%Inte
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblRealMesPorcentaje" runat="server" Target="_blank" Text='<%# Eval("RealMesPorcentaje").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Venta Mes Año Anterior" ItemStyle-HorizontalAlign="Center">
|
||||
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>
|
||||
Año<br />Anterior
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblVtaMesAA" runat="server" Target="_blank" Text='<%# Eval("VtaMesAA").ToString() %>'> </asp:Label>
|
||||
<asp:Label ID="lblVtaMesAA" runat="server" Target="_blank" Text='<%# Eval("VtaMesAA", "{0:#,###}").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Obj Mes" ItemStyle-HorizontalAlign="Center">
|
||||
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Right">
|
||||
<HeaderTemplate>
|
||||
Obj.<br />Mes
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblObjMes" runat="server" Target="_blank" Text='<%# Eval("ObjMes").ToString() %>'> </asp:Label>
|
||||
<asp:Label ID="lblObjMes" runat="server" Target="_blank" Text='<%# Eval("ObjMes", "{0:#,###}").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Var Mes A.A" ItemStyle-HorizontalAlign="Center">
|
||||
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Right">
|
||||
<HeaderTemplate>
|
||||
Var <br />Mes A.A
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblVarMesAA" runat="server" Target="_blank" Text='<%# Eval("VarMesAA").ToString() %>'> </asp:Label>
|
||||
<asp:Label ID="lblVarMesAA" runat="server" Target="_blank" Text='<%# Eval("VarMesAA", "{0:#,###}").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Var Mes Obj" ItemStyle-HorizontalAlign="Center">
|
||||
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Right">
|
||||
<HeaderTemplate>
|
||||
Var <br />Obj.
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblVarMesObj" runat="server" Target="_blank" Text='<%# Eval("VarMesObj").ToString() %>'> </asp:Label>
|
||||
<asp:Label ID="lblVarMesObj" runat="server" Target="_blank" Text='<%# Eval("VarMesObj", "{0:#,###}").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Real Acumulado" ItemStyle-HorizontalAlign="Center">
|
||||
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Right">
|
||||
<HeaderTemplate>
|
||||
Real<br/>Acum.
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblRealAcumulado" runat="server" Target="_blank" Text='<%# Eval("RealAcumulado").ToString() %>'> </asp:Label>
|
||||
<asp:Label ID="lblRealAcumulado" runat="server" Target="_blank" Text='<%# Eval("RealAcumulado", "{0:#,###}").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Real Acumulado %" ItemStyle-HorizontalAlign="Center">
|
||||
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>
|
||||
%Inte
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblRealAcumuladoPorcentaje" runat="server" Target="_blank" Text='<%# Eval("RealAcumuladoPorcentaje").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="A. Ant. Acumulado" ItemStyle-HorizontalAlign="Center">
|
||||
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>
|
||||
Acum<br />Año Ant
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblAAntAcumulado" runat="server" Target="_blank" Text='<%# Eval("AAntAcumulado").ToString() %>'> </asp:Label>
|
||||
<asp:Label ID="lblAAntAcumulado" runat="server" Target="_blank" Text='<%# Eval("AAntAcumulado", "{0:#,###}").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Obj Acumulado" ItemStyle-HorizontalAlign="Center">
|
||||
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>
|
||||
Obj.<br />Acum
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblObjAcumulado" runat="server" Target="_blank" Text='<%# Eval("ObjAcumulado").ToString() %>'> </asp:Label>
|
||||
<asp:Label ID="lblObjAcumulado" runat="server" Target="_blank" Text='<%# Eval("ObjAcumulado", "{0:#,###}").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%-- <asp:TemplateField HeaderText="%Var vs AA" ItemStyle-HorizontalAlign="Center">
|
||||
@@ -204,14 +231,20 @@
|
||||
<asp:Label ID="lblVarVSAAPerc" runat="server" Target="_blank" Text='<%# Eval("VarVSAAPerc").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>--%>
|
||||
<asp:TemplateField HeaderText="Var vs AA" ItemStyle-HorizontalAlign="Center">
|
||||
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>
|
||||
Var <br />vs AA
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblVarVSAA" runat="server" Target="_blank" Text='<%# Eval("VarVSAA").ToString() %>'> </asp:Label>
|
||||
<asp:Label ID="lblVarVSAA" runat="server" Target="_blank" Text='<%# Eval("VarVSAA", "{0:#,###}").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Var vs ObjAcum" ItemStyle-HorizontalAlign="Center">
|
||||
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>
|
||||
Var<br /> Obj.
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblVarVSObjAcum" runat="server" Target="_blank" Text='<%# Eval("VarVSObjAcum").ToString() %>'> </asp:Label>
|
||||
<asp:Label ID="lblVarVSObjAcum" runat="server" Target="_blank" Text='<%# Eval("VarVSObjAcum", "{0:#,###}").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
|
||||
@@ -86,7 +86,7 @@ Partial Class MetasVendedores
|
||||
|
||||
Select Case e.Row.DBCampo("TipoFila")
|
||||
Case "1"
|
||||
e.Row.CssClass = "GrupoSuperior"
|
||||
e.Row.CssClass = "Totales"
|
||||
' e.Row.FCLabel("lblRealMes").Text = ""
|
||||
' e.Row.FCLabel("lblVtaMesAA").Text = ""
|
||||
' e.Row.FCLabel("lblObjMes").Text = ""
|
||||
@@ -98,11 +98,11 @@ Partial Class MetasVendedores
|
||||
' e.Row.FCLabel("lblVarVSAA").Text = ""
|
||||
' e.Row.FCLabel("lblVarVSObjAcum").Text = ""
|
||||
Case "2"
|
||||
e.Row.CssClass = "Totales"
|
||||
Case "3"
|
||||
e.Row.CssClass = "SubTotales2"
|
||||
Case "4"
|
||||
Case "3"
|
||||
e.Row.CssClass = "SubTotales"
|
||||
Case "4"
|
||||
e.Row.CssClass = "SubTotales3"
|
||||
End Select
|
||||
|
||||
If e.Row.DataKey("Titulo") = "" Then
|
||||
|
||||
@@ -264,7 +264,7 @@
|
||||
<i></i>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright col-xs-3" id="divLitraje" visible="false" runat="server">
|
||||
<asp:TextBox ID="TxtLitraje" CssClass="form-control " runat="server" ReadOnly="true"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtLitraje" CssClass="form-control " runat="server" ></asp:TextBox>
|
||||
<%--<ajax:FilteredTextBoxExtender ID="FTBETVentaMinima" TargetControlID="TxtVentaMinima" FilterType="Numbers" runat="server" ValidChars=".," />--%>
|
||||
<label class="truncate" style="padding-left: 16px;" for="<%= TxtLitraje.ClientID.ToString()%>">Litraje:</label>
|
||||
<i></i>
|
||||
|
||||
@@ -1372,7 +1372,7 @@ Partial Class ProductosyServicios
|
||||
ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString, ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString,
|
||||
ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString, EsOutSourcing:=ChkEsOutSourcing.Checked, TiempoCaducidad:=TiempoCaducidad, CvePSAdicionalVigencia:=DdlPSAdicionalVigencia.SelectedValue.ToEntero(), PrecioLibre:=ChkPrecioLibre.Checked,
|
||||
CveMaterialPeligroso:=DdlMaterialPeligroso.SelectedValue.ToEntero, CveEmbalaje:=DdlEmbalaje.SelectedValue.ToEntero, PesoKg:=TxtPesoKg.Text.ToDecimal, Dimensiones:=TxtDimensiones.Text.Trim,
|
||||
CveObjetoImpuesto:=DdlObjetoImpuesto.SelectedValue.ToEntero) > 0 Then
|
||||
CveObjetoImpuesto:=DdlObjetoImpuesto.SelectedValue.ToEntero, Litraje:=TxtLitraje.Text.ToDecimal) > 0 Then
|
||||
ViewState("CvePS") = ObjProductosServicios.CvePS
|
||||
For Each GVR As GridViewRow In GvImpuestosLocales.Rows
|
||||
If GVR.FCCheckBox("ChkDeduccion").Checked Then
|
||||
@@ -1423,7 +1423,7 @@ Partial Class ProductosyServicios
|
||||
ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString, EsOutSourcing:=ChkEsOutSourcing.Checked,
|
||||
AplicaSerie:=ChkSerie.Checked, AplicaLote:=ChkLote.Checked, AplicaCaducidad:=ChkCaducidad.Checked, AplicaSeccion:=ChkSeccion.Checked, TiempoCaducidad:=TiempoCaducidad, CvePSAdicionalVigencia:=DdlPSAdicionalVigencia.SelectedValue.ToEntero(), PrecioLibre:=ChkPrecioLibre.Checked,
|
||||
CveMaterialPeligroso:=DdlMaterialPeligroso.SelectedValue.ToEntero, CveEmbalaje:=DdlEmbalaje.SelectedValue.ToEntero, PesoKg:=TxtPesoKg.Text.ToDecimal, Dimensiones:=TxtDimensiones.Text.Trim,
|
||||
CveObjetoImpuesto:=DdlObjetoImpuesto.SelectedValue.ToEntero) Then
|
||||
CveObjetoImpuesto:=DdlObjetoImpuesto.SelectedValue.ToEntero, Litraje:=TxtLitraje.Text.ToDecimal) Then
|
||||
|
||||
If Not ObjProductosServicios.LimpiaImpuestosLocales(CvePS) Then
|
||||
TieneError = True
|
||||
|
||||
@@ -194,7 +194,7 @@ Partial Class Ventas_RepProductosServicios
|
||||
DdlSubProyectoEjecucion.DataBind()
|
||||
|
||||
'Vendedor
|
||||
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
|
||||
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa, VendedorTipo:=-1).FiltraParametros("VendedorTipo in (1,3)") 'vendedores y vendedores de piso
|
||||
DdlVendedor.DataBind()
|
||||
|
||||
'CargaUsuarios
|
||||
|
||||
@@ -451,12 +451,13 @@ Partial Class Ventas_RepProductosServiciosDetalle
|
||||
DdlGrupo.SelectedValueExist(GPO)
|
||||
RblTipoCambio.SelectedValue = TipoCambio.ToString
|
||||
If TipoCambio > 1 Then CveMoneda = -1
|
||||
CargarMarcas(CveMarca)
|
||||
|
||||
CargaProvedores(CveProveedorCompra)
|
||||
'If CveProveedorCompra.ToEntero > 0 Then DdlProveedor.SelectedValue = CveProveedorCompra
|
||||
DdlTipoPSDes.SelectedValueExist(CveClasificacionDetalle)
|
||||
CargaDatos(CveProyecto, CveSubProyecto, CveCategoria, CveClasificacion, CvePS, Mes, MesEjec, CveCliente, CveSubProyectoEjecucion, CveVendedor, CveUsuario, CveEstatus, GPO.ToEntero, TipoDocto, CveMarca, ModalidadContable)
|
||||
CargarMarcas(CveMarca)
|
||||
CargaDatos()
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
@@ -497,32 +498,6 @@ Partial Class Ventas_RepProductosServiciosDetalle
|
||||
Agrupador = DdlGrupo.SelectedItem.Text
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos(CveProyecto As String, CveSubProyecto As String, CveCategoria As String, CveClasificacion As String, CvePS As String, Mes As String, MesEjec As String, CveCliente As Integer, CveSubProyectoEjecucion As String, CveVendedor As Integer, CveUsuario As String, CveEstatus As String, Gpo As Integer, TipoDocto As String, CveMarca As Integer, ModalidadContable As Boolean)
|
||||
Dim ObjVentas As New ClsVentas()
|
||||
Dim FechaI, FechaF, FechaIEjec, FechaFEjec As Date
|
||||
FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.ToDate, MinFecha)
|
||||
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.ToDate, MaxFecha)
|
||||
FechaIEjec = If(IsDate(TxtFechaIEjec.Text.Trim()), TxtFechaIEjec.Text.ToDate, MinFecha)
|
||||
FechaFEjec = If(IsDate(TxtFechaFEjec.Text.Trim()), TxtFechaFEjec.Text.ToDate, MaxFecha)
|
||||
Dim CveProveedorCompra As Integer = If(DdlProveedor.SelectedValue.ToEntero > 0, DdlProveedor.SelectedValue.ToEntero, -1)
|
||||
Dim TipoComprobante As String = If(DdlTipoComprobante.GetSelectedValuesM = "", "-1", DdlTipoComprobante.GetSelectedValuesM)
|
||||
|
||||
If RblTipoCambio.SelectedValue.ToEntero = 3 And TxtEspecifico.Text <> "" Then TCEspecifico = TxtEspecifico.Text.ToDouble Else TCEspecifico = -1
|
||||
|
||||
If ObjVentas.GetRepProductosServiciosDetalle(CveProyecto.ToEntero, CveSubProyecto.ToEntero, CveCategoria.ToEntero, CveClasificacion.ToEntero, CvePS.ToEntero,
|
||||
FechaI, FechaF, Mes.ToEntero, FechaIEjec, FechaFEjec, MesEjec.ToEntero, CveCliente.ToEntero, CveSubProyectoEjecucion.ToEntero,
|
||||
CveVendedor, CveUsuario.ToEntero, CveEstatus.ToEntero, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario, TipoDocto:=TipoComprobante,
|
||||
GPO:=Gpo, CveMoneda:=CveMoneda, TipoCambio:=TipoCambio, TCEspecifico:=TCEspecifico, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero,
|
||||
CveProveedorCompra:=CveProveedorCompra, CveMarca:=CveMarca, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero) Then
|
||||
GvDatos.DataSource = ObjVentas.DtResultados
|
||||
TmpDT = ObjVentas.DtResultados
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
GvDatos.DataBind()
|
||||
Agrupador = DdlGrupo.SelectedItem.Text
|
||||
End Sub
|
||||
Protected Sub BtnTipoCambio_Click(sender As Object, e As EventArgs)
|
||||
CargaDatos()
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivTipoCambio"))
|
||||
@@ -533,14 +508,10 @@ Partial Class Ventas_RepProductosServiciosDetalle
|
||||
DivMarca.Visible = True
|
||||
LblMarca.Visible = True
|
||||
|
||||
Dim ObjMarcas As New ClsProductosServicios
|
||||
If ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa) Then
|
||||
DdlMarcaPSDes.DataSource = ObjMarcas.DtResultados
|
||||
ObjMarcas.Dispose()
|
||||
DdlMarcaPSDes.DataBind()
|
||||
End If
|
||||
DdlMarcaPSDes.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa)
|
||||
DdlMarcaPSDes.DataBind()
|
||||
End If
|
||||
DdlMarcaPSDes.Items.Insert(0, New ListItem(" - ", "-1"))
|
||||
DdlMarcaPSDes.Items.Insert(0, New ListItem("Todas", "-1"))
|
||||
DdlMarcaPSDes.Items.FindByValue(CStr(CveMarca)).Selected = True
|
||||
End Sub
|
||||
#End Region
|
||||
@@ -573,14 +544,7 @@ Partial Class Ventas_RepProductosServiciosDetalle
|
||||
End If
|
||||
Else
|
||||
If Not e.Row.DBCampo("CveVenta").ToEntero > 0 Then
|
||||
'e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Center
|
||||
'e.Row.Cells(0).Width = Unit.Pixel(200)
|
||||
'e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
|
||||
'e.Row.Cells(1).Width = Unit.Pixel(60)
|
||||
'e.Row.Cells(2).Width = Unit.Pixel(90)
|
||||
'e.Row.Cells(3).Width = Unit.Pixel(90)
|
||||
'e.Row.Cells(5).Width = Unit.Pixel(80)
|
||||
'e.Row.Cells(8).Width = Unit.Pixel(100)
|
||||
|
||||
If e.Row.DBCampo("Gpo") = "" Then
|
||||
e.Row.Cells(5).Text = e.Row.DBCampo("Moneda").ToString
|
||||
e.Row.CssClass = "Totales"
|
||||
@@ -593,9 +557,6 @@ Partial Class Ventas_RepProductosServiciosDetalle
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
'Dim FechaI, FechaF As String
|
||||
'FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), "-1")
|
||||
'FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1")
|
||||
@@ -663,7 +624,6 @@ Partial Class Ventas_RepProductosServiciosDetalle
|
||||
DdlProveedor.Attributes.Add("data-metodo", "getproveedores")
|
||||
DdlProveedor.SelectedText = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("RazonSocial", String.Format("CveProveedor = {0}", CveProveedor))
|
||||
Else
|
||||
|
||||
DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
|
||||
DdlProveedor.DataBind()
|
||||
DdlProveedor.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
@@ -180,15 +180,15 @@ Partial Class Ventas_RepRecuperacion
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim Liga4 As String = String.Format("/Ventas/RepRecuperacionDetalle.aspx?GPO={0}&CveCliente={1}&CveSubProyecto={2}&Vendedor={3}&CveUsuario={4}&CveEstatusFactura={5}&IVA={6}&FechaI={7}&FechaF={8}&CveResponsable={9}&TipoDocto={10}&CveClienteSucursal={11}&CveBanco{12}&CveCuenta{13}&Grupo={14}&TipoCambio={15}&TCEspecifico={16}&CveMoneda={17}&Tipo={18}&EsDistribuidor={19}&FechaAplicadoI={20}&FechaAplicadoF={21}&FechaRegistroIEI={22}&FechaRegistroIEF={23}",
|
||||
Dim Liga4 As String = String.Format("/Ventas/RepRecuperacionDetalle.aspx?GPO={0}&CveCliente={1}&CveSubProyecto={2}&Vendedor={3}&CveUsuario={4}&CveEstatusFactura={5}&IVA={6}&FechaI={7}&FechaF={8}&CveResponsable={9}&TipoDocto={10}&CveClienteSucursal={11}&CveBanco{12}&CveCuenta{13}&Grupo={14}&TipoCambio={15}&TCEspecifico={16}&CveMoneda={17}&Tipo={18}&EsDistribuidor={19}&FechaAplicadoI={20}&FechaAplicadoF={21}&FechaRegistroIEI={22}&FechaRegistroIEF={23}&CveCondicionesPago={24}&CveTipoTransaccion={25}",
|
||||
DdlGrupo.SelectedValue, e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"),
|
||||
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), CveClienteSucursal, e.Row.DBCampo("CveBanco"), e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("GPO"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), e.Row.DBCampo("CveMoneda"), 2, e.Row.DBCampo("EsDistribuidor"), FechaAplicadoI, FechaAplicadoF, FechaRegistroIEI, FechaRegistroIEF)
|
||||
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), CveClienteSucursal, e.Row.DBCampo("CveBanco"), e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("GPO"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), e.Row.DBCampo("CveMoneda"), 2, e.Row.DBCampo("EsDistribuidor"), FechaAplicadoI, FechaAplicadoF, FechaRegistroIEI, FechaRegistroIEF, e.Row.DBCampo("CveCondicionesPago"), e.Row.DBCampo("CveTipoTransaccion"))
|
||||
|
||||
e.Row.FCHyperLink("HplPagado").NavigateUrl = Liga4
|
||||
|
||||
Dim Liga5 As String = String.Format("/Ventas/RepRecuperacionDetalle.aspx?GPO={0}&CveCliente={1}&CveSubProyecto={2}&Vendedor={3}&CveUsuario={4}&CveEstatusFactura={5}&IVA={6}&FechaI={7}&FechaF={8}&CveResponsable={9}&TipoDocto={10}&CveClienteSucursal={11}&CveBanco{12}&CveCuenta{13}&Grupo={14}&TipoCambio={15}&TCEspecifico={16}&CveMoneda={17}&Tipo={18}&EsDistribuidor={19}&FechaAplicadoI={20}&FechaAplicadoF={21}&FechaRegistroIEI={22}&FechaRegistroIEF={23}",
|
||||
Dim Liga5 As String = String.Format("/Ventas/RepRecuperacionDetalle.aspx?GPO={0}&CveCliente={1}&CveSubProyecto={2}&Vendedor={3}&CveUsuario={4}&CveEstatusFactura={5}&IVA={6}&FechaI={7}&FechaF={8}&CveResponsable={9}&TipoDocto={10}&CveClienteSucursal={11}&CveBanco{12}&CveCuenta{13}&Grupo={14}&TipoCambio={15}&TCEspecifico={16}&CveMoneda={17}&Tipo={18}&EsDistribuidor={19}&FechaAplicadoI={20}&FechaAplicadoF={21}&FechaRegistroIEI={22}&FechaRegistroIEF={23}&CveCondicionesPago={24}&CveTipoTransaccion={25}",
|
||||
DdlGrupo.SelectedValue, e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"),
|
||||
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), CveClienteSucursal, e.Row.DBCampo("CveBanco"), e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("GPO"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), e.Row.DBCampo("CveMoneda"), 1, e.Row.DBCampo("EsDistribuidor"), FechaAplicadoI, FechaAplicadoF, FechaRegistroIEI, FechaRegistroIEF)
|
||||
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), CveClienteSucursal, e.Row.DBCampo("CveBanco"), e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("GPO"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), e.Row.DBCampo("CveMoneda"), 1, e.Row.DBCampo("EsDistribuidor"), FechaAplicadoI, FechaAplicadoF, FechaRegistroIEI, FechaRegistroIEF, e.Row.DBCampo("CveCondicionesPago"), e.Row.DBCampo("CveTipoTransaccion"))
|
||||
|
||||
e.Row.FCHyperLink("HplVendido").NavigateUrl = Liga5
|
||||
|
||||
|
||||
@@ -179,8 +179,8 @@
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 truncate">Fecha Aplicado Inicio: </div>
|
||||
<div class="col-md-1" style="padding-left: 0px !important;">
|
||||
<div class="col-md-1 truncate">Fecha Aplicado I: </div>
|
||||
<div class="col-md-2" style="padding-left: 0px !important;">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important;">
|
||||
<asp:TextBox Width="80px" ID="TxtFechaAplicadoI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
@@ -194,8 +194,8 @@
|
||||
<ajax:ValidatorCalloutExtender ID="vcoFfvFAplicadoI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaAplicadoI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFAplicadoI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaAplicadoI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<div class="col-md-1 truncate">Fecha Aplicado Fin: </div>
|
||||
<div class="col-md-1">
|
||||
<div class="col-md-1 truncate">Fecha Aplicado F: </div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important;">
|
||||
<asp:TextBox Width="80px" ID="TxtFechaAplicadoF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
@@ -219,8 +219,14 @@
|
||||
<asp:ListItem Text="No" Value="0"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1 truncate">F. Registro IE inicio:</div>
|
||||
<div class="col-md-1" style="padding-left: 0px !important;">
|
||||
<label id="Label2" class="col-md-1 truncate">Tipo Transacción:</label>
|
||||
<div class="col-md-2" id="div1" >
|
||||
<asp:DropDownList ID="DdlTipoTransaccion" runat="server" DataTextField="TipoTransaccion" DataValueField="CveTipoTransaccion" AppendDataBoundItems="true" CssClass="form-control input-small input-sm select2me" Width="100%">
|
||||
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1 truncate">F. Registro IE Inicio:</div>
|
||||
<div class="col-md-2" style="padding-left: 0px !important;">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; ">
|
||||
<asp:TextBox Width="80px" ID="TxtFechaRegistroIEI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
@@ -235,7 +241,7 @@
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFRegistroIEI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaRegistroIEI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<div class="col-md-1 truncate">F. Registro IE Fin:</div>
|
||||
<div class="col-md-1" >
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding-left: 0px !important;">
|
||||
<asp:TextBox Width="80px" ID="TxtFechaRegistroIEF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
@@ -249,7 +255,18 @@
|
||||
<ajax:ValidatorCalloutExtender ID="vcoFfvFRegistroIEF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaRegistroIEF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFRegistroIEF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaRegistroIEF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-1 truncate">Condiciones de Pago</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlCondicionesPago" runat="server" AppendDataBoundItems="true" 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:ListItem Text="Crédito" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Contado" Value="0"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
|
||||
@@ -133,10 +133,11 @@ Partial Class Ventas_RepRecuperacionDetalle
|
||||
DdlMoneda.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlMoneda.DataBind()
|
||||
|
||||
'txtFechaI.Text = $"01/{Now.Month}/{Now.Year}"
|
||||
'txtFechaF.Text = Now.ToShortDateString
|
||||
|
||||
'Cargamos las fechas
|
||||
DdlTipoTransaccion.DataSource = GlobalDTTipoTransacciones().FiltraParametros("Tipo = 'Ing' and Estatus = True ")
|
||||
DdlTipoTransaccion.DataBind()
|
||||
DdlTipoTransaccion.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
'Cargamos las fechas
|
||||
FechaI = If(Request("FechaI") IsNot Nothing, Request("FechaI").ToString, "-1").ToString
|
||||
FechaF = If(Request("FechaF") IsNot Nothing, Request("FechaF").ToString, "-1").ToString
|
||||
If FechaF <> "-1" Then
|
||||
@@ -146,11 +147,11 @@ Partial Class Ventas_RepRecuperacionDetalle
|
||||
txtFechaI.Text = FechaI
|
||||
End If
|
||||
|
||||
FechaAplicadoI = If(Request("FechaAplicadoI") IsNot Nothing And Request("FechaAplicadoI").ToString <> "01/01/1900", Request("FechaAplicadoI").ToString, "-1").ToString
|
||||
FechaAplicadoF = If(Request("FechaAplicadoF") IsNot Nothing And Request("FechaAplicadoF").ToString <> "01/01/9999", Request("FechaAplicadoF").ToString, "-1").ToString
|
||||
FechaAplicadoI = If(Request("FechaAplicadoI") IsNot Nothing AndAlso Request("FechaAplicadoI").ToString <> "01/01/1900", Request("FechaAplicadoI").ToString, "-1").ToString
|
||||
FechaAplicadoF = If(Request("FechaAplicadoF") IsNot Nothing AndAlso Request("FechaAplicadoF").ToString <> "01/01/9999", Request("FechaAplicadoF").ToString, "-1").ToString
|
||||
|
||||
FechaRegistroIEI = If(Request("FechaRegistroIEI") IsNot Nothing And Request("FechaRegistroIEI").ToString <> "01/01/1900", Request("FechaRegistroIEI").ToString, "-1").ToString
|
||||
FechaRegistroIEF = If(Request("FechaRegistroIEF") IsNot Nothing And Request("FechaRegistroIEF").ToString <> "01/01/9999", Request("FechaRegistroIEF").ToString, "-1").ToString
|
||||
FechaRegistroIEI = If(Request("FechaRegistroIEI") IsNot Nothing AndAlso Request("FechaRegistroIEI").ToString <> "01/01/1900", Request("FechaRegistroIEI").ToString, "-1").ToString
|
||||
FechaRegistroIEF = If(Request("FechaRegistroIEF") IsNot Nothing AndAlso Request("FechaRegistroIEF").ToString <> "01/01/9999", Request("FechaRegistroIEF").ToString, "-1").ToString
|
||||
|
||||
If FechaAplicadoF <> "-1" Then
|
||||
TxtFechaAplicadoF.Text = FechaAplicadoF
|
||||
@@ -230,6 +231,8 @@ Partial Class Ventas_RepRecuperacionDetalle
|
||||
DdlClienteClasificacion.SelectedValueExist(CveClienteClasificacion)
|
||||
DdlClienteSucursal.SelectedValueExist(CveClienteSucursal)
|
||||
DdlDistribuidor.SelectedValueExist(EsDistribuidor)
|
||||
DdlTipoTransaccion.SelectedValueExist(IfNull(Request("CveTipoTransaccion"), "-1").ToString.ToEntero)
|
||||
DdlCondicionesPago.SelectedValueExist(IfNull(Request("CveCondicionesPago"), "-1").ToString.ToEntero)
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
lblEsDistribuidor.Visible = True
|
||||
@@ -256,7 +259,8 @@ Partial Class Ventas_RepRecuperacionDetalle
|
||||
Iva.ToString, DdlGrupo.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlResponsable.SelectedValue.ToEntero,
|
||||
DdlTipoDocto.SelectedValue, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveBanco:=DdlBanco.SelectedValue.ToEntero, CveCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero, Grupo:=Grupo,
|
||||
TipoCambio:=RblTipoCambio.SelectedValue.ToEntero, TCEspecifico:=TCEspecifico, CveMoneda:=DdlMoneda.SelectedValue.ToEntero, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, Tipo:=Tipo,
|
||||
EsDistribuidor:=DdlDistribuidor.SelectedValue.ToEntero(), FechaAplicadoI:=FechaAplicadoI, FechaAplicadoF:=FechaAplicadoF, FechaRegistroIEI:=FechaRegistroIEI, FechaRegistroIEF:=FechaRegistroIEF) Then
|
||||
EsDistribuidor:=DdlDistribuidor.SelectedValue.ToEntero(), FechaAplicadoI:=FechaAplicadoI, FechaAplicadoF:=FechaAplicadoF, FechaRegistroIEI:=FechaRegistroIEI, FechaRegistroIEF:=FechaRegistroIEF,
|
||||
CveTipoTransaccion:=DdlTipoTransaccion.SelectedValue.ToEntero, CveCondicionesPago:=DdlCondicionesPago.SelectedValue.ToEntero) Then
|
||||
|
||||
GvDatos.DataSource = ObjMovtos.DtResultados
|
||||
DtDatos = ObjMovtos.DtResultados
|
||||
|
||||
@@ -1170,11 +1170,13 @@
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:Literal ID="LtlPU" runat="server" Text='<%# Eval("PU") %>' Visible="false"></asp:Literal>
|
||||
<asp:TextBox ID="TxtPrecio" runat="server" CausesValidation="true" MaxLength="12" Text='<%# Eval("PU") %>' ValidationGroup="GprGV" Width="78px" Height="24px"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtPrecio" runat="server" CausesValidation="true" MaxLength="12" Text='<%# Eval("PU", "{0:0.00####}") %>' ValidationGroup="GprGV" Width="78px" Height="24px"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="SoloNumeros" runat="server" TargetControlID="TxtPrecio" FilterType="Custom, Numbers" ValidChars="." />
|
||||
<asp:RequiredFieldValidator ID="RFVPrecio" runat="server" ControlToValidate="TxtPrecio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Precio''</b> es necesario, por favor ingréselo." ValidationGroup="GprGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCPrecio" runat="server" HighlightCssClass="vco" TargetControlID="RFVPrecio" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
<asp:CustomValidator ID="CVPrecioEdit" runat="server" ClientValidationFunction="ValidaDecimal6digits" ControlToValidate="TxtPrecio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Precio''</b> no tiene el formato correcto. Por favor rectifique y vuelva a intentar." ValidateEmptyText="True" ValidationGroup="GprGV"></asp:CustomValidator>
|
||||
|
||||
<ajax:ValidatorCalloutExtender ID="VCEPrecioEdit" runat="server" HighlightCssClass="vco" TargetControlID="CVPrecioEdit" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
@@ -9011,290 +9011,299 @@ Partial Class Ventas
|
||||
|
||||
ViewState("CveVenta") = ObjFactura.CveVenta
|
||||
|
||||
|
||||
|
||||
|
||||
If Request("CveEmbarqueManifiesto") IsNot Nothing AndAlso IsNumeric(Request("CveEmbarqueManifiesto")) AndAlso Request("CveEmbarqueManifiesto").ToEntero() > 0 Then
|
||||
|
||||
If ObjVentas.Embarque_ManifiestoUpvta(ObjFactura.CveVenta, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, Request("CveEmbarqueManifiesto").ToEntero()) Then
|
||||
|
||||
End If
|
||||
End If
|
||||
GVAnticipos.DataBind()
|
||||
|
||||
|
||||
Try
|
||||
Dim DirectoriArchivoXML As String = String.Format("{0}{1}", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto) ' System.IO.Path.Combine()
|
||||
If Not Directory.Exists(DirectoriArchivoXML) Then
|
||||
Directory.CreateDirectory(DirectoriArchivoXML)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Dim DirectoriArchivoXML As String = String.Format("{0}{1}", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto) ' System.IO.Path.Combine()
|
||||
If Not Directory.Exists(DirectoriArchivoXML) Then
|
||||
Directory.CreateDirectory(DirectoriArchivoXML)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
End Try
|
||||
|
||||
|
||||
Dim SeTimbro As Boolean = False
|
||||
Dim SeTimbroNC As Boolean = False
|
||||
Dim EstatusSMS = 0
|
||||
Dim SeTimbro As Boolean = False
|
||||
Dim SeTimbroNC As Boolean = False
|
||||
Dim EstatusSMS = 0
|
||||
|
||||
Dim MsgCancelacionRefacturacion As Modelos.Factura.MCancelacionVentaMensaje = Nothing
|
||||
Dim MsgCancelacionRefacturacion As Modelos.Factura.MCancelacionVentaMensaje = Nothing
|
||||
|
||||
'TIMBRADO Y CASO ESPECIAL NOTA DE CREDITO
|
||||
If (TipoDoctoDevolucion = "" OrElse Not TipoDoctoDevolucion.Contiene("Rem", "RNC", "Cot", "Ped", "DPe", "PA", "Pd2")) Then
|
||||
'TIMBRADO Y CASO ESPECIAL NOTA DE CREDITO
|
||||
If (TipoDoctoDevolucion = "" OrElse Not TipoDoctoDevolucion.Contiene("Rem", "RNC", "Cot", "Ped", "DPe", "PA", "Pd2")) Then
|
||||
|
||||
Dim DebeTimbrar As Boolean = True
|
||||
If UsuarioActual.CveEmpresa.Contiene(1, 72, 80) Then
|
||||
'si tiene anticipos seleccionados y el total es cero, que no se timbre(previo empresa72)
|
||||
If LblAmortizacion.Text.ToDouble > 0 And TxtTotal.Text.ToDouble <= 0 Then
|
||||
DebeTimbrar = False
|
||||
End If
|
||||
End If
|
||||
Dim DebeTimbrar As Boolean = True
|
||||
If UsuarioActual.CveEmpresa.Contiene(1, 72, 80) Then
|
||||
'si tiene anticipos seleccionados y el total es cero, que no se timbre(previo empresa72)
|
||||
If LblAmortizacion.Text.ToDouble > 0 And TxtTotal.Text.ToDouble <= 0 Then
|
||||
DebeTimbrar = False
|
||||
End If
|
||||
End If
|
||||
|
||||
'Si es AMORTIZACIÓN ANTICIPO SOBRE FACTURA EN CERO no debe timbrar
|
||||
If DdlTipoAmortizacionAnticipo.SelectedValue = "3" Then
|
||||
DebeTimbrar = False
|
||||
End If
|
||||
'Si es AMORTIZACIÓN ANTICIPO SOBRE FACTURA EN CERO no debe timbrar
|
||||
If DdlTipoAmortizacionAnticipo.SelectedValue = "3" Then
|
||||
DebeTimbrar = False
|
||||
End If
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(335) Then
|
||||
DebeTimbrar = False
|
||||
End If
|
||||
If UsuarioActual.TienePermisoProceso(335) Then
|
||||
DebeTimbrar = False
|
||||
End If
|
||||
|
||||
If DebeTimbrar AndAlso ObjFactura.TipoDocto.Contiene("Ing", "Egs", "Ant", "Dev") Then
|
||||
If UsuarioActual.Empresa.TipoFacturacion = "CFDi" AndAlso (UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa = 1) Then
|
||||
If DebeTimbrar AndAlso ObjFactura.TipoDocto.Contiene("Ing", "Egs", "Ant", "Dev") Then
|
||||
If UsuarioActual.Empresa.TipoFacturacion = "CFDi" AndAlso (UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa = 1) Then
|
||||
|
||||
'FACTURA INGRESO/EGRESO
|
||||
Dim FM As New Modelos.FemsaFactura
|
||||
Dim TmpDT7Eleven As New DataTable
|
||||
Dim TmpDTComplementosTimbrado As New DataTable
|
||||
'FACTURA INGRESO/EGRESO
|
||||
Dim FM As New Modelos.FemsaFactura
|
||||
Dim TmpDT7Eleven As New DataTable
|
||||
Dim TmpDTComplementosTimbrado As New DataTable
|
||||
|
||||
If AplicaFEMSA Then
|
||||
PrepararTimbrado(FM, TmpDT7Eleven, TmpDTComplementosTimbrado)
|
||||
End If
|
||||
|
||||
Dim ObjTimbrado As New Timbrado
|
||||
SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura)
|
||||
Dim FolioFiscalFactura As String = ObjTimbrado.UUID
|
||||
Dim MsgErrorTimbrado = ObjTimbrado.MensajeErrorCFDI
|
||||
ObjTimbrado = Nothing
|
||||
|
||||
'NOTA DE CREDITO - REFACTURADA - CASO ESPECIAL, TIMBRADO E IMPRESION
|
||||
If DebeTimbrar AndAlso ListaNotasCreditoGeneradas.Count > 0 Then
|
||||
Try
|
||||
For Each NCGenerada In ListaNotasCreditoGeneradas
|
||||
If NCGenerada.Timbre IsNot Nothing Then
|
||||
NCGenerada.Timbre.CFDIRelacionados.UUID.Clear()
|
||||
NCGenerada.Timbre.CFDIRelacionados.UUID.Add(FolioFiscalFactura)
|
||||
|
||||
Dim ObjTimbradoNC As New Timbrado
|
||||
Dim TimbroNC = ObjTimbradoNC.TimbrarFactura(UsuarioActual, NCGenerada)
|
||||
|
||||
If Not TimbroNC Then
|
||||
Alert(ObjTimbradoNC.MensajeErrorCFDI, TipoMensaje.MsgError)
|
||||
End If
|
||||
ObjTimbradoNC = Nothing
|
||||
If AplicaFEMSA Then
|
||||
PrepararTimbrado(FM, TmpDT7Eleven, TmpDTComplementosTimbrado)
|
||||
End If
|
||||
Next
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al timbrar la NC.", ex)
|
||||
End Try
|
||||
|
||||
Dim ObjTimbrado As New Timbrado
|
||||
SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura)
|
||||
Dim FolioFiscalFactura As String = ObjTimbrado.UUID
|
||||
Dim MsgErrorTimbrado = ObjTimbrado.MensajeErrorCFDI
|
||||
ObjTimbrado = Nothing
|
||||
|
||||
'NOTA DE CREDITO - REFACTURADA - CASO ESPECIAL, TIMBRADO E IMPRESION
|
||||
If DebeTimbrar AndAlso ListaNotasCreditoGeneradas.Count > 0 Then
|
||||
Try
|
||||
For Each NCGenerada In ListaNotasCreditoGeneradas
|
||||
If NCGenerada.Timbre IsNot Nothing Then
|
||||
NCGenerada.Timbre.CFDIRelacionados.UUID.Clear()
|
||||
NCGenerada.Timbre.CFDIRelacionados.UUID.Add(FolioFiscalFactura)
|
||||
|
||||
Dim ObjTimbradoNC As New Timbrado
|
||||
Dim TimbroNC = ObjTimbradoNC.TimbrarFactura(UsuarioActual, NCGenerada)
|
||||
|
||||
If Not TimbroNC Then
|
||||
Alert(ObjTimbradoNC.MensajeErrorCFDI, TipoMensaje.MsgError)
|
||||
End If
|
||||
ObjTimbradoNC = Nothing
|
||||
End If
|
||||
Next
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al timbrar la NC.", ex)
|
||||
End Try
|
||||
|
||||
End If
|
||||
|
||||
If SeTimbro AndAlso ObjFactura.TipoDocto.Contiene("Ing") Then
|
||||
EstatusSMS = EnviarSMSTimbrado(ObjEventos)
|
||||
End If
|
||||
|
||||
If Not SeTimbro Then
|
||||
Alert(MsgErrorTimbrado, TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
'CANCELAR FACTURA ANTERIOR
|
||||
If SeTimbro AndAlso (Me.CveDevolucion > 0 AndAlso Me.NuevaFactura = 1) Then
|
||||
If Me.ObjFacturaNC IsNot Nothing Then
|
||||
Me.ObjFacturaNC.CveEstatusRefacturacion = 2 'MARCAR COMO REFACTURADA
|
||||
MsgCancelacionRefacturacion = Me.ObjFacturaNC.CancelarPorRefacturacion(Me.ObjFacturaNC.CveMotivoCancelacion, Me.ObjFacturaNC.MotivoCancelacion, FolioFiscalFactura)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If SeTimbro AndAlso ObjFactura.TipoDocto.Contiene("Ing") Then
|
||||
EstatusSMS = EnviarSMSTimbrado(ObjEventos)
|
||||
End If
|
||||
'VERIFICAR 100% AVANCE A IMPORTE Y CANTIDAD
|
||||
If ObjFactura.TipoDocto.Contiene("Ing", "Ant") AndAlso CveContrato > 0 Then
|
||||
If ObjContr.GetContratos(CveContrato, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
If Not SeTimbro Then
|
||||
Alert(MsgErrorTimbrado, TipoMensaje.MsgError)
|
||||
End If
|
||||
If ObjContr.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
'CANCELAR FACTURA ANTERIOR
|
||||
If SeTimbro AndAlso (Me.CveDevolucion > 0 AndAlso Me.NuevaFactura = 1) Then
|
||||
If Me.ObjFacturaNC IsNot Nothing Then
|
||||
Me.ObjFacturaNC.CveEstatusRefacturacion = 2 'MARCAR COMO REFACTURADA
|
||||
MsgCancelacionRefacturacion = Me.ObjFacturaNC.CancelarPorRefacturacion(Me.ObjFacturaNC.CveMotivoCancelacion, Me.ObjFacturaNC.MotivoCancelacion, FolioFiscalFactura)
|
||||
|
||||
'SI ES FLEXIBLE QUE NOTIFIQUE EL MONTO MAXIMO, SI NO LO ES QUE NOTIFIQUE EL PORCENTAJE ALCANZADO... FLEXIBLE = 2, NO FLEXIBLE = 1
|
||||
If ObjContr.DtResultados.Rows(0)("ModalidadDetalle").ToString() = "1" Then
|
||||
Dim PorcentajeAvance As Double = ObjContr.DtResultados.Rows(0)("ContratoAvance").ToString().ToDouble
|
||||
|
||||
If PorcentajeAvance >= 100 Then
|
||||
EnviarNotificacionAvance(ObjContr.DtResultados.Rows(0)("NumeroContrato").ToString(), ObjContr.DtResultados.Rows(0)("DescripcionContrato").ToString(), ObjContr.DtResultados.Rows(0)("ContratoTipo").ToString(), ObjContr.DtResultados.Rows(0)("NombreComercial").ToString(), ObjContr.DtResultados.Rows(0)("CorreoVendedor").ToString())
|
||||
End If
|
||||
Else
|
||||
Dim MontoMaximo As Double = ObjContr.DtResultados.Rows(0)("ImporteMax").ToString().ToDouble
|
||||
Dim Avance As Double = ObjContr.DtResultados.Rows(0)("Avance").ToString().ToDouble
|
||||
|
||||
Dim PorcentajeAvance As Double = (Avance / MontoMaximo) * 100
|
||||
|
||||
If PorcentajeAvance >= 100 And MontoMaximo > 0 Then
|
||||
EnviarNotificacionAvance(ObjContr.DtResultados.Rows(0)("NumeroContrato").ToString(), ObjContr.DtResultados.Rows(0)("DescripcionContrato").ToString(), ObjContr.DtResultados.Rows(0)("ContratoTipo").ToString(), ObjContr.DtResultados.Rows(0)("NombreComercial").ToString(), ObjContr.DtResultados.Rows(0)("CorreoVendedor").ToString(), MontoMaximo)
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
'VERIFICAR 100% AVANCE A IMPORTE Y CANTIDAD
|
||||
If ObjFactura.TipoDocto.Contiene("Ing", "Ant") AndAlso CveContrato > 0 Then
|
||||
If ObjContr.GetContratos(CveContrato, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
If ObjContr.DtResultados.Rows.Count > 0 Then
|
||||
'MENSAJE PRINCIPAL
|
||||
MensajeAlert.AppendFormat(String.Format("<br/>La {0}: <b>{1}</b> se generó correctamente.<br/><br/>", ObjFactura.TipoDocumento, ObjFactura.SerieFolio))
|
||||
|
||||
|
||||
'SI ES FLEXIBLE QUE NOTIFIQUE EL MONTO MAXIMO, SI NO LO ES QUE NOTIFIQUE EL PORCENTAJE ALCANZADO... FLEXIBLE = 2, NO FLEXIBLE = 1
|
||||
If ObjContr.DtResultados.Rows(0)("ModalidadDetalle").ToString() = "1" Then
|
||||
Dim PorcentajeAvance As Double = ObjContr.DtResultados.Rows(0)("ContratoAvance").ToString().ToDouble
|
||||
|
||||
If PorcentajeAvance >= 100 Then
|
||||
EnviarNotificacionAvance(ObjContr.DtResultados.Rows(0)("NumeroContrato").ToString(), ObjContr.DtResultados.Rows(0)("DescripcionContrato").ToString(), ObjContr.DtResultados.Rows(0)("ContratoTipo").ToString(), ObjContr.DtResultados.Rows(0)("NombreComercial").ToString(), ObjContr.DtResultados.Rows(0)("CorreoVendedor").ToString())
|
||||
' DESCARGA XML - SI SE TIMBRA MANDA CORREO CON FACTURA
|
||||
If SeTimbro Then
|
||||
Dim ArchivoXML = String.Format("{0}/XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto, ObjFactura.SerieFolio)
|
||||
If File.Exists(ArchivoXML) Then
|
||||
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar XML</a></li></ul>", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", CveVenta, "XML", ObjFactura.SerieFolio, ObjFactura.TipoDocto)))
|
||||
End If
|
||||
GeneraPDFFactura(ChkEnviarFactura.Checked) 'MANDA CORREO
|
||||
|
||||
End If
|
||||
|
||||
'DESCARGA PDF
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant", "Egs", "Dev", "Pd2") Then
|
||||
'If Not ImprimeAlert Then
|
||||
|
||||
Dim ArchivoIngPyMe As New System.IO.FileInfo(String.Format("{0}Formatos/Factura.mrt", UsuarioActual.Empresa.Ruta))
|
||||
Dim ArchivoIng As New System.IO.FileInfo(String.Format("{0}Formatos/Factura.rdlc", UsuarioActual.Empresa.Ruta))
|
||||
Dim ArchivoRem As New System.IO.FileInfo(String.Format("{0}Formatos/Remision.rdlc", UsuarioActual.Empresa.Ruta))
|
||||
Dim ArchivoEgs As New System.IO.FileInfo(String.Format("{0}Formatos/NotaCredito.rdlc", UsuarioActual.Empresa.Ruta))
|
||||
|
||||
If ArchivoIng.Exists Or ArchivoRem.Exists Or ArchivoIngPyMe.Exists Or ArchivoEgs.Exists Then
|
||||
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", CveVenta)))
|
||||
Else
|
||||
MensajeAlert.Append("Ocurrió un error al generar el PDF. Por favor vuelva a entrar a la factura para imprimir el PDF. ")
|
||||
End If
|
||||
End If
|
||||
|
||||
'ERROR DE NO TIMBRADO
|
||||
If Not SeTimbro And (DdlTipoComprobante.SelectedValue = "Ing" Or DdlTipoComprobante.SelectedValue.Contiene("Egs", "Dev") Or DdlTipoComprobante.SelectedValue = "Ant") Then
|
||||
MensajeAlert.AppendFormat("La factura no se pudo timbrar.</b> Por favor intentelo de nuevo a traves del boton Emitir.")
|
||||
End If
|
||||
|
||||
'ERROR DE NO TIMBRADO NC
|
||||
If Not IsNothing(ObjNC) AndAlso ObjNC.Count > 0 AndAlso Not SeTimbroNC Then
|
||||
MensajeAlert.AppendFormat("<br/>La NC <b>#{0}</b> no se pudo timbrar.</b> Por favor intentelo de nuevo a traves del boton Emitir.", CType(ObjNC(0), Modelos.Factura).SerieFolio)
|
||||
End If
|
||||
|
||||
'NOTIFICACION DE SMS
|
||||
Select Case EstatusSMS
|
||||
Case 1
|
||||
MensajeAlert.AppendFormat("<br/><b>Notificación SMS:</b> enviado con éxito al cliente al celular: <b>{0}</b>", ObjFactura.Cliente.CobranzaTelefono)
|
||||
Case 2
|
||||
MensajeAlert.AppendFormat("<br/><b>Notificación SMS:</b> sin enviar. Ocurrió un error en el envío, por favor verifique la información del cliente.")
|
||||
Case 3
|
||||
MensajeAlert.AppendFormat("<br/><b>Notificación SMS:</b> sin enviar. No se pudo cargar el celular del cliente, por favor verifique la información del cliente.")
|
||||
End Select
|
||||
|
||||
|
||||
'AUTO DESCARGAR PDF
|
||||
If UsuarioActual.CveEmpresa.Contiene(72, 1) Then
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") Then
|
||||
RegistraScript($"window.location.href = '/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", CveVenta))}'", "Imprimir")
|
||||
End If
|
||||
End If
|
||||
|
||||
'DESCARGAR PDF DE CICOVISA
|
||||
'If UsuarioActual.CveEmpresa = 72 And CveCliente = 70381 Then
|
||||
' If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem") Then
|
||||
' MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar Formato CICOVISA</a></li></ul><br/>", Encripta(String.Format("OP=CIC&CVEVENTA={0}", CveVenta)))
|
||||
' End If
|
||||
'End If
|
||||
|
||||
If DdlTipoComprobante.SelectedValue = "Cot" Then
|
||||
If Not CveEmpresaCRM > 0 Then
|
||||
If CveVenta > 0 Then MensajeAlert = New StringBuilder
|
||||
Dim ArchivoCotizacion As New System.IO.FileInfo(String.Format("{0}Formatos/Cotizacion.rdlc", UsuarioActual.Empresa.Ruta))
|
||||
|
||||
If Opcion = "Cot" And UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
||||
MensajeAlert.AppendFormat("<b><a class='Texto' href=""Ventas.aspx?CveVenta={0}"">Facturar</a></b><br/><br/>", CveVenta)
|
||||
End If
|
||||
|
||||
If ArchivoCotizacion.Exists Then
|
||||
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=0", CveVenta)))
|
||||
Else
|
||||
MensajeAlert.Append("Ocurrió un error al generar el PDF. Por favor vuelva a entrar a la factura para imprimir el PDF. ")
|
||||
End If
|
||||
|
||||
GeneraPDFCotizacion(ChkEnviarFactura.Checked) ' MANDA CORREO
|
||||
End If
|
||||
ElseIf DdlTipoComprobante.SelectedValue = "Rem" Then
|
||||
If UsuarioActual.CveEmpresa.Contiene(81, 109) Then
|
||||
EnviaPDFRemision(ChkEnviarFactura.Checked)
|
||||
End If
|
||||
End If
|
||||
|
||||
'ENVIA CORREO CON DETALLE DEL CONTRATO
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("DPe", "Ped") Then
|
||||
If Not String.IsNullOrEmpty(CorreoNotificacionPedDev) Then
|
||||
EnviarCorreoDevPed()
|
||||
End If
|
||||
End If
|
||||
|
||||
'MOVIMIENTO DE ALMACEN
|
||||
If ObjFactura.Inv_CveMovimiento > 0 Then
|
||||
MensajeAlert.AppendFormat("<br/><br/><b><a target='_blank' class='Texto' href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"">Movimiento de Almacén</a></b><br/>", ObjFactura.Inv_CveMovimiento)
|
||||
End If
|
||||
|
||||
If TieneAnticipo AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "2" Then
|
||||
MensajeAlert.AppendFormat("<br/><br/><b> Se generó una Nota de crédito Folio: {0} amortizando el anticipo </b><br/>", ObjFacturaDevolucion.Folio)
|
||||
End If
|
||||
|
||||
If RBLPago.SelectedValue.ToEntero() = 2 And TxtCambio.Text.ToDecimal > 0 Then
|
||||
MensajeAlert.AppendFormat("<br/><br/>Su cambio es de <b>${0}</b><br/>", TxtCambio.Text.ToDecimal.FormatoNumero(2))
|
||||
End If
|
||||
|
||||
If CveVentaNCProntoPago > 0 Then
|
||||
MensajeAlert.AppendFormat(String.Format("<br/>La nota de crédito <b>{0}</b> por descuento pronto pago se generó correctamente.<br/><br/>", SerieFolioNCProntoPago))
|
||||
End If
|
||||
|
||||
If MsgCancelacionRefacturacion IsNot Nothing Then
|
||||
If Not MsgCancelacionRefacturacion.HuboError Then
|
||||
If MsgCancelacionRefacturacion.CveEstatus = 5 Then
|
||||
MensajeAlert.AppendFormat("<br/>El folio <b>{0}</b> fue cancelado. <b><a target='_blank' class='Texto' href=""/Compras/PopUpVerFactura.aspx?P={1}"">Descargar Acuse</a></b>", Me.ObjFacturaNC.SerieFolio, Encripta(String.Format("OP=CAN&CVEVTA={0}", Me.ObjFacturaNC.CveVenta)))
|
||||
ElseIf MsgCancelacionRefacturacion.CveEstatus = 20 Then
|
||||
MensajeAlert.AppendFormat("<br/>El folio <b>{0}</b> esta en proceso de cancelación. <b><a target='_blank' class='Texto' href=""/Compras/PopUpVerFactura.aspx?P={1}"">Descargar Acuse</a></b>", Me.ObjFacturaNC.SerieFolio, Encripta(String.Format("OP=CAN&CVEVTA={0}", Me.ObjFacturaNC.CveVenta)))
|
||||
End If
|
||||
MensajeAlert.AppendFormat(" <a target='_self' class='Texto' href=""javascript:BtnEnviarMailCancelacion({0});"">Enviar Acuse</a>.<br/><br/>", Me.ObjFacturaNC.CveVenta)
|
||||
End If
|
||||
End If
|
||||
|
||||
'MUESTA ALERT OK
|
||||
' si es elrol 1165-Ventas,EMp:80, o la empresa 119, recarga ventas, para seguir registrando-.
|
||||
'Dim Liga = If(UsuarioActual.CveRol = 1165 Or UsuarioActual.CveEmpresa = 119, "document.location.href=""/Ventas/Ventas.aspx?CveVenta=-1"";", If(CveEmpresaCRM > 0, $"document.location.href=""/CRM/EmpresaCRM.aspx?CveEmpresaCRM={CveEmpresaCRM}"";", $"document.location.href=""/Ventas/Ventas.aspx?CveVenta=-1"";"))
|
||||
'Alert(MensajeAlert.ToString(), TipoMensaje.MsgInformacion, Liga)
|
||||
|
||||
Dim Liga As String = ""
|
||||
Dim Liga2 As String = ""
|
||||
|
||||
If Request("CveCliente") IsNot Nothing AndAlso Request("CveCliente").ToEntero > 0 Then
|
||||
Liga = $"document.location.href=""/Ventas/Ventas.aspx?CveCliente={Request("CveCliente")}"";"
|
||||
Else
|
||||
Dim MontoMaximo As Double = ObjContr.DtResultados.Rows(0)("ImporteMax").ToString().ToDouble
|
||||
Dim Avance As Double = ObjContr.DtResultados.Rows(0)("Avance").ToString().ToDouble
|
||||
|
||||
Dim PorcentajeAvance As Double = (Avance / MontoMaximo) * 100
|
||||
|
||||
If PorcentajeAvance >= 100 And MontoMaximo > 0 Then
|
||||
EnviarNotificacionAvance(ObjContr.DtResultados.Rows(0)("NumeroContrato").ToString(), ObjContr.DtResultados.Rows(0)("DescripcionContrato").ToString(), ObjContr.DtResultados.Rows(0)("ContratoTipo").ToString(), ObjContr.DtResultados.Rows(0)("NombreComercial").ToString(), ObjContr.DtResultados.Rows(0)("CorreoVendedor").ToString(), MontoMaximo)
|
||||
End If
|
||||
Liga = "document.location.href=""/Ventas/Ventas.aspx?CveVenta=-1"";"
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
If CveEmpresaCRM > 0 Then
|
||||
Liga2 = $"document.location.href=""/CRM/EmpresaCRM.aspx?CveEmpresaCRM={CveEmpresaCRM}"";"
|
||||
Else
|
||||
Liga2 = $"document.location.href=""/Ventas/Clientes.aspx?CveCliente={CveCliente}"";"
|
||||
End If
|
||||
|
||||
'MENSAJE PRINCIPAL
|
||||
MensajeAlert.AppendFormat(String.Format("<br/>La {0}: <b>{1}</b> se generó correctamente.<br/><br/>", ObjFactura.TipoDocumento, ObjFactura.SerieFolio))
|
||||
Alert(MensajeAlert.ToString(), TipoMensaje.MsgDosBotones, Liga, TextoConfirmacion:="Seguir Registrando", TextoSegundoBoton:="Ir al Cliente", JSBtn2:=Liga2, ShowCloseButton:=False)
|
||||
|
||||
MensajeAlert.Clear()
|
||||
|
||||
' DESCARGA XML - SI SE TIMBRA MANDA CORREO CON FACTURA
|
||||
If SeTimbro Then
|
||||
Dim ArchivoXML = String.Format("{0}/XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto, ObjFactura.SerieFolio)
|
||||
If File.Exists(ArchivoXML) Then
|
||||
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar XML</a></li></ul>", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", CveVenta, "XML", ObjFactura.SerieFolio, ObjFactura.TipoDocto)))
|
||||
End If
|
||||
GeneraPDFFactura(ChkEnviarFactura.Checked) 'MANDA CORREO
|
||||
'LIMPIA CONDICIONES DE PAGO - CONTADO
|
||||
RBLPago.SelectedValue = "1"
|
||||
LimpiaEscondeContado()
|
||||
BtnEmitirImprimir.Visible = False
|
||||
ObjFactura = Nothing
|
||||
|
||||
End If
|
||||
|
||||
'DESCARGA PDF
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant", "Egs", "Dev", "Pd2") Then
|
||||
'If Not ImprimeAlert Then
|
||||
|
||||
Dim ArchivoIngPyMe As New System.IO.FileInfo(String.Format("{0}Formatos/Factura.mrt", UsuarioActual.Empresa.Ruta))
|
||||
Dim ArchivoIng As New System.IO.FileInfo(String.Format("{0}Formatos/Factura.rdlc", UsuarioActual.Empresa.Ruta))
|
||||
Dim ArchivoRem As New System.IO.FileInfo(String.Format("{0}Formatos/Remision.rdlc", UsuarioActual.Empresa.Ruta))
|
||||
Dim ArchivoEgs As New System.IO.FileInfo(String.Format("{0}Formatos/NotaCredito.rdlc", UsuarioActual.Empresa.Ruta))
|
||||
|
||||
If ArchivoIng.Exists Or ArchivoRem.Exists Or ArchivoIngPyMe.Exists Or ArchivoEgs.Exists Then
|
||||
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", CveVenta)))
|
||||
Else
|
||||
MensajeAlert.Append("Ocurrió un error al generar el PDF. Por favor vuelva a entrar a la factura para imprimir el PDF. ")
|
||||
End If
|
||||
End If
|
||||
|
||||
'ERROR DE NO TIMBRADO
|
||||
If Not SeTimbro And (DdlTipoComprobante.SelectedValue = "Ing" Or DdlTipoComprobante.SelectedValue.Contiene("Egs", "Dev") Or DdlTipoComprobante.SelectedValue = "Ant") Then
|
||||
MensajeAlert.AppendFormat("La factura no se pudo timbrar.</b> Por favor intentelo de nuevo a traves del boton Emitir.")
|
||||
End If
|
||||
|
||||
'ERROR DE NO TIMBRADO NC
|
||||
If Not IsNothing(ObjNC) AndAlso ObjNC.Count > 0 AndAlso Not SeTimbroNC Then
|
||||
MensajeAlert.AppendFormat("<br/>La NC <b>#{0}</b> no se pudo timbrar.</b> Por favor intentelo de nuevo a traves del boton Emitir.", CType(ObjNC(0), Modelos.Factura).SerieFolio)
|
||||
End If
|
||||
|
||||
'NOTIFICACION DE SMS
|
||||
Select Case EstatusSMS
|
||||
Case 1
|
||||
MensajeAlert.AppendFormat("<br/><b>Notificación SMS:</b> enviado con éxito al cliente al celular: <b>{0}</b>", ObjFactura.Cliente.CobranzaTelefono)
|
||||
Case 2
|
||||
MensajeAlert.AppendFormat("<br/><b>Notificación SMS:</b> sin enviar. Ocurrió un error en el envío, por favor verifique la información del cliente.")
|
||||
Case 3
|
||||
MensajeAlert.AppendFormat("<br/><b>Notificación SMS:</b> sin enviar. No se pudo cargar el celular del cliente, por favor verifique la información del cliente.")
|
||||
End Select
|
||||
|
||||
|
||||
'AUTO DESCARGAR PDF
|
||||
If UsuarioActual.CveEmpresa.Contiene(72, 1) Then
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") Then
|
||||
RegistraScript($"window.location.href = '/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", CveVenta))}'", "Imprimir")
|
||||
End If
|
||||
End If
|
||||
|
||||
'DESCARGAR PDF DE CICOVISA
|
||||
'If UsuarioActual.CveEmpresa = 72 And CveCliente = 70381 Then
|
||||
' If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem") Then
|
||||
' MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar Formato CICOVISA</a></li></ul><br/>", Encripta(String.Format("OP=CIC&CVEVENTA={0}", CveVenta)))
|
||||
' End If
|
||||
'End If
|
||||
|
||||
If DdlTipoComprobante.SelectedValue = "Cot" Then
|
||||
If Not CveEmpresaCRM > 0 Then
|
||||
If CveVenta > 0 Then MensajeAlert = New StringBuilder
|
||||
Dim ArchivoCotizacion As New System.IO.FileInfo(String.Format("{0}Formatos/Cotizacion.rdlc", UsuarioActual.Empresa.Ruta))
|
||||
|
||||
If Opcion = "Cot" And UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
||||
MensajeAlert.AppendFormat("<b><a class='Texto' href=""Ventas.aspx?CveVenta={0}"">Facturar</a></b><br/><br/>", CveVenta)
|
||||
End If
|
||||
|
||||
If ArchivoCotizacion.Exists Then
|
||||
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=0", CveVenta)))
|
||||
Else
|
||||
MensajeAlert.Append("Ocurrió un error al generar el PDF. Por favor vuelva a entrar a la factura para imprimir el PDF. ")
|
||||
End If
|
||||
|
||||
GeneraPDFCotizacion(ChkEnviarFactura.Checked) ' MANDA CORREO
|
||||
End If
|
||||
ElseIf DdlTipoComprobante.SelectedValue = "Rem" Then
|
||||
If UsuarioActual.CveEmpresa.Contiene(81, 109) Then
|
||||
EnviaPDFRemision(ChkEnviarFactura.Checked)
|
||||
End If
|
||||
End If
|
||||
|
||||
'ENVIA CORREO CON DETALLE DEL CONTRATO
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("DPe", "Ped") Then
|
||||
If Not String.IsNullOrEmpty(CorreoNotificacionPedDev) Then
|
||||
EnviarCorreoDevPed()
|
||||
End If
|
||||
End If
|
||||
|
||||
'MOVIMIENTO DE ALMACEN
|
||||
If ObjFactura.Inv_CveMovimiento > 0 Then
|
||||
MensajeAlert.AppendFormat("<br/><br/><b><a target='_blank' class='Texto' href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"">Movimiento de Almacén</a></b><br/>", ObjFactura.Inv_CveMovimiento)
|
||||
End If
|
||||
|
||||
If TieneAnticipo AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "2" Then
|
||||
MensajeAlert.AppendFormat("<br/><br/><b> Se generó una Nota de crédito Folio: {0} amortizando el anticipo </b><br/>", ObjFacturaDevolucion.Folio)
|
||||
End If
|
||||
|
||||
If RBLPago.SelectedValue.ToEntero() = 2 And TxtCambio.Text.ToDecimal > 0 Then
|
||||
MensajeAlert.AppendFormat("<br/><br/>Su cambio es de <b>${0}</b><br/>", TxtCambio.Text.ToDecimal.FormatoNumero(2))
|
||||
End If
|
||||
|
||||
If CveVentaNCProntoPago > 0 Then
|
||||
MensajeAlert.AppendFormat(String.Format("<br/>La nota de crédito <b>{0}</b> por descuento pronto pago se generó correctamente.<br/><br/>", SerieFolioNCProntoPago))
|
||||
End If
|
||||
|
||||
If MsgCancelacionRefacturacion IsNot Nothing Then
|
||||
If Not MsgCancelacionRefacturacion.HuboError Then
|
||||
If MsgCancelacionRefacturacion.CveEstatus = 5 Then
|
||||
MensajeAlert.AppendFormat("<br/>El folio <b>{0}</b> fue cancelado. <b><a target='_blank' class='Texto' href=""/Compras/PopUpVerFactura.aspx?P={1}"">Descargar Acuse</a></b>", Me.ObjFacturaNC.SerieFolio, Encripta(String.Format("OP=CAN&CVEVTA={0}", Me.ObjFacturaNC.CveVenta)))
|
||||
ElseIf MsgCancelacionRefacturacion.CveEstatus = 20 Then
|
||||
MensajeAlert.AppendFormat("<br/>El folio <b>{0}</b> esta en proceso de cancelación. <b><a target='_blank' class='Texto' href=""/Compras/PopUpVerFactura.aspx?P={1}"">Descargar Acuse</a></b>", Me.ObjFacturaNC.SerieFolio, Encripta(String.Format("OP=CAN&CVEVTA={0}", Me.ObjFacturaNC.CveVenta)))
|
||||
End If
|
||||
MensajeAlert.AppendFormat(" <a target='_self' class='Texto' href=""javascript:BtnEnviarMailCancelacion({0});"">Enviar Acuse</a>.<br/><br/>", Me.ObjFacturaNC.CveVenta)
|
||||
End If
|
||||
End If
|
||||
|
||||
'MUESTA ALERT OK
|
||||
' si es elrol 1165-Ventas,EMp:80, o la empresa 119, recarga ventas, para seguir registrando-.
|
||||
'Dim Liga = If(UsuarioActual.CveRol = 1165 Or UsuarioActual.CveEmpresa = 119, "document.location.href=""/Ventas/Ventas.aspx?CveVenta=-1"";", If(CveEmpresaCRM > 0, $"document.location.href=""/CRM/EmpresaCRM.aspx?CveEmpresaCRM={CveEmpresaCRM}"";", $"document.location.href=""/Ventas/Ventas.aspx?CveVenta=-1"";"))
|
||||
'Alert(MensajeAlert.ToString(), TipoMensaje.MsgInformacion, Liga)
|
||||
|
||||
Dim Liga As String = ""
|
||||
Dim Liga2 As String = ""
|
||||
|
||||
If Request("CveCliente") IsNot Nothing AndAlso Request("CveCliente").ToEntero > 0 Then
|
||||
Liga = $"document.location.href=""/Ventas/Ventas.aspx?CveCliente={Request("CveCliente")}"";"
|
||||
Else
|
||||
Liga = "document.location.href=""/Ventas/Ventas.aspx?CveVenta=-1"";"
|
||||
End If
|
||||
|
||||
If CveEmpresaCRM > 0 Then
|
||||
Liga2 = $"document.location.href=""/CRM/EmpresaCRM.aspx?CveEmpresaCRM={CveEmpresaCRM}"";"
|
||||
Else
|
||||
Liga2 = $"document.location.href=""/Ventas/Clientes.aspx?CveCliente={CveCliente}"";"
|
||||
End If
|
||||
|
||||
Alert(MensajeAlert.ToString(), TipoMensaje.MsgDosBotones, Liga, TextoConfirmacion:="Seguir Registrando", TextoSegundoBoton:="Ir al Cliente", JSBtn2:=Liga2, ShowCloseButton:=False)
|
||||
|
||||
MensajeAlert.Clear()
|
||||
|
||||
'LIMPIA CONDICIONES DE PAGO - CONTADO
|
||||
RBLPago.SelectedValue = "1"
|
||||
LimpiaEscondeContado()
|
||||
BtnEmitirImprimir.Visible = False
|
||||
ObjFactura = Nothing
|
||||
|
||||
Else
|
||||
ObjVentas.RollBack()
|
||||
ObjVentas.RollBack()
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
|
||||
|
||||
For Each ErrorItem In ErrorList
|
||||
@@ -23130,7 +23139,7 @@ Partial Class Ventas
|
||||
|
||||
If ObjVentas.EliminarVenta(CveVenta) Then
|
||||
ObjVentas.Commit()
|
||||
Alert("La venta ha sido eliminada correctamente.", TipoMensaje.MsgInformacion)
|
||||
Alert("La venta ha sido eliminada correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Ventas/Clientes.aspx?CveCliente=" & CveCliente & """;")
|
||||
Else
|
||||
ObjVentas.RollBack()
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user