This commit is contained in:
2022-04-08 13:44:39 -07:00
43 changed files with 3096 additions and 1412 deletions

View File

@@ -120,6 +120,7 @@
<asp:BoundField DataField="DiasVencidos" ItemStyle-Width="5%" HeaderText="D.Venc" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:N0}" />
<asp:HyperLinkField DataTextField="FacturaAplicada" Target="_blank" HeaderText="Factura" DataNavigateUrlFields="CveVentaAplicada" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Motivo" HeaderText="Motivo" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%">
<ItemTemplate>
<asp:Label ID="LblEstatus" Text='<%# Eval("Estatus") %>' runat="server"></asp:Label>
@@ -203,6 +204,20 @@
<ajax:ValidatorCalloutExtender ID="VCEDiasVencidos2" runat="server" HighlightCssClass="vco" TargetControlID="RFVDiasVencidos2" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div id="DivMotivo" runat="server" visible="false" class="row">
<div class="col-md-12">
<div class="row">
<label class="col-md-3 truncate" style="color: #888888; font-family: 'Open Sans', sans-serif; direction: ltr; font-size: 12px;">Motivo:</label>
</div>
<div class="row">
<div class="col-md-12">
<asp:TextBox ID="TxtMotivo" CssClass="form-control input-sm" runat="server" Rows="2" TextMode="MultiLine" Width="100%" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVMotivo" runat="server" ControlToValidate="TxtMotivo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Motivo''</b> es necesario, por favor ingréselo." ValidationGroup="VgmGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEMotivo" runat="server" HighlightCssClass="vco" TargetControlID="RFVMotivo" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnGuardar" OnClick="BtnGuardar_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VgmGuardar" />

View File

@@ -4,14 +4,22 @@ Partial Class Ventas_CatAutorizacionLimites
Inherits ClsPaginas
#Region "PROPIEDADES"
Private Property CveAutorizacion() As Integer
Private Property CveAutorizacion() As Integer
Get
Return If(IsNothing(ViewState("CveAutorizacion")), -1, CInt(ViewState("CveAutorizacion")))
Return If(IsNothing(ViewState("CveAutorizacion")), -1, CInt(ViewState("CveAutorizacion")))
End Get
Set
End Get
Set
ViewState("CveAutorizacion") = Value
End Set
End Property
Private Property Modalidad() As String
Get
Return If(IsNothing(ViewState("Modalidad")), "", (ViewState("Modalidad").ToString))
End Set
End Property
End Get
Set
ViewState("Modalidad") = Value
End Set
End Property
#End Region
Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
@@ -29,20 +37,20 @@ Partial Class Ventas_CatAutorizacionLimites
DdlCliente.setEsWebService(True)
DdlClienteFiltro.setEsWebService(True)
#Region "CARGAS"
Private Sub CargaCombos()
txtFechaI.Text = Now.AddDays(-1).ToString("dd/MM/yyyy")
txtFechaI.Text = Now.ToString("dd/MM/yyyy")
DdlCliente.setEsWebService(True)
DdlClienteFiltro.setEsWebService(True)
'Dim EsWS = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
'If EsWS Then
' DdlCliente.setEsWebService(True)
' DdlClienteFiltro.setEsWebService(True)
'Else
' DdlCliente.setEsWebService(False)
'Dim EsWS = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
'If EsWS Then
' DdlCliente.setEsWebService(True)
' DdlClienteFiltro.setEsWebService(True)
'Else
' DdlCliente.setEsWebService(False)
' DdlCliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
' DdlCliente.DataBind()
' DdlCliente.ddl.Items.Insert(0, New ListItem("Seleccione", "-1"))
' DdlClienteFiltro.setEsWebService(False)
' DdlClienteFiltro.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
' DdlClienteFiltro.DataBind()
' DdlClienteFiltro.ddl.Items.Insert(0, New ListItem("Seleccione", "-1"))
'End If
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
@@ -64,8 +72,8 @@ Partial Class Ventas_CatAutorizacionLimites
CveCliente = DdlClienteFiltro.SelectedValue.ToEntero()
End If
Private Sub CargaDatos()
Dim CveCliente As Integer = -1
Dim FechaI, FechaF As Date
FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim.ToDate, MinFecha)
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim.ToDate, MaxFecha)
Dim ObjGral As New ClsVentas
@@ -103,8 +111,10 @@ Partial Class Ventas_CatAutorizacionLimites
LimpiaModal()
Modalidad = "A"
BtnGuardar.Text = "Agregar"
CargaDatos()
ltlMotititulo.Text = "Agregar autorización"
UpModal.Update()
RegistraScript("$('#DModal').modal()")
End Sub
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
If DdlTipoAutorizacion.SelectedValue.ToEntero() <= 0 Then
Alert("Debe seleccionar un tipo de autorización", TipoMensaje.MsgAdvertencia)
@@ -119,8 +129,10 @@ Partial Class Ventas_CatAutorizacionLimites
DiasVencidos = TxtDiasVencidos.Text.ToEntero()
End If
Dim Motivo As String = TxtMotivo.Text.Trim
Dim ObjPS As New ClsVentas
Dim DiasVencidos As Integer = 0
If ObjPS.AddAutorizacionLimite(UsuarioActual.CveEmpresa, DdlCliente.SelectedValue.ToEntero(), DdlVendedor.SelectedValue.ToEntero(), TxtPrecio.Text.ToDecimal(), CveEstatus, UsuarioActual.CveUsuario, CveTipoAutorizacion, TipoDocto, DiasVencidos, Motivo:=Motivo) Then
RegistraScript("$('#DModal').modal('hide')")
Alert("La autorización se agregó correctamente.", TipoMensaje.MsgInformacion)
End If
@@ -132,9 +144,13 @@ Partial Class Ventas_CatAutorizacionLimites
#End Region
#Region "LIMPIAR"
Alert("La autorización se agregó correctamente.", TipoMensaje.MsgInformacion)
Protected Sub LimpiaModal()
Me.CveAutorizacion = -1
TxtPrecio.Text = ""
ObjPS.Dispose()
DdlCliente.SelectedValue = "-1"
DdlVendedor.SelectedValueExist("-1")
End Sub
#End Region
@@ -286,9 +302,11 @@ Partial Class Ventas_CatAutorizacionLimites
If DdlTipoAutorizacion.Items.FindByValue("2") Is Nothing Then
DdlTipoAutorizacion.Items.Insert(0, New ListItem("Vencimiento", "2"))
End If
DivMotivo.Visible = False
Case "Egs"
'QUITAR LA DE VENCIMIENTO
DdlTipoAutorizacion.Items.Remove(DdlTipoAutorizacion.Items.FindByValue("2"))
DivMotivo.Visible = True
End Select
UpModal.Update()
End Sub

View File

@@ -2452,10 +2452,7 @@
<div class="modal-dialog" style="max-height: 500px; max-width: 500px;">
<asp:UpdatePanel ID="UpAgregarCliente" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<fieldset>
<%--<legend><b>Descripción</b></legend>--%>
<table border="0" class="portlet light bordered">
<tr>
<div class="portlet-title">
<div class="caption font-green">
@@ -2469,10 +2466,8 @@
</div>
</tr>
<tr>
<div class="modal-body">
<div class="row" style="padding-left: 16px;">
<div class="form-group form-md-line-input input-iconright col-xs-9">
<asp:TextBox ID="TxtRFCCliente" Text="XAXX010101000" Style="text-transform: uppercase;" placeholder="Ingrese el RFC para su validación" runat="server" CssClass="form-control" MaxLength="13" CausesValidation="true"></asp:TextBox>
@@ -2489,19 +2484,12 @@
<div class="col-md-12">
<div runat="server" id="DivTipoPersona" class="form-group form-md-line-input input-iconright">
<div runat="server" id="DivTipoPersona" visible="false" class="form-group form-md-line-input input-iconright">
<%-- <asp:RadioButtonList runat="server" ID="RdTipoPersona" RepeatDirection="Horizontal" OnSelectedIndexChanged="RdTipoPersona_SelectedIndexChanged" AutoPostBack="true" CssClass="form-control input-sm">
<asp:RadioButtonList runat="server" ID="RdTipoPersona" RepeatDirection="Horizontal" OnSelectedIndexChanged="RdTipoPersona_SelectedIndexChanged" AutoPostBack="true" CssClass="form-control">
<asp:ListItem Value="0">Física</asp:ListItem>
<asp:ListItem Value="1">Moral</asp:ListItem>
</asp:RadioButtonList>--%>
<asp:DropDownList runat="server" ID="RdTipoPersona" OnSelectedIndexChanged="RdTipoPersona_SelectedIndexChanged" AutoPostBack="true" CssClass="form-control input-sm select2me">
<asp:ListItem Value="0">Física</asp:ListItem>
<asp:ListItem Value="1">Moral</asp:ListItem>
</asp:DropDownList>
</asp:RadioButtonList>
<label for="<%= RdTipoPersona.ClientID.ToString()%>">Tipo Persona:</label>
<i></i>
@@ -2630,12 +2618,17 @@
</div>
</tr>
</table>
</fieldset>
<div id="DivBotonesAgregarCliente" runat="server" visible="false" class="modal-footer">
<asp:Button ID="BtnAgregarCliente" runat="server" CssClass="btn btn-primary" Text="Agregar" ValidationGroup="GrpGuardarCliente" />
<button id="BtnCancelarCliente" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
@@ -2841,6 +2834,7 @@
<asp:HiddenField ID="HdnAplicaIEPS" runat="server" Value="-1" />
<asp:HiddenField ID="HdnPorcentajeIEPS" runat="server" Value="-1" />
<asp:HiddenField ID="HdnCvePS" runat="server" Value="-1" />
<asp:HiddenField ID="HdnCveClasificacion" runat="server" Value="-1" ClientIDMode="Static" />
<div class="row" runat="server" visible="false">
<div class="col-md-12">
@@ -2905,10 +2899,6 @@
</div>
</div>
<div class="portlet-body form">
<asp:UpdatePanel runat="server" ID="UPPDatosUsado" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-4">
<label>Tipo Servicio:</label>
@@ -2929,7 +2919,7 @@
<div class="col-md-4">
<label>Año:</label>
<br />
<asp:TextBox ID="TxtAnioVehiculo" type="number" runat="server" Height="100%" Width="100%" CssClass="form-control" ></asp:TextBox>
<asp:TextBox ID="TxtAnioVehiculo" type="number" runat="server" Height="100%" Width="100%" CssClass="form-control"></asp:TextBox>
<asp:CustomValidator ID="CVAnio" runat="server" ClientValidationFunction="ValidaAnioVehiculo" ValidateEmptyText="true" ControlToValidate="TxtAnioVehiculo" Display="Dynamic" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Año''</b> esta vacío o no tiene el formato correcto, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:CustomValidator>
</div>
</div>
@@ -2944,7 +2934,7 @@
<label>BCI:</label>
<br />
<asp:DropDownList ID="DdlBCIUsado" CssClass="form-control input-sm select2me" runat="server" CausesValidation="true" DataTextField="BCI" DataValueField="CveBCIUsado" Width="100%">
</asp:DropDownList>
</asp:DropDownList>
</div>
</div>
<div class="row">
@@ -2971,15 +2961,10 @@
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
<br />
<div class="row">
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright">
@@ -3111,7 +3096,7 @@
<asp:DropDownList ID="DdlBCIAjuste" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="BCI" DataValueField="CveBCIUsado" Width="100%" AutoPostBack="true">
</asp:DropDownList>
<label for="<%= DdlBCIAjuste.ClientID.ToString()%>">BCI:</label>
<asp:RequiredFieldValidator ID="RFVBCIAjuste" runat="server" ControlToValidate="DdlBCIAjuste" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''BCI''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="RFVBCIAjuste" runat="server" ControlToValidate="DdlBCIAjuste" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''BCI''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEBCIAjuste" runat="server" HighlightCssClass="vco" TargetControlID="RFVBCIAjuste" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
@@ -3145,7 +3130,7 @@
<div class="col-md-8">
<div id="DivCodEnsamble" runat="server" class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCodEnsamble" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<asp:CustomValidator ID="CVCodEnsamble" runat="server" ControlToValidate="TxtCodEnsamble" ClientValidationFunction="ValidarCodigoEnsamble" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Ensamble''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" />
<asp:CustomValidator ID="CVCodEnsamble" runat="server" ControlToValidate="TxtCodEnsamble" ValidateEmptyText="true" ClientValidationFunction="ValidarCodigoEnsamble" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Ensamble''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" />
<label for="<%= TxtCodEnsamble.ClientID.ToString()%>">Cod.Ensamble:</label>
</div>
</div>
@@ -3336,13 +3321,16 @@
}
function ValidaAnioVehiculo(val, args) {
//VALIDA SOLO SI SE SELECCIONO UN USADO
var cveUsado = ToDouble($get("C_DdlRecepcionUsados").value);
if (cveUsado > 0) {
var today = new Date();
var anioActual = today.getFullYear();
let CveClasificacion = HdnCveClasificacion.value;
const acumuladores = "20520, 20522, 20513, 20511, 20521, 20512, 20514, 20229";
if (acumuladores.includes(CveClasificacion)) {
var anio = ToDouble(args.Value);
if (anio > 0) {
var valido = true;
if (anio < 1900) {
if (anio <= 1900 || anio > anioActual) {
valido = false;
}
if (anio.toString().length != 4) {
@@ -3363,18 +3351,33 @@
//MARCA OPTIMA
if (CveMarca == "1086") {
let regex = new RegExp("^[0-9]+$");
arguments.IsValid = regex.test(arguments.Value);
//SI NO ES REQUERIDO, PONER COMO VALIDO
if (!arguments.Value) {
arguments.IsValid = true;
} else {
let regex = new RegExp("^[0-9]+$");
arguments.IsValid = regex.test(arguments.Value);
}
return;
//MARCA MOTOBATERIAS
} else if ((CveMarca == "1090" || CveMarca == "1091") || CveClasificacion == "20517") {
let regex = new RegExp("^[A-L][0-9][0-9A-Z][A-Q][JAVY]$");
arguments.IsValid = regex.test(arguments.Value);
//EN MOTOBATERIAS ES REQUERIDO
if (!arguments.Value) {
arguments.IsValid = false;
} else {
let regex = new RegExp("^[A-L][0-9][0-9A-Z][A-Q][JAVY]$");
arguments.IsValid = regex.test(arguments.Value);
}
return;
//AUTOMOTRIZ-ACUMULADORES
} else {
let regex = new RegExp("^[1X]|^[0-9][A-HJ-M][0-3][0-9][A-Z][ACEN][2-5]$");
arguments.IsValid = regex.test(arguments.Value);
//SI NO ES REQUERIDO, PONER COMO VALIDO
if (!arguments.Value) {
arguments.IsValid = true;
} else {
let regex = new RegExp("^[1X]|^[0-9][A-HJ-M][0-3][0-9][A-Z][ACEN][2-5]$");
arguments.IsValid = regex.test(arguments.Value);
}
return;
}
}
@@ -3540,13 +3543,13 @@
var Descuento = parseFloat($get("TxtPorDescP").value);
var PorcentajeDescuentoMaximo = parseFloat($get("HdnPorcentajeDescuentoMaximo").value);
if (PorcentajeDescuentoMaximo > 0 && Descuento > PorcentajeDescuentoMaximo) {
$get("TxtDescP").value = "0";
$get("TxtPorDescP").value = "0";
Descuento = 0;
alert("No puede exceder el descuento maximo autorizado.");
}
}
$get("LblPrecioFinal").innerText = formato_numero(Monto - ((Monto * Descuento) / 100), 2, '.', ',');
$get("LblTotalPS").innerText = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ',');
@@ -3558,7 +3561,7 @@
if (TipoDescuento == 2) {
$get("LblDescuentos").innerText = formato_numero(Total, 2, '.', ',');
}
}
else {
$get("LblPrecioFinal").innerText = "0.00";
@@ -3605,10 +3608,10 @@
$get("LblPrecioFinal").innerText = formato_numero(Monto - ((Monto * Descuento) / 100), 2, '.', ',');
$get("LblTotalPS").innerText = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ',');
var Total = (Monto - parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", ""))) ;
var Total = (Monto - parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")));
$get("LblDescuentoAdicional").innerText = formato_numero(Total, 2, '.', ',');
//SUMA EL DESCUENTO YA EXISTENTE AL ORIGINAL
Total = Total + MontoOriginal;
@@ -3752,8 +3755,7 @@
$("#LblSubTotal1").text($("#TxtSubTotal").val());
}
function AbrirModalDescuentoAdicional()
{
function AbrirModalDescuentoAdicional() {
$('#ModalDescuento').modal();
$get('LblTitulo1').style.display = '';
$get('LblTitulo2').style.display = 'none';
@@ -3974,215 +3976,215 @@
var ValorTxt = Obj.value;
var suma = 0;
var total = parseFloat($('#<%= LblSaldoVenta.ClientID%>').text().replace(',', ''));
$('#<%= GVAnticipos.ClientID%> input[type="text"]').each(function (index) {
var currentsaldo = parseFloat($(this).val())
if (isNaN(currentsaldo)) { currentsaldo = 0 }
suma = currentsaldo + suma;
});
var txtvalue = (total - suma) + parseFloat(ValorTxt);
if (txtvalue < 0) { txtvalue = 0; }
if (txtvalue < Monto) { Monto = txtvalue.toFixed(2); }
$('#<%= GVAnticipos.ClientID%> input[type="text"]').each(function (index) {
var currentsaldo = parseFloat($(this).val())
if (isNaN(currentsaldo)) { currentsaldo = 0 }
suma = currentsaldo + suma;
});
var txtvalue = (total - suma) + parseFloat(ValorTxt);
if (txtvalue < 0) { txtvalue = 0; }
if (txtvalue < Monto) { Monto = txtvalue.toFixed(2); }
if (isNaN(ValorTxt))
ValorTxt = 0;
if (isNaN(Monto))
Monto = 0;
if (parseFloat(ValorTxt) < 0) {
ValorTxt = 0;
Obj.value = 0;
}
if (parseFloat(ValorTxt) > parseFloat(Monto)) {
alert("El monto de ''Anticipo a Amortizar'' no puede ser mayor al monto del ''Anticipo''");
Obj.value = Monto;
}
// else {
// if (parseFloat(Obj.value) > parseFloat($get("HdnAnticipos").value))
// $get("HdnAnticipos").value = parseFloat($get("HdnAnticipos").value) + (parseFloat($get("HdnAnticipos").value) + parseFloat(ValorTxt));
// else if (parseFloat(Obj.value) < parseFloat($get("HdnAnticipos").value))
// $get("HdnAnticipos").value = parseFloat($get("HdnAnticipos").value) - (parseFloat($get("HdnAnticipos").value) - parseFloat(ValorTxt));
// }
// SetText2($get("LblTotalAnticipos"), formato_numero($get("HdnAnticipos").value, 2, '.', ','));
}
function ImprimirCotizacion() {
__doPostBack('ctl00$HB$LNKImprimirCotizacion', '');
}
function SetText2(ObjTo, Value) {
ObjTo.innerText = Value;
if (isNaN(ValorTxt))
ValorTxt = 0;
if (isNaN(Monto))
Monto = 0;
if (parseFloat(ValorTxt) < 0) {
ValorTxt = 0;
Obj.value = 0;
}
function ValidarCantidad(t, c) {
if (t.value > c) {
t.value = c;
}
if (parseFloat(ValorTxt) > parseFloat(Monto)) {
alert("El monto de ''Anticipo a Amortizar'' no puede ser mayor al monto del ''Anticipo''");
Obj.value = Monto;
}
function Comma(Num) { //function to add commas to textboxes
Num += '';
Num = Num.replace(',', ''); Num = Num.replace(',', ''); Num = Num.replace(',', '');
Num = Num.replace(',', ''); Num = Num.replace(',', ''); Num = Num.replace(',', '');
x = Num.split('.');
x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1))
x1 = x1.replace(rgx, '$1' + ',' + '$2');
return x1 + x2;
}
function AddCodigoBarrasSerie(e) {
if (e.keyCode == 13 || e.which == 13) {
$('#BtnCodigoBarrasSerie').click();
}
}
// else {
// if (parseFloat(Obj.value) > parseFloat($get("HdnAnticipos").value))
// $get("HdnAnticipos").value = parseFloat($get("HdnAnticipos").value) + (parseFloat($get("HdnAnticipos").value) + parseFloat(ValorTxt));
// else if (parseFloat(Obj.value) < parseFloat($get("HdnAnticipos").value))
// $get("HdnAnticipos").value = parseFloat($get("HdnAnticipos").value) - (parseFloat($get("HdnAnticipos").value) - parseFloat(ValorTxt));
// }
// SetText2($get("LblTotalAnticipos"), formato_numero($get("HdnAnticipos").value, 2, '.', ','));
}
function ImprimirCotizacion() {
__doPostBack('ctl00$HB$LNKImprimirCotizacion', '');
}
function SetText2(ObjTo, Value) {
ObjTo.innerText = Value;
}
//SERIE PS
function SeriePS(e, b, txt, hdn) {
debugger;
if (e.keyCode == 13 || e.which == 13) {
if (txt.value != "" && txt.value != hdn.value) {
$(b).click();
}
}
}
function ValidarCantidad(t, c) {
if (t.value > c) {
function SeriePSBlur(b, txt, hdn) {
debugger;
t.value = c;
}
}
function Comma(Num) { //function to add commas to textboxes
Num += '';
Num = Num.replace(',', ''); Num = Num.replace(',', ''); Num = Num.replace(',', '');
Num = Num.replace(',', ''); Num = Num.replace(',', ''); Num = Num.replace(',', '');
x = Num.split('.');
x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1))
x1 = x1.replace(rgx, '$1' + ',' + '$2');
return x1 + x2;
}
function AddCodigoBarrasSerie(e) {
if (e.keyCode == 13 || e.which == 13) {
$('#BtnCodigoBarrasSerie').click();
}
}
//SERIE PS
function SeriePS(e, b, txt, hdn) {
debugger;
if (e.keyCode == 13 || e.which == 13) {
if (txt.value != "" && txt.value != hdn.value) {
$(b).click();
}
}
}
//SERIE-LOTE INV
var H1 = "";
var H2 = "";
var T = "";
function EnterAFEdit(event, Txt, Hdn1, Hdn2) {
if (event.which == 13 || event.keyCode == 13) {
H1 = Hdn1;
H2 = Hdn2;
T = Txt;
$get("HdnCodAFEdit").value = Txt.value;
$('#BtnVinculaAFEdit').click();
}
function SeriePSBlur(b, txt, hdn) {
debugger;
if (txt.value != "" && txt.value != hdn.value) {
$(b).click();
}
}
function AFBlurEdit(Txt, Hdn1, Hdn2) {
if (Txt.value.length > 0 && Txt.value != Hdn2.value) {
H1 = Hdn1;
H2 = Hdn2;
T = Txt;
$get("HdnCodAFEdit").value = Txt.value;
$('#BtnVinculaAFEdit').click();
}
//SERIE-LOTE INV
var H1 = "";
var H2 = "";
var T = "";
function EnterAFEdit(event, Txt, Hdn1, Hdn2) {
if (event.which == 13 || event.keyCode == 13) {
H1 = Hdn1;
H2 = Hdn2;
T = Txt;
$get("HdnCodAFEdit").value = Txt.value;
$('#BtnVinculaAFEdit').click();
}
}
function EnterAFEditOK(Cve, Codigo) {
$get(H1.id).value = Cve;
$get(H2.id).value = Codigo;
$get(T.id).value = (Codigo == -1) ? "" : Codigo;
function AFBlurEdit(Txt, Hdn1, Hdn2) {
if (Txt.value.length > 0 && Txt.value != Hdn2.value) {
H1 = Hdn1;
H2 = Hdn2;
T = Txt;
$get("HdnCodAFEdit").value = Txt.value;
$('#BtnVinculaAFEdit').click();
}
}
//Suma Totales
function FnSuma() {
debugger;
function EnterAFEditOK(Cve, Codigo) {
$get(H1.id).value = Cve;
$get(H2.id).value = Codigo;
$get(T.id).value = (Codigo == -1) ? "" : Codigo;
$get('TxtSubTotal2').value = FormatoNumero(ToDouble($get('TxtSubTotal').value) - ToDouble($get('LblDescuentos').innerHTML) - ToDouble($get('LblAmortizacion').innerHTML), 2);
var totalVenta = ToDouble($get('TxtSubTotal2').value) + ToDouble($get('TxtIVA').value) + ToDouble($get('TxtIEPS').value) - ToDouble($get('TxtRetIVA').value) - ToDouble($get('TxtRetISR').value);
}
$("#<%=GvImpuestosLocales2.ClientID%> input[type='text']").each(function () {
totalVenta -= ToDouble($(this).val().toString());
});
//Suma Totales
function FnSuma() {
debugger;
$get('TxtSubTotal2').value = FormatoNumero(ToDouble($get('TxtSubTotal').value) - ToDouble($get('LblDescuentos').innerHTML) - ToDouble($get('LblAmortizacion').innerHTML), 2);
var totalVenta = ToDouble($get('TxtSubTotal2').value) + ToDouble($get('TxtIVA').value) + ToDouble($get('TxtIEPS').value) - ToDouble($get('TxtRetIVA').value) - ToDouble($get('TxtRetISR').value);
$("#<%=GvImpuestosLocales2.ClientID%> input[type='text']").each(function () {
totalVenta -= ToDouble($(this).val().toString());
});
$('#TxtTotal').attr('value', FormatoNumero(totalVenta, 2));
$get('HdnTotalVenta').value = FormatoNumero(totalVenta, 2);
$('#TxtTotal').attr('value', FormatoNumero(totalVenta, 2));
$get('HdnTotalVenta').value = FormatoNumero(totalVenta, 2);
}
}
function chkAnt(t, txt, importe) {
debugger;
$get("HdnTipoDescuento").value = "3";
var Total = ToDouble($get('TxtTotal').value);
function chkAnt(t, txt, importe) {
debugger;
$get("HdnTipoDescuento").value = "3";
var Total = ToDouble($get('TxtTotal').value);
var SaldoCompra = parseFloat(parseFloat($get('HdnVentaSaldo').value).toFixed(2));
var SaldoCompra = parseFloat(parseFloat($get('HdnVentaSaldo').value).toFixed(2));
if (t.checked) {
if (t.checked) {
if (SaldoCompra > 0) {
if (SaldoCompra > importe) {
txt.value = importe.toFixed(2);
SaldoCompra = SaldoCompra - importe;
$get('HdnVentaSaldo').value = SaldoCompra;
} else {
txt.value = SaldoCompra.toFixed(2);
SaldoCompra = 0.00;
$get('HdnVentaSaldo').value = SaldoCompra;
}
if (SaldoCompra > 0) {
if (SaldoCompra > importe) {
txt.value = importe.toFixed(2);
SaldoCompra = SaldoCompra - importe;
$get('HdnVentaSaldo').value = SaldoCompra;
} else {
t.checked = false;
txt.value = SaldoCompra.toFixed(2);
SaldoCompra = 0.00;
$get('HdnVentaSaldo').value = SaldoCompra;
}
} else {
$get('HdnVentaSaldo').value = parseFloat(SaldoCompra) + parseFloat(txt.value);
txt.value = "";
t.checked = false;
}
$("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2));
} else {
$get('HdnVentaSaldo').value = parseFloat(SaldoCompra) + parseFloat(txt.value);
txt.value = "";
}
function FnCambiaAnt(chk, txt, saldo) {
$("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2));
var Total = ToDouble($get('TxtTotal').value);
var SaldoCompra = (Total - FnSumaValoresAnt() + ToDouble(txt.value)).toFixed(2); // le agrego lo del valor actual para validarlo //parseFloat(parseFloat($get('HdnVentaSaldo').value).toFixed(2));
if (SaldoCompra < 0) txt.value = SaldoCompra - txt.value;
//minimo entre saldocompra y el saldoanticipo
if (SaldoCompra < saldo) saldo = SaldoCompra;
}
if (ToDouble(txt.value) > 0) {
chk.checked = true;
} else {
chk.checked = false;
}
function FnCambiaAnt(chk, txt, saldo) {
if (ToDouble(txt.value) > saldo) {
txt.value = saldo;
alert("El Importe no debe de exceder a el saldo");
}
debugger;
$("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2));
$get('HdnVentaSaldo').value = Total - FnSumaValoresAnt();
var Total = ToDouble($get('TxtTotal').value);
var SaldoCompra = (Total - FnSumaValoresAnt() + ToDouble(txt.value)).toFixed(2); // le agrego lo del valor actual para validarlo //parseFloat(parseFloat($get('HdnVentaSaldo').value).toFixed(2));
if (SaldoCompra < 0) txt.value = SaldoCompra - txt.value;
//minimo entre saldocompra y el saldoanticipo
if (SaldoCompra < saldo) saldo = SaldoCompra;
if (ToDouble(txt.value) > 0) {
chk.checked = true;
} else {
chk.checked = false;
}
function FnSumaValoresAnt() {
var totalPoints = 0;
var t = '';
$('input[name*=TxtAnticipo]').each(function () {
totalPoints += ToDouble($(this).val());
});
return Math.round(totalPoints * 100) / 100;
if (ToDouble(txt.value) > saldo) {
txt.value = saldo;
alert("El Importe no debe de exceder a el saldo");
}
debugger;
$("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2));
$get('HdnVentaSaldo').value = Total - FnSumaValoresAnt();
}
function showDivEC() {
function FnSumaValoresAnt() {
var totalPoints = 0;
var t = '';
$('#<%= TxtNombreCliente.ClientID %>').val('');
$('input[name*=TxtAnticipo]').each(function () {
totalPoints += ToDouble($(this).val());
});
return Math.round(totalPoints * 100) / 100;
}
function showDivEC() {
$('#<%= TxtNombreCliente.ClientID %>').val('');
$('#<%= TxtDireccionCliente.ClientID %>').val('');
$('#<%= TxtNumExtCliente.ClientID %>').val('');
$('#<%= TxtNumIntCliente.ClientID %>').val('');

View File

@@ -4031,6 +4031,7 @@ Partial Class PV
HdnTipoInv.Value = drPS("Inv_CveMetodoInventario").ToString
HdnAplicaIEPS.Value = drPS("AplicaIEPS").ToString
HdnPorcentajeIEPS.Value = drPS("IEPSPorcentaje").ToString
HdnCveClasificacion.Value = drPS("CveClasificacion").ToString
'Muestra la tabla de tamaños
If drPS("CveTamaño").ToString().ToEntero() > 0 Then
DivRecepcionUsados.Visible = True
@@ -4736,6 +4737,7 @@ Partial Class PV
HdnCodigoPS.Value = "-1"
HdnTipoPS.Value = "-1"
HdnTipoInv.Value = "-1"
HdnCveClasificacion.Value = "-1"
DdlClasificacion.SelectedIndex = 0
If Not UsuarioActual.Empresa.Funcionalidad(141).ToString = "1" Then
@@ -5360,33 +5362,26 @@ Partial Class PV
Exit Sub
End If
If DrPS IsNot Nothing Then
'SOLO DEBE AGREGAR POLIZA VIRTUAL SI ES ACUMULADOR
If DrPS("CveClasificacion").ToString().ToEntero().Contiene(20520, 20522, 20513, 20511, 20521, 20512, 20514, 20229) Then
If String.IsNullOrEmpty(TxtAnioVehiculo.Text.Trim()) Then
Alert("El campo año esta vacío.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
If TxtAnioVehiculo.Text.ToDecimal() < 1900 Then
Alert("El campo año debe ser mayor a 1900.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If DrPS IsNot Nothing Then
'SOLO DEBE AGREGAR POLIZA VIRTUAL SI ES ACUMULADOR
If DrPS("CveClasificacion").ToString().ToEntero().Contiene(20520, 20522, 20513, 20511, 20521, 20512, 20514, 20229) Then
If String.IsNullOrEmpty(TxtAnioVehiculo.Text.Trim()) Then
Alert("El campo año esta vacío.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If TxtAnioVehiculo.Text.ToDecimal() <= 1900 Then
Alert("El campo año debe ser mayor a 1900.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If TxtAnioVehiculo.Text.ToDecimal() > Now.Year Then
Alert("El campo año no puede ser mayor al año actual.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
Else
If DrPS IsNot Nothing Then
'SOLO DEBE AGREGAR POLIZA VIRTUAL SI ES ACUMULADOR
If DrPS("CveClasificacion").ToString().ToEntero().Contiene(20520, 20522, 20513, 20511, 20521, 20512, 20514, 20229) Then
If Not String.IsNullOrEmpty(TxtAnioVehiculo.Text.Trim()) Then
If TxtAnioVehiculo.Text.ToDecimal() < 1900 Then
Alert("El año del vehiculo del vehículo no tiene el formato correcto.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
End If
End If
End If
@@ -5448,9 +5443,14 @@ Partial Class PV
PU = ObjDescuento.PU
End If
Dim RowSP As DataRow = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)
Dim CveProyecto As Integer = -1 '
Dim Proyecto As String = ""
Dim CveProyecto As Integer = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)("CveProyecto").ToString.ToEntero
Dim Proyecto As String = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)("Proyecto").ToString
If RowSP IsNot Nothing Then
CveProyecto = RowSP("CveProyecto").ToString.ToEntero
Proyecto = RowSP("Proyecto").ToString
End If
Dim Consec = AgregarProductoServicio(Cantidad, DdlUnidadMedida.SelectedValue.ToEntero, DdlUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text,
CvePS, "", TxtObsPS.Text.Trim, PU, ObjDescuento.ImporteDescuento,

View File

@@ -191,7 +191,19 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
var ObjVentas = new ClsVentas();
if (ObjVentas.UpdateEstatusVenta(CveVenta, CveEstatus, UsuarioActual.CveEmpresa))
{
sb.Append("El estatus de la factura fue cambiado a 'Cancelada'.");
if (respCancelacion.CveEstatus == 20)
{
sb.Append("El estatus de la factura fue cambiado a 'Cancelación en proceso'.");
}
else if (respCancelacion.CveEstatus == 23)
{
sb.Append("La solicitud de cancelación no la aplicó el SAT, intente cancelar de nuevo.");
}
else
{
sb.Append("El estatus de la factura fue cambiado a 'Cancelada'.");
}
}
else
{
@@ -312,7 +324,18 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
var ObjVentas = new ClsVentas();
if (ObjVentas.UpdateEstatusVenta(CveVenta, CveEstatus, UsuarioActual.CveEmpresa))
{
sb.Append("El estatus de la factura fue cambiado a 'Cancelada'.");
if (respCancelacion.CveEstatus == 20)
{
sb.Append("El estatus de la factura fue cambiado a 'Cancelación en proceso'.");
}
else if (respCancelacion.CveEstatus == 23)
{
sb.Append("La solicitud de cancelación no la aplicó el SAT, intente cancelar de nuevo.");
}
else
{
sb.Append("El estatus de la factura fue cambiado a 'Cancelada'.");
}
}
else
{
@@ -480,10 +503,14 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
// e.Row.FCLinkButton("LnkValidarRefac").Visible = false;
//}
if (e.Row.DBCampo("CveEstatusFactura").ToString().ToEntero() == 23)
{
e.Row.FCLinkButton("LnkValidarRefac").Visible = false;
}
if (e.Row.DBCampo("PuedeRefacturar").ToString().ToEntero() == 0 && e.Row.DBCampo("CveEstatusFactura").ToString().ToEntero() == 23 && e.Row.DBCampo("CveVentaSustitucion").ToEntero() > 0)
{
e.Row.FCLinkButton("LnkCancelar").Visible = true;
//e.Row.FCLinkButton("LnkValidarRefac").Visible = false;
}
}
}

View File

@@ -7,10 +7,10 @@ Imports Microsoft.Reporting.WebForms
Imports System.IO
Imports System.IO.Compression
Imports System.Net
Imports System.Net.Http
Imports System.Net.Http
Partial Class RepVentaDetalle
Inherits ClsPaginas
Inherits ClsPaginas
#Region "P R O P I E D A D E S"
Private Property CveProyecto As Integer
Get
@@ -54,26 +54,26 @@ Partial Class RepVentaDetalle
Set(value As Integer)
ViewState("CveMoneda") = value
End Set
End Property
End Property
Private Property TipoCliente As Integer
Get
If ViewState("TipoCliente") Is Nothing Then
Return -1
Else
Return ViewState("TipoCliente").ToString.ToEntero
End If
If ViewState("TipoCliente") Is Nothing Then
Return -1
Else
Return ViewState("TipoCliente").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("TipoCliente") = value
End Set
End Property
End Property
Private Property TCEspecifico As Decimal
Get
Return ViewState("TCEspecifico").ToString.ToDecimal
@@ -108,10 +108,10 @@ Partial Class RepVentaDetalle
Set(value As DataTable)
ViewState("DtColor") = value
End Set
End Property
End Property
#End Region
'pRivate ReadOnly Property ColumnasVisibles As
'pRivate ReadOnly Property ColumnasVisibles As
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
If UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario.Contiene(77, 21) Then Response.Redirect("/Inicio.aspx")
@@ -253,16 +253,16 @@ Partial Class RepVentaDetalle
If UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12) Then
ImgExcelVSH.Visible = True
ImgExcel.Visible = False
End If
End If
If UsuarioActual.CveVendedor > 0 AndAlso Not UsuarioActual.TienePermisoProceso(263) Then
DdlVendedor.SelectedValuesIfExistM(UsuarioActual.CveVendedor.ToString)
DdlVendedor.Attributes.Add("disabled", "")
DdlVendedor.Enabled = False
End If
End Sub
End Sub
#Region "CARGA COMBOS"
Private Sub CargaGrupo()
DdlGrupo.Items.Insert(0, New ListItem("Año", "1"))
@@ -278,7 +278,7 @@ Partial Class RepVentaDetalle
DdlGrupo.Items.Insert(10, New ListItem("Año Ejec.", "11"))
DdlGrupo.Items.Insert(11, New ListItem("Mes Ejec.", "12"))
DdlGrupo.Items.Insert(12, New ListItem("Año/Mes Ejec.", "13"))
DdlGrupo.Items.Insert(13, New ListItem("Fecha Ejec.", "14"))
DdlGrupo.Items.Insert(13, New ListItem("Fecha Ejec.", "14"))
DdlGrupo.Items.Insert(13, New ListItem("Vendedor/Cliente", "21"))
DdlGrupo.DataBind()
End Sub
@@ -379,7 +379,7 @@ Partial Class RepVentaDetalle
'Vendedor
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
DdlVendedor.DataBind()
DdlVendedor.DataBind()
DdlVendedor.Items.Insert(0, New ListItem("Sin Vendedor", "-2"))
'CargaUsuarios
@@ -393,11 +393,11 @@ Partial Class RepVentaDetalle
'Carga Clasificacion Cliente
DdlClienteClasificacion.DataSource = GlobalDTClienteClasificaciones(UsuarioActual.CveEmpresa)
DdlClienteClasificacion.DataBind()
DdlClienteClasificacion.Items.Insert(0, New ListItem("Todos", "-1"))
DdlTipoRelacion.DataSource = GlobalDTVtaTiposRelacion
DdlTipoRelacion.DataBind()
DdlClienteClasificacion.Items.Insert(0, New ListItem("Todos", "-1"))
DdlTipoRelacion.DataSource = GlobalDTVtaTiposRelacion
DdlTipoRelacion.DataBind()
DdlTipoRelacion.Items.Insert(0, New ListItem("Todos", "-1"))
CargaGrupo()
@@ -421,9 +421,9 @@ Partial Class RepVentaDetalle
DdlSubProyecto.DataSource = GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa)
DdlSubProyecto.DataBind()
'DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
End Sub
#End Region
#Region "SELECTED INDEX CHANGE"
Protected Sub DdlTipoComprobante_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaEstatus()
@@ -451,18 +451,18 @@ Partial Class RepVentaDetalle
'DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1).FiltraParametros($"CveClienteClasificacion = {DdlClienteClasificacion.SelectedValue.ToEntero} OR {DdlClienteClasificacion.SelectedValue.ToEntero} = -1")
'DdlClientes.DataBind()
'DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
End Sub
#End Region
#Region "CONSULTAR"
Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click
CargaDatos()
ConfiguraEmpresa()
UPDatos.Update()
End Sub
Private Sub CargaDatos()
Private Sub CargaDatos()
Dim AnioMes = If(Request("AnioMes") IsNot Nothing, Request("AnioMes").ToString, "-1").ToString
Dim Fecha = If(Request("Fecha") IsNot Nothing, Request("Fecha").ToString, "-1").ToString
Dim IVA = If(Request("IVA") IsNot Nothing, Request("IVA").ToString, "-1").ToString
@@ -475,7 +475,7 @@ Partial Class RepVentaDetalle
'PARAMETROS DE LOS LISTBOXS
Dim TipoComprobante As String = If(DdlTipoComprobante.GetSelectedValuesM = "", "-1", DdlTipoComprobante.GetSelectedValuesM)
Dim Sucursales As String = If(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM)
Dim Estatus As String = If(DdlEstatus.GetSelectedValuesM = "", "-1", DdlEstatus.GetSelectedValuesM)
Dim Estatus As String = If(DdlEstatus.GetSelectedValuesM = "", "-1", DdlEstatus.GetSelectedValuesM)
Dim CveCondicionesPago As Integer = If(DdlCondicionesPago.SelectedValue = "", -1, DdlCondicionesPago.SelectedValue.ToEntero)
Dim Vendedores As String = If(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM)
Dim CveCliente As Integer = If(DdlClientes.SelectedValue = "", -1, DdlClientes.SelectedValue.ToEntero)
@@ -489,16 +489,16 @@ Partial Class RepVentaDetalle
FechaIEjec = If(IsDate(TxtFechaIEjec.Text.Trim()), TxtFechaIEjec.Text.Trim.ToDate, MinFecha)
FechaFEjec = If(IsDate(TxtFechaFEjec.Text.Trim()), TxtFechaFEjec.Text.Trim.ToDate, MaxFecha)
Dim ModalidadContable As Boolean = CBool(If(Request("ModalidadContable") IsNot Nothing, Request("ModalidadContable").ToEntero(), 0))
ChkLecturaAdmin.Checked = Not ModalidadContable
Dim ObjVentas As New ClsVentas()
'FechaI, FechaF, -1, UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero
Dim ModalidadContable As Boolean = CBool(If(Request("ModalidadContable") IsNot Nothing, Request("ModalidadContable").ToEntero(), 0))
ChkLecturaAdmin.Checked = Not ModalidadContable
Dim ObjVentas As New ClsVentas()
'FechaI, FechaF, -1, UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero
If ObjVentas.GetRepVentasDetalle(DdlGrupo.SelectedValue.ToEntero, Anio.ToEntero, Mes.ToEntero, AnioMes, Fecha, CveCliente,
IVA, Vendedores, DdlUsuario.SelectedValue.ToEntero, Estatus, FechaI, FechaF,
CveCorte.ToEntero, TipoComprobante, DdlSubProyectoEjecucion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, FechaIEjec, FechaFEjec,
CveProyecto, Sucursales, TipoCambio, TCEspecifico, CveMoneda, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero,
CveProyecto, Sucursales, TipoCambio, TCEspecifico, CveMoneda, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero,
CveCondicionesPago:=CveCondicionesPago, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, ModalidadContable:=Not ChkLecturaAdmin.Checked, CveTipoRelacion:=DdlTipoRelacion.SelectedValue.ToEntero()) Then
DtVentas = AddRows(ObjVentas.DtResultados)
ImgImprimir.Enabled = True
@@ -507,19 +507,19 @@ Partial Class RepVentaDetalle
Else
GvDatos.DataSource = Nothing
GvVsh.DataSource = Nothing
End If
End If
ObjVentas.Dispose()
Agrupador = DdlGrupo.SelectedItem.Text
Agrupador = DdlGrupo.SelectedItem.Text
GvDatos.DataBind()
GvVsh.DataBind()
End Sub
End Sub
#End Region
#Region "GRIDVIEW"
Private Function AddRows(ByRef DT As DataTable) As DataTable
Dim i As Integer = 0
Dim Ultima As String = String.Empty
@@ -607,16 +607,16 @@ Partial Class RepVentaDetalle
If e.Row.DBCampo("RetIVA").ToDouble < 0 Then e.Row.Cells(9).ForeColor = Drawing.Color.Red
If e.Row.DBCampo("RetISR").ToDouble < 0 Then e.Row.Cells(10).ForeColor = Drawing.Color.Red
If e.Row.DBCampo("Total").ToDouble < 0 Then e.Row.Cells(11).ForeColor = Drawing.Color.Red
If e.Row.DBCampo("Total").ToDouble < 0 Then e.Row.Cells(12).ForeColor = Drawing.Color.Red
If e.Row.DBCampo("Total").ToDouble < 0 Then e.Row.Cells(13).ForeColor = Drawing.Color.Red
'If e.Row.DBCampo("MAX_SubTotal").ToDouble = 0 Then e.Row.FCLiteral("LtlMaxSubTotal").Text = ""
'If e.Row.DBCampo("AVG_SubTotal").ToDouble = 0 Then e.Row.FCLiteral("LtlAVGSubTotal").Text = ""
'If e.Row.DBCampo("MIN_SubTotal").ToDouble = 0 Then e.Row.FCLiteral("LtlMinSubTotal").Text = ""
'If e.Row.DBCampo("MAX_Total").ToDouble = 0 Then e.Row.FCLiteral("LtlMaxTotal").Text = ""
'If e.Row.DBCampo("AVG_Total").ToDouble = 0 Then e.Row.FCLiteral("LtlAVGTotal").Text = ""
'If e.Row.DBCampo("MIN_Total").ToDouble = 0 Then e.Row.FCLiteral("LtlMinTotal").Text = ""
If e.Row.DBCampo("Total").ToDouble < 0 Then e.Row.Cells(12).ForeColor = Drawing.Color.Red
If e.Row.DBCampo("Total").ToDouble < 0 Then e.Row.Cells(13).ForeColor = Drawing.Color.Red
'If e.Row.DBCampo("MAX_SubTotal").ToDouble = 0 Then e.Row.FCLiteral("LtlMaxSubTotal").Text = ""
'If e.Row.DBCampo("AVG_SubTotal").ToDouble = 0 Then e.Row.FCLiteral("LtlAVGSubTotal").Text = ""
'If e.Row.DBCampo("MIN_SubTotal").ToDouble = 0 Then e.Row.FCLiteral("LtlMinSubTotal").Text = ""
'If e.Row.DBCampo("MAX_Total").ToDouble = 0 Then e.Row.FCLiteral("LtlMaxTotal").Text = ""
'If e.Row.DBCampo("AVG_Total").ToDouble = 0 Then e.Row.FCLiteral("LtlAVGTotal").Text = ""
'If e.Row.DBCampo("MIN_Total").ToDouble = 0 Then e.Row.FCLiteral("LtlMinTotal").Text = ""
End If
End Sub
Protected Sub GvVsh_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvVsh.RowDataBound
@@ -634,11 +634,11 @@ Partial Class RepVentaDetalle
e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Right
End If
End Sub
End Sub
#End Region
#Region "PERSONALIZAR COLUMNAS"
Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs) Handles BtnPersonalizar.Click
If ChkFolio.Checked Then
@@ -822,10 +822,10 @@ Partial Class RepVentaDetalle
ImgExcelPersonalizado.Visible = False
End If
UPDatos.Update()
End Sub
End Sub
#End Region
#Region "IMPRESIONES"
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
'GvDatos.ExportToExcel("DetalleVentas_" & Now.ToShortDateString)
@@ -876,8 +876,8 @@ Partial Class RepVentaDetalle
pathPDF = Server.MapPath(String.Format("~/Empresas/{0}/PDF/{1}/{2}.pdf", UsuarioActual.CveEmpresa, TipoDocto, gvr.DataKey("SerieFolio").ToString))
If Not IO.File.Exists(pathPDF) Then
GenerarFacturaVentaDEV(gvr.DataKey("CveVenta").ToEntero, UsuarioActual.CveUsuario)
If Not IO.File.Exists(pathPDF) Then
GenerarFacturaVentaDEV(gvr.DataKey("CveVenta").ToEntero, UsuarioActual.CveUsuario)
'ListaPDF.Add(New MFacturaDescarga() With {.CveVenta = gvr.DataKey("CveVenta").ToEntero, .PDF = GenerarFacturaVentaDEV(gvr.DataKey("CveVenta").ToEntero, 100)})
End If
End If
@@ -886,8 +886,8 @@ Partial Class RepVentaDetalle
'D E S C A R G A I O N I C !
Dim DescargaZIP As Ionic.Zip.ZipFile = New Ionic.Zip.ZipFile()
Using DescargaZIP
DescargaZIP.UseZip64WhenSaving = Ionic.Zip.Zip64Option.AsNecessary
DescargaZIP.UseZip64WhenSaving = Ionic.Zip.Zip64Option.AsNecessary
For Each gvr As GridViewRow In GvDatos.Rows
If gvr.DataKey("CveVenta").ToEntero > 0 Then
Select Case gvr.DataKey("TipoDocumento").ToString
@@ -912,9 +912,9 @@ Partial Class RepVentaDetalle
If IO.File.Exists(pathPDF) Then
'NO AGREGAR ARCHIVOS REPETIDOS
Dim File As New IO.FileInfo(pathPDF)
If Not DescargaZIP.Any(Function(x) x.FileName.Contains(File.Name)) Then
DescargaZIP.AddFile(pathPDF, gvr.DataKey("TipoDocumento").ToString)
End If
If Not DescargaZIP.Any(Function(x) x.FileName.Contains(File.Name)) Then
DescargaZIP.AddFile(pathPDF, gvr.DataKey("TipoDocumento").ToString)
End If
End If
End If
Next
@@ -923,7 +923,7 @@ Partial Class RepVentaDetalle
Response.AddHeader("content-Disposition", "attachment; filename=ReporteVentasPDF.zip")
Response.ContentType = "application/zip"
Response.End()
End Sub
End Sub
Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer, CveUsuarioCreo As Integer) As Byte()
Dim Url = New Uri(String.Format("{0}Compras/PopUpVerFactura.aspx?P={1}", "http://localhost:85/", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta))))
Dim File As Byte() = Nothing
@@ -978,8 +978,8 @@ Partial Class RepVentaDetalle
If IO.File.Exists(pathXML) Then
'NO AGREGAR ARCHIVOS REPETIDOS
Dim File As New IO.FileInfo(pathXML)
If Not DescargaZIP.Any(Function(x) x.FileName.Contains(File.Name)) Then
DescargaZIP.AddFile(pathXML, gvr.DataKey("TipoDocumento").ToString)
If Not DescargaZIP.Any(Function(x) x.FileName.Contains(File.Name)) Then
DescargaZIP.AddFile(pathXML, gvr.DataKey("TipoDocumento").ToString)
End If
End If
End If
@@ -1014,13 +1014,15 @@ Partial Class RepVentaDetalle
Vendedor = If(DdlVendedor.GetSelectedText = "", "", $"&emsp;<b>Vendedor:</b>&nbsp;{DdlVendedor.GetSelectedText}")
CveUsuario = If(DdlUsuario.SelectedValue = "-1", "", $"&emsp;<b>Usuario:</b>&nbsp;{DdlUsuario.SelectedItem.Text}")
CveEstatusFactura = If(DdlEstatus.GetSelectedText = "", "", $"&emsp;<b>Estatus:</b>&nbsp;{DdlEstatus.GetSelectedText}")
CondicionesPago = If(DdlCondicionesPago.selectedValue = "-1", "", String.Format("&emsp;<b>Condiciones Pago</b>: {0}", DdlCondicionesPago.SelectedItem.Text))
CondicionesPago = If(DdlCondicionesPago.selectedValue = "-1", "", String.Format("&emsp;<b>Condiciones Pago</b>: {0}", DdlCondicionesPago.SelectedItem.Text))
Dim RutaFormato = String.Format("{0}Formatos\RepVentaDetalle.rdlc", UsuarioActual.Empresa.Ruta)
Dim Archivo As New System.IO.FileInfo(RutaFormato)
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
Dim logouri = String.Format("file://{0}", Imagen.FullName)
Dim dt As DataTable = DtVentas.FiltraParametros("(GPO IS NULL AND Cantidad IS NOT NULL) OR (GPO IS NOT NULL AND Cantidad IS NOT NULL)")
Dim params As New List(Of ReportParameter)
@@ -1050,134 +1052,134 @@ Partial Class RepVentaDetalle
GenerarPDF()
End Sub
Private Function GenerarFacturaVentaDEV(CveVenta As Integer, CveUsuario As Integer) As Byte()
Return DescargarFactura(CveVenta, UsuarioActual.CveEmpresa, CveUsuario)
'Dim ObjVentas As New ClsVentas
'Dim Vta As Modelos.Factura = Nothing
'Dim TmpDTImpuestos = New DataTable
'TmpDTImpuestos.Columns.Add("ImpuestoLocal", GetType(String))
'TmpDTImpuestos.Columns.Add("Importe", GetType(Double))
'TmpDTImpuestos.Columns.Add("Orden", GetType(Integer))
'If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
' Dim dtVentas As DataTable = ObjVentas.DtResultados
' ' se rellenan los campos de la factura
' Vta = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, Server.MapPath("/"))
' Vta.MonedaAbreviatura = dtVentas(0)("Abreviatura").ToString
' 'se rellena la sucursal
' Vta.Cliente.Sucursal = New Modelos.ClienteModel(dtVentas(0)("CveCliente").ToString.ToEntero, UsuarioActual.CveEmpresa)
' Vta.Cliente = New Modelos.ClienteModel
' Vta.Cliente.Nombre = dtVentas(0)("ClienteNombre").ToString
' Vta.Cliente.Telefono = dtVentas(0)("Telefono").ToString
' Vta.Cliente.Direccion = dtVentas(0)("ClienteDireccion").ToString
' Vta.Cliente.CP = dtVentas(0)("CPCliente").ToString
' Vta.Cliente.Ciudad = dtVentas(0)("ClienteCiudad").ToString
' Vta.Cliente.Localidad = dtVentas(0)("ClienteLocalidad").ToString
' Vta.Cliente.Estado = dtVentas(0)("ClienteEstado").ToString
' Vta.Cliente.Pais = dtVentas(0)("ClientePais").ToString
' Vta.Cliente.RFC = dtVentas(0)("ClienteRFC").ToString
' Vta.Cliente.Colonia = dtVentas(0)("ColoniaCliente").ToString
' Vta.AtencionA = dtVentas(0)("AtencionA").ToString
' Vta.Cliente.NoExt = dtVentas(0)("ClienteNoExt").ToString
' Vta.Cliente.NoInt = dtVentas(0)("ClienteNoInt").ToString
' Vta.Cliente.Codigo = dtVentas(0)("ClienteCodigo").ToString
' Vta.Cliente.Mail = dtVentas(0)("Mail").ToString
' Vta.RefDocto = dtVentas(0)("Ref").ToString
' Vta.CveVenta = dtVentas(0)("CveVenta").ToString.ToEntero
' Vta.ClienteSucursal = New Modelos.SucursalModel
' Vta.ClienteSucursal.Direccion = dtVentas(0)("SucClienteDireccion").ToString
' Vta.ClienteSucursal.NoExt = dtVentas(0)("SucClienteNoExt").ToString
' Vta.ClienteSucursal.NoInt = dtVentas(0)("SucClienteNoInt").ToString
' Vta.ClienteSucursal.Colonia = dtVentas(0)("SucClienteColonia").ToString
' Vta.ClienteSucursal.CP = dtVentas(0)("SucClienteCP").ToString
' Vta.ClienteSucursal.Municipio = dtVentas(0)("SucClienteCiudad").ToString
' Vta.ClienteSucursal.Estado = dtVentas(0)("SucClienteEstado").ToString
' Vta.ClienteSucursal.Pais = dtVentas(0)("SucClientePais").ToString
' Vta.ClienteSucursal.Localidad = dtVentas(0)("SucClienteLocalidad").ToString
' Vta.ClienteSucursal.CorreoSucursal = dtVentas(0)("SucClienteCorreo").ToString
' Vta.ClienteSucursal.TelefonoSucursal = dtVentas(0)("SucClienteTelefono").ToString
' Vta.ClienteSucursal.Sucursal = dtVentas(0)("SucursalCliente").ToString
' Vta.EnviarA = New Modelos.EnviarAModel
' Vta.EnviarA.CveDireccionEnvio = dtVentas(0)("CveDireccionEnvio").ToString.ToEntero
' Vta.EnviarA.EnvioDireccion = dtVentas(0)("EnvioDireccion").ToString
' Vta.EnviarA.EnvioColonia = dtVentas(0)("EnvioColonia").ToString
' Vta.EnviarA.EnvioCiudad = dtVentas(0)("EnvioCiudad").ToString
' Vta.EnviarA.EnvioEstado = dtVentas(0)("EnvioEstado").ToString
' Vta.EnviarA.EnvioCP = dtVentas(0)("EnvioCP").ToString
' Dim DR As DataRow = TmpDTImpuestos.NewRow()
' If UsuarioActual.CveEmpresa.Contiene(1, 5, 15, 17, 72, 66, 79, 81, 109, 110, 111, 76) Then
' If dtVentas(0)("SubTotal").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Subtotal" : DR("Importe") = dtVentas(0)("SubTotal").ToString.ToDouble : DR("Orden") = 10 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("Descuento").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Descuentos" : DR("Importe") = dtVentas(0)("Descuento").ToString.ToDouble : DR("Orden") = 20 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("Amortizacion").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Amort.Ant" : DR("Importe") = dtVentas(0)("Amortizacion").ToString.ToDouble : DR("Orden") = 30 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("SubTotal").ToString.ToDouble <> (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) Then DR("ImpuestoLocal") = "SubTotal2" : DR("Importe") = (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) : DR("Orden") = 40 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("IVA").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "IVA" : DR("Importe") = dtVentas(0)("IVA").ToString.ToDouble : DR("Orden") = 50 : TmpDTImpuestos.Rows.Add(DR)
' 'solo para eclipse, que muesre un subtotal debajo de IVA
' If UsuarioActual.CveEmpresa = 15 Then DR = TmpDTImpuestos.NewRow() : DR("ImpuestoLocal") = "Subtotal2" : DR("Importe") = (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) + dtVentas(0)("IVA").ToString.ToDouble : DR("Orden") = 51 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("RetIVA").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Ret.IVA" : DR("Importe") = dtVentas(0)("RetIVA").ToString.ToDouble : DR("Orden") = 60 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("RetISR").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Ret.ISR" : DR("Importe") = dtVentas(0)("RetISR").ToString.ToDouble : DR("Orden") = 70 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("Total").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Total" : DR("Importe") = dtVentas(0)("Total").ToString.ToDouble : DR("Orden") = 1000 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' End If
' If ObjVentas.GetVentaDetalle(CveVenta) Then 'Obtenemos el Detalle de la Oorden de Compra
' Vta.DtDetalle = ObjVentas.DtResultados
' End If
' If ObjVentas.GetVentaImpuestosLocales(CveVenta) Then
' If UsuarioActual.CveEmpresa.Contiene(1, 5, 15, 17, 72, 66, 79, 81, 109, 110, 111, 76) Then
' Dim dtImpuesto As DataTable = ObjVentas.DtResultados
' If dtImpuesto.Rows.Count > 0 Then
' For Each Row As DataRow In dtImpuesto.Rows
' Dim Orden = 80
' If Row("Importe").ToString.ToDouble <> 0 Then
' DR("ImpuestoLocal") = Row("ImpuestoLocal").ToString
' DR("Importe") = Row("Importe").ToString.ToDouble
' DR("Orden") = Orden
' TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' Orden = Orden + 1
' End If
' Next
' End If
' Vta.DtDeduccion = TmpDTImpuestos.FiltraParametros("", Orderby:="Orden ASC")
' Else
' Vta.DtDeduccion = ObjVentas.DtResultados
' End If
' End If
' If ObjVentas.GetVentasFirmas(CveVenta) Then
' Vta.DtFirmas = ObjVentas.DtResultados
' End If
'End If
'ObjVentas.Dispose()
'If Not IsNothing(Vta) Then
' PdfFactura(Vta)
' Vta = Nothing
'End If
End Function
Private Function GenerarFacturaVentaDEV(CveVenta As Integer, CveUsuario As Integer) As Byte()
Return DescargarFactura(CveVenta, UsuarioActual.CveEmpresa, CveUsuario)
'Dim ObjVentas As New ClsVentas
'Dim Vta As Modelos.Factura = Nothing
'Dim TmpDTImpuestos = New DataTable
'TmpDTImpuestos.Columns.Add("ImpuestoLocal", GetType(String))
'TmpDTImpuestos.Columns.Add("Importe", GetType(Double))
'TmpDTImpuestos.Columns.Add("Orden", GetType(Integer))
'If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
' Dim dtVentas As DataTable = ObjVentas.DtResultados
' ' se rellenan los campos de la factura
' Vta = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, Server.MapPath("/"))
' Vta.MonedaAbreviatura = dtVentas(0)("Abreviatura").ToString
' 'se rellena la sucursal
' Vta.Cliente.Sucursal = New Modelos.ClienteModel(dtVentas(0)("CveCliente").ToString.ToEntero, UsuarioActual.CveEmpresa)
' Vta.Cliente = New Modelos.ClienteModel
' Vta.Cliente.Nombre = dtVentas(0)("ClienteNombre").ToString
' Vta.Cliente.Telefono = dtVentas(0)("Telefono").ToString
' Vta.Cliente.Direccion = dtVentas(0)("ClienteDireccion").ToString
' Vta.Cliente.CP = dtVentas(0)("CPCliente").ToString
' Vta.Cliente.Ciudad = dtVentas(0)("ClienteCiudad").ToString
' Vta.Cliente.Localidad = dtVentas(0)("ClienteLocalidad").ToString
' Vta.Cliente.Estado = dtVentas(0)("ClienteEstado").ToString
' Vta.Cliente.Pais = dtVentas(0)("ClientePais").ToString
' Vta.Cliente.RFC = dtVentas(0)("ClienteRFC").ToString
' Vta.Cliente.Colonia = dtVentas(0)("ColoniaCliente").ToString
' Vta.AtencionA = dtVentas(0)("AtencionA").ToString
' Vta.Cliente.NoExt = dtVentas(0)("ClienteNoExt").ToString
' Vta.Cliente.NoInt = dtVentas(0)("ClienteNoInt").ToString
' Vta.Cliente.Codigo = dtVentas(0)("ClienteCodigo").ToString
' Vta.Cliente.Mail = dtVentas(0)("Mail").ToString
' Vta.RefDocto = dtVentas(0)("Ref").ToString
' Vta.CveVenta = dtVentas(0)("CveVenta").ToString.ToEntero
' Vta.ClienteSucursal = New Modelos.SucursalModel
' Vta.ClienteSucursal.Direccion = dtVentas(0)("SucClienteDireccion").ToString
' Vta.ClienteSucursal.NoExt = dtVentas(0)("SucClienteNoExt").ToString
' Vta.ClienteSucursal.NoInt = dtVentas(0)("SucClienteNoInt").ToString
' Vta.ClienteSucursal.Colonia = dtVentas(0)("SucClienteColonia").ToString
' Vta.ClienteSucursal.CP = dtVentas(0)("SucClienteCP").ToString
' Vta.ClienteSucursal.Municipio = dtVentas(0)("SucClienteCiudad").ToString
' Vta.ClienteSucursal.Estado = dtVentas(0)("SucClienteEstado").ToString
' Vta.ClienteSucursal.Pais = dtVentas(0)("SucClientePais").ToString
' Vta.ClienteSucursal.Localidad = dtVentas(0)("SucClienteLocalidad").ToString
' Vta.ClienteSucursal.CorreoSucursal = dtVentas(0)("SucClienteCorreo").ToString
' Vta.ClienteSucursal.TelefonoSucursal = dtVentas(0)("SucClienteTelefono").ToString
' Vta.ClienteSucursal.Sucursal = dtVentas(0)("SucursalCliente").ToString
' Vta.EnviarA = New Modelos.EnviarAModel
' Vta.EnviarA.CveDireccionEnvio = dtVentas(0)("CveDireccionEnvio").ToString.ToEntero
' Vta.EnviarA.EnvioDireccion = dtVentas(0)("EnvioDireccion").ToString
' Vta.EnviarA.EnvioColonia = dtVentas(0)("EnvioColonia").ToString
' Vta.EnviarA.EnvioCiudad = dtVentas(0)("EnvioCiudad").ToString
' Vta.EnviarA.EnvioEstado = dtVentas(0)("EnvioEstado").ToString
' Vta.EnviarA.EnvioCP = dtVentas(0)("EnvioCP").ToString
' Dim DR As DataRow = TmpDTImpuestos.NewRow()
' If UsuarioActual.CveEmpresa.Contiene(1, 5, 15, 17, 72, 66, 79, 81, 109, 110, 111, 76) Then
' If dtVentas(0)("SubTotal").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Subtotal" : DR("Importe") = dtVentas(0)("SubTotal").ToString.ToDouble : DR("Orden") = 10 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("Descuento").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Descuentos" : DR("Importe") = dtVentas(0)("Descuento").ToString.ToDouble : DR("Orden") = 20 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("Amortizacion").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Amort.Ant" : DR("Importe") = dtVentas(0)("Amortizacion").ToString.ToDouble : DR("Orden") = 30 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("SubTotal").ToString.ToDouble <> (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) Then DR("ImpuestoLocal") = "SubTotal2" : DR("Importe") = (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) : DR("Orden") = 40 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("IVA").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "IVA" : DR("Importe") = dtVentas(0)("IVA").ToString.ToDouble : DR("Orden") = 50 : TmpDTImpuestos.Rows.Add(DR)
' 'solo para eclipse, que muesre un subtotal debajo de IVA
' If UsuarioActual.CveEmpresa = 15 Then DR = TmpDTImpuestos.NewRow() : DR("ImpuestoLocal") = "Subtotal2" : DR("Importe") = (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) + dtVentas(0)("IVA").ToString.ToDouble : DR("Orden") = 51 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("RetIVA").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Ret.IVA" : DR("Importe") = dtVentas(0)("RetIVA").ToString.ToDouble : DR("Orden") = 60 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("RetISR").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Ret.ISR" : DR("Importe") = dtVentas(0)("RetISR").ToString.ToDouble : DR("Orden") = 70 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("Total").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Total" : DR("Importe") = dtVentas(0)("Total").ToString.ToDouble : DR("Orden") = 1000 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' End If
' If ObjVentas.GetVentaDetalle(CveVenta) Then 'Obtenemos el Detalle de la Oorden de Compra
' Vta.DtDetalle = ObjVentas.DtResultados
' End If
' If ObjVentas.GetVentaImpuestosLocales(CveVenta) Then
' If UsuarioActual.CveEmpresa.Contiene(1, 5, 15, 17, 72, 66, 79, 81, 109, 110, 111, 76) Then
' Dim dtImpuesto As DataTable = ObjVentas.DtResultados
' If dtImpuesto.Rows.Count > 0 Then
' For Each Row As DataRow In dtImpuesto.Rows
' Dim Orden = 80
' If Row("Importe").ToString.ToDouble <> 0 Then
' DR("ImpuestoLocal") = Row("ImpuestoLocal").ToString
' DR("Importe") = Row("Importe").ToString.ToDouble
' DR("Orden") = Orden
' TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' Orden = Orden + 1
' End If
' Next
' End If
' Vta.DtDeduccion = TmpDTImpuestos.FiltraParametros("", Orderby:="Orden ASC")
' Else
' Vta.DtDeduccion = ObjVentas.DtResultados
' End If
' End If
' If ObjVentas.GetVentasFirmas(CveVenta) Then
' Vta.DtFirmas = ObjVentas.DtResultados
' End If
'End If
'ObjVentas.Dispose()
'If Not IsNothing(Vta) Then
' PdfFactura(Vta)
' Vta = Nothing
'End If
End Function
#End Region
#Region "GRAFICA"
Private Sub CreaDataTableColor()
DtColor = New DataTable
DtColor.Columns.Add("Color")
@@ -1308,9 +1310,9 @@ Partial Class RepVentaDetalle
Protected Sub DdlVer_SelectedIndexChanged(sender As Object, e As EventArgs)
CambioGrafica()
End Sub
End Sub
#End Region
End Class

View File

@@ -493,7 +493,7 @@
<table>
<asp:CheckBox ID="ChkDireccionEnvio" runat="server" AutoPostBack="true" />
<span style="margin-left: 1px;">
<asp:DropDownList ID="DdlDireccionEnvio" runat="server" AutoPostBack="true" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="SucursalClienteVentaDireccion" DataValueField="CveDireccionEnvio" Width="180px" Visible="false">
<asp:DropDownList ID="DdlDireccionEnvio" runat="server" AutoPostBack="true" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="SucursalClienteVentaDireccion" DataValueField="CveDireccionEnvio" Width="180px" Visible="false" OnSelectedIndexChanged="DdlDireccionEnvio_SelectedIndexChanged">
<asp:ListItem Selected="true" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</span>
@@ -2219,7 +2219,7 @@
<ContentTemplate>
<asp:UpdatePanel ID="UPComplementosSAT" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table border="0" cellpadding="0" cellspacing="0" class="TextTab">
<table border="0" cellpadding="0" cellspacing="0" class="TextTab" style="width: 100%">
<tr valign="top">
<td rowspan="2" colspan="1">
<div class="portlet light xspadding bordered whitoutcol" style="width: 330px;">
@@ -2445,148 +2445,150 @@
</div>
</td>
<td rowspan="1" colspan="2">
<div class="portlet light xspadding bordered whitoutcol" style="width: 850px;">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">COMERCIO EXTERIOR</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" onclick="CargaComercioExterior()" class="expand"></a>
</div>
</div>
<div class="portlet-body form-horizontal form-row-sepe formnombottom" style="padding: 10px 20px 10px 30px">
<asp:UpdatePanel ID="UpComercioExterior" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="form-body">
<div class="row">
<label class="col-md-2 form-group form-md-line-input">Tipo Operación:</label>
<div class="col-md-3 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:Label ID="LblTipoOperacion" runat="server"></asp:Label>
<%--<asp:DropDownList ID="DdlTipoOperacion" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATTipoOperacionDescripcion" DataValueField="CveTipoOperacion"></asp:DropDownList>--%>
</div>
<label class="col-md-2 form-group form-md-line-input" style="padding-left: 20px;">Clave Pedimento:</label>
<div class="col-md-5 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:Label ID="LblClavePedimento" runat="server"></asp:Label>
<%--<asp:TextBox ID="TxtClavePedimento" CssClass="form-control input-sm" runat="server" Width="100%"></asp:TextBox>--%>
</div>
</div>
<div class="row">
<label class="col-md-2 form-group form-md-line-input">Incoterm:</label>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:DropDownList ID="DdlIncoterm" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATIncotermDescripcion" DataValueField="CveIncoterm">
</asp:DropDownList>
</div>
</div>
<div class="row">
<label class="col-md-2 form-group form-md-line-input">Motivo Traslado:</label>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:DropDownList ID="DdlSATMotivoTraslado" Width="100%" runat="server" CssClass="select2me" DataTextField="ClaveSATMotivoTrasladoDescripcion" DataValueField="CveMotivoTraslado"></asp:DropDownList>
</div>
<label class="col-md-2 form-group form-md-line-input" style="padding-left: 20px;">Num Reg IdTrib:</label>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:TextBox ID="TxtNumRegIdTrib" CssClass="form-control input-sm" runat="server" Width="100%"></asp:TextBox>
</div>
<%-- <label class="col-md-1"></label>
<div class="col-md-1">
</div>--%>
</div>
<div class="row">
<div class="col-md-12">
<asp:UpdatePanel ID="UPPDestina" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-2 form-group form-md-line-input"><span>Nombre:</span></div>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:TextBox ID="TxtDestinatarioNombre" CssClass="form-control input-sm" runat="server" Width="100%"></asp:TextBox>
</div>
</div>
<div class="row">
<div class="col-md-2 form-group form-md-line-input"><span>Calle:</span></div>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:TextBox ID="TxtComExtCalle" CssClass="form-control input-sm" runat="server" Width="100%"></asp:TextBox>
</div>
<div class="col-md-1 form-group form-md-line-input"><span>Núm.</span></div>
<div class="col-md-2 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:TextBox ID="TxtComExtNumero" CssClass="form-control input-sm" runat="server" Width="55px"></asp:TextBox>
</div>
<div class="col-md-1 form-group form-md-line-input"><span>CP.</span></div>
<div class="col-md-2 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:TextBox ID="TxtComExtCP" CssClass="form-control input-sm" runat="server" Width="65px"></asp:TextBox>
</div>
</div>
<div class="row">
<div class="col-md-2 form-group form-md-line-input"><span>Pais:</span></div>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:DropDownList ID="DdlComExtPais" AutoPostBack="true" OnSelectedIndexChanged="DdlPais_SelectedIndexChanged" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATPaisDescripcion" DataValueField="CvePais"></asp:DropDownList>
<asp:TextBox ID="TxtComExtPais" CssClass="form-control input-sm" runat="server" Width="100%" Visible="false"></asp:TextBox>
</div>
<div class="col-md-2 form-group form-md-line-input" style="padding-left: 20px;"><span>Estado:</span></div>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:DropDownList ID="DdlComExtEstado" AutoPostBack="true" OnSelectedIndexChanged="DdlEstado_SelectedIndexChanged" Visible="false" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATEstadoNombreEstado" DataValueField="CveEstado"></asp:DropDownList>
<asp:TextBox ID="TxtComExtEstado" CssClass="form-control input-sm" runat="server" Width="100%" Visible="false"></asp:TextBox>
</div>
</div>
<div class="row">
<div class="col-md-2 form-group form-md-line-input"><span>Municipio:</span></div>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:DropDownList ID="DdlComExtMunicipio" AutoPostBack="true" OnSelectedIndexChanged="DdlMunicipio_SelectedIndexChanged" Visible="false" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATMunicipioDescripcion" DataValueField="CveMunicipio"></asp:DropDownList>
<asp:TextBox ID="TxtComExtMunicipio" CssClass="form-control input-sm" runat="server" Width="100%" Visible="false"></asp:TextBox>
</div>
<div class="col-md-2 form-group form-md-line-input" style="padding-left: 20px;"><span>Colonia:</span></div>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:DropDownList ID="DdlComExtColonia" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" Visible="false" runat="server" DataTextField="ClaveSATColoniaNombreAsentamiento" DataValueField="CveColonia"></asp:DropDownList>
<asp:TextBox ID="TxtComExtColonia" CssClass="form-control input-sm" runat="server" Width="100%" Visible="false"></asp:TextBox>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="row">
<div class="col-md-7">
<div class="portlet light xspadding bordered whitoutcol" style="width: 100%;">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">COMERCIO EXTERIOR</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="row">
<div class="col-md-12">
Convertir a unidad Aduana
<div class="tools">
<a href="javascript:;" onclick="CargaComercioExterior()" class="expand"></a>
</div>
</div>
<div class="portlet-body form-horizontal form-row-sepe formnombottom" style="padding: 10px 20px 10px 30px">
<asp:UpdatePanel ID="UpComercioExterior" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="form-body">
<div class="row">
<label class="col-md-2 form-group form-md-line-input">Tipo Operación:</label>
<div class="col-md-3 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:Label ID="LblTipoOperacion" runat="server"></asp:Label>
<%--<asp:DropDownList ID="DdlTipoOperacion" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATTipoOperacionDescripcion" DataValueField="CveTipoOperacion"></asp:DropDownList>--%>
</div>
<label class="col-md-2 form-group form-md-line-input" style="padding-left: 20px;">Clave Pedimento:</label>
<div class="col-md-5 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:Label ID="LblClavePedimento" runat="server"></asp:Label>
<%--<asp:TextBox ID="TxtClavePedimento" CssClass="form-control input-sm" runat="server" Width="100%"></asp:TextBox>--%>
</div>
</div>
<div class="row">
<label class="col-md-2 form-group form-md-line-input">Incoterm:</label>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:DropDownList ID="DdlIncoterm" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATIncotermDescripcion" DataValueField="CveIncoterm">
</asp:DropDownList>
</div>
</div>
<div class="row">
<label class="col-md-2 form-group form-md-line-input">Motivo Traslado:</label>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:DropDownList ID="DdlSATMotivoTraslado" Width="100%" runat="server" CssClass="select2me" DataTextField="ClaveSATMotivoTrasladoDescripcion" DataValueField="CveMotivoTraslado"></asp:DropDownList>
</div>
<label class="col-md-2 form-group form-md-line-input" style="padding-left: 20px;">Num Reg IdTrib:</label>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:TextBox ID="TxtNumRegIdTrib" CssClass="form-control input-sm" runat="server" Width="100%"></asp:TextBox>
</div>
<%-- <label class="col-md-1"></label>
<div class="col-md-1">
</div>--%>
</div>
<div class="row">
<div class="col-md-12">
<asp:UpdatePanel ID="UPPDestina" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-2 form-group form-md-line-input"><span>Nombre:</span></div>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:TextBox ID="TxtDestinatarioNombre" CssClass="form-control input-sm" runat="server" Width="100%"></asp:TextBox>
</div>
</div>
<div class="row">
<div class="col-md-2 form-group form-md-line-input"><span>Calle:</span></div>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:TextBox ID="TxtComExtCalle" CssClass="form-control input-sm" runat="server" Width="100%"></asp:TextBox>
</div>
<div class="col-md-1 form-group form-md-line-input"><span>Núm.</span></div>
<div class="col-md-2 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:TextBox ID="TxtComExtNumero" CssClass="form-control input-sm" runat="server" Width="55px"></asp:TextBox>
</div>
<div class="col-md-1 form-group form-md-line-input"><span>CP.</span></div>
<div class="col-md-2 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:TextBox ID="TxtComExtCP" CssClass="form-control input-sm" runat="server" Width="65px"></asp:TextBox>
</div>
</div>
<div class="row">
<div class="col-md-2 form-group form-md-line-input"><span>Pais:</span></div>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:DropDownList ID="DdlComExtPais" AutoPostBack="true" OnSelectedIndexChanged="DdlPais_SelectedIndexChanged" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATPaisDescripcion" DataValueField="CvePais"></asp:DropDownList>
<asp:TextBox ID="TxtComExtPais" CssClass="form-control input-sm" runat="server" Width="100%" Visible="false"></asp:TextBox>
</div>
<div class="col-md-2 form-group form-md-line-input" style="padding-left: 20px;"><span>Estado:</span></div>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:DropDownList ID="DdlComExtEstado" AutoPostBack="true" OnSelectedIndexChanged="DdlEstado_SelectedIndexChanged" Visible="false" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATEstadoNombreEstado" DataValueField="CveEstado"></asp:DropDownList>
<asp:TextBox ID="TxtComExtEstado" CssClass="form-control input-sm" runat="server" Width="100%" Visible="false"></asp:TextBox>
</div>
</div>
<div class="row">
<div class="col-md-2 form-group form-md-line-input"><span>Municipio:</span></div>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:DropDownList ID="DdlComExtMunicipio" AutoPostBack="true" OnSelectedIndexChanged="DdlMunicipio_SelectedIndexChanged" Visible="false" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATMunicipioDescripcion" DataValueField="CveMunicipio"></asp:DropDownList>
<asp:TextBox ID="TxtComExtMunicipio" CssClass="form-control input-sm" runat="server" Width="100%" Visible="false"></asp:TextBox>
</div>
<div class="col-md-2 form-group form-md-line-input" style="padding-left: 20px;"><span>Colonia:</span></div>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:DropDownList ID="DdlComExtColonia" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" Visible="false" runat="server" DataTextField="ClaveSATColoniaNombreAsentamiento" DataValueField="CveColonia"></asp:DropDownList>
<asp:TextBox ID="TxtComExtColonia" CssClass="form-control input-sm" runat="server" Width="100%" Visible="false"></asp:TextBox>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
Convertir a unidad Aduana
<asp:TextBox ID="TxtComExtConvertir" runat="server" Width="60px"></asp:TextBox><asp:Button ID="BtnComExtConvertirUnidad" runat="server" Text="Convertir" />
<asp:GridView ID="GvComercioExterior" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False"
EmptyDataText="No hay datos disponibles" DataKeyNames="Cantidad,Codigo,ClaveSATFraccionArancelaria,ClaveSATUnidadAduana" OnRowDataBound="GvComercioExterior_RowDataBound">
<Columns>
<asp:TemplateField HeaderText="Cantidad">
<ItemTemplate>
<asp:TextBox ID="TxtCantidad" runat="server" Text='<%# Eval("Cantidad", "{0:#,##0.##}") %>' Width="50px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="CodigoPS" HeaderText="Producto ó Servicio" />
<asp:TemplateField HeaderText="Valor Unitario">
<ItemTemplate>
<asp:TextBox ID="TxtValorUnitario" runat="server" Text='<%# Eval("PU", "{0:N2}") %>' Width="60px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="ClaveSATFraccionArancelariaDescripcion" HeaderText="Fracción Arancelaria" />
<asp:BoundField DataField="ClaveSATUnidadAduanaDescripcion" HeaderText="Unidad Aduana" />
<%-- <asp:TemplateField HeaderText="Unidad Aduana">
<asp:GridView ID="GvComercioExterior" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False"
EmptyDataText="No hay datos disponibles" DataKeyNames="Cantidad,Codigo,ClaveSATFraccionArancelaria,ClaveSATUnidadAduana" OnRowDataBound="GvComercioExterior_RowDataBound">
<Columns>
<asp:TemplateField HeaderText="Cantidad">
<ItemTemplate>
<asp:TextBox ID="TxtCantidad" runat="server" Text='<%# Eval("Cantidad", "{0:#,##0.##}") %>' Width="50px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="CodigoPS" HeaderText="Producto ó Servicio" />
<asp:TemplateField HeaderText="Valor Unitario">
<ItemTemplate>
<asp:TextBox ID="TxtValorUnitario" runat="server" Text='<%# Eval("PU", "{0:N2}") %>' Width="60px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="ClaveSATFraccionArancelariaDescripcion" HeaderText="Fracción Arancelaria" />
<asp:BoundField DataField="ClaveSATUnidadAduanaDescripcion" HeaderText="Unidad Aduana" />
<%-- <asp:TemplateField HeaderText="Unidad Aduana">
<ItemTemplate>
<asp:DropDownList ID="DdlUnidadAduana" runat="server" AppendDataBoundItems="true" CssClass="select2me" DataTextField="ClaveSATUnidadAduanaDescripcion" DataValueField="CveUnidadAduana"></asp:DropDownList>
</ItemTemplate>
@@ -2596,22 +2598,143 @@
<ADS:Dropdownlost ID="DdlFraccionArancelaria" runat="server" CssClassDdl="selecthidden" CssStyle="width: 100%;" DataTextField="ClaveSATFraccionArancelariaDescripcion" DataValueField="CveFraccionArancelaria"></ADS:Dropdownlost>
</ItemTemplate>
</asp:TemplateField>--%>
<asp:TemplateField HeaderText="Total USD">
<ItemTemplate>
<asp:Label ID="LblTotalUSD" Text='<%# (CDbl(Eval("Cantidad").ToString) * CDbl(Eval("PU").ToString)).ToString("N2") %>' runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Marca">
<ItemTemplate>
<asp:TextBox ID="TxtMarca" runat="server" Text="" Width="70px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:TemplateField HeaderText="Total USD">
<ItemTemplate>
<asp:Label ID="LblTotalUSD" Text='<%# (CDbl(Eval("Cantidad").ToString) * CDbl(Eval("PU").ToString)).ToString("N2") %>' runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Marca">
<ItemTemplate>
<asp:TextBox ID="TxtMarca" runat="server" Text="" Width="70px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
<div class="col-md-5">
<div id="DivCartaPorte" runat="server" visible="false" class="portlet light xspadding bordered whitoutcol" style="width: 100%">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">CARTA PORTE</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body ">
<div class="rowpadding">
<asp:UpdatePanel ID="UpEmitirTransitorio" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row rowpadding">
<label class="col-md-2">Emitir:</label>
<div class="col-md-10">
<asp:CheckBox ID="ChkEmitirCartaPorte" runat="server" CssClass="chksino" Text=" " />
</div>
</div>
<br />
<div class="row rowpadding">
<label class="col-md-2">Origen:</label>
<div class="col-md-10">
<asp:TextBox ID="TxtOrigenCP" runat="server" Enabled="false" Text="" CssClass="form-control input-sm"></asp:TextBox>
</div>
</div>
<br />
<div class="row rowpadding">
<label class="col-md-2">Destino:</label>
<div class="col-md-10">
<asp:TextBox ID="TxtDestinoCP" runat="server" Enabled="false" Text="" CssClass="form-control input-sm"></asp:TextBox>
</div>
</div>
<br />
<div class="row rowpadding">
<label class="col-md-2">Fecha Llegada:</label>
<div class="col-md-4">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 117px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaLlegadaCP" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaSalidaCP" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaSalidaCP" runat="server" TargetControlID="TxtFechaLlegadaCP" Mask="99/99/9999" MaskType="Date" DisplayMoney="Right" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaSalidaCP" TargetControlID="TxtFechaLlegadaCP" PopupButtonID="ImgFechaSalidaCP" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
</div>
<label class="col-md-2">Fecha Entrega:</label>
<div class="col-md-4">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 117px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaEntregaCP" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaEntregaCP" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaEntregaCP" runat="server" TargetControlID="TxtFechaEntregaCP" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFEchaEntregaCP" TargetControlID="TxtFechaEntregaCP" PopupButtonID="ImgFechaEntregaCP" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
</div>
</div>
<br />
<div class="row rowpadding">
<label class="col-md-2">Distancia:</label>
<div class="col-md-10">
<asp:TextBox ID="TxtDistancia" runat="server" CssClass="form-control input-sm" type="number"></asp:TextBox>
</div>
</div>
<br />
<div class="row rowpadding">
<label class="col-md-2">Chofer:</label>
<div class="col-md-10">
<asp:DropDownList ID="DdlChofer" runat="server" DataTextField="ChoferLicencia" DataValueField="CveChofer" CssClass="form-control input-sm select2me" Width="100%"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlChofer" runat="server" Enabled="false" ControlToValidate="DdlChofer" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Chofer''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceDdlChofer" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlChofer" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<br />
<div class="row rowpadding">
<label class="col-md-2">Unidad:</label>
<div class="col-md-10">
<asp:DropDownList runat="server" ID="DdlUnidadCamion" AutoPostBack="true" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" DataValueField="CveCamion" DataTextField="CamionPlaca" OnSelectedIndexChanged="DdlUnidadCamionActivoFijo_SelectedIndexChanged"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlUnidadCamion" runat="server" Enabled="false" ControlToValidate="DdlUnidadCamion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Unidad''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceDdlUnidadCamion" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlUnidadCamion" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<br />
<div class="row rowpadding" runat="server" id="DvConfiguracionVeiculo" visible="false">
<label class="col-md-2">Configuración:</label>
<div class="col-md-10">
<asp:DropDownList ID="DdlConfigAuto" CssClass="form-control input-sm select2me" Width="100%" runat="server" AppendDataBoundItems="true" AutoPostBack="true" OnSelectedIndexChanged="DdlConfigAuto_SelectedIndexChanged" CausesValidation="true" DataTextField="ClaveConfigAutoTransporteDescripcion" DataValueField="CveConfigAutoTransporte" Style="padding: 0px">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlConfigAuto" runat="server" Enabled="false" ControlToValidate="DdlConfigAuto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Configuración Carta Porte''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCERfvDdlConfigAuto" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlConfigAuto" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row rowpadding" runat="server" id="DvRemolque1" visible="false">
<label class="col-md-2">Remolque 1:</label>
<div class="col-md-10">
<asp:DropDownList runat="server" ID="DdlRemolque1" AutoPostBack="true" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" DataValueField="CveCamion" DataTextField="CamionPlaca" OnSelectedIndexChanged="DdlRemolque1_SelectedIndexChanged"></asp:DropDownList>
</div>
</div>
<div class="row rowpadding" runat="server" id="DvRemolque2" visible="false">
<label class="col-md-2">Remolque 2:</label>
<div class="col-md-10">
<asp:DropDownList runat="server" ID="DdlRemolque2" AutoPostBack="true" Width="100%" CssClass="form-control input-sm select2me" DataValueField="CveCamion" DataTextField="CamionPlaca"></asp:DropDownList>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
</div>
</td>
@@ -4362,7 +4485,7 @@
<td colspan="1">&nbsp;</td>
</tr>
</table>
<asp:LinkButton ID="BtnCerrarBloqueo" runat="server" CssClass="btn btn-danger" Text="Cerrar Turno" ValidationGroup="GprBloqueo"/>
<asp:LinkButton ID="BtnCerrarBloqueo" runat="server" CssClass="btn btn-danger" Text="Cerrar Turno" ValidationGroup="GprBloqueo" />
</asp:Panel>
<div id="DivEstadoCaja" class="modal ADS fade" role="dialog">
@@ -4624,7 +4747,7 @@
</div>
<div class="actions">
<div class="btn-group">
<asp:HyperLink ID="ImgAddObs" CssClass="caption-subject bold" data-toggle="modal" data-target="#ModalBitacora" runat="server" Text=" <i class='fa fa-commenting font-green'></i><span class='caption-subject bold'>Agregar</span>" Style="font-weight: 700 !important;cursor: pointer;" ToolTip="Observaciones"></asp:HyperLink><br />
<asp:HyperLink ID="ImgAddObs" CssClass="caption-subject bold" data-toggle="modal" data-target="#ModalBitacora" runat="server" Text=" <i class='fa fa-commenting font-green'></i><span class='caption-subject bold'>Agregar</span>" Style="font-weight: 700 !important; cursor: pointer;" ToolTip="Observaciones"></asp:HyperLink><br />
<asp:HyperLink ID="HlEvento" CssClass="thickbox caption-subject bold" runat="server" Visible="false" Style="cursor: pointer; text-decoration: none;" ToolTip="Agendar"><i class='fa fa-calendar-plus-o font-green' style='font-weight: 700 !important;' ></i> <span class="caption-subject bold font-green">Agendar</span></asp:HyperLink><br />
<asp:Literal ID="LtlTareaNueva" runat="server"></asp:Literal>
<UserControl:TareaNueva runat="server" ID="TareaNueva" />
@@ -6510,7 +6633,7 @@
<asp:Label ID="LblNCSaldoAnticipo" runat="server" Text=""></asp:Label>
<asp:CheckBox ID="ChkAplicaNCAnticipo" runat="server" Text="Aplicar a Anticipo" Visible="false" />
</div>
<div class="col-md-3" id="DivBtnRemNC" runat="server" visible="false" >
<div class="col-md-3" id="DivBtnRemNC" runat="server" visible="false">
<asp:Button ID="BtnModalAplicarRemisionesNC" Text="Aplicar Remisiones" runat="server" OnClick="BtnModalAplicarRemisionesNC_Click" class="btn btn-primary" />
</div>
</div>
@@ -6570,12 +6693,12 @@
<asp:RangeValidator ID="RVNCPorcentaje" runat="server" Type="Double" MinimumValue="0.01" MaximumValue="100.00" ErrorMessage="El campo <b>''Porcentaje''</b> debe estar entre 1 y el porcentaje máximo de la factura(Saldo)." ControlToValidate="TxtNCPorcentaje" Display="None" ValidationGroup="GrpModalAplicarNC"></asp:RangeValidator>
<ajax:ValidatorCalloutExtender ID="VCENCPorcentaje" runat="server" HighlightCssClass="vco" TargetControlID="RVNCPorcentaje" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
<div class="row" style="margin-right: 10px; margin-top: 5px;" align="right">
<input type="text" id="TxtBusqueda10" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda10','{0}')", GvCxC.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda10','{0}')", GvCxC.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<div class="row" id="DivGvCxC" style="max-height: 5px" runat="server" visible="false">
<div class="row" id="DivGvCxC" style="max-height: 5px" runat="server" visible="false">
<div class="col-md-12" style="height: 440px; overflow: auto">
<asp:GridView ID="GvCxC" runat="server" AutoGenerateColumns="False" OnRowDataBound="GvCxC_RowDataBound"
DataKeyNames="CveVenta,CveMetodoPago33,CveFormaPago33" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None">
@@ -7274,10 +7397,7 @@
<div class="modal-dialog" style="max-height: 500px; max-width: 500px;">
<asp:UpdatePanel ID="UpAgregarCliente" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<fieldset>
<%--<legend><b>Descripción</b></legend>--%>
<table border="0" class="portlet light bordered">
<tr>
<div class="portlet-title">
<div class="caption font-green">
<i class="fa fa-users font-green"></i>
@@ -7288,8 +7408,16 @@
</div>
</div>
</div>
</tr>
<tr>
<div class="modal-body">
<div class="row" style="padding-left: 16px;">
<div class="form-group form-md-line-input input-iconright col-xs-9">
<asp:TextBox ID="TxtRFCCliente" Style="text-transform: uppercase;" placeholder="Ingrese el RFC para su validación" runat="server" CssClass="form-control" MaxLength="13" CausesValidation="true"></asp:TextBox>
@@ -7300,11 +7428,50 @@
<asp:Button ID="BtnValidarRFC" runat="server" CssClass="btn btn-success" Text="Validar" />
</div>
</div>
<div id="DivNombreCliente" runat="server" visible="false" class="form-group form-md-line-input input-iconright">
<div class="row">
<div class="col-md-12">
<div runat="server" id="DivTipoPersona" visible="false" class="form-group form-md-line-input input-iconright">
<asp:RadioButtonList runat="server" ID="RdTipoPersona" RepeatDirection="Horizontal" OnSelectedIndexChanged="RdTipoPersona_SelectedIndexChanged" AutoPostBack="true" CssClass="form-control">
<asp:ListItem Value="0">Física</asp:ListItem>
<asp:ListItem Value="1">Moral</asp:ListItem>
</asp:RadioButtonList>
<label for="<%= RdTipoPersona.ClientID.ToString()%>">Tipo Persona:</label>
<i></i>
</div>
</div>
</div>
<%--<div id="DivNombreCliente" runat="server" visible="false" class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtNombreCliente" CssClass="form-control " runat="server" MaxLength="150" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVNombreCliente" runat="server" ControlToValidate="TxtNombreCliente" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nombre''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCliente"></asp:RequiredFieldValidator>
<label for="<%= TxtNombreCliente.ClientID.ToString()%>">Razón Social:</label>
</div>--%>
<div class="row">
<div class="col-md-12" runat="server" id="DivRazonSocial2">
<div id="DivNombreCliente" runat="server" visible="false" class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtNombreCliente" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVNombreCliente" runat="server" ControlToValidate="TxtNombreCliente" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nombre''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCliente"></asp:RequiredFieldValidator>
<label for="<%= TxtNombreCliente.ClientID.ToString()%>">Razón Social:</label>
</div>
</div>
<div class="col-md-4" id="DVRegimenSociedad" runat="server" visible="false">
<div runat="server" class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtRegimenSociedad" CssClass="form-control " runat="server" MaxLength="50" onkeyup="fncTxt()" ClientIDMode="Static"></asp:TextBox>
<label for="<%= TxtRegimenSociedad.ClientID.ToString()%>">Regimen Sociedad:</label>
<i></i>
</div>
</div>
</div>
<div id="DivDireccionCliente" runat="server" visible="false" class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtDireccionCliente" CssClass="form-control " runat="server" MaxLength="90" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVDireccionC" runat="server" ControlToValidate="TxtDireccionCliente" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Direccion''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCliente"></asp:RequiredFieldValidator>
@@ -7398,12 +7565,13 @@
<label for="<%= DdlFormaCliente.ClientID.ToString()%>">Forma Pago: </label>
<i></i>
</div>
</div>
</div>
</tr>
</table>
</fieldset>
<div id="DivBotonesAgregarCliente" runat="server" visible="false" class="modal-footer">
<asp:Button ID="BtnAgregarCliente" runat="server" CssClass="btn btn-primary" Text="Agregar" ValidationGroup="GrpGuardarCliente" />
<button id="BtnCancelarCliente" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
@@ -7845,6 +8013,20 @@
<ajax:ValidatorCalloutExtender ID="VCEImporteSolicitud" runat="server" HighlightCssClass="vco" TargetControlID="CVImporteSolcitud" Width="300px"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtImporteSolicitud.ClientID.ToString()%>">Importe:</label>
</div>
<div id="DivMotivoAutorizacion" runat="server" visible="false" class="row">
<div class="col-md-12">
<div class="row">
<label class="col-md-3 truncate" style="color: #888888; font-family: 'Open Sans', sans-serif; direction: ltr; font-size: 12px;">Motivo:</label>
</div>
<div class="row">
<div class="col-md-12">
<asp:TextBox ID="TxtMotivoAutorizacion" CssClass="form-control input-sm" runat="server" Rows="2" TextMode="MultiLine" Width="100%" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVMotivo" runat="server" ControlToValidate="TxtMotivoAutorizacion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Motivo''</b> es necesario, por favor ingréselo." ValidationGroup="VgmGuardarAut"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEMotivo" runat="server" HighlightCssClass="vco" TargetControlID="RFVMotivo" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnSolicitarCredito" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VgmGuardarAut" />

View File

@@ -1356,6 +1356,15 @@ Partial Class Ventas
ViewState("ListaAnticiposAplicados") = value
End Set
End Property
Private Property CveTimbreCartaPorteVenta As Integer
Get
Return If(IsNothing(ViewState("CveTimbreCartaPorteVenta")), -1, ViewState("CveTimbreCartaPorteVenta").ToString().ToEntero())
End Get
Set(value As Integer)
ViewState("CveTimbreCartaPorteVenta") = value
End Set
End Property
#End Region
#Region "Propiedades PuntoVenta"
@@ -2272,6 +2281,9 @@ Partial Class Ventas
UpFacturar.Update()
'CargaTiposDocumentos()
TrEmitir.Visible = False
If UsuarioActual.CveRol = 1 Then
DivCartaPorte.Visible = True
End If
ViewState("EstablecioFolio") = False
'ViewState("SubProyectoPorcentajeIVA") = 0
RefacturacionGeneroNC = False
@@ -2448,7 +2460,7 @@ Partial Class Ventas
CargaCuentasTerminal()
CargaDdlNCPS()
CargarCamiones()
'SI USUARIO USA AMORTIZACIÓN CONTABLE, se carga las tablas para usarlas mas adelante
If UsuarioActual.Empresa.UsaAC Then
@@ -2643,6 +2655,9 @@ Partial Class Ventas
ObjInventario.Dispose()
End If
If DdlTipoComprobante.SelectedValue = "Ing" Then
CargaVentaCortePorte(Me.CveVenta)
End If
End If
Else
@@ -4888,6 +4903,7 @@ Partial Class Ventas
If DbRowVenta("CveDireccionEnvio").ToString().ToEntero() > 0 AndAlso DbRowVenta("CveDireccionEnvio").ToString() IsNot Nothing Then
ChkDireccionEnvio.Checked = True
DdlDireccionEnvio.SelectedValueExist(DbRowVenta("CveDireccionEnvio").ToString().ToEntero())
DdlDireccionEnvio_SelectedIndexChanged(DdlDireccionEnvio, EventArgs.Empty)
DdlDireccionEnvio.Enabled = False
ChkDireccionEnvio.Enabled = False
DdlDireccionEnvio.Visible = True
@@ -6014,6 +6030,7 @@ Partial Class Ventas
End If
End If
CargaDireccionCP()
ViewState("Vendedor") = ObjCliente.Vendedor
ViewState("CtaContable") = ObjCliente.CuentaContable
@@ -7088,6 +7105,8 @@ Partial Class Ventas
CargaVendedores()
CargaDireccionCP()
'SI LA VENTA YA ESTA REGISTRADA NO DEBE HABILITAR ACCIONES
If CveVenta <= 0 Then
LnkRemisiones.Visible = If(UsuarioActual.TienePermisoProceso(199), True, False) : LnkOCs.Visible = True : LnkCotizaciones.Visible = True : LnkPedido2SinFacturar.Visible = True : InicializaAplicarNCMasiva()
@@ -7099,6 +7118,7 @@ Partial Class Ventas
UpEstatus.Update()
UPCondicionesPago.Update()
UpCliente.Update()
UpEmitirTransitorio.Update()
End Sub
Private Function CargaCreditoDisponible(tCveCliente As Integer, tCveSucursalCliente As Integer, Optional ByRef ObjVentas As ClsVentas = Nothing) As Decimal
Dim Retorno As Decimal = 0
@@ -7594,7 +7614,7 @@ Partial Class Ventas
End If
'VERIFICA SI EL DESCUENTO SUPERA EL SUBTOTAL
If ObjDescuento.ImporteDescuento > (Cantidad * PU) Then
If ObjDescuento.ImporteDescuento.RoundSQL(2) > (Cantidad * PU).RoundSQL(2) Then
Alert("El descuento no puede ser mayor al subtotal", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
@@ -8158,6 +8178,17 @@ Partial Class Ventas
End If
End If
If ChkEmitirCartaPorte.Checked Then
If String.IsNullOrEmpty(TxtOrigenCP.Text.Trim()) Then
Alert("La carta porte no tiene un origen definido.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If String.IsNullOrEmpty(TxtDestinoCP.Text.Trim()) Then
Alert("La carta porte no tiene un destino definido.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
'CUANDO ES COTIZACION Y SE VA A FACTURAR SE HACE INGRESO
If DdlTipoComprobante.SelectedValue = "Cot" AndAlso BtnEmitirImprimir.Text = "Facturar" Then
DdlTipoComprobante.SelectedValue = "Ing"
@@ -8300,6 +8331,7 @@ Partial Class Ventas
End If
End If
'SI NO TIENE AUTORIZACION VERIFICAR LIMITE DE CREDITO Y CANDADOS DE VENTA
'No exceder el limite de credito, Si no tiene contrato limita el credito, si tiene no hace nada. Si no tiene remisiones tampoco hace nada.
If Me.CveAutorizacion <= 0 AndAlso (Not CveContrato > 0 Or CveContratoTipo.Contiene(28)) AndAlso (Not NuevaFactura = 1) AndAlso RBLPago.SelectedValue = "1" AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") AndAlso RemisionesLista.Count <= 0 AndAlso TxtTotal.Text.ToDecimal > 0 AndAlso Not CvePedidoA > 0 Then
'If UsuarioActual.Empresa.Funcionalidad(518) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(185) Then
@@ -8335,6 +8367,20 @@ Partial Class Ventas
Exit Sub
End If
ObjVentas.Dispose()
'VERIFICA SI TIENE BLOQUEO POR DIAS VENCIDOS
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
Dim Vta As New ClsVentas
Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa, TipoVerificacion:=2)
Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón: <br> <br> {0}", Vta.SerieVenta)
Vta.Dispose()
If Opcion = 2 Then
Alert(OpcionMsg, TipoMensaje.MsgError)
Exit Sub
End If
End If
End If
'End If
@@ -8778,9 +8824,18 @@ Partial Class Ventas
Dim CveVentaAnterior As Integer = Me.CveVenta
Dim CveTimbreCartaPorte As Integer = -1
GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjFactura, TmpDT, ObjFactura.CveNCaVincular, ObjContPaq, ObjBancos, ObjOS,
ObjEventos, ObjCGame, ObjClientes, EsNCAmortizacion:=EsNCAmortizacion, CveAnticipoPadre:=CveAnticipoPadre)
If ErrorList.Count = 0 AndAlso ChkEmitirCartaPorte.Checked AndAlso ObjFactura.TipoDocto = "Ing" Then
CveTimbreCartaPorte = GuardarCartaPorte(ObjFactura, ObjGeneral, ObjClientes)
If CveTimbreCartaPorte <= 0 Then
ErrorList.Add("Ocurrió un error al registrar la carta porte")
End If
End If
'Agregamos las OCs a la tabla
If ObjFactura.CveVenta > 0 AndAlso ErrorList.Count = 0 AndAlso DTOrdenesCompraPS IsNot Nothing AndAlso DTOrdenesCompraPS.Rows.Count > 0 AndAlso ErrorList.Count = 0 Then
Dim CveVentaDetalle As Integer = 0
@@ -9162,14 +9217,27 @@ Partial Class Ventas
PrepararTimbrado(FM, TmpDT7Eleven, TmpDTComplementosTimbrado)
End If
If ChkEmitirCartaPorte.Checked AndAlso CveTimbreCartaPorte > 0 Then
Dim RespCartaPorte = Timbres.PreParaCartaPorteFactura(CveTimbreCartaPorte, ObjFactura, UsuarioActual)
If Not RespCartaPorte.TieneError Then
ObjFactura.Timbre.Complementos.CartaPorte = RespCartaPorte.CartaPorte
Else
DebeTimbrar = False
Alert(RespCartaPorte.Mensaje, TipoMensaje.MsgAdvertencia)
End If
End If
Dim ObjTimbrado As New Timbrado
SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura)
If DebeTimbrar Then
SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura)
End If
Dim FolioFiscalFactura As String = ObjTimbrado.UUID
Dim MsgErrorTimbrado = ObjTimbrado.MensajeErrorCFDI
ObjTimbrado = Nothing
'NOTA DE CREDITO - REFACTURADA - CASO ESPECIAL, TIMBRADO E IMPRESION
If DebeTimbrar AndAlso ListaNotasCreditoGeneradas.Count > 0 Then
If DebeTimbrar AndAlso SeTimbro AndAlso ListaNotasCreditoGeneradas.Count > 0 Then
Try
For Each NCGenerada In ListaNotasCreditoGeneradas
If NCGenerada.Timbre IsNot Nothing Then
@@ -12040,16 +12108,20 @@ Partial Class Ventas
End If
End If
If ObjFactura.TipoDocto = "Ing" Then
If Not GuardarUsados(2, ObjVentas.IniciaTransacSQL, factura) Then
ErrorList.Add("Error al guardar usados")
End If
ElseIf ObjFactura.TipoDocto = "Dev" Then
If Not GuardarUsados(1, ObjVentas.IniciaTransacSQL, factura) Then
ErrorList.Add("Error al guardar usados")
'SI ES REFACTURACION, NO DEBE AFECTAR LOS USADOS
If Not NuevaFactura.Contiene(1) Then
If ObjFactura.TipoDocto = "Ing" Then
If Not GuardarUsados(2, ObjVentas.IniciaTransacSQL, factura) Then
ErrorList.Add("Error al guardar usados")
End If
ElseIf ObjFactura.TipoDocto = "Dev" Then
If Not GuardarUsados(1, ObjVentas.IniciaTransacSQL, factura) Then
ErrorList.Add("Error al guardar usados")
End If
End If
End If
If factura.TipoDocto = "Egs" AndAlso NuevaFactura = 1 Then
If DtVentasNC Is Nothing Then
InicializaDTVentasNC()
@@ -12372,7 +12444,7 @@ Partial Class Ventas
'INVENTARIOS
If ErrorList.Count = 0 Then
If Not EsNCAmortizacion AndAlso Not NCDescuento Then
If GuardarVentaInventarios(ObjInventario, ObjVentas, ObjConta, factura) Then
If GuardarVentaInventarios(ObjInventario, ObjVentas, ObjConta, factura, TmpDTDetalle) Then
ErrorList.Add("Ocurrio un error al Guardar Inventario")
End If
End If
@@ -14026,7 +14098,7 @@ Partial Class Ventas
End Try
End Function
Private Function GuardarVentaInventarios(ObjInventario As ClsInventarios, ObjVentas As ClsVentas, ObjConta As ClsContabilidad, factura As Modelos.Factura) As Boolean
Private Function GuardarVentaInventarios(ObjInventario As ClsInventarios, ObjVentas As ClsVentas, ObjConta As ClsContabilidad, factura As Modelos.Factura, TmpDTDetalle As DataTable) As Boolean
Dim OcurrioError As Boolean = False
Try
@@ -14035,7 +14107,7 @@ Partial Class Ventas
If RemisionesLista.Count > 0 AndAlso factura.TipoDocto.Contiene("Ing", "Rem") Then
For Each CveRemision As Integer In RemisionesLista
'El almacen general es el Primer Almacen de Material en la Sucursal
If Not TraspasoAlmacen(ObjInventario, ObjVentas, CveRemision, ObjConta, True, 9) Then
If Not TraspasoAlmacen(ObjInventario, ObjVentas, CveRemision, ObjConta, True, 9, TmpDTDetalle) Then
OcurrioError = True
ErrorList.Add("Ocurrió un error al verificar inventario de remisiones.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
Exit For
@@ -16004,6 +16076,14 @@ Partial Class Ventas
Dim TmpDTComplementosTimbrado As New DataTable
PrepararTimbrado(FM, TmpDT7Eleven, TmpDTComplementosTimbrado)
Dim RespCartaPorte = Timbres.PreParaCartaPorteFactura(CveTimbreCartaPorteVenta, ObjFactura, UsuarioActual)
If Not RespCartaPorte.TieneError Then
ObjFactura.Timbre.Complementos.CartaPorte = RespCartaPorte.CartaPorte
Else
Exit Sub
Alert(RespCartaPorte.Mensaje, TipoMensaje.MsgAdvertencia)
End If
If ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura) Then
'MENSAJE PRINCIPAL
@@ -17092,6 +17172,7 @@ Partial Class Ventas
CargaVendedores()
UpDetalle.Update()
UpEmitirTransitorio.Update()
End Sub
Private Sub CambiaSucursal(Optional RecargarPartidas As Boolean = True)
CargaFormatoSucursal()
@@ -17103,6 +17184,8 @@ Partial Class Ventas
RecargaSucursalPartidas()
End If
CargaDireccionSucursalOrigen(GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(""))
DdlPS.Attributes.Remove("data-cvesubproyecto")
DdlPS.Attributes.Add("data-cvesubproyecto", DdlSubProyectoDatos.SelectedValue)
@@ -19579,7 +19662,7 @@ Partial Class Ventas
gvr.FCDropDownList("DdlUnidadMedida").DataBind()
End Sub
Private Function TraspasoAlmacen(ByRef ObjInventario As ClsInventarios, ByRef ObjVentas As ClsVentas, CveRemision As Integer, ByRef ObjConta As ClsContabilidad, ConSalida As Boolean, ConceptoMovimiento As Integer) As Boolean
Private Function TraspasoAlmacen(ByRef ObjInventario As ClsInventarios, ByRef ObjVentas As ClsVentas, CveRemision As Integer, ByRef ObjConta As ClsContabilidad, ConSalida As Boolean, ConceptoMovimiento As Integer, TmpDTDetalle As DataTable) As Boolean
Dim OcurrioError As Boolean = False
Try
Dim DtMovimientos As DataTable
@@ -19715,7 +19798,7 @@ Partial Class Ventas
End If
If Not OcurrioError AndAlso UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
OcurrioError = Not GenerarMovimientoAlmacenVirtual(CveMovimientoSalidaAlmacen, CveAlmacenParaSalida, ObjInventario, ObjConta:=ObjConta)
OcurrioError = Not GenerarMovimientoAlmacenVirtual(TmpDTDetalle, CveMovimientoSalidaAlmacen, CveAlmacenParaSalida, ObjInventario, ObjConta:=ObjConta)
End If
End If
@@ -20131,7 +20214,7 @@ Partial Class Ventas
Return Not OcurrioError
End Function
Private Function GenerarMovimientoAlmacenVirtual(CveMovimientoSalidaAlmacen As Integer, CveAlmacen As Integer, ByRef ObjInventario As ClsInventarios, Optional ByRef ObjConta As ClsContabilidad = Nothing) As Boolean
Private Function GenerarMovimientoAlmacenVirtual(TmpDTDetalle As DataTable, CveMovimientoSalidaAlmacen As Integer, CveAlmacen As Integer, ByRef ObjInventario As ClsInventarios, Optional ByRef ObjConta As ClsContabilidad = Nothing) As Boolean
Dim OcurrioError As Boolean = False
Try
@@ -20162,7 +20245,13 @@ Partial Class Ventas
Dim PU As Decimal = RowUsado("Cargo").ToString().ToDecimal()
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1) Then
Dim CveVentaDetalle As Integer = -1
'RELACIONA LA VENTA DETALLA DE LA REMISION
If TmpDTDetalle IsNot Nothing Then
CveVentaDetalle = TmpDTDetalle.FiltroPrimeroValor("CveVentaDetalle", $"Cantidad = {RowUsado("Cantidad")} AND CvePS = {RowUsado("CvePS")}").ToEntero()
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1, CveVentaDetalle:=CveVentaDetalle) Then
OcurrioError = True
Exit For
End If
@@ -21054,6 +21143,10 @@ Partial Class Ventas
TxtCodigo.ReadOnly = False
End If
If CantidadFacturadaRemision = 0 AndAlso UsuarioActual.TienePermisoProceso(161) Then
DdlVendedor.Enabled = True
End If
TxtCantidad.Enabled = True
DdlClasificacion.Enabled = True
DdlPS.Enabled = True
@@ -21067,6 +21160,8 @@ Partial Class Ventas
LblSubTotal1.Text = TxtSubTotal.Text
LblAmort.Text = TxtSubTotal.Text
LimpiaEscondeContado()
UPPVentas.Update()
UpPS.Update()
UpCliente.Update()
UPObservaciones.Update()
@@ -21164,7 +21259,7 @@ Partial Class Ventas
Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1),
PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(),
CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), TipoDocto:="Rem", CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal,
OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDouble, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero()) Then
OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDouble, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero()) Then
OcurrioError = True
End If
@@ -21616,7 +21711,7 @@ Partial Class Ventas
LimpiaProntoPago()
'NO PERMITE EDITAR FECHA DEL PAGO
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(260) Then
TxtFechaPago.Enabled = False
imgCalendario.Visible = False
End If
@@ -22238,7 +22333,9 @@ Partial Class Ventas
Private Sub LnkAgregarCliente_Click(sender As Object, e As EventArgs) Handles LnkAgregarCliente.Click
DivNombreCliente.Visible = False
DivTipoPersona.Visible = False
DivDireccionCliente.Visible = False
DivNumeroCPCliente.Visible = False
DivColoniaTelefonoCliente.Visible = False
DivCiudadLocalidadCliente.Visible = False
@@ -22256,6 +22353,7 @@ Partial Class Ventas
If TxtRFCCliente.Text.ToUpper = "XAXX010101000" Then
DivNombreCliente.Visible = True
DivTipoPersona.Visible = True
DivDireccionCliente.Visible = True
DivNumeroCPCliente.Visible = True
DivColoniaTelefonoCliente.Visible = True
@@ -22285,6 +22383,7 @@ Partial Class Ventas
UpCliente.Update()
Else
DivNombreCliente.Visible = True
DivTipoPersona.Visible = True
DivDireccionCliente.Visible = True
DivNumeroCPCliente.Visible = True
DivColoniaTelefonoCliente.Visible = True
@@ -22324,10 +22423,14 @@ Partial Class Ventas
Dim ObjCliente As New ClsClientes
Dim TipoPersona As Boolean = If(RdTipoPersona.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) Then
DdlSubProyectoDatos.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", -1, -1, CvePrecioLista:=CvePrecioLista,
RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona) Then
If ObjCliente.DtResultados.Rows.Count > 0 Then
RegistraScript("hideDivEC();")
ViewState("CveCliente") = ObjCliente.DtResultados(0)("CveCliente").ToString().ToEntero()
@@ -22461,11 +22564,6 @@ Partial Class Ventas
#Region " DEVOLUCION ALMACEN "
Private Sub InicializaDevolucionAlmacen()
If CveVenta.Contiene(2035312, 2035310, 2039679) Then
LBAplicaDevolucion.Visible = True
End If
If Not GvInv.Rows.Count > 0 Then
Exit Sub
End If
@@ -22563,9 +22661,15 @@ Partial Class Ventas
If ChkDireccionEnvio.Checked Then
DdlDireccionEnvio.Visible = True
LnkOtraDireccion.Visible = True
DdlDireccionEnvio_SelectedIndexChanged(DdlDireccionEnvio, EventArgs.Empty)
Else
DdlDireccionEnvio.Visible = False
LnkOtraDireccion.Visible = False
If SucursalDestinoCP IsNot Nothing Then
SucursalDestinoCP = Nothing
SucursalDestinoCP = New Modelos.SucursalModel
TxtDestinoCP.Text = ""
End If
End If
End Sub
Private Sub BtnAgregarDireccion_Click(sender As Object, e As EventArgs) Handles BtnAgregarDireccion.Click
@@ -22604,6 +22708,7 @@ Partial Class Ventas
TxtEnvioTel.Text = ""
CargaDireccionesEnvio()
DdlDireccionEnvio.SelectedValueExist(CveDireccionEnvio)
DdlDireccionEnvio_SelectedIndexChanged(DdlDireccionEnvio, EventArgs.Empty)
End If
ObjClientes.Dispose()
@@ -23831,6 +23936,10 @@ Partial Class Ventas
ObjFacturaCancelacion.CveAlmacenDevolucion = CveAlmacenDevolucion
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ObjFacturaCancelacion.TipoDocto = "Rem" Then
ChkDevAlm.Checked = True
End If
resp = ObjFacturaCancelacion.CancelarFactura(ChkDevAlm.Checked, ListaRemisionesCancelar, CveMotivoCancelacion:=DdlMotivoCancelacion.SelectedValue.ToEntero(), Motivo:=TxtMotivoCancelacion.Text.Trim(), CveEstadoCancelacion:=Me.CveEstadoCancelacion)
End If
@@ -33741,8 +33850,10 @@ Partial Class Ventas
DiasVencidos = TxtDiasVencidos.Text.ToEntero()
End If
Dim Motivo As String = TxtMotivoAutorizacion.Text
Dim ObjPS As New ClsVentas
If ObjPS.AddAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero(), TxtImporteSolicitud.Text.ToDecimal(), CveEstatus, UsuarioActual.CveUsuario, CveTipoAutorizacion, TipoDocumento:=DdlTipoDocto.SelectedValue, DiasVencidos:=DiasVencidos) Then
If ObjPS.AddAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero(), TxtImporteSolicitud.Text.ToDecimal(), CveEstatus, UsuarioActual.CveUsuario, CveTipoAutorizacion, TipoDocumento:=DdlTipoDocto.SelectedValue, DiasVencidos:=DiasVencidos, Motivo:=Motivo) Then
RegistraScript("$('#DivModalSolicitarCredito').modal('hide')")
Alert("La autorización se agregó correctamente.", TipoMensaje.MsgInformacion)
End If
@@ -33773,10 +33884,12 @@ Partial Class Ventas
Case "Ing"
If DdlTipoAutorizacion.Items.FindByValue("2") Is Nothing Then
DdlTipoAutorizacion.Items.Insert(0, New ListItem("Vencimiento", "2"))
DivMotivoAutorizacion.Visible = True
End If
Case "Egs"
'QUITAR LA DE VENCIMIENTO
DdlTipoAutorizacion.Items.Remove(DdlTipoAutorizacion.Items.FindByValue("2"))
DivMotivoAutorizacion.Visible = True
End Select
UpModalSolicitud.Update()
End Sub
@@ -33832,5 +33945,430 @@ Partial Class Ventas
End If
End Sub
Protected Sub RdTipoPersona_SelectedIndexChanged(sender As Object, e As EventArgs)
DVRegimenSociedad.Visible = False
DivRazonSocial2.Attributes.Add("class", "col-md-12")
If RdTipoPersona.SelectedValue.ToEntero = 1 And UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
DivRazonSocial2.Attributes.Add("class", "col-md-8")
DVRegimenSociedad.Visible = True
End If
UpAgregarCliente.Update()
End Sub
#Region "C A R T A - P O R T E"
Public Sub CargaDireccionCP()
LblDireccion.Text = "Dirección"
LblColonia.Text = "Colonia"
LblCiudad.Text = "Ciudad"
LblEstado.Text = "Estado"
LblCP.Text = "00000"
End Sub
Public Sub CargarCamiones()
TxtFechaEntregaCP.Text = Now.ToString("dd/MM/yyyy")
TxtFechaLlegadaCP.Text = Now.ToString("dd/MM/yyyy")
DdlConfigAuto.Items.Clear()
DdlUnidadCamion.Items.Clear()
DdlChofer.Items.Clear()
DdlChofer.DataSource = GlobalDTChoferes(UsuarioActual.CveEmpresa)
DdlChofer.DataBind()
DdlChofer.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
Using ObjInv As New ClsInventarios
If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 1) Then
DdlUnidadCamion.DataSource = ObjInv.DtResultados
End If
If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2) Then
DdlRemolque1.DataSource = ObjInv.DtResultados
End If
End Using
DdlUnidadCamion.DataBind()
DdlUnidadCamion.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
DdlRemolque1.DataBind()
DdlRemolque1.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
Using ObjGrales As New ClsGenerales
If ObjGrales.GetCartaPorteConfigAutoTransportes() Then
DdlConfigAuto.DataSource = ObjGrales.DtResultados
End If
End Using
DdlConfigAuto.DataBind()
DdlConfigAuto.Items.Insert(0, New ListItem("Seleccione una", "-1"))
UpEmitirTransitorio.Update()
End Sub
Protected Sub DdlUnidadCamionActivoFijo_SelectedIndexChanged(sender As Object, e As EventArgs)
ChkEmitirCartaPorte.Checked = True
DvRemolque1.Visible = False
DvRemolque2.Visible = False
DdlRemolque1.SelectedValueExist(-1)
DdlRemolque2.SelectedValueExist(-1)
If DdlUnidadCamion.SelectedValue.ToEntero > 0 Then
Using ObjInv As New ClsInventarios
If ObjInv.GetCamiones(DdlUnidadCamion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, 1) Then
DdlConfigAuto.SelectedValueExist(ObjInv.DtResultados.FiltroPrimeroValor("CveConfigAutoTransporte"))
DdlConfigAuto_SelectedIndexChanged(Nothing, Nothing)
End If
End Using
End If
UpEmitirTransitorio.Update()
End Sub
Protected Sub DdlConfigAuto_SelectedIndexChanged(sender As Object, e As EventArgs)
ValidaConfiguracionVeiculo()
End Sub
Public Sub CargaVentaCortePorte(CveVenta As Integer)
TxtFechaEntregaCP.Enabled = False
TxtFechaLlegadaCP.Enabled = False
Using ObjGral As New ClsGenerales
If ObjGral.GetGralTimbre(-1, "Man", MinFecha, MaxFecha, 0, UsuarioActual.CveEmpresa, -1, CveVenta:=CveVenta) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
Dim RowCP As DataRow = ObjGral.DtResultados.Rows(0)
Me.CveTimbreCartaPorteVenta = RowCP("CveTimbre").ToString().ToEntero()
If CveTimbreCartaPorteVenta > 0 Then
ChkEmitirCartaPorte.Checked = True
ChkEmitirCartaPorte.Enabled = False
End If
TxtFechaEntregaCP.Text = RowCP("FechaEntrega").ToString()
TxtFechaLlegadaCP.Text = RowCP("FechaLlegada").ToString()
TxtDistancia.Text = RowCP("Distancia").ToString()
DdlChofer.SelectedValueExist(RowCP("CveChofer").ToString())
DdlUnidadCamion.SelectedValueExist(RowCP("CveCamion").ToString())
End If
End Using
DdlChofer.Enabled = False
DdlUnidadCamion.Enabled = False
End Sub
Private Sub ValidaConfiguracionVeiculo()
DvRemolque1.Visible = False
DvRemolque2.Visible = False
DdlRemolque1.SelectedValueExist(-1)
DdlRemolque2.SelectedValueExist(-1)
If DdlConfigAuto.SelectedValue.ToEntero > 0 Then
Using ObjGrales As New ClsGenerales
If ObjGrales.GetCartaPorteConfigAutoTransportes() Then
Dim Remolque As String = ObjGrales.DtResultados.FiltroPrimeroValor("Remolque", $" CveConfigAutoTransporte ='{DdlConfigAuto.SelectedValue}'")
If Remolque = "1" Then
RequiereRemolque = True
MostrarRemolques = True
End If
If Remolque = "0, 1" Then
RequiereRemolque = False
MostrarRemolques = True
End If
If Remolque = "0" Then
RequiereRemolque = False
MostrarRemolques = False
End If
End If
End Using
Else
RequiereRemolque = False
MostrarRemolques = False
End If
If RequiereRemolque Or MostrarRemolques Then
DvRemolque1.Visible = True
End If
If Not RequiereRemolque Then
DvConfiguracionVeiculo.Visible = False
Else
DvConfiguracionVeiculo.Visible = True
End If
UpEmitirTransitorio.Update()
End Sub
Protected Sub DdlRemolque1_SelectedIndexChanged(sender As Object, e As EventArgs)
DdlRemolque2.Items.Clear()
If DdlRemolque1.SelectedValue.ToEntero > 0 Then
DvRemolque2.Visible = True
Using ObjInv As New ClsInventarios
If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2) Then
DdlRemolque2.DataSource = ObjInv.DtResultados.FiltraParametros($"CveCamion <> {DdlRemolque1.SelectedValue.ToEntero}")
End If
End Using
DdlRemolque2.DataBind()
Else
DvRemolque2.Visible = False
End If
DdlRemolque2.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
UpEmitirTransitorio.Update()
End Sub
Private Function GuardarCartaPorte(ByRef ObjFactura As Modelos.Factura, ByRef ObjGral As ClsGenerales, ByRef ObjClientes As ClsClientes) As Integer
Dim ErrorProceso As Boolean = False
Dim CveTimbre As Integer = -1
Try
Dim CveDireccionOrigen As Integer = -1
Dim CveDireccionDestino As Integer = -1
If SucursalOrigenCP IsNot Nothing Then
CveDireccionOrigen = 0 'ObjClientes.DireccionEnvioAdd(-1, SucursalOrigenCP.Direccion, SucursalOrigenCP.NoExt, SucursalOrigenCP.NoInt, SucursalOrigenCP.Colonia, SucursalOrigenCP.Municipio, SucursalOrigenCP.Estado, SucursalOrigenCP.CP.ToEntero(), "", UsuarioActual.CveUsuario, 1, -1, "", CveEstado:=SucursalOrigenCP.CveEstado, CvePais:=SucursalOrigenCP.CvePais, CveEmpresa:=UsuarioActual.CveEmpresa)
End If
If SucursalDestinoCP IsNot Nothing Then
CveDireccionDestino = 0 'ObjClientes.DireccionEnvioAdd(-1, SucursalDestinoCP.Direccion, SucursalDestinoCP.NoExt, SucursalDestinoCP.NoInt, SucursalDestinoCP.Colonia, SucursalDestinoCP.Municipio, SucursalDestinoCP.Estado, SucursalDestinoCP.CP.ToEntero(), "", UsuarioActual.CveUsuario, 1, -1, "", CveEstado:=SucursalDestinoCP.CveEstado, CvePais:=SucursalDestinoCP.CvePais, CveEmpresa:=UsuarioActual.CveEmpresa)
End If
If Not (CveDireccionOrigen > 0 And CveDireccionDestino > 0) Then
ErrorProceso = True
Return -1
End If
Dim Fechallegada As DateTime = TxtFechaLlegadaCP.Text.ToDateTime()
Dim FechaEntrega As DateTime = TxtFechaEntregaCP.Text.ToDateTime()
Dim Distancia As Integer = TxtDistancia.Text.ToEntero()
Dim CveEntregaAlmacen As Integer = ObjGral.AddInvEntregaAlmacenRuta(DdlSubProyectoDatos.SelectedValue.ToEntero, CveDireccionOrigen, CveDireccionDestino, -1, DdlChofer.SelectedValue.ToEntero, DdlUnidadCamion.SelectedValue.ToEntero, FechaEntrega, Fechallegada, "T", "-1", "-1", Fechallegada, 1, 1, Distancia,
CveConfigAutoTransporte:=DdlConfigAuto.SelectedValue.ToEntero, CveCamionRemolque1:=DdlRemolque1.SelectedValue.ToEntero, CveCamionRemolque2:=DdlRemolque2.SelectedValue.ToEntero)
If CveEntregaAlmacen > 0 Then
For Each RowPS As DataRow In ObjFactura.DtDetalle.FiltraParametros("CveTipoPS = 2").Rows
If Not ObjGral.AddEntregaAlmacenRutaDetalle(CveEntregaAlmacen, RowPS("CvePS").ToString().ToEntero, RowPS("Cantidad").ToString().ToEntero, RowPS("CveUM").ToString().ToEntero, UsuarioActual.CveUsuario) Then
ErrorProceso = True
Exit For
End If
Next
CveTimbre = ObjGral.AddGralTimbre("Man", DdlSubProyectoDatos.SelectedValue.ToEntero, TxtFecha.Text.ToDate, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen:=CveEntregaAlmacen, AplicaCP:=True, CveVenta:=ObjFactura.CveVenta)
If Not CveTimbre > 0 Then
ErrorProceso = True
End If
Else
ErrorProceso = True
End If
Catch ex As Exception
ErrorProceso = True
OnError("Ocurrió un error al guardar los datos de la carta porte", ex)
End Try
If Not ErrorProceso Then
Return CveTimbre
Else
Return -1
End If
End Function
Property RequiereRemolque As Boolean
Get
If ViewState("RequiereRemolque") Is Nothing Then
ViewState("RequiereRemolque") = False
End If
Return Boolean.Parse(ViewState("RequiereRemolque").ToString)
End Get
Set(value As Boolean)
ViewState("RequiereRemolque") = value
End Set
End Property
Property MostrarRemolques As Boolean
Get
If ViewState("MostrarRemolques") Is Nothing Then
ViewState("MostrarRemolques") = False
End If
Return Boolean.Parse(ViewState("MostrarRemolques").ToString)
End Get
Set(value As Boolean)
ViewState("MostrarRemolques") = value
End Set
End Property
Property SucursalOrigenCP As Modelos.SucursalModel
Get
If ViewState("SucursalOrigenCP") Is Nothing Then
Return Nothing
End If
Return DirectCast(ViewState("SucursalOrigenCP"), Modelos.SucursalModel)
End Get
Set(value As Modelos.SucursalModel)
ViewState("SucursalOrigenCP") = value
End Set
End Property
Property SucursalDestinoCP As Modelos.SucursalModel
Get
If ViewState("SucursalDestinoCP") Is Nothing Then
Return Nothing
End If
Return DirectCast(ViewState("SucursalDestinoCP"), Modelos.SucursalModel)
End Get
Set(value As Modelos.SucursalModel)
ViewState("SucursalDestinoCP") = value
End Set
End Property
Private Sub CargaDireccionSucursalOrigen(Row As DataRow)
If SucursalOrigenCP Is Nothing Then
SucursalOrigenCP = New Modelos.SucursalModel
Else
SucursalOrigenCP = Nothing
SucursalOrigenCP = New Modelos.SucursalModel
End If
Dim SBDomicilioSucursal As New StringBuilder()
Try
If Row IsNot Nothing Then
SucursalOrigenCP.Direccion = Row("Calle").ToString()
SucursalOrigenCP.NoExt = Row("NoExt").ToString()
SucursalOrigenCP.NoInt = Row("NoInt").ToString()
SucursalOrigenCP.Colonia = Row("Colonia").ToString()
SucursalOrigenCP.CP = Row("CP").ToString()
SucursalOrigenCP.Municipio = Row("Municipio").ToString()
'SucursalOrigenCP.CveEstado = Row("CveEstado").ToString().ToEntero()
SucursalOrigenCP.Estado = Row("Estado").ToString()
'SucursalOrigenCP.CvePais = Row("CvePais").ToString().ToEntero()
SucursalOrigenCP.Pais = Row("Pais").ToString()
SBDomicilioSucursal.AppendFormat("{0}", Row("Calle").ToString())
If Row("NoInt").ToString().Length > 0 Then
SBDomicilioSucursal.AppendFormat(", No.Int: {0}", Row("NoInt").ToString())
End If
If Row("Colonia").ToString().Length > 0 Then
SBDomicilioSucursal.AppendFormat(", Col: {0}", Row("Colonia").ToString())
End If
If Row("CP").ToString().ToEntero > 0 Then
SBDomicilioSucursal.AppendFormat(", CP: {0}", Row("CP").ToString())
End If
If Row("NoExt").ToString().Length > 0 Then
SBDomicilioSucursal.AppendFormat(" No.Ext: {0}", Row("NoExt").ToString())
End If
Dim CiudadSucursal As String = String.Format("{0},{1}", Row("Municipio").ToString(), Row("Estado").ToString())
If CiudadSucursal.Length > 0 Then
SBDomicilioSucursal.AppendFormat(", {0}", CiudadSucursal)
End If
If Row("Pais").ToString().Length > 0 Then
SBDomicilioSucursal.AppendFormat(", {0}", Row("Pais").ToString())
End If
If Not String.IsNullOrEmpty(Row("Telefono").ToString()) Then
SucursalOrigenCP.TelefonoSucursal = Row("Telefono").ToString()
End If
End If
Catch ex As Exception
SBDomicilioSucursal.Clear()
GuardaLog(ex.ToString())
End Try
TxtOrigenCP.Text = SBDomicilioSucursal.ToString
UpEmitirTransitorio.Update()
End Sub
Protected Sub DdlDireccionEnvio_SelectedIndexChanged(sender As Object, e As EventArgs)
If SucursalDestinoCP Is Nothing Then
SucursalDestinoCP = New Modelos.SucursalModel
Else
SucursalDestinoCP = Nothing
SucursalDestinoCP = New Modelos.SucursalModel
End If
If TmpDTEnvioDireccion IsNot Nothing AndAlso TmpDTEnvioDireccion.FiltraParametros(String.Format("CveDireccionEnvio = {0}", DdlDireccionEnvio.SelectedValue.ToEntero())).Rows.Count > 0 Then
Dim Row As DataRow = TmpDTEnvioDireccion.FiltroPrimero(String.Format("CveDireccionEnvio = {0}", DdlDireccionEnvio.SelectedValue.ToEntero()))
If Row IsNot Nothing Then
SucursalDestinoCP.Direccion = Row("EnvioDireccion").ToString()
SucursalDestinoCP.Colonia = Row("EnvioColonia").ToString()
SucursalDestinoCP.Municipio = Row("EnvioCiudad").ToString()
'SucursalDestinoCP.CveEstado = Row("CveEstado").ToString().ToEntero()
SucursalDestinoCP.Estado = Row("EnvioEstado").ToString()
'SucursalDestinoCP.CvePais = Row("CvePais").ToString().ToEntero()
SucursalDestinoCP.Pais = Row("Pais").ToString()
SucursalDestinoCP.CP = Row("EnvioCP").ToString()
TxtDestinoCP.Text = String.Format("{0} col. {1},CP:{2}, {3},{4},{5}", SucursalDestinoCP.Direccion, SucursalDestinoCP.Colonia, SucursalDestinoCP.CP, SucursalDestinoCP.Municipio, SucursalDestinoCP.Estado, SucursalDestinoCP.Pais)
Else
TxtDestinoCP.Text = ""
End If
Else
TxtDestinoCP.Text = ""
End If
UpEmitirTransitorio.Update()
End Sub
#End Region
Protected Sub RdTipoPersona_SelectedIndexChanged(sender As Object, e As EventArgs)
DVRegimenSociedad.Visible = False
DivRazonSocial2.Attributes.Add("class", "col-md-12")
If RdTipoPersona.SelectedValue.ToEntero = 1 And UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
DivRazonSocial2.Attributes.Add("class", "col-md-8")
DVRegimenSociedad.Visible = True
End If
UpAgregarCliente.Update()
End Sub
End Class