Best JavaScript code snippet using fast-check-monorepo
customer_single_modal.js
Source:customer_single_modal.js
1$(document).on("click", function(event) {2 if ($(event.target).closest("#customer-single-modal .seaction-above-table .print-export-settings-btns .setting-btn-section").length === 0) {3 $("#customer-single-modal .seaction-above-table .print-export-settings-btns .setting-btn-section .settings-options").hide();4 }5 if ($(event.target).closest("#customer-single-modal .single-customer-info-section .body-section .filter-btn-section").length === 0) {6 $("#customer-single-modal .single-customer-info-section .body-section .filter-btn-section .filter-panel").hide();7 }8});9$(document).on("click", "#customer-single-modal .the-body .dropdown-menu li a.send-reminder-btn", function() {10 get_info_customer_reminder($(this).attr("data-customer-id"), $(this).attr("data-action-from"), $(this).attr("data-invoice-number"));11});12$(document).on("click", ".customer-full-page-btn", function(event) {13 $(".page-notification-section").hide();14 $("#customer-single-modal").fadeIn();15 $(".section-above-table .search-holder ul.dropdown-menu").removeClass("show");16 $("#customers_table").hide();17 single_customer_page_get_all_customers($(this).attr('data-customer-id'));18});19$(document).on("click", "#customer-single-modal .the-body .all-customer-section .top-section .back a", function(event) {20 $(".page-notification-section").fadeIn();21 $("#customer-single-modal").fadeOut();22 $("#customers_table").show();23 single_customer_sort_all_customers_ul("name");24 get_load_customers_table();25 get_modal_new_customer();26});27$("#customer-single-modal .the-body .all-customer-section .top-section .search-section input[type='text']").on("keyup", function() {28 var value = $(this).val().toLowerCase();29 $("#customer-single-modal .the-body .customer-list-section ul li").filter(function() {30 $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)31 });32});33$(document).on("click", "#customer-single-modal .the-body .customer-list-section ul li", function(event) {34 $("#customer-single-modal .single-customer-info-section .body-section .filter-btn-section .filter-panel select[name='filter_type']").val("All transactions");35 $("#customer-single-modal .single-customer-info-section .body-section .filter-btn-section .filter-panel select[name='filter_date']").val("All dates");36 single_customer_get_customers_details($(this).attr("data-customer-id"));37});38$(document).on("click", "#customer-single-modal .seaction-above-table .print-export-settings-btns .setting-btn-section .settings-options a.show-more-less", function(event) {39 if ($(this).attr("data-current-show") == "less") {40 $("#customer-single-modal .seaction-above-table .print-export-settings-btns .setting-btn-section .settings-options div.extra-group").show();41 $(this).attr("data-current-show", "more");42 $(this).html('<i class="fa fa-chevron-up" aria-hidden="true"></i> Show Less');43 } else {44 $("#customer-single-modal .seaction-above-table .print-export-settings-btns .setting-btn-section .settings-options div.extra-group").hide();45 $(this).attr("data-current-show", "less");46 $(this).html('<i class="fa fa-chevron-down" aria-hidden="true"></i> Show More');47 }48});49$(document).on("click", "#customer-single-modal .single-customer-info-section .top-section .notes a.add-notes-btn", function(event) {50 $("#customer-single-modal .single-customer-info-section .top-section .notes textarea").show();51 $(this).hide();52 $("#customer-single-modal .single-customer-info-section .top-section .notes textarea").focus();53 $("#customer-single-modal .single-customer-info-section .top-section .notes .saved-indicato").hide();54});55$("#customer-single-modal .single-customer-info-section .top-section .notes textarea").focus(function() {56 $("#customer-single-modal .single-customer-info-section .top-section .notes textarea").removeClass("notes-added");57 $("#customer-single-modal .single-customer-info-section .top-section .notes .saved-indicator").hide();58});59$("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section.customer-details .customer-details-section .customer-info .info-value[data-for='notes'] textarea").on("keyup", function() {60 $("#customer-single-modal .single-customer-info-section .top-section .notes textarea").val($(this).val());61 $("#customer-single-modal .single-customer-info-section .top-section .notes textarea").show();62 $("#customer-single-modal .single-customer-info-section .top-section .notes .saved-indicato").hide();63 $("#customer-single-modal .single-customer-info-section .top-section .notes a.add-notes-btn").hide();64});65$("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section.customer-details .customer-details-section .customer-info .info-value[data-for='notes'] textarea").focusout(function() {66 single_customer_notes_text_area_changed();67});68$("#customer-single-modal .single-customer-info-section .top-section .notes textarea").focusout(function() {69 single_customer_notes_text_area_changed();70});71$(document).on("click", "#customer-single-modal .seaction-above-table .print-export-settings-btns .setting-btn-section button.settings-btn", function(event) {72 $("#customer-single-modal .seaction-above-table .print-export-settings-btns .setting-btn-section .settings-options").show();73});74$(document).on("change", "#customer-single-modal .seaction-above-table .print-export-settings-btns .setting-btn-section .settings-options input[type='checkbox']", function(event) {75 if ($(this).is(":checked")) {76 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table th[data-column='" + $(this).attr("data-column") + "']").show();77 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td[data-column='" + $(this).attr("data-column") + "']").show();78 } else {79 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table th[data-column='" + $(this).attr("data-column") + "']").hide();80 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td[data-column='" + $(this).attr("data-column") + "']").hide();81 }82});83$(document).on("change", "#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table th input[name='customer_checkbox_all']", function(event) {84 if ($(this).is(":checked")) {85 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td input[type='checkbox']").prop("checked", true);86 } else {87 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td input[type='checkbox']").prop("checked", false);88 }89 set_by_batch_menu_disabled();90});91$(document).on("change", "#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td input[type='checkbox']", function(event) {92 single_customer_transaction_table_checkbox_changed();93});94$(document).on("click", "#customer-single-modal .single-customer-info-section .body-section ul.body-tabs li", function(event) {95 $("#customer-single-modal .single-customer-info-section .body-section ul.body-tabs li").removeClass("active");96 $(this).addClass("active");97 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section").hide();98 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section." + $(this).attr("data-target")).fadeIn();99});100$(document).on("click", "#customer-single-modal .single-customer-info-section .edit-button", function(event) {101 single_customer_get_customers_details($("#customer-single-modal input[name='customer_id']").val());102 $('#modal-container #new-customer-modal').modal('toggle');103 $('#modal-container #new-customer-modal form input[name="customer_id_edit_info"]').remove();104 $('#modal-container #new-customer-modal form').append('<input type="text" name="customer_id_edit_info" value="' + $("#customer-single-modal input[name='customer_id']").val() + '" style="display:none;">');105});106$(document).on("click", "#customer-single-modal .single-customer-info-section .body-section .filter-btn-section button.filter-btn", function(event) {107 $("#customer-single-modal .single-customer-info-section .body-section .filter-btn-section .filter-panel").show();108});109function single_customer_notes_text_area_changed() {110 if (!$.trim($("#customer-single-modal .single-customer-info-section .top-section .notes textarea").val())) {111 $("#customer-single-modal .single-customer-info-section .top-section .notes a.add-notes-btn").show();112 $("#customer-single-modal .single-customer-info-section .top-section .notes textarea").hide();113 $("#customer-single-modal .single-customer-info-section .top-section .notes textarea").val("");114 $("#customer-single-modal .single-customer-info-section .top-section .notes .saved-indicator").hide();115 single_customer_update_customer_notes();116 } else {117 $("#customer-single-modal .single-customer-info-section .top-section .notes a.add-notes-btn").hide();118 $("#customer-single-modal .single-customer-info-section .top-section .notes textarea").show();119 $("#customer-single-modal .single-customer-info-section .top-section .notes textarea").addClass("notes-added");120 $("#customer-single-modal .single-customer-info-section .top-section .notes .saved-indicator").show();121 single_customer_update_customer_notes();122 }123}124function single_customer_transaction_table_checkbox_changed() {125 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table th input[name='customer_checkbox_all']").prop("checked", true);126 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td input[type='checkbox']").each(function() {127 if (!$(this).is(":checked")) {128 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table th input[name='customer_checkbox_all']").prop("checked", false);129 }130 });131 set_by_batch_menu_disabled();132}133function set_by_batch_menu_disabled() {134 var invoice_selected = false;135 var not_invoice_selected = false;136 var no_selected = true;137 var no_status_open_overdue = true;138 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td input[type='checkbox']").each(function() {139 if ($(this).is(":checked")) {140 no_selected = false;141 if ($(this).attr("data-row-type") != "Invoice") {142 not_invoice_selected = true;143 } else {144 invoice_selected = true;145 }146 if ($(this).attr("data-row-status") == "Open" || $(this).attr("data-row-status") == "Overdue") {147 no_status_open_overdue = false;148 }149 }150 });151 $("#customer-single-modal .seaction-above-table ul.by-batch-btn li.print-transaction-btn").removeClass("disabled");152 $("#customer-single-modal .seaction-above-table ul.by-batch-btn li.print-packaging-slip-btn").removeClass("disabled");153 $("#customer-single-modal .seaction-above-table ul.by-batch-btn li.send-transaction-btn").removeClass("disabled");154 $("#customer-single-modal .seaction-above-table ul.by-batch-btn li.send-reminder-btn").removeClass("disabled");155 if (not_invoice_selected) {156 $("#customer-single-modal .seaction-above-table ul.by-batch-btn li.print-transaction-btn").addClass("disabled");157 $("#customer-single-modal .seaction-above-table ul.by-batch-btn li.send-transaction-btn").addClass("disabled");158 if (!invoice_selected) {159 $("#customer-single-modal .seaction-above-table ul.by-batch-btn li.print-transaction-btn").addClass("disabled");160 $("#customer-single-modal .seaction-above-table ul.by-batch-btn li.print-packaging-slip-btn").addClass("disabled");161 }162 }163 if (no_selected) {164 $("#customer-single-modal .seaction-above-table ul.by-batch-btn li.print-transaction-btn").addClass("disabled");165 $("#customer-single-modal .seaction-above-table ul.by-batch-btn li.print-packaging-slip-btn").addClass("disabled");166 $("#customer-single-modal .seaction-above-table ul.by-batch-btn li.send-transaction-btn").addClass("disabled");167 $("#customer-single-modal .seaction-above-table ul.by-batch-btn li.send-reminder-btn").addClass("disabled");168 }169 if (no_status_open_overdue) {170 $("#customer-single-modal .seaction-above-table ul.by-batch-btn li.send-reminder-btn").addClass("disabled");171 }172}173single_customer_table_columns_changed();174function single_customer_update_customer_notes() {175 $.ajax({176 url: baseURL + "/accounting/update_customer_notes",177 type: "POST",178 dataType: "json",179 data: {180 customer_id: $("#customer-single-modal input[name='customer_id']").val(),181 notes: $("#customer-single-modal .single-customer-info-section .top-section .notes textarea").val(),182 },183 success: function(data) {184 if (data.result == "success") {185 $("#customer-single-modal .single-customer-info-section .top-section .notes .saved-indicator").html("Saved!");186 } else {187 $("#customer-single-modal .single-customer-info-section .top-section .notes .saved-indicator").html("Not saved!");188 }189 },190 });191}192function single_customer_table_columns_changed() {193 $("#customer-single-modal .seaction-above-table .print-export-settings-btns .setting-btn-section .settings-options input[type='checkbox']")194 .map(function() {195 if ($(this).is(":checked")) {196 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table th[data-column='" + $(this).attr("data-column") + "']").show();197 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td[data-column='" + $(this).attr("data-column") + "']").show();198 } else {199 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table th[data-column='" + $(this).attr("data-column") + "']").hide();200 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td[data-column='" + $(this).attr("data-column") + "']").hide();201 }202 }).get();203}204function single_customer_page_get_all_customers(view_id = "") {205 $.ajax({206 url: baseURL + "/accounting/single_customer_page_get_all_customers",207 type: "POST",208 dataType: "json",209 data: {},210 success: function(data) {211 $("#customer-single-modal .the-body .customer-list-section ul").html(data.html);212 $('html, body').animate({213 scrollTop: $('#customer-single-modal .the-body .customer-list-section ul li[data-customer-id="' + view_id + '"]').offset().top214 }, 2000);215 $('#customer-single-modal .the-body .customer-list-section ul li[data-customer-id="' + view_id + '"]').addClass("active");216 single_customer_get_customers_details(view_id);217 },218 });219}220$(document).on("click", "#customer-single-modal .all-customer-section .sort-btn ul li", function(event) {221 single_customer_sort_all_customers_ul($(this).attr("data-sort-by"));222});223$(document).on("click", "#customer-single-modal .single-customer-info-section .body-section .filter-btn-section .filter-panel .btn-success.apply-btn", function(event) {224 single_customer_get_transaction_lists($("#customer-single-modal input[name='customer_id']").val());225});226function single_customer_get_transaction_lists(customer_id) {227 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table th input[name='customer_checkbox_all']").prop("checked", false);228 var filter_type = $("#customer-single-modal .single-customer-info-section .body-section .filter-btn-section .filter-panel select[name='filter_type']").val();229 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table tbody").html("<tr><td colspan='18' style='text-align:center;color: #C7C7C7;'><center><img src='" + baseURL + "assets/img/accounting/customers/loader.gif' style='width:50px;' /></center></td></tr>");230 $.ajax({231 url: baseURL + "/accounting/single_customer_get_transaction_lists",232 type: "POST",233 dataType: "json",234 data: {235 customer_id: customer_id,236 filter_type: filter_type,237 filter_date: $("#customer-single-modal .single-customer-info-section .body-section .filter-btn-section .filter-panel select[name='filter_date']").val(),238 },239 success: function(data) {240 if (data.tbody_html == "") {241 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table tbody").html("<tr><td colspan='18' style='text-align:center;color: #C7C7C7;'>No transaction list found.</td></tr>");242 } else {243 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table tbody").html(data.tbody_html);244 }245 single_customer_table_columns_changed();246 single_customer_sortTable();247 table_viewing_affected(filter_type);248 $("#loader-modal").hide();249 },250 });251}252function table_viewing_affected(filter_type) {253 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-start-date']").parent().parent().hide();254 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-start-date']").prop("checked", true);255 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-start-date']").trigger("click");256 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-end-date']").parent().parent().hide();257 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-end-date']").prop("checked", true);258 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-end-date']").trigger("click");259 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-statement-type']").parent().parent().hide();260 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-statement-type']").prop("checked", true);261 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-statement-type']").trigger("click");262 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-accepted-by']").parent().parent().hide();263 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-accepted-by']").prop("checked", true);264 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-accepted-by']").trigger("click");265 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-accepted-date']").parent().parent().hide();266 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-accepted-date']").prop("checked", true);267 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-accepted-date']").trigger("click");268 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-expiration-date']").parent().parent().hide();269 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-expiration-date']").prop("checked", true);270 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-expiration-date']").trigger("click");271 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-txn-type']").parent().parent().hide();272 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-txn-type']").prop("checked", true);273 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-txn-type']").trigger("click");274 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-interval']").parent().parent().hide();275 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-interval']").prop("checked", true);276 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-interval']").trigger("click");277 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-prev-date']").parent().parent().hide();278 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-prev-date']").prop("checked", true);279 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-prev-date']").trigger("click");280 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-next-date']").parent().parent().hide();281 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-next-date']").prop("checked", true);282 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-next-date']").trigger("click");283 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-amount']").parent().parent().hide();284 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-amount']").prop("checked", true);285 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-amount']").trigger("click");286 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-no']").parent().parent().show();287 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-type']").parent().parent().show();288 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-method']").parent().parent().show();289 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-source']").parent().parent().show();290 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-memo']").parent().parent().show();291 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-duedate']").parent().parent().show();292 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-aging']").parent().parent().show();293 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-balance']").parent().parent().show();294 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-last-delivered']").parent().parent().show();295 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-email']").parent().parent().show();296 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-attachment']").parent().parent().show();297 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-status']").parent().parent().show();298 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-ponumber']").parent().parent().show();299 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-sales-rep']").parent().parent().show();300 $("#customer-single-modal .setting-btn-section .settings-options .show-more-less").show();301 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-no']").prop("checked", false);302 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-no']").trigger("click");303 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-type']").prop("checked", false);304 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-type']").trigger("click");305 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-method']").prop("checked", true);306 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-method']").trigger("click");307 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-source']").prop("checked", true);308 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-source']").trigger("click");309 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-memo']").prop("checked", true);310 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-memo']").trigger("click");311 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-duedate']").prop("checked", false); //312 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-duedate']").trigger("click");313 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-aging']").prop("checked", false); //314 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-aging']").trigger("click");315 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-balance']").prop("checked", false); //316 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-balance']").trigger("click");317 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-last-delivered']").prop("checked", false); //318 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-last-delivered']").trigger("click");319 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-email']").prop("checked", true);320 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-email']").trigger("click");321 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-attachment']").prop("checked", false); //322 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-attachment']").trigger("click");323 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-status']").prop("checked", false); // 324 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-status']").trigger("click");325 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-ponumber']").prop("checked", true);326 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-ponumber']").trigger("click");327 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-sales-rep']").prop("checked", false); //328 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-sales-rep']").trigger("click");329 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table th[data-column='total']").show();330 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td[data-column='total']").show();331 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table th[data-column='date']").show();332 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td[data-column='date']").show();333 if (filter_type == "Statements") {334 //customer_id, P.O number, Sales Rep, No., Start Date, End date, Stement type, Action335 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-start-date']").parent().parent().show();336 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-start-date']").prop("checked", false);337 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-start-date']").trigger("click");338 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-end-date']").parent().parent().show();339 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-end-date']").prop("checked", false);340 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-end-date']").trigger("click");341 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-statement-type']").parent().parent().show();342 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-statement-type']").prop("checked", false);343 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-statement-type']").trigger("click");344 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-method']").parent().parent().hide();345 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-method']").prop("checked", true);346 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-method']").trigger("click");347 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-source']").parent().parent().hide();348 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-source']").prop("checked", true);349 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-source']").trigger("click");350 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-memo']").parent().parent().hide();351 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-memo']").prop("checked", true);352 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-memo']").trigger("click");353 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-duedate']").parent().parent().hide();354 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-duedate']").prop("checked", true);355 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-duedate']").trigger("click");356 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-aging']").parent().parent().hide();357 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-aging']").prop("checked", true);358 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-aging']").trigger("click");359 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-balance']").parent().parent().hide();360 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-balance']").prop("checked", true);361 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-balance']").trigger("click");362 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-last-delivered']").parent().parent().hide();363 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-last-delivered']").prop("checked", true);364 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-last-delivered']").trigger("click");365 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-email']").parent().parent().hide();366 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-email']").prop("checked", true);367 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-email']").trigger("click");368 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-attachment']").parent().parent().hide();369 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-attachment']").prop("checked", true);370 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-attachment']").trigger("click");371 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-status']").parent().parent().hide();372 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-status']").prop("checked", true);373 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-status']").trigger("click");374 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-ponumber']").parent().parent().hide();375 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-ponumber']").prop("checked", true);376 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-ponumber']").trigger("click");377 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-sales-rep']").parent().parent().hide();378 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-sales-rep']").prop("checked", true);379 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-sales-rep']").trigger("click");380 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table th[data-column='total']").hide();381 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table tbody td[data-column='total']").hide();382 $("#customer-single-modal .setting-btn-section .settings-options .show-more-less").hide();383 } else if (filter_type == "All plus deposits") {384 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-type']").prop("checked", false); //385 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-type']").trigger("click");386 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-no']").prop("checked", false); //387 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-no']").trigger("click");388 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-method']").prop("checked", true);389 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-method']").trigger("click");390 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-source']").prop("checked", true);391 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-source']").trigger("click");392 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-memo']").prop("checked", true);393 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-memo']").trigger("click");394 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-duedate']").prop("checked", false); //395 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-duedate']").trigger("click");396 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-aging']").prop("checked", true);397 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-aging']").trigger("click");398 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-balance']").prop("checked", false); //399 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-balance']").trigger("click");400 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-last-delivered']").prop("checked", true);401 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-last-delivered']").trigger("click");402 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-email']").prop("checked", true);403 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-email']").trigger("click");404 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-attachment']").prop("checked", false); //405 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-attachment']").trigger("click");406 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-status']").prop("checked", false); //407 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-status']").trigger("click");408 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-ponumber']").prop("checked", true);409 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-ponumber']").trigger("click");410 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-sales-rep']").prop("checked", false); //411 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-sales-rep']").trigger("click");412 } else if (filter_type == "All invoices" || filter_type == "Open invoices" || filter_type == "Overdue invoices") {413 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-method']").parent().parent().hide();414 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-source']").parent().parent().hide();415 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-type']").prop("checked", false); //416 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-type']").trigger("click");417 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-no']").prop("checked", false); //418 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-no']").trigger("click");419 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-method']").prop("checked", true);420 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-method']").trigger("click");421 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-source']").prop("checked", true);422 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-source']").trigger("click");423 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-memo']").prop("checked", true);424 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-memo']").trigger("click");425 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-duedate']").prop("checked", false); //426 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-duedate']").trigger("click");427 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-aging']").prop("checked", false); //428 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-aging']").trigger("click");429 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-balance']").prop("checked", false); //430 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-balance']").trigger("click");431 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-last-delivered']").prop("checked", true);432 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-last-delivered']").trigger("click");433 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-email']").prop("checked", true);434 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-email']").trigger("click");435 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-attachment']").prop("checked", false); //436 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-attachment']").trigger("click");437 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-status']").prop("checked", false); //438 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-status']").trigger("click");439 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-ponumber']").prop("checked", true);440 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-ponumber']").trigger("click");441 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-sales-rep']").prop("checked", false); //442 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-sales-rep']").trigger("click");443 } else if (filter_type == "Open estimates") {444 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-accepted-by']").parent().parent().show();445 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-accepted-by']").prop("checked", true);446 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-accepted-by']").trigger("click");447 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-accepted-date']").parent().parent().show();448 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-accepted-date']").prop("checked", true);449 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-accepted-date']").trigger("click");450 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-expiration-date']").parent().parent().show();451 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-expiration-date']").prop("checked", true);452 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-expiration-date']").trigger("click");453 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-method']").parent().parent().hide();454 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-source']").parent().parent().hide();455 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-duedate']").parent().parent().hide();456 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-aging']").parent().parent().hide();457 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-balance']").parent().parent().hide();458 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-type']").prop("checked", false); //459 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-type']").trigger("click");460 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-no']").prop("checked", false); //461 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-no']").trigger("click");462 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-method']").prop("checked", true);463 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-method']").trigger("click");464 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-source']").prop("checked", true);465 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-source']").trigger("click");466 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-memo']").prop("checked", true);467 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-memo']").trigger("click");468 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-duedate']").prop("checked", true);469 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-duedate']").trigger("click");470 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-aging']").prop("checked", true);471 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-aging']").trigger("click");472 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-balance']").prop("checked", true);473 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-balance']").trigger("click");474 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-last-delivered']").prop("checked", false); //475 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-last-delivered']").trigger("click");476 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-email']").prop("checked", true);477 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-email']").trigger("click");478 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-attachment']").prop("checked", false); //479 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-attachment']").trigger("click");480 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-status']").prop("checked", false); //481 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-status']").trigger("click");482 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-ponumber']").prop("checked", true);483 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-ponumber']").trigger("click");484 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-sales-rep']").prop("checked", false); //485 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-sales-rep']").trigger("click");486 } else if (filter_type == "Credit memos") {487 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-method']").parent().parent().hide();488 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-source']").parent().parent().hide();489 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-duedate']").parent().parent().hide();490 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-aging']").parent().parent().hide();491 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-balance']").parent().parent().hide();492 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-type']").prop("checked", false); //493 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-type']").trigger("click");494 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-no']").prop("checked", false); //495 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-no']").trigger("click");496 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-method']").prop("checked", true);497 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-method']").trigger("click");498 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-source']").prop("checked", true);499 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-source']").trigger("click");500 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-memo']").prop("checked", true);501 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-memo']").trigger("click");502 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-duedate']").prop("checked", true);503 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-duedate']").trigger("click");504 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-aging']").prop("checked", true);505 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-aging']").trigger("click");506 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-balance']").prop("checked", true);507 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-balance']").trigger("click");508 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-last-delivered']").prop("checked", true);509 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-last-delivered']").trigger("click");510 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-email']").prop("checked", true);511 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-email']").trigger("click");512 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-attachment']").prop("checked", false); //513 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-attachment']").trigger("click");514 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-status']").prop("checked", false); //515 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-status']").trigger("click");516 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-ponumber']").prop("checked", true);517 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-ponumber']").trigger("click");518 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-sales-rep']").prop("checked", false); //519 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-sales-rep']").trigger("click");520 } else if (filter_type == "Unbilled income") {521 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-method']").parent().parent().hide();522 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-source']").parent().parent().hide();523 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-duedate']").parent().parent().hide();524 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-aging']").parent().parent().hide();525 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-balance']").parent().parent().hide();526 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-last-delivered']").parent().parent().hide();527 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-email']").parent().parent().hide();528 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-ponumber']").parent().parent().hide();529 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-sales-rep']").parent().parent().hide();530 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-type']").prop("checked", false); //531 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-type']").trigger("click");532 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-no']").prop("checked", false); //533 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-no']").trigger("click");534 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-method']").prop("checked", true);535 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-method']").trigger("click");536 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-source']").prop("checked", true);537 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-source']").trigger("click");538 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-memo']").prop("checked", false); //539 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-memo']").trigger("click");540 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-duedate']").prop("checked", true);541 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-duedate']").trigger("click");542 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-aging']").prop("checked", true);543 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-aging']").trigger("click");544 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-balance']").prop("checked", true);545 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-balance']").trigger("click");546 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-last-delivered']").prop("checked", true);547 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-last-delivered']").trigger("click");548 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-email']").prop("checked", true);549 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-email']").trigger("click");550 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-attachment']").prop("checked", false); //551 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-attachment']").trigger("click");552 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-status']").prop("checked", true);553 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-status']").trigger("click");554 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-ponumber']").prop("checked", true);555 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-ponumber']").trigger("click");556 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-sales-rep']").prop("checked", true);557 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-sales-rep']").trigger("click");558 } else if (filter_type == "Money received") {559 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-method']").parent().parent().hide();560 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-source']").parent().parent().hide();561 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-duedate']").parent().parent().hide();562 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-aging']").parent().parent().hide();563 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-balance']").parent().parent().hide();564 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-last-delivered']").parent().parent().hide();565 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-email']").parent().parent().hide();566 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-type']").prop("checked", false); //567 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-type']").trigger("click");568 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-no']").prop("checked", false); //569 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-no']").trigger("click");570 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-method']").prop("checked", true);571 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-method']").trigger("click");572 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-source']").prop("checked", true);573 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-source']").trigger("click");574 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-memo']").prop("checked", true);575 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-memo']").trigger("click");576 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-duedate']").prop("checked", true);577 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-duedate']").trigger("click");578 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-aging']").prop("checked", true);579 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-aging']").trigger("click");580 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-balance']").prop("checked", true);581 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-balance']").trigger("click");582 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-last-delivered']").prop("checked", true);583 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-last-delivered']").trigger("click");584 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-email']").prop("checked", true);585 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-email']").trigger("click");586 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-attachment']").prop("checked", false); //587 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-attachment']").trigger("click");588 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-status']").prop("checked", true);589 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-status']").trigger("click");590 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-ponumber']").prop("checked", true);591 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-ponumber']").trigger("click");592 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-sales-rep']").prop("checked", false); //593 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-sales-rep']").trigger("click");594 } else if (filter_type == "Recurring templates") {595 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table th[data-column='date']").hide();596 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td[data-column='date']").hide();597 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table th[data-column='total']").hide();598 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td[data-column='total']").hide();599 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-txn-type']").parent().parent().show();600 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-txn-type']").prop("checked", false);601 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-txn-type']").trigger("click");602 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-interval']").parent().parent().show();603 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-interval']").prop("checked", false);604 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-interval']").trigger("click");605 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-prev-date']").parent().parent().show();606 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-prev-date']").prop("checked", false);607 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-prev-date']").trigger("click");608 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-next-date']").parent().parent().show();609 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-next-date']").prop("checked", false);610 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-next-date']").trigger("click");611 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-amount']").parent().parent().show();612 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-amount']").prop("checked", false);613 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-amount']").trigger("click");614 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-no']").parent().parent().hide();615 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-method']").parent().parent().hide();616 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-source']").parent().parent().hide();617 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-duedate']").parent().parent().hide();618 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-aging']").parent().parent().hide();619 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-balance']").parent().parent().hide();620 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-last-delivered']").parent().parent().hide();621 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-memo']").parent().parent().hide();622 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-email']").parent().parent().hide();623 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-attachment']").parent().parent().hide();624 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-status']").parent().parent().hide();625 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-type']").prop("checked", false);626 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-type']").trigger("click");627 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-no']").prop("checked", true); //628 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-no']").trigger("click");629 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-method']").prop("checked", true);630 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-method']").trigger("click");631 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-source']").prop("checked", true);632 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-source']").trigger("click");633 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-memo']").prop("checked", true);634 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-memo']").trigger("click");635 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-duedate']").prop("checked", true);636 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-duedate']").trigger("click");637 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-aging']").prop("checked", true);638 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-aging']").trigger("click");639 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-balance']").prop("checked", true);640 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-balance']").trigger("click");641 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-last-delivered']").prop("checked", true);642 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-last-delivered']").trigger("click");643 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-email']").prop("checked", true);644 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-email']").trigger("click");645 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-attachment']").prop("checked", true);646 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-attachment']").trigger("click");647 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-status']").prop("checked", true);648 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-status']").trigger("click");649 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-ponumber']").prop("checked", true);650 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-ponumber']").trigger("click");651 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-sales-rep']").prop("checked", false); //652 $("#customer-single-modal .setting-btn-section .settings-options input[name='tbl-colum-sales-rep']").trigger("click");653 }654}655function single_customer_sort_all_customers_ul(sort_by) {656 $("#customer-single-modal .all-customer-section .sort-btn button .sort-display").html("Sort by " + sort_by);657 if (sort_by == "name") {658 var result = $('#customer-single-modal .the-body .customer-list-section ul li').sort(function(a, b) {659 var contentA = ($(a).data('name'));660 var contentB = ($(b).data('name'));661 return (contentA < contentB) ? -1 : (contentA > contentB) ? 1 : 0;662 });663 $('#customer-single-modal .the-body .customer-list-section ul').html(result);664 } else {665 var result = $('#customer-single-modal .the-body .customer-list-section ul li').sort(function(a, b) {666 var contentA = parseInt($(a).data('open-balance'));667 var contentB = parseInt($(b).data('open-balance'));668 return (contentA > contentB) ? -1 : (contentA < contentB) ? 1 : 0;669 });670 $('#customer-single-modal .the-body .customer-list-section ul').html(result);671 }672}673function single_customer_get_customers_details(customer_id) {674 $("#customer-single-modal input[name='customer_id']").val(customer_id);675 $('#customer-single-modal .the-body .customer-list-section ul li').removeClass("active");676 $('#customer-single-modal .the-body .customer-list-section ul li[data-customer-id="' + customer_id + '"]').addClass("active");677 $("#customer-single-modal .top-section .btns-section .new-transactions .customer_craete_invoice_btn").attr("data-customer-id", customer_id);678 $("#customer-single-modal .top-section .btns-section .new-transactions .customer_receive_payment_btn").attr("data-customer-id", customer_id);679 $("#customer-single-modal .top-section .btns-section .new-transactions .customer_receive_payment_btn").attr("data-customer-id", customer_id);680 $("#customer-single-modal .top-section .btns-section .new-transactions .create-estimate-btn").attr("data-customer-id", customer_id);681 $("#customer-single-modal .top-section .btns-section .new-transactions .created-sales-receipt").attr("data-customer-id", customer_id);682 $("#customer-single-modal .top-section .btns-section .new-transactions .create-charge-btn").attr("data-customer-id", customer_id);683 $("#customer-single-modal .top-section .btns-section .new-transactions .time-activity-btn").attr("data-customer-id", customer_id);684 $("#customer-single-modal .top-section .btns-section .new-transactions .created-statement-btn").attr("data-customer-id", customer_id);685 $("#loader-modal").show();686 $('#modal-container #new-customer-modal form').trigger("reset");687 $.ajax({688 url: baseURL + "/accounting/single_customer_get_customers_details",689 type: "POST",690 dataType: "json",691 data: { customer_id: customer_id },692 success: function(data) {693 $('#customer-single-modal .customer-details-section .attachement-file-section div.attachement-viewer').html(data.attachements_html);694 $("#customer-single-modal .seaction-above-table .print-export-settings-btns button.export-btn").attr("data-customer-name", data.customer_details[0]['first_name'] + " " + data.customer_details[0]['last_name']);695 $("#customer-single-modal .seaction-above-table .print-export-settings-btns button.print-btn").attr("data-customer-name", data.customer_details[0]['last_name'] + ", " + data.customer_details[0]['first_name']);696 $("#customer-single-modal .seaction-above-table .print-export-settings-btns button.print-btn").attr("data-company-name", data.company_details['business_name']);697 $("#customer-single-modal .single-customer-info-section .top-section .monetary-section .monetary-open .amount").html("$" + data.open_balance);698 $("#customer-single-modal .single-customer-info-section .top-section .monetary-section .monetary-overdue .amount").html("$" + data.overdue);699 $("#customer-single-modal .single-customer-info-section .top-section .customer-name h2 span.text").html(data.customer_details[0]['first_name'] + " " + data.customer_details[0]['last_name']);700 $("#customer-single-modal .single-customer-info-section .top-section .customer-address label").html(data.customer_details[0]['mail_add'] + ", " + data.customer_details[0]['city'] + ", " + data.customer_details[0]['state'] + " " + data.customer_details[0]['zip_code']);701 $("#customer-single-modal .single-customer-info-section .top-section .notes textarea").val(data.customer_details[0]['notes']);702 $("#customer-single-modal .top-section .btns-section .new-transactions .create-estimate-btn").attr("data-email-add", data.customer_details[0]['email']);703 single_customer_notes_text_area_changed();704 $("#customer-single-modal .single-customer-info-section .top-section .notes .saved-indicator").hide();705 single_customer_get_transaction_lists(customer_id);706 console.log(data);707 // $("#loader-modal").hide();708 //seeting customer-deatials-values709 var billing_address = "";710 if (data.customer_details[0]['mail_add'] != null && data.customer_details[0]['mail_add'] != "") {711 billing_address += data.customer_details[0]['mail_add'];712 $('#modal-container #new-customer-modal textarea[name="street"]').val(data.customer_details[0]['mail_add']);713 }714 if (data.customer_details[0]['city'] != null && data.customer_details[0]['city'] != "") {715 billing_address += "<br>" + data.customer_details[0]['city'];716 $('#modal-container #new-customer-modal input[name="city"]').val(data.customer_details[0]['city']);717 }718 if (data.customer_details[0]['state'] != null && data.customer_details[0]['state'] != "") {719 billing_address += ", " + data.customer_details[0]['state'];720 $('#modal-container #new-customer-modal input[name="state"]').val(data.customer_details[0]['state']);721 }722 if (data.customer_details[0]['zip_code'] != null && data.customer_details[0]['zip_code'] != "") {723 billing_address += "<br>" + data.customer_details[0]['zip_code'];724 $('#modal-container #new-customer-modal input[name="zip"]').val(data.customer_details[0]['zip_code']);725 }726 if (data.customer_details[0]['country'] != null && data.customer_details[0]['country'] != "") {727 billing_address += " " + data.customer_details[0]['country'];728 $('#modal-container #new-customer-modal input[name="country"]').val(data.customer_details[0]['country']);729 }730 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section.customer-details .customer-details-section .customer-info .info-value[data-for='customer-name']").html(data.customer_details[0]['last_name'] + ", " + data.customer_details[0]['first_name']);731 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section.customer-details .customer-details-section .customer-info .info-value[data-for='email']").html(data.customer_details[0]['email']);732 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section.customer-details .customer-details-section .customer-info .info-value[data-for='phone']").html(data.customer_details[0]['phone_m']);733 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section.customer-details .customer-details-section .customer-info .info-value[data-for='mobile']").html(data.customer_details[0]['contact_phone1']);734 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section.customer-details .customer-details-section .customer-info .info-value[data-for='notes'] textarea").html(data.customer_details[0]['notes']);735 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section.customer-details .customer-details-section .customer-info .info-value[data-for='billing-address']").html(billing_address);736 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section.customer-details .customer-details-section .customer-info .info-value[data-for='customer-type']").html(data.customer_details[0]['customer_type']);737 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section.customer-details .customer-details-section .customer-info .info-value[data-for='fax']").html("");738 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section.customer-details .customer-details-section .customer-info .info-value[data-for='website']").html("");739 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section.customer-details .customer-details-section .customer-info .info-value[data-for='other']").html("");740 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section.customer-details .customer-details-section .customer-info .info-value[data-for='shipping-address']").html("");741 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section.customer-details .customer-details-section .customer-info .info-value[data-for='terms']").html("");742 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section.customer-details .customer-details-section .customer-info .info-value[data-for='payment-method']").html("");743 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section.customer-details .customer-details-section .customer-info .info-value[data-for='deleviry-method']").html("");744 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section.customer-details .customer-details-section .customer-info .info-value[data-for='customer-language']").html("");745 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section.customer-details .customer-details-section .customer-info .info-value[data-for='tax-reg-no']").html("");746 if (data.customer_details[0]['prefix'] != null) {747 $('#modal-container #new-customer-modal input[name="title"]').val(data.customer_details[0]['prefix']);748 }749 if (data.customer_details[0]['business_name'] != null) {750 $('#modal-container #new-customer-modal input[name="company"]').val(data.customer_details[0]['business_name']);751 }752 if (data.customer_details[0]['first_name'] != null) {753 $('#modal-container #new-customer-modal input[name="f_name"]').val(data.customer_details[0]['first_name']);754 }755 if (data.customer_details[0]['middle_name'] != null) {756 $('#modal-container #new-customer-modal input[name="m_name"]').val(data.customer_details[0]['middle_name']);757 }758 if (data.customer_details[0]['last_name'] != null) {759 $('#modal-container #new-customer-modal input[name="l_name"]').val(data.customer_details[0]['last_name']);760 }761 if (data.customer_details[0]['suffix'] != null) {762 $('#modal-container #new-customer-modal input[name="suffix"]').val(data.customer_details[0]['suffix']);763 }764 if (data.customer_details[0]['email'] != null) {765 $('#modal-container #new-customer-modal input[name="email"]').val(data.customer_details[0]['email']);766 }767 if (data.customer_details[0]['phone_m'] != null) {768 $('#modal-container #new-customer-modal input[name="phone"]').val(data.customer_details[0]['phone_m']);769 }770 if (data.customer_details[0]['contact_phone1'] != null) {771 $('#modal-container #new-customer-modal input[name="mobile"]').val(data.customer_details[0]['contact_phone1']);772 }773 if (data.customer_details[0]['customer_type'] != null) {774 $('#modal-container #new-customer-modal select[name="customer_type"]').val(data.customer_details[0]['customer_type']);775 }776 if (data.customer_details[0]['notes'] != null) {777 $('#modal-container #new-customer-modal textarea[name="notes"]').val(data.customer_details[0]['notes']);778 }779 if (data.customer_accounting_details.length > 0) {780 var shipping_address = "";781 if (data.customer_accounting_details[0]['shipping_address'] != null && data.customer_accounting_details[0]['shipping_address'] != "") {782 shipping_address = data.customer_accounting_details[0]['shipping_address'];783 $('#modal-container #new-customer-modal textarea[name="shipping_address"]').val(data.customer_accounting_details[0]['shipping_address']);784 }785 if (data.customer_accounting_details[0]['shipping_city'] != null && data.customer_accounting_details[0]['shipping_city'] != "") {786 shipping_address += "<br>" + data.customer_accounting_details[0]['shipping_city'];787 $('#modal-container #new-customer-modal input[name="shipping_city"]').val(data.customer_accounting_details[0]['shipping_city']);788 }789 if (data.customer_accounting_details[0]['shipping_state'] != null && data.customer_accounting_details[0]['shipping_state'] != "") {790 shipping_address += ", " + data.customer_accounting_details[0]['shipping_state'];791 $('#modal-container #new-customer-modal input[name="shipping_state"]').val(data.customer_accounting_details[0]['shipping_state']);792 }793 if (data.customer_accounting_details[0]['shipping_zip'] != null && data.customer_accounting_details[0]['shipping_zip'] != "") {794 shipping_address += "<br>" + data.customer_accounting_details[0]['shipping_zip'];795 $('#modal-container #new-customer-modal input[name="shipping_zip"]').val(data.customer_accounting_details[0]['shipping_zip']);796 }797 if (data.customer_accounting_details[0]['shipping_country'] != null && data.customer_accounting_details[0]['shipping_country'] != "") {798 shipping_address += " " + data.customer_accounting_details[0]['shipping_country'];799 $('#modal-container #new-customer-modal input[name="shipping_country"]').val(data.customer_accounting_details[0]['shipping_country']);800 }801 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section.customer-details .customer-details-section .customer-info .info-value[data-for='fax']").html(data.customer_accounting_details[0]['fax_no']);802 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section.customer-details .customer-details-section .customer-info .info-value[data-for='website']").html(data.customer_accounting_details[0]['website']);803 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section.customer-details .customer-details-section .customer-info .info-value[data-for='other']").html("");804 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section.customer-details .customer-details-section .customer-info .info-value[data-for='shipping-address']").html(shipping_address);805 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section.customer-details .customer-details-section .customer-info .info-value[data-for='terms']").html(data.customer_accounting_details[0]['payment_terms']);806 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section.customer-details .customer-details-section .customer-info .info-value[data-for='payment-method']").html(data.customer_accounting_details[0]['payment_method']);807 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section.customer-details .customer-details-section .customer-info .info-value[data-for='deleviry-method']").html(data.customer_accounting_details[0]['delivery_method']);808 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section.customer-details .customer-details-section .customer-info .info-value[data-for='customer-language']").html("");809 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section.customer-details .customer-details-section .customer-info .info-value[data-for='tax-reg-no']").html("");810 if (data.customer_accounting_details[0]['display_name'] != null) {811 $('#modal-container #new-customer-modal input[name="display_name"]').val(data.customer_accounting_details[0]['display_name']);812 }813 if (data.customer_accounting_details[0]['use_display_name'] != null) {814 $('#modal-container #new-customer-modal input[name="use_display_name"]').val(data.customer_accounting_details[0]['use_display_name']);815 }816 if (data.customer_accounting_details[0]['print_check_name'] != null) {817 $('#modal-container #new-customer-modal input[name="print_on_check_name"]').val(data.customer_accounting_details[0]['print_check_name']);818 }819 if (data.customer_accounting_details[0]['fax_no'] != null) {820 $('#modal-container #new-customer-modal input[name="fax"]').val(data.customer_accounting_details[0]['fax_no']);821 }822 if (data.customer_accounting_details[0]['website'] != null) {823 $('#modal-container #new-customer-modal input[name="website"]').val(data.customer_accounting_details[0]['website']);824 }825 if (data.customer_accounting_details[0]['is_sub_customer'] != null) {826 $('#modal-container #new-customer-modal input[name="sub_customer"]').val(data.customer_accounting_details[0]['is_sub_customer']);827 }828 if (data.customer_accounting_details[0]['parent_customer_id'] != null) {829 $('#modal-container #new-customer-modal select[name="parent_customer"]').val(data.customer_accounting_details[0]['parent_customer_id']);830 }831 if (data.customer_accounting_details[0]['bill_with'] != null) {832 $('#modal-container #new-customer-modal select[name="bill_with"]').val(data.customer_accounting_details[0]['bill_with']);833 }834 if (data.customer_accounting_details[0]['shipping_address'] != null) {835 $('#modal-container #new-customer-modal textarea[name="shipping_address"]').val(data.customer_accounting_details[0]['shipping_address']);836 }837 if (data.customer_accounting_details[0]['shipping_city'] != null) {838 $('#modal-container #new-customer-modal input[name="shipping_city"]').val(data.customer_accounting_details[0]['shipping_city']);839 }840 if (data.customer_accounting_details[0]['shipping_state'] != null) {841 $('#modal-container #new-customer-modal input[name="shipping_state"]').val(data.customer_accounting_details[0]['shipping_state']);842 }843 if (data.customer_accounting_details[0]['shipping_zip'] != null) {844 $('#modal-container #new-customer-modal input[name="shipping_zip"]').val(data.customer_accounting_details[0]['shipping_zip']);845 }846 if (data.customer_accounting_details[0]['shipping_country'] != null) {847 $('#modal-container #new-customer-modal input[name="shipping_country"]').val(data.customer_accounting_details[0]['shipping_country']);848 }849 if (data.customer_accounting_details[0]['tax_exempted'] != null) {850 $('#modal-container #new-customer-modal input[name="cust_tax_exempt"]').prop("checked", true);851 }852 if (data.customer_accounting_details[0]['tax_rate'] != null) {853 $('#modal-container #new-customer-modal select[name="tax_rate"]').val(data.customer_accounting_details[0]['tax_rate']);854 }855 if (data.customer_accounting_details[0]['reason_for_exemption'] != null) {856 $('#modal-container #new-customer-modal select[name="reason_for_exemption"]').val(data.customer_accounting_details[0]['reason_for_exemption']);857 }858 if (data.customer_accounting_details[0]['exemption_details'] != null) {859 $('#modal-container #new-customer-modal input[name="exemption_details"]').val(data.customer_accounting_details[0]['exemption_details']);860 }861 if (data.customer_accounting_details[0]['payment_method'] != null) {862 $('#modal-container #new-customer-modal select[name="cust_payment_method"]').val(data.customer_accounting_details[0]['payment_method']);863 }864 if (data.customer_accounting_details[0]['delivery_method'] != null) {865 $('#modal-container #new-customer-modal select[name="delivery_method"]').val(data.customer_accounting_details[0]['delivery_method']);866 }867 if (data.customer_accounting_details[0]['payment_terms'] != null) {868 $('#modal-container #new-customer-modal select[name="cust_payment_terms"]').val(data.customer_accounting_details[0]['payment_terms']);869 }870 if (data.customer_accounting_details[0]['opening_balance'] != null) {871 $('#modal-container #new-customer-modal input[name="opening_balance"]').val(data.customer_accounting_details[0]['opening_balance']);872 }873 }874 },875 });876}877$('#customer-single-modal .seaction-above-table .print-export-settings-btns button.export-btn').click(function() {878 let options = {879 "separator": ",",880 "newline": "\n",881 "quoteFields": true,882 "excludeColumns": "",883 "excludeRows": "",884 "trimContent": true,885 "filename": "Transaction List - " + $(this).attr("data-customer-name") + ".csv",886 "appendTo": "#output"887 }888 var attachment_th = $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table th[data-column='attachment']").html();889 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table th[data-column='attachment']").html("Attachment");890 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table th:last-child").hide();891 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td:last-child").hide();892 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table th:first-child").hide();893 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td:first-child").hide();894 $('#customer-single-modal .transaction-list-table #single_customer_table').table2csv('download', options);895 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table th:last-child").show();896 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td:last-child").show();897 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table th:first-child").show();898 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td:first-child").show();899 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table th[data-column='attachment']").html(attachment_th);900});901$('#customer-single-modal .seaction-above-table .print-export-settings-btns button.print-btn').click(function() {902 var attachment_th = $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table th[data-column='attachment']").html();903 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table th[data-column='attachment']").html("Attachment");904 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table th:last-child").hide();905 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td:last-child").hide();906 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table th:first-child").hide();907 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td:first-child").hide();908 var filter_type = $("#customer-single-modal .single-customer-info-section .body-section .filter-btn-section .filter-panel select[name='filter_type']").val();909 var filter_date = $("#customer-single-modal .single-customer-info-section .body-section .filter-btn-section .filter-panel select[name='filter_date']").val();910 var w = window.open();911 var html = `<!DOCTYPE html>912 <html lang="en">913 <title>Transaction List</title>914 <style>915 h1{916 text-align: center;917 }h3{918 text-align: center;919 }table {920 width: 100%;921 border-collapse: collapse;922 }thead tr {923 border-bottom: solid 2px #BFBFBF;924 }tbody tr {925 border-bottom: dotted 1px #BFBFBF;926 }th, td {927 padding: 10px;928 text-align: left;929 padding: 10px;930 }931 </style>932 <body>933 <h1>` + $(this).attr("data-company-name") + `</h1>934 <h3>Type: ` + filter_type + ` · Status: All statuses · Delivery method: Any · Name: ` + $(this).attr("data-customer-name") + ` · Date: ` + filter_date + `</h3>935 <table>` + $('#customer-single-modal .transaction-list-table #single_customer_table').html() + `</table>936 </body>937 <script>window.print();</script>938 </html>`;939 $(w.document.body).html(html);940 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table th:last-child").show();941 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td:last-child").show();942 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table th:first-child").show();943 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td:first-child").show();944 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table th[data-column='attachment']").html(attachment_th);945});946$(document).on("click", "#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td ul li.share-invoice-link-btn", function(event) {947 $.ajax({948 url: baseURL + "/accounting/generate_share_invoice_link",949 type: "POST",950 dataType: "json",951 data: {952 invoice_id: $(this).attr("data-invoice-id")953 },954 success: function(data) {955 $("div#share-link-modal").fadeIn();956 $('div#share-link-modal .the-modal-body .form-group input[name="shared_invoice_link"]').val(data.shared_link);957 },958 });959});960$(document).on("click", "div#share-link-modal .the-modal-body .btns button.cancel-btn", function(event) {961 $("div#share-link-modal").fadeOut();962});963$(document).on("click", "#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td .delete-invoice-btn", function(event) {964 delete_invoice(this, "single_customer_page");965});966function delete_invoice(element, action_from = "") {967 Swal.fire({968 title: "Delete Invoice?",969 html: "Are you sure you want to delete this invoice? This invoice is linked to other transactions",970 imageUrl: baseURL + "assets/img/accounting/customers/delete.png",971 showCancelButton: true,972 confirmButtonColor: "#2ca01c",973 cancelButtonColor: "#d33",974 confirmButtonText: "Yes, I want to delete this invoice!",975 }).then((result) => {976 if (result.value) {977 $("body").css({ 'cursor': 'wait' });978 $(element).css({ 'cursor': 'wait' });979 $.ajax({980 type: 'POST',981 url: baseURL + "invoice/deleteInvoiceBtnNew",982 data: { id: $(element).attr("data-invoice-id") },983 success: function(result) {984 $("body").css({ 'cursor': 'default' });985 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td .delete-invoice-btn").css({ 'cursor': 'default' });986 if (result) {987 Swal.fire({988 showConfirmButton: false,989 timer: 2000,990 title: "Success",991 html: "Invoice has been deleted.",992 icon: "success",993 });994 }995 },996 });997 if (action_from == "single_customer_page") {998 single_customer_page_get_all_customers($("#customer-single-modal input[name='customer_id']").val());999 } else if (action_from == "invoice_page") {1000 invoices_filter_changed();1001 $("div#invoice-viewer-modal").fadeOut();1002 }1003 }1004 });1005}1006$(document).on("click", "div#share-link-modal .the-modal-body .btns button.copy-btn", function(event) {1007 $('div#share-link-modal .the-modal-body .form-group input[name="shared_invoice_link"]').select();1008 document.execCommand("copy");1009 $("div#share-link-modal").fadeOut();1010 $("body").append(`1011 <div id="lou-customer-pop-up-alert">1012 <div class="lou-pop-up-body">Copied to clipboard</div>1013 </div>`);1014 $("#lou-customer-pop-up-alert").fadeIn();1015 setTimeout(function() {1016 $("#lou-customer-pop-up-alert").fadeOut();1017 setTimeout(function() { $("#lou-customer-pop-up-alert").remove(); }, 1000);1018 }, 3000);1019});1020$(document).on("click", "#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td .print-invoice-btn", function(event) {1021 $("body").css({ 'cursor': 'wait' });1022 $(this).css({ 'cursor': 'wait' });1023 $.ajax({1024 url: baseURL + "accounting/customer_print_invoice_pdf",1025 type: "POST",1026 dataType: "json",1027 data: {1028 invoice_id: $(this).attr("data-invoice-id"),1029 invoice_no: $(this).attr("data-invoice-no")1030 },1031 success: function(data) {1032 var win = window.open(data.pdf_link, '_blank');1033 if (win) {1034 win.focus();1035 } else {1036 console.log('Please allow popups for this website');1037 }1038 $("body").css({ 'cursor': 'default' });1039 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td .print-invoice-btn").css({ 'cursor': 'default' });1040 },1041 });1042});1043$(document).on("click", "#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td .print-invoice-packaging-slip-btn", function(event) {1044 print_invoice_packaging(this);1045});1046function print_invoice_packaging(element) {1047 $("body").css({ 'cursor': 'wait' });1048 $(element).css({ 'cursor': 'wait' });1049 $.ajax({1050 url: baseURL + "accounting/print_invoice_packaging_slip",1051 type: "POST",1052 dataType: "json",1053 data: {1054 invoice_id: $(element).attr("data-invoice-id"),1055 invoice_no: $(element).attr("data-invoice-no")1056 },1057 success: function(data) {1058 $(element).css({ 'cursor': 'pointer' });1059 var win = window.open(data.pdf_link, '_blank');1060 if (win) {1061 win.focus();1062 } else {1063 console.log('Please allow popups for this website');1064 }1065 $("body").css({ 'cursor': 'default' });1066 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td .print-invoice-packaging-slip-btn").css({ 'cursor': 'default' });1067 },1068 });1069}1070function single_customer_sortTable() {1071 var table, rows, switching, i, x, y, shouldSwitch;1072 table = document.getElementById("single_customer_table");1073 switching = true;1074 while (switching) {1075 switching = false;1076 rows = table.rows;1077 for (i = 1; i < (rows.length - 1); i++) {1078 shouldSwitch = false;1079 x = rows[i].getElementsByTagName("TD")[1];1080 y = rows[i + 1].getElementsByTagName("TD")[1];1081 if (x.innerHTML.toLowerCase() < y.innerHTML.toLowerCase()) {1082 shouldSwitch = true;1083 break;1084 }1085 }1086 if (shouldSwitch) {1087 rows[i].parentNode.insertBefore(rows[i + 1], rows[i]);1088 switching = true;1089 }1090 }1091}1092$(document).on("click", "#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td .copy-invoice-btn", function(event) {1093 $("#create_invoice_modal").modal('toggle');1094 $("#loader-modal").show();1095 $.ajax({1096 type: 'POST',1097 dataType: "json",1098 url: baseURL + "accounting/ajax_get_invoice_info",1099 data: { invoice_id: $(this).attr("data-invoice-id") },1100 success: function(data) {1101 var items_html = "<tr>" + $("#create_invoice_modal .items-section table tbody tr:first-child").html() + "</tr>";1102 console.log(data.invoice_items.length);1103 for (var i = 0; i < data.invoice_items.length - 1; i++) {1104 items_html += "<tr>" + $("#create_invoice_modal .items-section table tbody tr:first-child").html() + "</tr>";1105 }1106 $("#create_invoice_modal .items-section table tbody").html(items_html);1107 for (var i = 0; i < data.invoice_items.length; i++) {1108 $("#create_invoice_modal .items-section table tbody input[name='items[]']").eq(i).val(data.invoice_items[i]["title"]);1109 $("#create_invoice_modal .items-section table tbody input[name='itemid[]']").eq(i).val(data.invoice_items[i]["items_id"]);1110 $("#create_invoice_modal .items-section table tbody input[name='item_type[]']").eq(i).val(data.invoice_items[i]["item_type"]);1111 $("#create_invoice_modal .items-section table tbody input[name='quantity[]']").eq(i).val(data.invoice_items[i]["qty"]);1112 var cost = 0;1113 if (data.invoice_items[i]["iCost"] != null) {1114 cost = data.invoice_items[i]["iCost"];1115 }1116 $("#create_invoice_modal .items-section table tbody input[name='price[]']").eq(i).val(cost);1117 $("#create_invoice_modal .items-section table tbody input[name='tax[]']").eq(i).val(data.invoice_items[i]["tax"]);1118 $("#create_invoice_modal .items-section table tbody input[name='discount[]']").eq(i).val("0.00");1119 $("#create_invoice_modal .items-section table tbody input[name='tax_percent[]']").eq(i).val(data.invoice_items[i]["tax"] / (data.invoice_items[i]["qty"] * data.invoice_items[i]["iCost"]));1120 $("#create_invoice_modal form .item-totals input[name='adjustment_name']").val(data.invoice_details["adjustment_name"]);1121 $("#create_invoice_modal form .item-totals input[name='adjustment_value']").val(data.invoice_details["adjustment_value"]);1122 $("#create_invoice_modal form input[name='invoice_job_location']").val(data.invoice_details["job_location"]);1123 $("#create_invoice_modal form input[name='job_name']").val(data.invoice_details["job_name"]);1124 $("#create_invoice_modal form select[name='terms']").val(data.invoice_details["terms"]);1125 $("#create_invoice_modal form input[name='customer_email']").val(data.customer_info["acs_email"]);1126 $("#create_invoice_modal form select[name='customer_id']").val(data.customer_info["prof_id"]);1127 $("#create_invoice_modal form input[name='location_scale']").val(data.invoice_details["location_scale"]);1128 $("#create_invoice_modal form input[name='tags']").val(data.invoice_details["tags"]);1129 $("#create_invoice_modal form input[name='work_order_number']").val(data.invoice_details["work_order_number"]);1130 $("#create_invoice_modal form input[name='purchase_order']").val(data.invoice_details["purchase_order"]);1131 $("#create_invoice_modal form input[name='invoice_number']").val(data.invoice_details["invoice_number"]);1132 $("#create_invoice_modal form input[name='date_issued']").val(data.invoice_details["date_issued"]);1133 $("#create_invoice_modal form input[name='online_payments']").val(data.invoice_details["online_payments"]);1134 $("#create_invoice_modal form textarea[name='billing_address']").html(data.invoice_details["billing_address"]);1135 $("#create_invoice_modal form textarea[name='shipping_to_address']").html(data.invoice_details["shipping_to_address"]);1136 $("#create_invoice_modal form input[name='ship_via']").val(data.invoice_details["ship_via"]);1137 $("#create_invoice_modal form input[name='shipping_date']").val(data.invoice_details["shipping_date"]);1138 $("#create_invoice_modal form input[name='tracking_number']").val(data.invoice_details["tracking_number"]);1139 $("#create_invoice_modal form input[name='due_date']").val(data.invoice_details["due_date"]);1140 $("#create_invoice_modal form textarea[name='message_to_customer']").html(data.invoice_details["message_to_customer"]);1141 $("#create_invoice_modal form textarea[name='terms_and_conditions']").html(data.invoice_details["terms_and_conditions"]);1142 $("#create_invoice_modal form input[name='status']").val(data.invoice_details["status"]);1143 $("#create_invoice_modal form input[name='deposit_request_type']").val(data.invoice_details["deposit_request_type"]);1144 $("#create_invoice_modal form input[name='deposit_amount']").val(data.invoice_details["deposit_request"]);1145 }1146 table_items_input_changed_auto();1147 $("#loader-modal").hide();1148 },1149 });1150});1151function table_items_input_changed_auto() {1152 $("#create_invoice_modal .items-section table tbody input[name='items[]']").map(function() {1153 var qty = $(this).parent("td").parent("tr").find("input[name='quantity[]']").val();1154 var price = $(this).parent("td").parent("tr").find("input[name='price[]']").val();1155 var discount = $(this).parent("td").parent("tr").find("input[name='discount[]']").val();1156 var tax = $(this).parent("td").parent("tr").find("input.tax-hide").val();1157 var total = ((qty * price) + ((qty * price) * (tax / 100))) - discount;1158 $(this).parent("td").parent("tr").find("input[name='tax[]']").val(Number((qty * price) * (tax / 100)).toLocaleString('en'));1159 $(this).parent("td").parent("tr").find(".total_per_item").html(Number(total).toLocaleString('en'));1160 });1161 create_invoice_modal_compute_grand_total();1162}1163function print_by_batch(action = "") {1164 var php_function = "";1165 if (action == "packaging_slip") {1166 php_function = "generate_customer_invoice_packaging_slip_by_batch";1167 } else if (action == "transactions") {1168 php_function = "print_transactions_by_batch";1169 }1170 var invoice_ids = new Array();1171 var customer_id = $("#customer-single-modal input[name='customer_id']").val();1172 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td input[type='checkbox']").each(function() {1173 if ($(this).is(":checked")) {1174 if ($(this).attr("data-row-type") == "Invoice") {1175 invoice_ids.push($(this).attr("data-invoice-id"));1176 }1177 }1178 });1179 $("#loader-modal").show();1180 $.ajax({1181 url: baseURL + "accounting/" + php_function,1182 type: "POST",1183 dataType: "json",1184 data: {1185 customer_id: customer_id,1186 invoice_ids: invoice_ids,1187 },1188 success: function(data) {1189 var win = window.open(data.pdf_link, '_blank');1190 if (win) {1191 win.focus();1192 } else {1193 alert('Please allow popups for this website');1194 }1195 $("#loader-modal").hide();1196 },1197 });1198}1199$(document).on("click", "#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td .void-invoice-btn", function(event) {1200});1201function void_invoice(element, action_from = "") {1202 Swal.fire({1203 title: "Void Invoice?",1204 html: "Are you sure you want to void this invoice? This invoice is linked to other transactions",1205 imageUrl: baseURL + "assets/img/accounting/customers/cancellation.png",1206 showCancelButton: true,1207 confirmButtonColor: "#2ca01c",1208 cancelButtonColor: "#d33",1209 confirmButtonText: "Yes, I want to voide this invoice!",1210 }).then((result) => {1211 if (result.value) {1212 $("body").css({ 'cursor': 'wait' });1213 $(element).css({ 'cursor': 'wait' });1214 $.ajax({1215 type: 'POST',1216 url: baseURL + "invoice/void_invoice",1217 data: { id: $(element).attr("data-invoice-id") },1218 success: function(result) {1219 $("body").css({ 'cursor': 'default' });1220 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td .void-invoice-btn").css({ 'cursor': 'default' });1221 if (result) {1222 Swal.fire({1223 showConfirmButton: false,1224 timer: 2000,1225 title: "Success",1226 html: "Invoice has been voided.",1227 icon: "success",1228 });1229 if (action_from == "single_customer_page") {1230 single_customer_page_get_all_customers($("#customer-single-modal input[name='customer_id']").val());1231 } else if (action_from == "invoice_page") {1232 invoices_filter_changed();1233 $("div#invoice-viewer-modal").fadeOut();1234 }1235 }1236 },1237 });1238 }1239 });1240}1241$(document).on("click", "#customer-single-modal .seaction-above-table ul.by-batch-btn li.print-packaging-slip-btn", function(event) {1242 if (!$(this).hasClass("disabled")) {1243 print_by_batch("packaging_slip");1244 }1245});1246$(document).on("click", "#customer-single-modal .seaction-above-table ul.by-batch-btn li.print-transaction-btn", function(event) {1247 if (!$(this).hasClass("disabled")) {1248 print_by_batch("transactions");1249 }1250});1251$(document).on("click", "#customer-single-modal .seaction-above-table ul.by-batch-btn li.send-transaction-btn", function(event) {1252 if (!$(this).hasClass("disabled")) {1253 event.preventDefault();1254 $("body").css({ 'cursor': 'wait' });1255 var invoice_ids = new Array();1256 var customer_id = $("#customer-single-modal input[name='customer_id']").val();1257 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td input[type='checkbox']").each(function() {1258 if ($(this).is(":checked")) {1259 if ($(this).attr("data-row-type") == "Invoice") {1260 invoice_ids.push($(this).attr("data-invoice-id"));1261 }1262 }1263 });1264 $.ajax({1265 url: baseURL + "accounting/send_transaction",1266 type: "POST",1267 dataType: "json",1268 data: {1269 customer_id: customer_id,1270 invoice_ids: invoice_ids,1271 },1272 success: function(data) {1273 $("body").css({ 'cursor': 'default' });1274 if (data.status == "success") {1275 Swal.fire({1276 showConfirmButton: false,1277 timer: 2000,1278 title: "Success",1279 html: "Transactions has been sent!",1280 icon: "success",1281 });1282 }1283 },1284 error: function(XMLHttpRequest, textStatus, errorThrown) {1285 $("body").css({ 'cursor': 'default' });1286 Swal.fire({1287 showConfirmButton: false,1288 timer: 2000,1289 title: "Error",1290 html: "Something went wrong.",1291 icon: "error",1292 });1293 }1294 });1295 }1296});1297$(document).on("click", "#customer-single-modal .seaction-above-table ul.by-batch-btn li.send-reminder-btn", function(event) {1298 var open_inv = 0;1299 if (!$(this).hasClass("disabled")) {1300 var invoice_numbers = "";1301 var customer_id = $("#customer-single-modal input[name='customer_id']").val();1302 $("#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td input[type='checkbox']").each(function() {1303 if ($(this).is(":checked")) {1304 if ($(this).attr("data-row-status") == "Overdue" || $(this).attr("data-row-status") == "Open") {1305 invoice_numbers += ($(this).attr("data-invoice-number")) + ", ";1306 open_inv++;1307 }1308 }1309 });1310 $("body").css({ 'cursor': 'wait' });1311 $.ajax({1312 url: baseURL + "accounting/get_customer_info",1313 type: "POST",1314 dataType: "json",1315 data: {1316 customer_id: customer_id,1317 },1318 success: function(data) {1319 $("body").css({ 'cursor': 'default' });1320 $("#send-reminder-modal .form-group input[name='subject']").val(`Reminder: Invoices from ` + data.business_name);1321 var message = `Dear ` + data.customer_name + `,1322Just a reminder that we have not received a payment for the following invoices. 1323` + invoice_numbers + `1324Let us know if you have questions.1325 1326Thanks for your business!1327` + data.business_name;1328 $("#send-reminder-modal .form-group textarea").html(message);1329 $("#send-reminder-modal").addClass("show");1330 $("#send-reminder-modal .modal-title .normal .invoice-count").html(open_inv);1331 },1332 error: function(XMLHttpRequest, textStatus, errorThrown) {1333 $("body").css({ 'cursor': 'default' });1334 Swal.fire({1335 showConfirmButton: false,1336 timer: 2000,1337 title: "Error",1338 html: "Something went wrong.",1339 icon: "error",1340 });1341 }1342 });1343 }1344});1345$(document).on("click", "#customer-single-modal #single_customer_table .print-statement-btn ", function(event) {1346 window.open(baseURL + "assets/pdf/" + $(this).attr("type") + "_" + $(this).attr("data-statement-id") + ".pdf");1347});1348$(document).on("click", "#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td ul li.send-invoice-btn", function(event) {1349 send_single_invoice(this);1350});1351function send_single_invoice(element) {1352 Swal.fire({1353 title: "Send Invoice?",1354 html: "Are you sure you want to send this invoice?",1355 showCancelButton: true,1356 imageUrl: baseURL + "/assets/img/accounting/customers/message.png",1357 cancelButtonColor: "#d33",1358 confirmButtonColor: "#2ca01c",1359 confirmButtonText: "Send now",1360 }).then((result) => {1361 if (result.value) {1362 $.ajax({1363 url: baseURL + "invoice-page/send-batch",1364 type: "POST",1365 dataType: "json",1366 data: {1367 invoice_id: $(element).attr("data-invoice-id"),1368 action: "single-invoice"1369 },1370 success: function(data) {1371 if (data.status == "success") {1372 Swal.fire({1373 showConfirmButton: false,1374 timer: 2000,1375 title: "Success",1376 html: "Invoices are sent.",1377 icon: "success",1378 });1379 } else {1380 Swal.fire({1381 showConfirmButton: false,1382 timer: 2000,1383 title: "Error",1384 html: "Unable to send invoice.",1385 icon: "error",1386 });1387 }1388 $("#loader-modal").hide();1389 },1390 });1391 }1392 });1393}1394$(document).on('click', '#customer-single-modal .single-customer-info-section .body-section .tab-body-content-section .transaction-list-table table td', function() {1395 if (!$(this).is(':last-child') && !$(this).is(':first-child') && $(this).parent("tr").attr("data-transaction") == "Invoice") {1396 $("div#invoice-viewer-modal").fadeIn();1397 $("div#invoice-viewer-modal .the-modal-body.right-side-modal>.the-title .invoice-number").html($(this).parent("tr").attr("data-invoice-number"));1398 $("div#invoice-viewer-modal .the-modal-body.right-side-modal .total-amount-section .amount").html($(this).parent("tr").attr("data-grand-total"));1399 $("div#invoice-viewer-modal .the-modal-body.right-side-modal .invoice-info.invoice-date .date").html($(this).parent("tr").attr("data-date"));1400 $("div#invoice-viewer-modal .the-modal-body.right-side-modal .invoice-info.due-date .date").html($(this).parent("tr").attr("data-due-date"));1401 $("div#invoice-viewer-modal .the-modal-body.right-side-modal .status-text").html($(this).parent("tr").attr("data-status"));1402 if ($(this).parent("tr").attr("data-status") == "Paid") {1403 $("div#invoice-viewer-modal .the-modal-body.right-side-modal .status-icon").removeClass("pending");1404 $("div#invoice-viewer-modal .the-modal-body.right-side-modal .status-icon").addClass("success");1405 $("div#invoice-viewer-modal .the-modal-body.right-side-modal .status-icon i").attr("class", "fa fa-check-circle");1406 } else {1407 $("div#invoice-viewer-modal .the-modal-body.right-side-modal .status-icon").removeClass("success");1408 $("div#invoice-viewer-modal .the-modal-body.right-side-modal .status-icon").addClass("pending");1409 $("div#invoice-viewer-modal .the-modal-body.right-side-modal .status-icon i").attr("class", "fa fa-pause-circle");1410 }1411 invoice_viewer_changed($(this).parent("tr").attr("data-id"), $(this).parent("tr").attr("data-customer-id"));1412 } else if (!$(this).is(':last-child') && !$(this).is(':first-child') && $(this).parent("tr").attr("data-transaction") == "Payment") {1413 $("#customer_receive_payment_modal").fadeIn();1414 var customer_id = $(this).parent("tr").attr("data-customer-id");1415 var receive_payment_id = $(this).parent("tr").attr("data-receive-payment-id");1416 var invoice_id = $(this).parent("tr").attr("data-id");1417 $("#customer_receive_payment_modal #receive_payment_form select[name='customer_id']").val(customer_id);1418 $('#new-popup').modal('hide');1419 $("#loader-modal").show();1420 get_receive_payment(customer_id, receive_payment_id, invoice_id);1421 }1422});1423$(document).on("click", "#customer-single-modal .customer-details-section .attachement-file-section button.attachment-btn", function(event) {1424 // $(this).preventDefault();1425 $("#customer-single-modal .customer-details-section input[name='attachment-file']").trigger('click');1426});1427$(document).on("click", "#customer-single-modal .customer-details-section .attachement-file-section .attachement-viewer .delete", function(event) {1428 var file_name = $(this).parent("div").attr("data-file-name");1429 Swal.fire({1430 title: "Delete?",1431 showCancelButton: true,1432 imageUrl: $(this).parent("div").children("img").attr("src"),1433 cancelButtonColor: "#d33",1434 confirmButtonColor: "#2ca01c",1435 confirmButtonText: "Delete",1436 }).then((result) => {1437 if (result.value) {1438 $(this).parent("div").remove();1439 $.ajax({1440 url: baseURL + "/accounting/delete_customer_info_attachement",1441 type: "POST",1442 dataType: "json",1443 data: {1444 filename: file_name,1445 customer_id: $("#customer-single-modal input[name='customer_id']").val()1446 },1447 success: function(data) {1448 Swal.fire({1449 showConfirmButton: false,1450 timer: 2000,1451 title: "Success",1452 html: "Deleted!",1453 icon: "success",1454 });1455 }1456 });1457 }1458 });1459});1460$(document).on("change", "#customer-single-modal .customer-details-section input[name='attachment-file']", function(event) {;1461 new_customer_info_attachment("#customer-single-modal .customer-details-section", "customer_info");1462});1463function new_customer_info_attachment(target_form) {1464 var formDatas = new FormData();1465 $(target_form + " .attachement-file-section input[name='attachement-filenames']").val("");1466 var ctr = 0;1467 for (var i = 0; i < $(target_form + " input[name='attachment-file']").get(0).files.length; ++i) {1468 formDatas.append('file', $(target_form + " input[name='attachment-file']").get(0).files[i]);1469 formDatas.append('customer_id', $("#customer-single-modal input[name='customer_id']").val());1470 $.ajax({1471 type: "POST",1472 enctype: 'multipart/form-data',1473 url: baseURL + "/accounting/add_customer_info_attachement",1474 dataType: "json",1475 data: formDatas,1476 processData: false,1477 contentType: false,1478 cache: false,1479 beforeSend: function() {1480 ctr = 0;1481 },1482 success: function(data) {1483 var filenmae_val = $(target_form + " .attachement-file-section input[name='attachement-filenames']").val();1484 if (filenmae_val == "") {1485 $(target_form + " .attachement-file-section input[name='attachement-filenames']").val(data.uniquesavename + "." + data.ext);1486 } else {1487 $(target_form + " .attachement-file-section input[name='attachement-filenames']").val(data.uniquesavename + "." + data.ext + "," + filenmae_val);1488 }1489 var viewer_images = $(target_form + ' .attachement-file-section div.attachement-viewer').html();1490 if (data.ext != "jpg" && data.ext != "jpeg" && data.ext != "png" && data.ext != "JPG" && data.ext != "JPEG" && data.ext != "PNG") {1491 viewer_images += '<div class="img-holder" data-file-name="' + data.uniquesavename + "." + data.ext + '"><div class="delete">x</div><img src="' + baseURL + 'assets/img/accounting/customers/document.png" ></div>';1492 } else {1493 viewer_images += '<div class="img-holder" data-file-name="' + data.uniquesavename + "." + data.ext + '"><div class="delete">x</div><img src="' + baseURL + data.destination + '"></div>';1494 }1495 $(target_form + ' .attachement-file-section div.attachement-viewer').html(viewer_images);1496 },1497 error: function(e) {1498 console.log("ERROR : ", e);1499 }1500 });1501 }...
kernel-value-maps.js
Source:kernel-value-maps.js
1const { WebGLKernelValueBoolean } = require('./kernel-value/boolean');2const { WebGLKernelValueFloat } = require('./kernel-value/float');3const { WebGLKernelValueInteger } = require('./kernel-value/integer');4const { WebGLKernelValueHTMLImage } = require('./kernel-value/html-image');5const { WebGLKernelValueDynamicHTMLImage } = require('./kernel-value/dynamic-html-image');6const { WebGLKernelValueHTMLVideo } = require('./kernel-value/html-video');7const { WebGLKernelValueDynamicHTMLVideo } = require('./kernel-value/dynamic-html-video');8const { WebGLKernelValueSingleInput } = require('./kernel-value/single-input');9const { WebGLKernelValueDynamicSingleInput } = require('./kernel-value/dynamic-single-input');10const { WebGLKernelValueUnsignedInput } = require('./kernel-value/unsigned-input');11const { WebGLKernelValueDynamicUnsignedInput } = require('./kernel-value/dynamic-unsigned-input');12const { WebGLKernelValueMemoryOptimizedNumberTexture } = require('./kernel-value/memory-optimized-number-texture');13const { WebGLKernelValueDynamicMemoryOptimizedNumberTexture } = require('./kernel-value/dynamic-memory-optimized-number-texture');14const { WebGLKernelValueNumberTexture } = require('./kernel-value/number-texture');15const { WebGLKernelValueDynamicNumberTexture } = require('./kernel-value/dynamic-number-texture');16const { WebGLKernelValueSingleArray } = require('./kernel-value/single-array');17const { WebGLKernelValueDynamicSingleArray } = require('./kernel-value/dynamic-single-array');18const { WebGLKernelValueSingleArray1DI } = require('./kernel-value/single-array1d-i');19const { WebGLKernelValueDynamicSingleArray1DI } = require('./kernel-value/dynamic-single-array1d-i');20const { WebGLKernelValueSingleArray2DI } = require('./kernel-value/single-array2d-i');21const { WebGLKernelValueDynamicSingleArray2DI } = require('./kernel-value/dynamic-single-array2d-i');22const { WebGLKernelValueSingleArray3DI } = require('./kernel-value/single-array3d-i');23const { WebGLKernelValueDynamicSingleArray3DI } = require('./kernel-value/dynamic-single-array3d-i');24const { WebGLKernelValueSingleArray2 } = require('./kernel-value/single-array2');25const { WebGLKernelValueSingleArray3 } = require('./kernel-value/single-array3');26const { WebGLKernelValueSingleArray4 } = require('./kernel-value/single-array4');27const { WebGLKernelValueUnsignedArray } = require('./kernel-value/unsigned-array');28const { WebGLKernelValueDynamicUnsignedArray } = require('./kernel-value/dynamic-unsigned-array');29const kernelValueMaps = {30 unsigned: {31 dynamic: {32 'Boolean': WebGLKernelValueBoolean,33 'Integer': WebGLKernelValueInteger,34 'Float': WebGLKernelValueFloat,35 'Array': WebGLKernelValueDynamicUnsignedArray,36 'Array(2)': false,37 'Array(3)': false,38 'Array(4)': false,39 'Array1D(2)': false,40 'Array1D(3)': false,41 'Array1D(4)': false,42 'Array2D(2)': false,43 'Array2D(3)': false,44 'Array2D(4)': false,45 'Array3D(2)': false,46 'Array3D(3)': false,47 'Array3D(4)': false,48 'Input': WebGLKernelValueDynamicUnsignedInput,49 'NumberTexture': WebGLKernelValueDynamicNumberTexture,50 'ArrayTexture(1)': WebGLKernelValueDynamicNumberTexture,51 'ArrayTexture(2)': WebGLKernelValueDynamicNumberTexture,52 'ArrayTexture(3)': WebGLKernelValueDynamicNumberTexture,53 'ArrayTexture(4)': WebGLKernelValueDynamicNumberTexture,54 'MemoryOptimizedNumberTexture': WebGLKernelValueDynamicMemoryOptimizedNumberTexture,55 'HTMLCanvas': WebGLKernelValueDynamicHTMLImage,56 'HTMLImage': WebGLKernelValueDynamicHTMLImage,57 'HTMLImageArray': false,58 'HTMLVideo': WebGLKernelValueDynamicHTMLVideo,59 },60 static: {61 'Boolean': WebGLKernelValueBoolean,62 'Float': WebGLKernelValueFloat,63 'Integer': WebGLKernelValueInteger,64 'Array': WebGLKernelValueUnsignedArray,65 'Array(2)': false,66 'Array(3)': false,67 'Array(4)': false,68 'Array1D(2)': false,69 'Array1D(3)': false,70 'Array1D(4)': false,71 'Array2D(2)': false,72 'Array2D(3)': false,73 'Array2D(4)': false,74 'Array3D(2)': false,75 'Array3D(3)': false,76 'Array3D(4)': false,77 'Input': WebGLKernelValueUnsignedInput,78 'NumberTexture': WebGLKernelValueNumberTexture,79 'ArrayTexture(1)': WebGLKernelValueNumberTexture,80 'ArrayTexture(2)': WebGLKernelValueNumberTexture,81 'ArrayTexture(3)': WebGLKernelValueNumberTexture,82 'ArrayTexture(4)': WebGLKernelValueNumberTexture,83 'MemoryOptimizedNumberTexture': WebGLKernelValueMemoryOptimizedNumberTexture,84 'HTMLCanvas': WebGLKernelValueHTMLImage,85 'HTMLImage': WebGLKernelValueHTMLImage,86 'HTMLImageArray': false,87 'HTMLVideo': WebGLKernelValueHTMLVideo,88 }89 },90 single: {91 dynamic: {92 'Boolean': WebGLKernelValueBoolean,93 'Integer': WebGLKernelValueInteger,94 'Float': WebGLKernelValueFloat,95 'Array': WebGLKernelValueDynamicSingleArray,96 'Array(2)': WebGLKernelValueSingleArray2,97 'Array(3)': WebGLKernelValueSingleArray3,98 'Array(4)': WebGLKernelValueSingleArray4,99 'Array1D(2)': WebGLKernelValueDynamicSingleArray1DI,100 'Array1D(3)': WebGLKernelValueDynamicSingleArray1DI,101 'Array1D(4)': WebGLKernelValueDynamicSingleArray1DI,102 'Array2D(2)': WebGLKernelValueDynamicSingleArray2DI,103 'Array2D(3)': WebGLKernelValueDynamicSingleArray2DI,104 'Array2D(4)': WebGLKernelValueDynamicSingleArray2DI,105 'Array3D(2)': WebGLKernelValueDynamicSingleArray3DI,106 'Array3D(3)': WebGLKernelValueDynamicSingleArray3DI,107 'Array3D(4)': WebGLKernelValueDynamicSingleArray3DI,108 'Input': WebGLKernelValueDynamicSingleInput,109 'NumberTexture': WebGLKernelValueDynamicNumberTexture,110 'ArrayTexture(1)': WebGLKernelValueDynamicNumberTexture,111 'ArrayTexture(2)': WebGLKernelValueDynamicNumberTexture,112 'ArrayTexture(3)': WebGLKernelValueDynamicNumberTexture,113 'ArrayTexture(4)': WebGLKernelValueDynamicNumberTexture,114 'MemoryOptimizedNumberTexture': WebGLKernelValueDynamicMemoryOptimizedNumberTexture,115 'HTMLCanvas': WebGLKernelValueDynamicHTMLImage,116 'HTMLImage': WebGLKernelValueDynamicHTMLImage,117 'HTMLImageArray': false,118 'HTMLVideo': WebGLKernelValueDynamicHTMLVideo,119 },120 static: {121 'Boolean': WebGLKernelValueBoolean,122 'Float': WebGLKernelValueFloat,123 'Integer': WebGLKernelValueInteger,124 'Array': WebGLKernelValueSingleArray,125 'Array(2)': WebGLKernelValueSingleArray2,126 'Array(3)': WebGLKernelValueSingleArray3,127 'Array(4)': WebGLKernelValueSingleArray4,128 'Array1D(2)': WebGLKernelValueSingleArray1DI,129 'Array1D(3)': WebGLKernelValueSingleArray1DI,130 'Array1D(4)': WebGLKernelValueSingleArray1DI,131 'Array2D(2)': WebGLKernelValueSingleArray2DI,132 'Array2D(3)': WebGLKernelValueSingleArray2DI,133 'Array2D(4)': WebGLKernelValueSingleArray2DI,134 'Array3D(2)': WebGLKernelValueSingleArray3DI,135 'Array3D(3)': WebGLKernelValueSingleArray3DI,136 'Array3D(4)': WebGLKernelValueSingleArray3DI,137 'Input': WebGLKernelValueSingleInput,138 'NumberTexture': WebGLKernelValueNumberTexture,139 'ArrayTexture(1)': WebGLKernelValueNumberTexture,140 'ArrayTexture(2)': WebGLKernelValueNumberTexture,141 'ArrayTexture(3)': WebGLKernelValueNumberTexture,142 'ArrayTexture(4)': WebGLKernelValueNumberTexture,143 'MemoryOptimizedNumberTexture': WebGLKernelValueMemoryOptimizedNumberTexture,144 'HTMLCanvas': WebGLKernelValueHTMLImage,145 'HTMLImage': WebGLKernelValueHTMLImage,146 'HTMLImageArray': false,147 'HTMLVideo': WebGLKernelValueHTMLVideo,148 }149 },150};151function lookupKernelValueType(type, dynamic, precision, value) {152 if (!type) {153 throw new Error('type missing');154 }155 if (!dynamic) {156 throw new Error('dynamic missing');157 }158 if (!precision) {159 throw new Error('precision missing');160 }161 if (value.type) {162 type = value.type;163 }164 const types = kernelValueMaps[precision][dynamic];165 if (types[type] === false) {166 return null;167 } else if (types[type] === undefined) {168 throw new Error(`Could not find a KernelValue for ${ type }`);169 }170 return types[type];171}172module.exports = {173 lookupKernelValueType,174 kernelValueMaps,...
my-select-tree-single.component.ts
Source:my-select-tree-single.component.ts
1import { Component, OnInit, Input, Output, EventEmitter } from "@angular/core";2declare let $;3declare let layui;4@Component({5 selector: "ngx-my-select-tree-single",6 templateUrl: "./my-select-tree-single.component.html",7 styleUrls: ["./my-select-tree-single.component.scss"],8})9export class MySelectTreeSingleComponent implements OnInit {10 @Output() private inpuvalue = new EventEmitter<any>();11 @Input("placeholder") placeholder: any;12 // ä¸æ icon13 xialaicon = "arrow-ios-downward-outline";14 placeholder_title;15 // el516 single_tree_el5s;17 constructor() {}18 ngOnInit(): void {}19 ngAfterViewInit() {20 this.placeholder_title = this.placeholder;21 $("[name='single_tree_title']").attr("placeholder", this.placeholder_title);22 // $(".tree_isShow").hide();23 }24 ngOnDestroy() {25 this.dropselect();26 }27 tree_data; // æ ç»ææ°æ®28 // ä¸ææ 示ä¾29 init_select_tree(data) {30 var that = this;31 that.tree_data = data;32 var single_tree_el5s;33 layui.use(["eleTree"], function () {34 var eleTree = layui.eleTree;35 $("[name='single_tree_title']").on("click", function (e) {36 // if (that.xialaicon === "arrow-ios-upward-outline") {37 // that.xialaicon = "arrow-ios-downward-outline";38 // } else {39 // that.xialaicon = "arrow-ios-upward-outline";40 // }41 e.stopPropagation();42 if (!single_tree_el5s) {43 single_tree_el5s = eleTree.render({44 elem: ".single_tree_ele5",45 data: data,46 defaultExpandAll: false,47 showCheckbox: false,48 expandOnClickNode: false,49 highlightCurrent: true,50 // defaultCheckedKeys: [], // é»è®¤å¾é51 // defaultCheckedKeys: that.defaultCheckedKeys, // é»è®¤å¾é52 checkOnClickNode: true, // ç¹å»èç¹æ¶éä¸èç¹ï¼53 });54 that.single_tree_el5s = single_tree_el5s;55 }56 $(".single_tree_ele5").toggle();57 that.toggle();58 that.other_toggle();59 });60 // èç¹è¢«éæ©61 // var select_data = that.select_data; //[{id: 3, label: "nvh"},]62 // var select_label_list = that.select_label_list;63 eleTree.on("nodeClick(single_tree_data5)", function (d) {64 // console.error("select_data",d.data.currentData)65 $("[name='single_tree_title']").val(d.data.currentData.label);66 that.inpuvalue.emit(d.data.currentData.label);67 $(".single_tree_ele5").hide();68 // that.xialaicon = "arrow-ios-downward-outline";69 that.toggle();70 });71 $(document).on("click", function () {72 $(".single_tree_ele5").hide();73 // that.xialaicon = "arrow-ios-downward-outline";74 that.toggle();75 });76 });77 }78 // i å¾æ class åæ¢79 toggle() {80 var single_tree_ele5 = $(".single_tree_ele5").css("display");81 if (single_tree_ele5 == "none") {82 $("#single_tree_ele5_i").attr(83 "class",84 "layui-icon layui-icon-down single_tree_xiala"85 );86 } else {87 $("#single_tree_ele5_i").attr(88 "class",89 "layui-icon layui-icon-up single_tree_xiala"90 );91 }92 }93 // å
¶å®çä¸æ94 other_toggle() {95 // ç§å®¤ä¸ææ¡96 $(".ele5").hide();97 $(".eletype").hide();98 $(".single_ele5").hide();99 var ele5 = $(".ele5").css("display");100 if (ele5 == "none") {101 $("#ele5_i").attr("class", "layui-icon layui-icon-down xiala");102 } else {103 $("#ele5_i").attr("class", "layui-icon layui-icon-up xiala");104 }105 // 设å¤ç»è®¡ä¸ææ¡106 var eletype = $(".eletype").css("display");107 if (eletype == "none") {108 $("#eletype_i").attr("class", "layui-icon layui-icon-down xiala");109 } else {110 $("#eletype_i").attr("class", "layui-icon layui-icon-up xiala");111 }112 // æä¸æ113 var single_ele5 = $(".single_ele5").css("display");114 if (single_ele5 == "none") {115 $("#single_ele5_i").attr(116 "class",117 "layui-icon layui-icon-down single_xiala"118 );119 } else {120 $("#single_ele5_i").attr(121 "class",122 "layui-icon layui-icon-up single_xiala"123 );124 }125 // æ¥æéæ©å¨126 $(".layui-laydate").remove();127 }128 getselect() {129 return $("[name='single_tree_title']").val();130 }131 // å é¤éæ©ç132 delselect() {133 var department_list = [134 { id: 1, label: "éªè¯ä¸å¿" },135 { id: 2, label: "å·¥ç¨ä¸å¿" },136 ];137 $("[name='single_tree_title']").val(department_list[0]["label"]);138 // $("[name='single_tree_title']").val("");139 }140 // 设å¤å·¥æ¶æç»--ç¶æææ 141 delselect2() {142 var statusdata = [143 { id: "running", label: "è¿è¡" },144 { id: "stop", label: "空é²" },145 { id: "warning", label: "ç»´ä¿®" },146 { id: "placeon", label: "å ä½" },147 ];148 // $("[name='single_tree_title']").val(statusdata[0]["label"]);149 $("[name='single_tree_title']").val("");150 this.single_tree_el5s?.reload({ data: this.tree_data }); // éæ°å è½½æ 151 }152 // æ¸
空ä¸ææ°æ®153 dropselect() {154 this.delselect();155 // console.log("æ¸
空ä¸ææ°æ®",$("[name='single_tree_title']").val());156 var select = this.single_tree_el5s?.getChecked();157 this.single_tree_el5s?.reload({ data: this.tree_data }); // éæ°å è½½æ 158 // this.single_tree_el5s?.unCheckNodes() //åæ¶ææéä¸çèç¹159 }160 // 设置éæ©çæ°æ®161 setselect(data) {162 $("[name='single_tree_title']").val(data);163 }...
SingleHome.js
Source:SingleHome.js
1import React, { useEffect } from 'react';2import ImageGallery from 'react-image-gallery';3import { Link } from 'react-router-dom';4import numeral from 'numeral';5import { connect } from 'react-redux';6import {7 fetchSingleHome,8 deleteHome,9 setLoading10} from '../../actions/homeActions';11import Loader from '../utils/Loader';12import './single-home.scss';13import './image-gallery.scss';14const SingleHome = props => {15 useEffect(() => {16 //props.setLoading();17 props.fetchSingleHome(props.match.params.id);18 // eslint-disable-next-line19 }, []);20 if (props.current) {21 const {22 _id,23 images,24 title,25 rooms,26 area,27 price,28 location,29 date,30 built,31 floor,32 owner,33 description34 } = props.current;35 const dateDisplay = date.slice(0, 10);36 const priceDisplay = numeral(price)37 .format('0,0,0')38 .replace(',', ' ');39 const galleryItems = images.map(image => {40 const item = {41 original: image,42 thumbnail: image43 };44 return item;45 });46 // if (props.loading) {47 // return <Loader />;48 // }49 return (50 <div className="single">51 <ImageGallery items={galleryItems} showFullscreenButton={false} />52 <div className="single__details">53 <h2 className="single__title">{title}</h2>54 <p className="single__price">{priceDisplay} PLN</p>55 <div className="single__parameters">56 <h3 className="single__sub-heading">Offer details</h3>57 <p className="single__area">58 <i className="lni-grid"></i> Area: {area} m <sup>2</sup>59 </p>60 <p className="single__rooms">61 <i className="lni-home"></i> Rooms: {rooms}62 </p>63 <p className="single__built">64 <i className="lni-brick"></i> Built in: {built}65 </p>66 <p className="single__floor">67 <i className="lni-layers"></i> Floor: {floor}68 </p>69 </div>70 <div className="single__location">71 <h3 className="single__sub-heading">Location</h3>72 <p className="single__country">73 <i className="lni-flag"></i> Country: {location.country}74 </p>75 <p className="single__city">76 <i className="lni-map"></i> City: {location.city}77 </p>78 <p className="single__street">79 {' '}80 <i className="lni-map-marker"></i> Street: {location.street}81 </p>82 </div>83 <div className="single__owner">84 <h3 className="single__sub-heading">Contact to this offer: </h3>85 <p className="single__owner-name">86 <i className="lni-emoji-smile"></i> Owner: {owner.name}87 </p>88 <p className="single__owner-phone">89 {' '}90 <i className="lni-phone-handset"></i> Phone: {owner.phone}91 </p>92 <div className="single__owner-email">93 {' '}94 <i className="lni-envelope"></i> email: {owner.email}95 </div>96 </div>97 <p className="single__description">98 <span className="single__sub-heading">Description: </span>99 {description}100 </p>101 <p className="single__date">Added: {dateDisplay}</p>102 {owner.id !== props.currentUserId ? null : (103 <>104 <button105 onClick={() => props.deleteHome(_id)}106 className="single__btn single__btn--delete"107 >108 Delete109 </button>110 <Link to="/update" className="single__btn single__btn--update">111 Update112 </Link>113 </>114 )}115 <a className="single__goback" onClick={() => props.history.goBack()}>116 <i className="lni-angle-double-left"></i> Back to results117 </a>118 </div>119 </div>120 );121 } else return <div>Loading...</div>;122};123const mapStateToProps = state => {124 return {125 current: state.homes.currentHome,126 // loading: state.homes.loading,127 currentUserId: state.user.id128 };129};130export default connect(mapStateToProps, {131 fetchSingleHome,132 deleteHome,133 setLoading...
singleCreator.js
Source:singleCreator.js
1/**2 * Single coordinate system creator.3 */4define(function (require) {5 var Single = require('./Single');6 /**7 * Create single coordinate system and inject it into seriesModel.8 *9 * @param {module:echarts/model/Global} ecModel10 * @param {module:echarts/ExtensionAPI} api11 * @return {Array.<module:echarts/coord/single/Single>}12 */13 function create(ecModel, api) {14 var singles = [];15 ecModel.eachComponent('singleAxis', function(axisModel, idx) {16 var single = new Single(axisModel, ecModel, api);17 single.name = 'single_' + idx;18 single.resize(axisModel, api);19 axisModel.coordinateSystem = single;20 singles.push(single);21 });22 ecModel.eachSeries(function (seriesModel) {23 if (seriesModel.get('coordinateSystem') === 'singleAxis') {24 var singleAxisModel = ecModel.queryComponents({25 mainType: 'singleAxis',26 index: seriesModel.get('singleAxisIndex'),27 id: seriesModel.get('singleAxisId')28 })[0];29 seriesModel.coordinateSystem = singleAxisModel.coordinateSystem;30 }31 });32 return singles;33 }34 require('../../CoordinateSystem').register('single', {35 create: create,36 dimensions: Single.prototype.dimensions37 });...
Using AI Code Generation
1const fc = require('fast-check');2fc.check(fc.property(fc.integer(), fc.integer(), (a, b) => a + b >= a));3const fc = require('fast-check');4fc.check(fc.property(fc.integer(), fc.integer(), (a, b) => a + b >= a));5const fc = require('fast-check');6fc.check(fc.property(fc.integer(), fc.integer(), (a, b) => a + b >= a));7const fc = require('fast-check');8fc.check(fc.property(fc.integer(), fc.integer(), (a, b) => a + b >= a));9const fc = require('fast-check');10fc.check(fc.property(fc.integer(), fc.integer(), (a, b) => a + b >= a));11const fc = require('fast-check');12fc.check(fc.property(fc.integer(), fc.integer(), (a, b) => a + b >= a));13const fc = require('fast-check');14fc.check(fc.property(fc.integer(), fc.integer(), (a, b) => a + b >= a));15const fc = require('fast-check');16fc.check(fc.property(fc.integer(), fc.integer(), (a, b) => a + b >= a));17const fc = require('fast-check');18fc.check(fc.property(fc.integer(), fc.integer(), (a, b) => a + b >= a));19const fc = require('fast-check');20fc.check(fc.property(fc.integer(), fc.integer(), (a, b) => a + b >= a));
Using AI Code Generation
1const fc = require('@dubzzz/fast-check');2fc.assert(3 fc.property(fc.integer(), fc.integer(), (a, b) => a + b === b + a)4);5const fc = require('@dubzzz/fast-check');6fc.assert(7 fc.property(fc.integer(), fc.integer(), (a, b) => a + b === b + a)8);9const fc = require('@dubzzz/fast-check');10fc.assert(11 fc.property(fc.integer(), fc.integer(), (a, b) => a + b === b + a)12);13const fc = require('@dubzzz/fast-check');14fc.assert(15 fc.property(fc.integer(), fc.integer(), (a, b) => a + b === b + a)16);17const fc = require('@dubzzz/fast-check');18fc.assert(19 fc.property(fc.integer(), fc.integer(), (a, b) => a + b === b + a)20);21const fc = require('@dubzzz/fast-check');22fc.assert(23 fc.property(fc.integer(), fc.integer(), (a, b) => a + b === b + a)24);25const fc = require('@dubzzz/fast-check');26fc.assert(27 fc.property(fc.integer(), fc.integer(), (a, b) => a + b === b + a)28);29const fc = require('@dubzzz/fast-check');30fc.assert(31 fc.property(fc.integer(), fc.integer(), (a, b) => a + b === b + a)32);33const fc = require('@dubzzz/fast-check');34fc.assert(35 fc.property(fc.integer(), fc.integer(), (a
Using AI Code Generation
1const {fc} = require('fast-check');2fc.assert(fc.property(fc.integer(), fc.integer(), (a, b) => a + b === b + a));3const {fc} = require('fast-check');4const {property, assert} = fc;5assert(property(fc.integer(), fc.integer(), (a, b) => a + b === b + a));6const {fc} = require('fast-check');7const {property, assert} = fc;8assert(property(fc.integer(), fc.integer(), (a, b) => a + b === b + a));
Using AI Code Generation
1import { sample } from 'fast-check';2import { sample, integer } from 'fast-check';3import * as fc from 'fast-check';4import { sample } from 'fast-check/lib/check/arbitrary/Sampler';5import { sample, integer } from 'fast-check/lib/check/arbitrary/Sampler';6import * as fc from 'fast-check/lib/check/arbitrary/Sampler';
Using AI Code Generation
1const fc = require('fast-check');2const { oneof } = fc;3const { fc, oneof } = require('fast-check');4const fc = require('fast-check');5const { oneof } = fc;6const { fc, oneof } = require('fast-check');7const fc = require('fast-check');8const { oneof } = fc;9const { fc, oneof } = require('fast-check');10const fc = require('fast-check');11const { oneof } = fc;12const { fc, oneof } = require('fast-check');13const fc = require('fast-check');14const { oneof } = fc;15const { fc, oneof } = require('fast-check');16const fc = require('fast-check');17const { oneof } = fc;18const { fc, oneof } = require('fast-check');19const fc = require('fast-check');20const { oneof } = fc;21const { fc, oneof } = require('fast-check');22const fc = require('fast-check');23const { oneof } = fc;24const { fc, oneof } = require('fast-check');25const fc = require('fast-check');26const {
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!