invoice.js
1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
$(function () {
$(".search-invoice").on("keyup", function () {
var value = $(this).val().toLowerCase();
$(".invoice-users li").filter(function () {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1);
});
});
});
$("#custom-invoice > #printableArea:first").show();
// Print
$(".print-page").click(function () {
var mode = "iframe"; //popup
var close = mode == "popup";
var options = {
mode: mode,
popClose: close,
};
$("div#printableArea:first").printArea(options);
});
var $btns = $(".listing-user").click(function () {
var getDataInvoiceAttr = $(this).attr("data-invoice-id");
var getParentDiv = $(this).parents(".invoice-application");
var getParentInvListContainer = $(this).parents(".app-invoice");
var $el = $("." + this.id).show();
$("#custom-invoice > div").not($el).hide();
var setInvoiceNumber = getParentDiv
.find(".invoice-inner-part .invoice-number")
.text("#" + getDataInvoiceAttr);
var hideTheNonSelectedContent = $(this)
.parents(".invoice-application")
.find(".chat-not-selected")
.hide()
.siblings(".invoiceing-box")
.show();
var showInvContentSection = getParentDiv
.find(".invoice-inner-part #custom-invoice")
.css("display", "block");
$btns.removeClass("bg-lightgray dark:bg-darkprimary");
$(this).addClass("bg-lightgray dark:bg-darkprimary");
if ($(".invoiceing-box").css("display") == "block") {
$(".right-part.invoice-box").css("height", "100%");
}
// Print
$(".print-page").click(function () {
var mode = "iframe"; //popup
var close = mode == "popup";
var options = {
mode: mode,
popClose: close,
};
$("div#printableArea").printArea(options);
});
var myDiv = document.getElementsByClassName("invoice-inner-part")[0];
myDiv.scrollTop = 0;
});