This commit is contained in:
Rakcsle Supertramp
2020-02-26 08:54:22 -07:00
29 changed files with 2110 additions and 1104 deletions

View File

@@ -78,16 +78,16 @@
<ContentTemplate>
<asp:GridView ID="GvAcum" Width="100%" runat="server" GridLines="None" CssClass="table table-striped table-advance table-hover ScrollAD "
ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true" AutoGenerateColumns="False" AllowPaging="False"
ShowFooter="False" DataKeyNames="CvePSCargo,Codigo,Inicial,E_Almacen,E_Pub,E_Traspaso,E_Compra,E_Otros,S_Almacen,S_Traspaso,S_Otros,Exist_Actual">
ShowFooter="False" DataKeyNames="CvePSCargo,CodigoPS,Inicial,E_Almacen,E_Pub,E_Traspaso,E_Compra,E_Otros,S_Almacen,S_Traspaso,S_Otros,Exist_Actual">
<Columns>
<asp:BoundField DataField="Codigo" HeaderText="Grupo" ReadOnly="true" ></asp:BoundField>
<asp:BoundField DataField="CodigoPS" HeaderText="Grupo" ReadOnly="true" ></asp:BoundField>
<asp:BoundField DataField="Inicial" HeaderText="Inicial" ReadOnly="true" DataFormatString="{0:N0}"><ItemStyle HorizontalAlign="Center"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="E_Almacen" HeaderText="E.Alm" ReadOnly="true" DataFormatString="{0:N0}"><ItemStyle HorizontalAlign="Center"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="E_Pub" HeaderText="E.Alm" ReadOnly="true" DataFormatString="{0:N0}"><ItemStyle HorizontalAlign="Center"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="E_Pub" HeaderText="E.Pub" ReadOnly="true" DataFormatString="{0:N0}"><ItemStyle HorizontalAlign="Center"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="E_Traspaso" HeaderText="E.Tras" ReadOnly="true" DataFormatString="{0:N0}"><ItemStyle HorizontalAlign="Center"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="E_Compra" HeaderText="E.Compra" ReadOnly="true" DataFormatString="{0:N0}"><ItemStyle HorizontalAlign="Center"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="E_Otros" HeaderText="Otros" ReadOnly="true" DataFormatString="{0:N0}"><ItemStyle HorizontalAlign="Center"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="S_Almacen" HeaderText="E.Alm" ReadOnly="true" DataFormatString="{0:N0}"><ItemStyle HorizontalAlign="Center"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="S_Almacen" HeaderText="S.Alm" ReadOnly="true" DataFormatString="{0:N0}"><ItemStyle HorizontalAlign="Center"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="S_Traspaso" HeaderText="S.Tras" ReadOnly="true" DataFormatString="{0:N0}"><ItemStyle HorizontalAlign="Center"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="S_Otros" HeaderText="Otros" ReadOnly="true" DataFormatString="{0:N0}"><ItemStyle HorizontalAlign="Center"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="Exist_Actual" HeaderText="Exist. Actual" ReadOnly="true" DataFormatString="{0:N0}"><ItemStyle HorizontalAlign="Center"></ItemStyle></asp:BoundField>

View File

@@ -26,7 +26,7 @@ Partial Class Acumuladores_RepEntradasUsados
End Sub
Protected Sub CargarDatos()
DdlAlmacenes.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1)
DdlAlmacenes.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen = 22")
DdlAlmacenes.DataBind()
End Sub

View File

@@ -3,6 +3,11 @@
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.Derecha {
text-align: right;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Reporte Entradas Usados Clientes
@@ -77,10 +82,10 @@
<Columns>
<asp:BoundField HeaderText="Tipo" DataField="Codigo" />
<asp:BoundField HeaderText="Clientes/Grupos" DataField="Codigo_Clientes" />
<asp:BoundField HeaderText="Cantidad" DataField="Total" DataFormatString="{0:N0}" />
<asp:TemplateField HeaderText="Cantidad">
<ItemTemplate>
<asp:LinkButton ID="LnkCantidad" OnClick="CargarVentasGrupo" Text='<%# Eval("Total", "{0:N0}") %>' runat="server" />
<%--OnClick="CargarVentasGrupo"--%>
<asp:LinkButton ID="LnkCantidad" CommandName="Mostrar" OnCommand="CargarVentasGrupo" Text='<%# Eval("Total", "{0:N0}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
@@ -122,8 +127,8 @@
<asp:HyperLinkField HeaderText="Folio" DataTextField="SerieFolio" Target="_blank" ItemStyle-Width="20%" ItemStyle-CssClass="Texto Izquierda" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" />
<asp:HyperLinkField HeaderText="Fecha" DataTextField="Fecha" Target="_blank" ItemStyle-Width="10%" ItemStyle-CssClass="Texto" DataTextFormatString="{0:d}" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" />
<asp:HyperLinkField HeaderText="Sucursal" DataTextField="SubProyecto" Target="_blank" ItemStyle-Width="15%" ItemStyle-CssClass="Texto Izquierda" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" />
<asp:HyperLinkField HeaderText="Cantidad" DataTextField="Cantidad" Target="_blank" ItemStyle-Width="5%" ItemStyle-CssClass="Texto Derecha" DataTextFormatString="{0:###,##0.00##}" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" />
<asp:HyperLinkField HeaderText="Total" DataTextField="Total" Target="_blank" ItemStyle-Width="20%" ItemStyle-CssClass="Texto Derecha" DataTextFormatString="{0:###,###,##0.00##}" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" />
<asp:HyperLinkField HeaderText="Cantidad" DataTextField="Cantidad" Target="_blank" ItemStyle-Width="5%" ItemStyle-CssClass="Derecha" DataTextFormatString="{0:###,##0.00##}" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" />
<asp:HyperLinkField HeaderText="Total" DataTextField="Total" Target="_blank" ItemStyle-Width="20%" ItemStyle-CssClass="Derecha" DataTextFormatString="{0:###,###,##0.00##}" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}"/>
</Columns>
</asp:GridView>
</div>

View File

@@ -94,14 +94,14 @@ Partial Class Acumuladores_RepEntradasUsadosClientes
Dim renglon As GridViewRow = CType(tempLink.NamingContainer, GridViewRow)
LbCliente.Text = renglon.DataKey("NombreComercial")
LbTam.Text = renglon.DataKey("Codigo")
LbTam.Text = renglon.DataKey("Codigo_Clientes")
Dim ObjAcum As New ClsAcumuladores
If ObjAcum.GetUsadosClasificacionVentas(renglon.DataKey("CveCliente"), renglon.DataKey("Codigo"), TxtFechaI.Text, TxtFechaF.Text) Then
If ObjAcum.GetUsadosClasificacionVentas(renglon.DataKey("CveCliente"), renglon.DataKey("Codigo_Clientes"), TxtFechaI.Text, TxtFechaF.Text) Then
GvVentas.DataSource = ObjAcum.DtResultados
End If
ObjAcum.Dispose()
GvVentas.DataBind()
RegistraScript("$('#ModalVentasAvance').modal('show');RecargaAvances = true;")
RegistraScript("$('#ModalVentasAvance').modal();")
End Sub
End Class

View File

@@ -191,7 +191,7 @@ Public Class ClsCompras
AplicaNotaCredito As Boolean, Observaciones As String, CveEstatusCompra As Integer, CvePrePoliza As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional IdPoliza As Integer = -1,
Optional CveOC As Integer = -1, Optional CveCajaChica As Integer = -1, Optional CvePersonal As Integer = -1, Optional NumeroReembolso As String = "-1", Optional CveProveedorSucursal As Integer = -1,
Optional AplicoPromocion As Boolean = False, Optional PorcentajeIVA As Double = 0, Optional CveMetodoPago As Integer = -1, Optional CveRetIVAConcepto As Integer = -1, Optional CveConceptoContableAlmacen As Integer = -1,
Optional CveRetISRConcepto As Integer = -1, Optional NoDeducible As Boolean = False, Optional CveTipoCompra As Integer = -1, Optional TotalOriginal As Double = 0, Optional CveTipoConcepto As Integer = 1) As Boolean
Optional CveRetISRConcepto As Integer = -1, Optional NoDeducible As Boolean = False, Optional CveTipoCompra As Integer = -1, Optional TotalOriginal As Double = 0, Optional CveTipoConcepto As Integer = 1, Optional CveFactura As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -241,6 +241,7 @@ Public Class ClsCompras
.Add("@CveTipoCompra", SqlDbType.Int).Value = CveTipoCompra
.Add("@TotalOriginal", SqlDbType.Money).Value = TotalOriginal
.Add("@CveTipoConcepto", SqlDbType.Int).Value = CveTipoConcepto
.Add("@CveFactura", SqlDbType.Int).Value = CveFactura
End With
Try
@@ -265,7 +266,7 @@ Public Class ClsCompras
Descuento As Double, SubTotal As Double, IVA As Double, Total As Double, CveUsuario As Integer,
CveCompra As Integer, Optional CveCajaChica As Integer = -1, Optional CvePersonal As Integer = -1,
Optional CveProveedorSucursal As Integer = -1, Optional PorcentajeIVA As Double = 0,
Optional NumeroReembolso As String = "", Optional CveTipoCompra As Integer = -1, Optional NoDeducible As Boolean = False) As Boolean
Optional NumeroReembolso As String = "", Optional CveTipoCompra As Integer = -1, Optional NoDeducible As Boolean = False, Optional CveFactura As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -291,6 +292,7 @@ Public Class ClsCompras
.Add("@NumeroReembolso", SqlDbType.VarChar).Value = NumeroReembolso
.Add("@CveTipoCompra", SqlDbType.Int).Value = CveTipoCompra
.Add("@NoDeducible", SqlDbType.Bit).Value = NoDeducible
.Add("@CveFactura", SqlDbType.Int).Value = CveFactura
End With
Try

View File

@@ -4602,7 +4602,10 @@ Public Class ClsContabilidad
Return Retorno
End Function
Public Function UpdateCuenta(CveCuenta As Integer, Nombre As String, Tipo As String, CtaMayor As Integer, CveMoneda As Integer, Optional DigAgrupador As Integer = -1, Optional CveAgrupadorSAT As Integer = -1, Optional NomIdioma As String = "") As Boolean
Public Function UpdateCuenta(CveCuenta As Integer, Nombre As String, Tipo As String, CtaMayor As Integer, CveMoneda As Integer, Optional DigAgrupador As Integer = -1,
Optional CveAgrupadorSAT As Integer = -1, Optional NomIdioma As String = "", Optional CveConceptoAdmin As Integer = -1, Optional CveProveedor As Integer = -1,
Optional CveCliente As Integer = -1, Optional CveClasificacion As Integer = -1, Optional PorcentajeImpuesto As Decimal = -1,
Optional CveBancoCuenta As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Conta_UpdateCuentas")
@@ -4616,6 +4619,12 @@ Public Class ClsContabilidad
.Add("@DigAgrupador", SqlDbType.Int).Value = DigAgrupador
.Add("@NomIdioma", SqlDbType.VarChar).Value = NomIdioma
.Add("@CveAgrupadorSAT", SqlDbType.Int).Value = CveAgrupadorSAT
.Add("@CveConceptoAdmin", SqlDbType.Int).Value = CveConceptoAdmin
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
.Add("@PorcentajeImpuesto", SqlDbType.Money).Value = PorcentajeImpuesto
.Add("@CveBancoCuenta", SqlDbType.Int).Value = CveBancoCuenta
End With
Try
@@ -4630,7 +4639,9 @@ Public Class ClsContabilidad
Return Retorno
End Function
Public Function AddCuenta(CvePadre As Integer, Codigo As String, Nombre As String, Tipo As String, CtaMayor As Integer, CveMoneda As Integer, Optional DigAgrupador As Integer = -1,
Optional CveAgrupadorSAT As Integer = -1, Optional NomIdioma As String = "", Optional CveEmpresaParam As Integer = -1) As Integer
Optional CveAgrupadorSAT As Integer = -1, Optional NomIdioma As String = "", Optional CveEmpresaParam As Integer = -1, Optional CveConceptoAdmin As Integer = -1,
Optional CveProveedor As Integer = -1, Optional CveCliente As Integer = -1, Optional CveClasificacion As Integer = -1, Optional PorcentajeImpuesto As Decimal = -1,
Optional CveBancoCuenta As Integer = -1) As Integer
Dim Retorno As Integer = 0
DataAdapter("PA_Conta_AddCuentas")
@@ -4645,6 +4656,12 @@ Public Class ClsContabilidad
.Add("@NomIdioma", SqlDbType.VarChar).Value = NomIdioma
.Add("@CveAgrupadorSAT", SqlDbType.Int).Value = CveAgrupadorSAT
.Add("@CveEmpresaParam", SqlDbType.Int).Value = CveEmpresaParam
.Add("@CveConceptoAdmin", SqlDbType.Int).Value = CveConceptoAdmin
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
.Add("@PorcentajeImpuesto", SqlDbType.Money).Value = PorcentajeImpuesto
.Add("@CveBancoCuenta", SqlDbType.Int).Value = CveBancoCuenta
'.Add("@CveCuenta", SqlDbType.Int).Value = 0
'.Add("@Error", SqlDbType.VarChar).Value = ""
'.Add("@Error", SqlDbType.VarChar).Direction = ParameterDirection.Output
@@ -4690,6 +4707,23 @@ Public Class ClsContabilidad
Return Retorno
End Function
Public Function GetCuentasyConceptos(CveCliente As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Conta_GetCuentasyConceptos")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al consultar las cuentas y conceptos", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function UpdateCuentaCompaq(CveCuenta As Integer, IdCompaq As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False

View File

@@ -317,7 +317,7 @@ Public Class ClsVentas
Optional ObservacionesAlmacen As String = "", Optional CveSubProyecto As Integer = -1, Optional CveSubProyectoEjecucion As Integer = -1, Optional CveSubProyectoCobranza As Integer = -1,
Optional CveFormaPago33 As Integer = -1, Optional CveMetodoPago33 As Integer = -1, Optional CveUsoCFDI As Integer = -1, Optional OrdenCompra As String = "-1", Optional CveCuentaTerminal As Integer = -1, Optional CveTipoRelacion As Integer = -1, Optional ImpuestoLocal As Double = 0,
Optional CveTipoAmortizacionAnticipo As Integer = -1, Optional CveVentaRelacion As Integer = -1, Optional ImporteRelacion As Decimal = -1, Optional CveEmpresaCRM As Integer = -1, Optional EsInterno As Integer = -1, Optional CveAcercamientoCRM As Integer = -1,
Optional DiasCredito As Integer = 0, Optional EsDiasCreditoFijo As Boolean = False, Optional AnticipoEspecial As Boolean = False, Optional Kilometraje As Double = 0) As Boolean
Optional DiasCredito As Integer = 0, Optional EsDiasCreditoFijo As Boolean = False, Optional AnticipoEspecial As Boolean = False, Optional Kilometraje As Double = 0, Optional EsAmortizacion As Boolean = False) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_VentasAdd")
@@ -404,6 +404,7 @@ Public Class ClsVentas
.Add("@EsDiasCreditoFijo", SqlDbType.Bit).Value = EsDiasCreditoFijo
.Add("@AnticipoEspecial", SqlDbType.Bit).Value = AnticipoEspecial
.Add("@Kilometraje", SqlDbType.Float).Value = Kilometraje
.Add("@EsAmortizacion", SqlDbType.Bit).Value = EsAmortizacion
.Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue
End With

View File

@@ -14,6 +14,7 @@ Imports System.Net
Imports System.IO.Compression
Imports System.Text
Imports System.Net.Http
Imports System.Collections.Generic
Namespace Modelos
@@ -539,7 +540,64 @@ Namespace Modelos
Public Property CveEstatus As Integer
End Class
Public Function RegenerarPrePolizas(Optional TransaccionCompartida As SqlClient.SqlTransaction = Nothing, Optional ObjACTransac As ClsContPAQi = Nothing) As Boolean
Dim ErrorPrePolizas As Boolean = False
Dim ObjVentas As ClsVentas = Nothing
If TransaccionCompartida IsNot Nothing Then
ObjVentas = New ClsVentas(TransaccionCompartida)
Else
ObjVentas = New ClsVentas()
ObjVentas.IniciaTransacSQL()
End If
Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
Dim ObjBancos As New ClsBancos(ObjVentas.IniciaTransacSQL())
Dim ObjEventos As New ClsOIEventos(ObjVentas.IniciaTransacSQL())
Dim ObjAC As ClsContPAQi = Nothing
If ObjACTransac Is Nothing Then
If UsuarioActual.Empresa.UsaAC Then
ObjAC = New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL()
End If
Else
ObjAC = ObjACTransac
End If
ErrorPrePolizas = Not RegeneracionPolizas(Me, ObjVentas, ObjAC, ObjConta, ObjBancos, ObjEventos)
If TransaccionCompartida Is Nothing Then
ObjVentas.Commit()
ObjVentas.Dispose()
ObjBancos.Dispose()
ObjEventos.Dispose()
End If
If ObjACTransac Is Nothing Then
If ObjAC IsNot Nothing Then
ObjAC.Commit()
ObjAC.Dispose()
End If
End If
Return Not ErrorPrePolizas
End Function
Private Function RegeneracionPolizas(ObjFactura As Modelos.Factura, ByRef ObjVentas As ClsVentas, ByRef ObjAC As ClsContPAQi, ByRef ObjConta As ClsContabilidad, ObjBancos As ClsBancos, ObjEventos As ClsOIEventos) As Boolean
Dim ErrorPrePolizas As Boolean = False
'REMOVEMOS LOS CONCEPTOS DE LA PREPOLIZA
ErrorPrePolizas = Not ObjConta.RemovePrePolizasDetalle(ObjFactura.CvePrePoliza, -1, ObjFactura.CveVenta, 2)
'VUELVE A GENERAR LAS PREPOLIZAS
If Not ErrorPrePolizas Then
ErrorPrePolizas = ProcesoPrepolizas(ObjFactura, ObjConta, -1, ObjFactura.DtDetalle, ObjAC, ValorMultiplicador:=1, ObjBancos:=ObjBancos, ObjVentas:=ObjVentas, ObjEventos:=ObjEventos, DtRemisionesRelacionadas:=New DataTable, SeCancelaRemisionProceso:=False,
CancelarRemisiones:=False, ListaRemisionesCancelar:=New List(Of Integer))
End If
If Not ErrorPrePolizas Then ErrorPrePolizas = GuardarVentaImpuestosLocales(ObjFactura, ObjVentas, ObjConta, 1)
Return Not ErrorPrePolizas
End Function
Public Function EmitirFactura(Optional Timbrar As Boolean = True, Optional Transac As SqlClient.SqlTransaction = Nothing, Optional ObjContPaqTransac As ClsContPAQi = Nothing) As MMensajeFactura
Dim Retorno As New MMensajeFactura()
@@ -1059,7 +1117,7 @@ Namespace Modelos
Return Retorno
End Function
Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer, Optional GetBytes As Boolean = true) As Byte()
Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer, Optional GetBytes As Boolean = True) As Byte()
Dim Url = New Uri(String.Format("http://{0}:{1}/Compras/PopUpVerFactura.aspx?P={2}", HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port, Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta))))
Dim File As Byte() = Nothing
Try

View File

@@ -162,6 +162,7 @@
<asp:TemplateField ItemStyle-Width="10%">
<ItemTemplate>
<asp:CheckBox ID="chk" Checked="false" Visible="false" runat="server" />
<asp:Literal ID="LtlTip" runat="server" Text='<%# Eval("ConceptoTexto") %>' ></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Proveedor">

View File

@@ -4396,7 +4396,7 @@ Partial Class Compras_Compras
'End If
'METODO DE PREPOLIZA DE ALMACEN
If UsuarioActual.CveEmpresa.Contiene(1, 119, 72, 80) And UsuarioActual.Empresa.UsaInventarios And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Then
If UsuarioActual.CveEmpresa.Contiene(1, 119, 72, 80, 140) And UsuarioActual.Empresa.UsaInventarios And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Then
Dim ImporteAlmacen = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 AND ISNULL(CveAlmacen,0) = 0 AND ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveTipoPS = 2").ToString.ToDecimal
If ImporteAlmacen > 0 Then
If Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then
@@ -4412,8 +4412,6 @@ Partial Class Compras_Compras
CveConceptoContableAlmacen = 205
End If
Else
CveConceptoContableAlmacen = 225
End If
@@ -6237,7 +6235,7 @@ Partial Class Compras_Compras
End If
Case 6 'Compra
Dim AgregaMercanciaInventario As Boolean = UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119) AndAlso UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1"
Dim AgregaMercanciaInventario As Boolean = UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119, 140) AndAlso UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1"
Dim RegistraConcepto225 As Boolean = UsuarioActual.Empresa.UsaInventarios AndAlso DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1"
If RBLPago.SelectedValue.ToEntero = 4 Then
@@ -7910,7 +7908,7 @@ Partial Class Compras_Compras
If Request("CveFactura") IsNot Nothing Then
If Not ObjCompras.UpdateCompraFactura(CveCompra, Request("CveFactura").ToEntero, TxtSerie.Text.Trim, TxtFolio.Text.Trim) Then
ErrorOC = True
TieneError = True
End If
If UsuarioActual.Empresa.UsaAC Then

View File

@@ -187,7 +187,7 @@
<HeaderTemplate>Excedente</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="TxtSaldoExcedente" Width="80px" runat="server" Style="text-align: right;" onkeyup="FormatoMoneda(this)"></asp:TextBox>&nbsp;
<asp:RangeValidator ID="RVSaldoExcedente" runat="server" Enabled="false" Type="Currency" MinimumValue="0" MaximumValue='<%# Eval("Saldo", "{0:N2}") %>' ErrorMessage="*" ControlToValidate="TxtSaldoExcedente" Display="Dynamic"></asp:RangeValidator>
<asp:RangeValidator ID="RVSaldoExcedente" runat="server" Enabled="false" Type="Currency" MinimumValue="0" MaximumValue='<%#If(Eval("Saldo").ToString().Contains("-"), "0", Eval("Saldo", "{0:N2}")) %>' ErrorMessage="*" ControlToValidate="TxtSaldoExcedente" Display="Dynamic"></asp:RangeValidator>
</ItemTemplate>
</asp:TemplateField>

View File

@@ -161,15 +161,13 @@ Partial Class Compras_RepRembolsoComprobaciones
Dim ObjComp As New ClsCompras()
Dim ObjMov As New ClsContabilidad(ObjComp.IniciaTransacSQL)
Dim ObjAC As ClsContPAQi = Nothing
If UsuarioActual.Empresa.UsaContabilidad Then
ObjAC = New ClsContPAQi(UsuarioActual.Empresa)
ObjAC.IniciaTransacSQL()
End If
Dim TieneError = False
Dim CvePrePoliza As Integer = 0
Dim IdPoliza As Integer = 0
Dim Msg As New StringBuilder
Try
CvePrePoliza = ObjMov.AddPrePolizas("Compras/Registrar", 1, DtDatos(0)("Original").ToString.ToDecimal, DtDatos(0)("Original").ToString.ToDecimal, CveMoneda, TxtFechaUnificacion.Text.Trim.ToDate(), TxtConcepto.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3)
If CvePrePoliza > 0 AndAlso DdlPersonal.SelectedValue.ToEntero > 0 Then
@@ -200,9 +198,8 @@ Partial Class Compras_RepRembolsoComprobaciones
End If
If UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" AndAlso Not TieneError Then
If ObjAC Is Nothing Then
TieneError = True
End If
ObjAC = New ClsContPAQi(UsuarioActual.Empresa)
ObjAC.IniciaTransacSQL()
If Not TieneError Then
If Not ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjAC) Then
@@ -218,7 +215,10 @@ Partial Class Compras_RepRembolsoComprobaciones
End If
End If
Catch ex As Exception
TieneError = True
OnError("Ocurrió un error al unificar las compras", ex)
End Try
If Not TieneError Then
ObjComp.Commit()

View File

@@ -39,6 +39,7 @@ public partial class Contabilidad_ContabilizacionCompras : ClsPaginas
if (!IsPostBack)
{
TienePermisoVerPoliza = false;
TienePermisoEditar = false;
DdlProveedores.setEsWebService(true);
DdlProveedores.Attributes.Add("data-metodo", "getproveedores");
if (UsuarioActual.Empresa.UsaContabilidad)
@@ -74,7 +75,7 @@ public partial class Contabilidad_ContabilizacionCompras : ClsPaginas
else
{
Alert("Este módulo requiere el uso de Contabilidad.", ModExtensiones.TipoMensaje.MsgAdvertencia);
BtnConsultar.Enabled = false;
// BtnConsultar.Enabled = false;
BtnContabilizarCompras.Enabled = false;
BtnContabilizarPagos.Enabled = false;
BtnContabilizarAnticipos.Enabled = false;

View File

@@ -54,7 +54,7 @@ public partial class Contabilidad_ContabilizacionVentas : ClsPaginas
else
{
Alert("Este módulo requiere el uso de Contabilidad.", ModExtensiones.TipoMensaje.MsgAdvertencia);
BtnConsultar.Enabled = false;
//BtnConsultar.Enabled = false;
BtnContabilizarVentas.Enabled = false;
BtnContabilizarPagos.Enabled = false;
BtnContabilizarAnticipos.Enabled = false;

View File

@@ -1051,15 +1051,14 @@ Partial Class General_SaldosIniciales
Dim BonificacionUsado As Boolean = If(Row("EmitirBon Usado").ToString.ToUpper = "SI", True, False)
Dim LimiteCredito As Decimal = Row("Limite Credito").ToString.ToDecimal
Dim CobranzaCorreo As String = Row("CorreoPago").ToString
Dim CobranzaCorreo As String = Row("CorreoPagos").ToString
Dim PlazoCobranza As Integer = Row("Plazo Cobranza").ToString.ToEntero
Dim DìaVisita As String = Row("Dia Pago").ToString
Dim DiasPagoEspecifico As String = Row("Dìa Visita").ToString
Dim CobranzaContacto As String = Row("Encargado Pago").ToString
Dim CobranzaTelefono As String = Row("Celular Contacto").ToString.Replace("-", "").Replace(" ", "").Replace("(", "").Replace(")", "")
Dim CveUsoCFDI As Integer = If(Row("UsoCFDI").ToString = "", -1, GlobalDTSATUsosCFDI().FiltroPrimeroValor("CveUsoCFDI", String.Format("UsoCFDI = '{0}'", Row("UsoCFDI").ToString)).ToEntero)
' CobranzaContacto = Regex.Replace(CobranzaContacto, "[^0-9]", "")
'Telefono
@@ -1169,7 +1168,7 @@ Partial Class General_SaldosIniciales
If Not ObjClientes.AddCliente(RazonSocial, RazonSocial, Calle, NumExt.ToString, "", Colonia, Poblacion, Poblacion, Estado, Pais, RFC, CodigoPostal, Telefono, Contacto, "", "", "", "", "", -1, False, 0, 0, False, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", CveVendedor, PlazoCobranza, -1,
"-1", "-1", -1, "-1", -1, "0", -1, "0", 0, "", 0, "", 0, "", 0, "", "", "", Codigo, LimiteCredito, "", 1, False, "", "", "", False, "", "", "", "", "", False, "", "", "", False, 0, -1, EsDistribuidor:=EsDistribuidor, CveClienteClasificacion:=CveClasificación, CargoUsado:=CargoUsado,
BonificacionUsado:=BonificacionUsado, CobranzaContacto:=CobranzaContacto, CobranzaCorreo:=CobranzaCorreo, DiasEspecifico:=DiasPagoEspecifico, DiasRevision:=DìaVisita, CobranzaTelefono:=CobranzaTelefono, CveFormaPago33:=CveFormaPago33) Then
BonificacionUsado:=BonificacionUsado, CobranzaContacto:=CobranzaContacto, CobranzaCorreo:=CobranzaCorreo, DiasEspecifico:=DiasPagoEspecifico, DiasRevision:=DìaVisita, CobranzaTelefono:=CobranzaTelefono, CveFormaPago33:=CveFormaPago33, CveUsoCFDI:=CveUsoCFDI) Then
ErrorClientes = True
RFC.GuardaLog

View File

@@ -948,7 +948,7 @@ Partial Class Inventarios_RecepcionAlmacen
'Existencias
If TipoMovimiento = 2 Then
If ObjInventario.ComprasDevolucionExistenciasGet(CveCompraSurtir) Then
DtExistencias = DtRecepcion
DtExistencias = ObjInventario.DtResultados.Copy
Else
Alert("No se pudieron cargar las existencias del movimiento de entrada, por lo cual no se podra hacer la devolución.", TipoMensaje.MsgError)
BtnGuardar.Enabled = False
@@ -2031,8 +2031,8 @@ Partial Class Inventarios_RecepcionAlmacen
Dim ObjContaContPAQ As ClsContPAQi = Nothing
'ENTREGA DIRECTA
Dim CveMovtoSalidaDirecta = -1
Dim FolioSalidaDirecta = -1
Dim MovtosSalidaDirecta As New List(Of Integer)
Dim FoliosSalidaDirecta As New List(Of Integer)
'APARTADOS
Dim MovtosSalida As New List(Of Integer)
@@ -2160,16 +2160,22 @@ Partial Class Inventarios_RecepcionAlmacen
'ENTREGA DIRECTA
If EntregaDirecta Then
If Not ErrorMovInv Then
Dim CveVenta As Integer = 0
Dim Dt As DataTable = Nothing
If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
If ObjInventario.DtResultados.Rows.Count > 0 Then
Dt = ObjInventario.DtResultados
CveVenta = ObjInventario.DtResultados.Rows(0)("CveVenta").ToString.ToEntero
End If
End If
'GENERA UN MOVIMIENTO POR CADA VENTA
For Each DrVenta As DataRow In Dt.FiltraParametros("", DistinctColumns:={"CveVenta"}).Rows
Dim CveMovtoSalidaDirecta As Integer = -1
Dim FolioSalidaDirecta As Integer = -1
Dim CveVenta As Integer = DrVenta("CveVenta").ToString().ToEntero()
CveMovtoSalidaDirecta = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, 3, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1,
CveVenta, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, TipoCambio:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, TipoCambio),
MovimientoFijo:=True, CveMovimientoRelacionado:=CveMovimiento, Remision:=TxtRemision.Text, CveVendedor:=CveVendedor, CveCliente:=CveCliente, Modulo:="RA/G")
@@ -2177,10 +2183,11 @@ Partial Class Inventarios_RecepcionAlmacen
If Not CveMovtoSalidaDirecta > 0 Then
ErrorMovInv = True
Exit For
End If
If Not ErrorMovInv AndAlso Dt IsNot Nothing Then
For Each Dr As DataRow In Dt.Rows
For Each Dr As DataRow In Dt.FiltraParametros($"CveVenta={CveVenta}").Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovtoSalidaDirecta, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
ErrorMovInv = True
Exit For
@@ -2189,13 +2196,20 @@ Partial Class Inventarios_RecepcionAlmacen
End If
If Not ErrorMovInv Then
If Not ObjInventario.LimpiaEntregaDirecta(CveMovimiento) Then
If Not GeneraPrePolizaSalidaEntregaDirecta(CveMovtoSalidaDirecta, ObjInventario, ObjConta, ObjContaContPAQ) Then
ErrorMovInv = True
Exit For
End If
End If
If Not ErrorMovInv Then
If Not GeneraPrePolizaSalidaEntregaDirecta(CveMovtoSalidaDirecta, ObjInventario, ObjConta, ObjContaContPAQ) Then
MovtosSalidaDirecta.Add(CveMovtoSalidaDirecta)
FoliosSalidaDirecta.Add(FolioSalidaDirecta)
End If
Next
If Not ErrorMovInv Then
If Not ObjInventario.LimpiaEntregaDirecta(CveMovimiento) Then
ErrorMovInv = True
End If
End If
@@ -2745,11 +2759,19 @@ Partial Class Inventarios_RecepcionAlmacen
Msg.AppendFormat("Movimiento Registrado: Folio: <b>{0}</b>", link)
Msg.AppendFormat("<br/><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Movimiento</a> ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimiento)))
'If CveMovtoSalidaDirecta > 0 Then
' Msg.AppendFormat("<br/><br/> Movimientos de control:<br/>")
' link = String.Format("<a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", CveMovtoSalidaDirecta, FolioSalidaDirecta)
' Msg.AppendFormat("Movimiento de Salida Folio: <b>{0}</b>", link)
'End If
'ENTREGA DIRECTA
If CveMovtoSalidaDirecta > 0 Then
If MovtosSalidaDirecta.Count > 0 Then
Msg.AppendFormat("<br/><br/> Movimientos de control:<br/>")
link = String.Format("<a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", CveMovtoSalidaDirecta, FolioSalidaDirecta)
Msg.AppendFormat("Movimiento de Salida Folio: <b>{0}</b>", link)
For index = 0 To MovtosSalidaDirecta.Count - 1
link = String.Format("<a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", MovtosSalidaDirecta(index), FoliosSalidaDirecta(index))
Msg.AppendFormat("<br/>Movimiento de Salida Folio: <b>{0}</b>", link)
Next
End If
'APARTADO

View File

@@ -130,7 +130,11 @@
<div id="DivCliente" runat="server" visible="true">
<label class="col-md-1 truncate" style="width: 110px">Cliente:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlClientes" AutoPostBack="true" OnSelectedIndexChanged="DdlClientes_SelectedIndexChanged" AppendDataBoundItems="true" runat="server" CssClass="form-control input-sm select2me" Style="max-width: 200px" DataTextField="NombreComercial" DataValueField="CveCliente"></asp:DropDownList>
<asp:DropDownList ID="DdlClientes" AutoPostBack="False" OnSelectedIndexChanged="DdlClientes_SelectedIndexChanged" AppendDataBoundItems="true" runat="server" CssClass="form-control input-sm select2me" Style="max-width: 200px" DataTextField="NombreComercial" DataValueField="CveCliente"></asp:DropDownList>
</div>
<div class="col-md-2">
<label class="col-md-1 truncate" style="width: 125px">Todos los clientes:</label>
<asp:CheckBox runat="server" ID="ChkClientesTodos" data-size="small" Checked="False" AutoPostBack="true" OnCheckedChanged="SeleccionarTipoDeClientes" />
</div>
</div>
@@ -968,7 +972,7 @@
<div class="form-group form-md-line-input ">
<div class="row">
<div class="col-md-2" style="width:50%">
<div class="col-md-2" style="width: 50%">
<label for='<%= txtCantidad.ClientID %>'>Cantidad:</label>
<asp:TextBox ID="txtCantidad" CssClass="form-control input-sm" Width="100%" MaxLength="15" runat="server" ValidationGroup="GprAgregarUsado"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="SoloNumerosCantidad" runat="server" TargetControlID="txtCantidad" FilterType=" Numbers" />
@@ -977,7 +981,7 @@
<asp:CustomValidator ID="CVCantidad" runat="server" ClientValidationFunction="ValidaDecimal6digits" ControlToValidate="TxtCantidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> no tiene el formato correcto (6 decimales). Por favor rectifique y vuelva a intentar." ValidateEmptyText="True" ValidationGroup="GprAgregarUsado"></asp:CustomValidator>
<ajax:ValidatorCalloutExtender ID="VCECantidad" runat="server" HighlightCssClass="vco" TargetControlID="CVCantidad" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-2" style="width:50%">
<div class="col-md-2" style="width: 50%">
<asp:CheckBox runat="server" ID="ChkSeguirAgregando" />
<label for="ChkSeguirAgregando">Seguir Registrando</label>
</div>

View File

@@ -317,7 +317,6 @@ Partial Class Inventarios_RecepcionUsados
ViewState("DtPorcentajeMarcas") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
@@ -346,7 +345,7 @@ Partial Class Inventarios_RecepcionUsados
TxtFecha.Text = Now.ToShortDateString
TxtFechaPendientes.Text = Now.ToShortDateString
RVFecha.MaximumValue = Now.ToShortDateString
InicializaClientes()
InicializaClientes(False)
'si viene una parámetro para cargar un movimiento lo hacemos dentro del procedimiento cargadatos
Select Case UsuarioActual.Empresa.Funcionalidad(103)
@@ -1148,7 +1147,7 @@ Partial Class Inventarios_RecepcionUsados
'si es selectedvalue = 42, es entrada ,3 -salida
Dim CveConceptoUsados As Integer = If(RBLOpcion.SelectedValue.ToEntero = 42, 1, 2)
If RBLOpcion.SelectedValue.ToEntero = 42 AndAlso EsDistribuidor AndAlso Dr("CveTamaño").ToString.ToEntero > 0 Then
If EsDistribuidor AndAlso RBLOpcion.SelectedValue.ToEntero = 42 AndAlso Dr("CveTamaño").ToString.ToEntero > 0 Then
If Not ObjAcum.DistribuidorMovtosAdd(DdlClientes.SelectedValue.ToEntero, Dr("Cantidad").ToString.ToEntero(), Dr("CveTamaño").ToString.ToEntero, CveConceptoUsados, CveVenta, UsuarioActual.CveUsuario,
UsuarioActual.CveEmpresa, 0, Dr("Observaciones").ToString, CveMovimiento:=CveMovimiento) Then
@@ -1706,9 +1705,9 @@ Partial Class Inventarios_RecepcionUsados
#Region "DDL CLIENTE / CLIENTE SUCURSAL - SELECTED INDEX CHANGED"
Private Sub InicializaClientes()
Private Sub InicializaClientes(Todos As Boolean)
DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltraParametros("EsDistribuidor = 1")
DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltraParametros(If(Todos, "", "EsDistribuidor = 1"))
DdlClientes.DataBind()
DdlClientes.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlClientes.SelectedValue = "-1"
@@ -2781,4 +2780,9 @@ Partial Class Inventarios_RecepcionUsados
End Sub
#End Region
Protected Sub SeleccionarTipoDeClientes(sender As Object, e As EventArgs)
DdlClientes.Items.Clear()
InicializaClientes(ChkClientesTodos.Checked)
End Sub
End Class

View File

@@ -787,7 +787,7 @@ Partial Class Inventarios_TraspasoAlmacen
CveAlmacenDestino:=DdlAlmacenDestino.SelectedValue.ToEntero, GastoIndirecto:=If(ChkTransitorio.Checked And TxtGastoIndirecto.Text.ToDouble > 0, TxtGastoIndirecto.Text, "-1").ToDouble,
CveChofer:=If(ChkTransitorio.Checked, DdlChofer.SelectedValue.ToEntero, -1), Placa:=If(ChkTransitorio.Checked, TxtPlaca.Text.Trim, "-1"), FechaEntrega:=If(ChkTransitorio.Checked, TxtFechaEntrega.Text.Trim.ToDateTime.ToString("dd/MM/yyyy"), "-1"), EspecifUnidad:=If(ChkTransitorio.Checked, TxtEspecifUnidad.Text.Trim, "-1"),
ResponsableCarga:=If(ChkTransitorio.Checked, TxtResponsableCarga.Text.Trim, "-1"), ResponsableRecibio:=If(ChkTransitorio.Checked, TxtResponsableRecibio.Text.Trim, "-1"), Identificacion:=If(ChkTransitorio.Checked, TxtIdentificacion.Text.Trim, "-1"), Domicilio:=If(ChkTransitorio.Checked, TxtDomicilio.Text.Trim, "-1"),
Telefono:=If(ChkTransitorio.Checked, TxtTelefono.Text.Trim, "-1"), Ciudad:=If(ChkTransitorio.Checked, TxtCiudad.Text.Trim, "-1"), Licencia:=If(ChkTransitorio.Checked, TxtLicencia.Text.Trim, "-1"), Modulo:="TA/G")
Telefono:=If(ChkTransitorio.Checked, TxtTelefono.Text.Trim, "-1"), Ciudad:=If(ChkTransitorio.Checked, TxtCiudad.Text.Trim, "-1"), Licencia:=If(ChkTransitorio.Checked, TxtLicencia.Text.Trim, "-1"), Modulo:="TA/G2")
FolioSalida = ObjInventario.Folio
Folio = ObjInventario.Folio
If CveMovimientoSalida <= 0 Then
@@ -852,7 +852,7 @@ Partial Class Inventarios_TraspasoAlmacen
AlmacenEntrada = If(ChkTransitorio.Checked, DdlAlmacenTransitorio.SelectedValue.ToEntero, DdlAlmacenDestino.SelectedValue.ToEntero)
CveMovimientoEntrada = ObjInventario.AddMovimiento(AlmacenEntrada, TipoMovimientoEntrada, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, -1, -1,
Observaciones:=TxtObservaciones.Text.Trim, Recibio:=If(ChkTransitorio.Checked, TxtResponsable.Text.Trim, "-1"),
CveAlmacenDestino:=If(ChkTransitorio.Checked, DdlAlmacenDestino.SelectedValue.ToEntero, -1), CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/G")
CveAlmacenDestino:=If(ChkTransitorio.Checked, DdlAlmacenDestino.SelectedValue.ToEntero, -1), CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/G3")
FolioEntrada = ObjInventario.Folio
If CveMovimientoEntrada <= 0 Then
TextoError = "Ocurrió un error al generar el movimiento de entrada"
@@ -915,7 +915,7 @@ Partial Class Inventarios_TraspasoAlmacen
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
Dim resultado As DataTable = ObjInventario.DtResultados
Dim importe As Decimal = resultado.SUMD("Total")
Dim importe As Decimal = resultado.SUMD("Total").RoundSQL
Dim IdCtaContableSalida As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenOrigen.SelectedValue.ToEntero)).ToEntero
Dim IdCtaContableEntrada As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenDestino.SelectedValue.ToEntero)).ToEntero
Dim Contabilizable As Boolean = True
@@ -940,7 +940,7 @@ Partial Class Inventarios_TraspasoAlmacen
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
Dim resultado As DataTable = ObjInventario.DtResultados
Dim importe As Decimal = resultado.SUM("Total").ToDecimal
Dim importe As Decimal = resultado.SUMD("Total").RoundSQL
Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorio.SelectedValue.ToEntero)).ToEntero
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=importe, Contabilizable:=False) Then
@@ -1039,7 +1039,7 @@ Partial Class Inventarios_TraspasoAlmacen
'AGREGAMOS LA SALIDA DEL ALMACEN ORIGEN
CveMovimiento = ObjInventario.AddMovimiento(DdlAlmacenOrigen.SelectedValue.ToEntero, CveConceptoInventario, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
Observaciones:=TxtObservaciones.Text.Trim, Recibio:=If(ChkTransitorio.Checked, TxtResponsable.Text.Trim, ""),
GastoIndirecto:=If(ChkTransitorio.Checked And TxtGastoIndirecto.Text.ToDouble > 0, TxtGastoIndirecto.Text, "-1").ToDouble, Modulo:="TA/G")
GastoIndirecto:=If(ChkTransitorio.Checked And TxtGastoIndirecto.Text.ToDouble > 0, TxtGastoIndirecto.Text, "-1").ToDouble, Modulo:="TA/G4")
Dim FolioMov As Integer = ObjInventario.Folio
If CveMovimiento <= 0 Then
@@ -1510,26 +1510,37 @@ Partial Class Inventarios_TraspasoAlmacen
Exit Sub
End If
Dim CveMovimientoEntrada As Integer = 0
Dim Folio As Integer = 0
Dim ErrorMovInv As Boolean = False
Dim TextoError As String = ""
Dim Fecha As Date = TxtFechaRecepcion.Text.ToDate
Dim ObjInventario As New ClsInventarios
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL())
ObjInventario.IniciaTransacSQL()
Dim CveMovimientoEntrada As Integer = 0
Dim Folio = 0
Dim ErrorMovInv As Boolean = False
Dim TextoError = ""
Dim Fecha As Date = TxtFechaRecepcion.Text.ToDate
Try
CveMovimientoEntrada = ObjInventario.AddMovimiento(GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero, 27, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
Observaciones:=TxtObservacionesRecepcion.Text.Trim, Recibio:=TxtRecibio.Text, CveAlmacenDestino:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero,
CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/G")
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/TraspasoAlmacen", 53, 0, 0, 1, Fecha, TxtObservacionesRecepcion.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CvePrePoliza <= 0 Then
TextoError = "No se pudo generar la Poliza para la cancelacion"
CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/C")
If CveMovimientoEntrada <= 0 Then
TextoError = "No se pudo generar el movimiento"
ErrorMovInv = True
End If
Dim CvePrePoliza As Integer = -1
Dim Concepto As String = TxtObservacionesRecepcion.Text
If Concepto = "" Then Concepto = "Cancelación Traspaso"
If Not ErrorMovInv Then
Folio = ObjInventario.Folio
CvePrePoliza = ObjConta.AddPrePolizas("Inventario/TraspasoAlmacen", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CvePrePoliza <= 0 Then
TextoError = "No se pudo generar la Poliza para la cancelación"
ErrorMovInv = True
End If
End If
If CveMovimientoEntrada <= 0 And Not ErrorMovInv Then
TextoError = "No se pudo generar el movimiento de entrada correctamente"
@@ -1547,6 +1558,7 @@ Partial Class Inventarios_TraspasoAlmacen
TextoError = "Ocurrió un error al guardar los movimientos de salida"
Exit For
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PrecioUnitario, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveMovimientoDetalleEntrada:=CveMovimientoDetalleSalida) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
@@ -1554,25 +1566,36 @@ Partial Class Inventarios_TraspasoAlmacen
End If
importe += Cantidad * PrecioUnitario
Next
Else
ErrorMovInv = True
TextoError = "Ocurrió un error al obtener los movimientos de salida"
End If
If Not ErrorMovInv Then
Dim ImporteDecimal As Decimal = importe.ToDecimal
Dim ImporteDecimal As Decimal = importe.ToDecimal.RoundSQL
Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero)).ToEntero
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteDecimal, TxtObservaciones.Text, 289, TxtObservaciones.Text, Fecha, IdCtaContable, -1,
CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=ImporteDecimal) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteDecimal, TxtObservaciones.Text, 289, TxtObservaciones.Text, Fecha, IdCtaContable, -1,
CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=ImporteDecimal) Then
ErrorMovInv = True
TextoError = "Ocurrió un erro al cancelar el traspaso"
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteDecimal, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1,
CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=ImporteDecimal) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteDecimal, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1,
CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=ImporteDecimal) Then
ErrorMovInv = True
TextoError = "Ocurrió un erro al cancelar el traspaso"
End If
End If
End If
Catch ex As Exception
ErrorMovInv = True
TextoError = "Ocurrió un erro al cancelar el traspaso"
OnError(TextoError, ex)
End Try
If Not ErrorMovInv Then
ObjInventario.Commit()
@@ -1593,11 +1616,13 @@ Partial Class Inventarios_TraspasoAlmacen
UPDatosAlmacen.Update()
Else
ObjInventario.RollBack()
ObjConta.RollBack()
Alert(TextoError, TipoMensaje.MsgError)
End If
ObjConta.Dispose()
ObjInventario.Dispose()
CargaRecepcion()
End Sub
@@ -1648,7 +1673,7 @@ Partial Class Inventarios_TraspasoAlmacen
'AGREGAMOS LA ENTRADA
CveMovimientoSalida = ObjInventario.AddMovimiento(GvDatosRecepcion.Rows(0).DataKey("CveAlmacenDestino").ToEntero, 27, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveAlmacenDestino:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero, CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/G")
Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveAlmacenDestino:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero, CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/G1")
Folio = ObjInventario.Folio
If CveMovimientoSalida <= 0 Then
@@ -1708,7 +1733,7 @@ Partial Class Inventarios_TraspasoAlmacen
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
Dim resultado As DataTable = ObjInventario.DtResultados
Dim importe As Decimal = resultado.SUM("Total").ToDecimal
Dim importe As Decimal = resultado.SUMD("Total").RoundSQL
Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero)).ToEntero
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 289, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=importe, Contabilizable:=False) Then

View File

@@ -1058,6 +1058,32 @@
</div>
</div>
</div>
<div class="portlet light xspadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Cuentas y conceptos</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
</div>
<div class="portlet-body form-horizontal form-row-sepe">
<div class="form-body">
<asp:UpdatePanel runat="server" ID="UpCuentaConceptos" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvCuentasContable" runat="server" DataKeyNames="ConceptoContable,NombreCuenta" AutoGenerateColumns="False" EmptyDataText="No se encontraron Ventas en el Cliente" ToolTip="Listado de Historial de Ventas" CssClass="table table-striped table-advance table-hover" Style="text-align: center; min-width: 783px; width: 100%;" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Concepto Contable" DataField="ConceptoContable"/>
<asp:BoundField HeaderText="Nombre Cuenta" DataField="NombreCuenta"/>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
</div>

View File

@@ -778,7 +778,7 @@ Partial Class Clientes
If Request("ATI") IsNot Nothing AndAlso IsNumeric(Request("ATI")) Then
Tab.ActiveTabIndex = Request("ATI").ToEntero
End If
CargaCuentasyConceptos()
Else
'Configuración de Modalidad Insert
@@ -1037,6 +1037,15 @@ Partial Class Clientes
DdlMonedaExtranjeraAnticipos.Attributes.Add("onclick", "CargaCuentas(9);")
End Sub
Private Sub CargaCuentasyConceptos()
Dim ObjConta As New ClsContabilidad
If ObjConta.GetCuentasyConceptos(CveCliente) Then
GvCuentasContable.DataSource = ObjConta.DtResultados
End If
ObjConta.Dispose()
GvCuentasContable.DataBind()
UpCuentaConceptos.Update()
End Sub
Protected Sub BtnCargarCuentas_Click(sender As Object, e As EventArgs) Handles BtnCargarCuentas.Click
If UsuarioActual.Empresa.ServerContPAQi = "" Then Exit Sub
@@ -1863,6 +1872,7 @@ Partial Class Clientes
DdlUsoCFDI.Items.Clear()
DdlUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica)
DdlUsoCFDI.DataBind()
DdlUsoCFDI.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlSucursalUsoCFDI.Items.Clear()
DdlSucursalUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica)

View File

@@ -648,7 +648,8 @@
$get('LbImporteMN').innerHTML = '$ ' + FormatoNumero(SumaConversion, 2) + ' MXN';
}
}
function FnSeleccionaNC(chk, chkNC)
function FnSeleccionaNC(chk, chkNC,txtImporte)
{
if (chk.checked) {
chkNC.disabled = false;
@@ -659,6 +660,11 @@
chkNC.click();
}
}
txtImporte.disabled = chkNC.checked;
}
function FnEditarImporte(chkNC, txtImporte) {
txtImporte.disabled = chkNC.checked;
}
function FnLimites(chk, txt, limiteInferior, limiteSuperior) {

View File

@@ -616,7 +616,7 @@ 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});", 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}); 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))
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))
End If
@@ -644,10 +644,9 @@ Partial Class Ventas_ClientesAbonar
e.Row.FCRangeValidator("RVComision").MaximumValue = e.Row.DBCampo("Saldo")
End If
If e.Row.DBCampo("DescuentoProntoPago").ToDecimal() > 0 Then
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});", 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}); 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))
End If
Else
@@ -1540,12 +1539,26 @@ Partial Class Ventas_ClientesAbonar
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
If MsgError = "" Then
If ListaFacturasGenerarNC.Count > 0 Then
Dim Resp = GenerarNC(ObjIE.IniciaTransacSQL(), ObjConta, ListaFacturasGenerarNC)
For Each Fac As Modelos.Factura In ListaFacturasGenerarNC
Dim ListaNC As New List(Of Modelos.Factura)
ListaNC.Add(Fac)
Dim Resp As Modelos.Factura.MMensajeFactura = GenerarNC(ObjIE.IniciaTransacSQL(), ObjConta, ListaNC)
If Resp.CveVenta > 0 Then
NCGeneradas.Add(Resp)
Else
MsgError = "No se pudo generar la nota de credito"
MsgError = "No se pudo generar la nota de crédito"
Exit For
End If
Next
If MsgError = "" Then
If NCGeneradas.Count <> ListaFacturasGenerarNC.Count Then
MsgError = "No se generaron las notas de crédito seleccionadas"
End If
End If
End If
End If
End If
@@ -1641,21 +1654,14 @@ Partial Class Ventas_ClientesAbonar
If ObjConta IsNot Nothing Then ObjConta.Commit()
Dim StrMsg As New StringBuilder
StrMsg.Append("Abono Registrado Correctamente.<br/>")
StrMsg.AppendFormat("Folio <b><a href='/Bancos/IE.aspx?CveIE={0}' target='_blank' class='Texto'>{1}</a></b>", CveIE, ObjIE.Folio)
StrMsg.AppendFormat("Abono Registrado Correctamente. Folio <b><a href='/Bancos/IE.aspx?CveIE={0}' target='_blank' class='Texto'>{1}</a></b> <br/>", CveIE, ObjIE.Folio)
If IDPoliza > 0 Then StrMsg.AppendFormat("<br/> Poliza: <a href='/Contabilidad/RegPoliza.aspx?IdPoliza={0}' target='_blank' class='Texto'>{1}</a>", IDPoliza, FolioPoliza)
If IDPoliza > 0 Then StrMsg.AppendFormat("Poliza: <a href='/Contabilidad/RegPoliza.aspx?IdPoliza={0}' target='_blank' class='Texto'>{1}</a> <br/>", IDPoliza, FolioPoliza)
Dim TextoComplementoPago = EmitirComplementoPago(CveIE, CveVentasPago, SeriesPago)
Dim SbMensaje As New StringBuilder
SbMensaje.Append(String.Format("Abono Registrado Correctamente.<br/><br/> Poliza: <a href='/Contabilidad/RegPoliza.aspx?IdPoliza={0}' target='_blank' class='Texto'>{1}</a><br/><br/>{2}", IDPoliza, FolioPoliza, TextoComplementoPago))
For Each NC In NCGeneradas
For Each msg In NC.Mensajes
StrMsg.Append(msg)
Next
StrMsg.Append("</br>")
StrMsg.AppendFormat("Nota de crédito generada correctamente.<br/><br/> Folio: <a href='/Ventas/Ventas.aspx?CveVenta={0}' target='_blank' class='Texto'>{1}</a><br/>", NC.CveVenta, NC.SerieFolio)
Next
Alert($"{StrMsg.ToString}<br/><br/>{TextoComplementoPago}", TipoMensaje.MsgInformacion, If(ChkSeguirRegistrando.Checked, "location.href =""#""", "location.href =""/Bancos/RepCxCCliente.aspx"""))
@@ -1680,7 +1686,7 @@ Partial Class Ventas_ClientesAbonar
#Region " N O T A - D E - C R E D I T O"
Private Function GenerarNC(Trasac As SqlClient.SqlTransaction, ObjConta As ClsContPAQi, ListaVentasGenerarNC As List(Of Modelos.Factura)) As Modelos.Factura.MMensajeFactura
Private Function GenerarNC(SqlTransaccion As SqlClient.SqlTransaction, ObjConta As ClsContPAQi, ListaVentasGenerarNC As List(Of Modelos.Factura)) As Modelos.Factura.MMensajeFactura
Dim ObjFacturaDevolucion = New Modelos.Factura(UsuarioActual)
ObjFacturaDevolucion.TipoMensajeRespuesta = Modelos.TipoMensajeRespuesta.HTML
ObjFacturaDevolucion.CveUsuario = UsuarioActual.CveUsuario
@@ -1844,8 +1850,8 @@ Partial Class Ventas_ClientesAbonar
DtVentasNC.AcceptChanges()
ObjFacturaDevolucion.DtVentasNC = DtVentasNC
'ObjFacturaDevolucion.GenerarPDFFactura = True
Dim Resp = ObjFacturaDevolucion.EmitirFactura(False, Transac:=Trasac, ObjContPaqTransac:=ObjConta)
Dim Resp = ObjFacturaDevolucion.EmitirFactura(False, Transac:=SqlTransaccion, ObjContPaqTransac:=ObjConta)
ObjFacturaDevolucion.Dispose()
@@ -2371,6 +2377,11 @@ Partial Class Ventas_ClientesAbonar
#Region " COMPLEMENTOS PAGO "
Private Function EmitirComplementoPago(CveIE As Integer, CveVentas As List(Of Integer), Series As List(Of String)) As String
If Not UsuarioActual.Empresa.FacturaProduccion Then
Return ""
End If
If Not ChkComplementoPago.Checked Then
Return ""
End If

View File

@@ -1,4 +1,4 @@
<%@ Page Title="Ventas - Facturación" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PV.aspx.vb" Inherits="PV" EnableEventValidation="false" %>
<%@ Page Title="Ventas - Facturación" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PV.aspx.vb" Inherits="PV" EnableEventValidation="false"%>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%--Necesario para el modal que no se cierra--%>
@@ -621,7 +621,8 @@
<th runat="server" visible="false" id="nomostrar2"></th>
</tr>
</table>
<asp:GridView ID="GvPS" GridLines="None" runat="server" data-tableheader="#tbps" ShowHeader="true" AutoGenerateColumns="False" DataKeyNames="Consec,CvePS,Total, IEPS, CveClasificacion,CveUM,CveProyecto,CveSubProyecto,TipoDocto,PS,Obs,Cantidad,PU,Descuento,IVA,CantidadInventario,CantidadFacturadaRem" CssClass="table table-striped table-advance table-hover Widthall Sortable mysmallbtn ScrollAD" Style="min-width: 980px;">
<asp:GridView ID="GvPS" GridLines="None" runat="server" data-tableheader="#tbps" ShowHeader="true" AutoGenerateColumns="False"
DataKeyNames="CveVentaDetalle,Consec,CvePS,Total, IEPS, CveClasificacion,CveUM,CveProyecto,CveSubProyecto,TipoDocto,PS,Obs,Cantidad,PU,Descuento,IVA,CantidadInventario,CantidadFacturadaRem,EsCargo" CssClass="table table-striped table-advance table-hover Widthall Sortable mysmallbtn ScrollAD" Style="min-width: 980px;">
<Columns>
<%--0--%>
<asp:TemplateField ItemStyle-Font-Size="6pt">
@@ -1331,12 +1332,18 @@
</div>
<div class="portlet-body formnombottom">
<table border="0" align="center">
<tr>
<tr id="TrEmitir" runat="server">
<td>
<asp:Button ID="BtnEmitirImprimir" runat="server" Text="Emitir e Imprimir" Style="width: 170px; padding-right: 30px;" CssClass="btn btn-primary" ValidationGroup="GrpEmitirImprimir" />
<i class=" fa-print fa " style="margin-left: -30px; margin-top: 10px; color: white;"></i>
</td>
</tr>
<tr>
<td>
<asp:Button ID="BtnEditarRemision" runat="server" Text="Actualizar Remision" CssClass="btn myventasbutton btn-primary" Visible="false" />
<asp:Button ID="BtnPermisoEditarRemision" runat="server" Text="Editar Remision" CssClass="btn myventasbutton btn-primary" Visible="false" />
</td>
</tr>
</table>
</div>
</ContentTemplate>
@@ -2569,7 +2576,7 @@
</button>
<h4 class="modal-title" id="myModalLabelVenta">Registrar Venta</h4>
</div>
<div class="modal-body">
<div class="modal-body" onkeydown="return (event.keyCode!=13)">
<div class="row">
<div id="DivDatosVenta" runat="server" class="col-md-12">
<div class="portlet light xspadding bordered">
@@ -2588,7 +2595,7 @@
<div class="row">
<div class="col-md-4">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCantidad" onkeyup="Recalcula();" Text="1" onkeypress="DisableEnterKey(event);" runat="server" CssClass="form-control " ClientIDMode="Static" MaxLength="12" ValidationGroup="GrpAddVenta" Width="60px"></asp:TextBox>
<asp:TextBox ID="TxtCantidad" inputmode="numeric" onkeyup="Recalcula();" Text="1" runat="server" CssClass="form-control " ClientIDMode="Static" MaxLength="12" ValidationGroup="GrpAddVenta" Width="60px"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="SoloNumerosCantidad" runat="server" TargetControlID="TxtCantidad" FilterType="Custom, Numbers" ValidChars="." />
<asp:RequiredFieldValidator ID="RFVCantidad" runat="server" ControlToValidate="TxtCantidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOCantidad1" runat="server" HighlightCssClass="vco" TargetControlID="RFVCantidad" Width="300px"></ajax:ValidatorCalloutExtender>
@@ -2659,7 +2666,6 @@
</div>
<div id="DivRecepcionUsados" runat="server">
<div class="row">
<div class="col-md-6">
<label>Modelo:</label>
@@ -2670,10 +2676,10 @@
<div class="col-md-6">
<label>Año:</label>
<br />
<asp:TextBox ID="TxtAnioVehiculo" runat="server" Height="100%" Width="100%" CssClass="form-control" CausesValidation="true" MaxLength="500"></asp:TextBox>
<asp:TextBox ID="TxtAnioVehiculo" type="number" runat="server" Height="100%" Width="100%" CssClass="form-control" CausesValidation="true"></asp:TextBox>
</div>
</div>
<div class ="row">
<div class="row">
<div class="col-md-6">
<label>Tipo Servicio:</label>
<br />
@@ -2702,12 +2708,6 @@
<ajax:FilteredTextBoxExtender ID="FTBECantidad" runat="server" TargetControlID="TxtCantidad" FilterType="Custom, Numbers" ValidChars="." />
</ItemTemplate>
</asp:TemplateField>
<%-- <asp:TemplateField HeaderText="Modelo" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="30%">
<ItemTemplate>
<asp:DropDownList ID="DdlModeloAuto" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="ModeloMarca" DataValueField="CveModeloAuto">
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>--%>
<asp:TemplateField HeaderText="BCI" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="25%">
<ItemTemplate>
<asp:DropDownList ID="DdlBCIUsado" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="BCI" DataValueField="CveBCIUsado" Width="90%">
@@ -2720,22 +2720,12 @@
</div>
</div>
<%-- <br />
<div class="row">
<div class="col-md-7">
<label>BCI:</label>
<br />
<asp:DropDownList ID="DdlBCIUsado" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="BCI" DataValueField="CveBCIUsado" Width="200px">
</asp:DropDownList>
</div>
</div>--%>
<br />
<div class="row">
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPrecio" runat="server" onkeypress="setFocus(event,'LbAgregar');" onkeyup="Recalcula();" CausesValidation="true" lang="nb" ClientIDMode="Static" Text="0.00" MaxLength="12" ValidationGroup="GrpAddVenta" Width="76px" CssClass="form-control "></asp:TextBox>
<asp:TextBox ID="TxtPrecio" inputmode="numeric" runat="server" onkeyup="Recalcula();" CausesValidation="true" lang="nb" ClientIDMode="Static" Text="0.00" MaxLength="12" ValidationGroup="GrpAddVenta" Width="76px" CssClass="form-control "></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender4" 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="GrpAddVenta"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCPrecio" runat="server" HighlightCssClass="vco" TargetControlID="RFVPrecio" Width="300px"></ajax:ValidatorCalloutExtender>
@@ -2746,7 +2736,7 @@
</div>
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtDescuento" runat="server" onkeypress="setFocus(event,'LbAgregar');" onkeyup="Recalcula();" CausesValidation="true" lang="nb" ClientIDMode="Static" Text="0.00" MaxLength="12" ValidationGroup="GrpAddVenta" Width="100px" CssClass="form-control "></asp:TextBox>
<asp:TextBox ID="TxtDescuento" inputmode="numeric" runat="server" onkeyup="Recalcula();" CausesValidation="true" lang="nb" ClientIDMode="Static" Text="0.00" MaxLength="12" ValidationGroup="GrpAddVenta" Width="100px" CssClass="form-control "></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" runat="server" TargetControlID="TxtDescuento" FilterType="Custom, Numbers" ValidChars="." />
<asp:CustomValidator ID="CVDescuento" runat="server" ClientValidationFunction="ValidaDecimal6digits" ControlToValidate="TxtDescuento" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Descuento''</b> no tiene el formato correcto. Por favor rectifique y vuelva a intentar." ValidateEmptyText="True" ValidationGroup="GrpAddVenta"></asp:CustomValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender6" runat="server" HighlightCssClass="vco" TargetControlID="CVDescuento" Width="300px"></ajax:ValidatorCalloutExtender>
@@ -2807,7 +2797,7 @@
<a href="javascript;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="row" style="display:none;">
<div class="row" style="display: none;">
<div class="col-md-12">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlFacturas" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="SerieFolio" DataValueField="CveVenta" OnSelectedIndexChanged="DdlFacturas_SelectedIndexChanged" Width="100%" AutoPostBack="true">
@@ -2818,7 +2808,7 @@
</div>
<div class="row">
<div class="col-md-5">
<div >
<div>
<label for="<%= DdlDistribuidor.ClientID.ToString()%>">Distribuidor:</label><br />
<ADS:Dropdownlost ID="DdlDistribuidor" data-metodo="getcliente" CssStyle="width:100%" CssClassDdl="select2me" runat="server" DataTextField="CodigoNombre" DataValueField="CveCliente" Width="300px"></ADS:Dropdownlost>
</div>
@@ -2827,8 +2817,7 @@
<div class="row">
<div class="col-md-9">
<div class="form-group form-md-line-input input-iconright">
<ADS:DropDownLost ID="DdlPSAjuste" CssStyle="width: 100%;" CssClass=" form-control input-sm DdlPS" IncluyeTodos="false" CssClassDdl="select2me form-control" runat="server" CausesValidation="true" DataTextField="PSCodigo" DataValueField="CvePS" Onselectedindexchange="DdlPSAjuste_selectedindexchange" >
</ADS:DropDownLost>
<ADS:Dropdownlost ID="DdlPSAjuste" CssStyle="width: 100%;" CssClass=" form-control input-sm DdlPS" IncluyeTodos="false" CssClassDdl="select2me form-control" runat="server" CausesValidation="true" DataTextField="PSCodigo" DataValueField="CvePS" Onselectedindexchange="DdlPSAjuste_selectedindexchange"></ADS:Dropdownlost>
<asp:HiddenField ID="HdnPSAjusteMarca" ClientIDMode="Static" runat="server" Value="-1" />
<asp:HiddenField ID="HdnPSAjusteClasificacion" ClientIDMode="Static" runat="server" Value="-1" />
<label for="<%= DdlPSAjuste.ClientID.ToString()%>">Producto/Servicio a Recibir:</label>
@@ -2876,7 +2865,7 @@
<div class="col-md-8">
<div id="DivCodEnsamble" runat="server" class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCodEnsamble" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<asp:CustomValidator id="CVCodEnsamble" runat="server" ControlToValidate="TxtCodEnsamble" ClientValidationFunction="ValidarCodigoEnsamble" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Ensamble''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" />
<asp:CustomValidator ID="CVCodEnsamble" runat="server" ControlToValidate="TxtCodEnsamble" ClientValidationFunction="ValidarCodigoEnsamble" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Ensamble''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" />
<label for="<%= TxtCodEnsamble.ClientID.ToString()%>">Cod.Ensamble:</label>
</div>
</div>
@@ -2895,7 +2884,7 @@
<div class="col-md-8">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCodLinea" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<asp:CustomValidator id="CVCodLinea" runat="server" ControlToValidate="TxtCodLinea" ClientValidationFunction="ValidarCodigoLinea" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Linea''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" />
<asp:CustomValidator ID="CVCodLinea" runat="server" ControlToValidate="TxtCodLinea" ClientValidationFunction="ValidarCodigoLinea" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Linea''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" />
<label for="<%= TxtCodLinea.ClientID.ToString()%>">Cod.Linea:</label>
</div>
</div>
@@ -2907,7 +2896,7 @@
<asp:LinkButton ID="LnkFechaAjuste" class="btn default " Text=" <i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaAjuste" runat="server" TargetControlID="TxtFechaAjuste" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEEFechaAjuste" TargetControlID="TxtFechaAjuste" PopupButtonID="LnkFechaAjuste" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
<ajax:CalendarExtender runat="server" ID="CEEFechaAjuste" TargetControlID="TxtFechaAjuste" PopupButtonID="LnkFechaAjuste" PopupPosition="BottomLeft" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaAjuste" runat="server" ControlToValidate="TxtFechaAjuste" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEFechaAjuste" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaAjuste"></ajax:ValidatorCalloutExtender>
</div>
@@ -2917,8 +2906,8 @@
<div class="col-md-8">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCodInspeccion" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<asp:CustomValidator id="CVCodInspeccion" runat="server" ControlToValidate="TxtCodInspeccion" ClientValidationFunction="ValidarCodigoInspeccion" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Inspección''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" />
<%-- <asp:RegularExpressionValidator ID="REVCodInspeccion" runat="server" ControlToValidate="TxtCodInspeccion" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod. Inspección''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" ValidationExpression="^[A-L][0-9][1-9A-Z][A-HJ-M]$"></asp:RegularExpressionValidator>--%>
<asp:CustomValidator ID="CVCodInspeccion" runat="server" ControlToValidate="TxtCodInspeccion" ClientValidationFunction="ValidarCodigoInspeccion" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Inspección''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" />
<%-- <asp:RegularExpressionValidator ID="REVCodInspeccion" runat="server" ControlToValidate="TxtCodInspeccion" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod. Inspección''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" ValidationExpression="^[A-L][0-9][1-9A-Z][A-HJ-M]$"></asp:RegularExpressionValidator>--%>
<%--<asp:RequiredFieldValidator ID="RFVCodInspeccion" runat="server" ControlToValidate="TxtCodInspeccion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod. Inspeccion''</b> es necesario, por favor ingréselo." ValidationGroup="VGMAjuste"></asp:RequiredFieldValidator>--%>
<%--<ajax:ValidatorCalloutExtender ID="VCECodInspeccion" runat="server" HighlightCssClass="vco" TargetControlID="RFVCodInspeccion"></ajax:ValidatorCalloutExtender>--%>
<label for="<%= TxtCodInspeccion.ClientID.ToString()%>">Cod. Inspección:</label>
@@ -2963,7 +2952,7 @@
</div>
</div>
</div>
<div class="row" style="margin-top:17px;">
<div class="row" style="margin-top: 17px;">
<div class="col-md-2">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPoliza" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
@@ -2982,7 +2971,7 @@
</div>
</div>
<div class="col-md-4">
<asp:Button ID="BtnCalcularImporteAjuste" CssClass="btn green-haze btn-outline btn-circle btn-sm" OnClick="BtnCalcularImporteAjuste_Click" runat="server" Text="Recalcular" />
<asp:Button ID="BtnCalcularImporteAjuste" CssClass="btn green-haze btn-outline btn-circle btn-sm" OnClick="BtnCalcularImporteAjuste_Click" runat="server" Text="Recalcular" UseSubmitBehavior="false" />
</div>
</div>
</div>
@@ -2994,8 +2983,8 @@
<div class="modal-footer">
<asp:UpdatePanel ID="UpAgregar" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button ID="BtnCalculaMesesUso" Text="" OnClick="BtnCalculaMesesUso_Click" ClientIDMode="Static" Style="display: none;" runat="server" />
<asp:Button ClientIDMode="Static" ID="LnkAgregarPS" OnClick="LnkAgregarPS_Click" runat="server" CssClass="btn btn-primary" Text="Agregar" ValidationGroup="GrpAddVenta" />
<%-- <asp:Button ID="BtnCalculaMesesUso" Text="" OnClick="BtnCalculaMesesUso_Click" ClientIDMode="Static" Style="display: none;" runat="server" />--%>
<asp:Button ClientIDMode="Static" ID="LnkAgregarPS" OnClick="LnkAgregarPS_Click" runat="server" CssClass="btn btn-primary" Text="Agregar" ValidationGroup="GrpAddVenta" UseSubmitBehavior="false" />
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
@@ -3015,80 +3004,55 @@
function ValidarCodigoEnsamble(source, arguments) {
let CveMarca = HdnPSAjusteMarca.value;
let CveClasificacion = HdnPSAjusteClasificacion.value;
let regex = "";
//SI ES MOTOBATERIA
if (CveClasificacion = "20517") {
regex = "[1X]|"
//regex = "[*]|"
//SI ES OPTIMA
} else if (CveClasificacion = "20511") {
regex = "[1X]|"
}
//MARCA OPTIMA
if (CveMarca == "1086") {
let re = new RegExp("^" + regex + "[0-9]+$");
arguments.IsValid = re.test(parseInt(arguments.Value));
let regex = new RegExp("^[0-9]+$");
arguments.IsValid = regex.test(arguments.Value);
return;
//MARCA MOTOBATERIAS
} else if ((CveMarca == "1090" || CveMarca == "1091") || CveClasificacion == "20517") {
let regex = new RegExp("^[1X]");
arguments.IsValid = regex.test(arguments.Value);
return;
//AUTOMOTRIZ-ACUMULADORES
} else {
let re = new RegExp("^" + regex + "[0-9][A-HJ-M]([[0-2][0-9]|3[0-1])[0-9A-Z][ACEN][2-5]$");
arguments.IsValid = re.test(arguments.Value);
let regex = new RegExp("^[1X]|^[0-9][A-HJ-M]([[0-2][0-9]|3[0-1])[0-9A-Z][ACEN][2-5]$");
arguments.IsValid = regex.test(arguments.Value);
return;
}
}
function ValidarCodigoLinea(source, arguments) {
var CveMarca = HdnPSAjusteMarca.value;
let CveClasificacion = HdnPSAjusteClasificacion.value;
let regex = "";
//SI ES MOTOBATERIA
if (CveClasificacion = "20517") {
regex = "[*]|";
} else {
regex = "";
}
if (CveMarca == "1086") {
var re = new RegExp("^" + regex + "[0-9]+$");
arguments.IsValid = re.test(parseInt(arguments.Value));
} else {
var re = new RegExp("^" + regex + "$");
arguments.IsValid = re.test(arguments.Value);
}
var regex = new RegExp("^[*]");
arguments.IsValid = regex.test(arguments.Value);
}
function ValidarCodigoInspeccion(source, arguments) {
let CveMarca = HdnPSAjusteMarca.value;
let CveClasificacion = HdnPSAjusteClasificacion.value;
let clasificaciones = ["20517", "20511"]
//SI ES MOTOBATERIA
if (CveClasificacion = "20517") {
var re = new RegExp("^[X]|[x]|[A-L][0-9][1-9A-Z][A-HJ-M]$");
arguments.IsValid = re.test(arguments.Value);
//MARCA OPTIMA
if (CveMarca == "1086") {
var regex = new RegExp("^\d{4}$|^[A-L][0-9][1-9A-Z][A-HJ-M]$");
arguments.IsValid = regex.test(arguments.Value);
return;
//MARCA MOTOBATERIAS
} else if ((CveMarca == "1090" || CveMarca == "1091") || CveClasificacion == "20517") {
var regex = new RegExp("^[A-L][0-9][1-9A-Z][A-HJ-M]$");
arguments.IsValid = regex.test(arguments.Value);
return;
//AUTOMOTRIZ-ACUMULADORES
} else {
var re = new RegExp("^[A-L][0-9][1-9A-Z][A-HJ-M]$");
arguments.IsValid = re.test(arguments.Value);
var regex = new RegExp("^[X]|^[x]|[A-L][0-9][1-9A-Z][A-HJ-M]$");
arguments.IsValid = regex.test(arguments.Value);
return;
}
//if (clasificaciones.includes(CveClasificacion)) {
// //var re = new RegExp("^[*]|[A-L][0-9][1-9A-Z][A-HJ-M]$");
// var re = new RegExp("^[X]|[A-L][0-9][1-9A-Z][A-HJ-M]$");
// arguments.IsValid = re.test(parseInt(arguments.Value));
// return;
//} else {
// var re = new RegExp("^[A-L][0-9][1-9A-Z][A-HJ-M]$");
// arguments.IsValid = re.test(arguments.Value);
// return;
//}
}
function CalculaMesesUso() {
$get("BtnCalculaMesesUso").click();
}
//function CalculaMesesUso() {
// $get("BtnCalculaMesesUso").click();
//}
function ConvertirDllsPesos() {
var totalPesos = FormatoNumero(ToDouble($get('TxtTotal').value) * ToDouble($get('TxtTipoCambio').value), 2)

File diff suppressed because it is too large Load Diff

View File

@@ -162,7 +162,7 @@
<asp:GridView ID="GVRepIngresos" runat="server" GridLines="None" CssClass="table table-hover table-striped GVRepIngresos ScrollAD Widthall" AutoGenerateColumns="False"
DataKeyNames="Importe,Descuento,Amortizacion,IVA,IEPS,ImpuestoLocal,Total">
DataKeyNames="Importe,Descuento,Amortizacion,IVA,IEPS,ImpuestoLocal,Total" OnRowDataBound="GVRepIngresos_RowDataBound" >
<Columns>
<asp:TemplateField HeaderText="Titulo">
<ItemTemplate>

View File

@@ -145,4 +145,11 @@ Partial Class Ventas_RepIngresos
End Sub
#End Region
Protected Sub GVRepIngresos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("ConceptoContable").Contiene("INGRESOS", "ANTICIPOS") Then
e.Row.CssClass = "Totales"
End If
End If
End Sub
End Class

View File

@@ -3541,7 +3541,7 @@
<div style="max-height: 300px; overflow-y: auto;">
<asp:GridView ID="GVAnticipos" runat="server" AutoGenerateColumns="False" ClientIDMode="Static" EmptyDataText="No se encontraron Anticipos del Cliente"
ToolTip="Listado de Anticipos" CssClass="GVAnticipos table table-striped table-hover Widthall" data-height="300" Style="text-align: center;" GridLines="None"
DataKeyNames="ISTotal,Saldo,CveIE,Folio,Tipo,CveVenta,CveConceptoContable,CveConceptoContableAmor, TotalAnticipo, SubTotalAnticipo, IVAAnticipo, ImpuestosLocalesAnticipo, SubTotalAmortizacion, SubTotal, Original, IVA, RetIVA, RetISR, IdCtaContableNC,FolioFiscal, CveClasificacionNC, IdCtaContableNCSIG, TipoCambio, CveMoneda,Fecha,SaldoSubTotal">
DataKeyNames="ISTotal,Saldo,CveIE,Folio,Tipo,CveVenta,CveConceptoContable,CveConceptoContableAmor, TotalAnticipo, SubTotalAnticipo, IVAAnticipo, ImpuestosLocalesAnticipo, SubTotalAmortizacion, SubTotal, Original, IVA, RetIVA, RetISR, IdCtaContableNC,FolioFiscal, CveClasificacionNC, IdCtaContableNCSIG, TipoCambio,TipoCambioPago, CveMoneda,Fecha,SaldoSubTotal">
<Columns>
<asp:TemplateField>
<ItemTemplate>
@@ -5261,7 +5261,7 @@
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="myModalLabelVenta">Registrar Venta</h4>
<h4 class="modal-title" id="myModalLabelVenta">Registrar Producto/Servicio</h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
@@ -5272,35 +5272,24 @@
</div>
<asp:UpdatePanel runat="server" ID="UpClasificacionPyME" UpdateMode="Conditional">
<ContentTemplate>
<div class="form-group form-md-line-input input-iconright">
<%-- <%--<asp:HiddenField ID="HdnUnidadMedida" runat="server" Value="-1" />
<asp:HiddenField ID="HiddenField1" runat="server" Value="-1" />
<asp:HiddenField ID="HiddenField2" runat="server" Value="-1" />
<asp:HiddenField ID="HiddenField3" runat="server" Value="-1" />
<asp:HiddenField ID="HiddenField4" runat="server" Value="-1" />
<asp:HiddenField ID="HiddenField5" runat="server" Value="-1" />
<asp:HiddenField ID="HiddenField6" runat="server" Value="-1" />
<asp:HiddenField ID="HiddenField7" runat="server" Value="-1" />
<asp:HiddenField ID="HiddenField8" runat="server" Value="-1" />
<asp:HiddenField ID="HiddenField9" runat="server" Value="-1" />
<asp:HiddenField ID="HiddenField10" runat="server" Value="-1" />
<asp:HiddenField ID="HiddenField11" runat="server" Value="-1" />--%>
<div id="DivAddClasificacionPyME" runat="server" class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlClasificacionPyME" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Width="50%">
<asp:ListItem Selected="True" Text="Seleccione la Clasificación (Todas)" Value="-1"></asp:ListItem>
</asp:DropDownList>
<label for="<%= DdlClasificacionPyME.ClientID.ToString()%>">Clasificacion:</label>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group form-md-line-input input-iconright">
<ADS:Dropdownlost runat="server" ID="DdlPSPyME" CssStyle="width: 50%;" CssClass=" form-control input-sm DdlPS" CssClassDdl=" select2me " DataTextField="PSCodigo" DataValueField="CvePS" data-onresult="CargaExistenciaAlmacenes" />
<label for="<%= DdlPSPyME.ClientID.ToString()%>">
Productos / Servicio:
<label>
<label for="<%= DdlPSPyME.ClientID.ToString()%>">Producto/Servicio:</label>
<ADS:Dropdownlost runat="server" ID="DdlPSPyME" CssStyle="width: 100%;" CssClass=" form-control input-sm DdlPS" IncluyeTodos="false" CssClassDdl="select2me form-control" DataTextField="PSCodigo" DataValueField="CvePS" data-onresult="CargaExistenciaAlmacenes" />
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<div class="form-group form-md-line-input input-iconright">
<div id="DivAddUMPyME" runat="server" class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlUMPyME" AppendDataBoundItems="true" CssClass="form-control input-sm select2me " runat="server" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida" Style="width: 50%; max-width: 150px;"></asp:DropDownList>
<label for="<%= DdlUMPyME.ClientID.ToString()%>">Unidad de Medida:</label>
</div>
@@ -5308,7 +5297,7 @@
<div>
<label>Observación:</label>
<br />
<asp:TextBox ID="TxtObsPyME" runat="server" Height="50" Width="503px" TextMode="MultiLine" CausesValidation="true" MaxLength="500"></asp:TextBox>
<asp:TextBox ID="TxtObsPyME" runat="server" CssClass="form-control input-sm" Height="50" TextMode="MultiLine" CausesValidation="true" MaxLength="500"></asp:TextBox>
</div>
<div id="divproyectos" runat="server">
<asp:UpdatePanel ID="UPPProyecto" runat="server" UpdateMode="Conditional">
@@ -5328,12 +5317,23 @@
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPrecioPyME" runat="server" CausesValidation="true" lang="nb" ClientIDMode="Static" MaxLength="12" ValidationGroup="GrpAddVenta" CssClass="form-control"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender5" runat="server" TargetControlID="TxtPrecioPyME" FilterType="Custom, Numbers" ValidChars="." />
<asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtPrecioPyME" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Precio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
<label for="<%= TxtPrecioPyME.ClientID.ToString()%>">Precio:</label>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtDescuentoPyME" runat="server" Enabled="false" CausesValidation="true" lang="nb" ClientIDMode="Static" MaxLength="12" CssClass="form-control"></asp:TextBox>
<label for="<%= TxtDescuentoPyME.ClientID.ToString()%>">Descuento:</label>
</div>
</div>
</div>
<div class="form-group form-md-line-input input-iconright">
<div class="row">
<div class="col-md-6">
@@ -7346,6 +7346,8 @@
}
$('.DdlPS').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); });
$('.DdlPSPyME').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); });
$("body").on("mouseenter", ".select2-container.select2-container--default.select2-container--open .select2-dropdown li", function (event) {
var $this = $(this);
var ind = $this.index();

View File

@@ -2446,6 +2446,28 @@ Partial Class Ventas
End If
'MOSTRAR LA OPCION DE AGREGAR PS EN BDH
If UsuarioActual.CveEmpresa = 140 AndAlso CveVenta <= 0 Then
ImgOtrosConceptos.Visible = False
TrFormaEntrega.Visible = False
TabDetalleVentas.Visible = False
TabE.Visible = False
LnkOCs.Visible = False
GvPS.Columns(8).Visible = False
TrEdit.Visible = True
ThProyecto.Visible = False
For Each Gvr As GridViewRow In GvPS.Rows
Gvr.FCLinkButton("imgE").Visible = False
Gvr.FCLinkButton("imgEPyME").Visible = True
Next
LnkAddVenta.Visible = True
divproyectos.Visible = False
DivAddClasificacionPyME.Visible = False
DivAddUMPyME.Visible = False
End If
If UsuarioActual.Empresa.CvePlataforma = 2 Then
ImgOtrosConceptos.Visible = False
TrFormaEntrega.Visible = False
@@ -2454,6 +2476,7 @@ Partial Class Ventas
LnkOCs.Visible = False
GvPS.Columns(8).Visible = False
TrEdit.Visible = False
ThProyecto.Visible = False
For Each Gvr As GridViewRow In GvPS.Rows
Gvr.FCLinkButton("imgE").Visible = False
@@ -2461,6 +2484,9 @@ Partial Class Ventas
Next
LnkAddVenta.Visible = True
divproyectos.Visible = False
DivAddClasificacionPyME.Visible = False
DivAddUMPyME.Visible = False
End If
TabVentaAF.Visible = False
@@ -2562,6 +2588,24 @@ Partial Class Ventas
TxtFecha.Enabled = True
CargaPorcentajeMarcas()
BloqueaCondiconesPago()
End Sub
Private Sub BloqueaCondiconesPago()
If UsuarioActual.TienePermisoProceso(289) Then
DdlFormaEntrega.Enabled = False
DdlUsoCFDI.Enabled = False
DdlMetodoPago33.Enabled = False
DdlFormaPago33.Enabled = False
DdlTiposRelacion.Enabled = False
TxtFechaPago.ReadOnly = True
TxtFechaPago.Enabled = False
RBLPago.Enabled = False
imgCalendario.Visible = False
End If
UPCondicionesPago.Update()
End Sub
Private Sub ConfiguraEmpresa()
@@ -5104,9 +5148,11 @@ Partial Class Ventas
UpModalTitleUploadDocumentoCliente.Update()
UpModalButtonUploadDocumentoCliente.Update()
UPObservaciones.Update()
' RegistraScript("$('#DivDocsClienteUpload').modal({ backdrop: 'static', keyboard: false});", "modalOC")
End If
BloqueaCondiconesPago()
End Sub
Private Sub CargaRestriccionesCreditoCliente(Optional Alertas As Boolean = False, Optional CveVenta As Integer = -1)
@@ -5775,6 +5821,10 @@ Partial Class Ventas
Descuento = (GvPS.Rows(e.RowIndex).FCTextBox("TxtDescuento").Text.ToDecimal).RoundSQL(NumeroDecimales)
CuentaPredial = GvPS.Rows(e.RowIndex).FCTextBox("TxtPredial").Text.Trim
If UsuarioActual.CveEmpresa = 140 Then
Descuento = CalcularDescuentos(TmpDT.Rows(e.RowIndex)("CvePS").ToString.ToEntero, Cantidad, PU)
End If
Dim CantidadOriginal As Decimal = GvPS.Rows(e.RowIndex).DataKey("Cantidad").ToDecimal()
Dim DatarowPS As DataRow = Nothing
@@ -5824,9 +5874,9 @@ Partial Class Ventas
Dim objPS As New ClsProductosServicios
If objPS.GetPSSucursalesALL(CvePS, UsuarioActual.CveEmpresa, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero) Then
PrecioMinimo = objPS.DtResultados.FiltroPrimeroValor("PrecioMinimo", "").ToDecimal
If PrecioMinimo > 0 Then
Costo = PrecioMinimo
End If
'If PrecioMinimo > 0 Then
' Costo = PrecioMinimo
'End If
End If
objPS.Dispose()
@@ -5835,7 +5885,7 @@ Partial Class Ventas
If ValidaExistencia AndAlso DdlTipoComprobante.SelectedValue <> "Cot" And ChkSinExistencia.Checked = False AndAlso Not RegistroxOC Then
'VALIDA EXISTENCIA
If UsuarioActual.CveEmpresa.Contiene({72, 80, 119}) Then
If Existencia - TmpDT.SUM("Cantidad", $"CvePS = {CvePS}") < TxtCantidad.Text.ToDouble Then
If Existencia - TmpDT.SUM("Cantidad", $"CvePS = {CvePS} AND (EntregaDirecta IS NULL OR EntregaDirecta < 1)") < TxtCantidad.Text.ToDouble Then
Alert("No cuenta con la cantidad suficiente en inventario. Cuenta con " + Existencia.FormatoNumero(2) + ".", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
@@ -9248,15 +9298,23 @@ Partial Class Ventas
CveVentaRelacion:=(If(factura.CveVentaRelacion.ToEntero > 0, factura.CveVentaRelacion, -1)), ImporteRelacion:=(If(factura.ImporteRelacion <> Nothing, factura.ImporteRelacion, -1)),
CveTipoAmortizacionAnticipo:=factura.CveTipoAmortizacionAnticipo, CveEmpresaCRM:=CveEmpresaCRM, EsInterno:=EsInterno, CveAcercamientoCRM:=CveAcercamientoCRM,
DiasCredito:=factura.DiasCredito, EsDiasCreditoFijo:=factura.EsDiasCreditoFijo, AnticipoEspecial:=If(TrAntEspecial.Visible, ChkAntEspecial.Checked, False),
Kilometraje:=TxtKilometraje.Text.ToDouble) Then
Kilometraje:=TxtKilometraje.Text.ToDouble, EsAmortizacion:=EsNCAmortizacion) Then
ErrorList.Add("Ocurrió un error al Generar la Venta.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
Else
If factura.TipoDocto.Contiene("Dev") Or DtVentasNC IsNot Nothing Then
If DtVentasNC IsNot Nothing Then
For Each row As DataRow In DtVentasNC.Rows
If Not ObjVentas.AddVentasRelacionadas(ObjVentas.CveVenta, row("CveVenta").ToString.ToEntero) Then
ErrorList.Add("Ocurrió un error al relacionar las ventas entre si comuníquese a Soporte Técnico")
End If
Next
Else
If Not ObjVentas.AddVentasRelacionadas(ObjVentas.CveVenta, CveVenta) Then
ErrorList.Add("Ocurrió un error al relacionar las ventas entre si comuníquese a Soporte Técnico")
End If
End If
End If
End If
If Not GuardarUsados(ObjVentas.IniciaTransacSQL, ObjVentas.CveVenta) Then
ErrorList.Add("Error al guardar usados")
@@ -11750,11 +11808,8 @@ Partial Class Ventas
'If FechaMaxima < "01/01/2018".ToDate And UsuarioActual.CveEmpresa = 119 Then
' FechaMaxima = "01/01/2018".ToDate
'End If
'Dim Now As DateTime = New DateTime(2020, 2, 19)
Try
CvePrepoliza = ObjConta.AddPrePolizas("Ventas/Anticipos", CvePlantillaPoliza, TxtTotal.Text.ToDecimal, TxtTotal.Text.ToDecimal, DdlMoneda.SelectedValue.ToEntero, TxtFechaAnticipoCliente.Text.ToDate, String.Format("{0} {1} {2}-{3}", If(EsAnticipo2017Jam, "Aplicación Anticipo 2017", ""), NombreCliente, Serie, TxtFolio.Text), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CvePrepoliza > 0 Then
@@ -11773,6 +11828,8 @@ Partial Class Ventas
Dim CveCuentaIVAXTrasladar As Integer = 0
Dim CveCuentaIVATrasladado As Integer = 0
Dim Importe91 As Decimal = 0
If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDT.MAX("PorcentajeIVA").ToDouble).Rows.Count > 0 Then
Dim Dr As DataRow = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDT.MAX("PorcentajeIVA").ToDouble).FiltroPrimero("")
IdCtaIVAXTrasladar = Dr("IdCtaIVAXTrasladar").ToString.ToEntero
@@ -11789,7 +11846,7 @@ Partial Class Ventas
Dim TipoCambioFluctuacion As Decimal = 1
If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
If ObjIE.DtResultados.Rows.Count > 0 Then
Dim tFecha As Date = gvr.DataKey("Fecha").ToDate
Dim tFecha As Date = Now 'gvr.DataKey("Fecha").ToDate
Dim Fecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & Fecha & "#", "Fecha DESC")
@@ -11801,25 +11858,25 @@ Partial Class Ventas
End If
End If
If DdlMoneda.SelectedValue.ToEntero = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then 'Si la venta viene en Pesos y se va a pagar en Pesos
If DdlMoneda.SelectedValue.ToEntero = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then 'SI LA VENTA VIENE EN PESOS Y SE VA A PAGAR EN PESOS
tipoCambioPago = 1
tipoCambioVenta = 1
tipoCambioVentaValuacion = 1
PorcentajePago = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("Original").ToDecimal
ElseIf DdlMoneda.SelectedValue.ToEntero = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then 'Si la venta viene en Dolares y se va a pagar en Pesos
ElseIf DdlMoneda.SelectedValue.ToEntero = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then 'SI LA VENTA VIENE EN DOLARES Y SE VA A PAGAR EN PESOS
tipoCambioPago = gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
tipoCambioVenta = TxtTipoCambio.Text.ToDecimal
tipoCambioVentaValuacion = If(TxtFecha.Text.ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, TxtTipoCambio.Text.ToDecimal)
PorcentajePago = (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal) / gvr.DataKey("Original").ToDecimal
ElseIf DdlMoneda.SelectedValue.ToEntero = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then 'Si la venta viene en Dolares y se va a pagar en DOLARES
ElseIf DdlMoneda.SelectedValue.ToEntero = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then 'SI LA VENTA VIENE EN DOLARES Y SE VA A PAGAR EN DOLARES
tipoCambioPago = gvr.DataKey("TipoCambio").ToString.ToDecimal
tipoCambioVenta = TxtTipoCambio.Text.ToDecimal
tipoCambioVentaValuacion = If(TxtFecha.Text.ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, TxtTipoCambio.Text.ToDecimal)
PorcentajePago = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("Original").ToDecimal
ElseIf DdlMoneda.SelectedValue.ToEntero = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES
tipoCambioPago = gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
ElseIf DdlMoneda.SelectedValue.ToEntero = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then 'SI LA VENTA VIENE EN PESOS Y SE VA A PAGAR EN DOLARES
tipoCambioPago = gvr.DataKey("TipoCambio").ToDecimal() ' gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
tipoCambioVenta = 1
tipoCambioVentaValuacion = 1
tipoCambioVentaValuacion = If(TxtFecha.Text.ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, TxtTipoCambio.Text.ToDecimal)
PorcentajePago = (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal) / gvr.DataKey("Original").ToDecimal
End If
@@ -11935,19 +11992,24 @@ Partial Class Ventas
End If
importeMovimiento = 0
Case 91 'Amortizacion Nota de Credito
Dim TC As Decimal = 1
If gvr.DataKey("CveConceptoContable").ToString().ToEntero = 12 Then
If CveMonedaVenta = 1 And gvr.DataKey("CveMoneda").ToString.ToDecimal = 1 Then
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal
importeMX = importeMovimiento
TC = gvr.DataKey("TipoCambio").ToString.ToDecimal
ElseIf CveMonedaVenta = 2 And gvr.DataKey("CveMoneda").ToString.ToDecimal = 2 Then
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal
importeMX = importeMovimiento * gvr.DataKey("TipoCambio").ToString.ToDecimal
TC = gvr.DataKey("TipoCambio").ToString.ToDecimal
ElseIf CveMonedaVenta = 1 And gvr.DataKey("CveMoneda").ToString.ToDecimal = 2 Then
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
importeMX = importeMovimiento * gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
TC = TipoCambioFluctuacion
ElseIf CveMonedaVenta = 2 And gvr.DataKey("CveMoneda").ToString.ToDecimal = 1 Then
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
importeMX = importeMovimiento
TC = gvr.DataKey("TipoCambio").ToString.ToDecimal
End If
importeMovimiento = Math.Round(importeMovimiento, 2)
importeMX = Math.Round(importeMX, 2)
@@ -11976,8 +12038,8 @@ Partial Class Ventas
IdCtaContable = IdCtaContComplementaria
CveCuenta = 0
importeMX = importeMovimiento
ImporteComplementaria = ((importeMovimiento * gvr.DataKey("TipoCambio").ToString.ToDecimal) - importeMovimiento).RoundSQL
If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, False, importeMovimiento, Concepto, 203, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=gvr.DataKey("CveVenta").ToString.ToEntero, CveCliente:=CveCliente, CveVentaAmortizacion:=CveVenta, ImporteMX:=ImporteComplementaria, ImporteME:=If(gvr.DataKey("TipoCambio").ToString.ToDecimal = 1, 0, importeMovimiento), TipoCambio:=gvr.DataKey("TipoCambio").ToString.ToDecimal) Then
ImporteComplementaria = ((importeMovimiento * TC) - importeMovimiento).RoundSQL
If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, False, importeMovimiento, Concepto, 203, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=gvr.DataKey("CveVenta").ToString.ToEntero, CveCliente:=CveCliente, CveVentaAmortizacion:=CveVenta, ImporteMX:=ImporteComplementaria, ImporteME:=If(gvr.DataKey("TipoCambio").ToString.ToDecimal = 1, 0, importeMovimiento), TipoCambio:=TC) Then
ErrorConta = True
Exit For
End If
@@ -11990,7 +12052,7 @@ Partial Class Ventas
CveCuenta = 0
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, TipoMovimiento, importeMovimiento, Concepto, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=gvr.DataKey("CveVenta").ToString.ToEntero, CveCliente:=CveCliente, CveVentaAmortizacion:=CveVenta, ImporteMX:=importeMX, CveCuenta:=CveCuenta, TipoCambio:=gvr.DataKey("TipoCambio").ToString.ToDecimal) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, TipoMovimiento, importeMovimiento, Concepto, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=gvr.DataKey("CveVenta").ToString.ToEntero, CveCliente:=CveCliente, CveVentaAmortizacion:=CveVenta, ImporteMX:=importeMX, CveCuenta:=CveCuenta, TipoCambio:=TC) Then
ErrorConta = True
Exit For
End If
@@ -11998,8 +12060,8 @@ Partial Class Ventas
'AMORTIZA NC CONTRA ANTICIPO A CLIENTES
If Not ErrorConta And DdlTipoComprobante.SelectedValue = "Ant" Then
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal - ((gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("Original").ToDecimal) * gvr.DataKey("IVA").ToDecimal)
If ObjConta.AddPrePolizasDetalle(CvePrepoliza, False, importeMovimiento, Concepto, 11, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveVentaAmortizacion:=gvr.DataKey("CveVenta").ToString.ToEntero, ImporteMX:=importeMovimiento * gvr.DataKey("TipoCambio").ToString.ToDecimal, CveCuenta:=CveCuenta) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, True, importeMovimiento, Concepto, 4, Concepto, FechaMovimiento, gvr.DataKey("IdCtaContableNC").ToEntero, -1, CveClasificacion:=gvr.DataKey("CveClasificacionNC").ToEntero, CveVenta:=gvr.DataKey("CveVenta").ToString.ToEntero, CveCliente:=CveCliente, CveVentaAmortizacion:=CveVenta, ImporteMX:=importeMovimiento * gvr.DataKey("TipoCambio").ToString.ToDecimal, CveCuenta:=gvr.DataKey("IdCtaContableNCSIG").ToEntero) Then
If ObjConta.AddPrePolizasDetalle(CvePrepoliza, False, importeMovimiento, Concepto, 11, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveVentaAmortizacion:=gvr.DataKey("CveVenta").ToString.ToEntero, ImporteMX:=importeMovimiento * TC, CveCuenta:=CveCuenta) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrepoliza, True, importeMovimiento, Concepto, 4, Concepto, FechaMovimiento, gvr.DataKey("IdCtaContableNC").ToEntero, -1, CveClasificacion:=gvr.DataKey("CveClasificacionNC").ToEntero, CveVenta:=gvr.DataKey("CveVenta").ToString.ToEntero, CveCliente:=CveCliente, CveVentaAmortizacion:=CveVenta, ImporteMX:=importeMovimiento * TC, CveCuenta:=gvr.DataKey("IdCtaContableNCSIG").ToEntero) Then
ErrorConta = True
Exit For
End If
@@ -12010,6 +12072,7 @@ Partial Class Ventas
End If
End If
End If
Importe91 = importeMovimiento
importeMovimiento = 0
Case 92 'Amortizacion Ingreso X Comprobar
If gvr.DataKey("CveIE").ToString.ToEntero > 0 AndAlso gvr.DataKey("CveConceptoContable").ToString().ToEntero = 66 Then
@@ -12131,6 +12194,18 @@ Partial Class Ventas
If CveMonedaVenta <> 1 OrElse gvr.DataKey("CveMoneda").ToEntero <> 1 Then
IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria
CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria
If CveMonedaVenta = 1 And gvr.DataKey("CveMoneda").ToString.ToDecimal = 2 Then
If tipoCambioVentaValuacion > tipoCambioPago AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
importeMovimiento = Importe91 * (tipoCambioVentaValuacion - tipoCambioPago) 'Añadimos la diferencia de ganancia en la venta
importeMovimiento = Math.Abs(Math.Round(importeMovimiento, 2))
importeMX = importeMovimiento
End If
Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioVentaValuacion, tipoCambioPago)
TipoCambioGeneral = TCImpuestos
Else
Dim TipoCambioGanancia As Decimal = If(Not (gvr.DataKey("CveIE").ToString.ToEntero > 0 AndAlso gvr.DataKey("CveConceptoContable").ToString().ToEntero = 66), tipoCambioVentaValuacion, tipoCambioVenta)
If tipoCambioPago > TipoCambioGanancia AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
@@ -12140,6 +12215,8 @@ Partial Class Ventas
End If
Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, TipoCambioGanancia, tipoCambioPago)
TipoCambioGeneral = TCImpuestos
End If
Else
importeMovimiento = 0
End If
@@ -12147,6 +12224,17 @@ Partial Class Ventas
If CveMonedaVenta <> 1 OrElse gvr.DataKey("CveMoneda").ToEntero <> 1 Then
IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria
CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria
If CveMonedaVenta = 1 And gvr.DataKey("CveMoneda").ToString.ToDecimal = 2 Then
If tipoCambioVentaValuacion < tipoCambioPago AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
importeMovimiento = Importe91 * Math.Abs(tipoCambioVentaValuacion - tipoCambioPago) 'Añadimos la diferencia de ganancia en la venta
importeMovimiento = Math.Abs(Math.Round(importeMovimiento, 2))
importeMX = importeMovimiento
End If
Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioVentaValuacion, tipoCambioPago)
TipoCambioGeneral = TCImpuestos
Else
Dim TipoCambioPerdida As Decimal = If(Not (gvr.DataKey("CveIE").ToString.ToEntero > 0 AndAlso gvr.DataKey("CveConceptoContable").ToString().ToEntero = 66), tipoCambioVentaValuacion, tipoCambioVenta)
If tipoCambioPago < TipoCambioPerdida AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
@@ -12154,8 +12242,11 @@ Partial Class Ventas
importeMovimiento = Math.Abs(Math.Round(importeMovimiento, 2))
importeMX = importeMovimiento
End If
Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, TipoCambioPerdida, tipoCambioPago)
TipoCambioGeneral = TCImpuestos
End If
Else
importeMovimiento = 0
End If
@@ -12193,6 +12284,11 @@ Partial Class Ventas
End If
End If
Catch ex As Exception
ErrorConta = True
OnError("Ocurrió un error al guardar el anticipo", ex)
End Try
If ErrorConta Then
Alert("Ocurrió un error al amortizar el documento. Por favor verifique y vuelva a intentar.", TipoMensaje.MsgError)
ObjConta.RollBack()
@@ -13520,6 +13616,7 @@ Partial Class Ventas
End Sub
Protected Sub DdlSucursalCliente_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlSucursalCliente.SelectedIndexChanged
CargaClienteSucursal(DdlSucursalCliente.SelectedValue.ToEntero)
CargaRestriccionesCreditoCliente(Alertas:=True)
End Sub
Protected Sub DdlCCEdit_SelectedIndexChanged(sender As Object, e As System.EventArgs)
Dim gvr As GridViewRow = DirectCast(DirectCast(sender, DropDownList).BindingContainer, GridViewRow)
@@ -13642,6 +13739,10 @@ Partial Class Ventas
CargarAlmacenes()
DdlPS.Attributes.Remove("data-cvesubproyecto")
DdlPS.Attributes.Add("data-cvesubproyecto", DdlSubProyectoDatos.SelectedValue)
DdlPSPyME.Attributes.Remove("data-cvesubproyecto")
DdlPSPyME.Attributes.Add("data-cvesubproyecto", DdlSubProyectoDatos.SelectedValue)
UpPS.Update()
End Sub
Private Sub CargaFolios()
@@ -13958,39 +14059,24 @@ Partial Class Ventas
Return True
End Function
Private Sub AgregarPS()
'SELECCIONA EL PS DEPENDIENDO LA MODALIDAD (CODIGO BARRAS - DDL)
Dim CvePS = -1
If DIVCod.Visible Then
CvePS = HdnCvePS.Value.ToEntero
Else
CvePS = DdlPS.SelectedValue.ToEntero
End If
If ValidaAgregarPS(CvePS, DdlUnidadMedida.SelectedValue.ToEntero, TxtPrecio.Text.Trim.ToDouble, HdnTipoPS.Value.ToEntero) Then
Private Function CalcularDescuentos(CvePS As Integer, Cantidad As Decimal, PU As Decimal) As Decimal
Dim Descuento As Decimal = HdnDescuento.Value.ToDecimal
If UsuarioActual.Empresa.Funcionalidad(572) = "1" AndAlso Not TbDescuentosRNC.Visible Then
TbDescuentosRNC.Visible = True
End If
If UsuarioActual.Empresa.Funcionalidad(507) = DdlPS.SelectedValue Then
CvePSAmortizacion = DdlPS.SelectedValue.ToEntero.ToEntero
End If
Dim Descuento As Decimal = HdnDescuento.Value.ToDecimal
If HdnTipoDescuento.Value = "0" Then
Descuento = HdnDescuento.Value.ToDecimal * TxtCantidad.Text.ToDecimal
Descuento = HdnDescuento.Value.ToDecimal * Cantidad
End If
'Agrega Promocion en el Descuento
'AGREGA PROMOCION EN EL DESCUENTO
Dim TipoPromo As Integer = 0
Dim TotalPromocion As Decimal = 0
Dim PromocionPorcentaje As Decimal = 0
Dim CantMinima As Integer = 0
If DtPromociones.Rows.Count > 0 And DtPromociones IsNot Nothing Then
If DtPromociones IsNot Nothing AndAlso DtPromociones.Rows.Count > 0 Then
Dim dr As DataRow = DtPromociones.FiltroPrimero($"CvePS = {CvePS}")
If dr IsNot Nothing Then
TipoPromo = dr("TipoPromocion").ToString.ToEntero
@@ -14003,17 +14089,14 @@ Partial Class Ventas
If TipoPromo = 1 Then 'Promocion por Importe $
Descuento = Descuento + TotalPromocion
ElseIf TipoPromo = 2 Then 'Promocion por %
Descuento = Descuento + ((TxtPrecio.Text.Trim.ToDecimal * PromocionPorcentaje / 100) * TxtCantidad.Text.ToDecimal)
Descuento = Descuento + ((PU * PromocionPorcentaje / 100) * Cantidad)
ElseIf TipoPromo = 3 Then 'Promocion por Cantidad
If TxtCantidad.Text.ToDecimal >= CantMinima Then
If Cantidad >= CantMinima Then
Descuento = Descuento + TotalPromocion
End If
End If
Dim Cantidad As Decimal = TxtCantidad.Text.ToDecimal
Dim PU As Decimal = If(CvePSAmortizacion > 0, TxtPrecio.Text.Trim.ToDecimal * -1, TxtPrecio.Text.Trim.ToDecimal)
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("") ' Estado = -1
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
Dim ValidaCondicionesComerciales As Boolean = True
If DrPS IsNot Nothing AndAlso DrPS("CveClasificacion").ToString.ToEntero = 20636 Then
@@ -14027,6 +14110,8 @@ Partial Class Ventas
Dim RowPorcentaje = DtPorcentajeMarcas.FiltroPrimero($"CveMarca={DrPS("CveMarca").ToString()}")
'REALIZA LOS DESCUENTOS DE ACUERDO AL PORCENTAJE POR MARCA
If RowPorcentaje IsNot Nothing Then
'LIMPIAR LOS DESCUENTOS
Descuento = 0
Dim PorcentajeProducto = RowPorcentaje("PorcentajeProducto").ToString().ToDecimal() / 100D
Dim PorcentajeProducto2 = RowPorcentaje("PorcentajeProducto2").ToString().ToDecimal() / 100D
Dim PorcentajeProducto3 = RowPorcentaje("PorcentajeProducto3").ToString().ToDecimal() / 100D
@@ -14061,9 +14146,29 @@ Partial Class Ventas
End If
End If
End If
Return Descuento
End Function
Private Sub AgregarPS()
'SELECCIONA EL PS DEPENDIENDO LA MODALIDAD (CODIGO BARRAS - DDL)
Dim CvePS As Integer = -1
If DIVCod.Visible Then
CvePS = HdnCvePS.Value.ToEntero
Else
CvePS = DdlPS.SelectedValue.ToEntero
End If
If ValidaAgregarPS(CvePS, DdlUnidadMedida.SelectedValue.ToEntero, TxtPrecio.Text.Trim.ToDouble, HdnTipoPS.Value.ToEntero) Then
If UsuarioActual.Empresa.Funcionalidad(507) = DdlPS.SelectedValue Then
CvePSAmortizacion = DdlPS.SelectedValue.ToEntero.ToEntero
End If
Dim Cantidad As Decimal = TxtCantidad.Text.ToDecimal
Dim PU As Decimal = If(CvePSAmortizacion > 0, TxtPrecio.Text.Trim.ToDecimal * -1, TxtPrecio.Text.Trim.ToDecimal)
Dim Descuento As Decimal = CalcularDescuentos(CvePS, Cantidad, PU)
AgregarProductoServicio(Cantidad, DdlUnidadMedida.SelectedValue.ToEntero, DdlUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text,
CvePS, "", TxtObsPS.Text.Trim, PU, Descuento,
DdlProyecto.SelectedValue.ToEntero, DdlProyecto.SelectedItem.Text, DdlSubProyecto.SelectedValue.ToEntero, DdlSubProyecto.SelectedItem.Text,
@@ -14081,18 +14186,6 @@ Partial Class Ventas
End If
End If
''NO SIRVE PARA NADA - NO SE USAN LAS VARIABLES - IPP 28 AGOSTO 2017
'For Each gvr As GridViewRow In GVAnticipos.Rows
' Dim total As Decimal = TxtTotal.Text.ToString.ToDecimal
' Dim saldo As Decimal = gvr.DataKey("Saldo").ToDecimal
' Dim maxsaldo As Decimal
' If total > saldo Then
' maxsaldo = saldo
' Else
' maxsaldo = total
' End If
'Next
End Sub
@@ -14105,13 +14198,19 @@ Partial Class Ventas
Dim CveSubProyecto As Integer = IIf(DdlSubProyectoPyME.SelectedValue <> "-1", DdlSubProyectoPyME.SelectedValue, "0").ToString.ToEntero
Dim SubProyecto As String = IIf(DdlSubProyectoPyME.SelectedValue <> "-1", DdlSubProyectoPyME.SelectedItem.Text, "").ToString
AgregarProductoServicio(TxtCantidadPyME.Text.ToDecimal, DdlUMPyME.SelectedValue.ToEntero, DdlUMPyME.SelectedItem.Text, DdlClasificacionPyME.SelectedValue.ToEntero, DdlClasificacionPyME.SelectedItem.Text,
DdlPSPyME.SelectedValue.ToEntero, DdlPSPyME.SelectedText, TxtObsPyME.Text, TxtPrecioPyME.Text.ToDecimal, 0, CveProyecto, Proyecto, CveSubProyecto, SubProyecto)
Dim PU As Decimal = TxtPrecioPyME.Text.ToDecimal()
Dim Cantidad As Decimal = TxtCantidadPyME.Text.ToDecimal()
Dim CvePS As Integer = DdlPSPyME.SelectedValue.ToEntero
Dim Descuento As Decimal = CalcularDescuentos(CvePS, Cantidad, PU)
AgregarProductoServicio(Cantidad, DdlUMPyME.SelectedValue.ToEntero, DdlUMPyME.SelectedItem.Text, DdlClasificacionPyME.SelectedValue.ToEntero, DdlClasificacionPyME.SelectedItem.Text,
CvePS, DdlPSPyME.SelectedText, TxtObsPyME.Text, PU, Descuento, CveProyecto, Proyecto, CveSubProyecto, SubProyecto)
CalculaUsados()
CalculaTotalesVenta()
ElseIf Modalidad = "U" Then
Dim ErrorEdit As Boolean = True
@@ -14292,49 +14391,6 @@ Partial Class Ventas
DrPS("IEPSPorcentaje") = 0
End If
''VERIFICA SI APLICAN CONDICIONES COMERCIALES
'If DtPorcentajeMarcas IsNot Nothing AndAlso DtPorcentajeMarcas.Rows.Count > 0 Then
' 'VERIFICA SI EL PRODUCTO TIENE ESPECIFICADA UNA MARCA
' If Not String.IsNullOrEmpty(DrPS("CveMarca").ToString()) AndAlso DrPS("CveMarca").ToString().ToEntero() > 0 Then
' Dim RowPorcentaje = DtPorcentajeMarcas.FiltroPrimero($"CveMarca={DrPS("CveMarca").ToString()}")
' 'REALIZA LOS DESCUENTOS DE ACUERDO AL PORCENTAJE POR MARCA
' If RowPorcentaje IsNot Nothing Then
' Dim PorcentajeProducto = RowPorcentaje("PorcentajeProducto").ToString().ToDecimal() / 100D
' Dim PorcentajeProducto2 = RowPorcentaje("PorcentajeProducto2").ToString().ToDecimal() / 100D
' Dim PorcentajeProducto3 = RowPorcentaje("PorcentajeProducto3").ToString().ToDecimal() / 100D
' Dim TotalInicial = (Cantidad * (PU)) - Descuento
' Dim TotalFinal = TotalInicial
' 'SI APLICA EL PRIMER DESCUENTO
' If PorcentajeProducto > 0 Then
' Dim Descuento1 = TotalInicial * PorcentajeProducto
' Dim Total2 = (TotalInicial - Descuento1)
' 'SI APLICA EL SEGUNDO DESCUENTO
' If PorcentajeProducto2 > 0 Then
' Dim Descuento2 = Total2 * PorcentajeProducto2
' Dim Total3 = (Total2 - Descuento2)
' 'SI APLICA EL TERCER DESCUENTO
' If PorcentajeProducto3 > 0 Then
' Dim Descuento3 = Total3 * PorcentajeProducto3
' TotalFinal = Total3 - Descuento3
' Else
' TotalFinal = Total3
' End If
' Else
' TotalFinal = Total2
' End If
' Else
' TotalFinal = TotalInicial
' End If
' Descuento += ((Cantidad * PU) - TotalFinal)
' End If
' End If
'End If
TotalCalculableImpuestos = (Cantidad * (PU)) - Descuento
TotalCalculableImpuestosIVA = TotalCalculableImpuestos * (1 + DrPS("IEPSPorcentaje").ToString.ToDecimal)
@@ -14629,7 +14685,7 @@ Partial Class Ventas
TmpDT.Columns.Add("CveConcepto", GetType(Integer))
TmpDT.Columns.Add("EsOutSourcing", GetType(Boolean))
TmpDT.Columns.Add("EsUsado", GetType(Boolean))
TmpDT.Columns.Add("EsCargo", GetType(Boolean))
End Sub
Private Sub CreaDTmpC()
@@ -16957,7 +17013,6 @@ Partial Class Ventas
DrProducto("CvePS").ToString.ToEntero, DrProducto("PS").ToString, TxtObsPS.Text.Trim, TxtPrecio.Text.Trim.ToDecimal, 0,
DdlProyecto.SelectedValue.ToEntero, DdlProyecto.SelectedItem.Text, DdlSubProyecto.SelectedValue.ToEntero, DdlSubProyecto.SelectedItem.Text)
'AddPS(TxtCantidad.Text.Trim.ToDouble, DrProducto("CveUM").ToString.ToEntero, DrProducto("UnidadMedida").ToString, DrProducto("CveClasificacion").ToString.ToEntero, DrProducto("Clasificacion").ToString,
' DrProducto("CvePS").ToString.ToEntero, DrProducto("PS").ToString, TxtObsPS.Text.Trim, TxtPrecio.Text.Trim.ToDouble, HdnIVAPS.Value.ToDouble, 0, 0,
' -1, -1, True, DrProducto("Codigo").ToString, DdlProyecto.SelectedValue.ToEntero,
@@ -19550,9 +19605,10 @@ Partial Class Ventas
Private Sub LnkAddVenta_Click(sender As Object, e As EventArgs) Handles LnkAddVenta.Click
Modalidad = "A"
LnkAgregarPyME.Text = "Agregar"
TxtCantidadPyME.Text = ""
TxtCantidadPyME.Text = "1"
TxtObsPyME.Text = ""
TxtPrecioPyME.Text = "0.00"
TxtDescuentoPyME.Text = "0.00"
LblTotalPyME.Text = "0.00"
If Not UsuarioActual.Empresa.Funcionalidad(141).ToString = "1" Then
DdlPSPyME.SelectedValue = "-1"
@@ -19636,18 +19692,12 @@ Partial Class Ventas
Private Sub CargaPSPyME(CveClasificacion As Integer, Objeto As ADServerControl.Dropdownlost)
DdlPSPyME.setEsWebService(If(UsuarioActual.Empresa.Funcionalidad(141).ToString = "1", True, False))
DdlPSPyME.setEsWebService(True)
If Not UsuarioActual.Empresa.Funcionalidad(141).ToString = "1" Then
Objeto.ddl.Items.Clear()
'Objeto.ddl.DataSource = GlobalDTProductosServicios(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacion, AplicaParaVenta:=1, Estatus:=1)
Objeto.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacion, AplicaParaVenta:=1, Estatus:=1)
Objeto.ddl.DataBind()
Objeto.ddl.Items.Insert(0, New ListItem("*** Actualizar listado de Productos o Servicios ***", "-2"))
Objeto.ddl.Items.Insert(0, New ListItem("Seleccione el Producto", "-1"))
Else
DdlPSPyME.Attributes.Add("data-cvesubproyecto", DdlSubProyectoDatos.SelectedValue)
End If
DdlPSPyME.ddlWS.Attributes.Add("data-cveclasificacion", CveClasificacion.ToString)
DdlPSPyME.ddlWS.Attributes.Add("data-pagina", "ventas/ventas")
DdlPSPyME.ddlWS.Attributes.Add("data-Estatus", "1")
End Sub
@@ -19678,6 +19728,15 @@ Partial Class Ventas
'LblUnidadMedida.Text = PS.Rows(0)("UnidadMedida").ToString
TxtPrecioPyME.Text = drPS("Precio").ToString.FormatoNumero(2).Replace(","c, "")
Dim Cantidad As Decimal = TxtCantidadPyME.Text.ToDecimal()
Dim PU As Decimal = TxtPrecioPyME.Text.ToDecimal()
Dim Descuento As Decimal = CalcularDescuentos(DdlPSPyME.SelectedValue.ToEntero, Cantidad, PU)
TxtDescuentoPyME.Text = Descuento.FormatoNumero(2).Replace(","c, "")
LblTotalPyME.Text = ((Cantidad * PU) - Descuento).FormatoNumero(2).Replace(","c, "")
If UsuarioActual.CveEmpresa = 80 Then
'busca el precio de la sucursal
Dim ObjPS As New ClsProductosServicios
@@ -19895,8 +19954,6 @@ Partial Class Ventas
BtnAgregarPS.Enabled = True
End If
UpSerieConsignacion.Update()
TxtSerieLote.Text = ""
TxtSerieLote.Focus()
@@ -21650,7 +21707,7 @@ Partial Class Ventas
UPCondicionesPago.Update()
UpDetalle.Update()
BloqueaCondiconesPago()
End Sub
Private Sub InicializaDTVentasNC()
@@ -21704,11 +21761,11 @@ Partial Class Ventas
#Region " APLICA DEVOLUCION "
Private Sub InicializaAplicaDevolucion()
If Not UsuarioActual.CveUsuario = 100 Then
If Not UsuarioActual.CveEmpresa.Contiene(72, 80, 119, 140, 141, 146) Then
Exit Sub
End If
End If
'If Not UsuarioActual.CveUsuario = 100 Then
' If Not UsuarioActual.CveEmpresa.Contiene(72, 80, 119, 140, 141, 146) Then
' Exit Sub
' End If
'End If
'sino tiene el permiso no puede generar Devolucion
If Not UsuarioActual.TienePermisoProceso(264) Then
@@ -21770,7 +21827,7 @@ Partial Class Ventas
Dim AplicaPUEditado As Boolean = UsuarioActual.TienePermisoProceso(253)
Dim DtUsados As DataTable = TmpDT.FiltraParametros("EsUsado = True")
Dim DtUsados As DataTable = TmpDT.FiltraParametros("EsCargo = True")
TmpDT.Clear()
For Each Gv As GridViewRow In GvAplicaDevolucion.Rows
@@ -21969,6 +22026,8 @@ Partial Class Ventas
End If
Next
BloqueaCondiconesPago()
UpAnticipos.Update()
UpParametros.Update()
UpPS.Update()
@@ -21981,6 +22040,8 @@ Partial Class Ventas
UpnTools.Update()
UPObservaciones.Update()
UpAntNC.Update()
End Sub
#End Region
@@ -22426,6 +22487,7 @@ Partial Class Ventas
GvImpuestosLocales2.Enabled = True
BloqueaCondiconesPago()
UpPS.Update()
UPPDescuento.Update()
@@ -23775,6 +23837,7 @@ Partial Class Ventas
CambiaSucursalGeneral()
CargaAnticipos(CveCliente)
CargaRestriccionesCreditoCliente(CveVenta:=-1)
BloqueaCondiconesPago()
UpParametros.Update()
End Sub
@@ -23944,6 +24007,10 @@ Partial Class Ventas
Private Sub CalculaUsados(Optional DtUsadosDevolucion As DataTable = Nothing)
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Cot", "Dev") Then
If ViewState("CargoUsado").ToString = "False" Then
Exit Sub
End If
Dim DTTamanios As DataTable = GlobalDTAcumTamaños()
Dim DTCvePSCostos As DataTable
@@ -23953,7 +24020,17 @@ Partial Class Ventas
TmpDT.Columns.Add("Eliminar", GetType(Integer))
End If
For Each drow As DataRow In TmpDT.Rows
Dim TmpDTCalculo As DataRow() = Nothing
'SI ES VENTA NUEVA O SI VA SER DEVOLUCION CONSIDERAR TODOS
If Me.CveVenta <= 0 OrElse DtUsadosDevolucion IsNot Nothing Then
TmpDTCalculo = TmpDT.Rows.Cast(Of DataRow).ToArray()
'SI ES EDICION DE REMISION SOLO CONSIDERAR LOS PRODUCTOS NUEVOS
ElseIf Me.CveVenta > 0 AndAlso DtUsadosDevolucion Is Nothing AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Cot") Then
TmpDTCalculo = TmpDT.Select("CveVentaDetalle IS NULL OR CveVentaDetalle <=0")
End If
For Each drow As DataRow In TmpDTCalculo
If DTCvePSCostos IsNot Nothing Then
For Each drow2 As DataRow In DTCvePSCostos.Rows
If drow("CvePS").ToString.ToEntero = drow2("CvePSCargo").ToString.ToEntero Then
@@ -23962,7 +24039,6 @@ Partial Class Ventas
End If
Next
End If
Next
Dim TmpDTView As New DataView(TmpDT)
@@ -23972,11 +24048,19 @@ Partial Class Ventas
dRowEliminar.Delete()
Next
TmpDT.AcceptChanges()
If ViewState("CargoUsado").ToString = "False" Then
Exit Sub
'SI ES VENTA NUEVA O SI VA SER DEVOLUCION CONSIDERAR TODOS
If Me.CveVenta <= 0 OrElse DtUsadosDevolucion IsNot Nothing Then
TmpDTCalculo = TmpDT.Rows.Cast(Of DataRow).ToArray()
'SI ES EDICION DE REMISION SOLO CONSIDERAR LOS PRODUCTOS NUEVOS
ElseIf Me.CveVenta > 0 AndAlso DtUsadosDevolucion Is Nothing AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Cot") Then
TmpDTCalculo = TmpDT.Select("CveVentaDetalle IS NULL OR CveVentaDetalle <=0")
End If
TmpDT.AcceptChanges()
Dim CveUnidadMedidaPSA As Integer = -1
Dim UnidadMedidaPSA As String = "Unidad"
Dim CveClasificacionPSA As Integer = -1
@@ -24001,7 +24085,7 @@ Partial Class Ventas
DTPSTemp.Columns.Add("CveSubProyecto", GetType(Integer))
DTPSTemp.Columns.Add("SubProyecto", GetType(String))
For Each DrowPartidas As DataRow In TmpDT.Rows
For Each DrowPartidas As DataRow In TmpDTCalculo
Dim CveTamanioTemp As Integer = DrowPartidas("CveTamaño").ToString.ToEntero
If CveTamanioTemp > 0 Then