Merge branch 'master' of http://agonzalez@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -4609,26 +4609,10 @@ Public Class ClsContabilidad
|
|||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
Public Function GetMonedas() As Boolean
|
Public Function GetAgrupadoresSAT() As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
DataAdapter(" SELECT * FROM Monedas ".ToString, CommandType.Text)
|
DataAdapter("PA_Conta_AgrupadoresSATGet")
|
||||||
|
|
||||||
Try
|
|
||||||
SqlAdapter.Fill(Data)
|
|
||||||
Retorno = True
|
|
||||||
Catch ex As Exception
|
|
||||||
OnError("Ocurrió un error al consultar las Monedas.", ex)
|
|
||||||
End Try
|
|
||||||
|
|
||||||
Return Retorno
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Public Function GetAgrupadoresSAT(CveEmpresa As Integer) As Boolean
|
|
||||||
Dim Retorno As Boolean = False
|
|
||||||
|
|
||||||
DataAdapter(" SELECT CveAgrupadorSAT, Codigo + REPLICATE(' ', 10 - len(Codigo)) + ' - ' + Nombre AS CodigoNombre FROM AgrupadoresSAT where CveEmpresa= '" & CveEmpresa & "'", CommandType.Text)
|
|
||||||
|
|
||||||
Try
|
Try
|
||||||
SqlAdapter.Fill(Data)
|
SqlAdapter.Fill(Data)
|
||||||
Retorno = True
|
Retorno = True
|
||||||
|
|||||||
@@ -1175,7 +1175,7 @@ Public Class ClsPaginas
|
|||||||
ObjPS.Dispose()
|
ObjPS.Dispose()
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
Public Property GlobalDTPSSimplificado(CveEmpresa As Integer, Optional CveClasificacion As Integer = -1, Optional PSCodigo As String = "-1", Optional Estatus As Integer = 1, Optional AplicaParaVenta As Integer = -1) As DataTable
|
Public Property GlobalDTPSSimplificado(CveEmpresa As Integer, Optional CveClasificacion As Integer = -1, Optional PSCodigo As String = "-1", Optional Estatus As Integer = 1, Optional AplicaParaVenta As Integer = -1, Optional CvePS As Integer = -1) As DataTable
|
||||||
Get
|
Get
|
||||||
Dim AppNombre As String = String.Format("GlobalDTPSSimplificado{0}", CveEmpresa)
|
Dim AppNombre As String = String.Format("GlobalDTPSSimplificado{0}", CveEmpresa)
|
||||||
If CveEmpresa <> -1 Then
|
If CveEmpresa <> -1 Then
|
||||||
@@ -1195,6 +1195,7 @@ Public Class ClsPaginas
|
|||||||
If PSCodigo <> "-1" Then Cons = Cons.Where((Function(a) Convert.ToString(a!PSCodigo) = PSCodigo))
|
If PSCodigo <> "-1" Then Cons = Cons.Where((Function(a) Convert.ToString(a!PSCodigo) = PSCodigo))
|
||||||
If Estatus >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEstado) = Estatus))
|
If Estatus >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEstado) = Estatus))
|
||||||
If AplicaParaVenta >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!AplicaParaVenta) = AplicaParaVenta))
|
If AplicaParaVenta >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!AplicaParaVenta) = AplicaParaVenta))
|
||||||
|
If CvePS >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CvePS) = CvePS))
|
||||||
|
|
||||||
Try
|
Try
|
||||||
GlobalDTPSSimplificado = Cons.OrderBy(Function(a) a!PSCodigo).CopyToDataTable
|
GlobalDTPSSimplificado = Cons.OrderBy(Function(a) a!PSCodigo).CopyToDataTable
|
||||||
|
|||||||
@@ -529,6 +529,24 @@ Public Class ClsVentas
|
|||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
Public Function GetPagos(CveVenta As Integer, CveEmpresa As Integer) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
DataAdapter("PA_Vta_VentasPagosGet")
|
||||||
|
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al obtener el Pago de la Venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
Public Function RemoveVta_VentaPago(CveVenta As Integer, CveMetodoPago As Integer) As Boolean
|
Public Function RemoveVta_VentaPago(CveVenta As Integer, CveMetodoPago As Integer) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
DataAdapter("PA_Vta_VentasPagoRemove")
|
DataAdapter("PA_Vta_VentasPagoRemove")
|
||||||
@@ -2786,7 +2804,7 @@ Public Class ClsVentas
|
|||||||
Try
|
Try
|
||||||
|
|
||||||
Dim objServicio As Cancelacion.CancelacionSoapClient = New Cancelacion.CancelacionSoapClient()
|
Dim objServicio As Cancelacion.CancelacionSoapClient = New Cancelacion.CancelacionSoapClient()
|
||||||
Dim resp As Cancelacion.StructCancel = objServicio.ObtienePendientes(RFC, "UserTest", "1234567890")
|
Dim resp As Cancelacion.StructCancel = objServicio.ObtienePendientes(RFC, "UserTest", "1234567890")
|
||||||
If resp.Estado = 0 Then
|
If resp.Estado = 0 Then
|
||||||
Dim XmlPendientes As String = System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(resp.Xml))
|
Dim XmlPendientes As String = System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(resp.Xml))
|
||||||
Dim theReader As IO.StringReader = New IO.StringReader(XmlPendientes)
|
Dim theReader As IO.StringReader = New IO.StringReader(XmlPendientes)
|
||||||
|
|||||||
@@ -4001,7 +4001,7 @@ Namespace Modelos
|
|||||||
Dim TieneAlmacen As Boolean = False
|
Dim TieneAlmacen As Boolean = False
|
||||||
|
|
||||||
'VALIDA QUE LA FACTURA NO TENGA PAGOS
|
'VALIDA QUE LA FACTURA NO TENGA PAGOS
|
||||||
If ObjFactura.TipoDocto.Contiene("Ing", "Rem") AndAlso ObjFactura.Pagado > 0 Then
|
If Not EsRefacturacion 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."
|
Retorno.Mensaje = "La factura no se puede cancelar debido a que tiene pagos vinculados."
|
||||||
Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia
|
Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia
|
||||||
|
|
||||||
@@ -4033,7 +4033,7 @@ Namespace Modelos
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If ObjFactura.TipoDocto = "Ant" AndAlso ObjFactura.SaldoAmortizado > 0 Then
|
If ObjFactura.TipoDocto = "Ant" AndAlso ObjFactura.SaldoAmortizado > 0 Then
|
||||||
Retorno.Mensaje = "La factura no se puede cancelar debido a que tiene pagos vinculados."
|
Retorno.Mensaje = "La factura no se puede cancelar debido a que el anticipo ha sido amortizado."
|
||||||
Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia
|
Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia
|
||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
|
|||||||
@@ -380,7 +380,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
|||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If usuario.Empresa.Funcionalidad(558) = "1" Then
|
If usuario.Empresa.Funcionalidad(558) = "1" AndAlso DtPSRetorno IsNot Nothing Then
|
||||||
Try
|
Try
|
||||||
Dim NombreFiltroColumna As String = DtPSRetorno.Columns(3).ColumnName
|
Dim NombreFiltroColumna As String = DtPSRetorno.Columns(3).ColumnName
|
||||||
DtPSRetorno = DtPSRetorno.FiltraParametros("", String.Format("{0} DESC,PSCodigo", NombreFiltroColumna))
|
DtPSRetorno = DtPSRetorno.FiltraParametros("", String.Format("{0} DESC,PSCodigo", NombreFiltroColumna))
|
||||||
|
|||||||
@@ -16717,7 +16717,7 @@ Partial Class Compras_Compras
|
|||||||
Dim DiferenciaPermitida = 0.6
|
Dim DiferenciaPermitida = 0.6
|
||||||
|
|
||||||
If Math.Abs(DifTotales) > DiferenciaPermitida Then
|
If Math.Abs(DifTotales) > DiferenciaPermitida Then
|
||||||
Alert("Los importes de los conceptos (Productos/Servicios) no cuadran con el total. Por favor verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
|
Alert(String.Format("Los importes de los conceptos (Productos/Servicios) no cuadran con el total. Por favor verifique y vuelva a intentar.[{0}]", Math.Abs(DifTotales) - DiferenciaPermitida), TipoMensaje.MsgAdvertencia)
|
||||||
EsValido = False
|
EsValido = False
|
||||||
ElseIf DifTotales <> 0 Then
|
ElseIf DifTotales <> 0 Then
|
||||||
TxtSubTotal2.Text = (TxtSubTotal2.Text.ToDouble + DifTotales).ToString
|
TxtSubTotal2.Text = (TxtSubTotal2.Text.ToDouble + DifTotales).ToString
|
||||||
|
|||||||
@@ -53,21 +53,21 @@ public partial class Contabilidad_ContabilizacionCompras : ClsPaginas
|
|||||||
|
|
||||||
//DdlProveedores.DataSource = get_GlobalDTCompProveedores(UsuarioActual.CveEmpresa);
|
//DdlProveedores.DataSource = get_GlobalDTCompProveedores(UsuarioActual.CveEmpresa);
|
||||||
//DdlProveedores.DataBind();
|
//DdlProveedores.DataBind();
|
||||||
|
|
||||||
DdlPersonal.DataSource = get_GlobalDTRHPersonal(UsuarioActual.CveEmpresa);
|
|
||||||
DdlPersonal.DataBind();
|
|
||||||
|
|
||||||
DdlPlantillasPolizas.DataSource = get_GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa);
|
|
||||||
DdlPlantillasPolizas.Items.Insert(0, new ListItem("Todos", "-1"));
|
|
||||||
DdlPlantillasPolizas.DataBind();
|
|
||||||
|
|
||||||
txtFechaI.Text = DateTime.Now.FirstDayOfMonth().AddMonths(-1).ToShortDateString();
|
|
||||||
txtFechaF.Text = DateTime.Now.ToShortDateString();
|
|
||||||
|
|
||||||
//CargaDatos();
|
//CargaDatos();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DdlPersonal.DataSource = get_GlobalDTRHPersonal(UsuarioActual.CveEmpresa);
|
||||||
|
DdlPersonal.DataBind();
|
||||||
|
|
||||||
|
DdlPlantillasPolizas.DataSource = get_GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa);
|
||||||
|
DdlPlantillasPolizas.Items.Insert(0, new ListItem("Todos", "-1"));
|
||||||
|
DdlPlantillasPolizas.DataBind();
|
||||||
|
|
||||||
|
txtFechaI.Text = DateTime.Now.FirstDayOfMonth().AddMonths(-1).ToShortDateString();
|
||||||
|
txtFechaF.Text = DateTime.Now.ToShortDateString();
|
||||||
|
|
||||||
if (UsuarioActual.CveRol == 1 || UsuarioActual.CveUsuario == 17 || UsuarioActual.CveUsuario == 171 || UsuarioActual.TienePermisoProceso(221))
|
if (UsuarioActual.CveRol == 1 || UsuarioActual.CveUsuario == 17 || UsuarioActual.CveUsuario == 171 || UsuarioActual.TienePermisoProceso(221))
|
||||||
{
|
{
|
||||||
TienePermisoEditar = true;
|
TienePermisoEditar = true;
|
||||||
|
|||||||
@@ -111,19 +111,13 @@ Partial Class Contabilidad2_CatCuentas
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub CargaMonedas()
|
Private Sub CargaMonedas()
|
||||||
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
|
|
||||||
Dim ObJConta As New ClsContabilidad
|
|
||||||
|
|
||||||
|
DdlMoneda.DataSource = GlobalDTMonedas
|
||||||
If ObJConta.GetMonedas() Then
|
|
||||||
DdlMoneda.DataSource = ObJConta.DtResultados
|
|
||||||
End If
|
|
||||||
ObJConta.Dispose()
|
|
||||||
DdlMoneda.DataBind()
|
DdlMoneda.DataBind()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub CargaAgrupadorSAT()
|
Private Sub CargaAgrupadorSAT()
|
||||||
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
|
|
||||||
Dim ObjConta As New ClsContabilidad
|
Dim ObjConta As New ClsContabilidad
|
||||||
|
|
||||||
If ObjConta.GetAgrupadoresSAT(UsuarioActual.CveEmpresa) Then
|
If ObjConta.GetAgrupadoresSAT(UsuarioActual.CveEmpresa) Then
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
318
OC/OC.aspx.vb
318
OC/OC.aspx.vb
@@ -6082,51 +6082,51 @@ Partial Class OC
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable
|
Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable
|
||||||
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
|
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
|
||||||
Dim excelFile As ExcelFile = excelFile.Load(flatFilePath)
|
Dim excelFile As ExcelFile = ExcelFile.Load(flatFilePath)
|
||||||
|
|
||||||
Dim unnamed As Integer = 0
|
Dim unnamed As Integer = 0
|
||||||
Dim cols As Integer
|
Dim cols As Integer
|
||||||
Dim columns As String()
|
Dim columns As String()
|
||||||
Dim curRow As Integer = 0
|
Dim curRow As Integer = 0
|
||||||
Dim curCol As Integer = 0
|
Dim curCol As Integer = 0
|
||||||
Dim dataTable As DataTable = New DataTable()
|
Dim dataTable As DataTable = New DataTable()
|
||||||
Dim worksheet As ExcelWorksheet = excelFile.Worksheets(0)
|
Dim worksheet As ExcelWorksheet = excelFile.Worksheets(0)
|
||||||
|
|
||||||
For cols = 0 To worksheet.Rows(0).AllocatedCells.Count - 1
|
For cols = 0 To worksheet.Rows(0).AllocatedCells.Count - 1
|
||||||
|
|
||||||
If firstRowHasHeaders Then
|
If firstRowHasHeaders Then
|
||||||
|
|
||||||
If worksheet.Rows(0).Cells(cols).Value IsNot Nothing Then
|
If worksheet.Rows(0).Cells(cols).Value IsNot Nothing Then
|
||||||
dataTable.Columns.Add(worksheet.Rows(0).Cells(cols).Value.ToString())
|
dataTable.Columns.Add(worksheet.Rows(0).Cells(cols).Value.ToString())
|
||||||
Else
|
Else
|
||||||
dataTable.Columns.Add("Unnamed Column " & (System.Threading.Interlocked.Increment(unnamed)))
|
dataTable.Columns.Add("Unnamed Column " & (System.Threading.Interlocked.Increment(unnamed)))
|
||||||
End If
|
End If
|
||||||
|
|
||||||
curRow = 1
|
curRow = 1
|
||||||
Else
|
Else
|
||||||
dataTable.Columns.Add("Column " & (cols + 1))
|
dataTable.Columns.Add("Column " & (cols + 1))
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
While curRow < worksheet.Rows.Count
|
While curRow < worksheet.Rows.Count
|
||||||
columns = New String(cols - 1) {}
|
columns = New String(cols - 1) {}
|
||||||
|
|
||||||
For curCol = 0 To cols - 1
|
For curCol = 0 To cols - 1
|
||||||
|
|
||||||
If worksheet.Rows(curRow).Cells(curCol).Value Is Nothing Then
|
If worksheet.Rows(curRow).Cells(curCol).Value Is Nothing Then
|
||||||
columns(curCol) = ""
|
columns(curCol) = ""
|
||||||
Else
|
Else
|
||||||
columns(curCol) = worksheet.Rows(curRow).Cells(curCol).Value.ToString()
|
columns(curCol) = worksheet.Rows(curRow).Cells(curCol).Value.ToString()
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
dataTable.Rows.Add(columns)
|
dataTable.Rows.Add(columns)
|
||||||
curRow += 1
|
curRow += 1
|
||||||
End While
|
End While
|
||||||
|
|
||||||
Return dataTable
|
Return dataTable
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String)
|
Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String)
|
||||||
@@ -7469,131 +7469,131 @@ Partial Class OC
|
|||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "C A R G A R E X C E L "
|
#Region "C A R G A R E X C E L "
|
||||||
Protected Sub BtnCargaExcelCot_Click(sender As Object, e As EventArgs)
|
Protected Sub BtnCargaExcelCot_Click(sender As Object, e As EventArgs)
|
||||||
If TxtExcelCot.getfiles().Archivos.Count > 0 Then
|
If TxtExcelCot.getfiles().Archivos.Count > 0 Then
|
||||||
Dim file As Archivo = TxtExcelCot.getfiles().Archivos(0)
|
Dim file As Archivo = TxtExcelCot.getfiles().Archivos(0)
|
||||||
Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch
|
Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch
|
||||||
CargarArchivoCot(Directorio, file.filename)
|
CargarArchivoCot(Directorio, file.filename)
|
||||||
|
|
||||||
CargaCotizaciones(CveOrdenCompra)
|
CargaCotizaciones(CveOrdenCompra)
|
||||||
RegistraScript("$('#DivCargaExcelCotizaciones').modal('hide');")
|
RegistraScript("$('#DivCargaExcelCotizaciones').modal('hide');")
|
||||||
Else
|
Else
|
||||||
Alert("No existe el archivo. Favor de subir un archivo excel a la plataforma.", TipoMensaje.MsgError)
|
Alert("No existe el archivo. Favor de subir un archivo excel a la plataforma.", TipoMensaje.MsgError)
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub BtnDescargarFormatoCot_Click(sender As Object, e As EventArgs)
|
Protected Sub BtnDescargarFormatoCot_Click(sender As Object, e As EventArgs)
|
||||||
'cantidad, Producto, Precio Unitario, Fecha Entrega, Observación
|
'cantidad, Producto, Precio Unitario, Fecha Entrega, Observación
|
||||||
Dim DtPS As DataTable = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
|
Dim DtPS As DataTable = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
|
||||||
|
|
||||||
Dim DtExcel As DataTable = (From row As GridViewRow In GvD.Rows
|
Dim DtExcel As DataTable = (From row As GridViewRow In GvD.Rows
|
||||||
Join rowPS In DtPS On rowPS("CvePS").ToString().ToEntero() Equals row.DataKey("CvePS").ToEntero()
|
Join rowPS In DtPS On rowPS("CvePS").ToString().ToEntero() Equals row.DataKey("CvePS").ToEntero()
|
||||||
Where row.RowType = DataControlRowType.DataRow
|
Where row.RowType = DataControlRowType.DataRow
|
||||||
Select New With
|
Select New With
|
||||||
{
|
{
|
||||||
.Cantidad = row.DataKey("Cantidad"),
|
.Cantidad = row.DataKey("Cantidad"),
|
||||||
.Codigo = rowPS("Codigo"),
|
.Codigo = rowPS("Codigo"),
|
||||||
.Producto = rowPS("PSCodigo"),
|
.Producto = rowPS("PSCodigo"),
|
||||||
.PrecioUnitario = row.DataKey("Importe").ToDecimal(),
|
.PrecioUnitario = row.DataKey("Importe").ToDecimal(),
|
||||||
.FechaEntrega = "",
|
.FechaEntrega = "",
|
||||||
.Observacion = row.DataKey("Observacion")
|
.Observacion = row.DataKey("Observacion")
|
||||||
}).QueryToDataTable(True)
|
}).QueryToDataTable(True)
|
||||||
If DtExcel.Rows.Count < 2 Then
|
If DtExcel.Rows.Count < 2 Then
|
||||||
Alert("No hay resutados en la busqueda.", TipoMensaje.MsgAdvertencia)
|
Alert("No hay resutados en la busqueda.", TipoMensaje.MsgAdvertencia)
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
DtExcel.TableName = "Cotización"
|
DtExcel.TableName = "Cotización"
|
||||||
'DtExcel.Columns("Codigo").ColumnName = "Código"
|
'DtExcel.Columns("Codigo").ColumnName = "Código"
|
||||||
'DtExcel.Columns("PS").ColumnName = "Producto / Servicio"
|
'DtExcel.Columns("PS").ColumnName = "Producto / Servicio"
|
||||||
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
|
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
|
||||||
|
|
||||||
Dim FileExcel As New ExcelFile()
|
Dim FileExcel As New ExcelFile()
|
||||||
|
|
||||||
Dim worksheet = FileExcel.Worksheets.Add(DtExcel.TableName)
|
Dim worksheet = FileExcel.Worksheets.Add(DtExcel.TableName)
|
||||||
worksheet.InsertDataTable(DtExcel, New InsertDataTableOptions() With
|
worksheet.InsertDataTable(DtExcel, New InsertDataTableOptions() With
|
||||||
{
|
{
|
||||||
.ColumnHeaders = True,
|
.ColumnHeaders = True,
|
||||||
.StartRow = 0,
|
.StartRow = 0,
|
||||||
.StartColumn = 0
|
.StartColumn = 0
|
||||||
})
|
})
|
||||||
worksheet.Rows(0).Style.FillPattern.SetPattern(FillPatternStyle.Solid, SpreadsheetColor.FromArgb(75, 119, 190), SpreadsheetColor.FromArgb(255, 255, 255))
|
worksheet.Rows(0).Style.FillPattern.SetPattern(FillPatternStyle.Solid, SpreadsheetColor.FromArgb(75, 119, 190), SpreadsheetColor.FromArgb(255, 255, 255))
|
||||||
worksheet.Rows(0).Style.Font.Color = SpreadsheetColor.FromArgb(255, 255, 255)
|
worksheet.Rows(0).Style.Font.Color = SpreadsheetColor.FromArgb(255, 255, 255)
|
||||||
|
|
||||||
Dim columnCount = worksheet.CalculateMaxUsedColumns()
|
Dim columnCount = worksheet.CalculateMaxUsedColumns()
|
||||||
For i = 0 To columnCount
|
For i = 0 To columnCount
|
||||||
worksheet.Columns(i).AutoFit(1, worksheet.Rows(0), worksheet.Rows(worksheet.Rows.Count - 1))
|
worksheet.Columns(i).AutoFit(1, worksheet.Rows(0), worksheet.Rows(worksheet.Rows.Count - 1))
|
||||||
Next
|
Next
|
||||||
|
|
||||||
FileExcel.Save(Response, "Cotizacion.xlsx", SaveOptions.XlsxDefault)
|
FileExcel.Save(Response, "Cotizacion.xlsx", SaveOptions.XlsxDefault)
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
Protected Sub CargarArchivoCot(Ruta As String, FileName As String)
|
Protected Sub CargarArchivoCot(Ruta As String, FileName As String)
|
||||||
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
|
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
|
||||||
|
|
||||||
Dim dt As DataTable = Nothing
|
Dim dt As DataTable = Nothing
|
||||||
Dim ErrorArchivo = False
|
Dim ErrorArchivo = False
|
||||||
|
|
||||||
Try
|
Try
|
||||||
dt = ReadExcelFile(Ruta + FileName, True)
|
dt = ReadExcelFile(Ruta + FileName, True)
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
ErrorArchivo = True
|
ErrorArchivo = True
|
||||||
OnError("Ocurrio un error al leer el archivo <br/>" & ex.Message, ex)
|
OnError("Ocurrio un error al leer el archivo <br/>" & ex.Message, ex)
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
If Not ErrorArchivo AndAlso dt IsNot Nothing Then
|
If Not ErrorArchivo AndAlso dt IsNot Nothing Then
|
||||||
'cantidad, Producto, Precio Unitario, Fecha Entrega, Observación
|
'cantidad, Producto, Precio Unitario, Fecha Entrega, Observación
|
||||||
If DdlProveedorCot.SelectedValue.ToEntero() <= 0 Then
|
If DdlProveedorCot.SelectedValue.ToEntero() <= 0 Then
|
||||||
Alert("Debe Seleccionar la lista de precios a cargar. Favor de corregirlo", TipoMensaje.MsgError)
|
Alert("Debe Seleccionar la lista de precios a cargar. Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
|
||||||
If Not dt.Columns(0).ColumnName = "Cantidad" Then
|
|
||||||
Alert("El nombre de la tercera columna debe ser 'Cantidad'. Favor de corregirlo", TipoMensaje.MsgError)
|
|
||||||
Exit Sub
|
|
||||||
End If
|
End If
|
||||||
If Not dt.Columns(1).ColumnName = "Codigo" Then
|
If Not dt.Columns(0).ColumnName = "Cantidad" Then
|
||||||
Alert("El nombre de la cuarta columna debe ser 'Codigo'. Favor de corregirlo", TipoMensaje.MsgError)
|
Alert("El nombre de la tercera columna debe ser 'Cantidad'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
|
||||||
If Not dt.Columns(2).ColumnName = "Producto" Then
|
|
||||||
Alert("El nombre de la cuarta columna debe ser 'Producto'. Favor de corregirlo", TipoMensaje.MsgError)
|
|
||||||
Exit Sub
|
|
||||||
End If
|
|
||||||
If Not dt.Columns(3).ColumnName = "PrecioUnitario" Then
|
|
||||||
Alert("El nombre de la sexta columna debe ser 'PrecioUnitario'. Favor de corregirlo", TipoMensaje.MsgError)
|
|
||||||
Exit Sub
|
|
||||||
End If
|
End If
|
||||||
If Not dt.Columns(4).ColumnName = "FechaEntrega" Then
|
If Not dt.Columns(1).ColumnName = "Codigo" Then
|
||||||
Alert("El nombre de la sexta columna debe ser 'FechaEntrega'. Favor de corregirlo", TipoMensaje.MsgError)
|
Alert("El nombre de la cuarta columna debe ser 'Codigo'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
If Not dt.Columns(5).ColumnName = "Observacion" Then
|
If Not dt.Columns(2).ColumnName = "Producto" Then
|
||||||
Alert("El nombre de la sexta columna debe ser 'Observacion'. Favor de corregirlo", TipoMensaje.MsgError)
|
Alert("El nombre de la cuarta columna debe ser 'Producto'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
If Not dt.Columns(3).ColumnName = "PrecioUnitario" Then
|
||||||
dt.TableName = "Datos"
|
Alert("El nombre de la sexta columna debe ser 'PrecioUnitario'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
Dim ProductosNoCargados As New StringBuilder()
|
Exit Sub
|
||||||
Dim RowsCargados As Integer = 0
|
End If
|
||||||
|
If Not dt.Columns(4).ColumnName = "FechaEntrega" Then
|
||||||
|
Alert("El nombre de la sexta columna debe ser 'FechaEntrega'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
If Not dt.Columns(5).ColumnName = "Observacion" Then
|
||||||
|
Alert("El nombre de la sexta columna debe ser 'Observacion'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
dt.TableName = "Datos"
|
||||||
|
Dim ProductosNoCargados As New StringBuilder()
|
||||||
|
Dim RowsCargados As Integer = 0
|
||||||
Dim RowsNoCargados As Integer = 0
|
Dim RowsNoCargados As Integer = 0
|
||||||
Dim TieneError As Boolean = False
|
Dim TieneError As Boolean = False
|
||||||
|
|
||||||
Dim objCotizacion As New ClsOC
|
Dim objCotizacion As New ClsOC
|
||||||
objCotizacion.IniciaTransacSQL()
|
objCotizacion.IniciaTransacSQL()
|
||||||
|
|
||||||
Try
|
Try
|
||||||
Dim DtPS As DataTable = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
|
Dim DtPS As DataTable = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
|
||||||
|
|
||||||
Dim DtOCDetalle As DataTable = (From row As GridViewRow In GvD.Rows
|
Dim DtOCDetalle As DataTable = (From row As GridViewRow In GvD.Rows
|
||||||
Join rowPS In DtPS On rowPS("CvePS").ToString().ToEntero() Equals row.DataKey("CvePS").ToEntero()
|
Join rowPS In DtPS On rowPS("CvePS").ToString().ToEntero() Equals row.DataKey("CvePS").ToEntero()
|
||||||
Where row.RowType = DataControlRowType.DataRow
|
Where row.RowType = DataControlRowType.DataRow
|
||||||
Select New With
|
Select New With
|
||||||
{
|
{
|
||||||
.CvePS = row.DataKey("CvePS").ToEntero(),
|
.CvePS = row.DataKey("CvePS").ToEntero(),
|
||||||
.CveUnidadMedida = rowPS("CveUnidadMedida").ToString().ToEntero(),
|
.CveUnidadMedida = rowPS("CveUnidadMedida").ToString().ToEntero(),
|
||||||
.CveOrdenCompraDetalle = row.DataKey("CveOrdenCompraDetalle").ToString().ToEntero(),
|
.CveOrdenCompraDetalle = row.DataKey("CveOrdenCompraDetalle").ToString().ToEntero(),
|
||||||
.Codigo = rowPS("Codigo")
|
.Codigo = rowPS("Codigo")
|
||||||
}).QueryToDataTable(True)
|
}).QueryToDataTable(True)
|
||||||
|
|
||||||
|
|
||||||
@@ -7618,23 +7618,23 @@ Partial Class OC
|
|||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
TieneError = False
|
TieneError = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
TieneError = True
|
TieneError = True
|
||||||
OnError("Ocurrió un error al cargar las cotizaciones.", ex)
|
OnError("Ocurrió un error al cargar las cotizaciones.", ex)
|
||||||
Finally
|
Finally
|
||||||
If TieneError Then
|
If TieneError Then
|
||||||
objCotizacion.RollBack()
|
objCotizacion.RollBack()
|
||||||
Alert("Ocurrió un error al cargar las cotizaciones.")
|
Alert("Ocurrió un error al cargar las cotizaciones.")
|
||||||
Else
|
Else
|
||||||
objCotizacion.Commit()
|
objCotizacion.Commit()
|
||||||
Alert("Las cotizaciones se cargaron correctamente.")
|
Alert("Las cotizaciones se cargaron correctamente.")
|
||||||
End If
|
End If
|
||||||
objCotizacion.Dispose()
|
objCotizacion.Dispose()
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|||||||
@@ -107,9 +107,8 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<label class="col-md-2 truncate">Cliente:</label>
|
<label class="col-md-2 truncate">Cliente:</label>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<asp:DropDownList ID="DdlCliente" DataTextField="NombreComercial" DataValueField="CveCliente" CssClass="select2me" runat="server" Width="350px"></asp:DropDownList>
|
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientes" Width="100%" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;">
|
||||||
<asp:RequiredFieldValidator ID="RFVCliente" runat="server" ControlToValidate="DdlCliente" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cliente''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
</ADS:Dropdownlost>
|
||||||
<ajax:ValidatorCalloutExtender ID="VCECliente" runat="server" HighlightCssClass="vco" TargetControlID="RFVCliente" Width="300px"></ajax:ValidatorCalloutExtender>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -117,7 +116,7 @@
|
|||||||
<label class="col-md-2 truncate">Moneda:</label>
|
<label class="col-md-2 truncate">Moneda:</label>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<asp:DropDownList ID="DdlMoneda" DataTextField="Moneda" DataValueField="CveMoneda" CssClass="select2me" runat="server" Width="350px"></asp:DropDownList>
|
<asp:DropDownList ID="DdlMoneda" DataTextField="Moneda" DataValueField="CveMoneda" CssClass="select2me" runat="server" Width="350px"></asp:DropDownList>
|
||||||
<asp:RequiredFieldValidator ID="RFVMoneda" runat="server" ControlToValidate="DdlCliente" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Moneda''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
<asp:RequiredFieldValidator ID="RFVMoneda" runat="server" ControlToValidate="DdlMoneda" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Moneda''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||||
<ajax:ValidatorCalloutExtender ID="VCEMoneda" runat="server" HighlightCssClass="vco" TargetControlID="RFVMoneda" Width="300px"></ajax:ValidatorCalloutExtender>
|
<ajax:ValidatorCalloutExtender ID="VCEMoneda" runat="server" HighlightCssClass="vco" TargetControlID="RFVMoneda" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -87,9 +87,10 @@ Partial Class Ventas_Promociones
|
|||||||
DdlVendedor.DataBind()
|
DdlVendedor.DataBind()
|
||||||
DdlVendedor.Items.Insert(0, New ListItem("Todos", "-1"))
|
DdlVendedor.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||||
|
|
||||||
DdlCliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa)
|
'DdlCliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa)
|
||||||
DdlCliente.DataBind()
|
'DdlCliente.DataBind()
|
||||||
DdlCliente.Items.Insert(0, New ListItem("todos", "-1"))
|
'DdlCliente.Items.Insert(0, New ListItem("todos", "-1"))
|
||||||
|
DdlClientes.setEsWebService(True)
|
||||||
|
|
||||||
TxtFechaI.Text = Now.FirstDayOfMonth.ToShortDateString
|
TxtFechaI.Text = Now.FirstDayOfMonth.ToShortDateString
|
||||||
TxtFechaF.Text = Now.LastDayOfMonth.ToShortDateString
|
TxtFechaF.Text = Now.LastDayOfMonth.ToShortDateString
|
||||||
@@ -131,6 +132,7 @@ Partial Class Ventas_Promociones
|
|||||||
TempDT.Columns.Add("TipoPromocion", GetType(String))
|
TempDT.Columns.Add("TipoPromocion", GetType(String))
|
||||||
TempDT.Columns.Add("Promocion", GetType(String))
|
TempDT.Columns.Add("Promocion", GetType(String))
|
||||||
TempDT.Columns.Add("CantidadMinima", GetType(Integer))
|
TempDT.Columns.Add("CantidadMinima", GetType(Integer))
|
||||||
|
TempDT.Columns.Add("RinTamaño", GetType(String))
|
||||||
|
|
||||||
TempDT.Columns.Add("AplicaRestriccionTexto", GetType(String))
|
TempDT.Columns.Add("AplicaRestriccionTexto", GetType(String))
|
||||||
TempDT.Columns.Add("AplicaRestriccion", GetType(Boolean))
|
TempDT.Columns.Add("AplicaRestriccion", GetType(Boolean))
|
||||||
@@ -149,7 +151,7 @@ Partial Class Ventas_Promociones
|
|||||||
Protected Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As EventArgs)
|
Protected Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||||
ChangeDdlProducto()
|
ChangeDdlProducto()
|
||||||
DdlTipoPromocion.Items.FindByValue("1").Enabled = False
|
DdlTipoPromocion.Items.FindByValue("1").Enabled = False
|
||||||
DdlTipoPromocion.Items.FindByValue("3").Enabled = False
|
' DdlTipoPromocion.Items.FindByValue("3").Enabled = False
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub ChangeDdlProducto()
|
Private Sub ChangeDdlProducto()
|
||||||
If UsuarioActual.Empresa.Funcionalidad(105) = "" Then
|
If UsuarioActual.Empresa.Funcionalidad(105) = "" Then
|
||||||
@@ -185,9 +187,10 @@ Partial Class Ventas_Promociones
|
|||||||
DdlSubProyecto.SelectedValue = Dr("CveSubProyecto").ToString
|
DdlSubProyecto.SelectedValue = Dr("CveSubProyecto").ToString
|
||||||
DdlMarca.SelectedValue = Dr("CveMarca").ToString
|
DdlMarca.SelectedValue = Dr("CveMarca").ToString
|
||||||
If Dr("CveVendedor").ToString.ToEntero > 0 Then DdlVendedor.SelectedValue = Dr("CveVendedor").ToString
|
If Dr("CveVendedor").ToString.ToEntero > 0 Then DdlVendedor.SelectedValue = Dr("CveVendedor").ToString
|
||||||
If Dr("CveCliente").ToString.ToEntero > 0 Then DdlCliente.SelectedValue = Dr("CveCliente").ToString
|
If Dr("CveCliente").ToString.ToEntero > 0 Then DdlClientes.SelectedValue = Dr("CveCliente").ToString
|
||||||
ChkEstatus.Checked = If(Dr("Estatus").ToString = "True", True, False)
|
ChkEstatus.Checked = If(Dr("Estatus").ToString = "True", True, False)
|
||||||
DdlMoneda.SelectedValueExist(Dr("CveMoneda").ToString)
|
DdlMoneda.SelectedValueExist(Dr("CveMoneda").ToString)
|
||||||
|
DdlMarca.SelectedValueExist(Dr("CveMarca").ToString)
|
||||||
|
|
||||||
If ObjVentas.GetPromocionesDetalle(CvePromocion, UsuarioActual.CveEmpresa) Then
|
If ObjVentas.GetPromocionesDetalle(CvePromocion, UsuarioActual.CveEmpresa) Then
|
||||||
TempDT = ObjVentas.DtResultados
|
TempDT = ObjVentas.DtResultados
|
||||||
@@ -411,11 +414,12 @@ Partial Class Ventas_Promociones
|
|||||||
|
|
||||||
|
|
||||||
Private Sub GuardaPromocion()
|
Private Sub GuardaPromocion()
|
||||||
|
Dim CveCliente As Integer = If(DdlClientes.SelectedValue = "", -1, DdlClientes.SelectedValue.ToEntero)
|
||||||
Dim ObjVentas As New ClsVentas
|
Dim ObjVentas As New ClsVentas
|
||||||
Dim TieneError = False
|
Dim TieneError = False
|
||||||
ObjVentas.IniciaTransacSQL()
|
ObjVentas.IniciaTransacSQL()
|
||||||
CvePromocion = ObjVentas.AddPromociones(TxtPromocion.Text.Trim, If(IsDate(TxtFechaI.Text), TxtFechaI.Text.ToDate, MinFecha), If(IsDate(TxtFechaF.Text), TxtFechaF.Text.ToDate, MaxFecha),
|
CvePromocion = ObjVentas.AddPromociones(TxtPromocion.Text.Trim, If(IsDate(TxtFechaI.Text), TxtFechaI.Text.ToDate, MinFecha), If(IsDate(TxtFechaF.Text), TxtFechaF.Text.ToDate, MaxFecha),
|
||||||
DdlVendedor.SelectedValue.ToEntero, DdlCliente.SelectedValue.ToEntero, ChkEstatus.Checked, DdlMoneda.SelectedValue.ToEntero, UsuarioActual.CveUsuario,
|
DdlVendedor.SelectedValue.ToEntero, CveCliente, ChkEstatus.Checked, DdlMoneda.SelectedValue.ToEntero, UsuarioActual.CveUsuario,
|
||||||
UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero, DdlTipoAplicacion.SelectedValue.ToString, DdlMarca.SelectedValue.ToEntero)
|
UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero, DdlTipoAplicacion.SelectedValue.ToString, DdlMarca.SelectedValue.ToEntero)
|
||||||
|
|
||||||
If CvePromocion > 0 Then
|
If CvePromocion > 0 Then
|
||||||
@@ -443,11 +447,13 @@ Partial Class Ventas_Promociones
|
|||||||
ObjVentas.Dispose()
|
ObjVentas.Dispose()
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub ActualizaPromocion()
|
Private Sub ActualizaPromocion()
|
||||||
|
Dim CveCliente As Integer = If(DdlClientes.SelectedValue = "", -1, DdlClientes.SelectedValue.ToEntero)
|
||||||
|
|
||||||
Dim ObjVentas As New ClsVentas
|
Dim ObjVentas As New ClsVentas
|
||||||
Dim TieneError = False
|
Dim TieneError = False
|
||||||
ObjVentas.IniciaTransacSQL()
|
ObjVentas.IniciaTransacSQL()
|
||||||
|
|
||||||
If ObjVentas.UpdatePromociones(TxtPromocion.Text.Trim, If(IsDate(TxtFechaI.Text), TxtFechaI.Text.ToDate, MinFecha), If(IsDate(TxtFechaF.Text), TxtFechaF.Text.ToDate, MaxFecha), DdlVendedor.SelectedValue.ToEntero, DdlCliente.SelectedValue.ToEntero, ChkEstatus.Checked, DdlMoneda.SelectedValue.ToEntero, UsuarioActual.CveUsuario, CvePromocion, DdlSubProyecto.SelectedValue.ToEntero) Then
|
If ObjVentas.UpdatePromociones(TxtPromocion.Text.Trim, If(IsDate(TxtFechaI.Text), TxtFechaI.Text.ToDate, MinFecha), If(IsDate(TxtFechaF.Text), TxtFechaF.Text.ToDate, MaxFecha), DdlVendedor.SelectedValue.ToEntero, CveCliente, ChkEstatus.Checked, DdlMoneda.SelectedValue.ToEntero, UsuarioActual.CveUsuario, CvePromocion, DdlSubProyecto.SelectedValue.ToEntero, DdlMarca.SelectedValue.ToEntero) Then
|
||||||
|
|
||||||
For Each Dr As DataRow In TempDT.FiltraParametros("Estatus = 0").Rows
|
For Each Dr As DataRow In TempDT.FiltraParametros("Estatus = 0").Rows
|
||||||
If Not ObjVentas.AddPromocionesDetalle(CvePromocion, Dr("CvePS").ToString.ToEntero, Dr("CveTipoPromocion").ToString.ToEntero, Dr("Promocion").ToString.ToDouble, Dr("PUAnterior").ToString.ToDouble, Dr("PUPromocion").ToString.ToDouble,
|
If Not ObjVentas.AddPromocionesDetalle(CvePromocion, Dr("CvePS").ToString.ToEntero, Dr("CveTipoPromocion").ToString.ToEntero, Dr("Promocion").ToString.ToDouble, Dr("PUAnterior").ToString.ToDouble, Dr("PUPromocion").ToString.ToDouble,
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ Partial Class Ventas
|
|||||||
Private Property FolioXML As String
|
Private Property FolioXML As String
|
||||||
Private Property SubTotal As Decimal
|
Private Property SubTotal As Decimal
|
||||||
Private Property Total As Decimal = 0
|
Private Property Total As Decimal = 0
|
||||||
Private Property Descuentos As Decimal = 0
|
' Private Property Descuentos As Decimal = 0
|
||||||
Private Property EmisorRFC As String
|
Private Property EmisorRFC As String
|
||||||
Private Property ReceptorRFC As String
|
Private Property ReceptorRFC As String
|
||||||
Private Property TrasladoIVA As Decimal = 0
|
Private Property TrasladoIVA As Decimal = 0
|
||||||
@@ -5883,11 +5883,12 @@ Partial Class Ventas
|
|||||||
End Sub
|
End Sub
|
||||||
Protected Sub GvPS_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvPS.RowUpdating
|
Protected Sub GvPS_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvPS.RowUpdating
|
||||||
'Dim TipoDescuento As Integer
|
'Dim TipoDescuento As Integer
|
||||||
Dim Cantidad, PU, Descuento, CantidadInventario As Decimal
|
Dim Cantidad, PU, CantidadInventario As Decimal
|
||||||
|
Dim ObjDescuento As New Descuentos
|
||||||
Dim CuentaPredial As String
|
Dim CuentaPredial As String
|
||||||
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)
|
||||||
Descuento = (GvPS.Rows(e.RowIndex).FCTextBox("TxtDescuento").Text.ToDecimal).RoundSQL(NumeroDecimales)
|
ObjDescuento.ImporteDescuento = (GvPS.Rows(e.RowIndex).FCTextBox("TxtDescuento").Text.ToDecimal).RoundSQL(NumeroDecimales)
|
||||||
CuentaPredial = GvPS.Rows(e.RowIndex).FCTextBox("TxtPredial").Text.Trim
|
CuentaPredial = GvPS.Rows(e.RowIndex).FCTextBox("TxtPredial").Text.Trim
|
||||||
|
|
||||||
If PU <= 0 AndAlso UsuarioActual.CveEmpresa = 141 Then
|
If PU <= 0 AndAlso UsuarioActual.CveEmpresa = 141 Then
|
||||||
@@ -5896,7 +5897,7 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If UsuarioActual.CveEmpresa = 140 Then
|
If UsuarioActual.CveEmpresa = 140 Then
|
||||||
Descuento = CalcularDescuentos(TmpDT.Rows(e.RowIndex)("CvePS").ToString.ToEntero, Cantidad, PU)
|
ObjDescuento = CalcularDescuentos(TmpDT.Rows(e.RowIndex)("CvePS").ToString.ToEntero, Cantidad, PU)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim CantidadOriginal As Decimal = GvPS.Rows(e.RowIndex).DataKey("Cantidad").ToDecimal()
|
Dim CantidadOriginal As Decimal = GvPS.Rows(e.RowIndex).DataKey("Cantidad").ToDecimal()
|
||||||
@@ -6060,10 +6061,10 @@ Partial Class Ventas
|
|||||||
CalculaUsados()
|
CalculaUsados()
|
||||||
AgregarProductoServicio(Cantidad, DdlUM.SelectedValue.ToEntero, DdlUM.SelectedItem.Text, DdlCla.SelectedValue.ToEntero, DdlCla.SelectedItem.Text,
|
AgregarProductoServicio(Cantidad, DdlUM.SelectedValue.ToEntero, DdlUM.SelectedItem.Text, DdlCla.SelectedValue.ToEntero, DdlCla.SelectedItem.Text,
|
||||||
GvPS.Rows(e.RowIndex).FCDropDownLost("DdlPS").SelectedValue.ToEntero, GvPS.Rows(e.RowIndex).FCDropDownLost("DdlPS").SelectedText,
|
GvPS.Rows(e.RowIndex).FCDropDownLost("DdlPS").SelectedValue.ToEntero, GvPS.Rows(e.RowIndex).FCDropDownLost("DdlPS").SelectedText,
|
||||||
GvPS.Rows(e.RowIndex).FCTextBox("TxtObsPS").Text.Trim, PU, Descuento,
|
GvPS.Rows(e.RowIndex).FCTextBox("TxtObsPS").Text.Trim, PU, ObjDescuento.ImporteDescuento,
|
||||||
GvPS.Rows(e.RowIndex).FCDropDownList("DdlProyecto").SelectedValue.ToEntero, GvPS.Rows(e.RowIndex).FCDropDownList("DdlProyecto").SelectedItem.Text,
|
GvPS.Rows(e.RowIndex).FCDropDownList("DdlProyecto").SelectedValue.ToEntero, GvPS.Rows(e.RowIndex).FCDropDownList("DdlProyecto").SelectedItem.Text,
|
||||||
GvPS.Rows(e.RowIndex).FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero, GvPS.Rows(e.RowIndex).FCDropDownList("DdlSubProyecto").SelectedItem.Text,
|
GvPS.Rows(e.RowIndex).FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero, GvPS.Rows(e.RowIndex).FCDropDownList("DdlSubProyecto").SelectedItem.Text,
|
||||||
CuentaPredial:=CuentaPredial, CveVentaDetalle:=GvPS.Rows(e.RowIndex).DataKey("CveVentaDetalle").ToString.ToEntero, SeActualiza:=True)
|
CuentaPredial:=CuentaPredial, CveVentaDetalle:=GvPS.Rows(e.RowIndex).DataKey("CveVentaDetalle").ToString.ToEntero, SeActualiza:=True, CvePromocionDetalle:=ObjDescuento.CvePromocionDetalle)
|
||||||
|
|
||||||
' 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
|
||||||
@@ -6091,7 +6092,7 @@ Partial Class Ventas
|
|||||||
TmpDT.Rows(e.RowIndex)("PorcentajeIEPS") = 0
|
TmpDT.Rows(e.RowIndex)("PorcentajeIEPS") = 0
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim TotalCalculableImpuestos As Decimal = ((Cantidad * PU) - (Descuento))
|
Dim TotalCalculableImpuestos As Decimal = ((Cantidad * PU) - (ObjDescuento.ImporteDescuento))
|
||||||
Dim TotalCalculableImpuestosIVA As Decimal = 0
|
Dim TotalCalculableImpuestosIVA As Decimal = 0
|
||||||
TotalCalculableImpuestosIVA = TotalCalculableImpuestos * (1 + TmpDT.Rows(e.RowIndex)("PorcentajeIEPS").ToString.ToDecimal)
|
TotalCalculableImpuestosIVA = TotalCalculableImpuestos * (1 + TmpDT.Rows(e.RowIndex)("PorcentajeIEPS").ToString.ToDecimal)
|
||||||
|
|
||||||
@@ -6119,7 +6120,7 @@ Partial Class Ventas
|
|||||||
TmpDT.Rows(e.RowIndex)("Obs") = GvPS.Rows(e.RowIndex).FCTextBox("TxtObsPS").Text.Trim
|
TmpDT.Rows(e.RowIndex)("Obs") = GvPS.Rows(e.RowIndex).FCTextBox("TxtObsPS").Text.Trim
|
||||||
TmpDT.Rows(e.RowIndex)("TiempoEntrega") = GvPS.Rows(e.RowIndex).FCTextBox("TxtTiempoEntrega").Text.Trim
|
TmpDT.Rows(e.RowIndex)("TiempoEntrega") = GvPS.Rows(e.RowIndex).FCTextBox("TxtTiempoEntrega").Text.Trim
|
||||||
TmpDT.Rows(e.RowIndex)("PU") = PU
|
TmpDT.Rows(e.RowIndex)("PU") = PU
|
||||||
TmpDT.Rows(e.RowIndex)("Descuento") = Descuento
|
TmpDT.Rows(e.RowIndex)("Descuento") = ObjDescuento.ImporteDescuento
|
||||||
TmpDT.Rows(e.RowIndex)("TotalImporte") = (Cantidad * PU).RoundSQL(NumeroDecimales)
|
TmpDT.Rows(e.RowIndex)("TotalImporte") = (Cantidad * PU).RoundSQL(NumeroDecimales)
|
||||||
TmpDT.Rows(e.RowIndex)("ImporteIVA") = (TmpDT.Rows(e.RowIndex)("PorcentajeIVA").ToString.ToDecimal * TotalCalculableImpuestosIVA).RoundSQL(NumeroDecimales)
|
TmpDT.Rows(e.RowIndex)("ImporteIVA") = (TmpDT.Rows(e.RowIndex)("PorcentajeIVA").ToString.ToDecimal * TotalCalculableImpuestosIVA).RoundSQL(NumeroDecimales)
|
||||||
TmpDT.Rows(e.RowIndex)("ImporteIEPS") = (TmpDT.Rows(e.RowIndex)("PorcentajeIEPS").ToString.ToDecimal * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
|
TmpDT.Rows(e.RowIndex)("ImporteIEPS") = (TmpDT.Rows(e.RowIndex)("PorcentajeIEPS").ToString.ToDecimal * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
|
||||||
@@ -9422,7 +9423,7 @@ Partial Class Ventas
|
|||||||
If Not ObjVentas.AddVentaDetalle(ObjVentas.CveVenta, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("CveUM").ToString.ToEntero,
|
If Not ObjVentas.AddVentaDetalle(ObjVentas.CveVenta, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("CveUM").ToString.ToEntero,
|
||||||
Row("PU").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("ImporteIVA").ToString.ToDouble, Math.Round((Row("Total").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)) * (1 + Row("PorcentajeIVA").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)))), 6),
|
Row("PU").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("ImporteIVA").ToString.ToDouble, Math.Round((Row("Total").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)) * (1 + Row("PorcentajeIVA").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)))), 6),
|
||||||
Row("Obs").ToString, Row("Descuento").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("TipoDescuento").ToString.ToEntero, Row("CveSubProyecto").ToString.ToEntero, Row("CvePresupuestoIngreso").ToString.ToEntero,
|
Row("Obs").ToString, Row("Descuento").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("TipoDescuento").ToString.ToEntero, Row("CveSubProyecto").ToString.ToEntero, Row("CvePresupuestoIngreso").ToString.ToEntero,
|
||||||
TiempoEntrega:=Row("TiempoEntrega").ToString, CveVentaDetallePadre:=Row("CveVentaDetalle").ToString.ToEntero, CveContratoDetalle:=Row("CveContratoDetalle").ToString.ToEntero, CvePromocionDetalle:=If(DtPromociones IsNot Nothing, DtPromociones.FiltroPrimeroValor("CvePromocionDetalle", $"CvePS={Row("CvePS").ToString}").ToEntero, -1),
|
TiempoEntrega:=Row("TiempoEntrega").ToString, CveVentaDetallePadre:=Row("CveVentaDetalle").ToString.ToEntero, CveContratoDetalle:=Row("CveContratoDetalle").ToString.ToEntero, CvePromocionDetalle:=Row("CvePromocionDetalle").ToString.ToEntero,
|
||||||
IEPS:=Row("ImporteIEPS").ToString.ToDouble, CveMovimientoDetallePedido:=Row("CveMovimientoDetallePedido").ToString.ToEntero,
|
IEPS:=Row("ImporteIEPS").ToString.ToDouble, CveMovimientoDetallePedido:=Row("CveMovimientoDetallePedido").ToString.ToEntero,
|
||||||
ImporteRetIVA:=Row("ImporteRetIVA").ToString.ToDouble, ImporteRetISR:=Row("ImporteRetISR").ToString.ToDouble,
|
ImporteRetIVA:=Row("ImporteRetIVA").ToString.ToDouble, ImporteRetISR:=Row("ImporteRetISR").ToString.ToDouble,
|
||||||
PorcentajeIVA:=Row("PorcentajeIVA").ToString.ToDecimal, PorcentajeIEPS:=Row("PorcentajeIEPS").ToString.ToDouble, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString.ToDouble, PorcentajeRetISR:=Row("PorcentajeRetISR").ToString.ToDouble, CuentaPredial:=Row("CuentaPredial").ToString) Then
|
PorcentajeIVA:=Row("PorcentajeIVA").ToString.ToDecimal, PorcentajeIEPS:=Row("PorcentajeIEPS").ToString.ToDouble, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString.ToDouble, PorcentajeRetISR:=Row("PorcentajeRetISR").ToString.ToDouble, CuentaPredial:=Row("CuentaPredial").ToString) Then
|
||||||
@@ -14201,11 +14202,21 @@ Partial Class Ventas
|
|||||||
EsValido = True
|
EsValido = True
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
|
Dim DrPS As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
|
||||||
'valida sino tiene promocion la clasificacion
|
'valida sino tiene promocion la clasificacion
|
||||||
If DtPromociones.FiltraParametros($"CveClasificacion = {DdlClasificacion.SelectedValue.ToEntero}").Rows.Count > 0 Then
|
If DrPS IsNot Nothing Then
|
||||||
''falta aplicar si tiene promocion
|
If DtPromociones.FiltraParametros(String.Format("CveClasificacion = {0}", DdlClasificacion.SelectedValue.ToEntero)).Rows.Count > 0 Then
|
||||||
|
''falta aplicar si tiene promocion
|
||||||
|
Dim drPromo As DataRow = DtPromociones.FiltroPrimero(String.Format("CveClasificacion = {0}", DdlClasificacion.SelectedValue.ToEntero))
|
||||||
|
If drPromo IsNot Nothing Then
|
||||||
|
If drPromo("CveMarca").ToString = DrPS("CveMarca").ToString Then
|
||||||
|
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -14245,7 +14256,7 @@ Partial Class Ventas
|
|||||||
Return True
|
Return True
|
||||||
|
|
||||||
End Function
|
End Function
|
||||||
Private Function CalcularDescuentos(CvePS As Integer, Cantidad As Decimal, PU As Decimal) As Decimal
|
Private Function CalcularDescuentos(CvePS As Integer, Cantidad As Decimal, PU As Decimal) As Descuentos
|
||||||
Dim Descuento As Decimal = HdnDescuento.Value.ToDecimal
|
Dim Descuento As Decimal = HdnDescuento.Value.ToDecimal
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(572) = "1" AndAlso Not TbDescuentosRNC.Visible Then
|
If UsuarioActual.Empresa.Funcionalidad(572) = "1" AndAlso Not TbDescuentosRNC.Visible Then
|
||||||
@@ -14256,11 +14267,30 @@ Partial Class Ventas
|
|||||||
Descuento = HdnDescuento.Value.ToDecimal * Cantidad
|
Descuento = HdnDescuento.Value.ToDecimal * Cantidad
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Dim ValidaCondicionesComerciales As Boolean = True
|
||||||
|
|
||||||
'AGREGA PROMOCION EN EL DESCUENTO
|
'AGREGA PROMOCION EN EL DESCUENTO
|
||||||
Dim TipoPromo As Integer = 0
|
Dim TipoPromo As Integer = 0
|
||||||
Dim TotalPromocion As Decimal = 0
|
Dim TotalPromocion As Decimal = 0
|
||||||
Dim PromocionPorcentaje As Decimal = 0
|
Dim PromocionPorcentaje As Decimal = 0
|
||||||
Dim CantMinima As Integer = 0
|
Dim CantMinima As Integer = 0
|
||||||
|
Dim CveMarcaPS As Integer = 0
|
||||||
|
Dim CveClasifPS As Integer = 0
|
||||||
|
Dim CvePromocionDetalle As Integer = 0
|
||||||
|
Dim ObjDescuento As New Descuentos
|
||||||
|
|
||||||
|
Dim DrPS As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
|
||||||
|
If DrPS IsNot Nothing Then
|
||||||
|
|
||||||
|
CveMarcaPS = DrPS("CveMarca").ToString.ToEntero
|
||||||
|
CveClasifPS = DrPS("CveClasificacion").ToString.ToEntero
|
||||||
|
|
||||||
|
If CveClasifPS = 20636 Then
|
||||||
|
ValidaCondicionesComerciales = False
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
If DtPromociones IsNot Nothing AndAlso DtPromociones.Rows.Count > 0 Then
|
If DtPromociones IsNot Nothing AndAlso DtPromociones.Rows.Count > 0 Then
|
||||||
Dim dr As DataRow = DtPromociones.FiltroPrimero($"CvePS = {CvePS}")
|
Dim dr As DataRow = DtPromociones.FiltroPrimero($"CvePS = {CvePS}")
|
||||||
@@ -14269,6 +14299,18 @@ Partial Class Ventas
|
|||||||
TotalPromocion = dr("PUPromocion").ToString.ToDecimal * TxtCantidad.Text.ToDecimal
|
TotalPromocion = dr("PUPromocion").ToString.ToDecimal * TxtCantidad.Text.ToDecimal
|
||||||
PromocionPorcentaje = dr("Promocion").ToString.ToDecimal
|
PromocionPorcentaje = dr("Promocion").ToString.ToDecimal
|
||||||
CantMinima = dr("CantidadMinima").ToString.ToEntero
|
CantMinima = dr("CantidadMinima").ToString.ToEntero
|
||||||
|
CvePromocionDetalle = dr("CvePromocionDetalle").ToString.ToEntero
|
||||||
|
Else
|
||||||
|
'verifica marca, si tiene asignada la promocion
|
||||||
|
Dim drC As DataRow = DtPromociones.FiltroPrimero(String.Format("CveClasificacion = {0} AND (CveMarca = {1} OR CveMarca IS NULL)", CveClasifPS, CveMarcaPS))
|
||||||
|
|
||||||
|
If drC IsNot Nothing Then
|
||||||
|
TipoPromo = drC("TipoPromocion").ToString.ToEntero
|
||||||
|
TotalPromocion = drC("PUPromocion").ToString.ToDecimal * TxtCantidad.Text.ToDecimal
|
||||||
|
PromocionPorcentaje = drC("Promocion").ToString.ToDecimal
|
||||||
|
CantMinima = drC("CantidadMinima").ToString.ToEntero
|
||||||
|
CvePromocionDetalle = drC("CvePromocionDetalle").ToString.ToEntero
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -14279,15 +14321,11 @@ Partial Class Ventas
|
|||||||
ElseIf TipoPromo = 3 Then 'Promocion por Cantidad
|
ElseIf TipoPromo = 3 Then 'Promocion por Cantidad
|
||||||
If Cantidad >= CantMinima Then
|
If Cantidad >= CantMinima Then
|
||||||
Descuento = Descuento + TotalPromocion
|
Descuento = Descuento + TotalPromocion
|
||||||
|
Else
|
||||||
|
CvePromocionDetalle = -1
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
|
|
||||||
Dim ValidaCondicionesComerciales As Boolean = True
|
|
||||||
|
|
||||||
If DrPS IsNot Nothing AndAlso DrPS("CveClasificacion").ToString.ToEntero = 20636 Then
|
|
||||||
ValidaCondicionesComerciales = False
|
|
||||||
End If
|
|
||||||
|
|
||||||
'VERIFICA SI APLICAN CONDICIONES COMERCIALES
|
'VERIFICA SI APLICAN CONDICIONES COMERCIALES
|
||||||
If ValidaCondicionesComerciales AndAlso DtPorcentajeMarcas IsNot Nothing AndAlso DtPorcentajeMarcas.Rows.Count > 0 Then
|
If ValidaCondicionesComerciales AndAlso DtPorcentajeMarcas IsNot Nothing AndAlso DtPorcentajeMarcas.Rows.Count > 0 Then
|
||||||
@@ -14334,8 +14372,13 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Return Descuento
|
ObjDescuento.ImporteDescuento = Descuento
|
||||||
|
ObjDescuento.CvePromocionDetalle = CvePromocionDetalle
|
||||||
|
|
||||||
|
Return ObjDescuento
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
Private Sub AgregarPS()
|
Private Sub AgregarPS()
|
||||||
'SELECCIONA EL PS DEPENDIENDO LA MODALIDAD (CODIGO BARRAS - DDL)
|
'SELECCIONA EL PS DEPENDIENDO LA MODALIDAD (CODIGO BARRAS - DDL)
|
||||||
Dim CvePS As Integer = -1
|
Dim CvePS As Integer = -1
|
||||||
@@ -14353,12 +14396,12 @@ Partial Class Ventas
|
|||||||
|
|
||||||
Dim Cantidad As Decimal = TxtCantidad.Text.ToDecimal
|
Dim Cantidad As Decimal = TxtCantidad.Text.ToDecimal
|
||||||
Dim PU As Decimal = If(CvePSAmortizacion > 0, TxtPrecio.Text.Trim.ToDecimal * -1, TxtPrecio.Text.Trim.ToDecimal)
|
Dim PU As Decimal = If(CvePSAmortizacion > 0, TxtPrecio.Text.Trim.ToDecimal * -1, TxtPrecio.Text.Trim.ToDecimal)
|
||||||
Dim Descuento As Decimal = CalcularDescuentos(CvePS, Cantidad, PU)
|
Dim ObjDescuento As Descuentos = CalcularDescuentos(CvePS, Cantidad, PU)
|
||||||
|
|
||||||
AgregarProductoServicio(Cantidad, DdlUnidadMedida.SelectedValue.ToEntero, DdlUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text,
|
AgregarProductoServicio(Cantidad, DdlUnidadMedida.SelectedValue.ToEntero, DdlUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text,
|
||||||
CvePS, "", TxtObsPS.Text.Trim, PU, Descuento,
|
CvePS, "", TxtObsPS.Text.Trim, PU, ObjDescuento.ImporteDescuento,
|
||||||
DdlProyecto.SelectedValue.ToEntero, DdlProyecto.SelectedItem.Text, DdlSubProyecto.SelectedValue.ToEntero, DdlSubProyecto.SelectedItem.Text,
|
DdlProyecto.SelectedValue.ToEntero, DdlProyecto.SelectedItem.Text, DdlSubProyecto.SelectedValue.ToEntero, DdlSubProyecto.SelectedItem.Text,
|
||||||
SerieLote:=If(DIVCod.Visible, TxtCodigoSerie.Text.Trim, ""), TiempoEntrega:=TxtTiempoEntrega.Text, CuentaPredial:=TxtCuentaPredial.Text.Trim, RegeneraIEPS:=ClienteDesglosaIEPS)
|
SerieLote:=If(DIVCod.Visible, TxtCodigoSerie.Text.Trim, ""), TiempoEntrega:=TxtTiempoEntrega.Text, CuentaPredial:=TxtCuentaPredial.Text.Trim, RegeneraIEPS:=ClienteDesglosaIEPS, CvePromocionDetalle:=ObjDescuento.CvePromocionDetalle)
|
||||||
|
|
||||||
CalculaUsados()
|
CalculaUsados()
|
||||||
|
|
||||||
@@ -14390,10 +14433,10 @@ Partial Class Ventas
|
|||||||
|
|
||||||
Dim CvePS As Integer = DdlPSPyME.SelectedValue.ToEntero
|
Dim CvePS As Integer = DdlPSPyME.SelectedValue.ToEntero
|
||||||
|
|
||||||
Dim Descuento As Decimal = CalcularDescuentos(CvePS, Cantidad, PU)
|
Dim Descuento As Descuentos = CalcularDescuentos(CvePS, Cantidad, PU)
|
||||||
|
|
||||||
AgregarProductoServicio(Cantidad, DdlUMPyME.SelectedValue.ToEntero, DdlUMPyME.SelectedItem.Text, DdlClasificacionPyME.SelectedValue.ToEntero, DdlClasificacionPyME.SelectedItem.Text,
|
AgregarProductoServicio(Cantidad, DdlUMPyME.SelectedValue.ToEntero, DdlUMPyME.SelectedItem.Text, DdlClasificacionPyME.SelectedValue.ToEntero, DdlClasificacionPyME.SelectedItem.Text,
|
||||||
CvePS, DdlPSPyME.SelectedText, TxtObsPyME.Text, PU, Descuento, CveProyecto, Proyecto, CveSubProyecto, SubProyecto)
|
CvePS, DdlPSPyME.SelectedText, TxtObsPyME.Text, PU, Descuento.ImporteDescuento, CveProyecto, Proyecto, CveSubProyecto, SubProyecto)
|
||||||
|
|
||||||
CalculaUsados()
|
CalculaUsados()
|
||||||
CalculaTotalesVenta()
|
CalculaTotalesVenta()
|
||||||
@@ -14492,7 +14535,7 @@ Partial Class Ventas
|
|||||||
Optional CveContratoDetalle As Integer = 0, Optional CveVentaDetalle As Integer = 0, Optional CveMovimientoDetallePedido As Integer = 0,
|
Optional CveContratoDetalle As Integer = 0, Optional CveVentaDetalle As Integer = 0, Optional CveMovimientoDetallePedido As Integer = 0,
|
||||||
Optional CveOrdenCompraDetalle As Integer = 0, Optional CveVentaDetalleRemision As Integer = 0, Optional CveVentaDetalleCotizacion As Integer = 0,
|
Optional CveOrdenCompraDetalle As Integer = 0, Optional CveVentaDetalleRemision As Integer = 0, Optional CveVentaDetalleCotizacion As Integer = 0,
|
||||||
Optional CuentaPredial As String = "", Optional RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0,
|
Optional CuentaPredial As String = "", Optional RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0,
|
||||||
Optional SeActualiza As Boolean = False) As Boolean
|
Optional SeActualiza As Boolean = False, Optional CvePromocionDetalle As Integer = -1) As Boolean
|
||||||
|
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
If Not CvePS > 0 Then
|
If Not CvePS > 0 Then
|
||||||
@@ -14639,6 +14682,7 @@ Partial Class Ventas
|
|||||||
Row("IEPS") = Row("ImporteIEPS")
|
Row("IEPS") = Row("ImporteIEPS")
|
||||||
Row("Descuento") = (Descuento).RoundSQL(NumeroDecimales)
|
Row("Descuento") = (Descuento).RoundSQL(NumeroDecimales)
|
||||||
Row("TipoDescuento") = HdnTipoDescuento.Value
|
Row("TipoDescuento") = HdnTipoDescuento.Value
|
||||||
|
Row("CvePromocionDetalle") = CvePromocionDetalle
|
||||||
Row("Total") = (Cantidad * PU)
|
Row("Total") = (Cantidad * PU)
|
||||||
Row("TotalImporte") = (Cantidad * PU).RoundSQL(NumeroDecimales)
|
Row("TotalImporte") = (Cantidad * PU).RoundSQL(NumeroDecimales)
|
||||||
|
|
||||||
@@ -14830,6 +14874,7 @@ Partial Class Ventas
|
|||||||
TmpDT.Columns.Add("CveSubProyecto", GetType(Integer))
|
TmpDT.Columns.Add("CveSubProyecto", GetType(Integer))
|
||||||
TmpDT.Columns.Add("SubProyecto", GetType(String))
|
TmpDT.Columns.Add("SubProyecto", GetType(String))
|
||||||
TmpDT.Columns.Add("CveVentaDetallePadre", GetType(Integer))
|
TmpDT.Columns.Add("CveVentaDetallePadre", GetType(Integer))
|
||||||
|
TmpDT.Columns.Add("CvePromocionDetalle", GetType(Integer))
|
||||||
|
|
||||||
'TipoDescuento: 1 = Descuento * PU; 2 = Descuento por Total del concepto
|
'TipoDescuento: 1 = Descuento * PU; 2 = Descuento por Total del concepto
|
||||||
TmpDT.Columns.Add("CvePresupuestoIngreso", GetType(Integer))
|
TmpDT.Columns.Add("CvePresupuestoIngreso", GetType(Integer))
|
||||||
@@ -18290,6 +18335,8 @@ Partial Class Ventas
|
|||||||
Case "egreso" : DdlTipoComprobante.SelectedValue = "Egs"
|
Case "egreso" : DdlTipoComprobante.SelectedValue = "Egs"
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
|
Dim Descuentos As Decimal = 0
|
||||||
|
|
||||||
|
|
||||||
RFC = ReceptorRFC
|
RFC = ReceptorRFC
|
||||||
TxtFecha.Text = Fecha
|
TxtFecha.Text = Fecha
|
||||||
@@ -18556,7 +18603,7 @@ Partial Class Ventas
|
|||||||
_Fecha = ValorXML(nodo, "fecha")
|
_Fecha = ValorXML(nodo, "fecha")
|
||||||
SubTotal = ValorXML(nodo, "subTotal").ToDecimal
|
SubTotal = ValorXML(nodo, "subTotal").ToDecimal
|
||||||
Total = ValorXML(nodo, "total").ToDecimal
|
Total = ValorXML(nodo, "total").ToDecimal
|
||||||
Descuentos = ValorXML(nodo, "descuento").ToDecimal
|
'Descuentos = ValorXML(nodo, "descuento").ToDecimal
|
||||||
_Moneda = ValorXML(nodo, "Moneda")
|
_Moneda = ValorXML(nodo, "Moneda")
|
||||||
_TipoComprobante = ValorXML(nodo, "tipoDeComprobante")
|
_TipoComprobante = ValorXML(nodo, "tipoDeComprobante")
|
||||||
|
|
||||||
@@ -20058,11 +20105,11 @@ Partial Class Ventas
|
|||||||
Dim Cantidad As Decimal = TxtCantidadPyME.Text.ToDecimal()
|
Dim Cantidad As Decimal = TxtCantidadPyME.Text.ToDecimal()
|
||||||
Dim PU As Decimal = TxtPrecioPyME.Text.ToDecimal()
|
Dim PU As Decimal = TxtPrecioPyME.Text.ToDecimal()
|
||||||
|
|
||||||
Dim Descuento As Decimal = CalcularDescuentos(DdlPSPyME.SelectedValue.ToEntero, Cantidad, PU)
|
Dim ObjDescuento As Descuentos = CalcularDescuentos(DdlPSPyME.SelectedValue.ToEntero, Cantidad, PU)
|
||||||
|
|
||||||
TxtDescuentoPyME.Text = Descuento.FormatoNumero(2).Replace(","c, "")
|
TxtDescuentoPyME.Text = ObjDescuento.ImporteDescuento.FormatoNumero(2).Replace(","c, "")
|
||||||
|
|
||||||
LblTotalPyME.Text = ((Cantidad * PU) - Descuento).FormatoNumero(2).Replace(","c, "")
|
LblTotalPyME.Text = ((Cantidad * PU) - ObjDescuento.ImporteDescuento).FormatoNumero(2).Replace(","c, "")
|
||||||
|
|
||||||
If UsuarioActual.CveEmpresa = 80 Then
|
If UsuarioActual.CveEmpresa = 80 Then
|
||||||
'busca el precio de la sucursal
|
'busca el precio de la sucursal
|
||||||
@@ -25155,4 +25202,8 @@ Partial Class Ventas
|
|||||||
' ObjBancos.Dispose()
|
' ObjBancos.Dispose()
|
||||||
' If ObjAC IsNot Nothing Then ObjAC.Dispose()
|
' If ObjAC IsNot Nothing Then ObjAC.Dispose()
|
||||||
'End Sub
|
'End Sub
|
||||||
|
Partial Class Descuentos
|
||||||
|
Public ImporteDescuento As Decimal = 0
|
||||||
|
Public CvePromocionDetalle As Integer = -1
|
||||||
|
End Class
|
||||||
End Class
|
End Class
|
||||||
Reference in New Issue
Block a user