CARGA DE TRABAJO 1 Y 2

This commit is contained in:
Antonio Gonzalez
2020-06-14 17:48:44 -07:00
parent aae6187f95
commit cd24b5128a
11 changed files with 291 additions and 138 deletions

View File

@@ -10,8 +10,7 @@
padding: 0px 5px;
}
.nolineheight TxtNombreCliente
line-height: 1;
.nolineheight TxtNombreCliente line-height: 1;
}
.claseesconder {
@@ -1599,7 +1598,8 @@
<div class="portlet box purpleAlmacen" id="DivSalidaAlmacen" runat="server">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-dropbox"></i><asp:Literal ID="LltSalidaAlmacen" runat="server" Text="Salida Almacen"></asp:Literal>
<i class="fa fa-dropbox"></i>
<asp:Literal ID="LltSalidaAlmacen" runat="server" Text="Salida Almacen"></asp:Literal>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
@@ -3259,7 +3259,7 @@
<tr align="left">
<td>
<asp:TextBox ID="TxtObsFact" runat="server" Rows="3" TextMode="MultiLine" Width="250px" MaxLength="800" CssClass="form-control input-sm"></asp:TextBox></td>
</tr>
</tr>
<tr id="TrOC" runat="server">
<td>Orden de Compra: &nbsp;
<asp:TextBox ID="TxtOrdenCompra" runat="server" Width="100%" CssClass="form-control" CausesValidation="true"></asp:TextBox>
@@ -3294,6 +3294,18 @@
<td>
<asp:TextBox ID="TxtCorreoNotificaciones" runat="server" Width="100%" CssClass="form-control"></asp:TextBox></td>
</tr>
<tr align="left" id="trPaqueteriOpcionesLabel" runat="server" visible="false">
<td id="Td2" runat="server">Tipo de Entrega:&nbsp;</td>
</tr>
<tr align="left" id="trPaqueteriaOpciones" runat="server" visible="false">
<td colspan="2">
<asp:RadioButtonList runat="server" ID="RblPaqueteria">
<asp:ListItem Value="1" Text="Entrega En Mostrador" />
<asp:ListItem Value="2" Text="Entrega Interna" />
<asp:ListItem Value="3" Text="Entrega Externa" />
</asp:RadioButtonList>
</td>
</tr>
</table>
</div>
</ContentTemplate>
@@ -3371,7 +3383,7 @@
<asp:Button ID="BtnEditarRemision" runat="server" Text="Actualizar Remision" CssClass="btn myventasbutton btn-primary" Visible="false" />
<asp:Button ID="BtnPermisoEditarRemision" runat="server" Text="Editar Remision" CssClass="btn myventasbutton btn-primary" Visible="false" />
<asp:Button ID="BtnMandaMail" runat="server" Text="MandaMail" CssClass="btn myventasbutton btn-primary" Visible="false" />
<asp:Button ID="BtnCrearApartirDe" runat="server" Text="Crear a partir de" CssClass="btn myventasbutton btn-primary" Visible="false" />
@@ -3574,7 +3586,7 @@
<ItemTemplate>
<asp:Literal ID="LtlAnticipos" runat="server" Text='<%# Eval("Saldo", "{0:N2}") %>'></asp:Literal>&nbsp;
</ItemTemplate>
</asp:TemplateField>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Moneda Venta</HeaderTemplate>
<ItemTemplate>
@@ -4141,8 +4153,8 @@
<asp:Literal ID="LtlTareaNueva" runat="server"></asp:Literal>
<UserControl:TareaNueva runat="server" id="TareaNueva" />
<script> function OnAddedTareaNueva() {
$('.btnupEventoBitacora').click();
}
$('.btnupEventoBitacora').click();
}
</script>
</div>
@@ -7071,9 +7083,9 @@
$get(Row).style.backgroundColor = "#82b6db";
$get(Obj).focus();
var total = parseFloat($('#<%= HplSaldoAuxiliar.ClientID%>').text().replace(',', ''));
$get(Obj).value = 0;
var suma = 0;
$('#<%= GVAnticipos.ClientID%> input[type="text"]').each(function (index) {
$get(Obj).value = 0;
var suma = 0;
$('#<%= GVAnticipos.ClientID%> input[type="text"]').each(function (index) {
var currentsaldo = parseFloat($(this).val())
if (isNaN(currentsaldo)) { currentsaldo = 0 }
suma = currentsaldo + suma;
@@ -7089,7 +7101,7 @@
$get(Obj).value = "";
$get(Row).style.backgroundColor = "#ffffff";
}
//if ($("input:checkbox:not(:checked)"))
//if ($("input:checkbox:not(:checked)"))
SetText2($get("LblTotalAnticipos"), formato_numero($get("HdnAnticipos").value, 2, '.', ','));
}
function imprimircotizacion() {
@@ -7103,121 +7115,121 @@
var ValorTxt = Obj.value;
var suma = 0;
var total = parseFloat($('#<%= HplSaldoAuxiliar.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 (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;
}
}
function ImprimirCotizacion() {
__doPostBack('ctl00$HB$LNKImprimirCotizacion', '');
}
function SetText2(ObjTo, Value) {
ObjTo.innerText = Value;
}
if (parseFloat(ValorTxt) > parseFloat(Monto)) {
alert("El monto de ''Anticipo a Amortizar'' no puede ser mayor al monto del ''Anticipo''");
Obj.value = Monto;
}
}
function ImprimirCotizacion() {
__doPostBack('ctl00$HB$LNKImprimirCotizacion', '');
}
function SetText2(ObjTo, Value) {
ObjTo.innerText = Value;
}
//VALIDA QUE LA CANTIDAD DE T (TXT) NO SEA MAYOR A C
function ValidarCantidad(t, c) {
t.value = (t.value > c ? c : t.value)
}
//VALIDA QUE LA CANTIDAD DE T (TXT) NO SEA MAYOR A C
function ValidarCantidad(t, c) {
t.value = (t.value > c ? c : t.value)
}
//VALIDA QUE LA CANTIDAD DE T (TXT) NO SEA MENOR A C
function ValidarCantidadMenor(t, c) {
t.value = (t.value > c ? t.value : c)
}
//VALIDA QUE LA CANTIDAD DE T (TXT) NO SEA MENOR A C
function ValidarCantidadMenor(t, c) {
t.value = (t.value > c ? 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 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();
}
}
function AddCodigoBarrasSerie(e) {
if (e.keyCode == 13 || e.which == 13) {
$('#BtnCodigoBarrasSerie').click();
}
}
//SERIE PS
function SeriePS(e, b, txt, hdn) {
;
if (e.keyCode == 13 || e.which == 13) {
if (txt.value != "" && txt.value != hdn.value) {
$(b).click();
}
}
}
//SERIE PS
function SeriePS(e, b, txt, hdn) {
;
if (e.keyCode == 13 || e.which == 13) {
if (txt.value != "" && txt.value != hdn.value) {
$(b).click();
}
}
}
function SeriePSBlur(b, txt, hdn) {
;
if (txt.value != "" && txt.value != hdn.value) {
$(b).click();
}
}
function SeriePSBlur(b, txt, hdn) {
;
if (txt.value != "" && txt.value != hdn.value) {
$(b).click();
}
}
//SERIE-LOTE INV
var H1 = "";
var H2 = "";
var T = "";
//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;
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();
}
}
$('#BtnVinculaAFEdit').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();
}
}
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();
}
}
function EnterAFEditOK(Cve, Codigo) {
$get(H1.id).value = Cve;
$get(H2.id).value = Codigo;
$get(T.id).value = (Codigo == -1) ? "" : Codigo;
function EnterAFEditOK(Cve, Codigo) {
$get(H1.id).value = Cve;
$get(H2.id).value = Codigo;
$get(T.id).value = (Codigo == -1) ? "" : Codigo;
}
}
//Suma Totales
function FnSuma() {
$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') ? ToDouble($get('TxtIEPS').value) : 0) - ToDouble($get('TxtRetIVA').value) - ToDouble($get('TxtRetISR').value);
debugger;
$("#<%=GvImpuestosLocales2.ClientID%> input[type='text']").each(function () {
//Suma Totales
function FnSuma() {
$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') ? ToDouble($get('TxtIEPS').value) : 0) - ToDouble($get('TxtRetIVA').value) - ToDouble($get('TxtRetISR').value);
debugger;
$("#<%=GvImpuestosLocales2.ClientID%> input[type='text']").each(function () {
if ($(this).attr("class") == '5') // cuando es traslado de impuesto local, se suma
totalVenta += ToDouble($(this).val().toString());
@@ -7239,7 +7251,7 @@
$get("HdnTipoDescuento").value = "3";
//si es con.nc,es.el.total
var Total = ToDouble($get(TipoAnticipo == 2? 'TxtTotal':'TxtSubTotal').value);
var Total = ToDouble($get(TipoAnticipo == 2 ? 'TxtTotal' : 'TxtSubTotal').value);
var SaldoCompra = parseFloat(parseFloat($get('HdnVentaSaldo').value).toFixed(2));
if (ToDouble($get('HdnCveVenta').value) == 0) SaldoCompra = Total;

View File

@@ -1206,6 +1206,15 @@ Partial Class Ventas
ViewState("SaldoAnticipo") = value
End Set
End Property
Private Property CorreoEntregaAlmacen As String
Get
Return If(IsNothing(ViewState("CorreoEntregaAlmacen")), "", ViewState("CorreoEntregaAlmacen").ToString())
End Get
Set(value As String)
ViewState("CorreoEntregaAlmacen") = value
End Set
End Property
#End Region
@@ -2634,6 +2643,7 @@ Partial Class Ventas
If UsuarioActual.CveEmpresa = 141 Then
BtnModalAddPS.Enabled = False
End If
MostrarOpcioensPaqueteria()
End Sub
Private Sub BloqueaClasificaciones()
If UsuarioActual.CveEmpresa = 141 AndAlso DdlTipoComprobante.SelectedValue = "Cot" Then
@@ -4847,6 +4857,7 @@ Partial Class Ventas
ViewState("Mail") = If(DdlTipoComprobante.SelectedValue = "Cot", ObjCliente.MailCotizacion, ObjCliente.Mail)
ViewState("MailCC") = ObjCliente.NotificarA
CorreoEntregaAlmacen = ObjCliente.DtResultados(0)("CorreoEntregaAlmacen").ToString
LblDireccion.Text = ObjCliente.Direccion
LblColonia.Text = ObjCliente.Colonia
LblCiudad.Text = ObjCliente.Ciudad
@@ -5157,8 +5168,8 @@ Partial Class Ventas
CargarAlmacenes()
If UsuarioActual.Empresa.FacturaProduccion Then
CargaDocumentacionCliente()
End If
CargaDocumentacionCliente()
If UsuarioActual.CveEmpresa.Contiene(72, 80, 1, 119) Then
BtnEmitirImprimir.OnClientClick = $"ValidaGuardar({ If(ImprimeNombreSucursal = True, 1, 0)});"
@@ -9502,7 +9513,7 @@ Partial Class Ventas
CveVentaRelacion:=(If(factura.CveVentaRelacion.ToEntero() > 0, factura.CveVentaRelacion, -1)), ImporteRelacion:=(If(factura.ImporteRelacion <> Nothing, factura.ImporteRelacion, -1)),
CveTipoAmortizacionAnticipo:=factura.CveTipoAmortizacionAnticipo, CveEmpresaCRM:=CveEmpresaCRM, EsInterno:=EsInterno, CveAcercamientoCRM:=CveAcercamientoCRM,
DiasCredito:=factura.DiasCredito, EsDiasCreditoFijo:=factura.EsDiasCreditoFijo, AnticipoEspecial:=If(TrAntEspecial.Visible, ChkAntEspecial.Checked, False),
Kilometraje:=TxtKilometraje.Text.ToDouble, EsAmortizacion:=EsNCAmortizacion, CveTipoRetencion:=CveTipoRetencion, CorreoNotificacion:=TxtCorreoNotificaciones.Text) Then
Kilometraje:=TxtKilometraje.Text.ToDouble, EsAmortizacion:=EsNCAmortizacion, CveTipoRetencion:=CveTipoRetencion, CorreoNotificacion:=TxtCorreoNotificaciones.Text, FormaPaqueteria:=RblPaqueteria.SelectedValue.ToEntero) Then
ErrorList.Add("Ocurrió un error al Generar la Venta.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
Else
If factura.TipoDocto.Contiene("Dev", "Egs") Or DtVentasNC IsNot Nothing Or CveEstatusRefacturacion = 1 Then
@@ -9523,6 +9534,10 @@ Partial Class Ventas
End If
End If
If UsuarioActual.Empresa.Funcionalidad(280) = "1" And RblPaqueteria.SelectedValue = "1" Then
NotificarPaqueteria()
End If
End If
If Not GuardarUsados(ObjVentas.IniciaTransacSQL, ObjVentas.CveVenta) Then
@@ -14056,7 +14071,7 @@ Partial Class Ventas
TrVistaPrevia.Visible = EstatusCliente
End If
MostrarOpcioensPaqueteria()
TrAtencionA.Visible = True
tdVigencia.Visible = DdlTipoComprobante.SelectedValue.Contiene("Cot")
@@ -14067,6 +14082,7 @@ Partial Class Ventas
UPCondicionesPago.Update()
UpCliente.Update()
UpPS.Update()
UPObservaciones.Update()
End Sub
Protected Sub DdlSucursalCliente_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlSucursalCliente.SelectedIndexChanged
CargaClienteSucursal(DdlSucursalCliente.SelectedValue.ToEntero())
@@ -25648,6 +25664,27 @@ Partial Class Ventas
CargaEventoBitacora()
End Sub
Private Sub MostrarOpcioensPaqueteria()
Dim mostrarOpcionesPaq As Boolean = DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ped")
trPaqueteriaOpciones.Visible = mostrarOpcionesPaq
trPaqueteriOpcionesLabel.Visible = mostrarOpcionesPaq
End Sub
Private Sub NotificarPaqueteria()
Dim DtVendedores As DataTable = GlobalDTVendedores(UsuarioActual.CveEmpresa)
Dim CorreoVendedor As String = DtVendedores.FiltroPrimeroValor("Correo", String.Format("CveVendedor = {0}", DdlVendedor.SelectedValue))
Dim CorreoVendedorAdicional As String = DtVendedores.FiltroPrimeroValor("CorreoAdicionalNotificaciones", String.Format("CveVendedor = {0}", DdlVendedor.SelectedValue))
Dim CorreoCliente As String = Mail
Dim CorreoClienteAlmacen As String = CorreoEntregaAlmacen
Dim CorreoNotificacionCliente As String = MailCC
Dim CorreosCC As String = String.Format("{0};{1};{2};{3}", CorreoVendedor, CorreoVendedorAdicional, CorreoCliente, CorreoNotificacionCliente)
Dim LogCorreo As String = String.Format("{0} -- {1} --- {2}", "Tipo de entrega", CorreoClienteAlmacen, CorreosCC)
LogCorreo.GuardaLog
Dim MailCls As New ClsSisMail
MailCls.SendMail(ClsPaginas.EmpresaNotificaciones, CorreoVendedor, "Entrega en mostrador", "Pendiente", CorreosCC)
MailCls = Nothing
End Sub
End Class