This commit is contained in:
Luis Quijada
2025-04-14 11:17:08 -07:00
11 changed files with 196 additions and 1349 deletions

View File

@@ -1643,7 +1643,7 @@ Public Class ClsVentas
Return Retorno Return Retorno
End Function End Function
Public Function UpdateVentaDetalleRemision(CveVenta As Integer, CvePS As Integer, Cantidad As Decimal, PU As Decimal, IEPS As Decimal, PorcentajeIEPS As Decimal, IVA As Decimal, PorcentajeIVA As Decimal, Descuento As Decimal, Observaciones As String, Optional CveUsuarioModifico As Integer = -1, Optional CvePromocionDetalle As Integer = -1) As Boolean Public Function UpdateVentaDetalleRemision(CveVenta As Integer, CvePS As Integer, Cantidad As Decimal, PU As Decimal, IEPS As Decimal, PorcentajeIEPS As Decimal, IVA As Decimal, PorcentajeIVA As Decimal, Descuento As Decimal, Observaciones As String, Optional CveUsuarioModifico As Integer = -1, Optional CvePromocionDetalle As Integer = -1, Optional CantidadConversion As Decimal = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_VentasDetalleRemisionUpdate") DataAdapter("PA_VentasDetalleRemisionUpdate")
@@ -1660,6 +1660,7 @@ Public Class ClsVentas
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
.Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico .Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
.Add("@CvePromocionDetalle", SqlDbType.Int).Value = CvePromocionDetalle .Add("@CvePromocionDetalle", SqlDbType.Int).Value = CvePromocionDetalle
.Add("@CantidadConversion", SqlDbType.Decimal).Value = CantidadConversion
End With End With
Try Try

View File

@@ -1587,19 +1587,18 @@ Partial Class PopUpVerFactura
Dim CVEVENTA As Integer = UrlParametros("CVEVENTA").ToString.ToEntero Dim CVEVENTA As Integer = UrlParametros("CVEVENTA").ToString.ToEntero
Dim CVECLIENTE As Integer = UrlParametros("CVECLIENTE").ToString.ToEntero Dim CVECLIENTE As Integer = UrlParametros("CVECLIENTE").ToString.ToEntero
Dim MONTO As Decimal = UrlParametros("MONTO").ToString.ToDecimal Dim MONTO As Decimal = UrlParametros("MONTO").ToString.ToDecimal
Dim TIPO As String = UrlParametros("TIPO").ToString
If CVECLIENTE > 0 AndAlso (CVEIE > 0 Or CVEVENTA > 0) Then If CVECLIENTE > 0 AndAlso (CVEIE > 0 Or CVEVENTA > 0) Then
ImprimirSaldosAmortizacion(CVEVENTAAMORTIZADA, CVEIE, CVEVENTA, CVECLIENTE, MONTO) ImprimirSaldosAmortizacion(TIPO, CVEVENTAAMORTIZADA, CVEIE, CVEVENTA, CVECLIENTE, MONTO)
End If End If
End If End If
End Sub End Sub
Private Sub ImprimirSaldosAmortizacion(CveVentaAmortizada As Integer, CveIE As Integer, CveVenta As Integer, CveCliente As Integer, Monto As Decimal) Private Sub ImprimirSaldosAmortizacion(Tipo As String, CveVentaAmortizada As Integer, CveIE As Integer, CveVenta As Integer, CveCliente As Integer, Monto As Decimal)
Dim ObjMovtos As New ClsMovimientos()
Dim SaldoAntNCDev As Decimal = 0 Dim SaldoAntNCDev As Decimal = 0
Dim DatosSaldoAntNCDev As New DataTable Dim DatosSaldoAntNCDev As New DataTable
Dim TipoDocto As String = "" Dim TipoDocto As String = ""
@@ -1607,36 +1606,22 @@ Partial Class PopUpVerFactura
Dim Saldo As Decimal = 0D Dim Saldo As Decimal = 0D
Dim DTNCVinculadas As New DataTable Dim DTNCVinculadas As New DataTable
Dim ObjMovtos As New ClsMovimientos()
If ObjMovtos.GetAnticiposNCIxCCliente(CveCliente) Then If ObjMovtos.GetAnticiposNCIxCCliente(CveCliente) Then
DatosSaldoAntNCDev = ObjMovtos.DtResultados If Tipo.Contiene("NC", "Ant") Then
DatosSaldoAntNCDev = ObjMovtos.DtResultados.FiltraParametros($"Tipo='{Tipo}' AND CveVenta={CveVenta}")
ElseIf Tipo.Contiene("IxC") Then
DatosSaldoAntNCDev = ObjMovtos.DtResultados.FiltraParametros($"Tipo='{Tipo}' AND CveIE={CveIE}")
End If
End If End If
ObjMovtos.Dispose() ObjMovtos.Dispose()
If DatosSaldoAntNCDev IsNot Nothing AndAlso DatosSaldoAntNCDev.Rows.Count > 0 Then If DatosSaldoAntNCDev IsNot Nothing AndAlso DatosSaldoAntNCDev.Rows.Count > 0 Then
SaldoAntNCDev = If(CveVenta > 0, SaldoAntNCDev = DatosSaldoAntNCDev.FiltroPrimeroValor("Saldo").ToDecimal
DatosSaldoAntNCDev.FiltroPrimeroValor("Saldo", $"CveVenta={CveVenta}").ToDecimal, TipoDocto = DatosSaldoAntNCDev.FiltroPrimeroValor("Tipo")
DatosSaldoAntNCDev.FiltroPrimeroValor("Saldo", $"CveIE={CveIE}").ToDecimal) Folio = DatosSaldoAntNCDev.FiltroPrimeroValor("Folio")
Saldo = DatosSaldoAntNCDev.FiltroPrimeroValor("Saldo").ToDecimal
TipoDocto = If(CveVenta > 0,
DatosSaldoAntNCDev.FiltroPrimeroValor("Tipo", $"CveVenta={CveVenta}"),
DatosSaldoAntNCDev.FiltroPrimeroValor("Tipo", $"CveIE={CveIE}"))
If CveIE > 0 Then
CveVenta = DatosSaldoAntNCDev.FiltroPrimeroValor("CveVenta", $"CveIE={CveIE}").ToEntero
Folio = DatosSaldoAntNCDev.FiltroPrimeroValor("Folio", $"CveIE={CveIE}")
Saldo = DatosSaldoAntNCDev.FiltroPrimeroValor("Saldo", $"CveIE={CveIE}").ToDecimal
Else
Folio = DatosSaldoAntNCDev.FiltroPrimeroValor("Folio", $"CveVenta={CveVenta}")
Saldo = DatosSaldoAntNCDev.FiltroPrimeroValor("Saldo", $"CveVenta={CveVenta}").ToDecimal
End If
End If End If
@@ -1651,30 +1636,53 @@ Partial Class PopUpVerFactura
ObjVentas.Dispose() ObjVentas.Dispose()
End If End If
If TipoDocto.Contiene("IxC") Then
DTNCVinculadas = New DataTable()
DTNCVinculadas.Columns.Add(New DataColumn("SerieFolioEstatus", GetType(String)))
DTNCVinculadas.Columns.Add(New DataColumn("FechaAplicado", GetType(String)))
DTNCVinculadas.Columns.Add(New DataColumn("Moneda", GetType(String)))
DTNCVinculadas.Columns.Add(New DataColumn("TotalNC", GetType(String)))
Dim DtIxC As DataTable = Nothing
Dim ObjVentas As New ClsVentas
If ObjVentas.GetRepAnticiposNCIXCDetalle(CveCliente, -1, MinFecha, MaxFecha, UsuarioActual.CveEmpresa, -1, 3, -1, MinFecha, MaxFecha, TipoCambio:=1, TCEspecifico:=-1) Then
DtIxC = ObjVentas.DtResultados.FiltraParametros($"CveIE={CveIE} AND TipoColumna ='Aplicación'")
End If
ObjVentas.Dispose()
If DtIxC IsNot Nothing Then
For Each RowIxC As DataRow In DtIxC.Rows
Dim Row As DataRow = DTNCVinculadas.NewRow
Row("SerieFolioEstatus") = RowIxC("SerieFolioAmortizacion")
Row("FechaAplicado") = RowIxC("FechaAmortizacion")
Row("Moneda") = RowIxC("MonedaAmortizacion")
Row("TotalNC") = RowIxC("ImporteAmortizacion")
DTNCVinculadas.Rows.Add(Row)
Next
End If
End If
If DTNCVinculadas IsNot Nothing Then If DTNCVinculadas IsNot Nothing Then
Dim params As New List(Of ReportParameter) Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("Tipo", Tipo))
Dim ObjVentas As New ClsVentas Dim ObjVentas As New ClsVentas
If ObjVentas.GetVenta(CveVentaAmortizada, UsuarioActual.CveEmpresa) Then If ObjVentas.GetVenta(CveVentaAmortizada, UsuarioActual.CveEmpresa) Then
Dim DbRowVenta = ObjVentas.DtResultados.Copy().FiltroPrimero("") Dim DbRowVenta = ObjVentas.DtResultados.Copy().FiltroPrimero("")
If DbRowVenta IsNot Nothing Then If DbRowVenta IsNot Nothing Then
params.Add(New ReportParameter("SerieFolio", DbRowVenta("SerieFolio").ToString)) params.Add(New ReportParameter("SerieFolio", Folio))
params.Add(New ReportParameter("Moneda", DbRowVenta("Moneda").ToString)) params.Add(New ReportParameter("Moneda", DbRowVenta("Moneda").ToString))
params.Add(New ReportParameter("Cliente", DbRowVenta("ClienteNombre").ToString)) params.Add(New ReportParameter("Cliente", DbRowVenta("ClienteNombre").ToString))
End If End If
End If End If
ObjVentas.Dispose() ObjVentas.Dispose()
Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png") Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png")
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("FechaImpresion", NowADS().ToString)) params.Add(New ReportParameter("FechaImpresion", NowADS().ToString))

File diff suppressed because it is too large Load Diff

View File

@@ -98,8 +98,10 @@ Partial Class Inventarios_CatAlmacenes
Private Sub CargaUsuarios() Private Sub CargaUsuarios()
Dim DT As DataTable = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa).FiltraParametros(" Estatus = 1 ").Copy Dim DT As DataTable = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa)
If DT IsNot Nothing Then
DT = DT.FiltraParametros(" Estatus = 1 ").Copy
DT.DefaultView.Sort = "Nombre ASC" DT.DefaultView.Sort = "Nombre ASC"
DT = DT.DefaultView.ToTable DT = DT.DefaultView.ToTable
@@ -107,7 +109,7 @@ Partial Class Inventarios_CatAlmacenes
DdlUsuariosAutoriza.DataBind() DdlUsuariosAutoriza.DataBind()
DdlUsuariosAutoriza.Items.Insert(0, New ListItem("Seleccione uno", "-1")) DdlUsuariosAutoriza.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
End If
End Sub End Sub
Private Sub CargaCuentasContables() Private Sub CargaCuentasContables()

View File

@@ -670,16 +670,11 @@ Partial Class OP_OP
Dim CveMP As Integer = GvMPAgregados.DataKeys(row.RowIndex)("CvePSMateriaPrima").ToString().ToEntero() Dim CveMP As Integer = GvMPAgregados.DataKeys(row.RowIndex)("CvePSMateriaPrima").ToString().ToEntero()
Dim CveUMMP As Integer = GvMPAgregados.DataKeys(row.RowIndex)("CveUMMateriaPrima").ToString().ToEntero() Dim CveUMMP As Integer = GvMPAgregados.DataKeys(row.RowIndex)("CveUMMateriaPrima").ToString().ToEntero()
Dim CantidadSolicitada As Decimal = DtMP.Rows(row.RowIndex)("Cantidad").ToString().ToDecimal() Dim CantidadSolicitada As Decimal = DtMP.Rows(row.RowIndex)("Cantidad").ToString().ToDecimal()
Dim Existencia As Decimal = ObjInventario.GetExistenciasPS( Dim Existencia As Decimal = ObjInventario.GetExistenciasPS(
CvePS:=CveMP, CvePS:=CveMP,
CveUnidadMedida:=CveUMMP, CveUnidadMedida:=CveUMMP,
CveEmpresa:=UsuarioActual.CveEmpresa, CveEmpresa:=UsuarioActual.CveEmpresa,
CveAlmacen:=DdlAlmacenOrigenMP.SelectedValue.ToEntero() CveAlmacen:=DdlAlmacenOrigenMP.SelectedValue.ToEntero())
)
If Existencia < CantidadSolicitada Then If Existencia < CantidadSolicitada Then
Dim NombreProducto As String = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveMP).FiltroPrimeroValor("Producto", "") Dim NombreProducto As String = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveMP).FiltroPrimeroValor("Producto", "")
@@ -743,7 +738,6 @@ Partial Class OP_OP
Next Next
End If End If
If Not TieneError Then If Not TieneError Then
ObjInventario.Commit() ObjInventario.Commit()
Alert($"Solicitud de Traspaso guardada. Folio: <b>{FolioSolicitud}</b>", TipoMensaje.MsgInformacion) Alert($"Solicitud de Traspaso guardada. Folio: <b>{FolioSolicitud}</b>", TipoMensaje.MsgInformacion)
@@ -775,8 +769,6 @@ Partial Class OP_OP
Try Try
If Me.CveOP = -1 Then ' Modo CREACIÓN If Me.CveOP = -1 Then ' Modo CREACIÓN
Dim xmlProductos As String = DataTableToXML(DtPS) Dim xmlProductos As String = DataTableToXML(DtPS)
@@ -925,18 +917,14 @@ Partial Class OP_OP
' 1. Cargar almacén de salida (Tipo 28) ' 1. Cargar almacén de salida (Tipo 28)
DdlAlmacenOrigenSalidaMP.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoAlmacen = 28") DdlAlmacenOrigenSalidaMP.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoAlmacen = 28")
DdlAlmacenOrigenSalidaMP.DataBind() DdlAlmacenOrigenSalidaMP.DataBind()
' 2. Cargar almacén de producto terminado ' 2. Cargar almacén de producto terminado
DdlAlmacenTerminado.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoAlmacen = 1") DdlAlmacenTerminado.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoAlmacen = 1")
DdlAlmacenTerminado.DataBind() DdlAlmacenTerminado.DataBind()
DdlAlmacenTerminado.Items.Insert(0, New ListItem("Seleccionar almacén", "-1")) DdlAlmacenTerminado.Items.Insert(0, New ListItem("Seleccionar almacén", "-1"))
' Almacén de Devoluciones (Tipo 1) ' Almacén de Devoluciones (Tipo 1)
DdlAlmacenDevolucion.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoAlmacen = 1") DdlAlmacenDevolucion.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoAlmacen = 1")
DdlAlmacenDevolucion.DataBind() DdlAlmacenDevolucion.DataBind()
DdlAlmacenDevolucion.Items.Insert(0, New ListItem("Seleccionar almacén", "-1")) DdlAlmacenDevolucion.Items.Insert(0, New ListItem("Seleccionar almacén", "-1"))
' 3. Cargar GridViews ' 3. Cargar GridViews
GvProductoTerminado.DataSource = DtPS.FiltraParametros("Tipo = 'Producto'") GvProductoTerminado.DataSource = DtPS.FiltraParametros("Tipo = 'Producto'")
GvProductoTerminado.DataBind() GvProductoTerminado.DataBind()
@@ -1010,8 +998,12 @@ Partial Class OP_OP
ObjInventario.IniciaTransacSQL() ObjInventario.IniciaTransacSQL()
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL()) Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL())
Dim ObjOP As New ClsOP(ObjInventario.IniciaTransacSQL()) Dim ObjOP As New ClsOP(ObjInventario.IniciaTransacSQL())
Try Dim TotalMPProducto As Decimal = 0
Dim TotalMOProducto As Decimal = 0
Dim TotalCIProducto As Decimal = 0
Try
'Salida de MP
CveMovimientoSalida = ObjInventario.AddMovimiento(DdlAlmacenOrigenSalidaMP.SelectedValue.ToEntero(), TipoMovimientoSalida, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:="Finalización OP #" & LblFolio.Text, Modulo:="OP/FinalizarOPSalida") CveMovimientoSalida = ObjInventario.AddMovimiento(DdlAlmacenOrigenSalidaMP.SelectedValue.ToEntero(), TipoMovimientoSalida, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:="Finalización OP #" & LblFolio.Text, Modulo:="OP/FinalizarOPSalida")
FolioEntrada = ObjInventario.Folio FolioEntrada = ObjInventario.Folio
Dim DtMPAlmacen As DataTable = Nothing Dim DtMPAlmacen As DataTable = Nothing
@@ -1037,15 +1029,10 @@ Partial Class OP_OP
' 5. Calcular TotalCostoMP ' 5. Calcular TotalCostoMP
TotalCostoMP = ObjInventario.DtResultados.SUMD("Total") TotalCostoMP = ObjInventario.DtResultados.SUMD("Total")
Dim CostosPorProducto As New Dictionary(Of Integer, Decimal)
' 1. Recorrer cada Producto Terminado en la OP ' 1. Recorrer cada Producto Terminado en la OP
For Each rowProducto As DataRow In DtPS.Select("Tipo = 'Producto'") For Each rowProducto As DataRow In DtPS.Select("Tipo = 'Producto'")
Dim CvePSProducto As Integer = rowProducto("Clave").ToString.ToEntero() Dim CvePSProducto As Integer = rowProducto("Clave").ToString.ToEntero()
Dim CantidadProducto As Decimal = rowProducto("Cantidad").ToString.ToDecimal() Dim CantidadProducto As Decimal = rowProducto("Cantidad").ToString.ToDecimal()
Dim TotalMPProducto As Decimal = 0
Dim TotalMOProducto As Decimal = 0
Dim TotalCIProducto As Decimal = 0
' 2. Calcular Costo de Materias Primas por Producto ' 2. Calcular Costo de Materias Primas por Producto
For Each rowMP As DataRow In DtMP.Select($"Clave = {CvePSProducto}") For Each rowMP As DataRow In DtMP.Select($"Clave = {CvePSProducto}")
@@ -1064,10 +1051,13 @@ Partial Class OP_OP
For Each rowCI As DataRow In DtCI.Select($"Clave = {CvePSProducto}") For Each rowCI As DataRow In DtCI.Select($"Clave = {CvePSProducto}")
TotalCIProducto += rowCI("Total").ToString.ToDecimal() TotalCIProducto += rowCI("Total").ToString.ToDecimal()
Next Next
' 5. Determinar las devoluciones del Producto
Dim TotalDevPT As Decimal = GvMPUtilizada.Rows.Cast(Of GridViewRow)().Where($"datakey.cvepspt = {CvePSProducto}").Sum(Function(row) DirectCast(row.FindControl("TxtDevolucionMP"), TextBox).Text.ToDecimal())
' 5. Sumar Total por Producto (MP + MO + CI) ' 6. Sumar Total por Producto (MP + MO + CI)
Dim TotalProducto As Decimal = TotalMPProducto + TotalMOProducto + TotalCIProducto Dim TotalProducto As Decimal = TotalMPProducto + TotalMOProducto + TotalCIProducto - TotalDevPT
CostosPorProducto.Add(CvePSProducto, TotalProducto)
rowProducto("Costo") = TotalProducto
Next Next
' 2. PROCESAR DEVOLUCIONES SI EXISTEN ' 2. PROCESAR DEVOLUCIONES SI EXISTEN
@@ -1082,7 +1072,6 @@ Partial Class OP_OP
CveMovimientoDev = ObjInventario.AddMovimiento(DdlAlmacenDevolucion.SelectedValue.ToEntero(), TipoMovimientoDev, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=$"Devolución OP #{LblFolio.Text}", Modulo:="OP/Devoluciones", CveMovimientoRelacionado:=CveMovimientoSalida) CveMovimientoDev = ObjInventario.AddMovimiento(DdlAlmacenDevolucion.SelectedValue.ToEntero(), TipoMovimientoDev, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=$"Devolución OP #{LblFolio.Text}", Modulo:="OP/Devoluciones", CveMovimientoRelacionado:=CveMovimientoSalida)
If CveMovimientoDev > 0 Then If CveMovimientoDev > 0 Then
For Each row As GridViewRow In GvMPUtilizada.Rows For Each row As GridViewRow In GvMPUtilizada.Rows
Dim Devolucion As Decimal = row.FCTextBox("TxtDevolucionMP").Text.ToDecimal() Dim Devolucion As Decimal = row.FCTextBox("TxtDevolucionMP").Text.ToDecimal()
@@ -1108,9 +1097,9 @@ Partial Class OP_OP
Next Next
End If End If
End If End If
End If End If
'ENTRADA DE PRODUCTO TERMINADO
If Not ErrorMovInv Then If Not ErrorMovInv Then
CveMovimientoEntrada = ObjInventario.AddMovimiento(DdlAlmacenTerminado.SelectedValue.ToEntero(), CveConceptoEntrada, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:="Finalización OP #" & LblFolio.Text, Modulo:="OP/FinalizarOPEntrada", CveMovimientoRelacionado:=CveMovimientoSalida) CveMovimientoEntrada = ObjInventario.AddMovimiento(DdlAlmacenTerminado.SelectedValue.ToEntero(), CveConceptoEntrada, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:="Finalización OP #" & LblFolio.Text, Modulo:="OP/FinalizarOPEntrada", CveMovimientoRelacionado:=CveMovimientoSalida)
End If End If
@@ -1121,7 +1110,7 @@ Partial Class OP_OP
Dim PU_PT As Decimal = If(CantidadPT > 0, CostoPTAjustado / CantidadPT, 0) Dim PU_PT As Decimal = If(CantidadPT > 0, CostoPTAjustado / CantidadPT, 0)
For Each rowPT As DataRow In DtPS.Select("Tipo = 'Producto'") For Each rowPT As DataRow In DtPS.Select("Tipo = 'Producto'")
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, rowPT("Cantidad").ToString.ToDecimal(), rowPT("CveUM").ToString.ToEntero(), rowPT("Clave").ToString.ToEntero(), PU_PT) Then If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, rowPT("Cantidad").ToString.ToDecimal(), rowPT("CveUM").ToString.ToEntero(), rowPT("Clave").ToString.ToEntero(), rowPT("Costo").ToString.ToDecimal()) Then
ErrorMovInv = True : TextoError = "x" : Exit For ErrorMovInv = True : TextoError = "x" : Exit For
End If End If
Next Next
@@ -1130,21 +1119,28 @@ Partial Class OP_OP
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/OPFinalizada", 53, 0, 0, 1, Fecha, "Producción OP #" & LblFolio.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/OPFinalizada", 53, 0, 0, 1, Fecha, "Producción OP #" & LblFolio.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CvePrePoliza > 0 Then
'salida MP
If CvePrePoliza > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCostoMP, TotalCostoMP, 68, "Consumo MP OP #" & LblFolio.Text, "Consumo MP OP #" & LblFolio.Text, CveMovimientoAlmacen:=CveMovimientoSalida) Then If CvePrePoliza > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCostoMP, TotalCostoMP, 68, "Consumo MP OP #" & LblFolio.Text, "Consumo MP OP #" & LblFolio.Text, CveMovimientoAlmacen:=CveMovimientoSalida) Then
ErrorMovInv = True ErrorMovInv = True
End If End If
' entrada PT
If Not ErrorMovInv AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, CostoPTAjustado, CostoPTAjustado, 68, "Producción PT OP #" & LblFolio.Text, "Producción PT OP #" & LblFolio.Text, CveMovimientoAlmacen:=CveMovimientoEntrada) Then If Not ErrorMovInv AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, CostoPTAjustado, CostoPTAjustado, 68, "Producción PT OP #" & LblFolio.Text, "Producción PT OP #" & LblFolio.Text, CveMovimientoAlmacen:=CveMovimientoEntrada) Then
ErrorMovInv = True ErrorMovInv = True
End If End If
'dev MP
If Not ErrorMovInv AndAlso CostoDevoluciones <> 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, CostoDevoluciones, CostoDevoluciones, 95, "", $"OP #{LblFolio.Text}", CveMovimientoAlmacen:=CveMovimientoDev) Then
ErrorMovInv = True
End If
ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, CostoDevoluciones, CostoDevoluciones, 95, "", $"OP #{LblFolio.Text}", CveMovimientoAlmacen:=CveMovimientoDev) 'costo indirecto
If Not ErrorMovInv AndAlso TotalCIProducto <> 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalCIProducto, TotalCIProducto, 95, "Producción PT OP #" & LblFolio.Text, "Producción PT OP #" & LblFolio.Text) Then
ErrorMovInv = True
End If
'mano de obra
If Not ErrorMovInv AndAlso TotalCIProducto <> 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalMOProducto, TotalCIProducto, 95, "Producción PT OP #" & LblFolio.Text, "Producción PT OP #" & LblFolio.Text) Then
ErrorMovInv = True
End If
End If
'If Not ErrorMovInv Then 'If Not ErrorMovInv Then
'If Not ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual) Then 'If Not ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual) Then

View File

@@ -2584,12 +2584,22 @@ Partial Class Clientes
Dim InformacionCompleta As Boolean = True Dim InformacionCompleta As Boolean = True
'validación de información completa 'validación de información completa
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
Dim tPagare As Integer = 0
If TxtRFC.Text.Trim() = "" Then InformacionCompleta = False If TxtRFC.Text.Trim() = "" Then InformacionCompleta = False
If ChkPermiteCredito.Checked Then If ChkPermiteCredito.Checked Then
If TxtLimiteCredito.Text.ToDecimal = 0 OrElse TxtCobranzaContacto.Text.Trim = "" OrElse TxtCobranzaTelefono.Text.Trim = "" OrElse TxtDiasEspecifico.Text.Trim = "" OrElse TxtCobranzaCorreo.Text.Trim = "" Then If TxtLimiteCredito.Text.ToDecimal = 0 OrElse TxtCobranzaContacto.Text.Trim = "" OrElse TxtCobranzaTelefono.Text.Trim = "" OrElse TxtDiasEspecifico.Text.Trim = "" OrElse TxtCobranzaCorreo.Text.Trim = "" Then
InformacionCompleta = False InformacionCompleta = False
End If End If
'si es el concepto de pagaré
tPagare = 0
For Each dRow As GridViewRow In GvDocumentosCliente.Rows
Dim CveDocumentacion As Integer = dRow.DataKey("CveDocumentacion").ToEntero()
If CveDocumentacion = 265 Then
If dRow.FCTextBox("TxtFechaVigencia").Text.ToDate > Now Then tPagare = 1
End If
Next
If tPagare = 0 Then InformacionCompleta = False
End If End If
If TxtTelefono.Text.Trim() = "" Then InformacionCompleta = False If TxtTelefono.Text.Trim() = "" Then InformacionCompleta = False

View File

@@ -607,6 +607,11 @@ Partial Class Ventas_PVCobranza
Alert("No hay importe para sobrante/faltante", TipoMensaje.MsgAdvertencia) Alert("No hay importe para sobrante/faltante", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If End If
Else
If TxtFaltante.Text.ToDecimal() <> 0 Then
Alert("No debe especificar sobrante/faltante", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If End If
'validaciones 'validaciones
@@ -1024,12 +1029,12 @@ Partial Class Ventas_PVCobranza
If respFactura IsNot Nothing AndAlso respFactura.Factura IsNot Nothing AndAlso respFactura.Factura.DtAnticiposAplicados IsNot Nothing Then If respFactura IsNot Nothing AndAlso respFactura.Factura IsNot Nothing AndAlso respFactura.Factura.DtAnticiposAplicados IsNot Nothing Then
For Each dr As DataRow In respFactura.Factura.DtAnticiposAplicados.Rows For Each dr As DataRow In respFactura.Factura.DtAnticiposAplicados.Rows
msBuild.AppendLine($"<br><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=AMORTIZACIONHIS&CVEIE={0}&CVEVENTA={1}&CVECLIENTE={2}&CVEVENTAAMORTIZADA={3}&MONTO={4}", msBuild.AppendLine($"<br><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=AMORTIZACIONHIS&CVEIE={0}&CVEVENTA={1}&CVECLIENTE={2}&CVEVENTAAMORTIZADA={3}&MONTO={4}&TIPO={5}",
dr("CveIE").ToString, dr("CveIE").ToString,
dr("CveVenta").ToString, dr("CveVenta").ToString,
respFactura.Factura.CveCliente, respFactura.Factura.CveCliente,
respFactura.CveVenta, respFactura.CveVenta,
respFactura.Factura.Total))}"">Imprimir Saldo Aplicado {dr("Folio").ToString}</a><br/>") respFactura.Factura.Total, dr("Tipo")))}"">Imprimir Saldo Aplicado {dr("Folio").ToString}</a><br/>")
Next Next
End If End If
@@ -1064,12 +1069,12 @@ Partial Class Ventas_PVCobranza
If respNC IsNot Nothing AndAlso respNC.Factura IsNot Nothing AndAlso respNC.Factura.DtAnticiposAplicados IsNot Nothing Then If respNC IsNot Nothing AndAlso respNC.Factura IsNot Nothing AndAlso respNC.Factura.DtAnticiposAplicados IsNot Nothing Then
For Each dr As DataRow In respNC.Factura.DtAnticiposAplicados.Rows For Each dr As DataRow In respNC.Factura.DtAnticiposAplicados.Rows
msBuild.AppendLine($"<br><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=AMORTIZACIONHIS&CVEIE={0}&CVEVENTA={1}&CVECLIENTE={2}&CVEVENTAAMORTIZADA={3}&MONTO={4}", msBuild.AppendLine($"<br><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=AMORTIZACIONHIS&CVEIE={0}&CVEVENTA={1}&CVECLIENTE={2}&CVEVENTAAMORTIZADA={3}&MONTO={4}&Tipo={5}",
dr("CveIE").ToString, dr("CveIE").ToString,
dr("CveVenta").ToString, dr("CveVenta").ToString,
respNC.Factura.CveCliente, respNC.Factura.CveCliente,
respNC.CveVenta, respNC.CveVenta,
respNC.Factura.Total))}"">Imprimir Saldo Aplicado {dr("Folio").ToString}</a><br/>") respNC.Factura.Total, dr("Tipo")))}"">Imprimir Saldo Aplicado {dr("Folio").ToString}</a><br/>")
Next Next
End If End If
@@ -1444,22 +1449,6 @@ Partial Class Ventas_PVCobranza
For Each msg In Retorno.Mensajes For Each msg In Retorno.Mensajes
SbAlert.AppendFormat("{0} <br/>", msg) SbAlert.AppendFormat("{0} <br/>", msg)
Next Next
SbAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF Factura</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", Retorno.CveVenta)))
For Each dr As DataRow In DtAnticipos.Rows
SBAmortizaciones.AppendLine($"<br><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=AMORTIZACIONHIS&CVEIE={0}&CVEVENTA={1}&CVECLIENTE={2}&CVEVENTAAMORTIZADA={3}&MONTO={4}&SALDO={5}",
dr("CveIE").ToString,
dr("CveVenta").ToString,
Retorno.Factura.CveCliente,
Retorno.CveVenta,
Retorno.Factura.Total,
(Retorno.Factura.Total - Retorno.Factura.DtAnticiposAplicados.SUM("Importe"))))}"">Imprimir historial {dr("Folio").ToString}</a><br/>")
Next
SbAlert.Append(SBAmortizaciones.ToString)
Else Else
SbAlert.Append("Ocurrió un error al generar la factura") SbAlert.Append("Ocurrió un error al generar la factura")
End If End If
@@ -2472,9 +2461,9 @@ Partial Class Ventas_PVCobranza
Dim AnticipoAutorizado = CBool(e.Row.DBCampo("AnticipoAutorizado")) Dim AnticipoAutorizado = CBool(e.Row.DBCampo("AnticipoAutorizado"))
'If Not EsProduccion AndAlso UsuarioActual.CveRol = 1 Then If Not EsProduccion AndAlso UsuarioActual.CveRol = 1 Then
' AnticipoAutorizado = True AnticipoAutorizado = True
'End If End If
If UsuarioActual.Empresa.Funcionalidad(185) = "1" Then If UsuarioActual.Empresa.Funcionalidad(185) = "1" Then
If e.Row.DBCampo("Tipo").ToString().Contiene("NC", "Ant", "IxC") AndAlso Not AnticipoAutorizado Then If e.Row.DBCampo("Tipo").ToString().Contiene("NC", "Ant", "IxC") AndAlso Not AnticipoAutorizado Then

View File

@@ -73,10 +73,10 @@ Partial Class Ventas_RepComisionesSMS
LnkExportar.Visible = False LnkExportar.Visible = False
Dim FechaIPago As Date = If(TxtFechaIPago.Text.ToDate < MinFecha, MinFecha, TxtFechaIPago.Text.ToDate) Dim FechaIPago As Date = If(TxtFechaIPago.Text.ToDate < MinFecha, MinFecha, TxtFechaIPago.Text.ToDate)
Dim FechaFPago As Date = If(TxtFechaFPago.Text.ToDate < MinFecha, MaxFecha, TxtFechaFPago.Text.ToDate) Dim FechaFPago As Date = If(TxtFechaFPago.Text.ToDate < MinFecha, MaxFecha, TxtFechaFPago.Text.ToDate)
Dim CveMarca As Integer = -1
Dim ObjVentas As New ClsVentas Dim ObjVentas As New ClsVentas
If ObjVentas.GetComisionesMedicasRep(txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, -1, -1, DdlMedico.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, DdlUsuarioAtendio.SelectedValue.ToEntero, UsuarioActual.CveUsuario, -1, FechaIPago, FechaFPago) Then If ObjVentas.GetComisionesMedicasRep(txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, -1, -1, DdlMedico.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, DdlUsuarioAtendio.SelectedValue.ToEntero, UsuarioActual.CveUsuario, -1, CveMarca, FechaIPago, FechaFPago) Then
GvDatos.DataSource = ObjVentas.DtResultados GvDatos.DataSource = ObjVentas.DtResultados
If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then

View File

@@ -103,7 +103,7 @@ Partial Class Ventas_RepVentasResumen
VxC = Nothing VxC = Nothing
End If End If
If ObjMovtos.GetRepRecuperacion(TxtFechaI.Text.ToDate, TxtFechaF.Text.ToDate, -1, DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, "-1", UsuarioActual.CveEmpresa, 5, -1, "-1", CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then If ObjMovtos.GetRepRecuperacion(TxtFechaI.Text.ToDate, TxtFechaF.Text.ToDate, MinFecha, MaxFecha, -1, DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, "-1", UsuarioActual.CveEmpresa, 5, -1, "-1", CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
Datos = ObjVentas.DtResultados Datos = ObjVentas.DtResultados
GvPxC.DataSource = Datos GvPxC.DataSource = Datos
Else Else

View File

@@ -1127,6 +1127,8 @@
</th> </th>
<th id="thPredial1" runat="server" visible="false">Predial <th id="thPredial1" runat="server" visible="false">Predial
</th> </th>
<th id="thCantConversion1" runat="server" visible="false">Ed. Med
</th>
<th id="thEncIVA1" runat="server" visible="true">IVA <th id="thEncIVA1" runat="server" visible="true">IVA
</th> </th>
<th id="thEncIEPS1" runat="server" visible="false">IEPS <th id="thEncIEPS1" runat="server" visible="false">IEPS
@@ -1260,6 +1262,8 @@
<th id="thPredial2" runat="server" visible="false"> <th id="thPredial2" runat="server" visible="false">
<asp:TextBox ID="TxtCuentaPredial" runat="server" Width="75px" CssClass="form-control input-sm" type="number"></asp:TextBox> <asp:TextBox ID="TxtCuentaPredial" runat="server" Width="75px" CssClass="form-control input-sm" type="number"></asp:TextBox>
</th> </th>
<th id="thCantConversion2" runat="server" visible="false">
</th>
<th id="thEncIVA2" runat="server" visible="true"></th> <th id="thEncIVA2" runat="server" visible="true"></th>
<th id="thEncIEPS2" runat="server" visible="false"></th> <th id="thEncIEPS2" runat="server" visible="false"></th>
<th id="thPoliza2" runat="server" visible="false"> <th id="thPoliza2" runat="server" visible="false">
@@ -1472,6 +1476,15 @@
</EditItemTemplate> </EditItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<%--13--%> <%--13--%>
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Right" Visible="False">
<ItemTemplate>
<asp:Literal ID="LtlCantidadConversion" runat="server" Text='<%# Eval("CantidadConversion", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtCantidadConversion" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("CantidadConversion", "{0:N2}") %>' Width="60px"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<%--14--%>
<asp:TemplateField ItemStyle-HorizontalAlign="Right"> <asp:TemplateField ItemStyle-HorizontalAlign="Right">
<ItemTemplate> <ItemTemplate>
<asp:Label ID="LblIVA" runat="server" Text='<%# Eval("ImporteIVA", "{0:#,##0.00##}") %>'></asp:Label><br /> <asp:Label ID="LblIVA" runat="server" Text='<%# Eval("ImporteIVA", "{0:#,##0.00##}") %>'></asp:Label><br />
@@ -1479,7 +1492,7 @@
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<%--<asp:BoundField DataField="ImporteIVA" HeaderText="" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ReadOnly="true" />--%> <%--<asp:BoundField DataField="ImporteIVA" HeaderText="" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ReadOnly="true" />--%>
<%--14--%> <%--15--%>
<asp:TemplateField ItemStyle-HorizontalAlign="Right"> <asp:TemplateField ItemStyle-HorizontalAlign="Right">
<ItemTemplate> <ItemTemplate>
<asp:Label ID="LblIEPS" runat="server" Text='<%# Eval("ImporteIEPS", "{0:#,##0.00##}") %>'></asp:Label><br /> <asp:Label ID="LblIEPS" runat="server" Text='<%# Eval("ImporteIEPS", "{0:#,##0.00##}") %>'></asp:Label><br />
@@ -1487,17 +1500,17 @@
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<%--<asp:BoundField DataField="ImporteIEPS" HeaderText="" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ReadOnly="true" Visible="false" />--%> <%--<asp:BoundField DataField="ImporteIEPS" HeaderText="" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ReadOnly="true" Visible="false" />--%>
<%--15--%>
<asp:BoundField DataField="ImporteRetIVA" HeaderText="Ret IVA" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ReadOnly="true" Visible="false" />
<%--16--%> <%--16--%>
<asp:BoundField DataField="ImporteRetISR" HeaderText="Ret ISR" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ReadOnly="true" Visible="false" /> <asp:BoundField DataField="ImporteRetIVA" HeaderText="Ret IVA" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ReadOnly="true" Visible="false" />
<%--17--%> <%--17--%>
<asp:BoundField DataField="ImporteRetISR" HeaderText="Ret ISR" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ReadOnly="true" Visible="false" />
<%--18--%>
<asp:TemplateField ItemStyle-HorizontalAlign="Right"> <asp:TemplateField ItemStyle-HorizontalAlign="Right">
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlTotal" runat="server" Text='<%# If(UsuarioActual.Empresa.Funcionalidad(109) = "1", Eval("TotalConImpuestos", "{0:#,##0.00##}"), Eval("TotalImporte", "{0:#,##0.00##}")) %>'></asp:Literal> <asp:Literal ID="LtlTotal" runat="server" Text='<%# If(UsuarioActual.Empresa.Funcionalidad(109) = "1", Eval("TotalConImpuestos", "{0:#,##0.00##}"), Eval("TotalImporte", "{0:#,##0.00##}")) %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<%--18--%> <%--19--%>
<asp:TemplateField ItemStyle-HorizontalAlign="Center"> <asp:TemplateField ItemStyle-HorizontalAlign="Center">
<EditItemTemplate> <EditItemTemplate>
<div style="width: 85px;"> <div style="width: 85px;">
@@ -1511,14 +1524,14 @@
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" /> CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<%--19--%> <%--20--%>
<asp:TemplateField ItemStyle-HorizontalAlign="Center"> <asp:TemplateField ItemStyle-HorizontalAlign="Center">
<ItemTemplate> <ItemTemplate>
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" <asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete"
CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="confirmar" data-btn-ok-label="si" /> CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="confirmar" data-btn-ok-label="si" />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<%--20--%> <%--21--%>
<asp:TemplateField ItemStyle-HorizontalAlign="Center"> <asp:TemplateField ItemStyle-HorizontalAlign="Center">
<ItemTemplate> <ItemTemplate>
<asp:LinkButton ID="LnkExistencias" runat="server" Visible="false" AlternateText="Ver Existencias" CausesValidation="False" CommandName="Existencias" CommandArgument='<%# GvPS.Rows.Count.ToString() %>' <asp:LinkButton ID="LnkExistencias" runat="server" Visible="false" AlternateText="Ver Existencias" CausesValidation="False" CommandName="Existencias" CommandArgument='<%# GvPS.Rows.Count.ToString() %>'
@@ -1529,7 +1542,7 @@
CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-clone'></i>" /> CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-clone'></i>" />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<%--21--%> <%--22--%>
<asp:TemplateField> <asp:TemplateField>
<HeaderTemplate> <HeaderTemplate>
<asp:LinkButton ID="LnkOrdenarGvPS" runat="server" CssClass="Texto" Text="<i class='fa fa-retweet'></i>" OnClick="OrdenarGvPS" /> <asp:LinkButton ID="LnkOrdenarGvPS" runat="server" CssClass="Texto" Text="<i class='fa fa-retweet'></i>" OnClick="OrdenarGvPS" />
@@ -1538,13 +1551,13 @@
<asp:TextBox ID="TxtOrden" runat="server" MaxLength="3" Type="number" Width="30px" Text='<%# Eval("Orden") %>' /> <asp:TextBox ID="TxtOrden" runat="server" MaxLength="3" Type="number" Width="30px" Text='<%# Eval("Orden") %>' />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<%--22--%> <%--23--%>
<asp:TemplateField HeaderText="Presupuesto de Ingreso" Visible="false"> <asp:TemplateField HeaderText="Presupuesto de Ingreso" Visible="false">
<ItemTemplate> <ItemTemplate>
<asp:DropDownList runat="server" ID="DdlFR" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="FuenteRecaudacionCodigoRubroIngreso" DataValueField="CvePresupuestoIngreso" Style="max-width: 100px;" OnSelectedIndexChanged="DdlFR_SelectedIndexChanged"></asp:DropDownList> <asp:DropDownList runat="server" ID="DdlFR" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="FuenteRecaudacionCodigoRubroIngreso" DataValueField="CvePresupuestoIngreso" Style="max-width: 100px;" OnSelectedIndexChanged="DdlFR_SelectedIndexChanged"></asp:DropDownList>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<%--23--%> <%--24--%>
<asp:BoundField DataField="TieneProntoPago" HeaderText="Pronto Pago" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" ReadOnly="true" Visible="false" /> <asp:BoundField DataField="TieneProntoPago" HeaderText="Pronto Pago" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" ReadOnly="true" Visible="false" />
</Columns> </Columns>
<RowStyle CssClass="Texto" /> <RowStyle CssClass="Texto" />

View File

@@ -21,15 +21,16 @@ Partial Class Ventas
#Region "Propiedades" #Region "Propiedades"
Private Const NumeroDecimales As Integer = 2 Private Const NumeroDecimales As Integer = 2
Dim ColumnaSubProyecto As Integer = 8
Dim ColumnaDescuento As Integer = 11 Dim ColumnaDescuento As Integer = 11
Dim ColumnaPredial As Integer = 12 Dim ColumnaPredial As Integer = 12
Dim ColumnaSubProyecto As Integer = 8 Dim ColumnaCantConversion As Integer = 13
Dim ColumnaIVA As Integer = 13 Dim ColumnaIVA As Integer = 14
Dim ColumnaIEPS As Integer = 14 Dim ColumnaIEPS As Integer = 15
Dim ColumnaRetIVA As Integer = 15 Dim ColumnaRetIVA As Integer = 16
Dim ColumnaRetISR As Integer = 16 Dim ColumnaRetISR As Integer = 17
Dim ColumnaEditar As Integer = 18 Dim ColumnaEditar As Integer = 19
Dim ColumnaEliminar As Integer = 19 Dim ColumnaEliminar As Integer = 20
'Factura de ventas 'Factura de ventas
Dim DTConceptos As DataTable Dim DTConceptos As DataTable
@@ -2744,7 +2745,7 @@ Partial Class Ventas
End If End If
AC.Dispose() AC.Dispose()
'columna de Fuente de recaudacion 'columna de Fuente de recaudacion
GvPS.Columns(22).Visible = True GvPS.Columns(23).Visible = True
nomostrar.Visible = True nomostrar.Visible = True
nomostrar2.Visible = True nomostrar2.Visible = True
'GvPS.Width = 1250 'GvPS.Width = 1250
@@ -5037,11 +5038,7 @@ Partial Class Ventas
CargaNCDT(Dr("CveVenta").ToString().ToEntero(), DbRowVenta("TipoDocto").ToString(), Dr("Importe").ToString().ToDecimal, Dr("FolioFiscal").ToString(), TC:=Dr("TipoCambio").ToString().ToDecimal) CargaNCDT(Dr("CveVenta").ToString().ToEntero(), DbRowVenta("TipoDocto").ToString(), Dr("Importe").ToString().ToDecimal, Dr("FolioFiscal").ToString(), TC:=Dr("TipoCambio").ToString().ToDecimal)
End If End If
Next Next
If GvNC.Rows.Count > 0 Then ImgAntiPend.Visible = False
If GvNC.Rows.Count > 0 Then
ImgAntiPend.Visible = False
End If
End If End If
End If End If
End If End If
@@ -5066,7 +5063,6 @@ Partial Class Ventas
ChkDevAlm.Enabled = False ChkDevAlm.Enabled = False
'LiDevolucionAlmacen.Visible = False 'LiDevolucionAlmacen.Visible = False
End If End If
End If End If
'SI ES COTIZACION PUEDE GENERAR UNA OC PARA MODIFICAR LOS IMPORTES 'SI ES COTIZACION PUEDE GENERAR UNA OC PARA MODIFICAR LOS IMPORTES
@@ -5093,6 +5089,11 @@ Partial Class Ventas
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
TxtAlfa1.Text = DbRowVenta("Alfa1").ToString TxtAlfa1.Text = DbRowVenta("Alfa1").ToString
If DbRowVenta("CveTipoVenta").ToString = "2" Then 'pago directo
GvPS.Columns(ColumnaCantConversion).Visible = True
thCantConversion1.Visible = True
thCantConversion2.Visible = True
End If
End If End If
'CARGAR PS 'CARGAR PS
@@ -5895,8 +5896,8 @@ Partial Class Ventas
End If End If
'Ocultamos los botones Clonar y Ordenar 'Ocultamos los botones Clonar y Ordenar
GvPS.Columns(20).Visible = False
GvPS.Columns(21).Visible = False GvPS.Columns(21).Visible = False
GvPS.Columns(22).Visible = False
thOrden.Visible = False thOrden.Visible = False
GvFirmas.DataSource = DTmpF GvFirmas.DataSource = DTmpF
@@ -6360,7 +6361,7 @@ Partial Class Ventas
Dim HabilitarExistencias As Boolean = False Dim HabilitarExistencias As Boolean = False
If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso DbRowVenta("TipoDocto").ToString().Contiene("Rem", "Cot") Then If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso DbRowVenta("TipoDocto").ToString().Contiene("Rem", "Cot") Then
HabilitarExistencias = True HabilitarExistencias = True
GvPS.Columns(20).Visible = True GvPS.Columns(21).Visible = True
End If End If
If HabilitarExistencias Then If HabilitarExistencias Then
@@ -8793,9 +8794,6 @@ Partial Class Ventas
Protected Sub GvPS_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvPS.RowDataBound Protected Sub GvPS_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvPS.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.Attributes("id") = e.Row.RowIndex.ToString() e.Row.Attributes("id") = e.Row.RowIndex.ToString()
If e.Row.RowIndex = 0 Then
End If
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
'MODO EDICION 'MODO EDICION
@@ -8838,9 +8836,7 @@ Partial Class Ventas
e.Row.FCDropDownList("DdlSubProyecto").DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, dr("CveProyecto").ToString().ToEntero(), UsuarioActual.CveEmpresa, -1, 1) e.Row.FCDropDownList("DdlSubProyecto").DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, dr("CveProyecto").ToString().ToEntero(), UsuarioActual.CveEmpresa, -1, 1)
e.Row.FCDropDownList("DdlSubProyecto").DataBind() e.Row.FCDropDownList("DdlSubProyecto").DataBind()
e.Row.FCDropDownList("DdlSubProyecto").SelectedValueExist(e.Row.DBCampo("CveSubProyecto")) e.Row.FCDropDownList("DdlSubProyecto").SelectedValueExist(e.Row.DBCampo("CveSubProyecto"))
End If End If
End If End If
If UsuarioActual.TienePermisoProceso(68) OrElse UsuarioActual.Empresa.Funcionalidad(109) = "1" Then If UsuarioActual.TienePermisoProceso(68) OrElse UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
@@ -8848,7 +8844,6 @@ Partial Class Ventas
e.Row.FCTextBox("TxtDescuento").Enabled = False e.Row.FCTextBox("TxtDescuento").Enabled = False
End If End If
If Not EsCreaApartirDe Then If Not EsCreaApartirDe Then
'Si es una devolucion 'Si es una devolucion
If NuevaFactura = 0 Then If NuevaFactura = 0 Then
@@ -8906,7 +8901,6 @@ Partial Class Ventas
e.Row.FCDropDownList("DdlPrecioListaEdit").DataBind() e.Row.FCDropDownList("DdlPrecioListaEdit").DataBind()
e.Row.FCDropDownList("DdlPrecioListaEdit").SelectedValueExist(e.Row.DBCampo("CvePrecioLista")) e.Row.FCDropDownList("DdlPrecioListaEdit").SelectedValueExist(e.Row.DBCampo("CvePrecioLista"))
End If End If
End If End If
'Si es facturacion de OC o Contrato 'Si es facturacion de OC o Contrato
@@ -8950,7 +8944,6 @@ Partial Class Ventas
e.Row.FCTextBox("TxtPrecio").Enabled = False e.Row.FCTextBox("TxtPrecio").Enabled = False
End If End If
'PERMISO EDITAR REM 'PERMISO EDITAR REM
If e.Row.DBCampo("TipoDocto") = "Rem" And ModalidadEdicion Then If e.Row.DBCampo("TipoDocto") = "Rem" And ModalidadEdicion Then
'LO PERMITIDO MODIFICAR 'LO PERMITIDO MODIFICAR
@@ -8983,9 +8976,8 @@ Partial Class Ventas
e.Row.FCLabel("LblTurnoEditar").Visible = True e.Row.FCLabel("LblTurnoEditar").Visible = True
e.Row.FCTextBox("TxtNumTurnosEditar").Visible = True e.Row.FCTextBox("TxtNumTurnosEditar").Visible = True
End If End If
'LA COLUMNA DE ELIMINACION NO DEBE ESTAR VISIBLE EN EL MODO EDICION 'LA COLUMNA DE ELIMINACION NO DEBE ESTAR VISIBLE EN EL MODO EDICION
If GvPS.Columns(19).Visible Then If GvPS.Columns(20).Visible Then
e.Row.FCLinkButton("imgD").Visible = False e.Row.FCLinkButton("imgD").Visible = False
End If End If
@@ -9115,7 +9107,6 @@ Partial Class Ventas
End If End If
End If End If
If DdlTipoComprobante.SelectedValue.Contiene("Cot") Then If DdlTipoComprobante.SelectedValue.Contiene("Cot") Then
e.Row.FCHyperLink("HLPS").Visible = True e.Row.FCHyperLink("HLPS").Visible = True
e.Row.FCLabel("LblPS").Visible = False e.Row.FCLabel("LblPS").Visible = False
@@ -9124,7 +9115,6 @@ Partial Class Ventas
e.Row.FCHyperLink("HLPS").Visible = False e.Row.FCHyperLink("HLPS").Visible = False
e.Row.FCLabel("LblPS").Visible = True e.Row.FCLabel("LblPS").Visible = True
End If End If
End If End If
If CveVenta <= 0 Then If CveVenta <= 0 Then
@@ -9240,7 +9230,7 @@ Partial Class Ventas
OrdenarPS() OrdenarPS()
If GvPS.Columns(21).Visible Then If GvPS.Columns(22).Visible Then
For Each GvRow As GridViewRow In GvPS.Rows For Each GvRow As GridViewRow In GvPS.Rows
If GvRow.RowType = DataControlRowType.Header Then If GvRow.RowType = DataControlRowType.Header Then
@@ -9266,6 +9256,7 @@ Partial Class Ventas
Dim Cantidad, PU As Decimal Dim Cantidad, PU As Decimal
Dim ObjDescuento As New Modelos.VentaDescuentos Dim ObjDescuento As New Modelos.VentaDescuentos
Dim CuentaPredial As String Dim CuentaPredial As String
Dim CantidadConversion As Decimal = GvPS.Rows(e.RowIndex).FCTextBox("TxtCantidadConversion").Text.Trim.ToDecimal
Cantidad = GvPS.Rows(e.RowIndex).FCTextBox("TxtCantidad").Text.ToDecimal Cantidad = GvPS.Rows(e.RowIndex).FCTextBox("TxtCantidad").Text.ToDecimal
PU = (GvPS.Rows(e.RowIndex).FCTextBox("TxtPrecio").Text.ToDecimal).RoundSQL(6) PU = (GvPS.Rows(e.RowIndex).FCTextBox("TxtPrecio").Text.ToDecimal).RoundSQL(6)
@@ -9332,11 +9323,9 @@ Partial Class Ventas
If ObjPrecioSugerido IsNot Nothing AndAlso ObjPrecioSugerido.PrecioSugerido > 0 Then If ObjPrecioSugerido IsNot Nothing AndAlso ObjPrecioSugerido.PrecioSugerido > 0 Then
PU = ObjPrecioSugerido.PrecioSugerido PU = ObjPrecioSugerido.PrecioSugerido
End If End If
End If End If
End If End If
If RecalcularPromociones Then If RecalcularPromociones Then
ObjDescuento = CalcularDescuentos(CvePSNuevo, Cantidad, PU) ObjDescuento = CalcularDescuentos(CvePSNuevo, Cantidad, PU)
@@ -9410,13 +9399,11 @@ Partial Class Ventas
If GvPS.Rows(e.RowIndex).FCDropDownList("DdlPrecioListaEdit").SelectedItem IsNot Nothing Then If GvPS.Rows(e.RowIndex).FCDropDownList("DdlPrecioListaEdit").SelectedItem IsNot Nothing Then
PrecioLista = GvPS.Rows(e.RowIndex).FCDropDownList("DdlPrecioListaEdit").SelectedItem.Text PrecioLista = GvPS.Rows(e.RowIndex).FCDropDownList("DdlPrecioListaEdit").SelectedItem.Text
End If End If
End If End If
End If End If
Dim SubProyecto As String = "" Dim SubProyecto As String = ""
Dim CveSubProyecto As Integer = -1 Dim CveSubProyecto As Integer = -1
Dim Proyecto As String = "" Dim Proyecto As String = ""
Dim CveProyecto As Integer = -1 Dim CveProyecto As Integer = -1
@@ -9445,7 +9432,7 @@ Partial Class Ventas
CveProyecto, Proyecto, CveProyecto, Proyecto,
CveSubProyecto, SubProyecto, CveSubProyecto, SubProyecto,
CuentaPredial:=CuentaPredial, CveVentaDetalle:=GvPS.Rows(e.RowIndex).DataKey("CveVentaDetalle").ToString().ToEntero(), SeActualiza:=True, CvePromocionDetalle:=ObjDescuento.CvePromocionDetalle, CuentaPredial:=CuentaPredial, CveVentaDetalle:=GvPS.Rows(e.RowIndex).DataKey("CveVentaDetalle").ToString().ToEntero(), SeActualiza:=True, CvePromocionDetalle:=ObjDescuento.CvePromocionDetalle,
ObjDescuento:=ObjDescuento, NumTurnos:=NumTurnos, CvePrecioLista:=CvePrecioLista, PrecioLista:=PrecioLista, ConsecutivoManual:=ConsecutivoActual, OrdenManual:=OrdenOriginal) ObjDescuento:=ObjDescuento, NumTurnos:=NumTurnos, CvePrecioLista:=CvePrecioLista, PrecioLista:=PrecioLista, CantidadConversion:=CantidadConversion, ConsecutivoManual:=ConsecutivoActual, OrdenManual:=OrdenOriginal)
' TmpDT.Rows(e.RowIndex)("CveUM") = Ddl.SelectedValue ' TmpDT.Rows(e.RowIndex)("CveUM") = Ddl.SelectedValue
' TmpDT.Rows(e.RowIndex)("UM") = Ddl.SelectedItem.Text ' TmpDT.Rows(e.RowIndex)("UM") = Ddl.SelectedItem.Text
@@ -9509,6 +9496,7 @@ Partial Class Ventas
TmpDT.Rows(e.RowIndex)("PorcentajeRetIVA") = ClienteRetIVA TmpDT.Rows(e.RowIndex)("PorcentajeRetIVA") = ClienteRetIVA
TmpDT.Rows(e.RowIndex)("PorcentajeRetISR") = ClienteRetISR TmpDT.Rows(e.RowIndex)("PorcentajeRetISR") = ClienteRetISR
TmpDT.Rows(e.RowIndex)("CuentaPredial") = CuentaPredial TmpDT.Rows(e.RowIndex)("CuentaPredial") = CuentaPredial
TmpDT.Rows(e.RowIndex)("CantidadConversion") = CantidadConversion
TmpDT.Rows(e.RowIndex)("TotalConImpuestos") = (TmpDT.Rows(e.RowIndex)("Total").ToString().ToDecimal() - TmpDT.Rows(e.RowIndex)("Descuento").ToString().ToDecimal() + TmpDT.Rows(e.RowIndex)("ImporteIVA").ToString().ToDecimal()).RoundSQL(2) TmpDT.Rows(e.RowIndex)("TotalConImpuestos") = (TmpDT.Rows(e.RowIndex)("Total").ToString().ToDecimal() - TmpDT.Rows(e.RowIndex)("Descuento").ToString().ToDecimal() + TmpDT.Rows(e.RowIndex)("ImporteIVA").ToString().ToDecimal()).RoundSQL(2)
@@ -9558,7 +9546,6 @@ Partial Class Ventas
TmpDT.Rows(e.RowIndex)("CveSubProyecto") = DdlSubProyectoDatos.SelectedValue.ToEntero() TmpDT.Rows(e.RowIndex)("CveSubProyecto") = DdlSubProyectoDatos.SelectedValue.ToEntero()
End If End If
'RELACIONAL PS CON EL DESCUENTO 'RELACIONAL PS CON EL DESCUENTO
If ObjDescuento IsNot Nothing Then If ObjDescuento IsNot Nothing Then
ObjDescuento.Consec = TmpDT.Rows(e.RowIndex)("Consec").ToString().ToEntero() ObjDescuento.Consec = TmpDT.Rows(e.RowIndex)("Consec").ToString().ToEntero()
@@ -9566,12 +9553,12 @@ Partial Class Ventas
'RECALCULA LA CANTIDAD DE CONVERSION 'RECALCULA LA CANTIDAD DE CONVERSION
If CantidadOriginal <> Cantidad Then If CantidadOriginal <> Cantidad Then
Dim CantidadConversion As Decimal = TmpDT.Rows(e.RowIndex)("CantidadConversion").ToString().ToDecimal()
If AplicaComercioExterior Then If AplicaComercioExterior Then
'SI NO VIENE DE MANIFIESTO UTILIZA EL PESO DEL PRODUCTO 'SI NO VIENE DE MANIFIESTO UTILIZA EL PESO DEL PRODUCTO
If Request("CveManifiesto") Is Nothing Then If Request("CveManifiesto") Is Nothing Then
If DrPS("PesoKg").ToString().ToDecimal() > 0 Then If DrPS("PesoKg").ToString().ToDecimal() > 0 Then
CantidadConversion = Cantidad * DrPS("PesoKg").ToString().ToDecimal() CantidadConversion = Cantidad * DrPS("PesoKg").ToString.ToDecimal()
Else Else
CantidadConversion = Cantidad CantidadConversion = Cantidad
End If End If
@@ -9616,7 +9603,7 @@ Partial Class Ventas
'JJMQ 20160506: Se agrego para la validacion de pago de contado. 'JJMQ 20160506: Se agrego para la validacion de pago de contado.
'CVImporteContado.ValueToCompare = TxtTotal.Text.Replace(",", "") 'CVImporteContado.ValueToCompare = TxtTotal.Text.Replace(",", "")
If GvPS.Columns(21).Visible Then If GvPS.Columns(22).Visible Then
For Each GvRow As GridViewRow In GvPS.Rows For Each GvRow As GridViewRow In GvPS.Rows
If GvRow.RowType = DataControlRowType.Header Then If GvRow.RowType = DataControlRowType.Header Then
GvRow.FCLinkButton("LnkOrdenarGvPS").Visible = True GvRow.FCLinkButton("LnkOrdenarGvPS").Visible = True
@@ -14885,7 +14872,7 @@ Partial Class Ventas
CveContratoDetalle:=Row("CveContratoDetalle").ToString().ToEntero(), CvePromocionDetalle:=Row("CvePromocionDetalle").ToString().ToEntero(), IEPS:=Row("ImporteIEPS").ToString().ToDecimal, CveMovimientoDetallePedido:=Row("CveMovimientoDetallePedido").ToString().ToEntero(), ImporteRetIVA:=Row("ImporteRetIVA").ToString().ToDecimal, ImporteRetISR:=Row("ImporteRetISR").ToString().ToDecimal, CveContratoDetalle:=Row("CveContratoDetalle").ToString().ToEntero(), CvePromocionDetalle:=Row("CvePromocionDetalle").ToString().ToEntero(), IEPS:=Row("ImporteIEPS").ToString().ToDecimal, CveMovimientoDetallePedido:=Row("CveMovimientoDetallePedido").ToString().ToEntero(), ImporteRetIVA:=Row("ImporteRetIVA").ToString().ToDecimal, ImporteRetISR:=Row("ImporteRetISR").ToString().ToDecimal,
PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDecimal, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString().ToDecimal, PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDecimal, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString().ToDecimal,
PorcentajeRetISR:=Row("PorcentajeRetISR").ToString().ToDecimal, CuentaPredial:=Row("CuentaPredial").ToString(), CvePrecioLista:=Row("CvePrecioLista").ToString().ToEntero(), PorcentajeRetISR:=Row("PorcentajeRetISR").ToString().ToDecimal, CuentaPredial:=Row("CuentaPredial").ToString(), CvePrecioLista:=Row("CvePrecioLista").ToString().ToEntero(),
CveActivoFijo:=Row("CveActivoFijo").ToString().ToEntero(), NumTurnos:=Row("NumTurnos").ToString().ToDecimal(), EstatusAlmacen:=EsatusAlmacen, CantidadConversion:=Row("CantidadConversion").ToString().ToDecimal()) Then CveActivoFijo:=Row("CveActivoFijo").ToString().ToEntero(), NumTurnos:=Row("NumTurnos").ToString().ToDecimal(), EstatusAlmacen:=EsatusAlmacen, CantidadConversion:=Row("CantidadConversion").ToString.ToDecimal()) Then
ErrorList.Add("Ocurrió un error al agregar un Producto o Servicio a la Factura.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico") ErrorList.Add("Ocurrió un error al agregar un Producto o Servicio a la Factura.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
Exit For Exit For
Else Else
@@ -21255,7 +21242,7 @@ Partial Class Ventas
Row("TieneProntoPago") = "Si" Row("TieneProntoPago") = "Si"
'SOLO DEBE MOSTRASE SI EL PAGO ES DE CONTADO 'SOLO DEBE MOSTRASE SI EL PAGO ES DE CONTADO
If RBLPago.SelectedValue = "2" Then If RBLPago.SelectedValue = "2" Then
GvPS.Columns(23).Visible = True GvPS.Columns(24).Visible = True
thProntoPago.Visible = True thProntoPago.Visible = True
thProntoPago2.Visible = True thProntoPago2.Visible = True
End If End If
@@ -24551,7 +24538,7 @@ Partial Class Ventas
TxtAtencionA.Enabled = True TxtAtencionA.Enabled = True
GvPS.Columns(21).Visible = True GvPS.Columns(22).Visible = True
thOrden.Visible = True thOrden.Visible = True
Dim HabilitarExistencias As Boolean = False Dim HabilitarExistencias As Boolean = False
@@ -24716,7 +24703,8 @@ Partial Class Ventas
For Each Row As DataRow In TmpDT.Rows For Each Row As DataRow In TmpDT.Rows
Dim CveVentaDetalle As Integer = Row("CveVentaDetalle").ToString().ToEntero() Dim CveVentaDetalle As Integer = Row("CveVentaDetalle").ToString().ToEntero()
If CveVentaDetalle > 0 Then If CveVentaDetalle > 0 Then
If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalle").ToString().ToEntero(), Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDecimal, Row("PU").ToString().ToDecimal(), Row("ImporteIEPS").ToString().ToDecimal(), Row("PorcentajeIEPS").ToString().ToDecimal(), Row("ImporteIVA").ToString().ToDecimal(), Row("PorcentajeIVA").ToString().ToDecimal(), Row("Descuento").ToString().ToDecimal(), Row("Obs").ToString(), UsuarioActual.CveUsuario, CvePromocionDetalle:=Row("CvePromocionDetalle").ToString().ToEntero()) Then If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalle").ToString().ToEntero(), Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDecimal, Row("PU").ToString().ToDecimal(), Row("ImporteIEPS").ToString().ToDecimal(), Row("PorcentajeIEPS").ToString().ToDecimal(), Row("ImporteIVA").ToString().ToDecimal(), Row("PorcentajeIVA").ToString().ToDecimal(), Row("Descuento").ToString().ToDecimal(), Row("Obs").ToString(), UsuarioActual.CveUsuario,
CvePromocionDetalle:=Row("CvePromocionDetalle").ToString().ToEntero(), CantidadConversion:=Row("CantidadConversion").ToString.ToDecimal()) Then
OcurrioError = True OcurrioError = True
Exit For Exit For
End If End If
@@ -25217,11 +25205,11 @@ Partial Class Ventas
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
If RBLPago.SelectedValue = "2" Then If RBLPago.SelectedValue = "2" Then
GvPS.Columns(23).Visible = True GvPS.Columns(24).Visible = True
thProntoPago.Visible = True thProntoPago.Visible = True
thProntoPago2.Visible = True thProntoPago2.Visible = True
Else Else
GvPS.Columns(23).Visible = False GvPS.Columns(24).Visible = False
thProntoPago.Visible = False thProntoPago.Visible = False
thProntoPago2.Visible = False thProntoPago2.Visible = False
End If End If
@@ -28579,9 +28567,9 @@ Partial Class Ventas
'Ocultamos los botones Editar, Clonar y Ordenar 'Ocultamos los botones Editar, Clonar y Ordenar
GvPS.Columns(18).Visible = False GvPS.Columns(19).Visible = False
GvPS.Columns(20).Visible = False
GvPS.Columns(21).Visible = False GvPS.Columns(21).Visible = False
GvPS.Columns(22).Visible = False
thOrden.Visible = False thOrden.Visible = False
DdlVendedor.SelectedValue = DbRowVenta("CveVendedor").ToString() DdlVendedor.SelectedValue = DbRowVenta("CveVendedor").ToString()
@@ -33162,10 +33150,10 @@ Partial Class Ventas
'REINICIALIZA GENERALES PS 'REINICIALIZA GENERALES PS
LbAgregar.Visible = False LbAgregar.Visible = False
GvPS.Columns(18).Visible = False
GvPS.Columns(19).Visible = False GvPS.Columns(19).Visible = False
GvPS.Columns(20).Visible = False GvPS.Columns(20).Visible = False
GvPS.Columns(21).Visible = False GvPS.Columns(21).Visible = False
GvPS.Columns(22).Visible = False
thOrden.Visible = False thOrden.Visible = False
DivRemisionesFacturadas.Visible = False DivRemisionesFacturadas.Visible = False
@@ -33858,7 +33846,7 @@ Partial Class Ventas
End If End If
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
GvPS.Columns(20).Visible = True GvPS.Columns(21).Visible = True
End If End If
'ECONO, SOLO EL CLIENTE SIGI, PUEDE MODIFICAR EL IVA A 16% 'ECONO, SOLO EL CLIENTE SIGI, PUEDE MODIFICAR EL IVA A 16%
@@ -33880,14 +33868,14 @@ Partial Class Ventas
imgCalendario.Visible = False imgCalendario.Visible = False
End If End If
GvPS.Columns(21).Visible = True GvPS.Columns(22).Visible = True
thOrden.Visible = True thOrden.Visible = True
Dim HabilitarExistencias As Boolean = False Dim HabilitarExistencias As Boolean = False
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
HabilitarExistencias = True HabilitarExistencias = True
GvPS.Columns(20).Visible = True GvPS.Columns(21).Visible = True
End If End If
For Each GvRow As GridViewRow In GvPS.Rows For Each GvRow As GridViewRow In GvPS.Rows
@@ -35725,8 +35713,8 @@ Partial Class Ventas
DdlLineaAdicional_SelectedIndexChanged(DdlLineaAdicional, EventArgs.Empty) DdlLineaAdicional_SelectedIndexChanged(DdlLineaAdicional, EventArgs.Empty)
'HABILITA EDITAR Y ELIMINAR DEL GV 'HABILITA EDITAR Y ELIMINAR DEL GV
GvPS.Columns(18).Visible = True
GvPS.Columns(19).Visible = True GvPS.Columns(19).Visible = True
GvPS.Columns(20).Visible = True
SetPermisos() SetPermisos()
@@ -37408,7 +37396,7 @@ Partial Class Ventas
End If End If
AC.Dispose() AC.Dispose()
'columna de Fuente de recaudacion 'columna de Fuente de recaudacion
GvPS.Columns(22).Visible = True GvPS.Columns(23).Visible = True
nomostrar.Visible = True nomostrar.Visible = True
nomostrar2.Visible = True nomostrar2.Visible = True
'GvPS.Width = 1250 'GvPS.Width = 1250
@@ -40266,6 +40254,13 @@ Partial Class Ventas
Alert("Debe de seleccionar un hospital.", TipoMensaje.MsgAdvertencia) Alert("Debe de seleccionar un hospital.", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If End If
'activa la columna para especificar el precio
GvPS.Columns(ColumnaCantConversion).Visible = True
thCantConversion1.Visible = True
thCantConversion2.Visible = True
thCantConversion1.InnerText = "Ed. Med"
Else Else
If DdlClienteSucursalCliente() > 0 Then If DdlClienteSucursalCliente() > 0 Then
ViewState("CveCliente") = DdlClienteSucursalCliente() ViewState("CveCliente") = DdlClienteSucursalCliente()
@@ -40376,12 +40371,13 @@ Partial Class Ventas
Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero
Dim EdMedica As Decimal = 0 Dim EdMedica As Decimal = 0
If RBLTipoVenta.SelectedValue = "2" Then EdMedica = GvRow.FCTextBox("TxtEdMedica").Text.ToDecimal If RBLTipoVenta.SelectedValue = "2" Then EdMedica = GvRow.FCTextBox("TxtEdMedica").Text.ToDecimal
'tomamos la columna de predial, para el uso de ed médica
If Cantidad > 0 Then If Cantidad > 0 Then
If AgregarProductoServicio(Cantidad, CveUnidadMedida, Abreviatura, CveClasificacion, Clasificacion, If AgregarProductoServicio(Cantidad, CveUnidadMedida, Abreviatura, CveClasificacion, Clasificacion,
CvePS, "", TxtObsPS.Text.TrimEnd, PU, 0, CvePS, "", TxtObsPS.Text.TrimEnd, PU, 0,
DdlProyecto.SelectedValue.ToEntero(), DdlProyecto.SelectedItem.Text, DdlSubProyecto.SelectedValue.ToEntero(), DdlSubProyecto.SelectedItem.Text, DdlProyecto.SelectedValue.ToEntero(), DdlProyecto.SelectedItem.Text, DdlSubProyecto.SelectedValue.ToEntero(), DdlSubProyecto.SelectedItem.Text,
Serie:=If(DIVCod.Visible, TxtCodigoSerie.Text.Trim, ""), TiempoEntrega:=TxtTiempoEntrega.Text, CuentaPredial:=TxtCuentaPredial.Text.Trim, RegeneraIEPS:=ClienteDesglosaIEPS, CvePromocionDetalle:=-1, Serie:=If(DIVCod.Visible, TxtCodigoSerie.Text.Trim, ""), TiempoEntrega:=TxtTiempoEntrega.Text, CuentaPredial:="", RegeneraIEPS:=ClienteDesglosaIEPS, CvePromocionDetalle:=-1,
ImporteProntoPago:=0, ObjDescuento:=Nothing, CvePrecioLista:=-1, PrecioLista:="", NumTurnos:=0, CantidadConversion:=EdMedica) Then ImporteProntoPago:=0, ObjDescuento:=Nothing, CvePrecioLista:=-1, PrecioLista:="", NumTurnos:=0, CantidadConversion:=EdMedica) Then
CountPsAgregados = CountPsAgregados + 1 CountPsAgregados = CountPsAgregados + 1
Else Else