Merge branch 'master' of http://agonzalez@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -838,7 +838,7 @@
|
||||
</div>
|
||||
<div id="DivRetenciones" runat="server">
|
||||
<div id="DivTipoRetenciones" runat="server" visible="false" class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlTipoRetencion" AutoPostBack="true" OnSelectedIndexChanged="DdlTipoRetencion_SelectedIndexChanged" CssClass="form-control select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="MetodoPago" DataValueField="CveMetodoPago" ValidationGroup="GrpGuardar">
|
||||
<asp:DropDownList ID="DdlTipoRetencion" CssClass="form-control select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="MetodoPago" DataValueField="CveMetodoPago" ValidationGroup="GrpGuardar">
|
||||
<asp:ListItem Selected="True" Text="Sin Retención" Value="0"></asp:ListItem>
|
||||
<asp:ListItem Text="Arrendamiento" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Servicios Profesionales" Value="2"></asp:ListItem>
|
||||
|
||||
@@ -9940,23 +9940,6 @@ Partial Class Clientes
|
||||
Acum.Dispose()
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
Protected Sub DdlTipoRetencion_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
Select Case DdlTipoRetencion.SelectedValue
|
||||
Case "1" 'Arrendamiento
|
||||
TxtRetIVA.Text = "10"
|
||||
TxtRetISR.Text = "10"
|
||||
Case "2" 'Servicios Profesionales
|
||||
TxtRetIVA.Text = "10"
|
||||
TxtRetISR.Text = "10"
|
||||
Case "3" 'Fletes
|
||||
TxtRetIVA.Text = "4"
|
||||
TxtRetISR.Text = "4"
|
||||
Case "4" 'Servicios
|
||||
TxtRetIVA.Text = "6"
|
||||
TxtRetISR.Text = "6"
|
||||
End Select
|
||||
UpFiscalContable.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
End Class
|
||||
|
||||
|
||||
@@ -27,39 +27,49 @@ public partial class Ventas_RepCancelacionesPorAtender : ClsPaginas
|
||||
}
|
||||
private void CargarPendientes()
|
||||
{
|
||||
Cancelacion.CancelacionSoapClient objServicio = new Cancelacion.CancelacionSoapClient();
|
||||
Cancelacion.StructCancel resp = objServicio.ObtienePendientes(UsuarioActual.Empresa.RFC, "UserTest", "1234567890");
|
||||
if (resp.Estado == 0)
|
||||
|
||||
//Cancelacion.CancelacionSoapClient objServicio = new Cancelacion.CancelacionSoapClient();
|
||||
//Cancelacion.StructCancel resp = objServicio.ObtienePendientes(UsuarioActual.Empresa.RFC, "UserTest", "1234567890");
|
||||
//if (resp.Estado == 0)
|
||||
//{
|
||||
// string XmlPendientes = DecodeBase64(resp.Xml);
|
||||
// StringReader theReader = new StringReader(XmlPendientes);
|
||||
// DataSet theDataSet = new DataSet();
|
||||
// theDataSet.ReadXml(theReader);
|
||||
// if (theDataSet.Tables[0].Rows[0]["Uuid"].ToString() != "null")
|
||||
// {
|
||||
// var sb = new StringBuilder();
|
||||
// foreach (DataRow item in theDataSet.Tables[0].Rows)
|
||||
// {
|
||||
// sb.AppendFormat("{0};", item["Uuid"].ToString());
|
||||
// }
|
||||
// var ObjVentas = new ClsVentas();
|
||||
// if (ObjVentas.GetFacturasCanceladasPendientes(sb.ToString(), UsuarioActual.CveEmpresa))
|
||||
// {
|
||||
// GvDatos.DataSource = ObjVentas.DtResultados;
|
||||
// }
|
||||
// ObjVentas.Dispose();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// GvDatos.DataSource = null;
|
||||
// Alert("No se encontraron cancelaciones pendientes");
|
||||
// }
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// GvDatos.DataSource = null;
|
||||
// Alert("Error al obtener cancelaciones pendientes: " + resp.Descripcion, ModExtensiones.TipoMensaje.MsgError);
|
||||
//}
|
||||
using (ClsVentas ObjVentas = new ClsVentas())
|
||||
{
|
||||
string XmlPendientes = DecodeBase64(resp.Xml);
|
||||
StringReader theReader = new StringReader(XmlPendientes);
|
||||
DataSet theDataSet = new DataSet();
|
||||
theDataSet.ReadXml(theReader);
|
||||
if (theDataSet.Tables[0].Rows[0]["Uuid"].ToString() != "null")
|
||||
if (ObjVentas.GetFacturasCanceladasPendientesWS(UsuarioActual.Empresa.RFC, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
foreach (DataRow item in theDataSet.Tables[0].Rows)
|
||||
{
|
||||
sb.AppendFormat("{0};", item["Uuid"].ToString());
|
||||
}
|
||||
var ObjVentas = new ClsVentas();
|
||||
if (ObjVentas.GetFacturasCanceladasPendientes(sb.ToString(), UsuarioActual.CveEmpresa))
|
||||
{
|
||||
GvDatos.DataSource = ObjVentas.DtResultados;
|
||||
}
|
||||
ObjVentas.Dispose();
|
||||
}
|
||||
else
|
||||
{
|
||||
GvDatos.DataSource = null;
|
||||
Alert("No se encontraron cancelaciones pendientes");
|
||||
GvDatos.DataSource = ObjVentas.DtResultados;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GvDatos.DataSource = null;
|
||||
Alert("Error al obtener cancelaciones pendientes: " + resp.Descripcion, ModExtensiones.TipoMensaje.MsgError);
|
||||
}
|
||||
|
||||
|
||||
GvDatos.DataBind();
|
||||
UPDatos.Update();
|
||||
}
|
||||
@@ -153,9 +163,8 @@ public partial class Ventas_RepCancelacionesPorAtender : ClsPaginas
|
||||
private string DecodeBase64(string strXMLCodificado)
|
||||
{
|
||||
try
|
||||
{
|
||||
byte[] decbuff = Convert.FromBase64String(strXMLCodificado);
|
||||
return System.Text.Encoding.UTF8.GetString(decbuff);
|
||||
{
|
||||
return System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(strXMLCodificado));
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
@@ -1372,16 +1372,15 @@
|
||||
<td>
|
||||
<asp:Label ID="LblRetIVA" runat="server" BorderStyle="None" Text="0.00"></asp:Label> (%)
|
||||
</td>
|
||||
<%-- <td>
|
||||
<asp:DropDownList ID="DdlTipoRetencion" AutoPostBack="true" OnSelectedIndexChanged="DdlTipoRetencion_SelectedIndexChanged" CssClass="form-control select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="MetodoPago" DataValueField="CveMetodoPago" ValidationGroup="GrpGuardar">
|
||||
<td>
|
||||
<asp:DropDownList ID="DdlTipoRetencion" Visible="false" AutoPostBack="true" OnSelectedIndexChanged="DdlTipoRetencion_SelectedIndexChanged" CssClass="form-control input-sm" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="MetodoPago" DataValueField="CveMetodoPago" ValidationGroup="GrpGuardar">
|
||||
<asp:ListItem Selected="True" Text="Sin Retención" Value="0"></asp:ListItem>
|
||||
<asp:ListItem Text="Arrendamiento" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Servicios Profesionales" Value="2"></asp:ListItem>
|
||||
<asp:ListItem Text="Fletes" Value="3"></asp:ListItem>
|
||||
<asp:ListItem Text="Servicios" Value="4"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</td>--%>
|
||||
<td></td>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="TrRetISR" runat="server" align="right" style="display: none;">
|
||||
|
||||
@@ -4113,6 +4113,7 @@ Partial Class Ventas
|
||||
|
||||
'Sección Detalle
|
||||
DdlMoneda.Enabled = False
|
||||
DdlTipoRetencion.Enabled = False
|
||||
TxtFechaEjecucion.ReadOnly = True
|
||||
ImgCalendarFechaEje.Enabled = False
|
||||
'DdlSucursalEjecucion.Enabled = False
|
||||
@@ -4701,6 +4702,9 @@ Partial Class Ventas
|
||||
ViewState("ClienteRetIVA") = ObjCliente.RetIVA / 100
|
||||
ViewState("ClienteRetISR") = ObjCliente.RetISR / 100
|
||||
|
||||
DdlTipoRetencion.SelectedValueExist(ObjCliente.DtResultados(0)("CveTipoRetencion").ToString)
|
||||
DdlTipoRetencion_SelectedIndexChanged(DdlTipoRetencion, EventArgs.Empty)
|
||||
|
||||
ViewState("RetIVAFletes") = ObjCliente.RetieneIVAFletes
|
||||
If ObjCliente.RetieneIVAFletes Then
|
||||
TrRetIVA.Style.Add("display", "")
|
||||
@@ -4739,8 +4743,6 @@ Partial Class Ventas
|
||||
End If
|
||||
ViewState("CargoUsado") = ObjCliente.CargoUsados
|
||||
|
||||
'DdlTipoRetencion.SelectedValueExist(ObjCliente.DtResultados(0)("CveTipoRetencion").ToString)
|
||||
|
||||
Dim dr As DataRow = Nothing
|
||||
dr = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal = 1 And Estatus = 'Activo' AND CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
If dr IsNot Nothing Then
|
||||
@@ -5924,6 +5926,20 @@ Partial Class Ventas
|
||||
Dim TotalCalculableImpuestosIVA As Decimal = 0
|
||||
TotalCalculableImpuestosIVA = TotalCalculableImpuestos * (1 + TmpDT.Rows(e.RowIndex)("PorcentajeIEPS").ToString.ToDecimal)
|
||||
|
||||
Dim ClienteRetIVA = Me.ClienteRetIVA
|
||||
If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then
|
||||
If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then
|
||||
ClienteRetIVA = 0.1D
|
||||
ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then
|
||||
ClienteRetIVA = 0.04D
|
||||
ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") Then
|
||||
ClienteRetIVA = 0.06D
|
||||
End If
|
||||
|
||||
LblRetIVA.Text = (ClienteRetIVA * 100).FormatoNumero
|
||||
DdlTipoRetencion.Visible = True
|
||||
End If
|
||||
|
||||
|
||||
TmpDT.Rows(e.RowIndex)("CveUM") = GvPS.Rows(e.RowIndex).FCDropDownList("DdlUnidadMedida").SelectedValue.ToEntero
|
||||
TmpDT.Rows(e.RowIndex)("UM") = GvPS.Rows(e.RowIndex).FCDropDownList("DdlUnidadMedida").SelectedItem.Text
|
||||
@@ -7595,10 +7611,10 @@ Partial Class Ventas
|
||||
End Function
|
||||
|
||||
|
||||
Private Sub CreaObjetosVenta(Optional VistaPrevia As Boolean = False)
|
||||
Private Sub CreaObjetosVenta(Optional VistaPrevia As Boolean = False, Optional EsCancelacion As Boolean = False)
|
||||
|
||||
If Me.CveVenta > 0 AndAlso NuevaFactura <> 1 Then
|
||||
ObjFactura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa)
|
||||
ObjFactura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=EsCancelacion)
|
||||
Else
|
||||
ObjFactura = New Modelos.Factura
|
||||
End If
|
||||
@@ -14229,6 +14245,20 @@ Partial Class Ventas
|
||||
Row("PorcentajeIVA") = DrPS("IVA")
|
||||
End If
|
||||
|
||||
Dim ClienteRetIVA = Me.ClienteRetIVA
|
||||
If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then
|
||||
If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then
|
||||
ClienteRetIVA = 0.1D
|
||||
ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then
|
||||
ClienteRetIVA = 0.04D
|
||||
ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso DrPS("CveTipoPS").ToString().ToEntero() = 1 Then
|
||||
ClienteRetIVA = 0.06D
|
||||
End If
|
||||
|
||||
LblRetIVA.Text = (ClienteRetIVA * 100).FormatoNumero
|
||||
DdlTipoRetencion.Visible = True
|
||||
End If
|
||||
|
||||
Row("IVA") = Row("PorcentajeIVA")
|
||||
Row("ImporteIVA") = Math.Round(Row("PorcentajeIVA").ToString.ToDecimal * TotalCalculableImpuestosIVA, NumeroDecimales)
|
||||
Row("ImporteRetIVA") = Math.Round(ClienteRetIVA * TotalCalculableImpuestos, NumeroDecimales)
|
||||
@@ -18447,7 +18477,8 @@ Partial Class Ventas
|
||||
CancelarRefacturada()
|
||||
End If
|
||||
|
||||
CreaObjetosVenta()
|
||||
CreaObjetosVenta(EsCancelacion:=True)
|
||||
|
||||
Dim resp As Modelos.Factura.MCancelacionVentaMensaje = Nothing
|
||||
|
||||
If ObjFactura IsNot Nothing AndAlso ObjFactura.CveVenta > 0 Then
|
||||
@@ -18465,9 +18496,6 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
ObjFactura.CveAlmacenDevolucion = CveAlmacenDevolucion
|
||||
If ChkDevAlm.Checked Then
|
||||
ObjFactura.CveAlmacenDevolucion = CveAlmacenDevolucion
|
||||
End If
|
||||
|
||||
resp = ObjFactura.CancelarFactura(ChkDevAlm.Checked, ListaRemisionesCancelar)
|
||||
End If
|
||||
@@ -23871,10 +23899,12 @@ Partial Class Ventas
|
||||
CargaRNC()
|
||||
RegistraScript("$('#ModalAplicarRemisionesNC').modal({backdrop: 'static', keyboard: false });")
|
||||
End Sub
|
||||
|
||||
#Region "P O L I Z A - V I R T U A L"
|
||||
Protected Sub GeneraPolizaVentaWS(ObjFactura As Modelos.Factura)
|
||||
Dim DtUsados As DataTable = Nothing
|
||||
Dim ObjAcum As New ClsAcumuladores
|
||||
If ObjAcum.GetGarantiasDetalle(ObjFactura.CveVenta) Then
|
||||
If ObjAcum.GetGarantiasPolizaVirtual(ObjFactura.CveVenta) Then
|
||||
DtUsados = ObjAcum.DtResultados.Copy()
|
||||
End If
|
||||
ObjAcum.Dispose()
|
||||
@@ -23998,19 +24028,39 @@ Partial Class Ventas
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
'Protected Sub DdlTipoRetencion_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
' Dim PorcentajeRetencion As Decimal = 0
|
||||
' Select Case DdlTipoRetencion.SelectedValue
|
||||
' Case "1" 'Arrendamiento
|
||||
' PorcentajeRetencion = 10
|
||||
' Case "2" 'Servicios Profesionales
|
||||
' PorcentajeRetencion = 10
|
||||
' Case "3" 'Fletes
|
||||
' PorcentajeRetencion = 4
|
||||
' Case "4" 'Servicios
|
||||
' PorcentajeRetencion = 6
|
||||
' End Select
|
||||
#End Region
|
||||
|
||||
'End Sub
|
||||
Protected Sub DdlTipoRetencion_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then
|
||||
If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count > 0 Then
|
||||
For Each RowServicio As DataRow In TmpDT.Rows
|
||||
Dim ClienteRetIVA = Me.ClienteRetIVA
|
||||
If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then
|
||||
ClienteRetIVA = 0.1D
|
||||
ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then
|
||||
ClienteRetIVA = 0.04D
|
||||
ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso RowServicio("CveTipoPS").ToString().ToEntero() = 1 Then
|
||||
ClienteRetIVA = 0.06D
|
||||
End If
|
||||
|
||||
Dim TotalCalculableImpuestos As Decimal = (RowServicio("Cantidad").ToString().ToDecimal() * RowServicio("PU").ToString().ToDecimal()) - RowServicio("Descuento").ToString().ToDecimal()
|
||||
RowServicio("ImporteRetIVA") = (TotalCalculableImpuestos * ClienteRetIVA).RoundSQL()
|
||||
RowServicio("PorcentajeRetIVA") = ClienteRetIVA
|
||||
|
||||
Next
|
||||
TxtRetIVA.Text = TmpDT.SUM("ImporteRetIVA").ToDecimal().FormatoNumero(2)
|
||||
Dim PorcentajeRetIVA = (TmpDT.MAX("PorcentajeRetIVA").ToDecimal() * 100)
|
||||
LblRetIVA.Text = PorcentajeRetIVA.FormatoNumero(2)
|
||||
If PorcentajeRetIVA > 0 Then
|
||||
DdlTipoRetencion.Visible = True
|
||||
End If
|
||||
|
||||
GvPS.DataSource = TmpDT
|
||||
GvPS.DataBind()
|
||||
|
||||
UpPS.Update()
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user