Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -925,10 +925,10 @@ Public Class ClsAcumuladores
|
||||
OnError("Ocurrió un al eliminar poliza virtual. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
Public Function DistribuidorMovtosAdd(CveCliente As Integer, Cantidad As Decimal, CveTamaño As Integer, CveConcepto As Integer, CveVenta As Integer, CveUsuario As Integer,
|
||||
|
||||
Public Function DistribuidorMovtosAdd(CveCliente As Integer, Cantidad As Decimal, CveTamaño As Integer, Puntos As Decimal, ImporteCargo As Decimal, ImporteBonificacion As Decimal, CveConcepto As Integer, CveVenta As Integer, CveUsuario As Integer,
|
||||
CveEmpresa As Integer, ImporteCompras As Decimal, Observaciones As String, FechaIng As DateTime, Optional CveMovimiento As Integer = -1,
|
||||
Optional CveVentaBonificacion As Integer = -1, Optional FacturadoBonificacion As Boolean = False) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
@@ -940,6 +940,9 @@ Public Class ClsAcumuladores
|
||||
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
||||
.Add("@Cantidad", SqlDbType.Decimal).Value = Cantidad
|
||||
.Add("@CveTamaño", SqlDbType.Int).Value = CveTamaño
|
||||
.Add("@Puntos", SqlDbType.Money).Value = Puntos
|
||||
.Add("@ImporteCargo", SqlDbType.Money).Value = ImporteCargo
|
||||
.Add("@ImporteBonificacion", SqlDbType.Money).Value = ImporteBonificacion
|
||||
.Add("@CveConcepto", SqlDbType.Int).Value = CveConcepto
|
||||
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
@@ -961,7 +964,8 @@ Public Class ClsAcumuladores
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
Public Function DistribuidorMovtosGet(CveCliente As Integer, CveEmpresa As Integer, Optional FechaI As Date = MinFecha, Optional FechaF As Date = MaxFecha, Optional CveVentaRNCCargo As Integer = -1, Optional CveConcepto As Integer = -1) As Boolean
|
||||
Public Function DistribuidorMovtosGet(CveCliente As Integer, CveEmpresa As Integer, Optional FechaI As Date = MinFecha, Optional FechaF As Date = MaxFecha,
|
||||
Optional CveVentaRNCCargo As Integer = -1, Optional CveVentaRNCBonificacion As Integer = -1, Optional CveConcepto As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
'Data = New DataTable
|
||||
|
||||
@@ -973,6 +977,7 @@ Public Class ClsAcumuladores
|
||||
.Add("@FechaI", SqlDbType.Date).Value = FechaI
|
||||
.Add("@FechaF", SqlDbType.Date).Value = FechaF
|
||||
.Add("@CveVentaRNCCargo", SqlDbType.Int).Value = CveVentaRNCCargo
|
||||
.Add("@CveVentaRNCBonificacion", SqlDbType.Int).Value = CveVentaRNCBonificacion
|
||||
.Add("@CveConcepto", SqlDbType.Int).Value = CveConcepto
|
||||
End With
|
||||
|
||||
|
||||
@@ -4313,6 +4313,40 @@ Public Class ClsPaginas
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "CITRUS GAME"
|
||||
Property GlobalDTGralEmpacados(CveEmpresa As Integer) As DataTable
|
||||
Get
|
||||
Dim AppNombre As String = $"GlobalDTGralEmpacados-{CveEmpresa}"
|
||||
If Application(AppNombre) Is Nothing Then
|
||||
Dim ObjGenerales As New ClsGenerales()
|
||||
If ObjGenerales.GetEmpacados(CveEmpresa) Then Application(AppNombre) = ObjGenerales.DtResultados
|
||||
ObjGenerales.Dispose()
|
||||
End If
|
||||
|
||||
GlobalDTGralEmpacados = DirectCast(Application(AppNombre), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
Dim AppNombre As String = $"GlobalDTGralEmpacados-{CveEmpresa}"
|
||||
Application(AppNombre) = value
|
||||
End Set
|
||||
End Property
|
||||
Property GlobalDTGralTipoOrganicos(CveEmpresa As Integer) As DataTable
|
||||
Get
|
||||
Dim AppNombre As String = $"GlobalDTGralTipoOrganicos-{CveEmpresa}"
|
||||
If Application(AppNombre) Is Nothing Then
|
||||
Dim ObjGenerales As New ClsGenerales()
|
||||
If ObjGenerales.GetTipoOrganicos(CveEmpresa) Then Application(AppNombre) = ObjGenerales.DtResultados
|
||||
ObjGenerales.Dispose()
|
||||
End If
|
||||
|
||||
GlobalDTGralTipoOrganicos = DirectCast(Application(AppNombre), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
Dim AppNombre As String = $"GlobalDTGralTipoOrganicos-{CveEmpresa}"
|
||||
Application(AppNombre) = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
#End Region
|
||||
|
||||
|
||||
@@ -4321,8 +4355,6 @@ Public Class ClsPaginas
|
||||
DirectorioSitio = 2
|
||||
eFacturasCaptcha = 3
|
||||
|
||||
|
||||
|
||||
RutaEmpresasJM = 500
|
||||
RutaEmpresasRM = 501
|
||||
RutaEmpresasPC = 502
|
||||
|
||||
@@ -2102,12 +2102,17 @@ Namespace Modelos
|
||||
CveConcepto = 6
|
||||
End Select
|
||||
'SI ES FACTURA,NC,DEV O ES RNC DE CARGO, CANCELAR MOVIMIENTOS
|
||||
If factura.TipoDocto.Contiene("Ing", "Dev", "Egs") OrElse factura.TipoDocto.Contiene("RNC") AndAlso factura.Num1 = 1 Then
|
||||
If factura.TipoDocto.Contiene("Ing", "Dev", "Egs") OrElse (factura.TipoDocto.Contiene("RNC") AndAlso factura.Num1 = 1) Then
|
||||
|
||||
If ObjAcum.DistribuidorMovtosGet(factura.CveCliente, UsuarioActual.CveEmpresa, CveVentaRNCCargo:=factura.CveVenta, CveConcepto:=CveConcepto) Then
|
||||
Dim DtMovimientos As DataTable = ObjAcum.DtResultados.FiltraParametros("Cantidad > 0")
|
||||
If DtMovimientos IsNot Nothing AndAlso DtMovimientos.Rows.Count > 0 Then
|
||||
For Each RowSalida As DataRow In DtMovimientos.Rows
|
||||
Dim Cantidad As Decimal = RowSalida("Cantidad").ToString().ToDecimal() * -1
|
||||
Dim Puntos As Decimal = RowSalida("Puntos").ToString().ToDecimal()
|
||||
|
||||
Dim ImporteCargo As Decimal = RowSalida("ImporteCargo").ToString().ToDecimal()
|
||||
Dim ImporteBonificacion As Decimal = RowSalida("ImporteBonificacion").ToString().ToDecimal()
|
||||
|
||||
Dim FacturadoBonificacion = False
|
||||
Dim CveVentaBonificacion As Integer = -1
|
||||
@@ -2117,15 +2122,15 @@ Namespace Modelos
|
||||
FacturadoBonificacion = CBool(RowSalida("FacturadoBonificacion").ToString())
|
||||
End If
|
||||
|
||||
If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, Cantidad, RowSalida("CveTamaño").ToString.ToEntero, CveConcepto, factura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0D, "", factura.Fecha, CveVentaBonificacion:=CveVentaBonificacion, FacturadoBonificacion:=FacturadoBonificacion) Then
|
||||
If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, Cantidad, RowSalida("CveTamaño").ToString.ToEntero, Puntos, ImporteCargo, ImporteBonificacion, CveConcepto, factura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0D, "", factura.Fecha, CveVentaBonificacion:=CveVentaBonificacion, FacturadoBonificacion:=FacturadoBonificacion) Then
|
||||
Retorno = False
|
||||
Exit For
|
||||
End If
|
||||
|
||||
Next
|
||||
DtMovimientos.Dispose()
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
|
||||
End If
|
||||
|
||||
@@ -2138,15 +2143,25 @@ Namespace Modelos
|
||||
If UsuarioActual.Empresa.Funcionalidad(533).ToEntero > 0 AndAlso factura.TipoDocto.Contiene("Ing", "Rem") Then
|
||||
|
||||
If factura.TipoDocto = "Ing" AndAlso factura.Cliente.EsDistribuidor Then
|
||||
Dim CvePSPSA As Integer = UsuarioActual.Empresa.Funcionalidad(533).ToEntero
|
||||
|
||||
For Each drow As DataRow In factura.DtDetalle.Rows
|
||||
If drow("CveTamaño").ToString.ToEntero > 0 And (CvePSPSA <> drow("CvePS").ToString.ToEntero) Then
|
||||
If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, drow("Cantidad").ToString.ToDecimal, drow("CveTamaño").ToString.ToEntero, 2, factura.CveVenta, UsuarioActual.CveUsuario,
|
||||
UsuarioActual.CveEmpresa, 0D, "", factura.Fecha) Then
|
||||
If drow("CveTamaño").ToString.ToEntero > 0 Then
|
||||
Dim DrTamanio As DataRow = GlobalDTAcumTamaños().FiltroPrimero($"CveTamaño={drow("CveTamaño").ToString.ToEntero}")
|
||||
If DrTamanio IsNot Nothing Then
|
||||
Dim Cargo As Decimal = DrTamanio("Cargo").ToString().ToDecimal() * drow("Cantidad").ToString.ToDecimal()
|
||||
Dim Bonificacion As Decimal = DrTamanio("Bonificacion").ToString().ToDecimal() * drow("Cantidad").ToString.ToDecimal()
|
||||
Dim Puntos As Decimal = DrTamanio("Puntos").ToString().ToDecimal() * drow("Cantidad").ToString.ToDecimal()
|
||||
|
||||
If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, drow("Cantidad").ToString.ToDecimal, drow("CveTamaño").ToString.ToEntero, Puntos, Cargo, Bonificacion, 2, factura.CveVenta, UsuarioActual.CveUsuario,
|
||||
UsuarioActual.CveEmpresa, 0D, "", factura.Fecha) Then
|
||||
Resultado = False
|
||||
Exit For
|
||||
End If
|
||||
Else
|
||||
Resultado = False
|
||||
Exit For
|
||||
End If
|
||||
|
||||
End If
|
||||
Next
|
||||
|
||||
@@ -2197,13 +2212,22 @@ Namespace Modelos
|
||||
|
||||
If factura.Cliente.EsDistribuidor AndAlso factura.CveConceptoMovimiento = 42 AndAlso Dr("CveTamaño").ToString.ToEntero > 0 Then
|
||||
|
||||
If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, Dr("Cantidad").ToString.ToDecimal(), Dr("CveTamaño").ToString.ToEntero, CveConceptoUsados, CveVenta, UsuarioActual.CveUsuario,
|
||||
UsuarioActual.CveEmpresa, 0, Dr("Observaciones").ToString, factura.Fecha, CveMovimiento:=CveMovimiento) Then
|
||||
' Mensaje = "Error al guardar Movimientos de distribuidor"
|
||||
Dim DrTamanio As DataRow = GlobalDTAcumTamaños().FiltroPrimero($"CveTamaño={Dr("CveTamaño").ToString.ToEntero}")
|
||||
If DrTamanio IsNot Nothing Then
|
||||
Dim Cargo As Decimal = DrTamanio("Cargo").ToString().ToDecimal() * Dr("Cantidad").ToString.ToDecimal()
|
||||
Dim Bonificacion As Decimal = DrTamanio("Bonificacion").ToString().ToDecimal() * Dr("Cantidad").ToString.ToDecimal()
|
||||
Dim Puntos As Decimal = DrTamanio("Puntos").ToString().ToDecimal() * Dr("Cantidad").ToString.ToDecimal()
|
||||
|
||||
If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, Dr("Cantidad").ToString.ToDecimal(), Dr("CveTamaño").ToString.ToEntero, Puntos, Cargo, Bonificacion, CveConceptoUsados, CveVenta, UsuarioActual.CveUsuario,
|
||||
UsuarioActual.CveEmpresa, 0, Dr("Observaciones").ToString, factura.Fecha, CveMovimiento:=CveMovimiento) Then
|
||||
' Mensaje = "Error al guardar Movimientos de distribuidor"
|
||||
Resultado = False
|
||||
Exit For
|
||||
End If
|
||||
Else
|
||||
Resultado = False
|
||||
Exit For
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -4867,6 +4891,11 @@ Namespace Modelos
|
||||
AplicaRefacturacionConPagos = True
|
||||
End If
|
||||
|
||||
'SI NO TIENE PAGOS, DEBE SEGUIR EL CAMINO DE REFACTURACION NORMAL
|
||||
If AplicaRefacturacionConPagos AndAlso ObjFactura.Pagado = 0 Then
|
||||
AplicaRefacturacionConPagos = False
|
||||
End If
|
||||
|
||||
'VALIDA QUE LA FACTURA NO TENGA PAGOS
|
||||
If Not AplicaRefacturacionConPagos AndAlso ObjFactura.TipoDocto.Contiene("Ing", "Rem") AndAlso ObjFactura.Pagado > 0 Then
|
||||
Retorno.Mensaje = "La factura no se puede cancelar debido a que tiene pagos vinculados."
|
||||
@@ -5380,7 +5409,10 @@ Namespace Modelos
|
||||
DtSalidas = DtInventario.FiltraParametros($"CvePS IS NULL AND {Filtro}")
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
|
||||
DtVirtuales = DtInventario.FiltraParametros($"CvePS IS NULL AND CveConcepto = 37 AND CveTipoAlmacen = 24")
|
||||
DtVirtuales = DtInventario.FiltraParametros($"CvePS IS NULL AND CveConcepto = 37")
|
||||
If ObjFactura.TipoDocto = "Dev" Then
|
||||
DtVirtuales = DtInventario.FiltraParametros($"CvePS IS NULL AND CveConcepto = 36")
|
||||
End If
|
||||
End If
|
||||
|
||||
If ObjFactura.TipoDocto = "Ing" Then
|
||||
@@ -5593,7 +5625,7 @@ Namespace Modelos
|
||||
If DtVirtuales IsNot Nothing Then
|
||||
For Each RowVirtual As DataRow In DtVirtuales.Rows
|
||||
'REALIZA LA DEVOLUCION AL ALMACEN VIRTUAL
|
||||
If Not ErrorCancelar AndAlso Not CancelarMovimientosVirtuales(CveVenta, CveMovimientoDevolucion, RowVirtual("CveMovimiento").ToString().ToEntero(), ObjInventario) Then
|
||||
If Not ErrorCancelar AndAlso Not CancelarMovimientosVirtuales(CveVenta, CveMovimientoDevolucion, RowVirtual("CveMovimiento").ToString().ToEntero(), ObjInventario, TipoDocto:=ObjFactura.TipoDocto) Then
|
||||
ErrorCancelar = True
|
||||
MensajeError = "Ocurrió un error al realizar la devolución del virtual. Por favor vuelva a intentar."
|
||||
End If
|
||||
@@ -6130,7 +6162,7 @@ Namespace Modelos
|
||||
Return Not ErrorCancelar
|
||||
End Function
|
||||
|
||||
Private Function CancelarMovimientosVirtuales(CveVenta As Integer, CveMovimientoDevolucion As Integer, CveMovimientoVirtualSalida As Integer, ByRef ObjInventario As ClsInventarios) As Boolean
|
||||
Private Function CancelarMovimientosVirtuales(CveVenta As Integer, CveMovimientoDevolucion As Integer, CveMovimientoVirtualSalida As Integer, ByRef ObjInventario As ClsInventarios, Optional TipoDocto As String = "") As Boolean
|
||||
Dim ErrorCancelar As Boolean = False
|
||||
Try
|
||||
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
|
||||
@@ -6163,6 +6195,10 @@ Namespace Modelos
|
||||
End If
|
||||
|
||||
Dim CveConceptoMovimientoVirtual As Integer = 36
|
||||
If TipoDocto = "Dev" Then
|
||||
CveConceptoMovimientoVirtual = 37
|
||||
End If
|
||||
|
||||
Dim CveMovimientoRelacionadoVirtual As Integer = CveMovimientoDevolucion
|
||||
|
||||
If DtPSVirtual IsNot Nothing AndAlso DtPSVirtual.Rows.Count > 0 AndAlso CveAlmacenVirtual > 0 AndAlso CveConceptoMovimientoVirtual > 0 Then
|
||||
@@ -7382,6 +7418,14 @@ Namespace Modelos
|
||||
#End Region
|
||||
|
||||
#Region "G L O B A L - D T"
|
||||
Property GlobalDTAcumTamaños() As DataTable
|
||||
Get
|
||||
GlobalDTAcumTamaños = DirectCast(HttpContext.Current.Application("GlobalDTAcumTamaños"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
HttpContext.Current.Application("GlobalDTAcumTamaños") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property GlobalTipoCambio(Optional Fecha As Date = MinFecha) As Double
|
||||
Get
|
||||
If GlobalTipoCambio <= 0 Then
|
||||
|
||||
@@ -3519,7 +3519,7 @@ Partial Class Compras_Compras
|
||||
ViewState("IdCtaContRetIVA") = ObjProveedor.IdCtaContRetIVA
|
||||
ViewState("IdCtaContRetISR") = ObjProveedor.IdCtaContRetISR
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso ObjProveedor.IdCtaContProveedores < 1 Then
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso ObjProveedor.IdCtaContProveedores < 1 Then
|
||||
Alert("El Proveedor seleccionado no tiene cuenta contable asignada.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
|
||||
@@ -537,6 +537,7 @@
|
||||
<asp:BoundField HeaderText="Dias Trans" DataField="DiasTranscurridos" DataFormatString="{0}" Visible="false" />
|
||||
<asp:BoundField HeaderText="T.C." DataField="TipoCambio" DataFormatString="{0}" Visible="false" />
|
||||
<asp:BoundField HeaderText="Fecha Ejecución" DataField="FechaEjecucion" DataFormatString="{0:d}" Visible="false" />
|
||||
<asp:BoundField HeaderText="Linea Adicional" DataField="LineaAdicional" ItemStyle-HorizontalAlign="Center" Visible="false" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
@@ -660,6 +661,13 @@
|
||||
<td style="text-align: left;">
|
||||
<asp:CheckBox ID="ChkTC" runat="server" Text=" Tipo Cambio" /></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: left;">
|
||||
<asp:CheckBox ID="ChkMostrarLineaAdicional" runat="server" Text=" Linea Adicional" Checked="false" /></td>
|
||||
<td style="text-align: left;"></td>
|
||||
<td style="text-align: left;"></td>
|
||||
<td style="text-align: left;"></td>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
@@ -847,6 +847,13 @@ Partial Class RepCxCDetalle
|
||||
GvDatos.Columns(44).Visible = False
|
||||
End If
|
||||
|
||||
If ChkMostrarLineaAdicional.Checked Then
|
||||
GvDatos.Columns(45).Visible = True
|
||||
SePersonalizo = 1
|
||||
Else
|
||||
GvDatos.Columns(45).Visible = False
|
||||
End If
|
||||
|
||||
|
||||
If SePersonalizo = 1 Then
|
||||
ImgExcelPersonalizado.Visible = True
|
||||
|
||||
@@ -30,6 +30,10 @@ Partial Class Inventarios_KardexAlmacen
|
||||
txtFechaI.Text = Now.ToShortDateString
|
||||
End If
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(349) Then
|
||||
DdlIncluyeTransitorios.Items.RemoveAt(0) 'oculta opción "No" en tránsito
|
||||
End If
|
||||
|
||||
If IfNull(Request("CvePS"), "-1").ToString.ToEntero > 0 Then CargarKardex(Request("CvePS").ToString.ToEntero)
|
||||
ddlProducto2.SelectedValue = If(Request("CvePS") IsNot Nothing, Request("CvePS").ToString, "-1")
|
||||
End If
|
||||
@@ -147,8 +151,9 @@ Partial Class Inventarios_KardexAlmacen
|
||||
Dim CveProveedorCompra As Integer = If(DdlProveedor.SelectedValue.ToEntero > 0, DdlProveedor.SelectedValue.ToEntero, -1)
|
||||
Dim Marcas As String = If(DdlMarca.GetSelectedValuesM = "", "-1", DdlMarca.GetSelectedValuesM)
|
||||
Dim GPO As Integer = Ddlgrupo.SelectedValue.ToEntero
|
||||
Dim IncluyeTransitorios As Integer = DdlIncluyeTransitorios.SelectedValue.ToEntero
|
||||
|
||||
If ObjMovimientos.GetKardexAlmacenHorizontal(CvePS, FechaF, -1, DdlUnidadMedida.SelectedValue.ToEntero, CveProveedorCompra, DdlTipoAlmacen.SelectedValue.ToEntero(), DdlIncluyeTransitorios.SelectedValue.ToEntero(),
|
||||
If ObjMovimientos.GetKardexAlmacenHorizontal(CvePS, FechaF, -1, DdlUnidadMedida.SelectedValue.ToEntero, CveProveedorCompra, DdlTipoAlmacen.SelectedValue.ToEntero(), IncluyeTransitorios,
|
||||
DdlClasificacion.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CondicionExistencias:=DdlExistencia.SelectedValue,
|
||||
Orden:=DdlOrden.SelectedValue.ToEntero(), Marcas:=Marcas, IncluyeProyectado:=DdlProyeccionFiltro.SelectedValue.ToEntero, CveAlmacenes:=CveAlmacenes, GPO:=GPO) Then
|
||||
If ObjMovimientos.DtResultados IsNot Nothing AndAlso ObjMovimientos.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
@@ -1318,13 +1318,19 @@ Partial Class Inventarios_RecepcionUsados
|
||||
|
||||
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, Now, CveMovimiento:=CveMovimiento) Then
|
||||
Mensaje = "Error al guardar Movimientos de distribuidor"
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
Dim DrTamanio As DataRow = GlobalDTAcumTamaños().FiltroPrimero($"CveTamaño={Dr("CveTamaño").ToString.ToEntero}")
|
||||
If DrTamanio IsNot Nothing Then
|
||||
Dim Cargo As Decimal = DrTamanio("Cargo").ToString().ToDecimal() * Dr("Cantidad").ToString.ToDecimal()
|
||||
Dim Bonificacion As Decimal = DrTamanio("Bonificacion").ToString().ToDecimal() * Dr("Cantidad").ToString.ToDecimal()
|
||||
Dim Puntos As Decimal = DrTamanio("Puntos").ToString().ToDecimal() * Dr("Cantidad").ToString.ToDecimal()
|
||||
|
||||
If Not ObjAcum.DistribuidorMovtosAdd(DdlClientes.SelectedValue.ToEntero, Dr("Cantidad").ToString.ToEntero(), Dr("CveTamaño").ToString.ToEntero, Puntos, Cargo, Bonificacion, CveConceptoUsados, CveVenta, UsuarioActual.CveUsuario,
|
||||
UsuarioActual.CveEmpresa, 0, Dr("Observaciones").ToString, Now, CveMovimiento:=CveMovimiento) Then
|
||||
Mensaje = "Error al guardar Movimientos de distribuidor"
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
|
||||
@@ -6800,7 +6800,19 @@
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright" runat="server" id="DvLineaAdicionalDiasVenciemientoModal" visible="false">
|
||||
<asp:TextBox ID="TxtDiasVencimientoLineaAdicionalModal" CssClass="form-control " runat="server" MaxLength="20" CausesValidation="true" Width="250px"></asp:TextBox>
|
||||
|
||||
<asp:RequiredFieldValidator ID="RfvTxtDiasVencimientoLineaAdicionalModal" runat="server" ControlToValidate="TxtDiasVencimientoLineaAdicionalModal" CssClass="help-block errorimput"
|
||||
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe''</b> es necesario, por favor ingréselo." ValidationGroup="GrpLineaAdicional"></asp:RequiredFieldValidator>
|
||||
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtDiasVencimientoLineaAdicionalModal" ValidChars="1234567890" FilterType="Custom" />
|
||||
<label for="<%= TxtDiasVencimientoLineaAdicionalModal.ClientID.ToString()%>">Días de Vencimiento: </label>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-4" id="DvFechaVencimiento" runat="server">
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright date date-picker date date-picker">
|
||||
<asp:TextBox ID="TxtFechaVencimientoLineaAdicionalModal" CssClass="form-control" runat="server"></asp:TextBox>
|
||||
@@ -6819,18 +6831,7 @@
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright" runat="server" id="DvLineaAdicionalDiasVenciemientoModal" visible="false">
|
||||
<asp:TextBox ID="TxtDiasVencimientoLineaAdicionalModal" CssClass="form-control " runat="server" MaxLength="20" CausesValidation="true" Width="250px"></asp:TextBox>
|
||||
|
||||
<asp:RequiredFieldValidator ID="RfvTxtDiasVencimientoLineaAdicionalModal" runat="server" ControlToValidate="TxtDiasVencimientoLineaAdicionalModal" CssClass="help-block errorimput"
|
||||
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe''</b> es necesario, por favor ingréselo." ValidationGroup="GrpLineaAdicional"></asp:RequiredFieldValidator>
|
||||
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtDiasVencimientoLineaAdicionalModal" ValidChars="1234567890" FilterType="Custom" />
|
||||
<label for="<%= TxtDiasVencimientoLineaAdicionalModal.ClientID.ToString()%>">Días de Vencimiento: </label>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -513,12 +513,26 @@ Partial Class Clientes
|
||||
Set(value As Integer)
|
||||
ViewState("CveLineaAdicional") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
End Property
|
||||
Private Property FechaIngLineaAdicional As DateTime
|
||||
Get
|
||||
If ViewState("FechaIngLineaAdicional") Is Nothing Then
|
||||
ViewState("FechaIngLineaAdicional") = MinFecha
|
||||
End If
|
||||
|
||||
Return ViewState("FechaIngLineaAdicional").ToString().ToDateTime()
|
||||
|
||||
End Get
|
||||
Set(value As DateTime)
|
||||
ViewState("FechaIngLineaAdicional") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "Documentacion"
|
||||
Private Property DTDocumentacion As DataTable
|
||||
Get
|
||||
@@ -941,10 +955,10 @@ Partial Class Clientes
|
||||
LnkAgregarLineaAdicional.Visible = True
|
||||
GetLineasAdicionales()
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
'EN SERIO SE OCUPA EN CADA POSTBACK ??? IPP 7 SEPTIEMNRE 2017
|
||||
@@ -2085,15 +2099,15 @@ Partial Class Clientes
|
||||
UpAgregarSucursal.Update()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
Public Sub CargaAFAsignados()
|
||||
'Dim ObjAF As New ClsAF()
|
||||
'If ObjAF.GetActivosFijos(-1, UsuarioActual.CveEmpresa, "-1", "-1", -1, -1, "-1", -1, -1, -1, -1, -1, "-1", CveCliente) Then
|
||||
' GvAFAsignado.DataSource = ObjAF.DtResultados
|
||||
'Else
|
||||
' GvAFAsignado.DataSource = Nothing
|
||||
'End If
|
||||
'ObjAF.Dispose()
|
||||
'GvAFAsignado.DataBind()
|
||||
Public Sub CargaAFAsignados()
|
||||
'Dim ObjAF As New ClsAF()
|
||||
'If ObjAF.GetActivosFijos(-1, UsuarioActual.CveEmpresa, "-1", "-1", -1, -1, "-1", -1, -1, -1, -1, -1, "-1", CveCliente) Then
|
||||
' GvAFAsignado.DataSource = ObjAF.DtResultados
|
||||
'Else
|
||||
' GvAFAsignado.DataSource = Nothing
|
||||
'End If
|
||||
'ObjAF.Dispose()
|
||||
'GvAFAsignado.DataBind()
|
||||
End Sub
|
||||
Private Sub CargaMetodosPago33()
|
||||
DdlMetodoPago33.Items.Clear()
|
||||
@@ -4068,10 +4082,10 @@ Partial Class Clientes
|
||||
|
||||
Private Sub GenerarPDFCrystal(Optional Formato As String = "PDF")
|
||||
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/RepClientesCxC.rpt", UsuarioActual.Empresa.Ruta))
|
||||
Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png")
|
||||
'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
|
||||
'OBTENEMOS LOS DATOS
|
||||
Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png")
|
||||
'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
|
||||
'OBTENEMOS LOS DATOS
|
||||
Dim DtCxCFact As DataTable = Nothing
|
||||
|
||||
Dim FI = If(TxtFechaInicioCxP.Text = "" Or TxtFechaInicioCxP.Text = "__/__/____", "-1", TxtFechaInicioCxP.Text)
|
||||
@@ -4277,16 +4291,16 @@ Partial Class Clientes
|
||||
Else
|
||||
If Archivo.Exists Then
|
||||
Dim ArchivoSti As New System.IO.FileInfo(String.Format("{0}Formatos/RepClientesCxC.mrt", UsuarioActual.Empresa.Ruta))
|
||||
If ArchivoSti.Exists Then
|
||||
Dim listass As New List(Of ReportParameter)
|
||||
For Each item As CrystalParametro In lista
|
||||
listass.Add(New ReportParameter(item.Nombre, item.Valor.ToString()))
|
||||
Next
|
||||
ImprimirPDFStimulsoft($"{UsuarioActual.Empresa.Ruta}Formatos/RepClientesCxC.mrt", DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), listass, "Estado de cuenta", Formato)
|
||||
Else
|
||||
ImprimirbytesPDF(ImprimirPDFCrystal($"{UsuarioActual.Empresa.Ruta}Formatos/RepClientesCxC.rpt", DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), lista, "Estado de cuenta", Formato), "Estado de cuenta", Formato)
|
||||
End If
|
||||
|
||||
If ArchivoSti.Exists Then
|
||||
Dim listass As New List(Of ReportParameter)
|
||||
For Each item As CrystalParametro In lista
|
||||
listass.Add(New ReportParameter(item.Nombre, item.Valor.ToString()))
|
||||
Next
|
||||
ImprimirPDFStimulsoft($"{UsuarioActual.Empresa.Ruta}Formatos/RepClientesCxC.mrt", DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), listass, "Estado de cuenta", Formato)
|
||||
Else
|
||||
ImprimirbytesPDF(ImprimirPDFCrystal($"{UsuarioActual.Empresa.Ruta}Formatos/RepClientesCxC.rpt", DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), lista, "Estado de cuenta", Formato), "Estado de cuenta", Formato)
|
||||
End If
|
||||
|
||||
Else
|
||||
ImprimirbytesPDF(ImprimirPDFCrystal(Server.MapPath("~/Empresas/Grales/Formatos/RepClientesCxC.rpt"), DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), lista, "Estado de cuenta", Formato), "Estado de cuenta", Formato)
|
||||
End If
|
||||
@@ -4329,16 +4343,16 @@ Partial Class Clientes
|
||||
DtCxCFact2.Rows.Add(drr)
|
||||
|
||||
If Archivo.Exists Then
|
||||
Dim ArchivoSti As New System.IO.FileInfo(String.Format("{0}Formatos/RepClientesCxC.mrt", UsuarioActual.Empresa.Ruta))
|
||||
If ArchivoSti.Exists Then
|
||||
Dim listass As New List(Of ReportParameter)
|
||||
For Each item As CrystalParametro In lista
|
||||
listass.Add(New ReportParameter(item.Nombre, item.Valor.ToString()))
|
||||
Next
|
||||
ImprimirPDFStimulsoft($"{UsuarioActual.Empresa.Ruta}Formatos/RepClientesCxC.mrt", DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), listass, "Estado de cuenta", Formato)
|
||||
Else
|
||||
ImprimirbytesPDF(ImprimirPDFCrystal($"{UsuarioActual.Empresa.Ruta}Formatos/RepClientesCxC.rpt", DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), lista, "Estado de cuenta", Formato), "Estado de cuenta", Formato)
|
||||
End If
|
||||
Dim ArchivoSti As New System.IO.FileInfo(String.Format("{0}Formatos/RepClientesCxC.mrt", UsuarioActual.Empresa.Ruta))
|
||||
If ArchivoSti.Exists Then
|
||||
Dim listass As New List(Of ReportParameter)
|
||||
For Each item As CrystalParametro In lista
|
||||
listass.Add(New ReportParameter(item.Nombre, item.Valor.ToString()))
|
||||
Next
|
||||
ImprimirPDFStimulsoft($"{UsuarioActual.Empresa.Ruta}Formatos/RepClientesCxC.mrt", DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), listass, "Estado de cuenta", Formato)
|
||||
Else
|
||||
ImprimirbytesPDF(ImprimirPDFCrystal($"{UsuarioActual.Empresa.Ruta}Formatos/RepClientesCxC.rpt", DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), lista, "Estado de cuenta", Formato), "Estado de cuenta", Formato)
|
||||
End If
|
||||
Else
|
||||
ImprimirbytesPDF(ImprimirPDFCrystal(Server.MapPath("~/Empresas/Grales/Formatos/RepClientesCxC.rpt"), DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), lista, "Estado de cuenta", Formato), "Estado de cuenta", Formato)
|
||||
End If
|
||||
@@ -4361,9 +4375,9 @@ Partial Class Clientes
|
||||
End Using
|
||||
End If
|
||||
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "E N V I O C O R R E O"
|
||||
Private Sub EnviaCorreo(Liga As String, LigaActivar As String)
|
||||
|
||||
@@ -4431,11 +4445,11 @@ Partial Class Clientes
|
||||
a.GuardaLog()
|
||||
Dim Mail As New ClsSisMail()
|
||||
Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body)
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " COTIZACIONES "
|
||||
|
||||
|
||||
Protected Sub BtnVerMasCot_Click(sender As Object, e As EventArgs)
|
||||
If BtnVerMasCot.Text = "Ver Más" Then
|
||||
CargaCotizaciones(-1)
|
||||
@@ -4505,11 +4519,11 @@ Partial Class Clientes
|
||||
HLFacturar.HRef = $"/Ventas/Ventas.aspx?CveCotizacion={e.Row.DBCampo("CveVenta")}"
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "D I R E C C I O N E N V I O "
|
||||
|
||||
|
||||
Private Sub CargaCombosDirecionesClientesSAT()
|
||||
CargaDirClientePais()
|
||||
CargaDirClienteEstado()
|
||||
@@ -4732,12 +4746,12 @@ Partial Class Clientes
|
||||
End If
|
||||
|
||||
CargaDireccionesEnvio()
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " IMPORTAR SALDOS "
|
||||
|
||||
|
||||
Private Sub HLImportarSaldos_Click(sender As Object, e As EventArgs) Handles HLImportarSaldos.Click
|
||||
CargaClientesImportarSaldos()
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivImportarSaldos"))
|
||||
@@ -4841,9 +4855,9 @@ Partial Class Clientes
|
||||
e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("ChkSaldo(this,{0},{1});", e.Row.FCTextBox("TxtImporte").ClientID, e.Row.DBCampo("Saldo")))
|
||||
e.Row.FCTextBox("TxtImporte").Attributes.Add("onKeyUp", String.Format("CambiaSaldo({0},this,{1});", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo")))
|
||||
End If
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "Cuentas/Equipos"
|
||||
Public Sub BtnAgregarCtaEquipo_Click(sender As Object, e As EventArgs)
|
||||
HdnModalidad.Value = "I"
|
||||
@@ -5431,9 +5445,9 @@ Partial Class Clientes
|
||||
End If
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "GPS"
|
||||
Protected Sub btnCargaArrayDisp_Click(sender As Object, e As EventArgs) Handles btnCargaArrayDisp.Click
|
||||
If hdnArrayDispositivo.Value.Length > 0 Then
|
||||
@@ -5574,10 +5588,10 @@ Partial Class Clientes
|
||||
UpMoverDispositivo.Update()
|
||||
RegistraScript($"CargaModalMoverDispositivo({GvRow.DataKey("CveDispositivo")});")
|
||||
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "Sucursales"
|
||||
Public Sub CreaDTSucursales()
|
||||
|
||||
@@ -5811,14 +5825,14 @@ Partial Class Clientes
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "G P S"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Private Sub EnviaCorreoGPS(Liga As String, LigaActivar As String)
|
||||
|
||||
Try
|
||||
@@ -5889,16 +5903,16 @@ Partial Class Clientes
|
||||
End If
|
||||
|
||||
ObjClientes.Dispose()
|
||||
End Sub
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "C O N T R A T O S"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Private Sub CargaDatosContrato()
|
||||
If CveCliente <= 0 Then
|
||||
Exit Sub
|
||||
@@ -5943,10 +5957,10 @@ Partial Class Clientes
|
||||
e.Row.CssClass = "Totales white"
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "M E T O D O S "
|
||||
Protected Sub RblTipo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RblTipo.SelectedIndexChanged
|
||||
If DTHistorialVentas IsNot Nothing AndAlso RblTipo.SelectedValue <> "-1" Then
|
||||
@@ -6356,13 +6370,13 @@ Partial Class Clientes
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "IMPRIMIR GVHistorial"
|
||||
|
||||
|
||||
|
||||
|
||||
Protected Sub BtnExcelHistorial_Click(sender As Object, e As EventArgs)
|
||||
Dim retorno As Byte() = Nothing
|
||||
Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png")
|
||||
@@ -6437,18 +6451,18 @@ Partial Class Clientes
|
||||
ObjClientes.Dispose()
|
||||
|
||||
Return retorno
|
||||
End Function
|
||||
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "C O B R A N Z A"
|
||||
Public Sub Visitas_Click(sender As Object, e As EventArgs)
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivVisitas"))
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "Usuarios"
|
||||
Protected Sub GvUsuarios_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvUsuarios.RowDeleting
|
||||
Dim CveUsuario As Integer = GvUsuarios.Rows(e.RowIndex).DataKey("CveUsuario").ToEntero()
|
||||
@@ -6483,12 +6497,12 @@ Partial Class Clientes
|
||||
e.Row.Cells(5).Visible = False
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
#Region "C U E N T A S - B A N C A R I A S"
|
||||
|
||||
|
||||
Private Sub CargaCuentasBancarias(Optional RecargaGlobal As Boolean = False)
|
||||
|
||||
If CveCliente <= 0 Then Exit Sub
|
||||
@@ -6661,8 +6675,8 @@ Partial Class Clientes
|
||||
TxtNumeroCuenta2.Text = ""
|
||||
TxtConvenioCIE2.Text = ""
|
||||
TxtReferencia2.Text = ""
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#Region "GRIDVIEW - CUENTAS BANCARIAS"
|
||||
Protected Sub GvBancosCuentas_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvBancosCuentas.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
@@ -6718,10 +6732,10 @@ Partial Class Clientes
|
||||
GlobalDTCuentasDepositosClientes(UsuarioActual.CveEmpresa, -1, True) = Nothing
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Private Sub CargaPSGridCuentasBancos()
|
||||
If CveCliente > 0 Then
|
||||
GvBancosCuentas.DataSource = DTCuentasBancos
|
||||
@@ -6779,9 +6793,9 @@ Partial Class Clientes
|
||||
divestatus.Visible = True
|
||||
UpAddBancos.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "DivAddCuentasBancarias"))
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "C L I E N T E S P A G O S R E A L I Z A D O S I M P R I M I R P D F/Excel"
|
||||
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkPagosClientesBancosExcel.Click
|
||||
GenerarPDF("Excel")
|
||||
@@ -6803,11 +6817,11 @@ Partial Class Clientes
|
||||
ImprimirPDF("Empresas\Grales\Formatos\RepClientesPagosBancos.rdlc", DTCobrosRealizados, params, "RepClientesPagosBancos_" & Now.ToString("yyyyMMddhhmmss"), Formato:=Formato)
|
||||
|
||||
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "VENTAS"
|
||||
|
||||
|
||||
Public Function imprimirFacturaVenta(CveVenta As Integer) As Byte()
|
||||
Dim ObjVentas As New ClsVentas
|
||||
Dim Vta As Modelos.Factura = Nothing
|
||||
@@ -7038,10 +7052,10 @@ Partial Class Clientes
|
||||
ObjVentas.Dispose()
|
||||
|
||||
Return PdfFactura(Vta)
|
||||
End Function
|
||||
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "COMERCIO EXTERIOR"
|
||||
Public Sub CargaCombosComercioExterior()
|
||||
|
||||
@@ -7165,12 +7179,12 @@ Partial Class Clientes
|
||||
End Sub
|
||||
Protected Sub DdlMunicipio_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
CargaColonia()
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "D O C U M E N T A C I O N "
|
||||
|
||||
|
||||
Private Sub CargaDocumentacionCliente()
|
||||
Dim objRH As New ClsEdocumentacion()
|
||||
|
||||
@@ -7808,12 +7822,12 @@ Partial Class Clientes
|
||||
|
||||
RegistraScript("Download('" & baseUrl & "')")
|
||||
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "D O C U M E N T O S V E N T A S"
|
||||
|
||||
|
||||
Private Sub CargaDocumentosVenta(tCveCliente As Integer)
|
||||
Dim objInv As New ClsEdocumentacion
|
||||
|
||||
@@ -7984,11 +7998,11 @@ Partial Class Clientes
|
||||
|
||||
objRH.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "PERSONA FISICA"
|
||||
Protected Sub LnkPersonaFisica_Click(sender As Object, e As EventArgs)
|
||||
RegistraScript("$('#DivModalPersonaFisica').modal();")
|
||||
@@ -8013,9 +8027,9 @@ Partial Class Clientes
|
||||
|
||||
ObjCliente.Dispose()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "USUARIOS PLATAFORMA CLIENTE - 6 "
|
||||
Protected Sub CargaUsuariosPortalCliente()
|
||||
Dim objUsuario As ClsSisUsuarios = New ClsSisUsuarios
|
||||
@@ -8024,19 +8038,19 @@ Partial Class Clientes
|
||||
GvUsuarios.DataBind()
|
||||
End If
|
||||
objUsuario.Dispose()
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " DEVOLVER DINERO ANT/NC "
|
||||
Private Sub InicializaDevolverDinero()
|
||||
If UsuarioActual.TienePermisoProceso(247) Then
|
||||
GVAnticipos.Columns(6).Visible = True
|
||||
End If
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "MODAL GRAFICA/PEDIDOS"
|
||||
|
||||
|
||||
Protected Sub LnkVerGrafica_Click(sender As Object, e As EventArgs)
|
||||
If CargaDatatables() Then
|
||||
RegistraScript("$('#DivModalGrafica').modal('show')")
|
||||
@@ -8373,13 +8387,13 @@ Partial Class Clientes
|
||||
RegistraScript($"CargaGraficaCompratamientoSaldoMensual({Dt5.ToJson},{Dt6.ToJson.Replace($"{Chr(34)}True{Chr(34)}", "true").Replace($"{Chr(34)}False{Chr(34)}", "false")})", "55")
|
||||
|
||||
UPModalProd.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "TAB - COMPORTAMIENTO DE VENTAS"
|
||||
|
||||
|
||||
Private Sub CargaGrupo()
|
||||
DdlGrupo.Items.Insert(0, New ListItem("Categoria", "3"))
|
||||
DdlGrupo.Items.Insert(1, New ListItem("Clasificacion", "4"))
|
||||
@@ -8563,12 +8577,12 @@ Partial Class Clientes
|
||||
ObjVentas.Dispose()
|
||||
GvComportamientoVenta.DataBind()
|
||||
UpDatosComportamientoVenta.Update()
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "DISPOSITIVOS"
|
||||
|
||||
|
||||
Protected Sub LnkMoverDispositivo_Click(sender As Object, e As EventArgs)
|
||||
Dim CveDispositivo As Integer = HdnCveDispositivoMover.Value.ToEntero()
|
||||
Dim CveCliente As Integer = DdlClienteDispositivo.SelectedValue.ToEntero()
|
||||
@@ -8606,10 +8620,10 @@ Partial Class Clientes
|
||||
CargaEventoBitacora()
|
||||
NombreDispositivo = ""
|
||||
RegistraScript("$('#DivMoverDispositivo').modal('hide');")
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "CRM"
|
||||
Protected Sub CargaDatosCRM()
|
||||
Dim ObjCRM = New ClsCRM()
|
||||
@@ -8709,9 +8723,9 @@ Partial Class Clientes
|
||||
Alert("Se Unificó correctamente al Cliente con la Empresa CRM.")
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "PORCENTAJE PRECIO DE MARCAS"
|
||||
Private Sub LnkPorcentajeMarcas_Click(sender As Object, e As EventArgs) Handles LnkPorcentajeMarcas.Click
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivPorcentajeMarcas"))
|
||||
@@ -8936,9 +8950,9 @@ Partial Class Clientes
|
||||
|
||||
ObjPS.Dispose()
|
||||
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "PORCENTAJE PRECIO DE PRODUCTOS"
|
||||
Private Sub LnkPorcentajePrecios_Click(sender As Object, e As EventArgs) Handles LnkPorcentajePrecios.Click
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivPorcentajePrecios"))
|
||||
@@ -9174,12 +9188,12 @@ Partial Class Clientes
|
||||
|
||||
Protected Sub BtnCambiaPorcentaje_Click(sender As Object, e As EventArgs)
|
||||
DdlProducto2IndexChange(DdlProducto2.SelectedValue.ToEntero(), DdlProducto2)
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " A C U M U L A D O R E S"
|
||||
|
||||
|
||||
|
||||
|
||||
Protected Sub LnkFacturaUsadosCargos_Click(sender As Object, e As EventArgs)
|
||||
'CveVentaNota = 0
|
||||
|
||||
@@ -9822,11 +9836,11 @@ Partial Class Clientes
|
||||
|
||||
' ObjFactura.Timbre = PreParaTimbre(ObjFactura)
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "C L I E N T E S G R I D S I M P R I M I R P D F/Excel"
|
||||
Private Sub LnkCotizacionesPDF_Click(sender As Object, e As EventArgs) Handles LnkCotizacionesPDF.Click
|
||||
ImprimeGridsProveedores("PDF", DtCotizaciones, "RepClientesCotizaciones")
|
||||
@@ -9889,15 +9903,13 @@ Partial Class Clientes
|
||||
End Sub
|
||||
|
||||
Private Sub LnkUsadosReset_Click(sender As Object, e As EventArgs) Handles LnkUsadosReset.Click
|
||||
|
||||
Dim Acum As New ClsAcumuladores
|
||||
Dim Puntos As Decimal = -GvUsadosResumen.Rows.Cast(Of GridViewRow).Where(Function(x) x.RowType = DataControlRowType.DataRow).FirstOrDefault(Function(gvr) gvr.RowIndex = 3).DataKey("Puntos").ToEntero()
|
||||
If Acum.DistribuidorMovtosAdd(CveCliente, 1, 1, 3, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Puntos, "Saldo Inicializado", Now) Then
|
||||
If Acum.DistribuidorMovtosAdd(CveCliente, 1, 1, Puntos, 0, 0, 3, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Puntos, "Saldo Inicializado", Now) Then
|
||||
Alert("Puntuación Inicializada")
|
||||
End If
|
||||
Acum.Dispose()
|
||||
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
Protected Sub DdlTipoRetencion_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then
|
||||
@@ -10406,6 +10418,8 @@ Partial Class Clientes
|
||||
|
||||
Protected Sub LnkAgregarLineaAdicional_Click(sender As Object, e As EventArgs)
|
||||
CveLineaAdicional = -1
|
||||
FechaIngLineaAdicional = Nothing
|
||||
|
||||
RegistraScript("$('#DVLineasAdicionales').modal('show')")
|
||||
LtlLineasAdicionalesTotuloModal.Text = "Agregar Linea Adicional"
|
||||
AgregarLineaAdicionalLimpiarControles()
|
||||
@@ -10437,11 +10451,13 @@ Partial Class Clientes
|
||||
' Exit Sub
|
||||
'End If
|
||||
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If CveLineaAdicional > 0 Then
|
||||
|
||||
If DdlTipoLineaAdicionalModal.SelectedValue = "2" Then
|
||||
TxtFechaVencimientoLineaAdicionalModal.Text = FechaIngLineaAdicional.AddDays(TxtDiasVencimientoLineaAdicionalModal.Text.ToEntero()).ToString("dd/MM/yyyy")
|
||||
End If
|
||||
|
||||
|
||||
If CveLineaAdicional > 0 Then
|
||||
If Not ObjVentas.UpdateLineasAdicionales(CveLineaAdicional, TxtLineaAdicionalModal.Text, CveCliente, DdlProveedorLineaAdicionalModal.SelectedValue.ToEntero, DdlTipoLineaAdicionalModal.SelectedValue.ToEntero, TxtImporteLineaAdicionalModal.Text.ToDecimal,
|
||||
DdlMonedaLineAdicionalModal.SelectedValue.ToEntero, TxtFechaVencimientoLineaAdicionalModal.Text.ToDate, UsuarioActual.CveUsuario, DdlCategoriaLineaAdicionalModal.SelectedValue.ToEntero, UsuarioActual.CveEmpresa,
|
||||
DiasVencimiento:=TxtDiasVencimientoLineaAdicionalModal.Text.ToEntero) Then
|
||||
@@ -10449,7 +10465,11 @@ Partial Class Clientes
|
||||
Else
|
||||
Alert("Linea Adicional Actualizada Correctamente")
|
||||
End If
|
||||
Else
|
||||
Else
|
||||
If DdlTipoLineaAdicionalModal.SelectedValue = "2" Then
|
||||
TxtFechaVencimientoLineaAdicionalModal.Text = Now.AddDays(TxtDiasVencimientoLineaAdicionalModal.Text.ToEntero()).ToString("dd/MM/yyyy")
|
||||
End If
|
||||
|
||||
If Not ObjVentas.AddLineasAdicionales(TxtLineaAdicionalModal.Text, CveCliente, DdlProveedorLineaAdicionalModal.SelectedValue.ToEntero, DdlTipoLineaAdicionalModal.SelectedValue.ToEntero, TxtImporteLineaAdicionalModal.Text.ToDecimal,
|
||||
DdlMonedaLineAdicionalModal.SelectedValue.ToEntero, TxtFechaVencimientoLineaAdicionalModal.Text.ToDate, UsuarioActual.CveUsuario, DdlCategoriaLineaAdicionalModal.SelectedValue.ToEntero,
|
||||
DiasVencimiento:=TxtDiasVencimientoLineaAdicionalModal.Text.ToEntero) Then
|
||||
@@ -10476,6 +10496,7 @@ Partial Class Clientes
|
||||
|
||||
CveLineaAdicional = GvRow.DataKey("CveLineaAdicional").ToEntero
|
||||
|
||||
FechaIngLineaAdicional = GvRow.DataKey("FechaIng").ToDateTime()
|
||||
TxtLineaAdicionalModal.Text = GvRow.DataKey("LineaAdicional")
|
||||
DdlProveedorLineaAdicionalModal.txtText.Value = GvRow.DataKey("Proveedor")
|
||||
DdlProveedorLineaAdicionalModal.txtValue.Value = GvRow.DataKey("CveProveedor")
|
||||
@@ -10520,6 +10541,7 @@ Partial Class Clientes
|
||||
Protected Sub DdlTipoLineaAdicionalModal_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
|
||||
DvLineaAdicionalDiasVenciemientoModal.Visible = If(DdlTipoLineaAdicionalModal.SelectedValue.ToEntero = 2, True, False)
|
||||
DvFechaVencimiento.Visible = If(DdlTipoLineaAdicionalModal.SelectedValue.ToEntero = 2, False, True)
|
||||
UpLineaAdicionalmodal.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -438,21 +438,12 @@ Partial Class ProductosyServicios
|
||||
End Sub
|
||||
|
||||
Private Sub CargaPanelCitricos()
|
||||
Dim ObjGral As New ClsGenerales()
|
||||
If ObjGral.GetEmpacados(UsuarioActual.CveEmpresa) Then
|
||||
DdlEmpacado.DataSource = ObjGral.DtResultados
|
||||
End If
|
||||
If ObjGral.GetTipoOrganicos(UsuarioActual.CveEmpresa) Then
|
||||
DdlTipoOrganico.DataSource = ObjGral.DtResultados
|
||||
End If
|
||||
ObjGral.Dispose()
|
||||
|
||||
DdlEmpacado.DataSource = GlobalDTGralEmpacados(UsuarioActual.CveEmpresa)
|
||||
DdlTipoOrganico.DataSource = GlobalDTGralTipoOrganicos(UsuarioActual.CveEmpresa)
|
||||
DdlEmpacado.DataBind()
|
||||
DdlTipoOrganico.DataBind()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub MuestraPanel(Optional AfterPageLoad As Boolean = False)
|
||||
If AfterPageLoad Then
|
||||
RegistraScript("window.onload = function MuestraPanel() { document.getElementById(""C_BtnMostrarPanel"").click(); }")
|
||||
|
||||
@@ -136,8 +136,11 @@
|
||||
<asp:HyperLinkField DataTextField="SerieFolio" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" HeaderText="Serie Folio" />
|
||||
<asp:BoundField DataField="Saldo" HeaderText="Saldo" DataFormatString="{0:n}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="DiasVencimiento" HeaderText="Dias de Venc." ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="DiasTranscurridos" HeaderText="D.Trans" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="FechaVenta" HeaderText="F. Venta" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="FechaVencimientoVenta" HeaderText="F. Venc. Venta" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Estatus" HeaderText="Estatus" />
|
||||
|
||||
<asp:BoundField DataField="FechaEnvio" HeaderText="F. Envío" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:TemplateField HeaderText="Opciones" ItemStyle-Width="100px" HeaderStyle-Width="100px">
|
||||
<ItemTemplate>
|
||||
<div class="row" >
|
||||
|
||||
@@ -4702,6 +4702,15 @@ Partial Class Ventas
|
||||
If AplicaCancelarRemision AndAlso CveEstatus.Contiene(2, 3) AndAlso DdlTipoComprobante.SelectedValue = "Ing" Then DivCanRem.Visible = True
|
||||
VentaSaldoAlmacen = DbRowVenta("SaldoAlmacen").ToString().ToDecimal
|
||||
|
||||
If DbRowVenta("TipoDocto").ToString().Contiene("Rem", "Dev") AndAlso VentaSaldoAlmacen <> 0 Then
|
||||
ChkDevAlm.Checked = True
|
||||
LiDevolucionAlmacen.Visible = True
|
||||
If DbRowVenta("TipoDocto").ToString() = "Dev" Then
|
||||
LblDevAlm.Text = "Salida de almacen"
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If CveEstatus = 5 Then LbCancelarDocumento.Enabled = False
|
||||
'If CveEstatus = 20 Then
|
||||
' LbCancelarDocumentoManual.Visible = True
|
||||
@@ -9471,6 +9480,7 @@ Partial Class Ventas
|
||||
Dim ObjCGame As New ClsCGame(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjDocCliente As New ClsEdocumentacion(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjGeneral As New ClsGenerales(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjAcum As New ClsAcumuladores(ObjVentas.IniciaTransacSQL())
|
||||
|
||||
Dim ObjContPaq As ClsContPAQi = Nothing
|
||||
'Dim ObjFolios As New ClsGralFolios(ObjVentas.IniciaTransacSQL())
|
||||
@@ -9541,7 +9551,7 @@ Partial Class Ventas
|
||||
|
||||
Dim CveTimbreCartaPorte As Integer = -1
|
||||
|
||||
GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjFactura, TmpDT, ObjFactura.CveNCaVincular, ObjContPaq, ObjBancos, ObjOS,
|
||||
GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjAcum, ObjContr, ObjFactura, TmpDT, ObjFactura.CveNCaVincular, ObjContPaq, ObjBancos, ObjOS,
|
||||
ObjEventos, ObjCGame, ObjClientes, EsNCAmortizacion:=EsNCAmortizacion, CveAnticipoPadre:=CveAnticipoPadre)
|
||||
|
||||
If ErrorList.Count = 0 AndAlso ChkEmitirCartaPorte.Checked AndAlso ObjFactura.TipoDocto = "Ing" Then
|
||||
@@ -9668,7 +9678,7 @@ Partial Class Ventas
|
||||
|
||||
If (TieneAnticipo AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "2") OrElse (ListaNCDesc IsNot Nothing AndAlso ListaNCDesc.Count > 0) Then
|
||||
CreaObjetosVentaAmortizacion(ObjVentas, FolioFiscalRelacionado, CveVentaRelacionada, NCDescuento:=NCDescuento)
|
||||
If RegistrarNCAmortizacion(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjContPaq, ObjFacturaDevolucion, ObjBancos, Nothing,
|
||||
If RegistrarNCAmortizacion(ObjVentas, ObjConta, ObjInventario, ObjAcum, ObjContr, ObjContPaq, ObjFacturaDevolucion, ObjBancos, Nothing,
|
||||
Nothing, NCDescuento:=NCDescuento, ListaNCDescuento:=ListaNCDesc, IndexNC:=(If(DtVentasNC IsNot Nothing, DtVentasNC.Rows.Count - 1, 0))) Then
|
||||
ListaNotasCreditoGeneradas.Add(ObjFacturaDevolucion)
|
||||
End If
|
||||
@@ -9681,7 +9691,7 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
CreaObjetosVentaBonificacion(ObjVentas, FolioFiscalRelacionado, CveVentaRelacionada, NCDescuento:=NCDescuento)
|
||||
If RegistrarNCAmortizacion(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjContPaq, ObjFacturaBonificacion, ObjBancos, Nothing,
|
||||
If RegistrarNCAmortizacion(ObjVentas, ObjConta, ObjInventario, ObjAcum, ObjContr, ObjContPaq, ObjFacturaBonificacion, ObjBancos, Nothing,
|
||||
Nothing, NCDescuento:=NCDescuento, ListaNCDescuento:=ListaNCBonificacion, IndexNC:=(DtVentasNC.Rows.Count - 1)) Then
|
||||
ListaNotasCreditoGeneradas.Add(ObjFacturaBonificacion)
|
||||
End If
|
||||
@@ -9839,12 +9849,6 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
If ObjFactura.CveVenta > 0 AndAlso ErrorList.Count = 0 AndAlso (SeGuardoPrePoliza Or ObjFactura.TipoDocto.Contiene("Ped", "Cot", "DPe", "PeC", "PA", "Pd2")) Then
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ObjVentas.Commit()
|
||||
|
||||
'ENVIAR POLIZA VIRTUAL
|
||||
@@ -9854,7 +9858,6 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
'ContPAQ El movimiento 1 es el de Venta
|
||||
Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1"
|
||||
|
||||
@@ -9891,7 +9894,6 @@ Partial Class Ventas
|
||||
OnError("Ocurrió un error al contabilizar la factura", ex)
|
||||
End Try
|
||||
|
||||
|
||||
Try
|
||||
'RMF, cuando es pedido, se manda autorización.
|
||||
If ObjFactura.TipoDocto.Contiene("PA") Then
|
||||
@@ -10133,12 +10135,8 @@ Partial Class Ventas
|
||||
|
||||
If ArchivoCotRdlc.Exists Or ArchivoCotMrt.Exists Then
|
||||
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta)))
|
||||
|
||||
|
||||
If ChkEnviarFacturaCRM.Checked AndAlso CorreoContactoCRM.Trim.Length > 0 Then
|
||||
|
||||
Try
|
||||
|
||||
Dim pdfCRM As Byte() = Nothing
|
||||
'If CveVenta > 0 Then
|
||||
' ObjFactura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False)
|
||||
@@ -10151,16 +10149,10 @@ Partial Class Ventas
|
||||
GeneraPDFCotizacion(True, CorreoContactoCRM:=CorreoContactoCRM, pdfCRM:=pdfCRM, SerieFolioCRM:=SerieFolioCRM, TipoDoctoCRM:=TipoDoctoCRM)
|
||||
End If
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al enviar el PDF", ex)
|
||||
End Try
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
Else
|
||||
MensajeAlert.Append("Ocurrió un error al generar el PDF. Por favor vuelva a entrar a la factura para imprimir el PDF. ")
|
||||
End If
|
||||
@@ -10178,9 +10170,6 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
'ERROR DE NO TIMBRADO
|
||||
If Not SeTimbro And (DdlTipoComprobante.SelectedValue = "Ing" Or DdlTipoComprobante.SelectedValue.Contiene("Egs", "Dev") Or DdlTipoComprobante.SelectedValue = "Ant") Then
|
||||
MensajeAlert.AppendFormat("La factura no se pudo timbrar.</b> Por favor intentelo de nuevo a traves del boton Emitir.")
|
||||
@@ -10202,12 +10191,10 @@ Partial Class Ventas
|
||||
End Select
|
||||
|
||||
|
||||
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso CveEmpresaCRM > 0 AndAlso CveAcercamientoCRM > 0 Then
|
||||
RegistraScript($"window.location.href = '/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", CveVenta))}'", "Imprimir")
|
||||
End If
|
||||
|
||||
|
||||
'DESCARGAR PDF DE CICOVISA
|
||||
'If UsuarioActual.CveEmpresa = 72 And CveCliente = 70381 Then
|
||||
' If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem") Then
|
||||
@@ -10235,8 +10222,6 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
GeneraPDFCotizacion(ChkEnviarFactura.Checked) ' MANDA CORREO
|
||||
Else
|
||||
'Enviar pore correo cot CRM
|
||||
End If
|
||||
ElseIf DdlTipoComprobante.SelectedValue = "Rem" Then
|
||||
If UsuarioActual.CveEmpresa.Contiene(81, 109) Then
|
||||
@@ -10311,7 +10296,6 @@ Partial Class Ventas
|
||||
Alert(MensajeAlert.ToString(), TipoMensaje.MsgDosBotones, Liga, TextoConfirmacion:="Seguir Registrando", TextoSegundoBoton:="Ir al Cliente", JSBtn2:=Liga2, ShowCloseButton:=False)
|
||||
End If
|
||||
|
||||
|
||||
MensajeAlert.Clear()
|
||||
|
||||
Try
|
||||
@@ -10324,7 +10308,6 @@ Partial Class Ventas
|
||||
OnError("Ocurrió un error al limpiar los datos", ex)
|
||||
End Try
|
||||
|
||||
|
||||
Else
|
||||
ObjVentas.RollBack()
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
|
||||
@@ -10343,6 +10326,7 @@ Partial Class Ventas
|
||||
ObjCGame.Dispose()
|
||||
ObjContr.Dispose()
|
||||
ObjDocCliente.Dispose()
|
||||
ObjAcum.Dispose()
|
||||
'ObjFolios.Dispose()
|
||||
ErrorList.Clear()
|
||||
ErrorList = Nothing
|
||||
@@ -10986,24 +10970,27 @@ Partial Class Ventas
|
||||
End Sub
|
||||
|
||||
|
||||
Private Function RegistrarNCAmortizacion(ObjVentas As ClsVentas, ObjConta As ClsContabilidad, ObjInventario As ClsInventarios, ObjContr As ClsContratos, ObjContPaq As ClsContPAQi,
|
||||
Private Function RegistrarNCAmortizacion(ObjVentas As ClsVentas, ObjConta As ClsContabilidad, ObjInventario As ClsInventarios, ObjAcum As ClsAcumuladores, ObjContr As ClsContratos, ObjContPaq As ClsContPAQi,
|
||||
ByVal factura As Modelos.Factura, ObjBancos As ClsBancos, TmpDTconceptos As DataTable, ByRef ObjEventos As ClsOIEventos, Optional NCDescuento As Boolean = False,
|
||||
Optional ListaNCDescuento As List(Of Modelos.Factura) = Nothing, Optional IndexNC As Integer = 0) As Boolean
|
||||
Dim ProcesoCorrecto As Boolean = True
|
||||
|
||||
'GENERAMOS EL NUEVO FOLIO
|
||||
Dim ObjFolios As New ClsGralFolios(ObjVentas.IniciaTransacSQL())
|
||||
'Dim ObjFolios As New ClsGralFolios(ObjVentas.IniciaTransacSQL())
|
||||
|
||||
If ObjFolios.GetFolios(factura.TipoDocto, UsuarioActual.CveEmpresa) Then
|
||||
Dim DT As DataTable = ObjFolios.DtResultados.FiltraParametros(String.Format(" CveSubProyecto = {0} And Estado = 'Activo'", DdlSubProyectoDatos.SelectedValue.ToEntero()))
|
||||
If DT.Rows.Count > 0 Then
|
||||
factura.Serie = DT.Rows(0)("Serie").ToString()
|
||||
factura.Folio = DT.Rows(0)("FActual").ToString().ToEntero()
|
||||
Else
|
||||
ProcesoCorrecto = False
|
||||
End If
|
||||
DT.Dispose()
|
||||
End If
|
||||
'If ObjFolios.GetFolios(factura.TipoDocto, UsuarioActual.CveEmpresa) Then
|
||||
' Dim DT As DataTable = ObjFolios.DtResultados.FiltraParametros(String.Format(" CveSubProyecto = {0} And Estado = 'Activo'", DdlSubProyectoDatos.SelectedValue.ToEntero()))
|
||||
' If DT.Rows.Count > 0 Then
|
||||
' factura.Serie = DT.Rows(0)("Serie").ToString()
|
||||
' factura.Folio = DT.Rows(0)("FActual").ToString().ToEntero()
|
||||
' Else
|
||||
' ProcesoCorrecto = False
|
||||
' End If
|
||||
' DT.Dispose()
|
||||
'End If
|
||||
|
||||
factura.Serie = "-1"
|
||||
factura.Folio = -1
|
||||
|
||||
If NCDescuento Then
|
||||
|
||||
@@ -11019,7 +11006,7 @@ Partial Class Ventas
|
||||
|
||||
factura.CveVentaPadre = Me.CveVenta
|
||||
'Registramos la venta
|
||||
GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjContr, factura, factura.DtDetalle, -1, ObjContPaq, ObjBancos, EsNCAmortizacion:=False, NCDescuento:=True, ListaNCDescuento:=ListaNCDescuento)
|
||||
GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjAcum, ObjContr, factura, factura.DtDetalle, -1, ObjContPaq, ObjBancos, EsNCAmortizacion:=False, NCDescuento:=True, ListaNCDescuento:=ListaNCDescuento)
|
||||
|
||||
Else
|
||||
'GENERO LOS DATOS DE LA NC
|
||||
@@ -11158,7 +11145,7 @@ Partial Class Ventas
|
||||
ObjFacturaDevolucion.Timbre = PreParaTimbre(ObjFacturaDevolucion)
|
||||
|
||||
'Registramos la venta
|
||||
GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjContr, factura, tmpcon, -1, ObjContPaq, ObjBancos, EsNCAmortizacion:=True)
|
||||
GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjAcum, ObjContr, factura, tmpcon, -1, ObjContPaq, ObjBancos, EsNCAmortizacion:=True)
|
||||
|
||||
Else
|
||||
ErrorList.Add("No se encontró un producto para generar la nota de crédito")
|
||||
@@ -12916,7 +12903,7 @@ Partial Class Ventas
|
||||
|
||||
|
||||
#Region " GUARDAR - VENTA, PREPOLIZAS, INV, ESTIMACIONES, AC, NOTA DE CRÉDITO "
|
||||
Private Sub GuardarVenta(ByRef ObjVentas As ClsVentas, ByRef ObjConta As ClsContabilidad, ByRef ObjInventario As ClsInventarios, ByRef ObjContr As ClsContratos, factura As Modelos.Factura, ByRef TmpDTDetalle As DataTable, CveNCaVincular As Integer,
|
||||
Private Sub GuardarVenta(ByRef ObjVentas As ClsVentas, ByRef ObjConta As ClsContabilidad, ByRef ObjInventario As ClsInventarios, ByRef ObjAcum As ClsAcumuladores, ByRef ObjContr As ClsContratos, factura As Modelos.Factura, ByRef TmpDTDetalle As DataTable, CveNCaVincular As Integer,
|
||||
ByRef objContPaqi As ClsContPAQi, Optional ByRef ObjBancos As ClsBancos = Nothing, Optional ByRef ObjOS As ClsOS = Nothing, ByRef Optional ObjEventos As ClsOIEventos = Nothing, ByRef Optional ObjCGame As ClsCGame = Nothing,
|
||||
ByRef Optional ObjCliente As ClsClientes = Nothing, Optional EsNCAmortizacion As Boolean = False, Optional NCDescuento As Boolean = False, Optional ListaNCDescuento As List(Of Modelos.Factura) = Nothing, Optional CveAnticipoPadre As Integer = -1)
|
||||
|
||||
@@ -13128,11 +13115,11 @@ Partial Class Ventas
|
||||
'SI ES REFACTURACION, NO DEBE AFECTAR LOS USADOS
|
||||
If Not NuevaFactura.Contiene(1) Then
|
||||
If ObjFactura.TipoDocto = "Ing" Then
|
||||
If Not GuardarUsados(2, ObjVentas.IniciaTransacSQL, factura) Then
|
||||
If Not GuardarUsados(2, ObjVentas.IniciaTransacSQL, factura, ObjAcum) Then
|
||||
ErrorList.Add("Error al guardar usados")
|
||||
End If
|
||||
ElseIf ObjFactura.TipoDocto = "Dev" Then
|
||||
If Not GuardarUsados(1, ObjVentas.IniciaTransacSQL, factura) Then
|
||||
If Not GuardarUsados(1, ObjVentas.IniciaTransacSQL, factura, ObjAcum) Then
|
||||
ErrorList.Add("Error al guardar usados")
|
||||
End If
|
||||
End If
|
||||
@@ -13238,7 +13225,6 @@ Partial Class Ventas
|
||||
Dim ListaRNC As List(Of Modelos.Factura) = Nothing
|
||||
|
||||
If NCDescuento Then
|
||||
EsCargo = (Not ListaNCDescuento.Any(Function(RNC) RNC.Num2 = 1))
|
||||
ListaRNC = ListaNCDescuento
|
||||
Else
|
||||
EsCargo = RblRNCTipo.SelectedValue = "1"
|
||||
@@ -13246,26 +13232,93 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
'SI SE FACTURAN RNC DE CARGO, SE AGREGA EL CONCEPTO DE ACREDITAMIENTO
|
||||
If ListaRNC IsNot Nothing AndAlso ClienteEsDistribuidor AndAlso EsCargo AndAlso Not factura.EsGarantia Then
|
||||
Dim ObjAcum As New ClsAcumuladores(ObjVentas.IniciaTransacSQL())
|
||||
|
||||
If ListaRNC IsNot Nothing AndAlso ClienteEsDistribuidor AndAlso Not factura.EsGarantia Then
|
||||
Dim CvePSCargo As Integer = -1
|
||||
For Each RNC In ListaRNC
|
||||
CvePSCargo = RNC.DtDetalle.FiltroPrimeroValor("CvePS", $"CveVentaDetalle={Row("CveVentaDetalleRNC").ToString()}").ToEntero()
|
||||
If CvePSCargo > 0 Then
|
||||
Exit For
|
||||
Dim CveVentaRNC As Integer = -1
|
||||
|
||||
For Each RNC As Modelos.Factura In ListaRNC
|
||||
|
||||
If NCDescuento Then
|
||||
EsCargo = (Not RNC.Num1 = 2)
|
||||
End If
|
||||
|
||||
CvePSCargo = RNC.DtDetalle.FiltroPrimeroValor("CvePS", $"CveVentaDetalle={Row("CveVentaDetalleRNC").ToString()}").ToEntero()
|
||||
CveVentaRNC = RNC.DtDetalle.FiltroPrimeroValor("CveVenta", $"CveVentaDetalle={Row("CveVentaDetalleRNC").ToString()}").ToEntero()
|
||||
|
||||
If EsCargo Then
|
||||
If Not ObjAcum.DistribuidorMovtosGet(Me.CveCliente, UsuarioActual.CveEmpresa, CveVentaRNCCargo:=CveVentaRNC) AndAlso ObjAcum.DtResultados.Rows.Count > 0 Then
|
||||
ErrorList.Add("Ocurrió un error al obtener los movimientos del distribuidor.")
|
||||
Exit For
|
||||
End If
|
||||
|
||||
Dim RowMovto As DataRow = ObjAcum.DtResultados.FiltroPrimero($"CvePSCargo={CvePSCargo}")
|
||||
|
||||
If RowMovto IsNot Nothing Then
|
||||
'OBTIENE LOS IMPORTES ORIGINALES EN BASE A LO QUE HABIA EN EL MOVIMIENTO
|
||||
Dim ImporteCargoOriginal = (RowMovto("ImporteCargo").ToString().ToDecimal() / RowMovto("Cantidad").ToString().ToDecimal()).RoundSQL(2)
|
||||
'Dim ImporteBonificacionOriginal = (RowMovto("ImporteBonificacion").ToString().ToDecimal() / RowMovto("Cantidad").ToString().ToDecimal()).RoundSQL(2)
|
||||
Dim PuntosOriginales = (RowMovto("Puntos").ToString().ToDecimal() / RowMovto("Cantidad").ToString().ToDecimal()).RoundSQL(2)
|
||||
|
||||
Dim CveTamanio As Integer = RowMovto("CveTamaño").ToString().ToEntero()
|
||||
Dim Cantidad As Decimal = Row("Cantidad").ToString().ToDecimal()
|
||||
|
||||
Dim Puntos As Decimal = Cantidad * PuntosOriginales
|
||||
Dim Cargo As Decimal = Cantidad * ImporteCargoOriginal
|
||||
Dim Bonificacion As Decimal = 0
|
||||
|
||||
If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, Cantidad, CveTamanio, Puntos, Cargo, Bonificacion, 6, factura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0D, "", Now) Then
|
||||
ErrorList.Add("Ocurrió un error al agregar el movimiento de distribuidor.")
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
|
||||
Else
|
||||
|
||||
Dim DrTamanio As DataRow = GlobalDTAcumTamaños().FiltroPrimero($"CvePSCargo={CvePSCargo}")
|
||||
|
||||
If DrTamanio IsNot Nothing Then
|
||||
'OBTIENE LOS IMPORTES ORIGINALES EN BASE A LO QUE HABIA EN EL MOVIMIENTO
|
||||
Dim ImporteBonificacion = Row("Total").ToString().ToDecimal().RoundSQL(2)
|
||||
Dim CveTamanio As Integer = DrTamanio("CveTamaño").ToString().ToEntero()
|
||||
Dim Cantidad As Decimal = Row("Cantidad").ToString().ToDecimal()
|
||||
|
||||
Dim Puntos As Decimal = 0
|
||||
Dim Cargo As Decimal = 0
|
||||
|
||||
If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, Cantidad, CveTamanio, Puntos, Cargo, ImporteBonificacion, 6, factura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0D, "", Now) Then
|
||||
ErrorList.Add("Ocurrió un error al agregar el movimiento de distribuidor.")
|
||||
Exit For
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Next
|
||||
|
||||
Dim CveTamanio As Integer = GlobalDTAcumTamaños().FiltroPrimeroValor("CveTamaño", $"CvePSCargo={CvePSCargo}").ToEntero()
|
||||
'Dim RowTamanio As DataRow = GlobalDTAcumTamaños().FiltroPrimero($"CvePSCargo={CvePSCargo}")
|
||||
|
||||
If CveTamanio > 0 Then
|
||||
If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, Row("Cantidad").ToString().ToDecimal(), CveTamanio, 6, factura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0D, "", Now) Then
|
||||
ErrorList.Add("Ocurrió un error al agregar la venta detalle devolución.")
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
'If RowTamanio IsNot Nothing Then
|
||||
' Dim CveTamanio As Integer = RowTamanio("CveTamaño").ToString().ToEntero()
|
||||
' Dim Cantidad As Decimal = Row("Cantidad").ToString().ToDecimal()
|
||||
' Dim Puntos As Decimal = Cantidad * RowTamanio("Puntos").ToString().ToDecimal()
|
||||
' Dim Cargo As Decimal = Cantidad * RowTamanio("Cargo").ToString().ToDecimal()
|
||||
' Dim Bonificacion As Decimal = Cantidad * RowTamanio("Bonificacion").ToString().ToDecimal()
|
||||
|
||||
' If EsCargo Then
|
||||
' Bonificacion = 0
|
||||
' Else
|
||||
' Puntos = 0
|
||||
' Cargo = 0
|
||||
' End If
|
||||
|
||||
' If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, Cantidad, CveTamanio, Puntos, Cargo, Bonificacion, 6, factura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0D, "", Now) Then
|
||||
' ErrorList.Add("Ocurrió un error al agregar la venta detalle devolución.")
|
||||
' Exit For
|
||||
' End If
|
||||
'End If
|
||||
End If
|
||||
|
||||
End If
|
||||
@@ -24786,9 +24839,9 @@ Partial Class Ventas
|
||||
|
||||
ObjFacturaCancelacion.CveAlmacenDevolucion = CveAlmacenDevolucion
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ObjFacturaCancelacion.TipoDocto = "Rem" Then
|
||||
ChkDevAlm.Checked = True
|
||||
End If
|
||||
'If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ObjFacturaCancelacion.TipoDocto.Contiene("Rem", "Dev") Then
|
||||
' ChkDevAlm.Checked = True
|
||||
'End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(567) = "1" AndAlso ObjFacturaCancelacion.TipoDocto = "Rem" Then
|
||||
ChkDevAlm.Checked = True
|
||||
@@ -29314,13 +29367,15 @@ Partial Class Ventas
|
||||
End If
|
||||
UltimoRenglonRNC += 1
|
||||
|
||||
Dim CveVentaDetalleRNC As Integer = RNCBonificacion.DtDetalle.FiltroPrimeroValor("CveVentaDetalle").ToEntero()
|
||||
|
||||
'SOLO AGREGA SI LA CANTIDAD ES MAYOR CERO
|
||||
If Cantidad.RoundSQL(6) > 0D AndAlso ImportePU.RoundSQL(6) > 0 Then
|
||||
AgregaTempDT(TmpDTDescNCBonificacion, DrPS("CvePS").ToString().ToEntero(), DrPS("PS").ToString(), DrPS("Codigo").ToString(), DrPS("PSCodigo").ToString(), DrPS("CveTipoPS").ToString().ToEntero(), DrPS("Inv_CveMetodoInventario").ToString().ToEntero(),
|
||||
DrPS("CveUM").ToString().ToEntero(), DrPS("UnidadMedida").ToString(), DrPS("CveClasificacion").ToString().ToEntero(), DrPS("Clasificacion").ToString(), CveProyecto, Proyecto, CveSubProyecto, SubProyecto,
|
||||
Obs, Cantidad, ImportePU, RowCargo("PorcentajeIVA").ToString().ToDecimal, ImporteIVA, RowCargo("PorcentajeRetIVA").ToString().ToDecimal, ImporteRetIVA,
|
||||
RowCargo("PorcentajeRetISR").ToString().ToDecimal, ImporteRetISR, RowCargo("PorcentajeIEPS").ToString().ToDecimal, ImporteIEPS, -1, 0, ImporteTotal, "", "", -1, -1,
|
||||
DrPS("SATClavePS").ToString(), DrPS("SATClaveUnidadMedida").ToString(), -1, -1, -1, -1, -1, -1, CodigoObjetoImpuesto:=DrPS("CodigoObjetoImpuesto").ToString())
|
||||
DrPS("SATClavePS").ToString(), DrPS("SATClaveUnidadMedida").ToString(), -1, -1, -1, -1, -1, -1, CveVentaDetalleRNC:=CveVentaDetalleRNC, CodigoObjetoImpuesto:=DrPS("CodigoObjetoImpuesto").ToString())
|
||||
End If
|
||||
|
||||
Next
|
||||
@@ -32935,29 +32990,36 @@ Partial Class Ventas
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function GuardarUsados(CveConcepto As Integer, SqlTransaccion As SqlClient.SqlTransaction, factura As Modelos.Factura) As Boolean
|
||||
Private Function GuardarUsados(CveConcepto As Integer, SqlTransaccion As SqlClient.SqlTransaction, factura As Modelos.Factura, ObjAcum As ClsAcumuladores) As Boolean
|
||||
Dim Resultado As Boolean = True
|
||||
|
||||
If ClienteEsDistribuidor AndAlso Not factura.EsGarantia Then
|
||||
Dim ObjAcum As New ClsAcumuladores(SqlTransaccion)
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
If ClienteEsDistribuidor AndAlso Not factura.EsGarantia Then
|
||||
For Each drow As DataRow In factura.DtDetalle.Rows
|
||||
If drow("CveTamaño").ToString.ToEntero > 0 Then
|
||||
Dim DrTamanio As DataRow = GlobalDTAcumTamaños().FiltroPrimero($"CveTamaño={drow("CveTamaño").ToString.ToEntero}")
|
||||
If DrTamanio IsNot Nothing Then
|
||||
Dim Cargo As Decimal = DrTamanio("Cargo").ToString().ToDecimal() * drow("Cantidad").ToString.ToDecimal()
|
||||
Dim Bonificacion As Decimal = DrTamanio("Bonificacion").ToString().ToDecimal() * drow("Cantidad").ToString.ToDecimal()
|
||||
Dim Puntos As Decimal = DrTamanio("Puntos").ToString().ToDecimal() * drow("Cantidad").ToString.ToDecimal()
|
||||
|
||||
Dim CvePSPSA As Integer = UsuarioActual.Empresa.Funcionalidad(533).ToEntero
|
||||
|
||||
For Each drow As DataRow In factura.DtDetalle.Rows
|
||||
If drow("CveTamaño").ToString.ToEntero > 0 And (CvePSPSA <> drow("CvePS").ToString.ToEntero) Then
|
||||
If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, drow("Cantidad").ToString.ToDecimal, drow("CveTamaño").ToString.ToEntero, CveConcepto, factura.CveVenta, UsuarioActual.CveUsuario,
|
||||
If drow("CveTamaño").ToString.ToEntero > 0 Then
|
||||
If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, drow("Cantidad").ToString.ToDecimal, drow("CveTamaño").ToString.ToEntero, Puntos, Cargo, Bonificacion, CveConcepto, factura.CveVenta, UsuarioActual.CveUsuario,
|
||||
UsuarioActual.CveEmpresa, 0D, "", Now) Then
|
||||
Resultado = False
|
||||
Exit For
|
||||
Resultado = False
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
Resultado = False
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
Resultado = True
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
|
||||
Return Resultado
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
@@ -36023,6 +36085,9 @@ Partial Class Ventas
|
||||
|
||||
|
||||
Protected Sub DdlLineaAdicional_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
TxtFechaPago.Enabled = True
|
||||
imgCalendario.Visible = True
|
||||
|
||||
If DdlLineaAdicional.SelectedValue.ToEntero() > 0 Then
|
||||
RBLPago.SelectedValue = "1"
|
||||
RBLPago.Enabled = False
|
||||
@@ -36037,6 +36102,8 @@ Partial Class Ventas
|
||||
'AL FACTURAR CON LINEA ADICIONAL TIPO PO, SE SUMARÁN LOS DIAS DE VENCIMIENTO A LA FECHA ACTUAL
|
||||
If RowLinea("TipoLinea").ToString() = "2" Then
|
||||
TxtFechaPago.Text = Now.AddDays(RowLinea("DiasVencimiento").ToString().ToEntero()).ToString("dd/MM/yyyy")
|
||||
TxtFechaPago.Enabled = False
|
||||
imgCalendario.Visible = False
|
||||
End If
|
||||
|
||||
Me.CveCategoriaLineaAdicional = RowLinea("CveCategoria").ToString().ToEntero()
|
||||
|
||||
Reference in New Issue
Block a user