Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -541,6 +541,21 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="form-group form-md-line-input input-iconright col-md-4" runat="server" visible ="false" id="DvGenero">
|
||||
<asp:DropDownList ID="DdlGeneroCliente" runat="server" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Hombre" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Mujer" Value="0"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RfvDdlGeneroCliente" runat="server" InitialValue="-1" ControlToValidate="DdlGeneroCliente" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Género''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlGeneroCliente.ClientID.ToString()%>">Género:</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
@@ -908,7 +908,7 @@ Partial Class Clientes
|
||||
LbAgregarSucursal.Enabled = True
|
||||
CreaDTSucursales()
|
||||
CargaDocumentacionCliente()
|
||||
|
||||
MuestraOcultaGenero()
|
||||
'TxtPais.Text = "México"
|
||||
End If
|
||||
|
||||
@@ -1653,6 +1653,12 @@ Partial Class Clientes
|
||||
ChkEsDistribuidor.Checked = Boolean.Parse(ObjClientes.DtResultados(0)("EsDistribuidor").ToString())
|
||||
CobranzaTelefono = ObjClientes.CobranzaTelefono
|
||||
|
||||
If ObjClientes.DtResultados(0)("Genero").ToString().Length > 0 Then
|
||||
DdlGeneroCliente.SelectedValueExist(If(Boolean.Parse(ObjClientes.DtResultados(0)("Genero").ToString()), 1, 0))
|
||||
Else
|
||||
DdlGeneroCliente.SelectedValueExist(-1)
|
||||
End If
|
||||
|
||||
TxtFechaLimiteCredito.Text = If(ObjClientes.DtResultados.Rows(0)("FechaLimiteCredito").ToString.ToDate = New Date(1900, 1, 1), "", ObjClientes.DtResultados.Rows(0)("FechaLimiteCredito").ToString.ToDate.ToString("dd/MM/yyyy"))
|
||||
|
||||
If CobranzaTelefono.Length = 10 Then
|
||||
@@ -2711,6 +2717,8 @@ Partial Class Clientes
|
||||
Dim FechaLimiteCredito As Date = If(TxtFechaLimiteCredito.Text.Trim.Length > 0, TxtFechaLimiteCredito.Text.ToDate, New Date(1900, 1, 1))
|
||||
|
||||
|
||||
Dim GeneroCliente = If(DdlGeneroCliente.SelectedValue.ToEntero = 1 Or DdlGeneroCliente.SelectedValue.ToEntero = -1, True, False)
|
||||
|
||||
If CveCliente = -1 Then
|
||||
Dim ErrorAC As Boolean = False
|
||||
Dim CtaCliente As Integer = DdlCtaContableClientes.SelectedValue.ToEntero()
|
||||
@@ -2774,7 +2782,7 @@ Partial Class Clientes
|
||||
CvePais:=DdlPais.SelectedValue.ToEntero(), CveEstado:=DdlEstado.SelectedValue.ToEntero(), CveMunicipio:=DdlMunicipio.SelectedValue.ToEntero(), CveColonia:=DdlColonia.SelectedValue.ToEntero(), CveMotivoTraslado:=IIf(DdlMotivoTraslado.SelectedValue = "-1", "0", DdlMotivoTraslado.SelectedValue).ToString().ToEntero(), NumRegIdTrib:=IIf(TxtNumRegIdTrib.Text = "", "-1", TxtNumRegIdTrib.Text).ToString(),
|
||||
ComExtEstado:=IIf(TxtComExtEstado.Text = "", "-1", TxtComExtEstado.Text).ToString(), ComExtMunicipio:=IIf(TxtComExtMunicipio.Text = "", "-1", TxtComExtMunicipio.Text).ToString(), ComExtColonia:=IIf(TxtComExtColonia.Text = "", "-1", TxtComExtColonia.Text).ToString(), RequiereOC:=ChkRequiereOC.Checked, LT:=LT, LG:=LG, EsDistribuidor:=ChkEsDistribuidor.Checked,
|
||||
TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero(), CargoUsado:=ChkCargoUsado.Checked, BonificacionUsado:=ChkBonificacionUsado.Checked, CveTipoRetencion:=DdlTipoRetencion.SelectedValue.ToEntero(), CorreoEntregaCompras:=TxtCorreoEntregaCompras.Text, CorreoEntregaAlmacen:=TxtCorreoEntregaAlmacen.Text, CveSATEstado:=DdlEstadoSAT.SelectedValue.ToEntero(), CveAdminTrayecto:=If(DdlAdminTrayecto.SelectedValue.ToEntero() <= 0, 0, DdlAdminTrayecto.SelectedValue.ToEntero()),
|
||||
CveRegimenFiscal:=DdlRegimenFiscal.SelectedValue.ToEntero, RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona, RepresentanteLegal:=TxtRepresentanteLegal.Text, ComExtCalle:=TxtComExtCalle.Text.Trim(), ComExtNumExt:=TxtComExtNumero.Text.Trim(), ComExtCP:=TxtComExtCP.Text.Trim(), FechaLimiteCredito:=FechaLimiteCredito) Then
|
||||
CveRegimenFiscal:=DdlRegimenFiscal.SelectedValue.ToEntero, RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona, RepresentanteLegal:=TxtRepresentanteLegal.Text, ComExtCalle:=TxtComExtCalle.Text.Trim(), ComExtNumExt:=TxtComExtNumero.Text.Trim(), ComExtCP:=TxtComExtCP.Text.Trim(), FechaLimiteCredito:=FechaLimiteCredito, Genero:=GeneroCliente) Then
|
||||
|
||||
ViewState("CveCliente") = ObjClientes.CveCliente
|
||||
|
||||
@@ -2871,7 +2879,8 @@ Partial Class Clientes
|
||||
ApellidoPaternoPF:=IIf(TxtApellidoPaterno.Text = "", "-1", TxtApellidoPaterno.Text).ToString(), ApellidoMaternoPF:=IIf(TxtApellidoMaterno.Text = "", "-1", TxtApellidoMaterno.Text).ToString(), NombresPF:=IIf(TxtNombres.Text = "", "-1", TxtNombres.Text).ToString(),
|
||||
RequiereOC:=ChkRequiereOC.Checked, LT:=LT, LG:=LG, EsDistribuidor:=ChkEsDistribuidor.Checked, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero(), CargoUsado:=ChkCargoUsado.Checked, BonificacionUsado:=ChkBonificacionUsado.Checked, CveTipoRetencion:=DdlTipoRetencion.SelectedValue.ToEntero(), CorreoEntregaCompras:=TxtCorreoEntregaCompras.Text, CorreoEntregaAlmacen:=TxtCorreoEntregaAlmacen.Text, CveSATEstado:=DdlEstadoSAT.SelectedValue.ToEntero(),
|
||||
CveAdminTrayecto:=If(DdlAdminTrayecto.SelectedValue.ToEntero() <= 0, 0, DdlAdminTrayecto.SelectedValue.ToEntero()),
|
||||
NoDesglosaIVA:=ChkNoDesglosaIVA.Checked, CveRegimenFiscal:=DdlRegimenFiscal.SelectedValue.ToEntero, RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona, RepresentanteLegal:=TxtRepresentanteLegal.Text, ComExtCalle:=TxtComExtCalle.Text.Trim(), ComExtNumExt:=TxtComExtNumero.Text.Trim(), ComExtCP:=TxtComExtCP.Text.Trim(), FechaLimiteCredito:=FechaLimiteCredito) Then
|
||||
NoDesglosaIVA:=ChkNoDesglosaIVA.Checked, CveRegimenFiscal:=DdlRegimenFiscal.SelectedValue.ToEntero, RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona, RepresentanteLegal:=TxtRepresentanteLegal.Text, ComExtCalle:=TxtComExtCalle.Text.Trim(), ComExtNumExt:=TxtComExtNumero.Text.Trim(), ComExtCP:=TxtComExtCP.Text.Trim(), FechaLimiteCredito:=FechaLimiteCredito,
|
||||
Genero:=GeneroCliente) Then
|
||||
|
||||
|
||||
ObjClientes.LimpiaImpuestosLocales(CveCliente)
|
||||
@@ -10321,6 +10330,8 @@ Partial Class Clientes
|
||||
End If
|
||||
End If
|
||||
|
||||
MuestraOcultaGenero()
|
||||
|
||||
DdlRegimenFiscal.DataSource = dt
|
||||
DdlRegimenFiscal.DataBind()
|
||||
DdlRegimenFiscal.SelectedValueExist(Val)
|
||||
@@ -10581,5 +10592,17 @@ Partial Class Clientes
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub MuestraOcultaGenero()
|
||||
|
||||
DvGenero.Visible = False
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso RdTipoPersona.SelectedValue.ToEntero = 0 Then
|
||||
DvGenero.Visible = True
|
||||
End If
|
||||
|
||||
UpDatos.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
@@ -2556,18 +2556,31 @@
|
||||
</div>
|
||||
</div>
|
||||
<div id="DivCorreoCuentaCliente" runat="server" visible="false" class="row" style="padding-left: 16px;">
|
||||
<div class="form-group form-md-line-input input-iconright col-xs-6">
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright col-xs-4">
|
||||
<asp:TextBox ID="TxtCorreoCliente" CssClass="form-control" runat="server" MaxLength="300" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" CssClass="help-block errorimput" ValidationExpression="(([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)(\s*;\s*|\s*$))*" ControlToValidate="TxtCorreoCliente" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Email''</b> no es válido, por favor ingrése uno correcto." ValidationGroup="GrpGuardarCliente"></asp:RegularExpressionValidator>
|
||||
<label for="<%= TxtCorreoCliente.ClientID.ToString()%>">Email: </label>
|
||||
<i></i>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright col-xs-6">
|
||||
<div class="form-group form-md-line-input input-iconright col-xs-4">
|
||||
<asp:TextBox ID="TxtTelefonoCliente" CssClass="form-control " runat="server" MaxLength="10" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVTelefonoCliente" runat="server" ControlToValidate="TxtTelefonoCliente" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Teléfono''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCliente"></asp:RequiredFieldValidator>
|
||||
<asp:RegularExpressionValidator ID="RevTelefonoCliente" runat="server" CssClass="help-block errorimput" ValidationExpression="\d{10}" ControlToValidate="TxtTelefonoCliente" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Teléfono''</b> no es válido, por favor ingrése uno correcto." ValidationGroup="GrpGuardarCliente"></asp:RegularExpressionValidator>
|
||||
<label for="<%= TxtTelefonoCliente.ClientID.ToString()%>">Teléfono:</label>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright col-xs-4" runat="server" visible ="false" id="DvGenero">
|
||||
<asp:DropDownList ID="DdlGeneroCliente" runat="server" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Hombre" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Mujer" Value="0"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RfvDdlGeneroCliente" runat="server" InitialValue="-1" ControlToValidate="DdlGeneroCliente" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Género''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCliente"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlGeneroCliente.ClientID.ToString()%>">Género:</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="DivEstadoPaisCliente" runat="server" visible="false" class="row" style="padding-left: 16px;">
|
||||
|
||||
|
||||
@@ -6518,6 +6518,9 @@ Partial Class PV
|
||||
TxtCiudadCliente.Text = dr("Municipio").ToString
|
||||
TxtLocalidadCliente.Text = dr("Localidad").ToString
|
||||
End If
|
||||
|
||||
DdlGeneroCliente.SelectedValueExist(-1)
|
||||
|
||||
Else
|
||||
Dim ObjCliente As New ClsClientes
|
||||
If ObjCliente.ValidaClienteRFC(TxtRFCCliente.Text, UsuarioActual.CveEmpresa) Then
|
||||
@@ -6559,8 +6562,12 @@ Partial Class PV
|
||||
|
||||
CargaComboCFDICliente()
|
||||
|
||||
DdlGeneroCliente.SelectedValueExist(-1)
|
||||
|
||||
End If
|
||||
|
||||
MuestraOcultaGenero()
|
||||
|
||||
UpAgregarCliente.Update()
|
||||
End Sub
|
||||
|
||||
@@ -6656,12 +6663,13 @@ Partial Class PV
|
||||
Dim ObjCliente As New ClsClientes
|
||||
|
||||
Dim TipoPersona As Boolean = If(RdTipoPersona.SelectedValue.ToEntero = 1, True, False)
|
||||
Dim GeneroCliente = If(DdlGeneroCliente.SelectedValue.ToEntero = 1, True, False)
|
||||
|
||||
If ObjCliente.AgregarClienteNoFrecuente(TxtNombreCliente.Text.Trim, TxtDireccionCliente.Text.Trim, TxtNumExtCliente.Text.Trim, TxtNumIntCliente.Text.Trim,
|
||||
TxtColoniaCliente.Text.Trim, TxtLocalidadCliente.Text.Trim, TxtCiudadCliente.Text.Trim, DdlEstadoSAT.SelectedValue.ToEntero,
|
||||
TxtRFCCliente.Text.Trim, TxtCPCliente.Text.Trim, TxtTelefonoCliente.Text.Trim, TxtCorreoCliente.Text.Trim,
|
||||
DdlSubProyectoDatos.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", -1, -1, CvePrecioLista:=CvePrecioLista,
|
||||
RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona, CveRegimenFiscal:=CveRegimenFiscal, CveUsoCFDI:=CveUsoCFDI) Then
|
||||
RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona, CveRegimenFiscal:=CveRegimenFiscal, CveUsoCFDI:=CveUsoCFDI, Genero:=GeneroCliente) Then
|
||||
|
||||
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
||||
RegistraScript("hideDivEC();")
|
||||
@@ -8589,9 +8597,27 @@ Partial Class PV
|
||||
|
||||
End If
|
||||
|
||||
MuestraOcultaGenero()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
UpAgregarCliente.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub MuestraOcultaGenero()
|
||||
|
||||
DvGenero.Visible = False
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso RdTipoPersona.SelectedValue.ToEntero = 0 Then
|
||||
DvGenero.Visible = True
|
||||
End If
|
||||
|
||||
UpAgregarCliente.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkSolicitarDesc_Click(sender As Object, e As EventArgs)
|
||||
If Me.CveCliente <= 0 Then
|
||||
Alert("Debe seleccionar un cliente.", TipoMensaje.MsgAdvertencia)
|
||||
|
||||
@@ -600,11 +600,13 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
|
||||
|
||||
//
|
||||
|
||||
if (e.Row.DBCampo("PuedeRefacturar").ToString().ToEntero() == 1 && e.Row.DBCampo("CveEstatusFactura").ToString().ToEntero() == 23)
|
||||
if (e.Row.DBCampo("CveEstatusFactura").ToString().ToEntero() == 23)
|
||||
{
|
||||
e.Row.FCLinkButton("LnkValidarRefac").Visible = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (e.Row.DBCampo("PuedeRefacturar") == "0" && e.Row.DBCampo("CveEstatusFactura") == "23" && e.Row.DBCampo("CveVentaSustitucion").ToEntero() > 0)
|
||||
{
|
||||
if (e.Row.FCLinkButton("LnkCancelar") != null) e.Row.FCLinkButton("LnkCancelar").Visible = true;
|
||||
|
||||
@@ -8389,6 +8389,11 @@ Partial Class Ventas
|
||||
TmpDT.Rows(e.RowIndex)("PorcentajeIVA") = DrPS("IVA")
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(373) = "1" AndAlso LblRFC.Text = "XEXX010101000" Then
|
||||
TmpDT.Rows(e.RowIndex)("PorcentajeIVA") = 0
|
||||
TmpDT.Rows(e.RowIndex)("ImporteIVA") = 0
|
||||
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
|
||||
TmpDT.Rows(e.RowIndex)("Cantidad") = Cantidad
|
||||
@@ -8406,6 +8411,9 @@ Partial Class Ventas
|
||||
TmpDT.Rows(e.RowIndex)("PorcentajeRetISR") = ClienteRetISR
|
||||
TmpDT.Rows(e.RowIndex)("CuentaPredial") = CuentaPredial
|
||||
|
||||
|
||||
|
||||
|
||||
If ObjDescuento IsNot Nothing Then
|
||||
TmpDT.Rows(e.RowIndex)("CvePromocionDetalle") = ObjDescuento.CvePromocionDetalle
|
||||
End If
|
||||
@@ -18310,8 +18318,8 @@ Partial Class Ventas
|
||||
Return False
|
||||
End If
|
||||
|
||||
If PU <= 0 AndAlso UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
||||
Alert("El precio debe ser mayor a 0", TipoMensaje.MsgAdvertencia)
|
||||
If PU <= 0 Then
|
||||
Alert("No se puede vender a un importe de cero", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
|
||||
@@ -18323,10 +18331,10 @@ Partial Class Ventas
|
||||
ObjVentas.Dispose()
|
||||
|
||||
'VALIDA PRECIO CERO (0)
|
||||
If UsuarioActual.Empresa.Funcionalidad(139).ToString().ToEntero() > 0 And PU = 0 And DtPromociones.FiltroPrimeroValor("PUPromocion", $"CvePS = {CvePS}").ToDecimal > 0 Then
|
||||
Alert($"El producto <b>{HdnPS.Value}</b>. No se puede vender a un importe de cero ($0)", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
'If UsuarioActual.Empresa.Funcionalidad(139).ToString().ToEntero() > 0 And PU = 0 And DtPromociones.FiltroPrimeroValor("PUPromocion", $"CvePS = {CvePS}").ToDecimal > 0 Then
|
||||
' Alert($"El producto <b>{HdnPS.Value}</b>. No se puede vender a un importe de cero ($0)", TipoMensaje.MsgAdvertencia)
|
||||
' Return False
|
||||
'End If
|
||||
|
||||
'SI NO TIENE LA FUNCIONALIDAD VALIDARA LAS MONEDAS
|
||||
If UsuarioActual.Empresa.Funcionalidad(524) <> "" Then
|
||||
@@ -19064,6 +19072,11 @@ Partial Class Ventas
|
||||
Row("PorcentajeIVA") = DrPS("IVA")
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(373) = "1" AndAlso LblRFC.Text = "XEXX010101000" Then
|
||||
DrPS("IVA") = 0
|
||||
Row("PorcentajeIVA") = 0
|
||||
End If
|
||||
|
||||
If ClienteNODesglosaIVA Then
|
||||
'If Not RegeneraIEPS AndAlso Not FacturaDesglosoIEPS Then
|
||||
PU = PU * (1 + Row("PorcentajeIVA").ToString().ToDecimal)
|
||||
@@ -19073,6 +19086,8 @@ Partial Class Ventas
|
||||
Row("PorcentajeIVA") = 0
|
||||
End If
|
||||
|
||||
|
||||
|
||||
TotalCalculableImpuestos = ((Cantidad * (PU)) - Descuento)
|
||||
TotalCalculableImpuestosIVA = TotalCalculableImpuestos * (1 + DrPS("IEPSPorcentaje").ToString().ToDecimal)
|
||||
|
||||
@@ -23659,16 +23674,44 @@ Partial Class Ventas
|
||||
Protected Sub LBDevolucionAlmacen_Click(sender As Object, e As EventArgs)
|
||||
Dim SaldoAlmacen As Decimal = 0
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa, VerificaAlmacen:=True) Then
|
||||
If ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||
Dim DbRowVenta As DataRow = ObjVentas.DtResultados.Rows(0)
|
||||
Me.DevolucionAlmacen = DbRowVenta("EsDevolucionVenta").ToString().ToEntero()
|
||||
SaldoAlmacen = DbRowVenta("SaldoAlmacen").ToString().ToDecimal()
|
||||
Dim ErrorVerificacion As Boolean = False
|
||||
|
||||
Using ObjInv As New ClsInventarios
|
||||
If ObjInv.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then
|
||||
If ObjInv.DtResultados.Rows.Count > 0 Then
|
||||
TieneAlmacen = True
|
||||
End If
|
||||
Else
|
||||
ErrorVerificacion = True
|
||||
End If
|
||||
End Using
|
||||
|
||||
If ErrorVerificacion Then
|
||||
Alert("No se pudieron verificar los movimientos de almacen del documento.", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If SaldoAlmacen >= 0 Then
|
||||
If Not TieneAlmacen Then
|
||||
Alert("El documento no tiene movimientos de almacen.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Using ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa, VerificaAlmacen:=True) Then
|
||||
If ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||
Dim DbRowVenta As DataRow = ObjVentas.DtResultados.Rows(0)
|
||||
Me.DevolucionAlmacen = DbRowVenta("EsDevolucionVenta").ToString().ToEntero()
|
||||
SaldoAlmacen = DbRowVenta("SaldoAlmacen").ToString().ToDecimal()
|
||||
End If
|
||||
End If
|
||||
End Using
|
||||
|
||||
If DdlTipoComprobante.SelectedValue.ToString() = "Rem" AndAlso SaldoAlmacen = 0 Then
|
||||
Alert("El documento ya fue devuelto.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If DdlTipoComprobante.SelectedValue.ToString() = "Ing" AndAlso SaldoAlmacen = 0 Then
|
||||
Alert("El movimiento ya fue devuelto.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
@@ -23676,17 +23719,17 @@ Partial Class Ventas
|
||||
If Me.DevolucionAlmacen.Contiene(2) Then
|
||||
InicializaDevolucionAlmacen()
|
||||
UpnTools.Update()
|
||||
ObjVentas.Dispose()
|
||||
Alert("El movimiento ya fue devuelto.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim EstatusDevolucion = If(Me.DevolucionAlmacen = 0, 1, 0)
|
||||
|
||||
If ObjVentas.UpdateVentasDevolucionAlmacen(EstatusDevolucion, CveVenta) Then
|
||||
Dim ObjV As New ClsVentas
|
||||
If ObjV.UpdateVentasDevolucionAlmacen(EstatusDevolucion, CveVenta) Then
|
||||
Alert("La solicitud de Devolución de Almacén se guardó correctamente")
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
ObjV.Dispose()
|
||||
|
||||
Me.DevolucionAlmacen = EstatusDevolucion
|
||||
|
||||
@@ -24678,28 +24721,9 @@ Partial Class Ventas
|
||||
End Sub
|
||||
|
||||
Private Sub LbCancelarDocumento_Click(sender As Object, e As EventArgs) Handles LbCancelarDocumento.Click
|
||||
Dim SaldoAlmacen As Decimal = 0
|
||||
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Dev", "Egs") Then
|
||||
|
||||
Dim sb As New StringBuilder()
|
||||
Dim sbExtra As New StringBuilder()
|
||||
sb.Append("La factura se encuentra en el siguiente estatus del SAT:<br/>")
|
||||
|
||||
Dim TotalT As Decimal = TxtTotal.Text.ToDecimal
|
||||
Dim RFCReceptor As String = ""
|
||||
|
||||
If String.IsNullOrEmpty(Me.RFCReceptorVenta) Then
|
||||
RFCReceptor = LblRFC.Text.Trim
|
||||
|
||||
'SI SE FACTURO LA SUCURSAL DEL CLIENTE TOMA EL RFC DE ESTA
|
||||
If FacturarSucursal AndAlso Me.ClienteSucursal IsNot Nothing Then
|
||||
RFCReceptor = Me.ClienteSucursal.RFC
|
||||
End If
|
||||
Else
|
||||
RFCReceptor = Me.RFCReceptorVenta
|
||||
End If
|
||||
|
||||
Dim SaldoAlmacen As Decimal = 0
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Dev") Then
|
||||
|
||||
Dim PermiteCancelar As Boolean = True
|
||||
Using ObjVentas As New ClsVentas
|
||||
@@ -24722,12 +24746,41 @@ Partial Class Ventas
|
||||
Else
|
||||
PermiteCancelar = False
|
||||
End If
|
||||
|
||||
If PermiteCancelar And SaldoVenta <> 0 Then
|
||||
If UsuarioActual.TienePermisoProceso(269) AndAlso Not DevolucionAlmacen = 2 Then
|
||||
DivDevAlm.Visible = True
|
||||
TieneAlmacen = True
|
||||
End If
|
||||
End If
|
||||
|
||||
End Using
|
||||
|
||||
If Not PermiteCancelar Then
|
||||
Alert("La venta no se puede cancelar si no ha sido surtida previamente", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Dev", "Egs") Then
|
||||
|
||||
Dim sb As New StringBuilder()
|
||||
Dim sbExtra As New StringBuilder()
|
||||
sb.Append("La factura se encuentra en el siguiente estatus del SAT:<br/>")
|
||||
|
||||
Dim TotalT As Decimal = TxtTotal.Text.ToDecimal
|
||||
Dim RFCReceptor As String = ""
|
||||
|
||||
If String.IsNullOrEmpty(Me.RFCReceptorVenta) Then
|
||||
RFCReceptor = LblRFC.Text.Trim
|
||||
|
||||
'SI SE FACTURO LA SUCURSAL DEL CLIENTE TOMA EL RFC DE ESTA
|
||||
If FacturarSucursal AndAlso Me.ClienteSucursal IsNot Nothing Then
|
||||
RFCReceptor = Me.ClienteSucursal.RFC
|
||||
End If
|
||||
Else
|
||||
RFCReceptor = Me.RFCReceptorVenta
|
||||
End If
|
||||
|
||||
|
||||
Dim SWatch As New Stopwatch
|
||||
@@ -25042,7 +25095,7 @@ Partial Class Ventas
|
||||
' CancelarRefacturada()
|
||||
'End If
|
||||
|
||||
Dim ObjFacturaCancelacion As New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=True)
|
||||
Dim ObjFacturaCancelacion As New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=True, VerificaAlmacen:=True)
|
||||
Try
|
||||
Dim resp As Modelos.Factura.MCancelacionVentaMensaje = Nothing
|
||||
Dim strMensaje As New StringBuilder()
|
||||
|
||||
Reference in New Issue
Block a user