This commit is contained in:
2020-12-03 11:09:49 -07:00
23 changed files with 1147 additions and 117 deletions

View File

@@ -1257,7 +1257,7 @@ Partial Class ProductosyServicios
End If
Next
End If
If UsuarioActual.Empresa.Funcionalidad(563) <> "" Then
If UsuarioActual.Empresa.Funcionalidad(563) <> "" AndAlso ChkAplicaParaVenta.Checked Then
TieneError = GuardarProductoEnFranquicia(ObjProductosServicios, PSS, CveMetodoInv, EsPaquete, True)
End If
@@ -1323,7 +1323,7 @@ Partial Class ProductosyServicios
Next
End If
If UsuarioActual.Empresa.Funcionalidad(563) <> "" Then
If UsuarioActual.Empresa.Funcionalidad(563) <> "" AndAlso ChkAplicaParaVenta.Checked Then
TieneError = GuardarProductoEnFranquicia(ObjProductosServicios, PSS, CveMetodoInv, EsPaquete, False)
End If

View File

@@ -102,7 +102,7 @@
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server"
DataKeyNames="Nombre,FolioPago,SerieFolio,CveVenta,CveIE,CveCliente,Transaccion,CveVendedor,CveSubProyecto,Vendedor,SubProyecto,CveCategoria,CveMoneda,Costo,CostoDolares,Comision,PorcentajeComision,TieneCategoriaValida,CodigoPS"
DataKeyNames="Nombre,FolioPago,SerieFolio,CveVenta,CveIE,CveCliente,Transaccion,CveVendedor,CveSubProyecto,Vendedor,SubProyecto,CveCategoria,CveMoneda,Costo,CostoDolares,Comision,PorcentajeComision,TieneCategoriaValida,CodigoPS,PorcentajePrecioPublico,DiasPago"
EmptyDataText="No se han encontrado datos con los filtros especificados." data-sort="true" GridLines="None"
CssClass="table table-hover table-striped Widthall ScrollAD " Width="100%" AutoGenerateColumns="False"
OnRowDataBound="GvDatos_RowDataBound" OnPreRender="GvDatos_PreRender">

View File

@@ -113,28 +113,24 @@ public partial class Ventas_RepComisionesJAM : ClsPaginas
{
e.Row.CssClass = "SubTotales2";
//e.Row.Cells[0].Text = e.Row.DBCampo("Vendedor").ToString();
}
else
{
if (e.Row.DBCampo("Transaccion").ToString() == "Pago" && ChkEsquemaNuevo.Checked)
{
e.Row.FCLinkButton("LnkInfo").Visible = true;
//if (e.Row.DBCampo("CveCategoria").ToEntero() < 1 && e.Row.DBCampo("Comision").ToDouble() == 0)
//{
// //if (UsuarioActual.TienePermisoProceso(201))
// //{
// // e.Row.Cells[21].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales.";
// // e.Row.Cells[22].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales.";
// //}
// //else
// //{
// e.Row.Cells[21].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales.";
// e.Row.Cells[22].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales.";
// //}
//}else if (e.Row.DBCampo("CveCategoria").ToEntero() > 0 )
//{
// e.Row.Cells[21].ToolTip = $"El producto obtuvo la comision porque se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria",$"CveCategoria = {e.Row.DBCampo("CveCategoria").ToString()}")}.";
// e.Row.Cells[22].ToolTip = $"El producto obtuvo la comision porque se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {e.Row.DBCampo("CveCategoria").ToString()}")}.";
}
else
{
if (e.Row.DBCampo("Transaccion").ToString() == "Pago" && ChkEsquemaNuevo.Checked)
{
e.Row.FCLinkButton("LnkInfo").Visible = true;
if (!Convert.ToBoolean(e.Row.DataKey("TieneCategoriaValida")) && e.Row.DataKey("Comision").ToDouble() == 0)
{
e.Row.FCLinkButton("LnkInfo").ToolTip = $"No se encuentra dentro de alguna categoria que de comision ni alguno de los productos especiales. La categoria del producto es: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = { e.Row.DataKey("CveCategoria").ToString()}")}. % Precio Publico: {e.Row.DataKey("PorcentajePrecioPublico").ToString()}. Dias Pago: {e.Row.DataKey("DiasPago").ToString()}.";
}
else if (Convert.ToBoolean(e.Row.DataKey("TieneCategoriaValida")) && e.Row.DataKey("Comision").ToDouble() > 0)
{
e.Row.FCLinkButton("LnkInfo").ToolTip = $"El producto obtuvo la comision porque se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {e.Row.DataKey("CveCategoria").ToString()}")} y esta dentro de los rangos de precio publico y dias validos. % Precio Publico: {e.Row.DataKey("PorcentajePrecioPublico").ToString()}. Dias Pago: {e.Row.DataKey("DiasPago").ToString()}.";
}
else if (Convert.ToBoolean(e.Row.DataKey("TieneCategoriaValida")) && e.Row.DataKey("Comision").ToDouble() == 0)
{
e.Row.FCLinkButton("LnkInfo").ToolTip = $"El producto se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {e.Row.DataKey("CveCategoria").ToString()}")} que da comision, pero no se encuentra dentro de los rangos de precio publico y dias validos. % Precio Publico: {e.Row.DataKey("PorcentajePrecioPublico").ToString()}. Dias Pago: {e.Row.DataKey("DiasPago").ToString()}.";
}
else if (e.Row.DataKey("Comision").ToDouble() > 0)
{
e.Row.FCLinkButton("LnkInfo").ToolTip = $"El producto obtuvo comision porque esta dentro de los de las comisiones especiales. La categoria del producto es: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = { e.Row.DataKey("CveCategoria").ToString()}")}. El producto es: <b>{e.Row.DataKey("CodigoPS").ToString()}</b>. % Precio Publico: {e.Row.DataKey("PorcentajePrecioPublico").ToString()}. Dias Pago: {e.Row.DataKey("DiasPago").ToString()}.";
@@ -357,19 +353,19 @@ public partial class Ventas_RepComisionesJAM : ClsPaginas
}
protected void LnkInfo_Click(object sender, EventArgs e)
protected void LnkInfo_Click(object sender, EventArgs e)
{
GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
if (!Convert.ToBoolean(gvRow.DataKey("TieneCategoriaValida")) && gvRow.DataKey("Comision").ToDouble() == 0)
if (!Convert.ToBoolean(gvRow.DataKey("TieneCategoriaValida")) && gvRow.DataKey("Comision").ToDouble() == 0)
{
LblInfo.Text = $"No se encuentra dentro de alguna categoria que de comision ni alguno de los productos especiales.<br/> La categoria del producto es: <b>{get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = { gvRow.DataKey("CveCategoria").ToString()}")}</b>. <br/> % Precio Publico: <b>{gvRow.DataKey("PorcentajePrecioPublico").ToString()}</b> <br/> Dias Pago: <b>{gvRow.DataKey("DiasPago").ToString()}</b>";
}
else if (Convert.ToBoolean(gvRow.DataKey("TieneCategoriaValida")) && gvRow.DataKey("Comision").ToDouble() > 0)
else if (Convert.ToBoolean(gvRow.DataKey("TieneCategoriaValida")) && gvRow.DataKey("Comision").ToDouble() > 0)
{
LblInfo.Text = $"El producto obtuvo la comision porque se encuentra en la categoria: <b>{get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {gvRow.DataKey("CveCategoria").ToString()}")}</b> y esta dentro de los rangos de precio publico y dias validos. <br/> % Precio Publico: <b>{gvRow.DataKey("PorcentajePrecioPublico").ToString()}</b> <br/> Dias Pago: <b>{gvRow.DataKey("DiasPago").ToString()}</b>";
}
else if (Convert.ToBoolean(gvRow.DataKey("TieneCategoriaValida")) && gvRow.DataKey("Comision").ToDouble() == 0)
else if (Convert.ToBoolean(gvRow.DataKey("TieneCategoriaValida")) && gvRow.DataKey("Comision").ToDouble() == 0)
{
LblInfo.Text = $"El producto se encuentra en la categoria: <b>{get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {gvRow.DataKey("CveCategoria").ToString()}")}</b> que da comision, pero no se encuentra dentro de los rangos de precio publico y dias validos. <br/> % Precio Publico: <b>{gvRow.DataKey("PorcentajePrecioPublico").ToString()}</b> <br/> Dias Pago: <b>{gvRow.DataKey("DiasPago").ToString()}</b>";
}

View File

@@ -3926,7 +3926,7 @@ Partial Class Ventas
LblAlertRefacInv.Visible = True
End If
If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Ing", "Ant", "Dev", "Rem", "DPe", "RNC") AndAlso Not CveEstatus.Contiene(4, 5, 12, 13, 20) Then
If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Ing", "Ant", "Dev", "Rem", "DPe", "RNC", "Pd2") AndAlso Not CveEstatus.Contiene(4, 5, 12, 13, 20) Then
If UsuarioActual.TienePermisoProceso(159) Then
Dim TienePermiso As String = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, -1).FiltroPrimeroValor("CveSubProyecto", String.Format("CveSubProyecto = {0}", DbRowVenta("CveSubProyecto")))
If TienePermiso <> "" Then
@@ -6697,6 +6697,7 @@ Partial Class Ventas
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)("ImporteRetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
TmpDT.Rows(e.RowIndex)("RetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
TmpDT.Rows(e.RowIndex)("ImporteRetISR") = (ClienteRetISR * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
TmpDT.Rows(e.RowIndex)("PorcentajeRetIVA") = ClienteRetIVA
TmpDT.Rows(e.RowIndex)("PorcentajeRetISR") = ClienteRetISR
@@ -16309,6 +16310,7 @@ Partial Class Ventas
Row("IVA") = Row("PorcentajeIVA")
Row("ImporteIVA") = (Row("PorcentajeIVA").ToString().ToDecimal * TotalCalculableImpuestosIVA).RoundAD(NumeroDecimales)
Row("ImporteRetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundAD(NumeroDecimales)
Row("RetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundAD(NumeroDecimales)
Row("ImporteRetISR") = (ClienteRetISR * TotalCalculableImpuestos).RoundAD(NumeroDecimales)
Row("PorcentajeRetIVA") = ClienteRetIVA
Row("PorcentajeRetISR") = ClienteRetISR
@@ -20879,8 +20881,16 @@ Partial Class Ventas
RegistraScript("$('#ModalCancelarDocumento').modal();")
UpCancelarDocumento.Update()
sb.Clear()
ElseIf DdlTipoComprobante.SelectedValue.Contiene("Pd2") Then
Dim ObjVentas As New ClsVentas
If ObjVentas.UpdateEstatusVenta(CveVenta, 22, UsuarioActual.CveEmpresa) Then
Dim redirectString As String = String.Format("document.location.href=""/Ventas/Ventas.aspx?CveVenta={0}""", CveVenta)
Alert("Pedido cancelado.", JSBtnAceptar:=redirectString)
', "document.location.href=""/Ventas/Ventas.aspx?CveVenta=" & CveVenta
End If
ObjVentas.Dispose()
Else
CancelarDocumento()
CancelarDocumento()
End If
End Sub
@@ -25785,7 +25795,8 @@ Partial Class Ventas
If Not ObjVentas.AddVentaDetalle(CveVenta, Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDouble, Row("CveUM").ToString().ToEntero(),
Row("PU").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("ImporteIVA").ToString().ToDouble, Math.Round((Row("Total").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)) * (1 + Row("PorcentajeIVA").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)))), 6),
Row("Obs").ToString(), Row("Descuento").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("TipoDescuento").ToString().ToEntero(), Row("CveSubProyecto").ToString().ToEntero(), Row("CvePresupuestoIngreso").ToString().ToEntero(),
PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, IEPS:=Row("ImporteIEPS").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDouble, TiempoEntrega:=Row("TiempoEntrega").ToString()) Then
PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, IEPS:=Row("ImporteIEPS").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDouble, TiempoEntrega:=Row("TiempoEntrega").ToString(),
PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString().ToDecimal, ImporteRetIVA:=Row("ImporteRetIVA").ToString().ToDecimal) Then
MensajeError = "Ocurrió un error al guardar las partidas de la cotización"
OcurrioError = True
Exit For