<!DOCTYPE html>
<html lang="en">
<head>
<title>Evolution Quotedit</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link href="assets/css/bootstrap-5.2.0-dist/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="themes/default/theme.css" rel="stylesheet" type="text/css">
<link href="assets/css/style.css" rel="stylesheet" type="text/css">
<link href="assets/css/evochip.css" rel="stylesheet" type="text/css">
<style>
/* fallback */
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url(assets/css/material-icons.woff2) format('woff2');
}

.material-icons {
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 24px;
line-height: 1;
letter-spacing: normal;
text-transform: none;
display: inline-block;
white-space: nowrap;
word-wrap: normal;
direction: ltr;
-moz-font-feature-settings: 'liga';
-moz-osx-font-smoothing: grayscale;
}
/* fallback */
@font-face {
font-family: 'Material Symbols Rounded';
font-style: normal;
font-weight: 100 700;
src: url(assets/css/material-symbols-rounded.woff2) format('woff2');
}

.material-symbols-rounded {
font-family: 'Material Symbols Rounded';
font-weight: normal;
font-style: normal;
font-size: 24px;
line-height: 1;
letter-spacing: normal;
text-transform: none;
display: inline-block;
white-space: nowrap;
word-wrap: normal;
direction: ltr;
-moz-font-feature-settings: 'liga';
-moz-osx-font-smoothing: grayscale;
}

/* Hand-drawn counterpart to .material-symbols-rounded above, for fencing
glyphs Material Symbols has no match for (see assets/js/fencingIcons.js).
Same base sizing so both classes behave identically until a more
specific rule (e.g. ".fc-type-icon i") overrides font-size/color. */
.fencing-icons-round {
font-size: 24px;
line-height: 1;
display: inline-block;
vertical-align: middle;
}

</style>
<style> @page { size: auto } </style>

<script>
var homeurl = "https://my.evolutionerp.com.au";
var homepath = "/home/evolution/my.evolutionerp.com.au";
var csrfToken = "8a79a11eaa66cb241cb1f0e6488465a2227728ef8cb95559c62b0fa572416677";
</script>
<!-- JQUERY -->
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="assets/css/bootstrap-5.2.0-dist/js/bootstrap.bundle.min.js"></script>
<script>var manufacturingBinLocationsForStaging = ('' == '1');var manufacturingBinLocationsForStagingBinCheck = ('' == '1');var manufacturingBinLocationsForBranches = 'All';const timesheetTimerAllowMultiple = 'No' == 'Yes';const tsTimeDropdownInterval = 15;</script><script src="assets/js/modules/quotedit.js?seq=b2026081301"></script><script type="text/javascript" src="https://my.evolutionerp.com.au/plugins/csvexporter/plugin.js"></script><script type="text/javascript" src="https://my.evolutionerp.com.au/plugins/costupdater/plugin.js"></script><!-- Bootstrap -->
<script src="assets/js/global.js?seq=a2026081301"></script>
<script src="assets/js/fencingIcons.js?seq=2026081301"></script>
<script src="app/ajax/selectFilterClass.js?seq=2026081301"></script>
<script src="app/ajax/selectFilter.js?seq=2026081301"></script>

<script> var showJobCodeSetting = 'Disabled'; var useJobCodeAsID = '1'; </script>
<script src="assets/js/multiselect.js?seq=2026081301&u=631"></script>
<script src="assets/js/modules/timesheetTimerApplet.js?seq=2026081316"></script>
</head>
<body>

<script> //document.getElementsByTagName('body')[0].style.display = 'none'; WAS CAUSING RENDERING ISSUES ON CALENDAR </script>
<style>
.pac-container {
z-index: 10000 !important;
}
</style>
<div class="modal fade" id="searchModal" tabindex="-1" role="dialog" aria-labelledby="searchModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg searchDiv" role="document">
<div class="modal-content">
<div class="modal-header">
<div ID="searchModalTitle" class="h4 text-uppercase">Global Search</div>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span class="align-top" aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" ID="searchModalBody">
<form action="globalsearch.php" method="GET">
<div class="form-group">
<div class="row">
<div class="col">
<input type="text" name="global_search" class="form-control" placeholder="Global Search" value="">
</div>
<div class="col-4">
<input type="submit" class="form-control" name="globalsearch" value="GO">
</div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
<style>
.pac-container {
z-index: 10000 !important;
}
</style>
<div class="modal fade" id="notificationsModal" tabindex="-1" role="dialog" aria-labelledby="notificationsModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg searchDiv" role="document">
<div class="modal-content">
<div class="modal-header">
<div ID="notificationsModalTitle" class="h4 text-uppercase">Notifications</div>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span class="align-top" aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" ID="notificationsModalBody">
<div class="table-responsive" style='max-height:500px'>
<table class='table table-sm table-hover'><tr class = ''>
<td>
<div class='text-uppercase'>
<a href='index.php?page=jobedit&id=38'>Job 38 Whyalla Earthworks Pty Ltd</a>
</div>
Update for Dispatch 5013, 697 items are being dispatched on the26-06-2026<br>Dispatch has been committed
</td>
</tr><tr class = ''>
<td>
<div class='text-uppercase'>
<a href='index.php?page=jobedit&id=38'>Job 38 Whyalla Earthworks Pty Ltd</a>
</div>
Update for Dispatch 5013, 697 items are being dispatched on the26-06-2026
</td>
</tr><tr class = ''>
<td>
<div class='text-uppercase'>
<a href='index.php?page=jobedit&id=38'>Job 38 Whyalla Earthworks Pty Ltd</a>
</div>
Update for Dispatch 5012, 0 items are being dispatched on the26-06-2026<br>Dispatch has been committed
</td>
</tr><tr class = ''>
<td>
<div class='text-uppercase'>
<a href='index.php?page=jobedit&id=38'>Job 38 Whyalla Earthworks Pty Ltd</a>
</div>
Workshop 18, all 4 lines completed, due 18-06-2026
</td>
</tr><tr class = ''>
<td>
<div class='text-uppercase'>
<a href='index.php?page=jobedit&id=38'>Job 38 Whyalla Earthworks Pty Ltd</a>
</div>
Stock Picking New Picking Order 14, 539 items due on 23-06-2026<br>This has been committed
</td>
</tr><tr class = ''>
<td>
<div class='text-uppercase'>
<a href='index.php?page=jobedit&id=25'>Job 25 AAN Produce</a>
</div>
Update for Dispatch 5004, 31 items are being dispatched on the14-04-2026<br>Dispatch has been committed
</td>
</tr><tr class = ''>
<td>
<div class='text-uppercase'>
<a href='index.php?page=jobedit&id=23'>Job 23 MTE</a>
</div>
Workshop 8, all 2 lines completed, due 16-03-2026
</td>
</tr><tr class = ''>
<td>
<div class='text-uppercase'>
<a href='index.php?page=jobedit&id=23'>Job 23 MTE</a>
</div>
Workshop 8, all 2 lines completed, due 16-03-2026
</td>
</tr><tr class = ''>
<td>
<div class='text-uppercase'>
<a href='index.php?page=jobedit&id=23'>Job 23 MTE</a>
</div>
Update for Dispatch 5003, 0 items are being dispatched on the17-03-2026<br>Dispatch has been committed
</td>
</tr><tr class = ''>
<td>
<div class='text-uppercase'>
<a href='index.php?page=jobedit&id=21'>Job 21 MTE</a>
</div>
Update for Dispatch 5002, 7 items are being dispatched on the25-02-2026<br>Dispatch has been committed
</td>
</tr><tr class = ''>
<td>
<div class='text-uppercase'>
<a href='index.php?page=jobedit&id=21'>Job 21 MTE</a>
</div>
Update for Dispatch 5002, 7 items are being dispatched on the25-02-2026
</td>
</tr><tr class = ''>
<td>
<div class='text-uppercase'>
<a href='index.php?page=jobedit&id=21'>Job 21 MTE</a>
</div>
Stock Picking New Picking Order 8, 2 items due on 25-02-2026<br>This has been committed
</td>
</tr><tr class = ''>
<td>
<div class='text-uppercase'>
<a href='index.php?page=jobedit&id=21'>Job 21 MTE</a>
</div>
Update for Dispatch 5001, 0 items are being dispatched on the25-02-2026<br>Dispatch has been committed
</td>
</tr><tr class = ''>
<td>
<div class='text-uppercase'>
<a href='index.php?page=jobedit&id=21'>Job 21 MTE</a>
</div>
Workshop 7, all 3 lines completed, due 25-02-2026
</td>
</tr><tr class = ''>
<td>
<div class='text-uppercase'>
<a href='index.php?page=jobedit&id=21'>Job 21 MTE</a>
</div>
Workshop 7, all 3 lines completed, due 25-02-2026
</td>
</tr><tr class = ''>
<td>
<div class='text-uppercase'>
<a href='index.php?page=jobedit&id=19'>Job 19 Ace Automation</a>
</div>
Stock Picking New Picking Order 5, 0 items due on 15-01-2026<br>This has been committed
</td>
</tr><tr class = ''>
<td>
<div class='text-uppercase'>
<a href='index.php?page=jobedit&id=18'>Job 18 UGL Engineering Pty Ltd</a>
</div>
Update for Dispatch 5000, 9 items are being dispatched on the14-01-2026
</td>
</tr><tr class = ''>
<td>
<div class='text-uppercase'>
<a href='index.php?page=jobedit&id=18'>Job 18 UGL Engineering Pty Ltd</a>
</div>
Update for Dispatch 5000, 9 items are being dispatched on the14-01-2026
</td>
</tr><tr class = ''>
<td>
<div class='text-uppercase'>
<a href='index.php?page=jobedit&id=18'>Job 18 UGL Engineering Pty Ltd</a>
</div>
Stock Picking New Picking Order 4, 9 items due on 14-01-2026<br>This has been committed
</td>
</tr></table></div>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>

<!-- ALERT DIV -->
<div class="alertDiv" style="z-index:1060;" id="alert">
<div class="text-end">
<i class="material-symbols-rounded pointer" onclick="document.getElementById('alert').style.visibility='hidden';">close</i>
</div>
<div class="text-start" ID="alert-msg"></div>
</div>

<!-- NOTICE DIV -->
<div class="alertDiv noticeDiv" style="z-index:1060;" id="notice">
<div class="text-end">
<i class="material-symbols-rounded pointer" onclick="document.getElementById('notice').style.visibility='hidden';">close</i>
</div>
<div class="text-start text-uppercase" ID="notice-msg"></div>
</div>

<div ID="errorMsg"></div>


<!-- OVERLAY DIV -->
<div ID="overlay" class="overlay" style="display:none">
<div class="loader" ID="progress"></div>
</div>

<!-- INSERT COLOR TRANSITION EFFECTS -->
<div class='divEffect'></div>
<div class="divEffectDark"></div>

<div class="modal" tabindex="-1" role="dialog" data-keyboard="false" data-backdrop="static" id="yesNoModal" style="z-index:999999 !important;margin-top:100px;display:none;">
<div class="modal-dialog" role="document" style="box-shadow: 0px 0px 20px 20px #888;">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Confirmation</h5>
</div>
<div class="modal-body">
<p>Modal body text goes here.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" style="background:#596978" onclick="$('#yesNoModal').hide();$('.yesNoModalBackground').remove();if (yesNoModalCallback != undefined) yesNoModalCallback();">Yes</button>
<button type="button" class="btn btn-secondary" style="background:#777" data-dismiss="modal" onclick="$('#yesNoModal').hide();$('.yesNoModalBackground').remove();if (yesNoCancelModalCallback != undefined) yesNoCancelModalCallback();">No</button>
</div>
</div>
</div>
</div>

<!-- Main Container DIV -->
<div ID='' class="container-fluid">
<!-- HEADER -->
<div class="row site-header" id="header">
<div class="col-md-5 site_heading">
<img src='assets/images/logo_wide_website.png' style='height:45px;px;margin-top:-10px; margin-bottom:8px;' onmouseup="window.location='index.php'" class="pointer">
</div>
<div class='col text-end align-baseline pt-2 site-header-nav'>
<button class="p-2 border border-1 bg-light rounded" title="Change Company">
<a href='index.php?page=login2' class="text-uppercase fs-6">
<i class="material-symbols-rounded pe-2">business</i>
PLC Fencing </a>
</button>
<span class="p-1">
<a href="index.php?page=supportdashboard" title="Support"><i class="material-symbols-rounded">support</i></a>
</span>
<span class="p-1 " title="Global Search">
<i data-bs-toggle="modal"
data-bs-target="#searchModal"
class="material-symbols-rounded pointer">search</i>
</span>

<a href="https://my.evolutionerp.com.au/index.php?page=plugins" class="position-relative">
<i class="material-symbols-rounded pointer">extension <span class="position-absolute top-0 start-100 translate-middle badge rounded-pill bg-danger" style="display: none; --bs-badge-padding-x: 0.25em; --bs-badge-padding-y: 0.25em; --bs-badge-font-size: 0.35em;">
<span class="plugin_badge_count">0</span>
<span class="visually-hidden">unread messages</span>
</span></i>
</a>

<span class="p-1" title="Notifications">
<i data-bs-toggle="modal"
data-bs-target="#notificationsModal"
onmouseup="notifyMarkRead();"
class="material-symbols-rounded pointer">notifications</i>

<span class="badge badge-danger" ID="notifyBadge" style='margin-left:-10px'>8</span>
</span>
<span class="p-1" title="Calendar">
<a href='index.php?page=mycalendar'>
<i class="material-symbols-rounded ">calendar_today</i>
</a>
</span>
<span class="p-1" title="Manage Profile">
<a href='index.php?page=useredit'>
<i class="material-symbols-rounded">account_circle</i></a>
</span>
<span class="p-1" title="Log Off">
<a href='logoff.php'><i class="material-symbols-rounded">exit_to_app</i></a>
</span>
</div>
</div>
<!-- MENU AND CONTENT -->
<div class="row flex-nowrap main_site_container" ID="main_site_container"
dstyle="background-image:linear-gradient(to bottom, rgba(255,255,255,0.1), rgba(255,255,255) 80px), url('assets/images/backgrounds/wheat-g83cc73618_1920.jpg')">
<!-- MENU -->
<div class="bg-light m-0 p-0" style="width:60px" ID="menu_container">
<div ID='navdiv' class="menu_container" onmouseenter="menuToggle();" onmouseleave="menuToggleOut();">
<br>
<div class="accordion accordion-flush menu-main" id="accordianMainMenu">

<div class="accordion-item">
<h2 class="accordion-header" id="flush-headingOne">
<button class="accordion-button fs-6 collapsed no-toggle-arrow" type="button" aria-expanded="false" >
<a href="index.php"><i class="material-symbols-rounded md-36 pointer" style="margin-right:20px">home</i></a><a href="index.php" style="hidden;">HOME</a>
<i class="material-symbols-rounded pointer menu-pin-toggle" id="menuPinToggle" title="Pin Menu" onclick="event.stopPropagation(); menuTogglePin();">push_pin</i>
</button>
</h2>
</div>

<div class="accordion-item">
<h2 class="accordion-header" id="flush-headingAP">
<button class="accordion-button collapsed fs-6" type="button" data-bs-toggle="collapse" data-bs-target="#flush-ap" aria-expanded="false" aria-controls="flush-ap">
<i class="material-symbols-rounded">shopping_cart</i><span class="menu-label">PURCHASING</span>
</button>
</h2>
<div id="flush-ap" class="accordion-collapse collapse " aria-labelledby="flush-headingAP">
<div class="accordion-body fs-6 m-0 p-0">
<ul class="list-group">
<li class="list-group-item list-group-item-action ps-4 border-0 border-left-1 main_menu"><a title="Purchase Requisitions" href="index.php?page=reqreg">REQUISITIONS</a></li>
<li class="list-group-item list-group-item-action border-0 border-left-1 ps-4 main_menu"><a title="Min Max Reorder" href="index.php?page=invreorder">BIN RE-ORDER</a></li>
<li class="list-group-item list-group-item-action ps-4 border-0 border-left-1 main_menu"><a title="Purchase Orders" href="index.php?page=purchasereg">PURCHASE ORDERS</a></li>
<li class="list-group-item list-group-item-action ps-4 border-0 border-left-1 main_menu"><a title="Purchase Orders" href="index.php?page=backorderreg">BACK ORDERS</a></li>
<li class="list-group-item list-group-item-action ps-4 border-0 border-left-1 main_menu"><a title="Billing History" href="index.php?page=billreg">BILLS</a></li>
<li class="list-group-item list-group-item-action ps-4 border-0 border-left-1 main_menu"><a title="Supplier Credit Notes" href="index.php?page=creditnotereg&source=AP">CREDIT NOTES</a></li>
<li class="list-group-item list-group-item-action ps-4 border-0 border-left-1 main_menu" style="display:none"><a title="Pay Bills" href="index.php?page=billpay2">PAY BILLS</a></li>

<li class="list-group-item list-group-item-action ps-4 border-0 border-left-1 main_menu"><a title="Pay Bills" href="index.php?page=clientlist">MANAGE ACCOUNTS</a></li>
</ul>
</div>
</div>
</div>

<div class="accordion-item">
<h2 class="accordion-header" id="flush-headingAR">
<button class="accordion-button collapsed fs-6" type="button" data-bs-toggle="collapse" data-bs-target="#flush-ar" aria-expanded="false" aria-controls="flush-ar">
<i class="material-symbols-rounded">sell</i><span class="menu-label">SALES</span>
</button>
</h2>
<div id="flush-ar" class="accordion-collapse collapse " aria-labelledby="flush-headingAR">
<div class="accordion-body fs-6 m-0 p-0">
<ul class="list-group">
<li class="list-group-item list-group-item-action ps-4 border-0 border-left-1 main_menu"><a href="index.php?page=addressbook">ADDRESS BOOK</a></li>
<li class="list-group-item list-group-item-action border-0 border-left-1 ps-4 main_menu"><a href="index.php?page=leadreg">SALES LEADS</a></li>
<li class="list-group-item list-group-item-action ps-4 border-0 border-left-1 main_menu"><a href="index.php?page=opportunities">OPPORTUNITIES</a></li>
<li class="list-group-item list-group-item-action ps-4 border-0 border-left-1 main_menu"><a href="index.php?page=quotereg">QUOTES</a></li>
<li class="list-group-item list-group-item-action ps-4 border-0 border-left-1 main_menu"><a href="index.php?page=invoicereg">INVOICES</a></li>
<li class="list-group-item list-group-item-action ps-4 border-0 border-left-1 main_menu"><a title="Customer Credit Notes" href="index.php?page=creditnotereg&source=AR">CREDIT NOTES</a></li>
<li class="list-group-item list-group-item-action ps-4 border-0 border-left-1 main_menu"><a href="index.php?page=contracts">CONTRACT PRICING</a></li>
<li class="list-group-item list-group-item-action ps-4 border-0 border-left-1 main_menu"><a href="index.php?page=clientlist">MANAGE ACCOUNTS</a></li>
</ul>
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header" id="flush-headingGL">
<button class="accordion-button collapsed fs-6" type="button" data-bs-toggle="collapse" data-bs-target="#flush-gl" aria-expanded="false" aria-controls="flush-gl">
<i class="material-symbols-rounded">account_balance</i><span class="menu-label">ACCOUNTING</span>
</button>
</h2>
<div id="flush-gl" class="accordion-collapse collapse " aria-labelledby="flush-headingGL">
<div class="accordion-body fs-6 m-0 p-0">
<ul class="list-group">
<li class="list-group-item list-group-item-action ps-4 border-0 border-left-1 main_menu"><a href="index.php?page=ledger">GENERAL LEDGER</a></li>
<li class="list-group-item list-group-item-action border-0 border-left-1 ps-4 main_menu"><a href="index.php?page=accountreg">CHART OF ACCOUNTS</a></li>
</ul>
</div>
</div>
</div>


<div class="accordion-item">
<h2 class="accordion-header" id="flush-headingProjects">
<button class="accordion-button collapsed fs-6" type="button" data-bs-toggle="collapse" data-bs-target="#flush-projects" aria-expanded="false" aria-controls="flush-projects">
<i class="material-symbols-rounded">engineering</i><span class="menu-label">PROJECTS</span>
</button>
</h2>
<div id="flush-projects" class="accordion-collapse collapse " aria-labelledby="flush-headingProjects">
<div class="accordion-body fs-6 m-0 p-0">
<ul class="list-group">
<li class="list-group-item list-group-item-action ps-4 border-0 border-left-1 main_menu"><a href="index.php?page=jobregister">JOB REGISTER</a></li>
<li class="list-group-item list-group-item-action border-0 border-left-1 ps-4 main_menu"><a href="index.php?page=activities">PLANNED ACTIVITIES</a></li>
<li class="list-group-item list-group-item-action border-0 border-left-1 ps-4 main_menu"><a href="index.php?page=assignments">ASSIGNMENTS</a></li>
<li class="list-group-item list-group-item-action border-0 border-left-1 ps-4 main_menu"><a href="index.php?page=assignment_schedule">SCHEDULE</a></li>
<li class="list-group-item list-group-item-action border-0 border-left-1 ps-4 main_menu development"><a href="index.php?page=sites">SITES</a></li>
<li class="list-group-item list-group-item-action border-0 border-left-1 ps-4 main_menu"><a href="index.php?page=picking">PICKING SLIPS</a></li>
<li class="list-group-item list-group-item-action border-0 border-left-1 ps-4 main_menu"><a href="index.php?page=dispatch">DISPATCHES</a></li>
<li class="list-group-item list-group-item-action border-0 border-left-1 ps-4 main_menu"><a href="index.php?modules=projects&page=deliveries">RUNSHEETS</a></li>
<li class="list-group-item list-group-item-action border-0 border-left-1 ps-4 main_menu"><a href="index.php?page=defects">DEFECTS</a></li>
</ul>
</div>
</div>
</div>

<div class="accordion-item">
<h2 class="accordion-header" id="flush-headingTimesheets">
<button class="accordion-button collapsed fs-6" type="button" data-bs-toggle="collapse" data-bs-target="#flush-timesheets" aria-expanded="false" aria-controls="flush-timesheets">
<i class="material-symbols-rounded">schedule</i><span class="menu-label">TIMESHEETS</span>
</button>
</h2>
<div id="flush-timesheets" class="accordion-collapse collapse " aria-labelledby="flush-headingTimesheets">
<div class="accordion-body fs-6 m-0 p-0">
<ul class="list-group">
<li class="list-group-item development list-group-item-action border-0 border-left-1 ps-4 main_menu"><a href="index.php?modules=projects&page=timesheets">TIMESHEET APPROVALS</a></li>
<li class="list-group-item list-group-item-action border-0 border-left-1 ps-4 main_menu"><a href="index.php?page=timesheetHistory">TIMESHEETS</a></li>
<li class="list-group-item list-group-item-action border-0 border-left-1 ps-4 main_menu"><a href="index.php?page=assignment_schedule">SCHEDULE</a></li>
</ul>
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header" id="flush-headingMf">
<button class="accordion-button collapsed fs-6" type="button" data-bs-toggle="collapse" data-bs-target="#flush-mf" aria-expanded="false" aria-controls="flush-mf">
<i class="material-symbols-rounded">factory</i><span class="menu-label">MANUFACTURE</span>
</button>
</h2>
<div id="flush-mf" class="accordion-collapse collapse " aria-labelledby="flush-headingMf">
<div class="accordion-body fs-6 m-0 p-0">
<ul class="list-group">
<li class="list-group-item list-group-item-action ps-4 border-0 border-left-1 main_menu"><a href="index.php?page=mfstatus">PROCESS SUMMARY</a></li>
<li class="list-group-item list-group-item-action border-0 border-left-1 ps-4 main_menu"><a href="index.php?page=mfactivity">CALENDAR</a></li>
<li class="list-group-item list-group-item-action border-0 border-left-1 ps-4 main_menu"><a href="index.php?page=mfinsights">INSIGHTS</a></li>
<li class="list-group-item list-group-item-action border-0 border-left-1 ps-4 main_menu"><a href="index.php?page=mfprodorders">PRODUCTION ORDERS</a></li>
<li class="list-group-item list-group-item-action border-0 border-left-1 ps-4 main_menu"><a href="index.php?page=mfshoporders">SHOPORDERS</a></li>
<li class="list-group-item list-group-item-action border-0 border-left-1 ps-4 main_menu"><a href="index.php?page=mfpending">PENDING ITEMS</a></li>
<li class="list-group-item list-group-item-action border-0 border-left-1 ps-4 main_menu"><a href="index.php?page=mfprocesses">PROCESSES</a></li>
<li class="list-group-item list-group-item-action border-0 border-left-1 ps-4 main_menu"><a href="index.php?page=mfrouting">ROUTING</a></li>
</ul>
</div>
</div>
</div>

<div class="accordion-item">
<h2 class="accordion-header" id="flush-headingInv">
<button class="accordion-button collapsed fs-6" type="button" data-bs-toggle="collapse" data-bs-target="#flush-inv" aria-expanded="false" aria-controls="flush-inv">
<i class="material-symbols-rounded">inventory</i><span class="menu-label">INVENTORY</span>
</button>
</h2>
<div id="flush-inv" class="accordion-collapse collapse " aria-labelledby="flush-headingInv">
<div class="accordion-body fs-6 m-0 p-0">
<ul class="list-group">
<li class="list-group-item list-group-item-action ps-4 border-0 border-left-1 main_menu"><a href="index.php?page=inventory">MANAGE INVENTORY</a></li>
<li class="list-group-item list-group-item-action border-0 border-left-1 ps-4 main_menu"><a href="index.php?page=invcats">CATEGORIES</a></li>
<li class="list-group-item list-group-item-action border-0 border-left-1 ps-4 main_menu"><a href="index.php?page=invbins">BIN LOCATIONS</a></li>
<li class="list-group-item list-group-item-action border-0 border-left-1 ps-4 main_menu"><a href="index.php?page=invspecs">ATTRIBUTES</a></li>
<li class="list-group-item list-group-item-action border-0 border-left-1 ps-4 main_menu"><a href="index.php?page=invcoding">CODING STANDARD</a></li>
<li class="list-group-item list-group-item-action border-0 border-left-1 ps-4 main_menu"><a href="index.php?page=invtools">TOOLS</a></li>
<li class="list-group-item list-group-item-action border-0 border-left-1 ps-4 main_menu"><a href="index.php?page=invreports">REPORTS</a></li>
</ul>
</div>
</div>
</div>

<div class="accordion-item">
<h2 class="accordion-header" id="flush-headingRep">
<button class="accordion-button collapsed fs-6" type="button" data-bs-toggle="collapse" data-bs-target="#flush-report" aria-expanded="false" aria-controls="flush-report">
<i class="material-symbols-rounded">bar_chart</i><span class="menu-label">REPORTS</span>
</button>
</h2>
<div id="flush-report" class="accordion-collapse collapse " aria-labelledby="flush-headingRep">
<div class="accordion-body fs-6 m-0 p-0">
<ul class="list-group">
<li class="list-group-item list-group-item-action border-0 border-left-1 ps-4 main_menu"><a href="index.php?page=reportsdashboard">REPORTS DASHBOARD (NEW)</a></li>
</ul>
</div>
</div>
</div>

<div class="accordion-item">
<h2 class="accordion-header" id="flush-headingAssets">
<button class="accordion-button collapsed fs-6" type="button" data-bs-toggle="collapse" data-bs-target="#flush-assets" aria-expanded="false" aria-controls="flush-assets">
<i class="material-symbols-rounded">emoji_transportation</i><span class="menu-label">ASSETS</span>
</button>
</h2>
<div id="flush-assets" class="accordion-collapse collapse " aria-labelledby="flush-headingAssets">
<div class="accordion-body fs-6 m-0 p-0">
<ul class="list-group">
<li class="list-group-item list-group-item-action ps-4 border-0 border-left-1 main_menu"><a href="index.php?page=assetreg">ASSET REGISTER</a></li>
<li class="list-group-item list-group-item-action ps-4 border-0 border-left-1 main_menu"><a href="index.php?page=assetsbooked">BOOKED ASSETS</a></li>
<li class="list-group-item list-group-item-action ps-4 border-0 border-left-1 main_menu"><a href="index.php?page=assetSchedule">ASSET MAINTENANCE REPORT</a></li>
</ul>
</div>
</div>
</div>

<div class="accordion-item">
<h2 class="accordion-header" id="flush-headingCF">
<button class="accordion-button collapsed fs-6" type="button" data-bs-toggle="collapse" data-bs-target="#flush-cf" aria-expanded="false" aria-controls="flush-cf">
<i class="material-symbols-rounded">group</i><span class="menu-label">CONTACTS</span>
</button>
</h2>
<div id="flush-cf" class="accordion-collapse collapse " aria-labelledby="flush-headingCF">
<div class="accordion-body fs-6 m-0 p-0">
<ul class="list-group">
<li class="list-group-item list-group-item-action ps-4 border-0 border-left-1 main_menu"><a href="index.php?page=clientlist">MANAGE ACCOUNTS</a></li>
<li class="list-group-item list-group-item-action border-0 border-left-1 ps-4 main_menu"><a href="index.php?page=stafflist">MANAGE STAFF</a></li>
<li class="list-group-item list-group-item-action border-0 border-left-1 ps-4 main_menu"><a href="index.php?page=departments">DEPARTMENTS</a></li>
<li class="list-group-item list-group-item-action border-0 border-left-1 ps-4 main_menu"><a href="index.php?page=quallist">QUALIFICATIONS</a></li>
<li class="list-group-item list-group-item-action border-0 border-left-1 ps-4 main_menu development"><a href="index.php?page=qualcatlist">QUALIFICATION TYPES</a></li>
<li class="list-group-item list-group-item-action border-0 border-left-1 ps-4 main_menu"><a href="index.php?page=email">MAILING LIST</a></li>
</ul>
</div>
</div>
</div>

<div class="accordion-item">
<h2 class="accordion-header" id="flush-headingWHS">
<button class="accordion-button collapsed fs-6" type="button" data-bs-toggle="collapse" data-bs-target="#flush-WHS" aria-expanded="false" aria-controls="flush-WHS">
<i class="material-symbols-rounded">medical_information</i><span class="menu-label">WHS & EQ</span>
</button>
</h2>
<div id="flush-WHS" class="accordion-collapse collapse " aria-labelledby="flush-headingWHS">
<div class="accordion-body fs-6 m-0 p-0">
<ul class="list-group">
<li class="list-group-item list-group-item-action border-0 border-left-1 ps-4 main_menu"><a href="index.php?page=whsForms">FORMS</a></li>
</ul>
</div>
</div>
</div>

</div> </div>
</div>
<!-- CONTENT DIV -->
<div class="page_content">
<div class="row">
<!-- CONTENT -->
<div ID="main_content_div" class="col" >
<script src="assets/jscripts/sortable-master/sortable.min.js"></script>
<link rel="stylesheet" href="assets/jscripts/sortable-master/css/sortable-theme-minimal.css"/>
<script>var page="quotedit";</script><script>var current_page="quotedit";</script><style>
select {
font-kerning: auto;
}
.datatable tr td { vertical-align: middle;}

.ai-scope-card { overflow: hidden; }
.ai-scope-header { background: linear-gradient(to bottom, rgba(0,0,0,0.02), rgba(0,0,0,0.05)); cursor: pointer; }
.ai-scope-header .ai-scope-chevron { transition: transform 0.2s ease; }
.ai-scope-header[aria-expanded="true"] .ai-scope-chevron { transform: rotate(180deg); }
.ai-scope-header .ai-status-badge.ai-status-generated { background-color: #5cb85c !important; }
.ai-scope-header .ai-status-badge.ai-status-error { background-color: #cd6155 !important; }
</style>
<script> sectionList = [{"id":413,"type":"Quotation Inclusion","name":"1. FENCE","notes":"<p>Approximately 69m of 2400H Spear Top Fence - TS0121<\/p>\r\n<p>550mm Razor Wire Flat Loops - Approximately 3m<\/p>","quoteId":2266,"source":"user","accepted":0,"value":29432.65820000000167055986821651458740234375,"tax":0},{"id":414,"type":"Quotation Inclusion","name":"2. INSTALLATION","notes":"<p>2 People x 2 Days Allowed<\/p>","quoteId":2266,"source":"user","accepted":0,"value":6777.49610000000029685907065868377685546875,"tax":0},{"id":415,"type":"Quotation Inclusion","name":"3. GATES","notes":"<p>3x 4m Double Gate<\/p>","quoteId":2266,"source":"user","accepted":0,"value":6987.951699999999618739821016788482666015625,"tax":0}] </script><style>
.pac-container {
z-index: 10000 !important;
}
</style>
<div class="modal fade" id="pipetopost2" tabindex="-1" role="dialog" aria-labelledby="pipetopost2Label" aria-hidden="true">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header">
<div ID="pipetopost2Title" class="h2">Advanced Post Builder</div>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" ID="pipetopost2Body">
<script>
//var mfprocs = """";
//console.log(mfprocs);
</script>
<style>
/* Scoped to this wizard (#pipeModifier2) so the responsive heights below
never affect .navtab usage elsewhere. Keep the min-height floor; replace the
fixed max-height with viewport-relative heights that grow on larger screens. */
#pipeModifier2 .navtab{
min-height:450px;
max-height:500px;
overflow-y:auto;
}

/* Medium screens and up — let the pane use more of the viewport vertically. */
@media (min-height: 800px){
#pipeModifier2 .navtab{
max-height:65vh;
}
}

/* Large / tall monitors — take up more of the screen. */
@media (min-height: 1000px){
#pipeModifier2 .navtab{
max-height:72vh;
}
}

/* Widen the modal dialog on very large screens so the extra height isn't
stranded in a narrow column. Scoped to this modal id only. */
@media (min-width: 1600px){
#pipetopost2 .modal-xl{
max-width:1400px;
}
}

</style>
<form>
<div class="container-fluid text-start" ID="pipeModifier2">

<div class="row">
<div class="col">

<!-- START OF STEP 1 -->
<div class="navtab pipetab">
<div class="h4 text-uppercase">Post Modifier Options</div>
<br>
<div class="form-group">
<label for="">What type of post do you want?</label>
<select name="wizardType" ID="p2postType" class="required form-control" onchange="setPostOptions();setTabVisibility();">
<option>Please Select</option>
<option value="std">Standard straight or cranked post</option>
<option value="rail">Rail & Stays</option>
<option value="dbl">Double Post</option>
<option value="tpl">Triple post</option>
</select>
</div>
<div class="form-group" id="p2postBarbDiv">
<label for="">Will this post be cranked or have barbed wire?</label>
<select name="wizardType" data-target="post_barb" ID="p2postBarb" class="required form-control navFlag" onchange="setTabVisibility();">
<option>Please Select</option>
<option selected>No</option>
<option>Yes</option>
</select>
</div>
<div class="form-group">
<label for="">Is this post powdercoated?</label>
<select name="powderFlag" data-target="post_coating" ID="p2postPc" class="required form-control navFlag" onchange="setTabVisibility();">
<option>Please Select</option>
<option selected>No</option>
<option>Yes</option>
</select>
</div>
<div class="form-group" ID="p2postPlatedDiv">
<label for="">Is this plated or fixed at top or bottom</label>
<select name="platedFlag" id="p2postPlated" data-target="post_baseplates" class="required form-control navFlag" onchange="setTabVisibility();getBaseplates();">
<option>Please Select</option>
<option selected>No</option>
<option>Bolted bottom only</option>
<option disabled>Bolted top and bottom</option>
</select>
</div>
</div>

<!-- END OF STEP -->
<!-- START OF STEP STANDARD POSTS -->
<div ID="post_standard" class="pipetab navtab post_standard hidden">
<div class="h3 text-uppercase">POST SPECIFICIATIONS</div>
<br>
<fieldset ID="p2postOptions">
<!-- STAYS OPTIONS -->
<div class="form-group stays rail">
<label for="postLength">Stay Type</label>
<select class="form-control build-desc required" ID="p2stay_type" name="stay_type">
<option>Please Select</option>
<option>Standard Rail</option>
<option>Continuous Top Rail (Swaged)</option>
<option>Back stay single bend</option>
<option>Back stay double bend</option>
<option>Inline straight stay (Cable and turnbuckle)</option>
<option>Inline diagonal stay for fittings</option>
<option>Inline cranked diagonal stay post to post</option>
<option>Inline double cranked diagonal stay inground</option>
</select>
</div>
<div class="form-group stdpost">
<label for="">Post Type</label>
<select ID="p2postSubType" name="postSubType" class="form-control build-desc">
<option>Select</option>
<option>Post - Corner</option>
<option>Post - End</option>
<option>Post - Gate</option>
<option>Post - Intermediate</option>
</select>
</div>
<div class="form-group stdpost dblpost tplpost stays rail">
<label for="postLength">Post Length (mm)(overall)</label>
<input type="text" name="postLength" ID="p2postLength" class="required form-control">
</div>
<div class="form-group stdpost dblpost tplpost stays">
<label for="postLength">Would you like to include a swaged extension?</label>
<select onchange="p2SyncSwage('p2postSwage','swaged');" ID="p2postSwage" class="form-control build-desc">
<option selected>No</option>
<option>Yes</option>
</select>
</div>
<div class="form-group swaged" style="display:none">
<label for="postLength">Length of Swaged Extension</label>
<input type="text" name="postSwageExt" ID="p2postSwageExt" class="form-control" value="600">
</div>
<h4 class="dblpost">SECONDARY PIPE</h4>
<!-- SECONDARY PIPE OPTIONS -->
<div class="form-group dblpost">
<label for="postLength">Length of secondary pipe</label>
<input type="text" ID="post_length_sec" class="form-control required">
</div>
<div class="form-group dblpost">
<label for="postLength">Profile of secondary pipe</label>
<select ID="post_profile_sec" class="form-control">
<option>Please Select</option>
<option selected>Round Pipe</option>
<option disabled>SHS (Coming Soon)</option>
</select>
</div>
<div class="form-group dblpost">
<label for="postLength">Size / Bore of secondary pipe</label>
<select ID="post_bore_sec" class="form-control required" onchange="p2GetPipeFull(this.value,'p2postPipeFull2');p2GetProductionSec();">
<option>Please Select</option>
<option>32</option>
<option>40</option>
<option>50</option>
<option>80</option>
<option>100</option>
<option>150</option>
</select>
</div>
<div class="form-group dblpost">
<label for="postLength">Would you like to include a swaged extension?</label>
<select onchange="p2SyncSwage('p2postSwageSec','swaged_sec');" ID="p2postSwageSec" class="form-control build-desc">
<option selected>No</option>
<option>Yes</option>
</select>
</div>
<div class="form-group swaged_sec" style="display:none">
<label for="postLength">Length of Swaged Extension</label>
<input type="text" name="postSwageExtSec" ID="p2postSwageExtSec" class="form-control" value="600">
</div>
<h4 class="tplpost">TERTIARY PIPE</h4>
<!-- TERTIARY PIPE OPTIONS -->
<div class="form-group tplpost">
<label for="postLength">Length of tertiary pipe</label>
<input type="text" ID="post_length_tertiary" class="form-control required">
</div>
<div class="form-group tplpost">
<label for="postLength">Profile of tertiary pipe</label>
<select ID="post_profile_tertiary" class="form-control">
<option>Please Select</option>
<option>Round Pipe</option>
<option>SHS</option>
</select>
</div>
<div class="form-group tplpost">
<label for="postLength">Size / Bore of tertiary pipe</label>
<select ID="post_bore_tertiary" class="form-control required" onchange="p2GetPipeFull(this.value,'p2postPipeFull3');p2GetProductionTertiary();">
<option>Please Select</option>
<option>40</option>
<option>50</option>
<option>80</option>
<option>100</option>
<option>150</option>
</select>
</div>
<div class="form-group tplpost">
<label for="postLength">Would you like to include a swaged extension?</label>
<select onchange="p2SyncSwage('p2postSwageTertiary','swaged_tertiary');" ID="p2postSwageTertiary" class="form-control build-desc">
<option selected>No</option>
<option>Yes</option>
</select>
</div>
<div class="form-group swaged_tertiary" style="display:none">
<label for="postLength">Length of Swaged Extension</label>
<input type="text" name="postSwageExtTertiary" ID="p2postSwageExtTertiary" class="form-control" value="600">
</div>

<h4 class="dblpost tplpost">SPECS</h4>
<div class="form-group dblpost">
<label for="postLength">What gussets are specified?</label>
<select ID="post_dbl_gussets" class="form-control">
<option>Please Select</option>
<option disabled>Round notched pipe</option>
<option selected>Gusset Plates</option>
</select>
</div>
<div class="form-group dblpost">
<label for="post_dbl_gussets_code">Choose Gusset Material</label>
<select ID="post_dbl_gussets_code" class="form-control required">
<option>Please Select</option>
</select>
</div>
<div class="form-group dblpost">
<label for="post_dbl_gussets_orientation">Choose Orientation of Plates</label>
<select ID="post_dbl_gussets_orientation" class="form-control">
<option>Please Select</option>
<option value="portrait" selected>Portrait (Weld long side)</option>
<option value="landscape">Landscape (Weld Short Side)</option>
</select>
</div>
<div class="form-group dblpost">
<label for="postLength">Specify the number of gussets?</label>
<input type="text" ID="post_gusset_spacing" class="form-control required" value="">
</div>
</fieldset>
</div>

<!-- START OF STEP COATING -->
<div ID="post_coating" class="pipetab navtab hidden">
<div class="h4 text-uppercase">Coating</div>
<br>
<div class="form-group">
<label for="">Post Coating</label>
<select ID="p2postCoating" name="postCoating" class="form-control required" onchange="p2ToggleCoating();">
<option value="0">Plain Galvanized</option>
<option>Powdercoated Black</option>
<option>Powdercoated Green</option>
<option>Powdercoated Monument</option>
<option>Powdercoated Non-Standard</option>
</select>
</div>
<div class="form-group" ID="p2CoatingCodeDiv">
<label for="">Post Coating Code</label>
<select ID="p2postCoatingCode" name="postCoatingCode" class="form-control required">

<option selected>Please Select</option>
</select><br><div ID="p2pcDesc"></div>
</div>
<div class="form-group" ID="p2CoatingCodeDiv">
<label for="">Powder Coating Handling Oncost % (Optional)</label>
<input type="text"
ID="p2postCoatingOncost"
class="form-control"
>
</div>
</div>


<!-- START OF STEP CRANKING AND BARB -->
<div ID="post_barb" class="pipetab navtab post_barb hidden">
<div class="h4 text-uppercase">Barb and Cranking</div>
<br>
<div class="form-group">
<label for="">Post Crank</label>
<select ID="post_Crank" name="postCrank" class="form-control">
<option value="vertical">None</option>
<option>Cranked Standard Inline</option>
<option>Cranked 45 Deg Cnr</option>
<option>Cranked 90 Deg Cnr</option>
<option>Cranked Extension arm Gate post</option>
<option>Cranked - Y-Top</option>
</select>
</div>
<div class="form-group">
<label for="">Include Barb?</label>
<select ID="p2postBarbed" name="postCrankBarb" class="form-control" onchange="toggleClass('pipeBarbRow');">
<option selected>Yes</option>
<option>No</option>
</select>
</div>
<div class="form-group pipeBarbRow">
<label for="">Barb Spacing</label>
<input type="text" ID="post_Barb_Spacing" name="postBarbSpacing" size="5" value="150" class="form-control"> mm
</div>
<div class="form-group pipeBarbRow">
<label for="">Barb Rows</label>
<input type="text" ID="post_Barb_Rows" name="postBarbRows" value="3" class="form-control">
</div>
<div class="form-group y-top hidden">
<label for="">Y-Top Ext. Costing</label>
<input type="text" ID="post_Barb_Ytop" name="postBarbYtop" size="5" value="3" class="form-control">
</div>
</div>


<!-- STEP FOOTINGS / BASEPLATES -->
<div ID="post_baseplates" class="pipetab navtab post_baseplates hidden">
<div class="h4 text-uppercase">Base plates and fixing</div>
<br>
<div class="form-group">
<label for="">Bolt Down</label>
<select ID="p2postPlates" name="postPlates" class="form-control">
<option value="N/A">Please Select</option>
</select>
<div ID="post_Plated_Msg"></div>
</div>
</div>
<!-- END OF STEP -->
<!-- START OF STEP 3 -->
<div class="pipetab navtab production hidden">
<div class="h4 text-uppercase">Production Costs</div>
<br>
<div class="form-group">
<label for="">How many posts do you require</label>
<input type="text" name="p2postQty" ID="p2postQty" class="requred form-control">
</div>
<div class="form-group">
<label for="">Post QTY to calculate passive time. (OPTIONAL)</label>
<input type="text" name="postPassive" ID="postPassive" class="form-control">
<div class="alert alert-secondary">If left empty this will default to the number of posts for this build. If you are adding multiple posts, specifiy the qty here to spread out the passive time. </div>
</div>

<div class="form-group" class="form-control required">
<label for="">Waste</label>
<select ID="wasteCost" name="wasteCost" class="required form-control">
<option>Please Select</option>
<option>Yes</option>
<option>No</option>
</select> <div ID="pipe_to_post_waste"></div>
</div>

<fieldset ID="p2postOptions2">
<div class="form-group stdpost dblpost tplpost stays rail">
<label for="">Pipe Length</label>
<select ID="p2postPipeFull" name="fullLength" class="required form-control" onchange="p2ShowPipeStock()">
<option>Please Select</option>
</select>
<div class="alert alert-secondary" ID="p2pipeStock">Choose the pipe to use above to preview stock availability</div>
</div>

<div class="form-group dblpost">
<label for="">Pipe Length Secondary</label>
<select ID="p2postPipeFull2" name="fullLength" class="form-control" onchange="p2ShowPipeStock(this.id,'p2pipeStock2')">
<option>Please Select</option>
</select>
<div class="alert alert-secondary" ID="p2pipeStock2">Choose the pipe to use above to preview stock availability</div>
</div>

<div class="form-group tplpost">
<label for="">Pipe Length Tertiary</label>
<select ID="p2postPipeFull3" name="fullLength" class="form-control" onchange="p2ShowPipeStock(this.id,'p2pipeStock3')">
<option>Please Select</option>
</select>
<div class="alert alert-secondary" ID="p2pipeStock3">Choose the pipe to use above to preview stock availability</div>
</div>
</fieldset>
<div class="form-group">
<label for="">Select Pricing</label>
<select ID="p2postPipePricing" name="fullLength" class="form-control">
<option>Standard Pricing</option>
<option>Average Cost</option>
</select>
</div>

<div class="">

<!-- PRIMARY PIPE PRODUCTION RATES -->
<h5 class="text-uppercase">Primary Pipe Rates</h5>
<div class="form-group">
<div class="d-flex justify-content-between">
<label ID="FACT-CUT">FACT-CUT:</label>
<a ID="p2pipeCutManage" href="#" target="_blank" class="manage-fact" style="display:none">Manage</a>
</div>
<input type=text ID="p2pipeCutCost" value="" class="form-control">
</div>
<div class="form-group">
<div class="d-flex justify-content-between">
<label ID="FACT-DENT">FACT-DENT:</label>
<a ID="p2pipeDentManage" href="#" target="_blank" class="manage-fact" style="display:none">Manage</a>
</div>
<input type=text ID="p2pipeDentCost" value="" class="form-control">
</div>
<div class="form-group">
<div class="d-flex justify-content-between">
<label ID="FACT-CRANK">FACT-CRANK:</label>
<a ID="p2pipeCrankManage" href="#" target="_blank" class="manage-fact" style="display:none">Manage</a>
</div>
<input type=text ID="p2pipeCrankCost" value="" class="form-control">
</div>
<div class="form-group">
<div class="d-flex justify-content-between">
<label>FACT-SWAGE:</label>
<a ID="p2pipeSwageManage" href="#" target="_blank" class="manage-fact" style="display:none">Manage</a>
</div>
<input type=text ID="p2pipeSwageCost" value="" class="form-control">
</div>
<div class="form-group">
<div class="d-flex justify-content-between">
<label ID="FACT-WELD">FACT-WELD:</label>
<a ID="p2pipeWeldManage" href="#" target="_blank" class="manage-fact" style="display:none">Manage</a>
</div>
<input type=text ID="p2pipeWeldCost" value="" class="form-control">
</div>

<!-- SECONDARY PIPE PRODUCTION RATES (DBL AND TPL) -->
<div ID="p2prodRatesSec" style="display:none">
<hr>
<h5 class="text-uppercase">Secondary Pipe Rates</h5>
<div class="form-group">
<div class="d-flex justify-content-between">
<label>FACT-CUT (Secondary):</label>
<a ID="p2pipeCutManageSec" href="#" target="_blank" class="manage-fact" style="display:none">Manage</a>
</div>
<input type=text ID="p2pipeCutCostSec" value="" class="form-control">
</div>
<div class="form-group">
<div class="d-flex justify-content-between">
<label>FACT-DENT (Secondary):</label>
<a ID="p2pipeDentManageSec" href="#" target="_blank" class="manage-fact" style="display:none">Manage</a>
</div>
<input type=text ID="p2pipeDentCostSec" value="" class="form-control">
</div>
<div class="form-group">
<div class="d-flex justify-content-between">
<label>FACT-CRANK (Secondary):</label>
<a ID="p2pipeCrankManageSec" href="#" target="_blank" class="manage-fact" style="display:none">Manage</a>
</div>
<input type=text ID="p2pipeCrankCostSec" value="" class="form-control">
</div>
<div class="form-group">
<div class="d-flex justify-content-between">
<label>FACT-SWAGE (Secondary):</label>
<a ID="p2pipeSwageManageSec" href="#" target="_blank" class="manage-fact" style="display:none">Manage</a>
</div>
<input type=text ID="p2pipeSwageCostSec" value="" class="form-control">
</div>
<div class="form-group">
<div class="d-flex justify-content-between">
<label>FACT-WELD (Secondary):</label>
<a ID="p2pipeWeldManageSec" href="#" target="_blank" class="manage-fact" style="display:none">Manage</a>
</div>
<input type=text ID="p2pipeWeldCostSec" value="" class="form-control">
</div>
</div>

<!-- TERTIARY PIPE PRODUCTION RATES (TPL) -->
<div ID="p2prodRatesTertiary" style="display:none">
<hr>
<h5 class="text-uppercase">Tertiary Pipe Rates</h5>
<div class="form-group">
<div class="d-flex justify-content-between">
<label>FACT-CUT (Tertiary):</label>
<a ID="p2pipeCutManageTertiary" href="#" target="_blank" class="manage-fact" style="display:none">Manage</a>
</div>
<input type=text ID="p2pipeCutCostTertiary" value="" class="form-control">
</div>
<div class="form-group">
<div class="d-flex justify-content-between">
<label>FACT-DENT (Tertiary):</label>
<a ID="p2pipeDentManageTertiary" href="#" target="_blank" class="manage-fact" style="display:none">Manage</a>
</div>
<input type=text ID="p2pipeDentCostTertiary" value="" class="form-control">
</div>
<div class="form-group">
<div class="d-flex justify-content-between">
<label>FACT-CRANK (Tertiary):</label>
<a ID="p2pipeCrankManageTertiary" href="#" target="_blank" class="manage-fact" style="display:none">Manage</a>
</div>
<input type=text ID="p2pipeCrankCostTertiary" value="" class="form-control">
</div>
<div class="form-group">
<div class="d-flex justify-content-between">
<label>FACT-SWAGE (Tertiary):</label>
<a ID="p2pipeSwageManageTertiary" href="#" target="_blank" class="manage-fact" style="display:none">Manage</a>
</div>
<input type=text ID="p2pipeSwageCostTertiary" value="" class="form-control">
</div>
<div class="form-group">
<div class="d-flex justify-content-between">
<label>FACT-WELD (Tertiary):</label>
<a ID="p2pipeWeldManageTertiary" href="#" target="_blank" class="manage-fact" style="display:none">Manage</a>
</div>
<input type=text ID="p2pipeWeldCostTertiary" value="" class="form-control">
</div>
</div>

</div>

</div>
<!-- END OF STEP -->

<!-- START OF FINAL STEP -->
<div ID="finish" class="pipetab navtab hidden">
<div class="h4 text-uppercase">Summary and Finish</div>
<div class="form-group">
<label for="">Description</label>
<textarea name="description" ID="p2description" class="form-control" rows="5" style="height:100%"></textarea>
</div>
<div class="form-group">
<label for="">Cost Breakdown</label>
<table class="table">
<thead>
<tr>
<th style="width:70%">Item</th>
<th>Qty</th>
<th>Cost</th>
<th>Sub.Total</th>
</tr>
</thead>
<tbody ID="p2Costing">
</tbody>
</table>
<div class="h3 text-right" ID="total"></div>
<h4>Manufacture Routing</h4>
<div id="processes"></div>
</div>
</div>
<!-- END OF STEP -->


</div>
</div>

<div class="row">
<div class="col">

<div class="form-group">
<label for=""></label>
<input type="button" ID="processPipe" value="Update & Close" class="form-control hidden">
</div>
</div>
</div>
<div class="row">
<div class="col-2">
<button class="bg-danger button form-control" type="button" onclick="resetForm();">Reset</button>
</div>
<div class="col">
<button class="button form-control" type="button" id="prevBtn" onclick="nextPrev(-1)">Previous</button>
</div>
<div class="col">
<button class="button form-control" type="button" id="nextBtn" onclick="nextPrev(1)">Next</button>
<button class="button form-control" style="display:none" type="button" id="finishBtn" onclick="p2Finish();">Finish</button>
</div>
</div>
</div>
</form>
<div style="text-align:center;margin-top:40px;">
<span class="step"></span>
<span class="step"></span>
<span class="step"></span>
<span class="step"></span>
</div>

<script src="plugins/pipe/pipetopost2.js"></script>

<script>
document.getElementById("p2postLength").addEventListener("change", function () {
if(document.getElementById("post_length_sec").value==""){
document.getElementById("post_length_sec").value=this.value;
}
if(document.getElementById("post_length_tertiary").value==""){
document.getElementById("post_length_tertiary").value=this.value;
}

});
</script>


</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
<style>
.pac-container {
z-index: 10000 !important;
}
</style>
<div class="modal fade" id="uomModal" tabindex="-1" role="dialog" aria-labelledby="uomModalLabel" aria-hidden="true">
<div class="modal-dialog modal-md" role="document">
<div class="modal-content">
<div class="modal-header">
<div ID="uomModalTitle" class="h2">UOM Conversion Tools</div>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" ID="uomModalBody">
<form name="form1" method="post" action="uomsave.php">
<div class="container text-start">
<input type="hidden" id="id" name="id" class="form-control">
<input type="hidden" id="uomtarget" class="form-control" value="0">

<h4>Base Unit of Measure: <span id="uom_baseunit"></span></h4>
<div class="alert alert-secondary">
Use this tool to re-calculate the base rate from a different UOM rate. A usefull example is re-calculating a new cost for a Each item from a Tonne rate.
</div>
<div class="form-group">
<label>Type</label>
<select class="form-control" id="uomtype">
<option value="0" data-brqty="1" data-price="">Base Unit of Measure</option>
</select>
</div>

<div class="form-group">
<label>Conversion Rate / Quantity Break</label>
<input type="text" class="form-control" id="uombrqty">
</div>

<div class="form-group">
<label>Cost</label>
<input type="text" class="form-control" id="uomcost">
</div>

<div class="form-group">
<label>Price</label>
<input type="text" class="form-control" id="uomprice">
</div>

<div class="form-group">
<input type="button" id="updateuom" onclick="uomCostConvert()" value="Update Pricing" class="form-control">
</div>

</div>
</form>

<script>
function getUOM (id=null,tgt='new') {
//doAlert("Loading UOM");
//SET TARGET NEW ITEMS OR LINES
if(tgt!="new"){
document.getElementById("uomtarget").value=tgt;
}
var url = "uomsave.php?id="+id+"&call=getInvUom";
var item=document.getElementById("itemFilterSelect");
var type=document.getElementById("uomtype");
var xmlhttp1=new XMLHttpRequest();
xmlhttp1.onreadystatechange=function(){
if (xmlhttp1.readyState=="4" && xmlhttp1.status=="200"){
var json=JSON.parse(xmlhttp1.responseText);
if(json.length>"0"){
//console.log(json);
$('#uomModal').modal('show');
//GET PRICING METHOD FOR SETTING COST
var costMethod = document.getElementById("supplierSelect");
//SET BASE UNIT OF MEAURE
document.getElementById("uom_baseunit").innerHTML=json.uom;
document.getElementById("uomcost").value=json.cost;
document.getElementById("uombrqty").value="1";
document.getElementById("uomprice").value=json.price;
type.options[0].setAttribute("data-cost",json.cost);
type.options[0].setAttribute("data-costavg",json.costavg);
type.options[0].setAttribute("data-price",json.price);
type.options.length=1;
//SET THE OPTIONS
for(x=0;x<json.invuom.length;x++){
json.invuom[x].costavg=(json.costavg*json.invuom[x].brqty);
json.invuom[x].costavg = Math.round(json.invuom[x].costavg*10000)/10000;
el=document.createElement("option");
el.setAttribute("data-cost",(parseFloat(json.invuom[x].cost)+parseFloat(json.invuom[x].oncost)));
el.setAttribute("data-costavg",(parseFloat(json.invuom[x].costavg)+parseFloat(json.invuom[x].oncost)));
el.innerHTML=json.invuom[x].uomname;
el.setAttribute("data-price",json.invuom[x].price);
el.setAttribute("data-brqty",json.invuom[x].brqty);
type.appendChild(el);
}
if(tgt=="new"){
document.getElementById("uommore_icon").style.display="";
}
}
}
}
xmlhttp1.open("POST", url, true);
xmlhttp1.send();
}

function uomCostConvert(){
//GET NEW VALUES
var uombrqty=document.getElementById("uombrqty").value;
var uomcost=document.getElementById("uomcost").value;
var uomprice=document.getElementById("uomprice").value;

//SET NEW COST AND UPDATE ROW
var x = document.getElementById("uomtarget").value;
if(x>"0"){
var uomtgt=document.getElementById("itemcost"+x);
var uommargin=document.getElementById("discount"+x);
uomtgt.value=Math.round(uomcost/uombrqty*10000)/10000;
if(uomprice>"0"){
uommargin.value=Math.round((100/uomcost)*(uomprice-uomcost)*10000)/10000;
}
updateRow(x);
} else {
var uomtgt=document.getElementById("cost");
var uommargin=document.getElementById("discount");
uomtgt.value=Math.round(uomcost/uombrqty*10000)/10000;
if(uomprice>"0"){
uommargin.value=Math.round((100/uomcost)*(uomprice-uomcost)*10000)/10000;
}
updateNew();
}
$('#uomModal').modal('hide');
}

document.getElementById("uomtype").addEventListener("change", function() {
var costMethod = document.getElementById("supplierSelect");
if(costMethod.options[costMethod.selectedIndex].innerHTML == "Average Cost"){
document.getElementById("uomcost").value=this.options[this.selectedIndex].getAttribute("data-costavg");
} else {
document.getElementById("uomcost").value=this.options[this.selectedIndex].getAttribute("data-cost");
}
document.getElementById("uomprice").value=this.options[this.selectedIndex].getAttribute("data-price");
document.getElementById("uombrqty").value=this.options[this.selectedIndex].getAttribute("data-brqty");
} , false);

</script>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
<style>
.pac-container {
z-index: 10000 !important;
}
</style>
<div class="modal fade" id="addInventoryAdvancedOptionModal" tabindex="-1" role="dialog" aria-labelledby="addInventoryAdvancedOptionModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header">
<div ID="addInventoryAdvancedOptionModalTitle" class="h2">Add Inventory Item (Advanced Option)</div>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" ID="addInventoryAdvancedOptionModalBody">
<style>
#advancedBOMBuilder {
max-width: 1200px;
margin-left: 0px;
}

#advancedBOMBuilder .nav-item {
white-space: nowrap;
margin: 0px -1px;
}

#advancedBOMBuilder .nav-link {
color: gray;
}

#advancedBOMBuilder .nav-item.active>a {
color: black !important;
}

#advancedBOMBuilder > .navbar .material-symbols-rounded {
/*font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;*/
margin-top: 7px;
color: gray;
font-size: 22px;
}

#AdvBomtheDescription,
#AdvBomqty {
font-size: inherit;
line-height: 12px;
height: 25px;
width: 97%;
border-radius: 4.875px;
padding: 14px;
padding: 10px!important;
font-size: inherit;
}

#AdvBomtheDescription {
margin: 10px 0px 0px 0px;
width: 100%;
}

#AdvBomqty {
text-align: right;
max-width: 70px;
min-width: 33px !important;
}

#dataTableAdvBomBody td,
#dataTableAdvBom td {
padding: 5px 10px;
white-space: nowrap;
text-align: right;
vertical-align: top !important;
}

.inv_values>td:nth-child(1),
#dataTableAdvBomBody>tr:nth-child(1)>td:nth-child(1) {
text-align: left;
}

#AdvBomitemFilterSelect {
height: calc (40vh);
}

#advancedBOMBuilder .material-symbols-rounded {
color: gray;
font-size: 24px;
}

.AdvBomabtd0 {
display: flex;
}

.advBOMItemCode {
display: inline-block;
width: 150px;
padding: 4px;
}

.AdvBomitemDesc {
flex: 2;
padding: 15px;
}

.inv_values {
padding: 5px;
vertical-align: top;
}

.qtyvalue>.datainput {
padding: 15px;
}

.inv_values>td {
padding: 6px !important;
vertical-align: top;
text-align: right;
}

.inv_values>td:first-child {
padding: 6px !important;
text-align: left !important;
}

#advancedBOMBuilder .datatabletitle {
vertical-align: top;
}

.datatabletitle td {
text-align: right;
}

.datatabletitle td:first-child {
text-align: left;
}

#dataTableAdvBomBody tr>td:nth-child(6) .datainput {
float: right;
}

#advancedBOMBuilder .advOptTabCons {
max-height: calc(65vh);
overflow: auto;
}

.AdvBomRouteCreator .process {
display: inline-block;
}

.AdvBomRouteCreator #processList,
.AdvBomRouteCreator #processList2 {
width: 100%;
border-color: lightgray;
}

.myPlaceholder {
min-height: 30px;
box-sizing: border-box;
width: 100%;
border: 1px solid grey;
display: block;
margin: 5px;
padding: 8px;
vertical-align: top;
}

.AdvBomRouteCreator .error {
color: red;
}

#addInventoryAdvancedOptionModal .modal-content {
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
border-bottom: 0px;
}

#addInventoryAdvancedOptionModal .modal-footer {
background: white;
margin: 0px 1px;
}

.AdvBomRouteCreator #route {
margin-top: 12px;
}

.AdvBomRouteCreator .formListDiv .material-symbols-rounded {
margin-top: -4px;
}

.advOptTabCons h4 {
font-weight: bold;
padding-left: 0.6em !important;
padding-bottom: 0px !important;
}

#advancedOptionsStep3 .formListDiv {
width: auto;
display: inline-block;
}

#advancedOptionsStep3 .form-control {
width: 75px;
text-align: right;
padding: 7px;
}

#advBomMFProcTimeEntry td {
vertical-align: top !important;
}

#advBomMFProcTimeEntry td textarea {
resize: none;
text-align: left !important;
min-width: 300px !important;
width: calc(25vw);
}

#advBomPreviewProcess th:last-child,
#advBomMFProcTimeEntry td:last-child {
padding-right: 0rem !important;
}

#advancedOptionsStep3 table {
width: 100%;
max-width: 1100px;
}

#advancedBOMBuilder .formListDiv {
padding: 2px 5px 0px 10px !important;
white-space: nowrap;
width: auto;
height: 28px !important;
min-height: 28px !important;
}

#advancedOptionsStep3 td {
white-space: nowrap;
}

#advancedOptionsStep3 td:first-child {
width: 100%;
}

#advancedOptionsStep4 .card {
border-color: lightgray;
width: 98%;
}

#advancedOptionsStep4 .card-header {
background: black !important;
}

#advancedOptionsStep4 .card-header h3 {
text-transform: uppercase;
font-size: 14px;
font-weight: bold;
color: white !important;
padding-top: 5px;
letter-spacing: 2px !important;
}

#advancedBOMBuilder .proctype {
border: solid 1px black;
color: white;
font-size: 0.8rem;
padding: 0px 4px;
background: black;
border-radius: 8px;
cursor: pointer;
padding-bottom: 2px;
margin-right: 5px;
vertical-align: top;
line-height: 14px;
margin-top: 4px;
display: inline-block;
}

.AdvBomRouteCreator #processList .formListDiv {
width: auto !important;
}

.AdvBomRouteCreator #processList2 .formListDiv {
width: 50% !important;
padding: 0px !important;
}

.advbomspacer {
width: 30px;
display: inline-block;
}

::-ms-input-placeholder { /* Edge 12-18 */
color: #CCC !important;
}

::placeholder {
color: #CCC !important;
}

.AdvBomitemDesc,
#AdvBomtheDescription {
height: 50px;
resize: none;
padding: 7px !important;
line-height: 14px !important;
}

.AdvBomitemDesc {
padding: 3px !important;
margin: 5px 10px;
}

.AdvBomtotal_cost_calc {
white-space: nowrap;
}

.advBOMLT,
.advBOMPC,
.advBOMTU,
.advBOMST,
.advBOMSC,
.advBomTE {
width: 75px !important;
}

#advBomPreviewProcess th,
.advBomPrevBOM th,
.advBomPrevProcesses th,
.advBomPrevBOM td,
.advBomPrevProcesses td {
padding: 5px 20px 5px 0.5rem;
}

.advBomPrevBOM td:last-child,
.advBomPrevProcesses td:last-child {
padding: 5px 0px 5px 0px;
}

.advBomPrevBOM td:nth-child(2) {
white-space: nowrap;
}

.advBomPrevProcesses h3 {
margin: 0px;
padding-left: 5px;
font-size: 16px;
font-weight: bold;
}

.advBomPrevProcesses thead td:nth-child(8),
.advBomPrevProcesses thead td:nth-child(7),
.advBomPrevProcesses thead td:nth-child(6),
.advBomPrevProcesses thead td:nth-child(5),
.advBomPrevProcesses thead td:nth-child(4) {
text-align: right;
}

.advBomPrevProcesses tfoot td {
text-align: right;
}

.AdvBomRouteCreator .formListDiv,
.AdvBomRouteCreator .process {
cursor: pointer;
}

.AdvBomRouteCreator #processList2 {
overflow-x: scroll;
overflow-y: hidden;
}

.AdvBomRouteCreator #processList2 a {
cursor: pointer;
margin-top: -1px !important;
display: inline-block;
}

.advprocessInner {
background: rgba(158,183,156,0.25);
border: 1px solid grey;
border-radius: 5px;
padding: 3px 3px 1px 7px;
width: fit-content;
}

#advBomLabourTable td,
#advBomLabourTable th {
white-space: nowrap;
}

#advBomLabour select {
width: auto;
padding: 7px;
}

#advBomLabour td:nth-child(1) {
width: 250px;
}

#advBomLabour td:nth-child(2) {
width: 120px !important;
}

#advBomLabour td:nth-child(3) {
xwidth: 100%;
}

#advBomLabour input {
width: 80px;
}

#advBomLabour textarea {
resize: none;
width: 100% !important;
text-align: left !important;
}

#advBomPreviewProcess th,
#bomAdvPreviewTable tr:last-child td:nth-child(1),
#advBomPreviewProcess tr:last-child td:nth-child(3),
#advBomPreviewProcess td,
#bomAdvPreviewTable th,
#bomAdvPreviewTable td {
text-align: right !important;
}

#bomAdvPreviewTable th:nth-child(1),
#bomAdvPreviewTable th:nth-child(2),
#bomAdvPreviewTable th:nth-child(3),
#advBomPreviewProcess td:nth-child(1),
#advBomPreviewProcess td:nth-child(2),
#advBomPreviewProcess td:nth-child(3),
#bomAdvPreviewTable td:nth-child(1),
#bomAdvPreviewTable td:nth-child(2),
#bomAdvPreviewTable td:nth-child(3) {
text-align: left !important;
}

#bomAdvPreviewTable .badge {
display: none;
}

#advancedOptionsStep3 .multiSelectInput {
text-align: left;
}

#advancedOptionsStep3 .formListDiv {
padding: 2px 5px 7px 10px !important;
white-space: nowrap;
width: fit-content;
height: 28px !important;
min-height: 28px !important;
/*max-width: 222px !important;*/
display: block;
height: auto !important;
}

#advancedOptionsStep3 textarea {
width: 100% !important;
height: 73px !important;
}

#advancedOptionsStep3 .advbomspacer {
width: 15px;
}

#advancedOptionsStep3 .mfproctimecostrow input,
#advancedOptionsStep3 .mfproctimecostrow {
color: lightsalmon !important;
}

#advBomMFProcTimeEntry tr:nth-child(odd) td {
border: none;
padding-top: 5px;
}

#advBomMFProcTimeEntry tr:nth-child(even) td {
padding-bottom: 5px;
}

#advBomMFProcTimeEntry tr:first-child td {
border-color: inherit;
border-style: solid;
border-width: 0;
border-top-width: 0.8px;
border: none;
}

#advBomLabourTable b,
#advBomMFProcTimeEntry b {
font-weight: normal;
}

#advBomMFProcTimeEntry tr:nth-child(odd) td:nth-child(5) {
opacity: 0.4;
}

#advBomLabour th,
#advBomLabour td {
border: none;
}

#advBomLabourTable {
margin-bottom: 0px;
}

#advancedOptionsStep3 td {
padding-right: 20px !important;
border: none;
}

#advancedOptionsStep3 td:last-child {
padding-right: 0px !important;
}

.helper {
font-size: 1rem;
color: gray;
font-style: italic;
}

textarea {
resize: none;
}

#advancedOptionsStep1 ul {
margin-left: 50px;
width: 75%;
}

#advancedBOMBuilder .nonmateriallist li {
width: 33%;
float: left;
}

#bomAdvPreviewTable tfoot td {
text-align: right !important;
}

#advBomMFSelectProcessPreview .formListDiv {
width: 300px;
height: 38px !important;
padding: 7px 5px !important;
display: inline !important;
}

#advBomMFSelectProcessPreview .proctype {
margin-right: -1px;
}

#advBomMFSelectProcessPreview table {
margin-left: 0.5rem !important;
}

#advBomMFSelectProcessPreview td {
padding-bottom: 20px !important;
}

.advBomPrevProcesses th:nth-child(8),
.advBomPrevProcesses th:nth-child(7),
.advBomPrevProcesses th:nth-child(6),
.advBomPrevProcesses th:nth-child(5),
.advBomPrevProcesses th:nth-child(4) {
text-align: right;
}
#advBomMFSelectProcessPreview td {
padding-bottom: 20px !important;
}

.AdvBomcostvalue,
.AdvBomqtyfld {
width: 70px;
}

#advancedBOMBuilder .inv_values .datainput {
border: none;
padding: 10px;
border-radius: 3px;
text-align: right;
background: none;
}

#advancedBOMBuilder .inv_values .form-control {
border: none;
background: none;
}

#advancedBOMBuilder .inv_values .advbomitemfilter {
text-align: left;
}

#advancedBOMBuilder .inv_values .form-control:focus,
#advancedBOMBuilder .inv_values .form-control:hover,
#advancedBOMBuilder .inv_values .datainput:focus,
#advancedBOMBuilder .inv_values .datainput:hover {
border: solid 1px lightgray;
padding: 10px;
border-radius: 3px;
background: white;
}

#advancedBOMBuilder .inv_values .input-group-text {
border-radius: 3px;
}

.advBomRowsLbl {
padding-top: 0.25rem;
}

.AdvBomitemDesc {
text-align: left !important;
}

#dataTableAdvBomBody tr:nth-child(even) {
background: lightgray;
}

.advBomPrevBOM td:first-child,
.advBomPrevBOM td:nth-child(2) {
text-align: left;
}

#bomAdvPreviewTable tfoot tr td:nth-child(2) {
text-align: right !important;
}

#dataTableAdvBom tfoot td {
background: darkgray !important;
}

#advancedOptionsStep1 {
overflow: hidden !important;
}</style>

<form id="advBomBuilderForm" name="advBomBuilderForm" onsubmit="return false">
<div class="container-fluid text-start" id="advancedBOMBuilder">
<nav class="navbar navbar-expand-lg navbar-light border-bottom text-uppercase fw-bold">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item active" data-index="1">
<a class='nav-link pointer h4 text-uppercase'>Bill of Materials</a>
</li>
<li><b><span class="material-symbols-rounded">
arrow_forward_ios
</span></b></li>
<li class="nav-item" data-index="2">
<a class='nav-link pointer h4 text-uppercase'>Manufacturing Route</a>
</li>
<li><b><span class="material-symbols-rounded">
arrow_forward_ios
</span></b></li>
<li class="nav-item d-none" data-index="3">
<a class='nav-link pointer h4 text-uppercase'>Processses</a>
</li>
<li class="d-none"><b><span class="material-symbols-rounded">
arrow_forward_ios
</span></b></li>
<li class="nav-item" data-index="4">
<a class='nav-link pointer h4 text-uppercase reviewentryheading'>Review Entry</a>
</li>
<li><b><span class="material-symbols-rounded">
arrow_forward_ios
</span></b></li>
<li class="nav-item" data-index="5">
<a class='nav-link pointer h4 text-uppercase'>Save New Item</a>
</li>
</ul>
</div>
</nav>
<div class="advOptTabCons" id="advancedOptionsStep1">
<h4 class="text-uppercase bold p-4">Item Bill of Materials</h4>
<div class="row mb-4">
<div class="d-none col p-4">
Please select an existing inventory item from the list below and add these item as Bill of Materials for your new item <b id="invAddItemName"></b>.
&nbsp;&nbsp;
Only material only items will be shown in the list.
&nbsp;&nbsp;
Any inventory items under the following categories are not included in the list:
<ul class="nonmateriallist"><li>Ops - XX Labour</li><li>PLCx External Production </li></ul> </div>
</div>
<style>
.table-fixed thead th {
z-index: 9;
vertical-align: top;
}
#dataTableAdvBom thead tr:not(.thead-dark) th {
background-color:#81BEF7;
top: 38px;
}
#dataTableAdvBomBody tr td:first-child {
border-right: none;
border-bottom: none;
}
#dataTableAdvBomBody td {
border: none;
}
#dataTableAdvBomBody tr:nth-child(even) td {
background: #DDD;
}

#dataTableAdvBomBody tr:hover td {
background: darkgray;
color: white;
}
</style>
<div style="min-height:calc(40vh);">
<div class="p-4 pt-0" style="max-height:calc(50vh);overflow-y:scroll;">
<table id="dataTableAdvBom" class='datatable table table-fixed'>
<thead>
<tr class='datatabletitle thead-dark'>
<th width="*" title="Inventory items under the following categories are excluded from the list: &#013; &#013; &#09; - Ops - XX Labour &#013; &#09; - PLCx External Production ">Item Code and Description (please add Material Only items)</th>
<th class="d-none">SOH</th>
<th>UOM</th>
<th>Avail</th>
<th>Cost</th>
<th class="d-none">Avg. Cost</th>
<th>Qty</td>
<th></th>
<th></th>
</tr>
<tr style="height:40px;padding:0px;margin:0;background-color:#81BEF7;">
<th style="width:50%;">
<div class="input-group">
<div class="input-group-text"><i class="material-symbols-rounded">search</i></div>
<input type='text' name='AdvBomitemFilter' class="form-control" ID='AdvBomitemFilter' evo-filter-tgt="AdvBomitemFilterSelect" evo-filter-type="inv" value="" placeholder="Item Code">
</div>
<div class="filtered_list">
<select class="filtered_list form-control" name="AdvBomitemFilterSelect" id="AdvBomitemFilterSelect" size=8 onchange="getAdvBOMProduct();" onmouseup="getAdvBOMProduct();">
<option>Please Select</option>
</select>
</div>
<div class="input-group">
<textarea id="AdvBomtheDescription" name="AdvBomdescription" class='datainput form-control' placeholder="Item Description"></textarea>
</div>
</th>
<th id="AdvBomsohcol" class="d-none"></th>
<th id="AdvBomuom"></th>
<th><span id="AdvBomavailText"></span><input type="hidden" id="AdvBomavail" name="avail" class='datainput form-control'></th>
<th style="width:85px" id="AdvBomcostcol"></th>
<th class="d-none" style="width:80px" id="AdvBomavgcostcol"></th>
<th>
<div class="form-group">
<input type="text" name="qty" id='AdvBomqty' size="3" value="0" class='datainput form-control' onkeydown="return isNumberKey(event);">
</div>
</th>
<th align="center">
<span id="AdvBomcount_total_cost"></span>
<input type="hidden" name="alloated" id="AdvBomallocated" />
<input type="hidden" name="cost" id="AdvBomcost" />
<input type="hidden" name="avgcost" id="AdvBomavgcost" />
<input type="hidden" name="costmethod" id="AdvBomcostmethod" />
<input type="hidden" name="productionmethod" id="AdvBomproductionmethod" />
<a href="javascript:;" title="to add this new material into row item" onclick="if (document.getElementById('AdvBomitemFilterSelect').selectedIndex >= 0) { addAdvBOMDataRow('dataTableAdvBom', 'bom'); }"><i class="material-symbols-rounded">add_circle</i></a>
</th>
<th></th>
</tr>
</thead>
<tbody id="dataTableAdvBomBody">
</tbody>
<tfoot>
<tr class='datatabletitle' style="position:sticky;bottom:0;">
<td><strong>Total for <span id="advBomCount"></span> BOM(s)</strong></td>
<td class="d-none"><strong class='AdvBomtotalsoh'></strong></td>
<td><strong class='AdvBomtotaluom'></strong></td>
<td><strong class='AdvBomtotalavail'></strong></td>
<td><strong class='AdvBomtotalcost'></strong></td>
<td class="d-none"><strong class='AdvBomtotalavgcost'></strong></td>
<td><strong class='AdvBomtotalqty'></strong></td>
<td><strong class='AdvBomalltotal'></strong></td>
<td></td>
</tr>
</tfoot>
</table>

<div class="row justify-content-end">
<!-- <div class="col-2">
<input type="button" value="Request BOM" data-bs-toggle="modal" data-bs-target="#reqBOMAddModal" class="form-control" onclick="getBOMList(reqBOMAddInvInsert);">
</div> -->
<div class="col-2">
</div>
<!-- <div class="col-2">
<input class="form-control" type="button" value="Show Deleted" onclick="showAdvBomDeletedRows()" id='AdvBomdelToggleButton' name='AdvBomdelToggleButton' />
<input name='AdvBomdelToggle' type='hidden' id='AdvBomdelToggle' value='0' class="form-control">
</div>
<div class="col-2">
<input type='submit' name='save' value='Save' class="form-control" />
</div> -->
</div>
</div>
</div>
<div style="margin-top: -20px;height: 20px;z-index: 999;background: white;position: absolute;width: 95%;">
</div>
<div class="row px-4">
<div class="col">
<h3>Tip!</h3>
<p>The Bill of Material (BOM) listed here is a list of the components that is required to produce a manufactured part. The combination of costs on this screen can be used to automatically update the cost price and RRP of all manufactured items.</p>
</div>
</div>
</div>
<div class="advOptTabCons" id="advancedOptionsStep2">
<div class="row">
<h4 class="text-uppercase bold p-4 mx-3">Available Manufacturing Routes</h4>
<div class="col px-4 mx-2">
<br>
Please select a route you would like to use for this item:
<br>
<br>
<div class="form-group mx-0">
<select name="advBomRoute" class="form-select" id="advBomRoute">
<option value="0">No Manufacturing Process Needed</option>
<option value="11" data-route='{"processes":["43","33"],"depth":["0","1"],"units":["unit","unit"],"notes":["",""],"costs":[0,0],"takeup":[0,0],"setupcost":[60,0],"setuptime":[30,0],"pcost":[0,0],"leadtime":[0,0],"external":[0,0]}'>Chainwire Gate Manufacture</option><option value="1" data-route='{"processes":["17","22","24","35"],"depth":["0","1","2","3"],"units":["unit","unit","unit","unit"],"notes":["","","",""],"costs":[0,0,0,0],"takeup":[0,0,0,0],"setupcost":[0,0,0,0],"setuptime":[0,0,0,0],"pcost":[0,0,0,0],"leadtime":[0,0,0,0],"external":[0,0,0,0]}'>Cranked Post</option><option value="5" data-route='{"processes":["18"],"depth":["0"],"units":["unit"],"notes":[""],"costs":[0],"takeup":[0],"setupcost":[0],"setuptime":[0],"pcost":[0],"leadtime":[0],"external":[0]}'>CUT - Drop Saw</option><option value="27" data-route='{"processes":["43","36"],"depth":["0","1"],"units":["unit","unit"],"notes":["",""],"costs":[0,0],"takeup":[0,0],"setupcost":[60,0],"setuptime":[30,0],"pcost":[0,0],"leadtime":[0,0],"external":[0,1]}'>Cut and Ext- Galvanise</option><option value="4" data-route='{"processes":["16"],"depth":["0"],"units":["unit"],"notes":[""],"costs":[0],"takeup":[0],"setupcost":[0],"setuptime":[0],"pcost":[0],"leadtime":[0],"external":[1]}'>External - Bed Laser Cutting</option><option value="18" data-route='{"processes":["43"],"depth":["0"],"units":["unit"],"notes":[""],"costs":[0],"takeup":[0],"setupcost":[60],"setuptime":[30],"pcost":[0],"leadtime":[0],"external":[0]}'>FABRICATE-R- GENERAL</option><option value="19" data-route='{"processes":["22"],"depth":["0"],"units":["unit"],"notes":[""],"costs":[0],"takeup":[0],"setupcost":[0],"setuptime":[0],"pcost":[0],"leadtime":[0],"external":[0]}'>Form - Crimp</option><option value="21" data-route='{"processes":["17","27","34","38"],"depth":["0","1","2","3"],"units":["unit","unit","unit","unit"],"notes":["","","",""],"costs":[0,0,0,0],"takeup":[0,0,0,0],"setupcost":[0,0,0,0],"setuptime":[0,0,0,0],"pcost":[0,0,0,0],"leadtime":[0,0,0,0],"external":[0,0,0,0]}'>Gate Post</option><option value="6" data-route='{"processes":["15","36"],"depth":["0","1"],"units":["unit","unit"],"notes":["",""],"costs":[0,0],"takeup":[0,0],"setupcost":[0,0],"setuptime":[0,0],"pcost":[360,0],"leadtime":[0,0],"external":[0,1]}'>Laser Cut then Galvanise</option><option value="7" data-route='{"processes":["15","34"],"depth":["0","1"],"units":["unit","unit"],"notes":["",""],"costs":[0,0],"takeup":[0,0],"setupcost":[0,0],"setuptime":[0,0],"pcost":[360,0],"leadtime":[0,0],"external":[0,0]}'>Laser Cut then Weld</option><option value="26" data-route='{"processes":["17"],"depth":["0"],"units":["unit"],"notes":[""],"costs":[0],"takeup":[0],"setupcost":[0],"setuptime":[0],"pcost":[0],"leadtime":[0],"external":[0]}'>Pack-cut</option><option value="24" data-route='{"processes":["17","22","24"],"depth":["0","1","2"],"units":["unit","unit","unit"],"notes":["","",""],"costs":[0,0,0],"takeup":[0,0,0],"setupcost":[0,0,0],"setuptime":[0,0,0],"pcost":[0,0,0],"leadtime":[0,0,0],"external":[0,0,0]}'>Post - cut, crimp, crank</option><option value="16" data-route='{"processes":["17","22","24","35","34"],"depth":["0","1","2","3","3"],"units":["unit","unit","unit","unit","unit"],"notes":["","","","",""],"costs":[0,0,0,0,0],"takeup":[0,0,0,0,0],"setupcost":[0,0,0,0,0],"setuptime":[0,0,0,0,0],"pcost":[0,0,0,0,0],"leadtime":[0,0,0,0,0],"external":[0,0,0,0,0]}'>Post - cut, crimp, crank, weld, cap</option><option value="17" data-route='{"processes":["17","22","27","24","34","35"],"depth":["0","1","2","3","4","4"],"units":["unit","unit","unit","unit","unit","unit"],"notes":["","","","","",""],"costs":[0,0,0,0,0,0],"takeup":[0,0,0,0,0,0],"setupcost":[0,0,0,0,0,0],"setuptime":[0,0,0,0,0,0],"pcost":[0,0,0,0,0,0],"leadtime":[0,0,0,0,0,0],"external":[0,0,0,0,0,0]}'>Post - cut, crimp, crank, weld, drill, cap</option><option value="8" data-route='{"processes":["17","27","22","35"],"depth":["0","1","2","3"],"units":["unit","unit","unit","unit"],"notes":["","","",""],"costs":[0,0,0,0],"takeup":[0,0,0,0],"setupcost":[0,0,0,0],"setuptime":[0,0,0,0],"pcost":[0,0,0,0],"leadtime":[0,0,0,0],"external":[0,0,0,0]}'>Post - cut, crimp, drill, cap</option><option value="10" data-route='{"processes":["17","27","24","22","35"],"depth":["0","1","2","3","4"],"units":["unit","unit","unit","unit","unit"],"notes":["","","","",""],"costs":[0,0,0,0,0],"takeup":[0,0,0,0,0],"setupcost":[0,0,0,0,0],"setuptime":[0,0,0,0,0],"pcost":[0,0,0,0,0],"leadtime":[0,0,0,0,0],"external":[0,0,0,0,0]}'>Post - cut, crimp, drill, cap, crank</option><option value="9" data-route='{"processes":["17","22","34","27","35"],"depth":["0","1","2","3","3"],"units":["unit","unit","unit","unit","unit"],"notes":["","","","",""],"costs":[0,0,0,0,0],"takeup":[0,0,0,0,0],"setupcost":[0,0,0,0,0],"setuptime":[0,0,0,0,0],"pcost":[0,0,0,0,0],"leadtime":[0,0,0,0,0],"external":[0,0,0,0,0]}'>Post - cut, crimp, mark, cap, drill and weld </option><option value="14" data-route='{"processes":["18","34","27","36","38"],"depth":["0","1","1","2","3"],"units":["unit","unit","unit","unit","unit"],"notes":["","","","",""],"costs":[0,0,0,0,0],"takeup":[0,0,0,0,0],"setupcost":[0,0,0,0,0],"setuptime":[0,0,0,0,0],"pcost":[0,0,0,0,0],"leadtime":[0,0,0,0,0],"external":[0,0,0,1,0]}'>Post - cut, weld, drill, galv, paint</option><option value="23" data-route='{"processes":["17","22","35"],"depth":["0","1","2"],"units":["unit","unit","unit"],"notes":["","",""],"costs":[0,0,0],"takeup":[0,0,0],"setupcost":[0,0,0],"setuptime":[0,0,0],"pcost":[0,0,0],"leadtime":[0,0,0],"external":[0,0,0]}'>Post: Cut, Crimp , Cap</option><option value="13" data-route='{"processes":["17","15","34","36","38"],"depth":["0","0","1","2","3"],"units":["unit","unit","unit","unit","unit"],"notes":["","","","",""],"costs":[0,0,0,0,0],"takeup":[0,0,0,0,0],"setupcost":[0,0,0,0,0],"setuptime":[0,0,0,0,0],"pcost":[0,360,0,0,0],"leadtime":[0,0,0,0,0],"external":[0,0,0,1,0]}'>SAPN Weldmesh CNR Post</option><option value="12" data-route='{"processes":["15","34","36","38"],"depth":["0","1","2","3"],"units":["unit","unit","unit","unit"],"notes":["","","",""],"costs":[0,0,0,0],"takeup":[0,0,0,0],"setupcost":[0,0,0,0],"setuptime":[0,0,0,0],"pcost":[360,0,0,0],"leadtime":[0,0,0,0],"external":[0,0,1,0]}'>SAPN Weldmesh Post</option><option value="25" data-route='{"processes":["17","24"],"depth":["0","1"],"units":["unit","unit"],"notes":["",""],"costs":[0,0],"takeup":[0,0],"setupcost":[0,0],"setuptime":[0,0],"pcost":[0,0],"leadtime":[0,0],"external":[0,0]}'>Stay - bent</option><option value="3" data-route='{"processes":["15"],"depth":["0"],"units":["unit"],"notes":[""],"costs":[0],"takeup":[0],"setupcost":[0],"setuptime":[0],"pcost":[360],"leadtime":[0],"external":[0]}'>Tube Laser Cutting</option><option value="20" data-route='{"processes":["30"],"depth":["0"],"units":["unit"],"notes":[""],"costs":[0],"takeup":[0],"setupcost":[0],"setuptime":[0],"pcost":[0],"leadtime":[0],"external":[0]}'>Twitch Cutting</option><option value="15" data-route='{"processes":["31"],"depth":["0"],"units":["unit"],"notes":[""],"costs":[0],"takeup":[0],"setupcost":[0],"setuptime":[0],"pcost":[0],"leadtime":[0],"external":[0]}'>Wire Winding</option> </select>
</div>
</div>
</div>
<div class="row p-3 pt-0 custProcess3">
<div class="col">
&nbsp;You may import the selected route as a new route and update the processes or create a new route below clicking on the corresponding buttons available beside the navigation buttons.
</div>
</div>
<div class="AdvBomRouteCreator mx-1">
<input type="hidden" id="importedRoute" value="0">
<h4 class="text-uppercase bold p-2 m-4 mx-1">Item Manufacturing Process Editor</h4>
<div class="row p-3 pt-0 d-none">
<div class="col">
<b><br>Build New Manufacturing Route/Process</b>
</div>
</div>
<div class="row p-3 pt-0 pb-0">
<div class="form-group">
<label for="AdvBomRouteName">Route Name:<br></label>
<input type="text" class="form-control selfoc" id="AdvBomRouteName" name="AdvBomRouteName" aria-describedby="AdvBomRouteName" onkeyup="verifyAdvBomRouteName(this);checkDuplicateProcess();">
<small id="AdvBomRouteNameMessage" class="form-text text-muted">Please enter a descriptive name for your manufacturing route / processes</small>
</div>
<div class="form-group">
<label for="AdvBomRouteDescription">Description:<br></label>
<textarea class="form-control" id="AdvBomRouteDescription" name="AdvBomRouteDescription" rows="3" onkeyup="checkDuplicateProcess();"></textarea>
</div>
</div>
<div class="row p-3 pt-2">
<div class="col-4">
<div ID="processList" class='dashboardItemSmall source'>
<h3>Processes</h3>
<li id='mfProcesses$1' data-id='43' data-depth="0" data-unit="unit" data-notes='' class='formListDiv process' onmousedown="showCoords(event,this)" style="width:47%">1-FABRICATE GENERAL-P</li><li id='mfProcesses$2' data-id='15' data-depth="0" data-unit="unit" data-notes='' class='formListDiv process' onmousedown="showCoords(event,this)" style="width:47%">2-CUT - Tube Laser</li><li id='mfProcesses$3' data-id='22' data-depth="0" data-unit="unit" data-notes='' class='formListDiv process' onmousedown="showCoords(event,this)" style="width:47%">3-FORM - Pipe Crimping</li><li id='mfProcesses$4' data-id='17' data-depth="0" data-unit="unit" data-notes='' class='formListDiv process' onmousedown="showCoords(event,this)" style="width:47%">4-CUT - Pack-Cut / Bandsaw</li><li id='mfProcesses$5' data-id='36' data-depth="0" data-unit="unit" data-notes='' class='formListDiv process' onmousedown="showCoords(event,this)" style="width:47%">5-EXT - Hot Dip Galvanising</li><li id='mfProcesses$6' data-id='27' data-depth="0" data-unit="unit" data-notes='' class='formListDiv process' onmousedown="showCoords(event,this)" style="width:47%">6-FORM - Drilling</li><li id='mfProcesses$7' data-id='34' data-depth="0" data-unit="unit" data-notes='' class='formListDiv process' onmousedown="showCoords(event,this)" style="width:47%">7-Welding</li><li id='mfProcesses$8' data-id='38' data-depth="0" data-unit="unit" data-notes='' class='formListDiv process' onmousedown="showCoords(event,this)" style="width:47%">8-Paint Application</li><li id='mfProcesses$9' data-id='35' data-depth="0" data-unit="unit" data-notes='' class='formListDiv process' onmousedown="showCoords(event,this)" style="width:47%">Capping Posts</li><li id='mfProcesses$10' data-id='18' data-depth="0" data-unit="unit" data-notes='' class='formListDiv process' onmousedown="showCoords(event,this)" style="width:47%">CUT - Drop Saw</li><li id='mfProcesses$11' data-id='16' data-depth="0" data-unit="unit" data-notes='' class='formListDiv process' onmousedown="showCoords(event,this)" style="width:47%">EXT - Bed Laser Cutting</li><li id='mfProcesses$12' data-id='37' data-depth="0" data-unit="unit" data-notes='' class='formListDiv process' onmousedown="showCoords(event,this)" style="width:47%">EXT - Powder Coating</li><li id='mfProcesses$13' data-id='20' data-depth="0" data-unit="unit" data-notes='' class='formListDiv process' onmousedown="showCoords(event,this)" style="width:47%">FORM - Cropping</li><li id='mfProcesses$14' data-id='28' data-depth="0" data-unit="unit" data-notes='' class='formListDiv process' onmousedown="showCoords(event,this)" style="width:47%">FORM - Picket / Spear Forming</li><li id='mfProcesses$15' data-id='21' data-depth="0" data-unit="unit" data-notes='' class='formListDiv process' onmousedown="showCoords(event,this)" style="width:47%">FORM - Pipe Notching</li><li id='mfProcesses$16' data-id='23' data-depth="0" data-unit="unit" data-notes='' class='formListDiv process' onmousedown="showCoords(event,this)" style="width:47%">FORM - Pipe Swaging</li><li id='mfProcesses$17' data-id='24' data-depth="0" data-unit="unit" data-notes='' class='formListDiv process' onmousedown="showCoords(event,this)" style="width:47%">FORM - Post Cranking / Pipe Bending</li><li id='mfProcesses$18' data-id='26' data-depth="0" data-unit="unit" data-notes='' class='formListDiv process' onmousedown="showCoords(event,this)" style="width:47%">FORM - Punching</li><li id='mfProcesses$19' data-id='33' data-depth="0" data-unit="unit" data-notes='' class='formListDiv process' onmousedown="showCoords(event,this)" style="width:47%">Gate Lacing / Barbs</li><li id='mfProcesses$20' data-id='32' data-depth="0" data-unit="unit" data-notes='' class='formListDiv process' onmousedown="showCoords(event,this)" style="width:47%">Lacing Tool Winding</li><li id='mfProcesses$21' data-id='30' data-depth="0" data-unit="unit" data-notes='' class='formListDiv process' onmousedown="showCoords(event,this)" style="width:47%">Twitch Cutting</li><li id='mfProcesses$22' data-id='31' data-depth="0" data-unit="unit" data-notes='' class='formListDiv process' onmousedown="showCoords(event,this)" style="width:47%">Wire Winding</li> </div>
</div>
<div class="col-8">
<div ID="processList2" class="dashboardItemTwoThirds">
<div>
<h3>New / Edit Route</h3>
</div>
<ul ID="route" style="width:90%;min-height:150px;border:0px solid grey;padding:0px;" class='source'>
</ul>

</div>

<div class="d-none">
<div ID="Coords"></div>
MOUSE POSITION IN PROCESS<input type=text ID="Coords0">
BASE OFFSET <input type=text ID="Parent"><br>
MOUSE POSITION TO BODY <input size='4' type=text ID="Coords2">
PARENT OFFSET <input size='4' type=text ID="poffset">
ACTIVE OFFSET <input size='4' type=text ID="offset">
DEPTH <input size='4' type=text ID="depth">
</div>
</div>
</div>
<div class="col-6">
</div>
<div class="alert alert-warning mx-3">* Click on the Unit Type to change from Unit to Batch and vice versa</div> </div>
<div id="advBomRoutePreview" class="row p-4 pt-2 pb-0">
<br>
<p style="text-transform: uppercase;font-weight: bold;">
<b id="advBomRoutePreviewName"></b> process preview:
</p>
<div id="advBomRoutePreviewProcesses"></div>
</div>
</div>
<div class="advOptTabCons" id="advancedOptionsStep3">
<h4 class="text-uppercase bold p-4">Manufacturing Processes Cost Based Route</h4>
<div class="row px-4">
<div>
<br>
A <a onmouseup="document.querySelector('#advancedOptionsStep3').scrollTo(0, document.querySelector('#advancedOptionsStep3').offsetHeight);" style="font-size: inherit;font-family: inherit;margin-top: 0px;padding: 0px;text-decoration: underline; vertical-align: top;cursor: pointer;">"Factory Labour"</a> item will be added to the Bill of Materials covering the total cost and time entered above to produce the item.
&nbsp;&nbsp;
You may change the Factory Labour item details below the Route Information or use an existing Production Cost Line Item.
<br>
<span style="color:lightsalmon !important">Items in orange are "optional" and can be filled if you wish to include this in the "Factory Labour" item cost.</span>
<br>
</div>
<table class="table table-responsive mt-4" style="margin-left: 0.5rem;">
<tbody id="advBomMFProcTimeEntry">
<tr>
<td rowspan="2">
<div class="formListDiv process" data-setuptime="${setuptime}" data-leadtime="${leadtime}" data-pcosts="${processcost}" data-setupcost="${setupcost}" data-takeup="${takeup}" data-external="${isexternal}" data-notes="${notes}" data-cost="${cost}" data-id="${id}" data-unit="${unit}" data-depth="${depth}" style="margin-left:${margin};padding:15px;">${name}${spacer}${unittext}</div><input type="hidden" name="advbommfp_alloc_id[]" value="${id}"><textarea class="form-control" cols="50" rows="2" name="advbommfp_notes[]" placeholder="Enter process description" style="margin-left:${margin};width:calc(100% - ${margin}) !important;">${notes}</textarea></td>
<td>
<b>Time (m)</b><input type="text" name="advbommfp_alloc_time[]" class="form-control selfocus advBomTE hrtomin" size="4" value="" addplaceholder="" onkeyup="computeBatch(this);" placeholder="10m / 1h" title="Enter value in hours or minutes. Example: 1 hour/hours/hr 5 minutes/minute/min"></td>
<td>
<b>Qty Break</b><input type="text" name="advbommfp_alloc_qty[]" class="form-control selfocus advBomTE" size="4" value="" onkeyup="computeBatch(this);" value="${qty}"></td>
<td>
<b>Unit Cost</b><input type="text" name="advbommfp_alloc_cost[]" class="form-control selfocus advBomTE border-danger" size="4" onkeyup="this.setAttribute('oval', this.value);this.setAttribute('ocost', this.value);computeBatch(this, true);" ocost="${cost}" value="${cost}" onfocus="showHelper (this, 'Enter the cost per item for this process');"></td>
<td style="display: none;">
<b>Batch Time</b><input tabindex="-1" type="text" name="advbommfpbatch_alloc_time[]" class="form-control selfocus advBomTE hrtomin" size="4" value="" addplaceholder="" onfocus="blur();" onkeyup="blur();" onchange="this.value = this.getAttribute('ovalue');" placeholder="10m / 1h" title="Enter value in hours or minutes. Example: 1 hour/hours/hr 5 minutes/minute/min"></td>
<td onmouseout="hideComputationHelper();" onmouseover="showTotalCostComputation(this.querySelector('input'));">
<b>Total Cost</b><input type="text" name="advbommfpbatch_alloc_cost[]" class="form-control selfocus advBomTE border-0" size="4" value="" onfocus="blur();" xonkeyup="blur();" onchange="this.value = this.getAttribute('ovalue');" readonly onmouseout="hideComputationHelper();" onmouseover="showTotalCostComputation(this);"></td>
</tr>
<tr class="mfproctimecostrow">
<td style="display: none;">
<b>Take Up</b><br><input tabindex="-1" type="text" class="form-control selfocus advBOMTU float" name="advbomfp_takeup[]" value="${takeup}">
<span ${hidelead}>
<b>Lead Time (m)</b><br><input tabindex="-1" type="text" class="form-control selfocus advBOMLT hrtomin" name="advbomfp_leadtime[]" addplaceholder="" value="${leadtime}" placeholder="10m / 1h" title="Enter value in hours or minutes. Example: 1 hour/hours/hr 5 minutes/minute/min">
</td>
<td class="d-none">
<b>Setup Cost</b><br><input tabindex="-1" type="text" class="form-control selfocus advBOMSC float" name="advbomfp_setupcost[]" value="${setupcost}"></td>
<td style="display: none;">
<b>Process Cost</b><br><input tabindex="-1" type="text" class="form-control selfocus advBOMPC float" name="advbomfp_processcost[]" value="${processcost}"></td>
<td>
<b>Setup Time (m)</b><br><input type="text" class="form-control selfocus advBOMST hrtomin" addplaceholder="" name="advbomfp_setuptime[]" value="${setuptime}" placeholder="10m / 1h" title="Enter value in hours or minutes. Example: 1 hour/hours/hr 5 minutes/minute/min" onkeyup="computeBatch(this.parentNode.parentNode.previousElementSibling.querySelector('[type=text]'));"></td>
<td class="d-none ${hidelead}"></td>
</tr>
</tbody>
</table>
</div>
<div class="row px-4 labouritemcon d-none">
<br><h4 class="text-uppercase bold p-4 py-2">Listed below are the Factory Labour Items, please select an item applicable to this item that will be added to your Bill of Materials</h4><br>
<table class="table table-responsive" id="advBomLabourTable" style="margin-left: 0.5rem;">
<thead>
<th><b>Item Code</b></th>
<th><b>Category</b></th>
<th><b>Description</b></th>
<th><b>Labour Cost</b></th>
<th class="d-none"><b>Sell Price</b></th>
<th><b>Quantity (h)</b></th>
<th><b>Total Cost</b></th>
</thead>
<tbody id="advBomLabour">
<tr>
<td>
<div class="form-group row m-0 p-0 w-100">
<div class="input-group p-0 w-0">
<div class="input-group-text">
<i class="material-symbols-rounded">search</i>
</div>
<input onfocus="this.dataset.oldval = this.value; relocateLabourSelect(); " onkeyup="filterSelect ('invlabour', this.id);" xonblur="document.querySelector('#advBomLabourIdSelect').style.display = 'none';" type="text" name="advBomLabourId" class="form-control text-start" id="advBomLabourId" placeholder="Item Code" autocomplete="off">
</div>
<div class="filtered_list">
<select class="xfiltered_list form-control advBomLabourIdSelect text-start" name="advBomLabourIdSelect" id="advBomLabourIdSelect" size="8" onmouseup="this.style.display = 'none'; document.querySelector('#advBomLabourId').value = this.options[this.selectedIndex].text; updateLabourData(); this.dataset.oldval = this.value;" data-static-options="1">
<option data-markup="0" data-desc="" id="-1" value="-1" selected="selected">Please select a Factory Labour Item</option>
<option data-cost="720.14" data-cat="Ops - XX Labour" data-markup="33" data-desc="1 person fencing crew with utility - per day - local" value="4143">OpsLbr-DAYRATE-1pers</option>
<option data-cost="1221.62" data-cat="Ops - XX Labour" data-markup="33" data-desc="2 person fencing crew with utility - per day - local" value="4152">OpsLbr-DAYRATE-2pers</option>
<option data-cost="1886.04" data-cat="Ops - XX Labour" data-markup="33" data-desc="3 person fencing crew with two utilities - per day - local" value="4153">OpsLbr-DAYRATE-3pers</option>
<option data-cost="2387.52" data-cat="Ops - XX Labour" data-markup="33" data-desc="4 person fencing crew with two utilities - per day - local" value="4154">OpsLbr-DAYRATE-4pers</option>
<option data-cost="1060.14" data-cat="Ops - XX Labour" data-markup="33" data-desc="1 person fencing crew with utility - per day - working away" value="4155">OpsLbr-DAYRATELAFHA-1pers</option>
<option data-cost="1911.62" data-cat="Ops - XX Labour" data-markup="33" data-desc="2 person fencing crew with utility - per day - working away" value="4157">OpsLbr-DAYRATELAFHA-2pers</option>
<option data-cost="2926.04" data-cat="Ops - XX Labour" data-markup="33" data-desc="3 person fencing crew with utility - per day - working away" value="4158">OpsLbr-DAYRATELAFHA-3pers</option>
<option data-cost="3777.52" data-cat="Ops - XX Labour" data-markup="33" data-desc="4 person fencing crew with utility - per day - working away" value="4159">OpsLbr-DAYRATELAFHA-4pers</option>
<option data-cost="50.148" data-cat="Ops - XX Labour" data-markup="33" data-desc="Hourly Rate for Fencer" value="4138">OpsLbr-Fencer-HR</option>
<option data-cost="340" data-cat="Ops - XX Labour" data-markup="33" data-desc="Daily surcharge for staff member working away" value="4156">OpsLbr-LAFHA-DAY</option>
<option data-cost="14" data-cat="Ops - XX Labour" data-markup="33" data-desc="Hourly rate surcharge for Staff living away" value="4139">OpsLbr-LAFHA-HR</option>
<option data-cost="1.4" data-cat="Ops - XX Labour" data-markup="33" data-desc="Hourly rate surcharge for PM supervision of staff" value="4140">OpsLbr-LAFHASPVR-HR</option>
<option data-cost="57.064" data-cat="Ops - XX Labour" data-markup="33" data-desc="Hourly Rate for Project Manager" value="4136">OpsLbr-ProjectManager-HR</option>
<option data-cost="51.492" data-cat="Ops - XX Labour" data-markup="33" data-desc="Hourly Rate for Site Supervisor" value="4137">OpsLbr-SiteSupervisor-HR</option>
<option data-cost="2600" data-cat="PLCx External Production " data-markup="25" data-desc="External Processomg - Galvanising - Gate Leaves - Greater than 2500H - Require Double Dip - Full Bath" value="3817">WS-EXT-GALV-DBLDIPFULLBATH</option>
<option data-cost="1.407" data-cat="PLCx External Production " data-markup="25" data-desc="External Processing - Cost for Galvanising per kg of steel " value="3017">WS-EXT-GALV-PERKG</option>
<option data-cost="20.16" data-cat="PLCx External Production " data-markup="25" data-desc="External Processing - Powdercoating - Arkote - Tuffkote - 100NB- LM" value="2407">WS-EXT-PC-TK-100NB</option>
<option data-cost="30.24" data-cat="PLCx External Production " data-markup="25" data-desc="External Processing - Powdercoating - Arkote - Tuffkote - 100NB - Bent - LM " value="2415">WS-EXT-PC-TK-100NB-BENT</option>
<option data-cost="40.383" data-cat="PLCx External Production " data-markup="25" data-desc="External Processing - Powdercoating - Arkote - Tuffkote - 100NB with Brackets or Base Plates - LM " value="3019">WS-EXT-PC-TK-100NB-BP</option>
<option data-cost="60.5745" data-cat="PLCx External Production " data-markup="25" data-desc="External Processing - Powdercoating - Arkote - Tuffkote - 100NB bent with Brackets or Base Plates - LM" value="2419">WS-EXT-PC-TK-100NB-BP-BENT</option>
<option data-cost="42" data-cat="PLCx External Production " data-markup="25" data-desc="External Processing - Powdercoating - Arkote - Tuffkote - Greater than 100NB - TO BE QUOTED - LM" value="3891">WS-EXT-PC-TK-100NB-GREATER</option>
<option data-cost="33.075" data-cat="PLCx External Production " data-markup="25" data-desc="External Processing - Powdercoating - Arkote - Tuffkote - 100UC - LM" value="2900">WS-EXT-PC-TK-100UC</option>
<option data-cost="131.5125" data-cat="PLCx External Production " data-markup="25" data-desc="External Processing - Powdercoating - Arkote - Tuffkote - 125x65 PFC Post 4300L - EA" value="3880">WS-EXT-PC-TK-125PFC-4300LPOS</option>
<option data-cost="10.395" data-cat="PLCx External Production " data-markup="25" data-desc="External Processing - Powdercoating - Arkote - Tuffkote - 50 angle - LM " value="3023">WS-EXT-PC-TK-50ANGLE</option>
<option data-cost="9.954" data-cat="PLCx External Production " data-markup="25" data-desc="External Processing - Powdercoating - Arkote - Tuffkote - 50NB or smaller pipe - LM " value="3024">WS-EXT-PC-TK-50NB</option>
<option data-cost="14.931" data-cat="PLCx External Production " data-markup="25" data-desc="External Processing - Powdercoating - Arkote - Tuffkote - 50NB or smaller pipe - Bent - LM" value="2412">WS-EXT-PC-TK-50NB-BENT</option>
<option data-cost="19.845" data-cat="PLCx External Production " data-markup="25" data-desc="External Processing - Powdercoating - Arkote - Tuffkote - 50NB with Brackets or Base Plates - LM " value="2408">WS-EXT-PC-TK-50NB-BP</option>
<option data-cost="29.7675" data-cat="PLCx External Production " data-markup="25" data-desc="External Processing - Powdercoating - Arkote - Tuffkote - 50NB or smaller pipe bent with Brackets or Base Plates - LM" value="2416">WS-EXT-PC-TK-50NB-BP-BENT</option>
<option data-cost="11.676" data-cat="PLCx External Production " data-markup="25" data-desc="External Processing - Powdercoating - Arkote - Tuffkote - 65NB - LM" value="2405">WS-EXT-PC-TK-65NB</option>
<option data-cost="19.089" data-cat="PLCx External Production " data-markup="25" data-desc="External Processing - Powdercoating - Arkote - Tuffkote - 65NB - Bent - LM " value="2413">WS-EXT-PC-TK-65NB-BENT</option>
<option data-cost="25.389" data-cat="PLCx External Production " data-markup="25" data-desc="External Processing - Powdercoating - Arkote - Tuffkote - 65NB or 75SHS with Brackets or Base Plates - LM " value="3029">WS-EXT-PC-TK-65NB-BP</option>
<option data-cost="38.0835" data-cat="PLCx External Production " data-markup="25" data-desc="External Processing - Powdercoating - Arkote - Tuffkote - 65NB bent with Brackets or Base Plates - LM" value="2417">WS-EXT-PC-TK-65NB-BP-BENT</option>
<option data-cost="15.498" data-cat="PLCx External Production " data-markup="25" data-desc="External Processing - Powdercoating - Arkote - Tuffkote - 80NB - LM" value="2406">WS-EXT-PC-TK-80NB</option>
<option data-cost="21.147" data-cat="PLCx External Production " data-markup="25" data-desc="External Processing - Powdercoating - Arkote - Tuffkote - 80NB - bent - LM " value="2414">WS-EXT-PC-TK-80NB-BENT</option>
<option data-cost="30.996" data-cat="PLCx External Production " data-markup="25" data-desc="External Processing - Powdercoating - Arkote - Tuffkote - 80NB with Brackets or Base Plates - LM" value="2410">WS-EXT-PC-TK-80NB-BP</option>
<option data-cost="0.525" data-cat="PLCx External Production " data-markup="25" data-desc="External Processing - Powdercoating - Arkote - Tuffkote - Small items, eg bolts, minimum order 1000 - EA" value="2931">WS-EXT-PC-TK-BULK-SMALLS</option>
<option data-cost="39.816" data-cat="PLCx External Production " data-markup="25" data-desc="External Processing- Powdercoating - Tuffkote - Chainmesh gate frame - up to 2400H x 6000L - Per m² " value="3597">WS-EXT-PC-TK-CWGATE</option>
<option data-cost="35.175" data-cat="PLCx External Production " data-markup="25" data-desc="External Processing - Powdercoating - Arkote - Tuffkote - Pale Curved Top W 2950 - EA " value="3883">WS-EXT-PC-TK-PALECRV</option>
<option data-cost="45.423" data-cat="PLCx External Production " data-markup="25" data-desc="External Processing - Powdercoating - Arkote - Tuffkote - Standard fence Panels- m2" value="2496">WS-EXT-PC-TK-PANELS</option>
<option data-cost="92.106" data-cat="PLCx External Production " data-markup="25" data-desc="External Processing - Powdercoating - Arkote - Tuffkote 1800H sliding gate leaf -Standard Colour - 8.41m to 10.4m - per m2" value="3528">WS-EXT-PC-TK-SLDEGATE-LEAF-1.8</option>
<option data-cost="87.066" data-cat="PLCx External Production " data-markup="25" data-desc="External Processing - Powdercoating - Arkote- Tuffkote - Slide Gate U-Post - standard colour - per m2" value="3529">WS-EXT-PC-TK-SLDGATEUPOST</option>
<option data-cost="2.898" data-cat="PLCx External Production " data-markup="25" data-desc="External Processing - Powdercoating - Arkote - Tuffkote - Small items fitting in box size - 105 x 75 x 75 - EA" value="2927">WS-EXT-PC-TK-SMALL-A7</option>
<option data-cost="29.925" data-cat="PLCx External Production " data-markup="25" data-desc="External Processing - Powdercoating - Arkote - Tuffkote - Small items fitting in box size - 300 x 210 x 210 - EA" value="2930">WS-EXT-PC-TK-SMALLS-A4</option>
<option data-cost="19.593" data-cat="PLCx External Production " data-markup="25" data-desc="External Processing - Powdercoating - Arkote - Tuffkote - Small items fitting in box size - 210 x 150 x 150 - EA " value="2929">WS-EXT-PC-TK-SMALLS-A5</option>
<option data-cost="11.277" data-cat="PLCx External Production " data-markup="25" data-desc="External Processing - Powdercoating - Arkote - Tuffkote - Small items fitting in box size - 150 x 105 x 105 - EA " value="2928">WS-EXT-PC-TK-SMALLS-A6</option>
<option data-cost="63.4725" data-cat="PLCx External Production " data-markup="25" data-desc="External Processing - Powdercoating - Arkote - Tuffkote - Tubular Swing Gates - per m2 " value="3043">WS-EXT-PC-TK-TUBSWINGGATES</option>
<option data-cost="25.2" data-cat="PLCx External Production " data-markup="25" data-desc="External Processing - Powdercoating - Arkote - Tuffkote - Weldmesh sheets - per m2 (x2 sides) - 6m2 minimum - M2" value="2924">WS-EXT-PC-TK-WELDMESH</option>
</select>
<script>
var iecats = [{"id":"4143","code":"OpsLbr-DAYRATE-1pers","cost":"720.14","desc":"1 person fencing crew with utility - per day - local","markup":"33","category":"Ops - XX Labour"},{"id":"4152","code":"OpsLbr-DAYRATE-2pers","cost":"1221.62","desc":"2 person fencing crew with utility - per day - local","markup":"33","category":"Ops - XX Labour"},{"id":"4153","code":"OpsLbr-DAYRATE-3pers","cost":"1886.04","desc":"3 person fencing crew with two utilities - per day - local","markup":"33","category":"Ops - XX Labour"},{"id":"4154","code":"OpsLbr-DAYRATE-4pers","cost":"2387.52","desc":"4 person fencing crew with two utilities - per day - local","markup":"33","category":"Ops - XX Labour"},{"id":"4155","code":"OpsLbr-DAYRATELAFHA-1pers","cost":"1060.14","desc":"1 person fencing crew with utility - per day - working away","markup":"33","category":"Ops - XX Labour"},{"id":"4157","code":"OpsLbr-DAYRATELAFHA-2pers","cost":"1911.62","desc":"2 person fencing crew with utility - per day - working away","markup":"33","category":"Ops - XX Labour"},{"id":"4158","code":"OpsLbr-DAYRATELAFHA-3pers","cost":"2926.04","desc":"3 person fencing crew with utility - per day - working away","markup":"33","category":"Ops - XX Labour"},{"id":"4159","code":"OpsLbr-DAYRATELAFHA-4pers","cost":"3777.52","desc":"4 person fencing crew with utility - per day - working away","markup":"33","category":"Ops - XX Labour"},{"id":"4138","code":"OpsLbr-Fencer-HR","cost":"50.148","desc":"Hourly Rate for Fencer","markup":"33","category":"Ops - XX Labour"},{"id":"4156","code":"OpsLbr-LAFHA-DAY","cost":"340","desc":"Daily surcharge for staff member working away","markup":"33","category":"Ops - XX Labour"},{"id":"4139","code":"OpsLbr-LAFHA-HR","cost":"14","desc":"Hourly rate surcharge for Staff living away","markup":"33","category":"Ops - XX Labour"},{"id":"4140","code":"OpsLbr-LAFHASPVR-HR","cost":"1.4","desc":"Hourly rate surcharge for PM supervision of staff","markup":"33","category":"Ops - XX Labour"},{"id":"4136","code":"OpsLbr-ProjectManager-HR","cost":"57.064","desc":"Hourly Rate for Project Manager","markup":"33","category":"Ops - XX Labour"},{"id":"4137","code":"OpsLbr-SiteSupervisor-HR","cost":"51.492","desc":"Hourly Rate for Site Supervisor","markup":"33","category":"Ops - XX Labour"},{"id":"3817","code":"WS-EXT-GALV-DBLDIPFULLBATH","cost":"2600","desc":"External Processomg - Galvanising - Gate Leaves - Greater than 2500H - Require Double Dip - Full Bath","markup":"25","category":"PLCx External Production "},{"id":"3017","code":"WS-EXT-GALV-PERKG","cost":"1.407","desc":"External Processing - Cost for Galvanising per kg of steel ","markup":"25","category":"PLCx External Production "},{"id":"2407","code":"WS-EXT-PC-TK-100NB","cost":"20.16","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 100NB- LM","markup":"25","category":"PLCx External Production "},{"id":"2415","code":"WS-EXT-PC-TK-100NB-BENT","cost":"30.24","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 100NB - Bent - LM ","markup":"25","category":"PLCx External Production "},{"id":"3019","code":"WS-EXT-PC-TK-100NB-BP","cost":"40.383","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 100NB with Brackets or Base Plates - LM ","markup":"25","category":"PLCx External Production "},{"id":"2419","code":"WS-EXT-PC-TK-100NB-BP-BENT","cost":"60.5745","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 100NB bent with Brackets or Base Plates - LM","markup":"25","category":"PLCx External Production "},{"id":"3891","code":"WS-EXT-PC-TK-100NB-GREATER","cost":"42","desc":"External Processing - Powdercoating - Arkote - Tuffkote - Greater than 100NB - TO BE QUOTED - LM","markup":"25","category":"PLCx External Production "},{"id":"2900","code":"WS-EXT-PC-TK-100UC","cost":"33.075","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 100UC - LM","markup":"25","category":"PLCx External Production "},{"id":"3880","code":"WS-EXT-PC-TK-125PFC-4300LPOS","cost":"131.5125","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 125x65 PFC Post 4300L - EA","markup":"25","category":"PLCx External Production "},{"id":"3023","code":"WS-EXT-PC-TK-50ANGLE","cost":"10.395","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 50 angle - LM ","markup":"25","category":"PLCx External Production "},{"id":"3024","code":"WS-EXT-PC-TK-50NB","cost":"9.954","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 50NB or smaller pipe - LM ","markup":"25","category":"PLCx External Production "},{"id":"2412","code":"WS-EXT-PC-TK-50NB-BENT","cost":"14.931","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 50NB or smaller pipe - Bent - LM","markup":"25","category":"PLCx External Production "},{"id":"2408","code":"WS-EXT-PC-TK-50NB-BP","cost":"19.845","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 50NB with Brackets or Base Plates - LM ","markup":"25","category":"PLCx External Production "},{"id":"2416","code":"WS-EXT-PC-TK-50NB-BP-BENT","cost":"29.7675","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 50NB or smaller pipe bent with Brackets or Base Plates - LM","markup":"25","category":"PLCx External Production "},{"id":"2405","code":"WS-EXT-PC-TK-65NB","cost":"11.676","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 65NB - LM","markup":"25","category":"PLCx External Production "},{"id":"2413","code":"WS-EXT-PC-TK-65NB-BENT","cost":"19.089","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 65NB - Bent - LM ","markup":"25","category":"PLCx External Production "},{"id":"3029","code":"WS-EXT-PC-TK-65NB-BP","cost":"25.389","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 65NB or 75SHS with Brackets or Base Plates - LM ","markup":"25","category":"PLCx External Production "},{"id":"2417","code":"WS-EXT-PC-TK-65NB-BP-BENT","cost":"38.0835","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 65NB bent with Brackets or Base Plates - LM","markup":"25","category":"PLCx External Production "},{"id":"2406","code":"WS-EXT-PC-TK-80NB","cost":"15.498","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 80NB - LM","markup":"25","category":"PLCx External Production "},{"id":"2414","code":"WS-EXT-PC-TK-80NB-BENT","cost":"21.147","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 80NB - bent - LM ","markup":"25","category":"PLCx External Production "},{"id":"2410","code":"WS-EXT-PC-TK-80NB-BP","cost":"30.996","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 80NB with Brackets or Base Plates - LM","markup":"25","category":"PLCx External Production "},{"id":"2931","code":"WS-EXT-PC-TK-BULK-SMALLS","cost":"0.525","desc":"External Processing - Powdercoating - Arkote - Tuffkote - Small items, eg bolts, minimum order 1000 - EA","markup":"25","category":"PLCx External Production "},{"id":"3597","code":"WS-EXT-PC-TK-CWGATE","cost":"39.816","desc":"External Processing- Powdercoating - Tuffkote - Chainmesh gate frame - up to 2400H x 6000L - Per m\u00b2 ","markup":"25","category":"PLCx External Production "},{"id":"3883","code":"WS-EXT-PC-TK-PALECRV","cost":"35.175","desc":"External Processing - Powdercoating - Arkote - Tuffkote - Pale Curved Top W 2950 - EA ","markup":"25","category":"PLCx External Production "},{"id":"2496","code":"WS-EXT-PC-TK-PANELS","cost":"45.423","desc":"External Processing - Powdercoating - Arkote - Tuffkote - Standard fence Panels- m2","markup":"25","category":"PLCx External Production "},{"id":"3528","code":"WS-EXT-PC-TK-SLDEGATE-LEAF-1.8","cost":"92.106","desc":"External Processing - Powdercoating - Arkote - Tuffkote 1800H sliding gate leaf -Standard Colour - 8.41m to 10.4m - per m2","markup":"25","category":"PLCx External Production "},{"id":"3529","code":"WS-EXT-PC-TK-SLDGATEUPOST","cost":"87.066","desc":"External Processing - Powdercoating - Arkote- Tuffkote - Slide Gate U-Post - standard colour - per m2","markup":"25","category":"PLCx External Production "},{"id":"2927","code":"WS-EXT-PC-TK-SMALL-A7","cost":"2.898","desc":"External Processing - Powdercoating - Arkote - Tuffkote - Small items fitting in box size - 105 x 75 x 75 - EA","markup":"25","category":"PLCx External Production "},{"id":"2930","code":"WS-EXT-PC-TK-SMALLS-A4","cost":"29.925","desc":"External Processing - Powdercoating - Arkote - Tuffkote - Small items fitting in box size - 300 x 210 x 210 - EA","markup":"25","category":"PLCx External Production "},{"id":"2929","code":"WS-EXT-PC-TK-SMALLS-A5","cost":"19.593","desc":"External Processing - Powdercoating - Arkote - Tuffkote - Small items fitting in box size - 210 x 150 x 150 - EA ","markup":"25","category":"PLCx External Production "},{"id":"2928","code":"WS-EXT-PC-TK-SMALLS-A6","cost":"11.277","desc":"External Processing - Powdercoating - Arkote - Tuffkote - Small items fitting in box size - 150 x 105 x 105 - EA ","markup":"25","category":"PLCx External Production "},{"id":"3043","code":"WS-EXT-PC-TK-TUBSWINGGATES","cost":"63.4725","desc":"External Processing - Powdercoating - Arkote - Tuffkote - Tubular Swing Gates - per m2 ","markup":"25","category":"PLCx External Production "},{"id":"2924","code":"WS-EXT-PC-TK-WELDMESH","cost":"25.2","desc":"External Processing - Powdercoating - Arkote - Tuffkote - Weldmesh sheets - per m2 (x2 sides) - 6m2 minimum - M2","markup":"25","category":"PLCx External Production "}];
</script>
</div>
</div></td>
<td>
<select id="advBomLabourCat" name="advBomLabourCat" class="form-select" onmouseup="updateLabourData();">
<option data-markup="33" data-desc="" value="69">Ops - XX Labour</option>
<option data-markup="25" data-desc="" value="36">PLCx External Production </option>
</select>
<div id="advLabourMUCon" class="col mt-2">Markup: <span id="advLabourCatMarkup">33</span>%</div>
<td>
<textarea class="form-control" id="advBomLabourDesc" name="advBomLabourDesc"></textarea></td>
<td>
<input class="form-control selfocus border-0" type="text" step="0.0001" id="advLabourCost" name="advLabourCost" onchange="this.value = this.getAttribute('ovalue');" ovalue="0" value="0" onfocus="this.blur();"></td>
<td class="d-none">
<input class="form-control selfocus" type="text" step="0.01" id="advLabourSellPrice" name="advLabourSellPrice" value="0"></td>
<td>
<input class="form-control selfocus border-0" type="text" step="0.0001" id="advLabourQty" name="advLabourQty" value="0" onfocus="showHelper (this, 'Labour Quantity is computed as [Total Unit Cost] / [Labour Cost]');this.blur();"></td>
<td>
<input class="form-control selfocus" type="text" step="0.01" id="advLabourSellCost" name="advLabourSellCost" ovalue="0" value="0" onchange="this.value = this.getAttribute('ovalue');" onfocus="showHelper (this, 'This is the Total of the `Process Total Cost` for each processes above');"></td>
</tr>
</tbody>
<input type="hidden" id="advBomLabourCode" name="advBomLabourCode" value="">
<input type="hidden" id="advBomLabourMarkup" name="advBomLabourMarkup" value="0">
</table>
<p class="text-danger">* You may chose to use an existing Non-material time or use the provided Factory Labour Item which will be created when this item is created.&nbsp;&nbsp;If you cannot find the labour item, please make sure this has a UOM of 'HR' or the item name has 'production' or 'labour' in it.</p>
</div>
<div class="row px-4 labouritemcon2 alert alert-danger">
* Please fill in for all processes above in order to select the Labour Item
</div>
</div>
<div class="advOptTabCons" id="advancedOptionsStep4">
<h4 class="text-uppercase bold p-4">Review your Item being created</h4>
<div class="row">
<div class="col p-4">
Shown below are the details of the Item to be added, please review your enty and click next to add this item to the quote or navigate back to change any entry.
</div>
</div>
<div class="card pricingcard">
<div class="card-header">
<div class="col">
<h3>PRICING MARKUP</h3>
</div>
</div>
<div class="card-body row p-1">
<div class="col-2 p-4">
<b>Markup (%)</b>
</div>
<div class="col-4 p-4">
<input type="text" class="form-control" style="width:70px;" name="advBomPreviewMarkup" id="advBomPreviewMarkup" value="25" onfocus="this.select();">
<small class="text text-danger">* Changing the markup will update the Item Price</small>
</div>
<div class="col-2 p-4 advBomPrevsellpriceLabel">
<b>Item Price:</b>
</div>
<div class="col-4 p-4 advBomPrevsellprice">
</div>
</div>
</div>
<div class="card mt-4">
<div class="card-header">
<div class="col">
<h3>Item Information</h3>
</div>
</div>
<div class="card-body row p-1">
<div class="col-2 p-4">
<b>Item Code:</b>
</div>
<div class="col-4 p-4 advBomPrevitemcode">
</div>
<div class="col-2 p-4">
<b>UOM:</b>
</div>
<div class="col-4 p-4 advBomPrevuom">
</div>
</div>
<div class="row p-1">
<div class="col px-4">
<b>Description:</b>
</div>
</div>
<div class="row p-1">
<div class="col p-4 pt-2 pb-0 advBomPrevitemdesc">
</div>
</div>
<div class="row p-1">
<div class="col-2 p-4">
<b>Category:</b>
</div>
<div class="col-4 p-4 advBomPrevcategory">
</div>
<div class="col-2 p-4">
<b>Item Cost:</b>
</div>
<div class="col-4 p-4 advBomPrevbuyprice">
</div>
</div>
<div class="row p-1">
<div class="col-2 p-4">
<b>Notes:</b>
</div>
<div class="col-4 p-4 advBomPrevcategory">
</div>
</div>
<div class="row p-1">
<div class="col p-4 pt-2 advBomPrevnotes">
</div>
</div>
</div>
<div class="card mt-4">
<div class="card-header">
<div class="col">
<h3>Bill of Materials</h3>
</div>
</div>
<div class="card-body p-3">
<table id="bomAdvPreviewTable" class="table table-responsive" data-sortable>
<thead>
<th>
</th>
<th>
<b>Code</b></th>
<th>
<b>Description</b></th>
<th>
<b>UOM</b></th>
<th>
<b>Avail</b></th>
<th class="text-end">
<b>Cost</b></th>
<th class="d-none">
<b>Avg Cost</b></th>
<th class="text-end">
<b>Qty</b></th>
<th class="text-end">
<b>Sub-total</b></th>
</thead>
<tbody class="advBomPrevBOM">
<tr>
<td>
${cnt}</td>
<td>
${code}</td>
<td>
${desc}</td>
<td>
${soh}</td>
<td class="text-end">
${avail}</td>
<td class="text-end">
$${cost}</td>
<td class="d-none">
$${avgcost}</td>
<td class="text-end">
${qty}</td>
<td class="text-end">
${subtotal}</td>
</tr>
</tbody>
<tfoot>
<td colspan="7"><b>TOTAL:</b></td><td style="text-align:right;"><b>$<span class="advBomPrevBOMTotal"></span></b></td>
</tfoot>
</table>
</div>
</div>
<div class="card mt-4">
<div class="card-header">
<div class="col">
<h3>Processes and Costing</h3>
</div>
</div>
<div class="card-body p-3 advBomPrevProcesses">
<h3><span class="advBomRouteName"></span></h3>
<pre class="mx-1 advBomRouteDesc"></pre>
<table class="table table-responsive">
<thead>
<th>
<b>Process<b></th>
<th><b>Type<b></th> <th>
<b>Notes<b></th>
<th>
<b>Time (min)<b></th>
<th>
<b>Qty Break (min)<b></th>
<th>
<b>Unit Cost</b></th>
<th class="d-none">
<b>Total Time (min)<b></th>
<th>
<b>Total Cost<b></th>
</thead>
<tbody id="advBomPreviewProcess">
<tr>
<td style="white-space:nowrap;">
<span style="display:inline-block;margin-left:${margin};">${process}</span></td>
<td>
${unit}</td> <td>
${notes}</td>
<td>
${time}</td>
<td>
${qty}</td>
<td>
$${unitcost}</td>
<td class="d-none">
${totaltime}</td>
<td>
$${totalcost}</td>
</tr>
</tbody>
<tfoot>
<tr>
<td class="tdspace"></td>
<td class="tdspace"></td>
<td>
<b>TOTAL:</b></td>
<td>
<b class="ptime"></b></td>
<td>
<b class="pqty"></b></td>
<td>
<b class="pcost"></b></td>
<td>
<b class="pbtime"></b></td>
<td>
<b class="pbcost"></b></td>
</tr>
</tfoot>
</table>
<div class="row d-none">
<div class="col-6">
<label><b>Update Item Cost from BOM: </b></label>
<span class="BOMUpdate"></span>
</div>
</div>
</div>
</div>
</div>
<div class="advOptTabCons" id="advancedOptionsStep5">
<h4 class="text-uppercase bold p-4">Creating your Inventory Item</h4>
<div class="row">
<div class="col p-4">
Please wait while we create this Inventory Item in the system and add it to your quote.
<br>
<br>
<ul style="line-height:25px;">
<li>Create Inventory Item&nbsp;&nbsp;<i class="material-symbols-rounded d-none step51">sprint</i></li>
<li>Add Bill of Materials&nbsp;&nbsp;<i class="material-symbols-rounded d-none step52">sprint</i></li>
<li>Set Manufacturing Processes&nbsp;&nbsp;<i class="material-symbols-rounded d-none step53">sprint</i></li>
<li>Set Manufacturing Times and Costs&nbsp;&nbsp;<i class="material-symbols-rounded d-none step54">sprint</i></li>
<li>Add Item to Quote&nbsp;&nbsp;<i class="material-symbols-rounded d-none step55">sprint</i></li>
</ul>
</div>
</div>
<div class="row">
<div class="col px-4">
<div class="alert alert-warning">Please do not leave this page while we finish this activity.</div>
</div>
</div>
</div>
<div class="AdvBomImportBOM" style="display:none;">
<div class="container-fluid text-start m-3 ">
<div class="form-group">
<label>Please Select Source Kit Item To Import BOM From:</label>
<div class="input-group">
<div class="input-group-text"><i class="material-symbols-rounded">search</i></div>
<input type='text' name='AdvBomitemFilterImport' class="form-control" ID='AdvBomitemFilterImport' evo-filter-tgt="AdvBomitemFilterImportSelect" evo-filter-type="inv" value="" placeholder="Item Code" getCloneKit="1">
</div>
<div class="filtered_list">
<select class="filtered_list form-control" name="AdvBomitemFilterImportSelect" id="AdvBomitemFilterImportSelect" size=8 onchange="code = ''; try { code = this.options[this.selectedIndex].dataset.code; } catch (err) { }; if (code != '') document.querySelector('#AdvBomitemFilterImport').value = code; previewCloneKit();" onmouseup="previewCloneKit();code = ''; try { code = this.options[this.selectedIndex].dataset.code; } catch (err) { }; if (code != '') document.querySelector('#AdvBomitemFilterImport').value = code; previewCloneKit();" getCloneKit="1">
<option>Please Select</option>
</select>
</div>
</div>
<div class="form-group row">
<input type="hidden" value="0" name="itemid" />
<div class="col-8"></div>
</div>
<div class="form-group row">
<p>
The selected Inventory Item above has the following Bill of Materials, please click on "IMPORT BOM" above to continue with the import or select another Item from the list.
</p>
<div class="advBomImportBomList">
</div>
</div>
</div>
</div>

<br>
<br>
<div class="row d-none">
<div class="col text-end navigationButtons">
<div class="row advBomSTCCB d-none" style="width: 70%;text-align: left;margin-left: 1rem;margin-right: auto;"><div class="form-check"><input class="form-check-input" type="checkbox" value="1" id="chkIncludeSetupTime"><label class="form-check-label" for="chkIncludeSetupTime">&nbsp;Include Setup Time and Cost in 'Factory Labour' BOM Time and Cost.</label>&nbsp;&nbsp;<i class="material-symbols-rounded" style="cursor:pointer;" onclick="doAlertModal (advBomExplanation, undefined, 'Detailed Explanation');">help</i></div></div>
<button id="actImportBOM" class="btn btn-success text-uppercase" onmouseup="this.style.display = 'none';openImportModal();" style="display:none;">Import BOM</button>
<button class="btn btn-success text-uppercase" id="getcloneKit" onclick="getCloneKit();" style="display:none;">Import BOM from Selected Item</button>
<button class="btn btn-danger text-uppercase" id="cancelgetcloneKit" onclick="cancelImportBOM();" style="display:none;">Cancel Import</button>
<button type="button" onclick="advBomCancelCreation ();" class="advBomCancelCreation btn btn-danger custProcess4" style="display:none;">Cancel Route Creation</button>
<button type="button" class="btn btn-success custProcess1 text-uppercase" onclick="advBomImportProcess ();" style="display:none;">Import selected route as a new route/process</button>
<button type="button" class="btn btn-info custProcess2 text-uppercase" onclick="advBomCreateProcess ();" style="display:none;">Create new route/process</button>
<button style="display:none !important;" class="btn btn-primary text-uppercase" id="btnAdvOptRestart" onmouseup="advOptRestart();">Add Another Item</button>
<button style="display:none !important;" class="btn btn-primary text-uppercase" id="btnAdvOptFinish" onmouseup="advOptFinish();">Close Screen</button>
<button class="btn btn-secondary text-uppercase" id="btnAdvOptPrev" onmouseup="advOptPrevStep();">Previous</button>
<button class="btn btn-primary text-uppercase" id="btnAdvOptNext" onmouseup="advOptNextStep();">Next</button>
<button class="btn btn-warning text-uppercase" id="advOptCancel" onmouseup="advOptCancel();">Cancel</button>
</div>
<div class="col cloneKitPreview">
<table class="table table-reponsive" data-sortable>
<thead>
<th>
<b>Code</b></th>
<th>
<b>Desc</b></th>
<th>
<b>SOH</b></th>
<th>
<b>Avail</b></th>
<th>
<b>Cost</b></th>
</thead>
<tbody>
<tr>
<td>${bomItem.code}</td>
<td>${bomItem.desc}</td>
<td>${bomItem.soh}</td>
<td>${(bomItem.soh - bomItem.allocated)}</td>
<td>${numWithDec(bomItem.cost)}</td>
</tr>
</tbody>
</table>
<br>
* Production / Non-material Inventory are excluded from the Import.
</div>
</div>
</div>
<input type="hidden" id="advOptCurStep" value="1">
</form>

<script>
var processListIDs = JSON.parse('{"15":15,"16":16,"17":17,"18":18,"20":20,"21":21,"22":22,"23":23,"24":24,"26":26,"27":27,"28":28,"30":30,"31":31,"32":32,"33":33,"34":34,"35":35,"36":36,"37":37,"38":38,"43":43,"0":"","1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":"","9":"","10":"","11":"","12":"","13":"","14":"","19":"","25":"","29":"","39":"","40":"","41":"","42":""}');
var processListNames = JSON.parse('{"15":"2-CUT - Tube Laser","16":"EXT - Bed Laser Cutting","17":"4-CUT - Pack-Cut \/ Bandsaw","18":"CUT - Drop Saw","20":"FORM - Cropping","21":"FORM - Pipe Notching","22":"3-FORM - Pipe Crimping","23":"FORM - Pipe Swaging","24":"FORM - Post Cranking \/ Pipe Bending","26":"FORM - Punching","27":"6-FORM - Drilling","28":"FORM - Picket \/ Spear Forming","30":"Twitch Cutting","31":"Wire Winding","32":"Lacing Tool Winding","33":"Gate Lacing \/ Barbs","34":"7-Welding","35":"Capping Posts","36":"5-EXT - Hot Dip Galvanising","37":"EXT - Powder Coating","38":"8-Paint Application","43":"1-FABRICATE GENERAL-P","0":"","1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":"","9":"","10":"","11":"","12":"","13":"","14":"","19":"","25":"","29":"","39":"","40":"","41":"","42":""}');
var manufacturingEnableProcessTypes = 'Enabled' == 'Enabled';
var exCats = [];
exCats.push(69);exCats.push(36); var exCatData = [];
exCatData.push(JSON.parse('{"id":69,"name":"Ops - XX Labour","description":"Operations and Installation - Labour - Workings only do not charge","markup":33}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
exCatData.push(JSON.parse('{"id":36,"name":"PLCx External Production ","description":"Factory Production Costs - External","markup":25}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
var iexCatData = [];
iexCatData.push(JSON.parse('{"id":"4143","code":"OpsLbr-DAYRATE-1pers","cost":"720.14","desc":"1 person fencing crew with utility - per day - local","markup":"33","category":"Ops - XX Labour"}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"4152","code":"OpsLbr-DAYRATE-2pers","cost":"1221.62","desc":"2 person fencing crew with utility - per day - local","markup":"33","category":"Ops - XX Labour"}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"4153","code":"OpsLbr-DAYRATE-3pers","cost":"1886.04","desc":"3 person fencing crew with two utilities - per day - local","markup":"33","category":"Ops - XX Labour"}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"4154","code":"OpsLbr-DAYRATE-4pers","cost":"2387.52","desc":"4 person fencing crew with two utilities - per day - local","markup":"33","category":"Ops - XX Labour"}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"4155","code":"OpsLbr-DAYRATELAFHA-1pers","cost":"1060.14","desc":"1 person fencing crew with utility - per day - working away","markup":"33","category":"Ops - XX Labour"}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"4157","code":"OpsLbr-DAYRATELAFHA-2pers","cost":"1911.62","desc":"2 person fencing crew with utility - per day - working away","markup":"33","category":"Ops - XX Labour"}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"4158","code":"OpsLbr-DAYRATELAFHA-3pers","cost":"2926.04","desc":"3 person fencing crew with utility - per day - working away","markup":"33","category":"Ops - XX Labour"}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"4159","code":"OpsLbr-DAYRATELAFHA-4pers","cost":"3777.52","desc":"4 person fencing crew with utility - per day - working away","markup":"33","category":"Ops - XX Labour"}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"4138","code":"OpsLbr-Fencer-HR","cost":"50.148","desc":"Hourly Rate for Fencer","markup":"33","category":"Ops - XX Labour"}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"4156","code":"OpsLbr-LAFHA-DAY","cost":"340","desc":"Daily surcharge for staff member working away","markup":"33","category":"Ops - XX Labour"}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"4139","code":"OpsLbr-LAFHA-HR","cost":"14","desc":"Hourly rate surcharge for Staff living away","markup":"33","category":"Ops - XX Labour"}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"4140","code":"OpsLbr-LAFHASPVR-HR","cost":"1.4","desc":"Hourly rate surcharge for PM supervision of staff","markup":"33","category":"Ops - XX Labour"}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"4136","code":"OpsLbr-ProjectManager-HR","cost":"57.064","desc":"Hourly Rate for Project Manager","markup":"33","category":"Ops - XX Labour"}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"4137","code":"OpsLbr-SiteSupervisor-HR","cost":"51.492","desc":"Hourly Rate for Site Supervisor","markup":"33","category":"Ops - XX Labour"}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"3817","code":"WS-EXT-GALV-DBLDIPFULLBATH","cost":"2600","desc":"External Processomg - Galvanising - Gate Leaves - Greater than 2500H - Require Double Dip - Full Bath","markup":"25","category":"PLCx External Production "}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"3017","code":"WS-EXT-GALV-PERKG","cost":"1.407","desc":"External Processing - Cost for Galvanising per kg of steel ","markup":"25","category":"PLCx External Production "}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"2407","code":"WS-EXT-PC-TK-100NB","cost":"20.16","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 100NB- LM","markup":"25","category":"PLCx External Production "}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"2415","code":"WS-EXT-PC-TK-100NB-BENT","cost":"30.24","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 100NB - Bent - LM ","markup":"25","category":"PLCx External Production "}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"3019","code":"WS-EXT-PC-TK-100NB-BP","cost":"40.383","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 100NB with Brackets or Base Plates - LM ","markup":"25","category":"PLCx External Production "}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"2419","code":"WS-EXT-PC-TK-100NB-BP-BENT","cost":"60.5745","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 100NB bent with Brackets or Base Plates - LM","markup":"25","category":"PLCx External Production "}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"3891","code":"WS-EXT-PC-TK-100NB-GREATER","cost":"42","desc":"External Processing - Powdercoating - Arkote - Tuffkote - Greater than 100NB - TO BE QUOTED - LM","markup":"25","category":"PLCx External Production "}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"2900","code":"WS-EXT-PC-TK-100UC","cost":"33.075","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 100UC - LM","markup":"25","category":"PLCx External Production "}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"3880","code":"WS-EXT-PC-TK-125PFC-4300LPOS","cost":"131.5125","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 125x65 PFC Post 4300L - EA","markup":"25","category":"PLCx External Production "}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"3023","code":"WS-EXT-PC-TK-50ANGLE","cost":"10.395","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 50 angle - LM ","markup":"25","category":"PLCx External Production "}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"3024","code":"WS-EXT-PC-TK-50NB","cost":"9.954","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 50NB or smaller pipe - LM ","markup":"25","category":"PLCx External Production "}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"2412","code":"WS-EXT-PC-TK-50NB-BENT","cost":"14.931","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 50NB or smaller pipe - Bent - LM","markup":"25","category":"PLCx External Production "}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"2408","code":"WS-EXT-PC-TK-50NB-BP","cost":"19.845","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 50NB with Brackets or Base Plates - LM ","markup":"25","category":"PLCx External Production "}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"2416","code":"WS-EXT-PC-TK-50NB-BP-BENT","cost":"29.7675","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 50NB or smaller pipe bent with Brackets or Base Plates - LM","markup":"25","category":"PLCx External Production "}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"2405","code":"WS-EXT-PC-TK-65NB","cost":"11.676","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 65NB - LM","markup":"25","category":"PLCx External Production "}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"2413","code":"WS-EXT-PC-TK-65NB-BENT","cost":"19.089","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 65NB - Bent - LM ","markup":"25","category":"PLCx External Production "}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"3029","code":"WS-EXT-PC-TK-65NB-BP","cost":"25.389","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 65NB or 75SHS with Brackets or Base Plates - LM ","markup":"25","category":"PLCx External Production "}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"2417","code":"WS-EXT-PC-TK-65NB-BP-BENT","cost":"38.0835","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 65NB bent with Brackets or Base Plates - LM","markup":"25","category":"PLCx External Production "}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"2406","code":"WS-EXT-PC-TK-80NB","cost":"15.498","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 80NB - LM","markup":"25","category":"PLCx External Production "}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"2414","code":"WS-EXT-PC-TK-80NB-BENT","cost":"21.147","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 80NB - bent - LM ","markup":"25","category":"PLCx External Production "}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"2410","code":"WS-EXT-PC-TK-80NB-BP","cost":"30.996","desc":"External Processing - Powdercoating - Arkote - Tuffkote - 80NB with Brackets or Base Plates - LM","markup":"25","category":"PLCx External Production "}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"2931","code":"WS-EXT-PC-TK-BULK-SMALLS","cost":"0.525","desc":"External Processing - Powdercoating - Arkote - Tuffkote - Small items, eg bolts, minimum order 1000 - EA","markup":"25","category":"PLCx External Production "}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"3597","code":"WS-EXT-PC-TK-CWGATE","cost":"39.816","desc":"External Processing- Powdercoating - Tuffkote - Chainmesh gate frame - up to 2400H x 6000L - Per m\u00b2 ","markup":"25","category":"PLCx External Production "}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"3883","code":"WS-EXT-PC-TK-PALECRV","cost":"35.175","desc":"External Processing - Powdercoating - Arkote - Tuffkote - Pale Curved Top W 2950 - EA ","markup":"25","category":"PLCx External Production "}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"2496","code":"WS-EXT-PC-TK-PANELS","cost":"45.423","desc":"External Processing - Powdercoating - Arkote - Tuffkote - Standard fence Panels- m2","markup":"25","category":"PLCx External Production "}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"3528","code":"WS-EXT-PC-TK-SLDEGATE-LEAF-1.8","cost":"92.106","desc":"External Processing - Powdercoating - Arkote - Tuffkote 1800H sliding gate leaf -Standard Colour - 8.41m to 10.4m - per m2","markup":"25","category":"PLCx External Production "}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"3529","code":"WS-EXT-PC-TK-SLDGATEUPOST","cost":"87.066","desc":"External Processing - Powdercoating - Arkote- Tuffkote - Slide Gate U-Post - standard colour - per m2","markup":"25","category":"PLCx External Production "}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"2927","code":"WS-EXT-PC-TK-SMALL-A7","cost":"2.898","desc":"External Processing - Powdercoating - Arkote - Tuffkote - Small items fitting in box size - 105 x 75 x 75 - EA","markup":"25","category":"PLCx External Production "}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"2930","code":"WS-EXT-PC-TK-SMALLS-A4","cost":"29.925","desc":"External Processing - Powdercoating - Arkote - Tuffkote - Small items fitting in box size - 300 x 210 x 210 - EA","markup":"25","category":"PLCx External Production "}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"2929","code":"WS-EXT-PC-TK-SMALLS-A5","cost":"19.593","desc":"External Processing - Powdercoating - Arkote - Tuffkote - Small items fitting in box size - 210 x 150 x 150 - EA ","markup":"25","category":"PLCx External Production "}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"2928","code":"WS-EXT-PC-TK-SMALLS-A6","cost":"11.277","desc":"External Processing - Powdercoating - Arkote - Tuffkote - Small items fitting in box size - 150 x 105 x 105 - EA ","markup":"25","category":"PLCx External Production "}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"3043","code":"WS-EXT-PC-TK-TUBSWINGGATES","cost":"63.4725","desc":"External Processing - Powdercoating - Arkote - Tuffkote - Tubular Swing Gates - per m2 ","markup":"25","category":"PLCx External Production "}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
iexCatData.push(JSON.parse('{"id":"2924","code":"WS-EXT-PC-TK-WELDMESH","cost":"25.2","desc":"External Processing - Powdercoating - Arkote - Tuffkote - Weldmesh sheets - per m2 (x2 sides) - 6m2 minimum - M2","markup":"25","category":"PLCx External Production "}'.replaceAll('\n','\\n').replaceAll('\r','\\r')));
var advanceOptionModal = '1';
var modjc = '2';
</script>

</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>

<style>
.modInvTabCons h4 {
font-weight: bold;
padding-left: 0.6em !important;
padding-bottom: 0px !important;
}</style>

<div class="modInvNavItem d-none">
<li class="modInvNav nav-item active" data-index="0">
<a class='nav-link pointer h4 text-uppercase'>Edit Item Info</a>
</li>
<li><b><span class="material-symbols-rounded">
arrow_forward_ios
</span></b></li>
</div>
<div class="modInvTabCons d-none" id="modInvOptionStep0" style="margin-bottom:-40px;">
<h4 class="text-uppercase bold p-4"><span id="modInvItemHead"></span> Item Information</h4>
<div class="row">
<div class="col">
<div class="text-start p-2 my-2">
<div class="form-row d-none">
<div class="form-group col-4">
<label for="code">Code</label>
<input name="code" id="modInvcode" type="hidden" value="">
<span id="modInvCodeDisp"></span>
</div>
</div>

<div class="form-group">
<label for="description">Description</label>
<textarea name="description" rows="3" cols="50" id="modInvdescription" class="form-control required"></textarea>
</div>

<div class="form-group pt-2 d-none">
<div class="form-row">
<div class="col-2">
<label for="notes">Internal Notes</label>
</div>
</div>
<textarea name="notes" rows="2" id="modInvnotes" class="form-control"></textarea>
<div class="col text-bold text-end text-uppercase">
Specifiy supplier, item code, contact details, etc
</div>
</div>

<div class="form-group d-none">
<div class="form-row">
<div class="col-2">
<label for="customer_notes">Notes to Customer</label>
</div>
</div>
<textarea name="customer_notes" rows="2" id="modInvcustomer_notes" class="form-control required"></textarea>
<div class="col text-bold text-end text-uppercase">
By default, this note is added to the Quote Line Item Description
</div>
</div>

<div class="form-group d-none">
<label for="category">Category</label>
<select class="form-select required" name="cat" onchange="addSpecRow();applyCatDefaults();" id="modInvcategory">
<option value="">Please Select</option>
<option value='86' >! Legacy Codes</option><option value='45' >!. Codes for Recycling</option><option value='24' >!Generic Fencing Prices</option><option value='31' >Bluedog Spear Top</option><option value='2' >Chainlink Fittings </option><option value='14' >Chainlink Gates</option><option value='25' >Chainwire Fencing</option><option value='30' >Colorbond Fencing</option><option value='34' >Concreting</option><option value='3' >Eltrak Gate Systems</option><option value='33' >Gate Automation</option><option value='87' >Gate Sub-assemblies</option><option value='1' >Miscellaneous</option><option value='68' >Operations</option><option value='73' >Operations - Installation</option><option value='74' >Ops - Materials</option><option value='70' >Ops - Plant</option><option value='72' >Ops - Services</option><option value='71' >Ops - Subcontracting</option><option value='69' >Ops - XX Labour</option><option value='32' >Palisade Fencing</option><option value='5' >PIPE</option><option value='47' >PLCx Chainlink</option><option value='12' >PLCx Chainlink Fabric</option><option value='85' >PLCx Custom Items</option><option value='36' >PLCx External Production </option><option value='49' >PLCx Fabrication</option><option value='80' >PLCx Fasteners</option><option value='66' >PLCx Fittings</option><option value='84' >PLCx Freight</option><option value='51' >PLCx Hollow Section</option><option value='52' >PLCx Hot Rolled</option><option value='79' >PLCx Palisade</option><option value='50' >PLCx Pipe</option><option value='59' >PLCx Post</option><option value='64' >PLCx Products</option><option value='53' >PLCx Raw Steel</option><option value='81' >PLCx Timber</option><option value='63' >PLCx Weld Mesh</option><option value='58' >PLCx Weldmesh</option><option value='82' >PLCx Wire</option><option value='83' >PLCx Wire - Bundled</option><option value='67' >PLCx Z Ed Working</option><option value='56' >PLCx Z Mitch Working</option><option value='57' >PLCx Z Pat Working </option><option value='42' >PLCx Z Pete Working</option><option value='21' >Rural Fencing</option><option value='23' >SA WATER RURAL</option><option value='27' >SA Water Spear Top</option><option value='38' >SAPN Fencing</option><option value='22' >Signage</option><option value='17' >Steel</option><option value='19' >Steel - Commercial Pipe</option><option value='20' >Steel - Commercial Pipe H</option><option value='8' >Steel - Flat Bar</option><option value='18' >Steel - RHS</option><option value='26' >Tubular Fencing</option><option value='4' >Tubular Gate Fittings</option><option value='28' >Tubular Gates</option><option value='11' >Unapproved</option><option value='35' >Weldmesh Fencing</option><option value='9' >Weldmesh Raw Materials</option> </select>
<span id="modInvcategory_error" class="text-danger"></span>
<input type="hidden" name="catShort" id="modInvcatShort" value="">
<input type="hidden" name="autoCode" id="modInvautoCode" value="">
<script>
var categories = new Array();
categories.push(new Array("86","! Legacy Codes","LEGACY","0","Legacy Codes that are inactive but still feed BOMs - Do not use","0","0","0","0","0",""));categories.push(new Array("45","!. Codes for Recycling","Z","0","Overwrite codes from this category when starting new inventory item","0","0","0","0","0",""));categories.push(new Array("24","!Generic Fencing Prices","GEN","0","Generic Pricing for all Fence Types","33","0","0","1","0",""));categories.push(new Array("31","Bluedog Spear Top","Spear To","26","Tubular Fencing Spear Top","25","1","84","155","17",""));categories.push(new Array("2","Chainlink Fittings ","CLFIT","0","XX Chainlink Fittings-all items require review-price, supplier etc. XX","80","1","84","1","0",""));categories.push(new Array("14","Chainlink Gates","CLG","0","Chainlink Gates","30","1","84","1","20",""));categories.push(new Array("25","Chainwire Fencing","CW","0","Chainwire Fencing materials and install separate rates","25","0","0","1","0",""));categories.push(new Array("30","Colorbond Fencing","CBOND","0","Colorbond Fencing Install and material separate rate","25","0","0","1","0",""));categories.push(new Array("34","Concreting","CONCR","0","Concreting inventory items","25","1","84","1","0",""));categories.push(new Array("3","Eltrak Gate Systems","ELTRAK","0","Vater Gate Fittings","30","1","84","155","17",""));categories.push(new Array("33","Gate Automation","AUTO","0","Automation for Gates","25","0","84","1","0",""));categories.push(new Array("87","Gate Sub-assemblies","GATESUB","0","To capture all pre-manufactured gate sub-assemblies, eg, hinges, etc","25","1","0","155","19",""));categories.push(new Array("1","Miscellaneous","MISC","0","Default Miscellaneous category for Evolution ERP","20","1","84","1","20",""));categories.push(new Array("68","Operations","OPS","0","Operations and Installation","33","0","0","1","0",""));categories.push(new Array("73","Operations - Installation","OPSLBR","0","Installation Charge Out Rates","33","0","0","1","0",""));categories.push(new Array("74","Ops - Materials","OPSMAT","68","Operations and Installation - Materials and Consumables","33","1","84","1","17",""));categories.push(new Array("70","Ops - Plant","OPSPLANT","68","Operations and Installation - Plant and Equipment","33","0","0","1","0",""));categories.push(new Array("72","Ops - Services","OPSSERV","68","Operations and Installation - External Services","33","0","84","1","0",""));categories.push(new Array("71","Ops - Subcontracting","OPSSUB","68","Operations and Installation - Subcontracting","33","0","84","1","0",""));categories.push(new Array("69","Ops - XX Labour","OPSLBR","68","Operations and Installation - Labour - Workings only do not charge","33","0","0","1","0",""));categories.push(new Array("32","Palisade Fencing","Palisade","0","Palisade Fencing","25","0","0","1","0",""));categories.push(new Array("5","PIPE","PI","0","Round Hollow Pipe","25","1","84","1","20",""));categories.push(new Array("47","PLCx Chainlink","PLCxCL","0","PLCx Saleable Items - Chainlink Fencing Products","50","1","84","155","20",""));categories.push(new Array("12","PLCx Chainlink Fabric","CL","47","Chainlink Rolls","25","1","84","155","17",""));categories.push(new Array("85","PLCx Custom Items","custom","0","Contains codes which can be BOM modified to enter anything onto a quote","50","0","0","155","0",""));categories.push(new Array("36","PLCx External Production ","Fact/Ext","0","Factory Production Costs - External","25","0","0","1","0",""));categories.push(new Array("49","PLCx Fabrication","WS-","0","Used to capture standard internal factory, workshop, labour, plant and processing charge rates","0","0","0","155","0",""));categories.push(new Array("80","PLCx Fasteners","plcxfast","0","For all screws, bolts, nuts, fasteners, etc","25","1","84","155","17",""));categories.push(new Array("66","PLCx Fittings","FIT","0","caps-fittings-hinges-rollers-gate components","50","1","84","155","17",""));categories.push(new Array("84","PLCx Freight","PLCXFREI","0","For all materials related freight","25","0","84","155","0",""));categories.push(new Array("51","PLCx Hollow Section","HS","53","PLCx Hollow Section","50","1","84","155","19",""));categories.push(new Array("52","PLCx Hot Rolled","Black","53","PLCx- PFC, UB, ANGLE, FLAT, SOLID etc.","50","1","84","155","19",""));categories.push(new Array("79","PLCx Palisade","PLCXPAL","0","PLCx Saleable Items - Palisade Fencing Products","50","1","0","155","20",""));categories.push(new Array("50","PLCx Pipe","PIPE","53","NB PIPE","50","1","84","155","19",""));categories.push(new Array("59","PLCx Post","PLCxP","47","Chainlink post","0","1","0","155","0",""));categories.push(new Array("64","PLCx Products","PLCxP","0","PLCx manufactured/supplied products","80","1","84","155","17",""));categories.push(new Array("53","PLCx Raw Steel","Raw Stee","0","PLCx Raw Steel ","50","1","84","155","19",""));categories.push(new Array("81","PLCx Timber","plcxtimb","0","For timber products","25","1","84","155","17",""));categories.push(new Array("63","PLCx Weld Mesh","WM","58","Weld Mesh panels","33","1","84","155","18",""));categories.push(new Array("58","PLCx Weldmesh","WM-","0","PLCx Weldmesh Products","33","1","84","155","18",""));categories.push(new Array("82","PLCx Wire","plcxwire","0","For wire products other than chainlink, including raw wire","25","1","84","155","17",""));categories.push(new Array("83","PLCx Wire - Bundled","plcxwire","82","Bundled Wire Rolls","50","0","0","155","0",""));categories.push(new Array("67","PLCx Z Ed Working","ED","0","Ed custom products","0","1","0","155","19",""));categories.push(new Array("56","PLCx Z Mitch Working","PLCxM","0","Working Folder for MW","0","0","0","155","0",""));categories.push(new Array("57","PLCx Z Pat Working ","PLCxP","0","Working folder for PL","0","0","0","155","0",""));categories.push(new Array("42","PLCx Z Pete Working","ZS","0","xx","0","0","0","0","0",""));categories.push(new Array("21","Rural Fencing","rural","0","Rural Fencing Materials","25","1","84","1","18",""));categories.push(new Array("23","SA WATER RURAL","SAWRURAL","21","SA Water Rural to TS0121","25","0","0","1","0",""));categories.push(new Array("27","SA Water Spear Top","SAWSPEAR","26","SA Water Spear Top","0","0","84","0","0",""));categories.push(new Array("38","SAPN Fencing","SAPN Gen","0","SAPN Generic Rates for Fencing","33","0","0","0","0",""));categories.push(new Array("22","Signage","SIGN","0","Signage","25","1","84","1","20",""));categories.push(new Array("17","Steel","ST","0","Parent category for purchased steel products","0","1","84","1","20",""));categories.push(new Array("19","Steel - Commercial Pipe","STCP","17","Commercial Galvanized Pipe","25","1","84","1","20",""));categories.push(new Array("20","Steel - Commercial Pipe H","STCPHDG","17","Hot dipped glavanized Pipe","30","1","84","1","20",""));categories.push(new Array("8","Steel - Flat Bar","SFL","17","Flat Bar","25","1","84","77","18",""));categories.push(new Array("18","Steel - RHS","ST-RHS","17","Rectangular Hollow section and Square hollow section","0","1","84","1","20",""));categories.push(new Array("26","Tubular Fencing","TUBULAR","0","Tubular Fencing","25","0","0","1","0",""));categories.push(new Array("4","Tubular Gate Fittings","GF-TUBUL","0","Tubular Gate Fittings and Hardware that is Purchased","100","1","84","155","17",""));categories.push(new Array("28","Tubular Gates","TSG","0","Tubular Sliding, Cantilever and Swing Gates","33","1","0","155","17",""));categories.push(new Array("11","Unapproved","TBP","0","Unappoved imports","1","0","0","1","0",""));categories.push(new Array("35","Weldmesh Fencing","Weldmesh","0","Weldmesh Fencing Materials &amp; Installation","25","0","0","1","0",""));categories.push(new Array("9","Weldmesh Raw Materials","wldmsh","0","Weldmesh Raw Materials","25","0","84","77","0","")); </script>
</div>
<div class="form-row pt-2 d-none">
<div class="form-group col-3">
<label for="buyPrice">Buy Price</label>
<input name="cost" type="number" min="0" step="0.01" value="" id="modInvbuyPrice" class="form-control required">
</div>
<div class="form-group col-3 pt-2">
<label for="uom">UOM</label>
<select name="uom" id="modInvuom" class="form-select">
<option value="0">N/A</option>
<option value="BX">BX - Box</option>
<option value="EA">EA - Each</option>
<option value="HR">HR - Hour</option>
<option value="KG">KG - Kilogram</option>
<option value="LM">LM - Lineal Meter</option>
<option value="M2">M2 - Meters Square</option>
<option value="M3">M3 - Meters Cubed</option>
<option value="PA">PA - Pallet</option>
<option value="TN">TN - Tonne</option>
</select>
</div>
</div>
<div class="container d-none" id="modInvspecs">
</div>
</div>
</div>
</div>
</div>
<div class="modInvTabCons d-none" id="modInvOptionStep6">
<h4 class="text-uppercase bold p-4"><span id="modInvItemHead"></span> Saving Item Information To Quote</h4>
<div class="row">
<div class="col p-4">
Please wait while we modify this nventory item for this quote.
<br>
<br>
<ul style="line-height:25px;">
<li>Update Inventory Item&nbsp;&nbsp;<i class="material-symbols-rounded d-none step61">sprint</i></li>
<li>Add and Update Bill of Materials&nbsp;&nbsp;<i class="material-symbols-rounded d-none step62">sprint</i></li>
<li>Update Route for Item in Quote&nbsp;&nbsp;<i class="material-symbols-rounded d-none step63">sprint</i></li>
<li>Update Item in Quote&nbsp;&nbsp;<i class="material-symbols-rounded d-none step64">sprint</i></li>
</ul>
</div>
</div>
<div class="row">
<div class="col px-4">
<div class="alert alert-warning">Please do not leave this page while we finish this activity.</div>
</div>
</div>
</div><style>
.pac-container {
z-index: 10000 !important;
}
</style>
<div class="modal fade" id="quoteTemplateModal" tabindex="-1" role="dialog" aria-labelledby="quoteTemplateModalLabel" aria-hidden="true">
<div class="modal-dialog modal-md" role="document">
<div class="modal-content">
<div class="modal-header">
<div ID="quoteTemplateModalTitle" class="h2">Load Starter Template</div>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" ID="quoteTemplateModalBody">
<div class='mb-3 text-start'>
<form action='quoteditsave.php' method='POST'>
<input type='hidden' name='quoteid' value = '2266'>
<input type='hidden' name='clientid' value='3293'>
<input type='hidden' name='siteid' value='145'>
<input type='hidden' name='quotetypeid' ID='quotetypeid' value = '0'>
<label>You can choose a starter template from the list below to get Started.</label>
<table class="table table-hover table-sm">
<thead>
<tr>
<th>#</th>
<th>ID</th>
<th>Reference</th>
</tr>
</thead>
<tbody ID='starterTemplates'>
</tbody>
</table>
<div class="row mb-4 d-none">
<div class="col">
</div>
<div class="col text-end">
<input class="form-check-input" type="checkbox" value="" id="appyContractPriceCB" name="appyContractPrice" checked value="1">
<label class="form-check-label" for="appyContractPriceCB">
Apply Customer Contract Pricing
</label>
</div>
</div>
<div class='row'>
<div class='col'><input type='button' data-bs-dismiss="modal" class='form-control bg-warning' value = 'Close'></div>
<div class='col'><input type='submit' class='form-control loadtemplatebtn' value = 'Load' name='loadTemplate'></div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
<style>
.pac-container {
z-index: 10000 !important;
}
</style>
<div class="modal fade" id="pricingSummaryModal" tabindex="-1" role="dialog" aria-labelledby="pricingSummaryModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<div ID="pricingSummaryModalTitle" class="h2">Pricing Analysis</div>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body text-left" ID="pricingSummaryModalBody">
<div class='text-start'><div class='alert bg-light'>Please save your quote before reviewing the below table to ensure changes have been committed</div><div class='h4'>PRICE SPREAD BY INVENTORY CATEGORY</div><div class='row'>
<div class='col'>!Generic Fencing Prices</div>
<div class='col'>$7,250.45</div>
<div class='col'>16.68 %</div>
</div><div class='row'>
<div class='col'>Tubular Fencing</div>
<div class='col'>$18.50</div>
<div class='col'>0.04 %</div>
</div><div class='row'>
<div class='col'>SA Water Spear Top</div>
<div class='col'>$29,387.51</div>
<div class='col'>67.62 %</div>
</div><div class='row'>
<div class='col'>PLCx Fittings</div>
<div class='col'>$11.02</div>
<div class='col'>0.03 %</div>
</div><div class='row'>
<div class='col'>Operations - Installation</div>
<div class='col'>$6,748.40</div>
<div class='col'>15.53 %</div>
</div><div class='row'>
<div class='col'>Ops - Materials</div>
<div class='col'>$29.10</div>
<div class='col'>0.07 %</div>
</div><div class='row'>
<div class='col'>PLCx Wire</div>
<div class='col'>$15.62</div>
<div class='col'>0.04 %</div>
</div><div class='h4 mt-3'>PRICE SPREAD BY TABS</div>
<div class="accordion accordion-flush" id="accordionFlushExample">
<div class="accordion-item">
<div class="accordion-header" id="flush-headingOne">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapse1" aria-expanded="false" aria-controls="flush-collapse1">
<div class='col'>413. 1. FENCE</div>
<div class='col'>$29,432.65</div>
<div class='col'>67.72 %</div>
</button>
</div>
<div id="flush-collapse1" class="accordion-collapse collapse" aria-labelledby="flush-headingOne" data-bs-parent="#accordionFlushExample">
<div class="accordion-body bg-light"><div class='row'>
<div class='col'>Tubular Fencing</div>
<div class='col'>$18.50</div>
<div class='col'>0.06 %</div>
</div><div class='row'>
<div class='col'>SA Water Spear Top</div>
<div class='col'>$29,387.51</div>
<div class='col'>99.85 %</div>
</div><div class='row'>
<div class='col'>PLCx Fittings</div>
<div class='col'>$11.02</div>
<div class='col'>0.04 %</div>
</div><div class='row'>
<div class='col'>PLCx Wire</div>
<div class='col'>$15.62</div>
<div class='col'>0.05 %</div>
</div> </div>
</div>
</div>
<div class="accordion-item">
<div class="accordion-header" id="flush-headingOne">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapse2" aria-expanded="false" aria-controls="flush-collapse2">
<div class='col'>415. 3. GATES</div>
<div class='col'>$6,987.95</div>
<div class='col'>16.08 %</div>
</button>
</div>
<div id="flush-collapse2" class="accordion-collapse collapse" aria-labelledby="flush-headingOne" data-bs-parent="#accordionFlushExample">
<div class="accordion-body bg-light"><div class='row'>
<div class='col'>!Generic Fencing Prices</div>
<div class='col'>$6,987.95</div>
<div class='col'>100 %</div>
</div> </div>
</div>
</div>
<div class="accordion-item">
<div class="accordion-header" id="flush-headingOne">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapse3" aria-expanded="false" aria-controls="flush-collapse3">
<div class='col'>0. all</div>
<div class='col'>$262.50</div>
<div class='col'>0.6 %</div>
</button>
</div>
<div id="flush-collapse3" class="accordion-collapse collapse" aria-labelledby="flush-headingOne" data-bs-parent="#accordionFlushExample">
<div class="accordion-body bg-light"><div class='row'>
<div class='col'>!Generic Fencing Prices</div>
<div class='col'>$262.50</div>
<div class='col'>100 %</div>
</div> </div>
</div>
</div>
<div class="accordion-item">
<div class="accordion-header" id="flush-headingOne">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapse4" aria-expanded="false" aria-controls="flush-collapse4">
<div class='col'>414. NEW TAB 2</div>
<div class='col'>$6,777.50</div>
<div class='col'>15.59 %</div>
</button>
</div>
<div id="flush-collapse4" class="accordion-collapse collapse" aria-labelledby="flush-headingOne" data-bs-parent="#accordionFlushExample">
<div class="accordion-body bg-light"><div class='row'>
<div class='col'>Operations - Installation</div>
<div class='col'>$6,748.40</div>
<div class='col'>99.57 %</div>
</div><div class='row'>
<div class='col'>Ops - Materials</div>
<div class='col'>$29.10</div>
<div class='col'>0.43 %</div>
</div> </div>
</div>
</div>
</div></div>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
<style>
.pac-container {
z-index: 10000 !important;
}
</style>
<div class="modal fade" id="revisionModal" tabindex="-1" role="dialog" aria-labelledby="revisionModalLabel" aria-hidden="true">
<div class="modal-dialog modal-md" role="document">
<div class="modal-content">
<div class="modal-header">
<div ID="revisionModalTitle" class="h2">Revisions for quote 2266</div>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" ID="revisionModalBody">
<table class="table">
<thead>
<tr>
<th>ID</th>
<th>Reference</th>
<th>Date</th>
<th>Revison</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
<script>
var catDiscounts = new Array();catDiscounts.push(new Array("1","0","0"));catDiscounts.push(new Array("2","0","0"));catDiscounts.push(new Array("3","0","0"));catDiscounts.push(new Array("4","0","0"));catDiscounts.push(new Array("5","0","0"));catDiscounts.push(new Array("8","0","0"));catDiscounts.push(new Array("9","0","0"));catDiscounts.push(new Array("11","0","0"));catDiscounts.push(new Array("12","0","0"));catDiscounts.push(new Array("14","0","0"));catDiscounts.push(new Array("17","0","0"));catDiscounts.push(new Array("18","0","0"));catDiscounts.push(new Array("19","0","0"));catDiscounts.push(new Array("20","0","0"));catDiscounts.push(new Array("21","0","0"));catDiscounts.push(new Array("22","0","0"));catDiscounts.push(new Array("23","0","0"));catDiscounts.push(new Array("24","0","0"));catDiscounts.push(new Array("25","0","0"));catDiscounts.push(new Array("26","0","0"));catDiscounts.push(new Array("27","0","0"));catDiscounts.push(new Array("28","0","0"));catDiscounts.push(new Array("30","0","0"));catDiscounts.push(new Array("31","0","0"));catDiscounts.push(new Array("32","0","0"));catDiscounts.push(new Array("33","0","0"));catDiscounts.push(new Array("34","0","0"));catDiscounts.push(new Array("35","0","0"));catDiscounts.push(new Array("36","0","0"));catDiscounts.push(new Array("38","0","0"));catDiscounts.push(new Array("42","0","0"));catDiscounts.push(new Array("45","0","0"));catDiscounts.push(new Array("47","0","0"));catDiscounts.push(new Array("49","0","0"));catDiscounts.push(new Array("50","0","0"));catDiscounts.push(new Array("51","0","0"));catDiscounts.push(new Array("52","0","0"));catDiscounts.push(new Array("53","0","0"));catDiscounts.push(new Array("56","0","0"));catDiscounts.push(new Array("57","0","0"));catDiscounts.push(new Array("58","0","0"));catDiscounts.push(new Array("59","0","0"));catDiscounts.push(new Array("63","0","0"));catDiscounts.push(new Array("64","0","0"));catDiscounts.push(new Array("66","0","0"));catDiscounts.push(new Array("67","0","0"));catDiscounts.push(new Array("68","0","0"));catDiscounts.push(new Array("69","0","0"));catDiscounts.push(new Array("70","0","0"));catDiscounts.push(new Array("71","0","0"));catDiscounts.push(new Array("72","0","0"));catDiscounts.push(new Array("73","0","0"));catDiscounts.push(new Array("74","0","0"));catDiscounts.push(new Array("79","0","0"));catDiscounts.push(new Array("80","0","0"));catDiscounts.push(new Array("81","0","0"));catDiscounts.push(new Array("82","0","0"));catDiscounts.push(new Array("83","0","0"));catDiscounts.push(new Array("84","0","0"));catDiscounts.push(new Array("85","0","0"));catDiscounts.push(new Array("86","0","0"));catDiscounts.push(new Array("87","0","0"));</script> <style>
.sectionCount {
height: 50px;
}

.address {
height: 25px;
}
</style>
<!-- I DONT BELEIVE DATA TABLES ARE NEEDED - REMOVE IN SEPTEMBER 25 IF ALL IS WELL
<slink rel="stylesheet" type="text/css" href="assets/jscripts/DataTables/datatables.min.css" />
<sscript type="text/javascript" isrc="assets/jscripts/DataTables/datatables.min.js"></script>
-->
<SSCRIPT TYPE="text/javascript" SRC="app/ajax/selectFilter.js?seq=928383712081616287"></SCRIPT>
<script src="assets/js/tinymce/tinymce.min.js"></script>
<script src="assets/js/pricing.js"></script>
<script src="assets/js/modules/contractpricingcommon.js"></script>
<script src="assets/js/popupCalculator.js"></script>

<script>
var quoteMarginDefault = parseInt("25");
var quoteKitShow = "Show";
//var client = JSON.parse('');
//const pricing = new customerPricing(client);

// Prevent Bootstrap dialog from blocking focusin
document.addEventListener('focusin', (e) => {
if (e.target.closest(".tox-tinymce-aux, .moxman-window, .tam-assetmanager-root") !== null) {
e.stopImmediatePropagation();
}
});

tinymce.init({
selector: 'textarea.editmce',
content_css: "assets/css/bootstrap-5.2.0-dist/css/bootstrap.min.css",
plugins: "lists table code preview",
browser_spellcheck: true,
promotion: false,
height: 400,
toolbar: "pricingInsertShort pricingInsertLong insertOptionsShort insertOptionsLong undo redo | forecolor backcolor | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
setup: function(editor) {
editor.ui.registry.addButton('pricingInsertShort', {
text: 'Add Prices Short',
onAction: function(_) {
editor.insertContent(document.getElementById("sectionSummary").innerHTML);
}
});
editor.ui.registry.addButton('pricingInsertLong', {
text: 'Add Prices Long',
onAction: function(_) {
var pricing_long_tgts = document.getElementsByClassName("tab_edit");
for (i = 0; i < pricing_long_tgts.length; i++) {
if (pricing_long_tgts[i].getAttribute("data-type") == "Optional Extra") {
continue;
}
//HEADING
pricing_long_heading = pricing_long_tgts[i].getAttribute("data-name");
editor.insertContent("<h3>" + pricing_long_heading + "</h3>");
//TEXT
editor.insertContent("<div>" + pricing_long_tgts[i].getAttribute("data-notes") + "</div>");
//PRICE
var pricing_long_id = pricing_long_tgts[i].getAttribute("data-id");
var testSection = document.getElementsByName("sectionId[]");
var qty = document.getElementsByName("itemqty[]");
var deleted = document.getElementsByName("deleteInvItem[]");
var price = document.getElementsByName("adjPrice[]");
var pricing_long_total = 0;
for (j = 0; j < testSection.length; j++) {
if (testSection[j].value == pricing_long_id && deleted[j].value == 0) {
pricing_long_total += Math.round((price[j].value * qty[j].value) * 1000) / 1000;
}
}
editor.insertContent("<h5 class=\"text-uppercase text-end\">Price (Exc. GST): $" + Math.round(pricing_long_total * 100) / 100 + "</h5><br>");
}
}
});
editor.ui.registry.addButton('insertOptionsShort', {
text: 'Add Options Short',
onAction: function(_) {
editor.insertContent(document.getElementById("optionsSummary").innerHTML);
}
});
editor.ui.registry.addButton('insertOptionsLong', {
text: 'Add Options Long',
onAction: function(_) {
editor.insertContent(loadNoteOptions());
}
});
}
});

var noteTemplates = [{"id":57,"type":"Clause","status":1,"name":"Assumption - Ability to work on Sundays & Public Holidays ","message":"<p>Assumption - Ability to work on Sundays &amp; Public Holidays&nbsp;<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":59,"type":"Clause","status":1,"name":"Assumption - Access for all Vehicles Including Concrete Trucks","message":"<p>Assumption - Access for all Vehicles Including Concrete Trucks<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":64,"type":"Clause","status":1,"name":"Assumption - Access to site will remain unimpeded, regardless of the prevailing conditions","message":"<p>Assumption - Access to site will remain unimpeded, regardless of the prevailing conditions<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":58,"type":"Clause","status":1,"name":"Assumption - All Vehicles, Machinery and Tools allowed on site including Concrete Trucks","message":"<p>Assumption - All Vehicles, Machinery and Tools allowed on site including Concrete Trucks<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":50,"type":"Clause","status":1,"name":"Assumption - Clear and Level Fence Line","message":"<p>Assumption - Clear and Level Fence Line<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":66,"type":"Clause","status":1,"name":"Assumption - Concrete plinth \/ slab (by others)","message":"<p>Assumption - Concrete plinth \/ slab (by others) suitable for drilling holes at required chemical anchor locations - adequate clearance from edge \/ reinforcement<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":54,"type":"Clause","status":1,"name":"Assumption - Concrete Wash Out area Available for Use","message":"<p>Assumption - Concrete Wash Out area Available for Use<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":48,"type":"Clause","status":1,"name":"Assumption - Corners and Gate Locations Surveyed\/Marked","message":"<p>Assumption - Corners and Gate Locations Surveyed\/Marked<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":60,"type":"Clause","status":1,"name":"Assumption - Loading & Unloading Facilities Available Onsite at No Cost to PLC Fencing","message":"<p>Assumption - Loading &amp; Unloading Facilities Available Onsite at No Cost to PLC Fencing<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":56,"type":"Clause","status":1,"name":"Assumption - Minimal Trade Interference","message":"<p>Assumption - Minimal Trade Interference<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":62,"type":"Clause","status":1,"name":"Assumption - PLC Fencing take no responsibility for discrepancies between the quoted and final required scope and specification","message":"<p>Assumption - PLC Fencing take no responsibility for discrepancies between the quoted and final required scope and specification<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":49,"type":"Clause","status":1,"name":"Assumption - Plinth Height Set at All grade Changes","message":"<p>Assumption - Plinth Height Set at All grade Changes<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":47,"type":"Clause","status":1,"name":"Assumption - Projects to be Completed in ONE Mobilisation","message":"<p>Assumption - Projects to be Completed in ONE Mobilisation<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":61,"type":"Clause","status":1,"name":"Assumption - Rates apply depending on final quantities and are subject to requote if significant deviations occur ","message":"<p>Assumption - Rates apply depending on final quantities and are subject to requote if significant deviations occur&nbsp;<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":53,"type":"Clause","status":1,"name":"Assumption - Rubbish Disposal Available On Site ","message":"<p>Assumption - Rubbish Disposal Available On Site&nbsp;<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":52,"type":"Clause","status":1,"name":"Assumption - Secure Laydown areas within reasonable distance","message":"<p>Assumption - Secure Laydown areas within reasonable distance<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":63,"type":"Clause","status":1,"name":"Assumption - The Client will have satisfied themselves that the quoted specification and quantities are correct for the project","message":"<p>Assumption - The Client will have satisfied themselves that the quoted specification and quantities are correct for the project before using this pricing in their own pricing submission or before engaging PLC Fencing to complete the project<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":55,"type":"Clause","status":1,"name":"Assumption - Unimpeded Access - No Restrictions on Driving on Surfaces\t\t\t\t","message":"<p>Assumption - Unimpeded Access - No Restrictions on Driving on Surfaces&nbsp;<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":65,"type":"Clause","status":1,"name":"Assumption - Works will proceed without union interference","message":"<p>Assumption - Works will proceed without union interference, which includes any disruption of works, the prevention of authorised personnel from accessing the site, or the imposition of an enterprise bargaining agreement (EBA)<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":5,"type":"Template","status":1,"name":"Chainlink Supply and Install","message":"<h3>Chainlink Fencing Supply and Install Quotation<\/h3>\r\n<p>Thank you for contacting PLC Fencing regarding your chainlink fencing project.<\/p>\r\n<p>This quotation is for the supply and installation of ______ meters of chainlinking Fencing as per the below Specification<\/p>\r\n<table style=\"border-collapse: collapse; width: 99.9736%;\" border=\"1\"><colgroup><col style=\"width: 18.9359%;\"><col style=\"width: 47.8306%;\"><col style=\"width: 33.2071%;\"><\/colgroup>\r\n<tbody>\r\n<tr>\r\n<td>Hieght<\/td>\r\n<td>&nbsp;<\/td>\r\n<td>&nbsp;<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>Finish<\/td>\r\n<td>&nbsp;<\/td>\r\n<td>&nbsp;<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>&nbsp;<\/td>\r\n<td>&nbsp;<\/td>\r\n<td>&nbsp;<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>&nbsp;<\/td>\r\n<td>&nbsp;<\/td>\r\n<td>&nbsp;<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<p>&nbsp;<\/p>","screen":"","category":"Quotes","owner":304,"aiMode":"","aiInstructions":null},{"id":7,"type":"Template","status":1,"name":"Chainlink Type 1 Material Template","message":"<table style=\"border-collapse: collapse; width: 73.7795%; height: 223.906px; border-width: 1px; border-style: solid;\" border=\"1\"><colgroup><col style=\"width: 34.7228%;\"><col style=\"width: 40.3853%;\"><col style=\"width: 24.8936%;\"><\/colgroup>\r\n<tbody>\r\n<tr style=\"height: 22.3906px;\">\r\n<td style=\"height: 22.3906px; border-width: 1px;\"><span style=\"text-decoration: underline;\"><strong><span style=\"color: rgb(0, 0, 0); text-decoration: underline;\">Materials to be Used<\/span><\/strong><\/span><\/td>\r\n<td style=\"height: 22.3906px; border-width: 1px;\">&nbsp;<\/td>\r\n<td style=\"border-width: 1px;\">&nbsp;<\/td>\r\n<\/tr>\r\n<tr style=\"height: 22.3906px;\">\r\n<td style=\"height: 22.3906px; border-width: 1px;\">Chain Wire<\/td>\r\n<td style=\"height: 22.3906px; border-width: 1px;\">1800h 2.5mm - 50 Pitch - Galvanised&nbsp;<\/td>\r\n<td style=\"border-width: 1px;\">PVC Black<\/td>\r\n<\/tr>\r\n<tr style=\"height: 22.3906px;\">\r\n<td style=\"height: 22.3906px; border-width: 1px;\">Chain Wire<\/td>\r\n<td style=\"height: 22.3906px; border-width: 1px;\">1800 3.15 - 50 Pitch - Galvanised<\/td>\r\n<td style=\"border-width: 1px;\">PVC Black<\/td>\r\n<\/tr>\r\n<tr style=\"height: 22.3906px;\">\r\n<td style=\"height: 22.3906px; border-width: 1px;\">Barbed Wire<\/td>\r\n<td style=\"height: 22.3906px; border-width: 1px;\">1.57mm Galvanised x 3 Strands<\/td>\r\n<td style=\"border-width: 1px;\">&nbsp;<\/td>\r\n<\/tr>\r\n<tr style=\"height: 22.3906px;\">\r\n<td style=\"height: 22.3906px; border-width: 1px;\">Razor Rings<\/td>\r\n<td style=\"height: 22.3906px; border-width: 1px;\">550mm Razor Rings - Overlapped<\/td>\r\n<td style=\"border-width: 1px;\">&nbsp;<\/td>\r\n<\/tr>\r\n<tr style=\"height: 22.3906px;\">\r\n<td style=\"height: 22.3906px; border-width: 1px;\">Razor Rings<\/td>\r\n<td style=\"height: 22.3906px; border-width: 1px;\">Concertina 550mm Razor Rings<\/td>\r\n<td style=\"border-width: 1px;\">&nbsp;<\/td>\r\n<\/tr>\r\n<tr style=\"height: 22.3906px;\">\r\n<td style=\"height: 22.3906px; border-width: 1px;\">Post Spacings<\/td>\r\n<td style=\"height: 22.3906px; border-width: 1px;\">3.30 Metres<\/td>\r\n<td style=\"border-width: 1px;\">&nbsp;<\/td>\r\n<\/tr>\r\n<tr style=\"height: 22.3906px;\">\r\n<td style=\"height: 22.3906px; border-width: 1px;\">Post Cranked<\/td>\r\n<td style=\"height: 22.3906px; border-width: 1px;\">All Posts \/ Corner Posts \/ Gate Posts<\/td>\r\n<td style=\"border-width: 1px;\">&nbsp;<\/td>\r\n<\/tr>\r\n<tr style=\"height: 22.3906px;\">\r\n<td style=\"height: 22.3906px; border-width: 1px;\">Intermediate Posts<\/td>\r\n<td style=\"height: 22.3906px; border-width: 1px;\">40NB Medium Galvanised Pipe&nbsp;<\/td>\r\n<td style=\"border-width: 1px;\">&ndash; Powder Coated Black<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"height: 22.3906px; border-width: 1px;\">Corner Strainer Posts<\/td>\r\n<td style=\"height: 22.3906px; border-width: 1px;\">80NB Medium Galvanised Pipe&nbsp;<\/td>\r\n<td style=\"border-width: 1px;\">&ndash; Powder Coated Black<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"border-width: 1px;\">Inline Strainers<\/td>\r\n<td style=\"border-width: 1px;\">50NB Medium Galvanised Pipe&nbsp;<\/td>\r\n<td style=\"border-width: 1px;\">&ndash; Powder Coated Black<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"border-width: 1px;\">Stays (Concreted)<\/td>\r\n<td style=\"border-width: 1px;\">32NB Medium Galvanised Pipe&nbsp;<\/td>\r\n<td style=\"border-width: 1px;\">&ndash; Powder Coated Black<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"border-width: 1px;\">Stays &amp; Fittings<\/td>\r\n<td style=\"border-width: 1px;\">32NB Medium Galvanised Pipe&nbsp;<\/td>\r\n<td style=\"border-width: 1px;\">&ndash; Powder Coated Black<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"border-width: 1px;\">Top &amp; Bottom Rails<\/td>\r\n<td style=\"border-width: 1px;\">32NB Medium Galvanised Pipe<\/td>\r\n<td style=\"border-width: 1px;\">&ndash; Powder Coated Black<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"border-width: 1px;\">Earthing Tags<\/td>\r\n<td style=\"border-width: 1px;\">As Per Specification<\/td>\r\n<td style=\"border-width: 1px;\">&nbsp;<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"border-width: 1px;\">Concrete<\/td>\r\n<td style=\"border-width: 1px;\">25MPA<\/td>\r\n<td style=\"border-width: 1px;\">&nbsp;<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"border-width: 1px;\">Bitumin Paint<\/td>\r\n<td style=\"border-width: 1px;\">Durabild - As Specified<\/td>\r\n<td style=\"border-width: 1px;\">&nbsp;<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"border-width: 1px;\">Footing Depth<\/td>\r\n<td style=\"border-width: 1px;\">Cnr Posts 750 x 250<\/td>\r\n<td style=\"border-width: 1px;\">&nbsp;<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"border-width: 1px;\">Footing Depth<\/td>\r\n<td style=\"border-width: 1px;\">Int Post 600 x 250<\/td>\r\n<td style=\"border-width: 1px;\">&nbsp;<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"border-width: 1px;\">Footing Depth<\/td>\r\n<td style=\"border-width: 1px;\">Stays 600 x 250<\/td>\r\n<td style=\"border-width: 1px;\">&nbsp;<\/td>\r\n<\/tr>\r\n<tr style=\"height: 22.3906px;\">\r\n<td style=\"height: 22.3906px; border-width: 1px;\">Gates<\/td>\r\n<td style=\"height: 22.3906px; border-width: 1px;\">Fabricated in House by PLC Fencing to Specifications&nbsp;<\/td>\r\n<td style=\"border-width: 1px;\">&nbsp;<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>","screen":"","category":"Quotes","owner":304,"aiMode":"","aiInstructions":null},{"id":42,"type":"Clause","status":1,"name":"Exclusion - Access Controls \/ Card Readers","message":"<p>Exclusion - Access Controls \/ Card Readers<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":41,"type":"Clause","status":1,"name":"Exclusion - Backfilling \/ Compacting of Excavation","message":"<p>Exclusion - Backfilling \/ Compacting of Excavation<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":27,"type":"Clause","status":1,"name":"Exclusion - Compaction Testing","message":"<p>Exclusion - Compaction Testing<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":44,"type":"Clause","status":1,"name":"Exclusion - Concrete Gate Aprons & Concrete Plinths","message":"<p>Exclusion - Concrete Gate Aprons &amp; Concrete Plinths<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":26,"type":"Clause","status":1,"name":"Exclusion - Concrete Testing","message":"<p>Exclusion - Concrete Testing<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":31,"type":"Clause","status":1,"name":"Exclusion - Connection of Earthing","message":"<p>Exclusion - Connection of Earthing<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":36,"type":"Clause","status":1,"name":"Exclusion - De Watering of Footings \/ Excavations","message":"<p>Exclusion - De Watering of Footings \/ Excavations<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":35,"type":"Clause","status":1,"name":"Exclusion - Dust Supression","message":"<p>Exclusion - Dust Supression<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":25,"type":"Clause","status":1,"name":"Exclusion - Hydro Excavation or Non-Invasive Digging","message":"<p>Exclusion - Hydro Excavation or Non-Invasive Digging<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":45,"type":"Clause","status":1,"name":"Exclusion - Inductions > 0.5 Hrs Medicals \/ Externals VOCs","message":"<p>Exclusion - Inductions &gt; 0.5 Hrs Medicals \/ Externals VOCs<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":32,"type":"Clause","status":1,"name":"Exclusion - Isolation of Fencing ","message":"<p>Exclusion - Isolation of Fencing&nbsp;<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":23,"type":"Clause","status":1,"name":"Exclusion - Levelling of Fence Line","message":"<p>Exclusion - Levelling of Fence Line<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":43,"type":"Clause","status":1,"name":"Exclusion - Locking Mechanisms","message":"<p>Exclusion - Locking Mechanisms<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":40,"type":"Clause","status":1,"name":"Exclusion - Power Supply by Others","message":"<p>Exclusion - Power Supply by Others<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":46,"type":"Clause","status":1,"name":"Exclusion - Reinstatement of Any Surfaces ","message":"<p>Exclusion - Reinstatement of Any Surfaces&nbsp;<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":22,"type":"Clause","status":1,"name":"Exclusion - Removal \/ Demolition \/ Disposal of Existing Fence","message":"<p>Exclusion - Removal \/ Demolition \/ Disposal of Existing Fence<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":29,"type":"Clause","status":1,"name":"Exclusion - Removal of Contaminated Materials","message":"<p>Exclusion - Removal of Contaminated Materials<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":28,"type":"Clause","status":1,"name":"Exclusion - Removal of Spoil to be Spread On Site \/ Stockpile Onsite","message":"<p>Exclusion - Removal of Spoil to be Spread On Site \/ Stockpile Onsite<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":24,"type":"Clause","status":1,"name":"Exclusion - Rock Breaking \/ Hard Digging","message":"<p>Exclusion - Rock Breaking \/ Hard Digging<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":38,"type":"Clause","status":1,"name":"Exclusion - Signage","message":"<p>Exclusion - Signage<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":30,"type":"Clause","status":1,"name":"Exclusion - Soil Testing","message":"<p>Exclusion - Soil Testing<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":37,"type":"Clause","status":1,"name":"Exclusion - Supply of Signs","message":"<p>Exclusion - Supply of Signs<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":20,"type":"Clause","status":1,"name":"Exclusion - Surveying of Site","message":"<p>Exclusion - Surveying of Site<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":33,"type":"Clause","status":1,"name":"Exclusion - Temporary Fencing \/ Safety Barriers","message":"<p>Exclusion - Temporary Fencing \/ Safety Barriers<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":34,"type":"Clause","status":1,"name":"Exclusion - Traffic \/ Pedestrian Management","message":"<p>Exclusion - Traffic \/ Pedestrian Management<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":19,"type":"Clause","status":1,"name":"Exclusion - Underground Service Locating","message":"<p>Exclusions - Underground Service Locating<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":21,"type":"Clause","status":1,"name":"Exclusion - Vegetation Removal","message":"<p>Exclusion - Vegetation Removal<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":10,"type":"Clause","status":1,"name":"Inclusion - All Materials As Specified","message":"<p>Inclusions - All Materials As Specified<\/p>\r\n<p>&nbsp;<\/p>\r\n<p>&nbsp;<\/p>\r\n<p>&nbsp;<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":15,"type":"Clause","status":1,"name":"Inclusion - Backfilling and Compaction of excavations ","message":"<p>Inclusion - Backfilling and Compaction of excavations&nbsp;<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":11,"type":"Clause","status":1,"name":"Inclusion - Concrete as specified","message":"<p>Inclusion - Concrete as specified<\/p>","screen":"","category":"Quotes","owner":493,"aiMode":"","aiInstructions":null},{"id":16,"type":"Clause","status":1,"name":"Inclusion - Earthing Tags","message":"<p>Inclusion - Earthing Tags<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":14,"type":"Clause","status":1,"name":"Inclusion - Fencing & Gates as Described above","message":"<p>Inclusion - Fencing &amp; Gates as Described above<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":18,"type":"Clause","status":1,"name":"Inclusion - Freight","message":"<p>Inclusion - Freight<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":12,"type":"Clause","status":1,"name":"Inclusion - Labour & Equipment to Complete the Above Project ","message":"<p>Inclusion - Labour &amp; Equipment to Complete the Above Project<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":13,"type":"Clause","status":1,"name":"Inclusion - LAFHA - Accommodations & Meals","message":"<p>Inclusion - LAFHA - Accommodations &amp; Meals<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":17,"type":"Clause","status":1,"name":"Inclusion - Mobilisations \/ Swings \/ Travel","message":"<p>Inclusion - Mobilisations \/ Swings \/ Travel<\/p>","screen":"","category":"Quotes","owner":631,"aiMode":"","aiInstructions":null},{"id":6,"type":"Clause","status":1,"name":"Site Unseen","message":"<p>** This quotation is based on customer provided information and plans and PLC has not done a site inspection. Price provided will be confirmed once a site inspection has been undertaken<\/p>","screen":"","category":"Quotes","owner":304,"aiMode":"","aiInstructions":null},{"id":39,"type":"Template","status":1,"name":"Supply & Install - Chainlink Fencing","message":"<p>Supply &amp; Install - Chainlink Fencing - 1800H Mesh - 3-Barb Top at 150 Centres - Total 2250H - Galvanised Finish<\/p>\r\n<p>&nbsp;<\/p>","screen":"","category":"Quotes","owner":521,"aiMode":"","aiInstructions":null}];
tinymce.init({
selector:'textarea.section_notes',
plugins: "lists table code preview",
browser_spellcheck: true,
height : 400,
promotion: false,
toolbar: "templates undo redo | forecolor backcolor | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
setup: function (editor) {
let toggleState = false;
if(allowTemplates > 0){
editor.ui.registry.addMenuButton('templates', {
text: 'Templates',
fetch: (callback, fetchContext) => {
if (fetchContext.pattern.length > 0) {
callback([
{
type: 'menuitem',
text: `You searched for: "${fetchContext.pattern}"`,
onAction: () => editor.insertContent(`<strong>Inserted selected search result</strong>`)
}
]);
} else {
const items = [
{type: 'menuitem', text: 'Manage Templates', icon:'edit-block', onAction: () => window.location="index.php?page=messageTemplates"}
];
noteTemplates.forEach(element => {
if(typeof contactP !== 'undefined'){element.message = element.message.replace('@contactName;', contactP); }
if(typeof company !== 'undefined'){ element.message = element.message.replace('@company;', company); }
if(typeof email !== 'undefined'){element.message = element.message.replace('@email;', email); }
if(typeof phone !== 'undefined'){element.message = element.message.replace('@phone;', phone); }
//console.log(element.message)
items.push({
type: 'menuitem',
text: element.name,
onAction: () => editor.setContent(element.message)
});
});
callback(items);
}
}

});
}
}
});
</script>

<!-- //################# HIDDEN DIV FOR ADVANCED PRICING ##################//-->
<div ID="priceOptions_old" style='display:none;background-color:white;position:absolute;width:400px;height:350px;border:1px solid black;right:180px;top:170px;text-align:right'>
<div style='width:100%;text-alignment:right;'>
<a onclick="document.getElementById('priceOptions').style.display='none';">
<i class="pointer material-symbols-rounded">close</i>
</a>
</div>
<div style="text-align:left;padding-left:40px;width:360px;">
<h1>PRICING OPTIONS</h1><br>
<table>
<tr style="text-align:right;">
<td>Price Option B: </td>
<td> <input type="text" name="priceOptionsB" ID="priceOptionsB"></td>
</tr>
<tr style="text-align:right;">
<td>Price Option C: </td>
<td> <input type="text" name="priceOptionsC" ID="priceOptionsC"></td>
</tr>
<tr style="text-align:right;">
<td>Price Option D: </td>
<td> <input type="text" name="priceOptionsD" ID="priceOptionsD"></td>
</tr>
</table>
</div>

</div>

<!-- //################# HIDDEN DIV PRINT ##################//-->
<div ID='invAlert' class="popupDiv">
<div style='width:100%;float:right;'>
<a style='float:right' onclick="hideAll()" ;>
<i class="pointer material-symbols-rounded">close</i>
</a>
</div>
<div style="text-align:left;padding-left:10px;width:400px;">
<h2>New Item - More Info</h2><br>
<h3 class="text-danger">Warnings / Alerts</h3>
<div ID="alerts" style="width:90%">No Alerts</div>
<br>
<hr>
<br>
<h3>Stock</h3>
<table class="table table-hover table-sm">
<thead>
<tr>
<th>Branch</th>
<th>SOH</th>
<th>AVAIL</th>
<th>ON ORDER</th>
</tr>
</thead>
<tbody>
<tr>
<td>Head Office</td>
<td id='branch_1_soh'>0</td>
<td id='branch_1_avail'>0</td>
<td id='branch_1_onorder'>0</td>
</tr> </tbody>
</table>
<br>
<hr>
<h3>Item Information Summary</h3>
<div ID="add_item_summary"></div>
<hr>
<br>
<a href="#" class="h4" id="add_item_link" target="_blank">Click here to manage item</a>
</div>
</div>
<form action='quoteditsave.php' method='POST' name='addQuote' ID="form" class="" onsubmit="fixMultiDecimals(); return validateForm(null,this);" accept-charset="utf-8" autocomplete="off">
<input type='hidden' name='sectionid' ID='section_id' value="0">
<input type='hidden' ID='last_save_value' value="43460.6">

<div ID='kitform' class='popupDiv'><div >
<h1>Kit Options</h1>
</div>
<div>
<div style="width:100%;display:inline;float:left" ID="kitText"></div>
<div class="alert bg-light rounded" id="tickandflick" style="clear:both;">* This inventory kit has been set as Tick and Flick. Kit items will not be grouped under the main line item.</div>
<div style='text-align:center'>
<input class="button" type='button' value="Close" onclick='hideAll();$("#qty").focus();'>
</div>
</div>

</div>

<div ID='productModifier' class='popupDiv'>
<a onclick="document.getElementById('productModifier').classList.toggle('popupDivFade');" style="float:right">
<i class="pointer material-symbols-rounded">close</i>
</a>
<br>
<div ID="pluginText" style="width:100%;"></div>
</div>
<div class='pageheader'>
<a href='index.php?page=quotereg' title="Back to quote register">
<div class='pagetitle'>QUOTE ENTRY/EDIT | ID 2266</div>
</a>
<div style='float:right'>
<div class='pagebutton'>Branch
<select name='branch' ID="branch">
<option value='1' selected>Head Office</option> </select>
<a href="#" title="Copy Quote" data-bs-toggle="modal" data-bs-target="#copyQuoteModal">
<i class="material-symbols-rounded">file_copy</i></a>
<a href="#" onclick="hideAll();document.getElementById('attachment').classList.toggle('popupDivLarge');" title="ATTACH FILES">
<i class="material-symbols-rounded">attach_file</i></a>
<a href="#" onclick="popupDiv('toolbox')" title="TOOLS">
<i class="material-symbols-rounded">build</i></a>
<a href="#" onmouseup="showNotes();" data-bs-toggle="modal" data-bs-target="#notesModal" TITLE="NOTES">
<i class="material-symbols-rounded">notes</i></a>
<a href="#" data-bs-toggle="modal" data-bs-target="#aiNotesModal" title="AI NOTES">
<i class="material-symbols-rounded">auto_awesome</i></a>
<a href="#" onclick="hideAll();document.getElementById('print').classList.toggle('popupDivFade');" title="PRINT">
<i class="material-symbols-rounded">print</i></a>
<a href="#" onclick="hideAll();document.getElementById('emailDiv').classList.toggle('popupDivLarge');" title="EMAIL">
<i class="material-symbols-rounded">email</i></a>
<a href="#" data-bs-toggle="modal" data-bs-target="#quickSaleModal" title="QUICK SUPPLY">
<i class="material-symbols-rounded">point_of_sale</i></a>
<a href="#" ID="savebutton" title="SAVE">
<i class="material-symbols-rounded">save</i></a>
</div>
</div>
</div>
<input type="hidden" name="quoteid" ID='quoteId' value="2266">
<input type="hidden" name="status" value="1" ID="status">
<input type="hidden" ID="clientid" value="3293">
<input type="hidden" ID="quoteTypeVal" value="3">
<input type="hidden" name="save" ID="save" value="1">
<input type="hidden" name="custDiscount" ID='custDiscount' value="0">

<div class="container-fluid text-start">
<div class="row">
<div class="col-lg">
<div class="form-group">
<div class="row">
<div class="col">
<label>
CONTACT NAME
</label>
</div>
<div class="col text-end">
<a href="index.php?page=clientedit&clientid=3293" ID="userEdit">Manage</a>
</div>
</div>
<div class="input-group">
<div class="input-group-text"><i class="material-symbols-rounded">search</i></div>
<input type="text" class="form-control required" name="clientfilter" ID='clientFilter' onkeyup='filterClients();' onFocus="document.getElementById('clientSelect').style.display='inline';this.select();" style=";" autocomplete="off">
</div>
<div class="filtered_list">
<select name='client' ID='clientSelect' class="required required_always form-control filtered_list" onmouseup="getClients();loadDefaults();" onclick=this.style.display="none" ; onblur=this.style.display="none" ; size="10" data-oldclient="3293" onchange="if (this.value != this.dataset.oldclient) { var ositeid = document.querySelector('#sites').value; var ositename = document.querySelector('#sites').options[document.querySelector('#sites').selectedIndex].text; document.querySelector('#dataTable').style.opacity = 0.5; document.querySelector('#formRow').style.display = 'none'; }">
<option>Please Select</option>
<option value="3293" selected>City Port Adelaide Enfield</option><script>
document.getElementById("clientFilter").value="City Port Adelaide Enfield";
</script></select>
</div>
</div> <div class="form-group">
<div class="row">
<div class="col"><label>Contact Person</label></div>
<div class="col text-end">
<a href="index.php?page=clientedit&tab=clienteditcontacts&clientid=3293" ID="userEdit">Manage</a>
</div>
</div>
<div class="input-group">
<div class="input-group-text"><i class="material-symbols-rounded">search</i></div>
<input type='text' name='contact' ID='contact' onkeyup='filterDropdown("contact","contacts");' onFocus='document.getElementById("contacts").style.display="inline";this.select();' autocomplete="off" class="form-control" value='Thomas Campbell'>
</div>
<div class="filtered_list">
<select name="contacts" size="10" ID="contacts" class="form-control filtered_list" onchange='document.getElementById("contact").value=this.options[this.selectedIndex].getAttribute("data-name");' onclick='this.style.display="none";' onmouseover="this.focus();" onblur='this.style.display="none";'>

<option>Add New Contact</option>
<option data-name="Thomas Campbell"
data-email="thomas.campbell@cityofpae.sa.gov.au"
data-mobile=""
data-phone="(08) 8405 60"
value="144" >Thomas Campbell</option>
</select>
</div>
</div>
<div class="form-group">
<label>Email:</label>
<input type='text' ID="primaryEmail" name='email' value="thomas.campbell@cityofpae.sa.gov.au" class="form-control">
</div>
<div class="row">
<div class="col">
<div class="form-group">
<label>Phone:</label>
<input type='text' ID="primaryPhone" name='phone' class="form-control" size='30' value='(08) 8405 60'>
</div>
</div>
<div class="col">
<div class="form-group">
<label>Mobile:</label>
<input type='text' ID="mobile" name='mobile' class="form-control" size='30' value=''>
</div>
</div>
</div>
</div>
<div class="col-lg">
<div class="form-group">
<label>Internal Reference</label>
<input class="required form-control" type='text' name='reference' autocomplete="off" value='Carlisle St, Pump Station'>
</div>
<div class="form-group">
<div class="row">
<div class="col"><label><a href="index.php?page=quoteTypes" target="_blank"> Quote Types:</a> </label></div>
<div class="col text-end"><i data-bs-toggle="modal" data-bs-target="#quoteTemplateModal" onclick="getQuoteStarters();" class="pointer material-symbols-rounded">more_vert</i></div>
</div>

<select name='quoteType' data-old-value = '3' ID="quoteType" class="required form-control" onchange="setPrintOptions()"
>
<option>Please Select</option>
<script>var quoteTypeObject = [{"id":2,"name":"Chainlink Fencing Plain T","code":"CLPT","status":1,"filename_text":"","notes":"","quoteTemplate":6,"quoteTabTemplate":"1871,1865","invoiceTemplate":13,"invoiceAccount":0,"printOptions":"[\"printStaff\",\"printPrices\",\"printNotes\",\"printDelivery\",\"printShipVia\"]","printOptionsI":"[\"printStaff\",\"printPrices\",\"printNotes\",\"printDelivery\",\"printShipVia\"]"},{"id":1,"name":"Default Quote Type","code":"DEF","status":1,"filename_text":"PLCx","notes":"This is the default quote type that comes bundles as an example w","quoteTemplate":10,"quoteTabTemplate":"0","invoiceTemplate":13,"invoiceAccount":0,"printOptions":"[\"printStaff\",\"printItems\",\"printPrices\",\"printNotes\",\"printDelivery\",\"printShipVia\",\"printDiscount\",\"printChildren\"]","printOptionsI":"[\"printStaff\",\"printItems\",\"printPrices\",\"printNotes\",\"printDelivery\",\"printShipVia\",\"printDiscount\",\"printChildren\"]"},{"id":4,"name":"PLCx - Itemized Quotes Priced","code":"SO","status":1,"filename_text":"PLCx","notes":"This category is used for Supply Only","quoteTemplate":6,"quoteTabTemplate":"0","invoiceTemplate":13,"invoiceAccount":0,"printOptions":"[\"printStaff\",\"printItems\",\"printPrices\",\"printNotes\",\"printDelivery\",\"printDiscount\"]","printOptionsI":"[\"printStaff\",\"printItems\",\"printPrices\",\"printNotes\",\"printDelivery\",\"printDiscount\"]"},{"id":3,"name":"Tabbed Quotes - Priced","code":"SI","status":1,"filename_text":"","notes":"","quoteTemplate":10,"quoteTabTemplate":"1856","invoiceTemplate":13,"invoiceAccount":0,"printOptions":"[\"printStaff\",\"printPrices\",\"printNotes\",\"printDelivery\",\"printSection\"]","printOptionsI":"[\"printStaff\",\"printItems\",\"printPrices\",\"printDiscount\"]"}];</script><option data-template="6" starter-templates="1871,1865" value='2' >Chainlink Fencing Plain T</option><option data-template="10" starter-templates="0" value='1' >Default Quote Type</option><option data-template="6" starter-templates="0" value='4' >PLCx - Itemized Quotes Priced</option><option data-template="10" starter-templates="1856" value='3' selected>Tabbed Quotes - Priced</option> </select>
</div>
<div class="form-group">
<label>Office / Billing Address</label>
<textarea name='invaddress' ID='offAddress' rows='4' cols='35' class="form-control hidden"></textarea>
<div class="border ">
<input type="text" name='address1' ID='address1' class="form-control border-0 address" value="163 Saint Vincent Street" placeholder="Street Address">
<input type="text" name='address2' ID='address2' class="form-control border-0 address" value="" placeholder="Address Line 2">
<div class="row p-1">
<div class="col">
<input type="text" name='suburb' ID='suburb' class="form-control border-0 address" placeholder="Suburb" value="Port Adelaide">
</div>
</div>
<div class="row p-1">
<div class="col">
<input type="text" ID='postcode' name='postcode' class="form-control border-0 address" value="" placeholder="Postcode">
</div>
<div class="col">
<input type="text" class="form-control border-0 address" ID='state' name='state' value="5015" placeholder="State">
</div>
</div>
</div>
</div>
</div>
<div class="col-lg">
<div class="form-group">
<label>Delivery Instructions</label>
<input type='text' name='shipvia' class="form-control" value=''>
</div>
<div class="form-group">
<div class="container-fluid">
<div class="row">
<div class="col"><label>Site:</label></div>
<div class="col text-end"><a href="index.php?page=clientsites&clientid=3293">Manage</a></div>
</div>
</div>
<div class="input-group">
<div class="input-group-text"><i class="material-symbols-rounded">search</i></div>
<input type='text' name='site' ID='site' onkeyup='filterDropdown("site","sites");' onFocus='document.getElementById("sites").style.display="inline";this.select();' class="form-control" autocomplete="off" value='145' placeholder="Click here to search for site from list below">
</div>
<div class="filtered_list">
<select data-oval="145" name="sites" size="10" ID="sites" class="form-control filtered_list" onclick='this.style.display="none";' onmouseover="this.focus();" onblur='this.style.display="none";'>
<option value="" selected>Please Select</option>
<script>document.getElementById("site").value='Carlisle St';</script><option style="font-family:courier new;" value='145' selected>Carlisle&nbsp;St&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [145]</option> </select>
</div>
</div>
<div class="form-group">
<label>Delivery / Site Address:</label>
<textarea name='deladdress' ID='delAddress' rows='4' cols='35' class="form-control hidden"></textarea>
<div class="border ">
<input name='delAddress1' value=" Carlisle St" ID='delAddress1' Placeholder="Street Address" class="form-control border-0 address">
<input name='delAddress2' ID='delAddress2' value="" Placeholder="Address Line 2" class="form-control border-0 address">
<div class="row p-1">
<div class="col">
<input type="text" name="delSuburb" ID="delSuburb" class="form-control border-0 address" value="Northfield" placeholder="Suburb">
</div>
</div>
<div class="row p-1">
<div class="col">
<input type="text" name="delPostcode" ID="delPostcode" class="form-control border-0 address" value="5085" placeholder="Postcode">
</div>
<div class="col">
<input type="text" name="delState" ID="delState" value="SA" class="form-control border-0 address" placeholder="State">
</div>
</div>
</div>
</div>
</div>
<div class="col-lg">
<div ID="unsaved" class="bg-warning button unsaved" style="display:none;">NOT SAVED</div>
<div class="form-group">
<label>Sales Rep:</label>
<select name='salesRep' ID="salesRep" class="form-control">

<option value='53' >Adam Love</option><option value='51' >Ashley Cole</option><option value='7' >Bessie McInnes</option><option value='8' >Betty Shanley</option><option value='48' >Brandon Nicolle</option><option value='9' >Cody Bannister</option><option value='11' >Daniel Spaan</option><option value='12' >Dougal Colquhoun</option><option value='13' >Edward Walton</option><option value='2' >Evolution Support</option><option value='35' >Frazer Spaan</option><option value='14' >Ian Gisborne</option><option value='50' >Jack Blackwell</option><option value='16' >Jayden Lee</option><option value='17' >Jed Lienert</option><option value='19' >Julian Pett</option><option value='43' >Kelton Holme </option><option value='34' >Kristen Hartmann</option><option value='31' >Leo Enter</option><option value='21' >Liam Clark</option><option value='41' selected>Maria Colorado</option><option value='54' >Matthew Smith</option><option value='4' >Mitch Wyatt</option><option value='52' >Nash Attrill</option><option value='26' >Oliver Bley</option><option value='27' >Patric Levi</option><option value='46' >Peter Spooner</option><option value='28' >Samara Wyatt</option><option value='1' >Shane Cosgrove</option><option value='3' >Shane Cosgrove</option><option value='45' >Tyson Fowler</option><option value='29' >Warren Wright</option><option value='30' >William Humphries</option><option value='38' >Zachary Zerk</option> </select>
</div>
<div class="form-group">
<label>Date:</label>
<input type="date" name="date" value="2026-08-11" class="form-control">
</div>
<div class="form-group">
<label>Required By:</label>
<input type="date" class="form-control" name="requiredBy" value="0000-00-00" data-required-days="7">
</div>
<div class="form-group">
</div>
<div class="container">
<div class="row pointer" data-bs-target="#revisionModal" data-bs-toggle="modal">
<div class="col h4">Revision:</div>
<div class="col h4">N/A</div>
</div>

<div class="row">
<div class="col"><a href="index.php?page=opportunityedit&opportunityid=110">Sales Opportunity: </a></div>
<div class="col h4"><a href="index.php?page=opportunityedit&opportunityid=110">110</a></div>
</div>


<div class="row">
<div class="col h4">Terms:</div>
<div class="col h4">30 Days Net</div>
</div>
<div class="row mt-2 text-uppercase">
<div class="col font-weight-bold h4">Total (Ex. Tax):</div>
<div class="col font-weight-bold h4 quoteTotal">$43,460.60</div>
</div>
</div>
</div>
</div>
</div>

<!-- //################# NEST HIDDEN DIVS CONTAINER ##################//-->
<div style="position:relative;padding-right:10px;margin-left:-500px;top:-100px;">
<!-- //################# HIDDEN DIV TOOLBOX ##################//-->

<div ID='toolbox' class="popupDiv">
<div class="container-fluid">
<div class="row">
<div class="h1 col text-start">Toolbox</div>
<div class="col text-end">
<a onclick="document.getElementById('toolbox').classList.toggle('popupDivFade');">
<i class="pointer material-symbols-rounded">close</i>
</a>
</div>
</div>
</div>

<div style="text-align:left;padding-left:15px;width:100%;">
<p>
<br>Select from Dropdown<br>
<select name='quoteFunction' class="form-control" id='quoteFunction' data-id="2266">
<option>Select Function</option>
<option value="pricingTools">Pricing Tools</option>
<option value="functionCreateJob">Create Job</option>
<option value="functionCreateInvoice">Create Invoice</option>
<option disabled> ---------- </option>
<option value="importQuoteParams">Import / Export Quotation</option>
<option value="functionReview">Mark Review & Approve</option>
<option disabled> ---------- </option>
<option value="functionClinkWizard">Fencing Tools</option>
<option disabled> ---------- </option>
<option value="unmarkAsSent">Unmark Quote as Sent</option> </select>
</p>
<hr>
<!-- //################# PRICING TOOLS ##################//-->
<div ID='pricingTools' style="display:;">
<h2>Pricing Tools</h2>
<div class="container-fluid">
<div class="row">
<div class="col">
Below are some tools to help you manage margin <br>and pricing on your quotation. <br><br>
</div>
</div>
<div class="row">
<div class="col">
<div class="h3">Pricing Method</div>
<div class="switch">
Cost Plus:
<input id="costplus" name="costplus" class="cmn-toggle cmn-toggle-round-flat" type="checkbox" style="visibility:hidden;" checked>
<label for="costplus"></label>
<br>

</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="h3">Override Margin / Discount values</div>
<p>You can use this slider to overwrite the margin on all<br> items.Dont forget to save when your done.</p>
<div ID='pricingMethod'>Discount: </Div>
<br>
<input type=range ID='priceOverride' class="form-control" min="1" max="70" step='.5' value='25'>
</div>
</div>
<div class="row">
<div style="display:table-cell">Value:</div>
<div style="display:table-cell" ID='sliderVal'>25</div>
</div>
<hr>
<div class="row">
<div class="col">
<div class="h3">Auto-Margin</div>
<p>Set your desired quotation value and hit go and the <br>margin will be calculated for you.</p>
<div class="form-group">
<label>Target Value</label>
<input type="text" class="form-control" ID="targetVal">
</div>
<input type="button" value="Go" ID="autoMargin">
</div>
</div>
<div class="row">
<div class="col">Cost</div>
<div class="col quoteCost"></div>
</div>
<div class="row">
<div class="col">Margin</div>
<div class="col quoteMargin"></div>
</div>
<div class="row">
<div class="col">Total</div>
<div class="col quoteTotal"></div>
</div>
<div class="row mt-2">
<div class="col">
<div class="h3">Audit Costs against Inventory</div>
<p>Check this to highlight item with cost below inventory value.</p>
<div class="form-group form-check">
<label class="form-check-label">Highlight Cost Variations</label>
<input type="checkbox" class="form-check-input" ID="highlightCostAudit" onchange='costAudit()'>
</div>
</div>
</div>
</div>
</div>

<!-- //################# IMPORT QUOTE ##################//-->
<div ID='importQuoteParams' class="container-fluid" style="display:none;">
<h2>Import Quotation</h2>
<div class="row">
<div class="col">
<input type='text' name='quoteImportId' ID='quoteImportId' onFocus='document.getElementById("quoteImportList").style.display="inline";this.select();' autocomplete="off" class="form-control">
<div class="filtered_list">
<select name='quoteImportList' ID="quoteImportList" size="15" onblur='this.style.display="none";' onchange='this.style.display="none";' class="filtered_list form-control">

<option value="0"> Select Quotation </option>
<option value='2276'>2276 Enerven Energy - Mt Piper BESS </option><option value='2275'>2275 Thoroughbred Fe - Fraser Coast Extra Gates</option><option value='2274'>2274 Lia Gibbs - Stock Fence Cascade Road</option><option value='2273'>2273 Realfence Pty L - Realfence Supply-Only</option><option value='2272'>2272 Garry Gillespie - Hay 132kV Substation</option><option value='2271'>2271 Iron Built Infr - T464 Hay 132kV Zone Subst</option><option value='2270'>2270 The Rural City - Tennis Club Upgrade</option><option value='2269'>2269 BORAL Construct - Boral Murray Bridge Quarr</option><option value='2268'>2268 Enerven Energy - ANI 275 KV Relocation Pro</option><option value='2267'>2267 Fusco Construct - Kingston SE ELC</option> </select>
</div>
</div>
</div>
<div class="row">
<div class="col">
<label>What do you want to Import?</label>
<div><input type='checkbox' name="importLines" class="checkbox" checked> Quote Lines</div>
<div><input type='checkbox' name="importNotes" class="checkbox" checked> Notes</div>
<div><input type='checkbox' name="importClient" class="checkbox"> Customer Details</div>
<div><input type='checkbox' name="importAddress" class="checkbox" checked> Delivery & Address Info</div>
</div>
</div>
<div class="form-group">
<label>How do you want to manage sections</label>
<select class="form-control" name="importSectionOption">
<option value="0" selected>Clone Section from Source</option>
<option value="1">Import into new section</option>
</select>
</div>
<input type='submit' name='importQuote' value='Import Quote' class='button form-control' ID='importQuote' style='display:'>
<br>
<hr>
<h2>Export Quotation</h2>
<input type="hidden" name="quoteid" value="2266">
<div class="row">
<div class="col"></div>
</div>
<input type='submit' name='exportQuote' value='Export Quote' class='button form-control' ID='exportQuote'>


</div>

<!-- //################# REVIEW QUOTE ##################//-->
<div ID='functionReview' class="container-fluid" style="display:none">
<div class="form-group">
<label>Request Review</label>
<select name="review" class="form-control" onchange="document.getElementById('form').submit();">
<option selected>No</option>
<option >Yes</option>
</select>
</div>
<div class="form-group">
<label>Comments / Notes</label>
<textarea class="form-control" name="approve_note" style="height:120px"></textarea>
</div>
<div class="form-group">
<div class="row">
<div class="col"><input type="submit" name="approve" class="form-control" value="Approve"></div>
<div class="col"><input type="submit" name="approve" class="form-control" value="Review"></div>
</div>
</div>
</div>
<!-- //################# CREATE INVOICE ##################//-->
<div ID='functionCreateInvoice' style="display:none;" class="container-fluid">
<h2>Create Invoice</h2>

<div ID="invoiceStatus"></div>
<hr>
<div class="h4">Select Optional Extras</div>
<table class="table table-sm table-hover">
</table>
<div class="form-group">
<label><a href="index.php?page=quoteTypes" target="_blank">Invoice Type:</a></label>
<select ID="invoiceTypeSelect" class="required form-control">
<option value="">Please Select</option>
<option value='2' >Chainlink Fencing Plain T</option><option value='1' >Default Quote Type</option><option value='4' >PLCx - Itemized Quotes Priced</option><option value='3' selected>Tabbed Quotes - Priced</option> </select>
</div>
<div class="form-group">
<input type='checkbox' value='1' name='invoiceNotes'> Include Quote Notes<br>
</div>
<div class="form-group">
<input type='button' value='Create Invoice' ID='invoiceCreate' class="form-control">
</div>
</div>
<!-- //################# CREATE JOB ##################//-->
<div ID='functionCreateJob' style="display:none;">
<h2>Create Job</h2>
<br>
This quotation does not belong to Job,
<br>
<a href='index.php?page=jobadd&quoteid=2266'>Click Here to Create a Job</a><br>
<hr>
</div>
<!-- //################# CUSTOM MODULES ##################//-->
<div style="display:none;width:100%;word-break:break-all;word-wrap:break-all;overflow-wrap" ID="functionClinkWizard">
<h3>Fencing Tools</h3>
<p>The chainlink wizard allows you to build <br>
and specify a chainlink fence and export<br>
a completed material list back into this <br>current quotation.</p>
<input type="button" value="Start Wizard" onclick="window.location.href='index.php?page=chainlinkWizard&quoteid=2266'">
<div class="quote_tools_custom"></div>

<h3>Installation Oncost</h3>
To add oncost to an item go to the Installation <br>
category in inventory and go the specs tab,<br>
add the percentage value in the oncost value. <br>
<br><br>
<input type="hidden" ID="oncostEnabled" name="oncost" value="0">
<div class="form-group">
<label>Item Specific(%)</label>
<div class="h6">Controlled by specs in inventory module</div>
</div>
<div class="form-group">
<label>Admin Oncost (%)</label>
<input class="form-control" name="adminOncost" type="number" ID="oncostValAdmin" value="10">
</div>

</div>
<div style="display:none;width:100%;word-break:break-all;word-wrap:break-all;overflow-wrap" ID="markAsSent">
<h3>
Mark Quote as Sent
</h3>
<p>
This will mark the Quote as e-mail has been sent out.
</p>
<hr>
<div class="form-group">
<input type='button' value='Mark Quote as Sent' ID='markQuoteAsSentBtn' class="form-control">
</div>
</div>
<div style="display:none;width:100%;word-break:break-all;word-wrap:break-all;overflow-wrap" ID="unmarkAsSent">
<h3>
Unmark Quote as Sent
</h3>
<p>
This will unmark the Quote as e-mail has been sent out.
</p>
<hr>
<div class="form-group">
<input type='button' value='Unmark Quote as Sent' ID='unmarkQuoteAsSentBtn' class="form-control">
</div>
</div>
</div>
</div>

<!-- //################# HIDDEN DIV NOTES ##################//-->
<style>
.pac-container {
z-index: 10000 !important;
}
</style>
<div class="modal fade" id="notesModal" tabindex="-1" role="dialog" aria-labelledby="notesModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header">
<div ID="notesModalTitle" class="h2">Notes</div>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" ID="notesModalBody">
<div ID='notes' class="container-fluid text-start">
<div class="row">
<div class="col">
<ul class="nav nav-tabs nav-justified" role="tablist" id="notesTab">
<li class="nav-item" role="presentation">
<button class="nav-link active" id="quote-notes" data-bs-toggle="tab" data-bs-target="#multi_notes_tab1" type="button" role="tab" aria-controls="multi_notes_tab1" aria-selected="true">Notes Shown on Quotation</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="quote-notes2" data-bs-toggle="tab" data-bs-target="#multi_notes_tab2" type="button" role="tab" aria-controls="multi_notes_tab2" aria-selected="true">Internal Notes</button>
</li>
</ul>
</div>
<div class="col-3">
<a class="nav-link" href="index.php?page=messageTemplates">Manage Templates</a>
</div>
</div>

<div class="tab-content" id="notesTabContent">
<div class="tab-pane fade show active" id="multi_notes_tab1" role="tabpanel" aria-labelledby="quote-notes">
<div class="form-group">
<div class="row">
<div class="col">
<select name='definedNotes' id="definedNotes" class="form-control">
<option>Click here to load a template</option>
<option value='5'>Chainlink Supply and Install</option><option value='7'>Chainlink Type 1 Material Template</option><option value='39'>Supply & Install - Chainlink Fencing</option> </select>
</div>
<div class="col-3">
<input type="button" value="load" id="loadNoteTemplate" class="button form-control">
</div>
</div>
</div>

<div class="row">
<div class="col">
<textarea name="notes1" ID="notes1" style='height:520px;' class='editmce quotenotes form-control'></textarea>
</div>
</div>
</div>
<div class="tab-pane fade" id="multi_notes_tab2" role="tabpanel" aria-labelledby="quote-notes2">
<div class="row">
<div class="col">
<textarea name="notes2" ID="notes2" style='height:420px;' class='editmce form-control quotenotes'></textarea>
</div>
</div>
</div>
<div class="row">
<div class="col">
<hr>
<h4>Special Clauses / Conditions</h4>
<div class="table-responsive" style="max-height:100px">
<div class="form-group">
<div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_57"
value='57'>
<label class="form-check-label" for="clause_57">Assumption - Ability to work on Sundays & Public Holidays </label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_59"
value='59'>
<label class="form-check-label" for="clause_59">Assumption - Access for all Vehicles Including Concrete Trucks</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_64"
value='64'>
<label class="form-check-label" for="clause_64">Assumption - Access to site will remain unimpeded, regardless of the prevailing conditions</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_58"
value='58'>
<label class="form-check-label" for="clause_58">Assumption - All Vehicles, Machinery and Tools allowed on site including Concrete Trucks</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_50"
value='50'>
<label class="form-check-label" for="clause_50">Assumption - Clear and Level Fence Line</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_66"
value='66'>
<label class="form-check-label" for="clause_66">Assumption - Concrete plinth / slab (by others)</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_54"
value='54'>
<label class="form-check-label" for="clause_54">Assumption - Concrete Wash Out area Available for Use</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_48"
value='48'>
<label class="form-check-label" for="clause_48">Assumption - Corners and Gate Locations Surveyed/Marked</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_60"
value='60'>
<label class="form-check-label" for="clause_60">Assumption - Loading & Unloading Facilities Available Onsite at No Cost to PLC Fencing</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_56"
value='56'>
<label class="form-check-label" for="clause_56">Assumption - Minimal Trade Interference</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_62"
value='62'>
<label class="form-check-label" for="clause_62">Assumption - PLC Fencing take no responsibility for discrepancies between the quoted and final required scope and specification</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_49"
value='49'>
<label class="form-check-label" for="clause_49">Assumption - Plinth Height Set at All grade Changes</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_47"
value='47'>
<label class="form-check-label" for="clause_47">Assumption - Projects to be Completed in ONE Mobilisation</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_61"
value='61'>
<label class="form-check-label" for="clause_61">Assumption - Rates apply depending on final quantities and are subject to requote if significant deviations occur </label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_53"
value='53'>
<label class="form-check-label" for="clause_53">Assumption - Rubbish Disposal Available On Site </label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_52"
value='52'>
<label class="form-check-label" for="clause_52">Assumption - Secure Laydown areas within reasonable distance</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_63"
value='63'>
<label class="form-check-label" for="clause_63">Assumption - The Client will have satisfied themselves that the quoted specification and quantities are correct for the project</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_55"
value='55'>
<label class="form-check-label" for="clause_55">Assumption - Unimpeded Access - No Restrictions on Driving on Surfaces </label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_65"
value='65'>
<label class="form-check-label" for="clause_65">Assumption - Works will proceed without union interference</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_42"
value='42'>
<label class="form-check-label" for="clause_42">Exclusion - Access Controls / Card Readers</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_41"
value='41'>
<label class="form-check-label" for="clause_41">Exclusion - Backfilling / Compacting of Excavation</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_27"
value='27'>
<label class="form-check-label" for="clause_27">Exclusion - Compaction Testing</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_44"
value='44'>
<label class="form-check-label" for="clause_44">Exclusion - Concrete Gate Aprons & Concrete Plinths</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_26"
value='26'>
<label class="form-check-label" for="clause_26">Exclusion - Concrete Testing</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_31"
value='31'>
<label class="form-check-label" for="clause_31">Exclusion - Connection of Earthing</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_36"
value='36'>
<label class="form-check-label" for="clause_36">Exclusion - De Watering of Footings / Excavations</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_35"
value='35'>
<label class="form-check-label" for="clause_35">Exclusion - Dust Supression</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_25"
value='25'>
<label class="form-check-label" for="clause_25">Exclusion - Hydro Excavation or Non-Invasive Digging</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_45"
value='45'>
<label class="form-check-label" for="clause_45">Exclusion - Inductions > 0.5 Hrs Medicals / Externals VOCs</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_32"
value='32'>
<label class="form-check-label" for="clause_32">Exclusion - Isolation of Fencing </label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_23"
value='23'>
<label class="form-check-label" for="clause_23">Exclusion - Levelling of Fence Line</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_43"
value='43'>
<label class="form-check-label" for="clause_43">Exclusion - Locking Mechanisms</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_40"
value='40'>
<label class="form-check-label" for="clause_40">Exclusion - Power Supply by Others</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_46"
value='46'>
<label class="form-check-label" for="clause_46">Exclusion - Reinstatement of Any Surfaces </label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_22"
value='22'>
<label class="form-check-label" for="clause_22">Exclusion - Removal / Demolition / Disposal of Existing Fence</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_29"
value='29'>
<label class="form-check-label" for="clause_29">Exclusion - Removal of Contaminated Materials</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_28"
value='28'>
<label class="form-check-label" for="clause_28">Exclusion - Removal of Spoil to be Spread On Site / Stockpile Onsite</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_24"
value='24'>
<label class="form-check-label" for="clause_24">Exclusion - Rock Breaking / Hard Digging</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_38"
value='38'>
<label class="form-check-label" for="clause_38">Exclusion - Signage</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_30"
value='30'>
<label class="form-check-label" for="clause_30">Exclusion - Soil Testing</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_37"
value='37'>
<label class="form-check-label" for="clause_37">Exclusion - Supply of Signs</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_20"
value='20'>
<label class="form-check-label" for="clause_20">Exclusion - Surveying of Site</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_33"
value='33'>
<label class="form-check-label" for="clause_33">Exclusion - Temporary Fencing / Safety Barriers</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_34"
value='34'>
<label class="form-check-label" for="clause_34">Exclusion - Traffic / Pedestrian Management</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_19"
value='19'>
<label class="form-check-label" for="clause_19">Exclusion - Underground Service Locating</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_21"
value='21'>
<label class="form-check-label" for="clause_21">Exclusion - Vegetation Removal</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_10"
value='10'>
<label class="form-check-label" for="clause_10">Inclusion - All Materials As Specified</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_15"
value='15'>
<label class="form-check-label" for="clause_15">Inclusion - Backfilling and Compaction of excavations </label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_11"
value='11'>
<label class="form-check-label" for="clause_11">Inclusion - Concrete as specified</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_16"
value='16'>
<label class="form-check-label" for="clause_16">Inclusion - Earthing Tags</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_14"
value='14'>
<label class="form-check-label" for="clause_14">Inclusion - Fencing & Gates as Described above</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_18"
value='18'>
<label class="form-check-label" for="clause_18">Inclusion - Freight</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_12"
value='12'>
<label class="form-check-label" for="clause_12">Inclusion - Labour & Equipment to Complete the Above Project </label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_13"
value='13'>
<label class="form-check-label" for="clause_13">Inclusion - LAFHA - Accommodations & Meals</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_17"
value='17'>
<label class="form-check-label" for="clause_17">Inclusion - Mobilisations / Swings / Travel</label>
</div><div class="form-check form-check-inline" style='min-width:150px'>
<input class="form-check-input quote_clause"
type="checkbox"
id="clause_6"
value='6'>
<label class="form-check-label" for="clause_6">Site Unseen</label>
</div> </div>
</div>
<input type="button" name="saveNote" ID="saveNote" class="button form-control" value="Save" onclick="saveNotes();">
</div>
</div>
<div class="row">
<div class="col">
<br>
<div class="h5 text-uppercase">
Terms: 30 Days Net: </div>

<div ID="sectionSummary">
<h3>Quotation Inclusions</h3>
<table class="table table-sm table-hover" style='width:95%'>
<tr>
<td>1. FENCE</td>
<td style='width:60%'>Quotation Inclusion</td>
<td>$29,432.65</td>
</tr><tr>
<td>3. GATES</td>
<td style='width:60%'>Quotation Inclusion</td>
<td>$6,987.95</td>
</tr><tr>
<td>Carlisle St, Pump Station</td>
<td></td>
<td>$262.50</td>
</tr><tr>
<td>2. INSTALLATION</td>
<td style='width:60%'>Quotation Inclusion</td>
<td>$6,777.50</td>
</tr><tr style="font-weight:bold;">
<td>Total Inclusions</td>
<td></td>
<td>$43,460.60</td>
</tr></table> </div>

<div ID="optionsSummary">
<h3>Optional Extras</h3>
<table style="border-collapse: collapse; width: 95%; float: left;" border="0" cellpadding="10">
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>

<!-- //################# HIDDEN DIV AI NOTES ##################//-->
<style>
.pac-container {
z-index: 10000 !important;
}
</style>
<div class="modal fade" id="aiNotesModal" tabindex="-1" role="dialog" aria-labelledby="aiNotesModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header">
<div ID="aiNotesModalTitle" class="h2">AI Notes</div>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" ID="aiNotesModalBody">
<div class="container-fluid text-start" id="aiNotesContainer">
<div class="d-flex justify-content-between align-items-start mb-2">
<p class="text-muted mb-0 me-3">Generate client-facing notes for this quote. Pick a template and choose how closely to follow it — <strong>Adapt</strong> keeps its wording and structure and rewrites the specifics from this quote's client, site and line items. Preview before deploying — Deploy overwrites the current notes and saves immediately.</p>
<div class="btn-group btn-group-sm flex-shrink-0">
<button type="button" class="btn btn-outline-secondary" onclick="aiNotesToggleAll(true);">Expand All</button>
<button type="button" class="btn btn-outline-secondary" onclick="aiNotesToggleAll(false);">Collapse All</button>
</div>
</div>
<div class="card ai-scope-card mb-3" data-ai-scope="main" >
<div class="card-header ai-scope-header d-flex justify-content-between align-items-center" data-bs-toggle="collapse" href="#aiCollapse_main" role="button" aria-expanded="true" aria-controls="aiCollapse_main">
<div>
<i class="material-symbols-rounded align-middle me-1">description</i>
<strong>Main Notes</strong>
<span class="badge bg-light text-muted border ms-2">All Sections</span>
<span class="badge bg-secondary ms-1 ai-status-badge" id="aiStatus_main">Not generated</span>
</div>
<i class="material-symbols-rounded ai-scope-chevron">expand_more</i>
</div>
<div class="collapse show" id="aiCollapse_main">
<div class="card-body">
<div class="row align-items-end g-2 mb-1">
<div class="col-md-5">
<label class="form-label small text-muted mb-1" for="aiTemplateFilter_main">Template (optional)</label>
<div class="input-group">
<span class="input-group-text"><i class="material-symbols-rounded">search</i></span>
<input type="text" class="form-control form-control-sm" id="aiTemplateFilter_main"
onkeyup='filterDropdown("aiTemplateFilter_main","aiTemplate_main");'
onfocus='document.getElementById("aiTemplate_main").style.display="inline-block";this.select();'
placeholder="Search templates..." autocomplete="off">
</div>
<div class="filtered_list">
<select class="form-control form-control-sm filtered_list" id="aiTemplate_main"
onchange='document.getElementById("aiTemplateFilter_main").value=getOptionText(this);this.style.display="none";aiNotesTemplatePicked("main");'
onclick='this.style.display="none";'
onblur='this.style.display="none";' multiple>
<option value="" data-ai-mode="items">None &mdash; line items only</option>
<option value="57" data-ai-mode="">Assumption - Ability to work on Sundays &amp; Public Holidays (Clause)</option>
<option value="59" data-ai-mode="">Assumption - Access for all Vehicles Including Concrete Trucks (Clause)</option>
<option value="64" data-ai-mode="">Assumption - Access to site will remain unimpeded, regardless of the prevailing conditions (Clause)</option>
<option value="58" data-ai-mode="">Assumption - All Vehicles, Machinery and Tools allowed on site including Concrete Trucks (Clause)</option>
<option value="50" data-ai-mode="">Assumption - Clear and Level Fence Line (Clause)</option>
<option value="66" data-ai-mode="">Assumption - Concrete plinth / slab (by others) (Clause)</option>
<option value="54" data-ai-mode="">Assumption - Concrete Wash Out area Available for Use (Clause)</option>
<option value="48" data-ai-mode="">Assumption - Corners and Gate Locations Surveyed/Marked (Clause)</option>
<option value="60" data-ai-mode="">Assumption - Loading &amp; Unloading Facilities Available Onsite at No Cost to PLC Fencing (Clause)</option>
<option value="56" data-ai-mode="">Assumption - Minimal Trade Interference (Clause)</option>
<option value="62" data-ai-mode="">Assumption - PLC Fencing take no responsibility for discrepancies between the quoted and final required scope and specification (Clause)</option>
<option value="49" data-ai-mode="">Assumption - Plinth Height Set at All grade Changes (Clause)</option>
<option value="47" data-ai-mode="">Assumption - Projects to be Completed in ONE Mobilisation (Clause)</option>
<option value="61" data-ai-mode="">Assumption - Rates apply depending on final quantities and are subject to requote if significant deviations occur (Clause)</option>
<option value="53" data-ai-mode="">Assumption - Rubbish Disposal Available On Site (Clause)</option>
<option value="52" data-ai-mode="">Assumption - Secure Laydown areas within reasonable distance (Clause)</option>
<option value="63" data-ai-mode="">Assumption - The Client will have satisfied themselves that the quoted specification and quantities are correct for the project (Clause)</option>
<option value="55" data-ai-mode="">Assumption - Unimpeded Access - No Restrictions on Driving on Surfaces (Clause)</option>
<option value="65" data-ai-mode="">Assumption - Works will proceed without union interference (Clause)</option>
<option value="5" data-ai-mode="">Chainlink Supply and Install (Template)</option>
<option value="7" data-ai-mode="">Chainlink Type 1 Material Template (Template)</option>
<option value="42" data-ai-mode="">Exclusion - Access Controls / Card Readers (Clause)</option>
<option value="41" data-ai-mode="">Exclusion - Backfilling / Compacting of Excavation (Clause)</option>
<option value="27" data-ai-mode="">Exclusion - Compaction Testing (Clause)</option>
<option value="44" data-ai-mode="">Exclusion - Concrete Gate Aprons &amp; Concrete Plinths (Clause)</option>
<option value="26" data-ai-mode="">Exclusion - Concrete Testing (Clause)</option>
<option value="31" data-ai-mode="">Exclusion - Connection of Earthing (Clause)</option>
<option value="36" data-ai-mode="">Exclusion - De Watering of Footings / Excavations (Clause)</option>
<option value="35" data-ai-mode="">Exclusion - Dust Supression (Clause)</option>
<option value="25" data-ai-mode="">Exclusion - Hydro Excavation or Non-Invasive Digging (Clause)</option>
<option value="45" data-ai-mode="">Exclusion - Inductions &gt; 0.5 Hrs Medicals / Externals VOCs (Clause)</option>
<option value="32" data-ai-mode="">Exclusion - Isolation of Fencing (Clause)</option>
<option value="23" data-ai-mode="">Exclusion - Levelling of Fence Line (Clause)</option>
<option value="43" data-ai-mode="">Exclusion - Locking Mechanisms (Clause)</option>
<option value="40" data-ai-mode="">Exclusion - Power Supply by Others (Clause)</option>
<option value="46" data-ai-mode="">Exclusion - Reinstatement of Any Surfaces (Clause)</option>
<option value="22" data-ai-mode="">Exclusion - Removal / Demolition / Disposal of Existing Fence (Clause)</option>
<option value="29" data-ai-mode="">Exclusion - Removal of Contaminated Materials (Clause)</option>
<option value="28" data-ai-mode="">Exclusion - Removal of Spoil to be Spread On Site / Stockpile Onsite (Clause)</option>
<option value="24" data-ai-mode="">Exclusion - Rock Breaking / Hard Digging (Clause)</option>
<option value="38" data-ai-mode="">Exclusion - Signage (Clause)</option>
<option value="30" data-ai-mode="">Exclusion - Soil Testing (Clause)</option>
<option value="37" data-ai-mode="">Exclusion - Supply of Signs (Clause)</option>
<option value="20" data-ai-mode="">Exclusion - Surveying of Site (Clause)</option>
<option value="33" data-ai-mode="">Exclusion - Temporary Fencing / Safety Barriers (Clause)</option>
<option value="34" data-ai-mode="">Exclusion - Traffic / Pedestrian Management (Clause)</option>
<option value="19" data-ai-mode="">Exclusion - Underground Service Locating (Clause)</option>
<option value="21" data-ai-mode="">Exclusion - Vegetation Removal (Clause)</option>
<option value="10" data-ai-mode="">Inclusion - All Materials As Specified (Clause)</option>
<option value="15" data-ai-mode="">Inclusion - Backfilling and Compaction of excavations (Clause)</option>
<option value="11" data-ai-mode="">Inclusion - Concrete as specified (Clause)</option>
<option value="16" data-ai-mode="">Inclusion - Earthing Tags (Clause)</option>
<option value="14" data-ai-mode="">Inclusion - Fencing &amp; Gates as Described above (Clause)</option>
<option value="18" data-ai-mode="">Inclusion - Freight (Clause)</option>
<option value="12" data-ai-mode="">Inclusion - Labour &amp; Equipment to Complete the Above Project (Clause)</option>
<option value="13" data-ai-mode="">Inclusion - LAFHA - Accommodations &amp; Meals (Clause)</option>
<option value="17" data-ai-mode="">Inclusion - Mobilisations / Swings / Travel (Clause)</option>
<option value="6" data-ai-mode="">Site Unseen (Clause)</option>
<option value="39" data-ai-mode="">Supply &amp; Install - Chainlink Fencing (Template)</option>
</select>
</div>
</div>
<div class="col-md-4">
<label class="form-label small text-muted mb-1" for="aiMode_main">How closely to follow the template</label>
<select class="form-control form-control-sm ai-mode-select" id="aiMode_main" onchange='aiNotesModeHint("main");'>
<option value="adapt" data-hint="Keeps the template's wording, headings and introduction &mdash; rewrites only the client, site, dates, quantities and inclusions to match this quote.">Adapt template (recommended)</option>
<option value="strict" data-hint="Reproduces the template almost word for word. Only placeholders and factual details are changed. Use this for approved copy.">Strict &mdash; near verbatim</option>
<option value="style" data-hint="Uses the template for tone and structure only. All wording is written fresh from the line items.">Style guide only</option>
<option value="items" data-hint="Ignores the template entirely and writes a short scope summary from the line items.">Line items only</option>
</select>
</div>
<div class="col-md-3 text-md-end">
<button type="button" class="button form-control ai-generate-btn" onclick="aiNotesGenerate('main', 0, this);">Generate</button>
</div>
</div>
<div class="small text-muted mb-2 ai-mode-hint" id="aiModeHint_main">Keeps the template's wording, headings and introduction &mdash; rewrites only the client, site, dates, quantities and inclusions to match this quote.</div>
<div class="mb-2">
<a class="small pointer" data-bs-toggle="collapse" href="#aiExtra_main" role="button" aria-expanded="false" aria-controls="aiExtra_main">
<i class="material-symbols-rounded align-middle" style="font-size:16px;">tune</i> Extra instructions for this draft (optional)
</a>
<div class="collapse" id="aiExtra_main">
<textarea class="form-control form-control-sm mt-1" id="aiInstructions_main" rows="2" maxlength="1000"
placeholder="e.g. 2 days not 3, Harbour Town centre, no airbrush option this time"></textarea>
</div>
</div>
<div class="alert alert-warning py-2 px-3 small mb-2" id="aiPlaceholders_main" style="display:none;"></div>
<div class="ai-preview" id="aiPreview_main" style="min-height:120px;max-height:320px;overflow-y:auto;border:1px solid #ccc;padding:10px;border-radius:4px;background:#fff;">
<span class="text-muted">Not generated yet.</span>
</div>
<div class="text-end mt-2">
<button type="button" class="button ai-deploy-btn" id="aiDeploy_main" disabled onclick="aiNotesDeploy('main', 0, '', '');">Deploy</button>
</div>
</div>
</div>
</div>
<div class="card ai-scope-card mb-3" data-ai-scope="section" data-section-id="413">
<div class="card-header ai-scope-header d-flex justify-content-between align-items-center" data-bs-toggle="collapse" href="#aiCollapse_413" role="button" aria-expanded="false" aria-controls="aiCollapse_413">
<div>
<i class="material-symbols-rounded align-middle me-1">segment</i>
<strong>1. FENCE</strong>
<span class="badge bg-light text-muted border ms-2">Quotation Inclusion</span>
<span class="badge bg-secondary ms-1 ai-status-badge" id="aiStatus_413">Not generated</span>
</div>
<i class="material-symbols-rounded ai-scope-chevron">expand_more</i>
</div>
<div class="collapse" id="aiCollapse_413">
<div class="card-body">
<div class="row align-items-end g-2 mb-1">
<div class="col-md-5">
<label class="form-label small text-muted mb-1" for="aiTemplateFilter_413">Template (optional)</label>
<div class="input-group">
<span class="input-group-text"><i class="material-symbols-rounded">search</i></span>
<input type="text" class="form-control form-control-sm" id="aiTemplateFilter_413"
onkeyup='filterDropdown("aiTemplateFilter_413","aiTemplate_413");'
onfocus='document.getElementById("aiTemplate_413").style.display="inline-block";this.select();'
placeholder="Search templates..." autocomplete="off">
</div>
<div class="filtered_list">
<select class="form-control form-control-sm filtered_list" id="aiTemplate_413"
onchange='document.getElementById("aiTemplateFilter_413").value=getOptionText(this);this.style.display="none";aiNotesTemplatePicked("413");'
onclick='this.style.display="none";'
onblur='this.style.display="none";' multiple>
<option value="" data-ai-mode="items">None &mdash; line items only</option>
<option value="57" data-ai-mode="">Assumption - Ability to work on Sundays &amp; Public Holidays (Clause)</option>
<option value="59" data-ai-mode="">Assumption - Access for all Vehicles Including Concrete Trucks (Clause)</option>
<option value="64" data-ai-mode="">Assumption - Access to site will remain unimpeded, regardless of the prevailing conditions (Clause)</option>
<option value="58" data-ai-mode="">Assumption - All Vehicles, Machinery and Tools allowed on site including Concrete Trucks (Clause)</option>
<option value="50" data-ai-mode="">Assumption - Clear and Level Fence Line (Clause)</option>
<option value="66" data-ai-mode="">Assumption - Concrete plinth / slab (by others) (Clause)</option>
<option value="54" data-ai-mode="">Assumption - Concrete Wash Out area Available for Use (Clause)</option>
<option value="48" data-ai-mode="">Assumption - Corners and Gate Locations Surveyed/Marked (Clause)</option>
<option value="60" data-ai-mode="">Assumption - Loading &amp; Unloading Facilities Available Onsite at No Cost to PLC Fencing (Clause)</option>
<option value="56" data-ai-mode="">Assumption - Minimal Trade Interference (Clause)</option>
<option value="62" data-ai-mode="">Assumption - PLC Fencing take no responsibility for discrepancies between the quoted and final required scope and specification (Clause)</option>
<option value="49" data-ai-mode="">Assumption - Plinth Height Set at All grade Changes (Clause)</option>
<option value="47" data-ai-mode="">Assumption - Projects to be Completed in ONE Mobilisation (Clause)</option>
<option value="61" data-ai-mode="">Assumption - Rates apply depending on final quantities and are subject to requote if significant deviations occur (Clause)</option>
<option value="53" data-ai-mode="">Assumption - Rubbish Disposal Available On Site (Clause)</option>
<option value="52" data-ai-mode="">Assumption - Secure Laydown areas within reasonable distance (Clause)</option>
<option value="63" data-ai-mode="">Assumption - The Client will have satisfied themselves that the quoted specification and quantities are correct for the project (Clause)</option>
<option value="55" data-ai-mode="">Assumption - Unimpeded Access - No Restrictions on Driving on Surfaces (Clause)</option>
<option value="65" data-ai-mode="">Assumption - Works will proceed without union interference (Clause)</option>
<option value="5" data-ai-mode="">Chainlink Supply and Install (Template)</option>
<option value="7" data-ai-mode="">Chainlink Type 1 Material Template (Template)</option>
<option value="42" data-ai-mode="">Exclusion - Access Controls / Card Readers (Clause)</option>
<option value="41" data-ai-mode="">Exclusion - Backfilling / Compacting of Excavation (Clause)</option>
<option value="27" data-ai-mode="">Exclusion - Compaction Testing (Clause)</option>
<option value="44" data-ai-mode="">Exclusion - Concrete Gate Aprons &amp; Concrete Plinths (Clause)</option>
<option value="26" data-ai-mode="">Exclusion - Concrete Testing (Clause)</option>
<option value="31" data-ai-mode="">Exclusion - Connection of Earthing (Clause)</option>
<option value="36" data-ai-mode="">Exclusion - De Watering of Footings / Excavations (Clause)</option>
<option value="35" data-ai-mode="">Exclusion - Dust Supression (Clause)</option>
<option value="25" data-ai-mode="">Exclusion - Hydro Excavation or Non-Invasive Digging (Clause)</option>
<option value="45" data-ai-mode="">Exclusion - Inductions &gt; 0.5 Hrs Medicals / Externals VOCs (Clause)</option>
<option value="32" data-ai-mode="">Exclusion - Isolation of Fencing (Clause)</option>
<option value="23" data-ai-mode="">Exclusion - Levelling of Fence Line (Clause)</option>
<option value="43" data-ai-mode="">Exclusion - Locking Mechanisms (Clause)</option>
<option value="40" data-ai-mode="">Exclusion - Power Supply by Others (Clause)</option>
<option value="46" data-ai-mode="">Exclusion - Reinstatement of Any Surfaces (Clause)</option>
<option value="22" data-ai-mode="">Exclusion - Removal / Demolition / Disposal of Existing Fence (Clause)</option>
<option value="29" data-ai-mode="">Exclusion - Removal of Contaminated Materials (Clause)</option>
<option value="28" data-ai-mode="">Exclusion - Removal of Spoil to be Spread On Site / Stockpile Onsite (Clause)</option>
<option value="24" data-ai-mode="">Exclusion - Rock Breaking / Hard Digging (Clause)</option>
<option value="38" data-ai-mode="">Exclusion - Signage (Clause)</option>
<option value="30" data-ai-mode="">Exclusion - Soil Testing (Clause)</option>
<option value="37" data-ai-mode="">Exclusion - Supply of Signs (Clause)</option>
<option value="20" data-ai-mode="">Exclusion - Surveying of Site (Clause)</option>
<option value="33" data-ai-mode="">Exclusion - Temporary Fencing / Safety Barriers (Clause)</option>
<option value="34" data-ai-mode="">Exclusion - Traffic / Pedestrian Management (Clause)</option>
<option value="19" data-ai-mode="">Exclusion - Underground Service Locating (Clause)</option>
<option value="21" data-ai-mode="">Exclusion - Vegetation Removal (Clause)</option>
<option value="10" data-ai-mode="">Inclusion - All Materials As Specified (Clause)</option>
<option value="15" data-ai-mode="">Inclusion - Backfilling and Compaction of excavations (Clause)</option>
<option value="11" data-ai-mode="">Inclusion - Concrete as specified (Clause)</option>
<option value="16" data-ai-mode="">Inclusion - Earthing Tags (Clause)</option>
<option value="14" data-ai-mode="">Inclusion - Fencing &amp; Gates as Described above (Clause)</option>
<option value="18" data-ai-mode="">Inclusion - Freight (Clause)</option>
<option value="12" data-ai-mode="">Inclusion - Labour &amp; Equipment to Complete the Above Project (Clause)</option>
<option value="13" data-ai-mode="">Inclusion - LAFHA - Accommodations &amp; Meals (Clause)</option>
<option value="17" data-ai-mode="">Inclusion - Mobilisations / Swings / Travel (Clause)</option>
<option value="6" data-ai-mode="">Site Unseen (Clause)</option>
<option value="39" data-ai-mode="">Supply &amp; Install - Chainlink Fencing (Template)</option>
</select>
</div>
</div>
<div class="col-md-4">
<label class="form-label small text-muted mb-1" for="aiMode_413">How closely to follow the template</label>
<select class="form-control form-control-sm ai-mode-select" id="aiMode_413" onchange='aiNotesModeHint("413");'>
<option value="adapt" data-hint="Keeps the template's wording, headings and introduction &mdash; rewrites only the client, site, dates, quantities and inclusions to match this quote.">Adapt template (recommended)</option>
<option value="strict" data-hint="Reproduces the template almost word for word. Only placeholders and factual details are changed. Use this for approved copy.">Strict &mdash; near verbatim</option>
<option value="style" data-hint="Uses the template for tone and structure only. All wording is written fresh from the line items.">Style guide only</option>
<option value="items" data-hint="Ignores the template entirely and writes a short scope summary from the line items.">Line items only</option>
</select>
</div>
<div class="col-md-3 text-md-end">
<button type="button" class="button form-control ai-generate-btn" onclick="aiNotesGenerate('section', 413, this);">Generate</button>
</div>
</div>
<div class="small text-muted mb-2 ai-mode-hint" id="aiModeHint_413">Keeps the template's wording, headings and introduction &mdash; rewrites only the client, site, dates, quantities and inclusions to match this quote.</div>
<div class="mb-2">
<a class="small pointer" data-bs-toggle="collapse" href="#aiExtra_413" role="button" aria-expanded="false" aria-controls="aiExtra_413">
<i class="material-symbols-rounded align-middle" style="font-size:16px;">tune</i> Extra instructions for this draft (optional)
</a>
<div class="collapse" id="aiExtra_413">
<textarea class="form-control form-control-sm mt-1" id="aiInstructions_413" rows="2" maxlength="1000"
placeholder="e.g. 2 days not 3, Harbour Town centre, no airbrush option this time"></textarea>
</div>
</div>
<div class="alert alert-warning py-2 px-3 small mb-2" id="aiPlaceholders_413" style="display:none;"></div>
<div class="ai-preview" id="aiPreview_413" style="min-height:120px;max-height:320px;overflow-y:auto;border:1px solid #ccc;padding:10px;border-radius:4px;background:#fff;">
<span class="text-muted">Not generated yet.</span>
</div>
<div class="text-end mt-2">
<button type="button" class="button ai-deploy-btn" id="aiDeploy_413" disabled onclick="aiNotesDeploy('section', 413, '1. FENCE', 'Quotation Inclusion');">Deploy</button>
</div>
</div>
</div>
</div>
<div class="card ai-scope-card mb-3" data-ai-scope="section" data-section-id="414">
<div class="card-header ai-scope-header d-flex justify-content-between align-items-center" data-bs-toggle="collapse" href="#aiCollapse_414" role="button" aria-expanded="false" aria-controls="aiCollapse_414">
<div>
<i class="material-symbols-rounded align-middle me-1">segment</i>
<strong>2. INSTALLATION</strong>
<span class="badge bg-light text-muted border ms-2">Quotation Inclusion</span>
<span class="badge bg-secondary ms-1 ai-status-badge" id="aiStatus_414">Not generated</span>
</div>
<i class="material-symbols-rounded ai-scope-chevron">expand_more</i>
</div>
<div class="collapse" id="aiCollapse_414">
<div class="card-body">
<div class="row align-items-end g-2 mb-1">
<div class="col-md-5">
<label class="form-label small text-muted mb-1" for="aiTemplateFilter_414">Template (optional)</label>
<div class="input-group">
<span class="input-group-text"><i class="material-symbols-rounded">search</i></span>
<input type="text" class="form-control form-control-sm" id="aiTemplateFilter_414"
onkeyup='filterDropdown("aiTemplateFilter_414","aiTemplate_414");'
onfocus='document.getElementById("aiTemplate_414").style.display="inline-block";this.select();'
placeholder="Search templates..." autocomplete="off">
</div>
<div class="filtered_list">
<select class="form-control form-control-sm filtered_list" id="aiTemplate_414"
onchange='document.getElementById("aiTemplateFilter_414").value=getOptionText(this);this.style.display="none";aiNotesTemplatePicked("414");'
onclick='this.style.display="none";'
onblur='this.style.display="none";' multiple>
<option value="" data-ai-mode="items">None &mdash; line items only</option>
<option value="57" data-ai-mode="">Assumption - Ability to work on Sundays &amp; Public Holidays (Clause)</option>
<option value="59" data-ai-mode="">Assumption - Access for all Vehicles Including Concrete Trucks (Clause)</option>
<option value="64" data-ai-mode="">Assumption - Access to site will remain unimpeded, regardless of the prevailing conditions (Clause)</option>
<option value="58" data-ai-mode="">Assumption - All Vehicles, Machinery and Tools allowed on site including Concrete Trucks (Clause)</option>
<option value="50" data-ai-mode="">Assumption - Clear and Level Fence Line (Clause)</option>
<option value="66" data-ai-mode="">Assumption - Concrete plinth / slab (by others) (Clause)</option>
<option value="54" data-ai-mode="">Assumption - Concrete Wash Out area Available for Use (Clause)</option>
<option value="48" data-ai-mode="">Assumption - Corners and Gate Locations Surveyed/Marked (Clause)</option>
<option value="60" data-ai-mode="">Assumption - Loading &amp; Unloading Facilities Available Onsite at No Cost to PLC Fencing (Clause)</option>
<option value="56" data-ai-mode="">Assumption - Minimal Trade Interference (Clause)</option>
<option value="62" data-ai-mode="">Assumption - PLC Fencing take no responsibility for discrepancies between the quoted and final required scope and specification (Clause)</option>
<option value="49" data-ai-mode="">Assumption - Plinth Height Set at All grade Changes (Clause)</option>
<option value="47" data-ai-mode="">Assumption - Projects to be Completed in ONE Mobilisation (Clause)</option>
<option value="61" data-ai-mode="">Assumption - Rates apply depending on final quantities and are subject to requote if significant deviations occur (Clause)</option>
<option value="53" data-ai-mode="">Assumption - Rubbish Disposal Available On Site (Clause)</option>
<option value="52" data-ai-mode="">Assumption - Secure Laydown areas within reasonable distance (Clause)</option>
<option value="63" data-ai-mode="">Assumption - The Client will have satisfied themselves that the quoted specification and quantities are correct for the project (Clause)</option>
<option value="55" data-ai-mode="">Assumption - Unimpeded Access - No Restrictions on Driving on Surfaces (Clause)</option>
<option value="65" data-ai-mode="">Assumption - Works will proceed without union interference (Clause)</option>
<option value="5" data-ai-mode="">Chainlink Supply and Install (Template)</option>
<option value="7" data-ai-mode="">Chainlink Type 1 Material Template (Template)</option>
<option value="42" data-ai-mode="">Exclusion - Access Controls / Card Readers (Clause)</option>
<option value="41" data-ai-mode="">Exclusion - Backfilling / Compacting of Excavation (Clause)</option>
<option value="27" data-ai-mode="">Exclusion - Compaction Testing (Clause)</option>
<option value="44" data-ai-mode="">Exclusion - Concrete Gate Aprons &amp; Concrete Plinths (Clause)</option>
<option value="26" data-ai-mode="">Exclusion - Concrete Testing (Clause)</option>
<option value="31" data-ai-mode="">Exclusion - Connection of Earthing (Clause)</option>
<option value="36" data-ai-mode="">Exclusion - De Watering of Footings / Excavations (Clause)</option>
<option value="35" data-ai-mode="">Exclusion - Dust Supression (Clause)</option>
<option value="25" data-ai-mode="">Exclusion - Hydro Excavation or Non-Invasive Digging (Clause)</option>
<option value="45" data-ai-mode="">Exclusion - Inductions &gt; 0.5 Hrs Medicals / Externals VOCs (Clause)</option>
<option value="32" data-ai-mode="">Exclusion - Isolation of Fencing (Clause)</option>
<option value="23" data-ai-mode="">Exclusion - Levelling of Fence Line (Clause)</option>
<option value="43" data-ai-mode="">Exclusion - Locking Mechanisms (Clause)</option>
<option value="40" data-ai-mode="">Exclusion - Power Supply by Others (Clause)</option>
<option value="46" data-ai-mode="">Exclusion - Reinstatement of Any Surfaces (Clause)</option>
<option value="22" data-ai-mode="">Exclusion - Removal / Demolition / Disposal of Existing Fence (Clause)</option>
<option value="29" data-ai-mode="">Exclusion - Removal of Contaminated Materials (Clause)</option>
<option value="28" data-ai-mode="">Exclusion - Removal of Spoil to be Spread On Site / Stockpile Onsite (Clause)</option>
<option value="24" data-ai-mode="">Exclusion - Rock Breaking / Hard Digging (Clause)</option>
<option value="38" data-ai-mode="">Exclusion - Signage (Clause)</option>
<option value="30" data-ai-mode="">Exclusion - Soil Testing (Clause)</option>
<option value="37" data-ai-mode="">Exclusion - Supply of Signs (Clause)</option>
<option value="20" data-ai-mode="">Exclusion - Surveying of Site (Clause)</option>
<option value="33" data-ai-mode="">Exclusion - Temporary Fencing / Safety Barriers (Clause)</option>
<option value="34" data-ai-mode="">Exclusion - Traffic / Pedestrian Management (Clause)</option>
<option value="19" data-ai-mode="">Exclusion - Underground Service Locating (Clause)</option>
<option value="21" data-ai-mode="">Exclusion - Vegetation Removal (Clause)</option>
<option value="10" data-ai-mode="">Inclusion - All Materials As Specified (Clause)</option>
<option value="15" data-ai-mode="">Inclusion - Backfilling and Compaction of excavations (Clause)</option>
<option value="11" data-ai-mode="">Inclusion - Concrete as specified (Clause)</option>
<option value="16" data-ai-mode="">Inclusion - Earthing Tags (Clause)</option>
<option value="14" data-ai-mode="">Inclusion - Fencing &amp; Gates as Described above (Clause)</option>
<option value="18" data-ai-mode="">Inclusion - Freight (Clause)</option>
<option value="12" data-ai-mode="">Inclusion - Labour &amp; Equipment to Complete the Above Project (Clause)</option>
<option value="13" data-ai-mode="">Inclusion - LAFHA - Accommodations &amp; Meals (Clause)</option>
<option value="17" data-ai-mode="">Inclusion - Mobilisations / Swings / Travel (Clause)</option>
<option value="6" data-ai-mode="">Site Unseen (Clause)</option>
<option value="39" data-ai-mode="">Supply &amp; Install - Chainlink Fencing (Template)</option>
</select>
</div>
</div>
<div class="col-md-4">
<label class="form-label small text-muted mb-1" for="aiMode_414">How closely to follow the template</label>
<select class="form-control form-control-sm ai-mode-select" id="aiMode_414" onchange='aiNotesModeHint("414");'>
<option value="adapt" data-hint="Keeps the template's wording, headings and introduction &mdash; rewrites only the client, site, dates, quantities and inclusions to match this quote.">Adapt template (recommended)</option>
<option value="strict" data-hint="Reproduces the template almost word for word. Only placeholders and factual details are changed. Use this for approved copy.">Strict &mdash; near verbatim</option>
<option value="style" data-hint="Uses the template for tone and structure only. All wording is written fresh from the line items.">Style guide only</option>
<option value="items" data-hint="Ignores the template entirely and writes a short scope summary from the line items.">Line items only</option>
</select>
</div>
<div class="col-md-3 text-md-end">
<button type="button" class="button form-control ai-generate-btn" onclick="aiNotesGenerate('section', 414, this);">Generate</button>
</div>
</div>
<div class="small text-muted mb-2 ai-mode-hint" id="aiModeHint_414">Keeps the template's wording, headings and introduction &mdash; rewrites only the client, site, dates, quantities and inclusions to match this quote.</div>
<div class="mb-2">
<a class="small pointer" data-bs-toggle="collapse" href="#aiExtra_414" role="button" aria-expanded="false" aria-controls="aiExtra_414">
<i class="material-symbols-rounded align-middle" style="font-size:16px;">tune</i> Extra instructions for this draft (optional)
</a>
<div class="collapse" id="aiExtra_414">
<textarea class="form-control form-control-sm mt-1" id="aiInstructions_414" rows="2" maxlength="1000"
placeholder="e.g. 2 days not 3, Harbour Town centre, no airbrush option this time"></textarea>
</div>
</div>
<div class="alert alert-warning py-2 px-3 small mb-2" id="aiPlaceholders_414" style="display:none;"></div>
<div class="ai-preview" id="aiPreview_414" style="min-height:120px;max-height:320px;overflow-y:auto;border:1px solid #ccc;padding:10px;border-radius:4px;background:#fff;">
<span class="text-muted">Not generated yet.</span>
</div>
<div class="text-end mt-2">
<button type="button" class="button ai-deploy-btn" id="aiDeploy_414" disabled onclick="aiNotesDeploy('section', 414, '2. INSTALLATION', 'Quotation Inclusion');">Deploy</button>
</div>
</div>
</div>
</div>
<div class="card ai-scope-card mb-3" data-ai-scope="section" data-section-id="415">
<div class="card-header ai-scope-header d-flex justify-content-between align-items-center" data-bs-toggle="collapse" href="#aiCollapse_415" role="button" aria-expanded="false" aria-controls="aiCollapse_415">
<div>
<i class="material-symbols-rounded align-middle me-1">segment</i>
<strong>3. GATES</strong>
<span class="badge bg-light text-muted border ms-2">Quotation Inclusion</span>
<span class="badge bg-secondary ms-1 ai-status-badge" id="aiStatus_415">Not generated</span>
</div>
<i class="material-symbols-rounded ai-scope-chevron">expand_more</i>
</div>
<div class="collapse" id="aiCollapse_415">
<div class="card-body">
<div class="row align-items-end g-2 mb-1">
<div class="col-md-5">
<label class="form-label small text-muted mb-1" for="aiTemplateFilter_415">Template (optional)</label>
<div class="input-group">
<span class="input-group-text"><i class="material-symbols-rounded">search</i></span>
<input type="text" class="form-control form-control-sm" id="aiTemplateFilter_415"
onkeyup='filterDropdown("aiTemplateFilter_415","aiTemplate_415");'
onfocus='document.getElementById("aiTemplate_415").style.display="inline-block";this.select();'
placeholder="Search templates..." autocomplete="off">
</div>
<div class="filtered_list">
<select class="form-control form-control-sm filtered_list" id="aiTemplate_415"
onchange='document.getElementById("aiTemplateFilter_415").value=getOptionText(this);this.style.display="none";aiNotesTemplatePicked("415");'
onclick='this.style.display="none";'
onblur='this.style.display="none";' multiple>
<option value="" data-ai-mode="items">None &mdash; line items only</option>
<option value="57" data-ai-mode="">Assumption - Ability to work on Sundays &amp; Public Holidays (Clause)</option>
<option value="59" data-ai-mode="">Assumption - Access for all Vehicles Including Concrete Trucks (Clause)</option>
<option value="64" data-ai-mode="">Assumption - Access to site will remain unimpeded, regardless of the prevailing conditions (Clause)</option>
<option value="58" data-ai-mode="">Assumption - All Vehicles, Machinery and Tools allowed on site including Concrete Trucks (Clause)</option>
<option value="50" data-ai-mode="">Assumption - Clear and Level Fence Line (Clause)</option>
<option value="66" data-ai-mode="">Assumption - Concrete plinth / slab (by others) (Clause)</option>
<option value="54" data-ai-mode="">Assumption - Concrete Wash Out area Available for Use (Clause)</option>
<option value="48" data-ai-mode="">Assumption - Corners and Gate Locations Surveyed/Marked (Clause)</option>
<option value="60" data-ai-mode="">Assumption - Loading &amp; Unloading Facilities Available Onsite at No Cost to PLC Fencing (Clause)</option>
<option value="56" data-ai-mode="">Assumption - Minimal Trade Interference (Clause)</option>
<option value="62" data-ai-mode="">Assumption - PLC Fencing take no responsibility for discrepancies between the quoted and final required scope and specification (Clause)</option>
<option value="49" data-ai-mode="">Assumption - Plinth Height Set at All grade Changes (Clause)</option>
<option value="47" data-ai-mode="">Assumption - Projects to be Completed in ONE Mobilisation (Clause)</option>
<option value="61" data-ai-mode="">Assumption - Rates apply depending on final quantities and are subject to requote if significant deviations occur (Clause)</option>
<option value="53" data-ai-mode="">Assumption - Rubbish Disposal Available On Site (Clause)</option>
<option value="52" data-ai-mode="">Assumption - Secure Laydown areas within reasonable distance (Clause)</option>
<option value="63" data-ai-mode="">Assumption - The Client will have satisfied themselves that the quoted specification and quantities are correct for the project (Clause)</option>
<option value="55" data-ai-mode="">Assumption - Unimpeded Access - No Restrictions on Driving on Surfaces (Clause)</option>
<option value="65" data-ai-mode="">Assumption - Works will proceed without union interference (Clause)</option>
<option value="5" data-ai-mode="">Chainlink Supply and Install (Template)</option>
<option value="7" data-ai-mode="">Chainlink Type 1 Material Template (Template)</option>
<option value="42" data-ai-mode="">Exclusion - Access Controls / Card Readers (Clause)</option>
<option value="41" data-ai-mode="">Exclusion - Backfilling / Compacting of Excavation (Clause)</option>
<option value="27" data-ai-mode="">Exclusion - Compaction Testing (Clause)</option>
<option value="44" data-ai-mode="">Exclusion - Concrete Gate Aprons &amp; Concrete Plinths (Clause)</option>
<option value="26" data-ai-mode="">Exclusion - Concrete Testing (Clause)</option>
<option value="31" data-ai-mode="">Exclusion - Connection of Earthing (Clause)</option>
<option value="36" data-ai-mode="">Exclusion - De Watering of Footings / Excavations (Clause)</option>
<option value="35" data-ai-mode="">Exclusion - Dust Supression (Clause)</option>
<option value="25" data-ai-mode="">Exclusion - Hydro Excavation or Non-Invasive Digging (Clause)</option>
<option value="45" data-ai-mode="">Exclusion - Inductions &gt; 0.5 Hrs Medicals / Externals VOCs (Clause)</option>
<option value="32" data-ai-mode="">Exclusion - Isolation of Fencing (Clause)</option>
<option value="23" data-ai-mode="">Exclusion - Levelling of Fence Line (Clause)</option>
<option value="43" data-ai-mode="">Exclusion - Locking Mechanisms (Clause)</option>
<option value="40" data-ai-mode="">Exclusion - Power Supply by Others (Clause)</option>
<option value="46" data-ai-mode="">Exclusion - Reinstatement of Any Surfaces (Clause)</option>
<option value="22" data-ai-mode="">Exclusion - Removal / Demolition / Disposal of Existing Fence (Clause)</option>
<option value="29" data-ai-mode="">Exclusion - Removal of Contaminated Materials (Clause)</option>
<option value="28" data-ai-mode="">Exclusion - Removal of Spoil to be Spread On Site / Stockpile Onsite (Clause)</option>
<option value="24" data-ai-mode="">Exclusion - Rock Breaking / Hard Digging (Clause)</option>
<option value="38" data-ai-mode="">Exclusion - Signage (Clause)</option>
<option value="30" data-ai-mode="">Exclusion - Soil Testing (Clause)</option>
<option value="37" data-ai-mode="">Exclusion - Supply of Signs (Clause)</option>
<option value="20" data-ai-mode="">Exclusion - Surveying of Site (Clause)</option>
<option value="33" data-ai-mode="">Exclusion - Temporary Fencing / Safety Barriers (Clause)</option>
<option value="34" data-ai-mode="">Exclusion - Traffic / Pedestrian Management (Clause)</option>
<option value="19" data-ai-mode="">Exclusion - Underground Service Locating (Clause)</option>
<option value="21" data-ai-mode="">Exclusion - Vegetation Removal (Clause)</option>
<option value="10" data-ai-mode="">Inclusion - All Materials As Specified (Clause)</option>
<option value="15" data-ai-mode="">Inclusion - Backfilling and Compaction of excavations (Clause)</option>
<option value="11" data-ai-mode="">Inclusion - Concrete as specified (Clause)</option>
<option value="16" data-ai-mode="">Inclusion - Earthing Tags (Clause)</option>
<option value="14" data-ai-mode="">Inclusion - Fencing &amp; Gates as Described above (Clause)</option>
<option value="18" data-ai-mode="">Inclusion - Freight (Clause)</option>
<option value="12" data-ai-mode="">Inclusion - Labour &amp; Equipment to Complete the Above Project (Clause)</option>
<option value="13" data-ai-mode="">Inclusion - LAFHA - Accommodations &amp; Meals (Clause)</option>
<option value="17" data-ai-mode="">Inclusion - Mobilisations / Swings / Travel (Clause)</option>
<option value="6" data-ai-mode="">Site Unseen (Clause)</option>
<option value="39" data-ai-mode="">Supply &amp; Install - Chainlink Fencing (Template)</option>
</select>
</div>
</div>
<div class="col-md-4">
<label class="form-label small text-muted mb-1" for="aiMode_415">How closely to follow the template</label>
<select class="form-control form-control-sm ai-mode-select" id="aiMode_415" onchange='aiNotesModeHint("415");'>
<option value="adapt" data-hint="Keeps the template's wording, headings and introduction &mdash; rewrites only the client, site, dates, quantities and inclusions to match this quote.">Adapt template (recommended)</option>
<option value="strict" data-hint="Reproduces the template almost word for word. Only placeholders and factual details are changed. Use this for approved copy.">Strict &mdash; near verbatim</option>
<option value="style" data-hint="Uses the template for tone and structure only. All wording is written fresh from the line items.">Style guide only</option>
<option value="items" data-hint="Ignores the template entirely and writes a short scope summary from the line items.">Line items only</option>
</select>
</div>
<div class="col-md-3 text-md-end">
<button type="button" class="button form-control ai-generate-btn" onclick="aiNotesGenerate('section', 415, this);">Generate</button>
</div>
</div>
<div class="small text-muted mb-2 ai-mode-hint" id="aiModeHint_415">Keeps the template's wording, headings and introduction &mdash; rewrites only the client, site, dates, quantities and inclusions to match this quote.</div>
<div class="mb-2">
<a class="small pointer" data-bs-toggle="collapse" href="#aiExtra_415" role="button" aria-expanded="false" aria-controls="aiExtra_415">
<i class="material-symbols-rounded align-middle" style="font-size:16px;">tune</i> Extra instructions for this draft (optional)
</a>
<div class="collapse" id="aiExtra_415">
<textarea class="form-control form-control-sm mt-1" id="aiInstructions_415" rows="2" maxlength="1000"
placeholder="e.g. 2 days not 3, Harbour Town centre, no airbrush option this time"></textarea>
</div>
</div>
<div class="alert alert-warning py-2 px-3 small mb-2" id="aiPlaceholders_415" style="display:none;"></div>
<div class="ai-preview" id="aiPreview_415" style="min-height:120px;max-height:320px;overflow-y:auto;border:1px solid #ccc;padding:10px;border-radius:4px;background:#fff;">
<span class="text-muted">Not generated yet.</span>
</div>
<div class="text-end mt-2">
<button type="button" class="button ai-deploy-btn" id="aiDeploy_415" disabled onclick="aiNotesDeploy('section', 415, '3. GATES', 'Quotation Inclusion');">Deploy</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>

<div class="container-fluid">
<div class="row">
</div>
<!-- NEW ROW -->
<div class="row text-start">
<div class="col-sm">
<div class="form-group">
<select name='tid' id="invCategory" class="form-control" alt="TIP:ROLE MOUSE WHEEL" onfocus=document.getElementById("itemFilterSelect").style.display="inline" ; onblur=if(document.activeElement.id!="itemFiterSelect" ){document.getElementById("itemFilterSelect").style.display="none" ;};>
<option value='%%' selected>Filter by Category</option><option value='86'>! Legacy Codes</option><option value='45'>!. Codes for Recycling</option><option value='24'>!Generic Fencing Prices</option><option value='31'>Bluedog Spear Top</option><option value='2'>Chainlink Fittings </option><option value='14'>Chainlink Gates</option><option value='25'>Chainwire Fencing</option><option value='30'>Colorbond Fencing</option><option value='34'>Concreting</option><option value='3'>Eltrak Gate Systems</option><option value='33'>Gate Automation</option><option value='87'>Gate Sub-assemblies</option><option value='1'>Miscellaneous</option><option value='68'>Operations</option><option value='73'>Operations - Installation</option><option value='74'>Ops - Materials</option><option value='70'>Ops - Plant</option><option value='72'>Ops - Services</option><option value='71'>Ops - Subcontracting</option><option value='69'>Ops - XX Labour</option><option value='32'>Palisade Fencing</option><option value='5'>PIPE</option><option value='47'>PLCx Chainlink</option><option value='12'>PLCx Chainlink Fabric</option><option value='85'>PLCx Custom Items</option><option value='36'>PLCx External Production </option><option value='49'>PLCx Fabrication</option><option value='80'>PLCx Fasteners</option><option value='66'>PLCx Fittings</option><option value='84'>PLCx Freight</option><option value='51'>PLCx Hollow Section</option><option value='52'>PLCx Hot Rolled</option><option value='79'>PLCx Palisade</option><option value='50'>PLCx Pipe</option><option value='59'>PLCx Post</option><option value='64'>PLCx Products</option><option value='53'>PLCx Raw Steel</option><option value='81'>PLCx Timber</option><option value='63'>PLCx Weld Mesh</option><option value='58'>PLCx Weldmesh</option><option value='82'>PLCx Wire</option><option value='83'>PLCx Wire - Bundled</option><option value='67'>PLCx Z Ed Working</option><option value='56'>PLCx Z Mitch Working</option><option value='57'>PLCx Z Pat Working </option><option value='42'>PLCx Z Pete Working</option><option value='21'>Rural Fencing</option><option value='23'>SA WATER RURAL</option><option value='27'>SA Water Spear Top</option><option value='38'>SAPN Fencing</option><option value='22'>Signage</option><option value='17'>Steel</option><option value='19'>Steel - Commercial Pipe</option><option value='20'>Steel - Commercial Pipe H</option><option value='8'>Steel - Flat Bar</option><option value='18'>Steel - RHS</option><option value='26'>Tubular Fencing</option><option value='4'>Tubular Gate Fittings</option><option value='28'>Tubular Gates</option><option value='11'>Unapproved</option><option value='35'>Weldmesh Fencing</option><option value='9'>Weldmesh Raw Materials</option> </select>
</div>
</div>
<div class="col-sm">
<div class="form-group">
<input type="text" ID="needle" class="form-control" placeholder="Type to filter" onkeyup="filterTable('needle','dataTable');">
</div>
</div>
<div class="col-md">
</div>
<div class="col-auto ">
<div class="d-flex align-items-center gap-2 flex-nowrap" id="itemActionButtons">
<input type="button" data-bs-target="#addInventoryModal" data-bs-toggle="modal" value="Add Item">
<input type="button" xdata-bs-target="#addInventoryAdvancedOptionModal" xdata-bs-toggle="modal" value="Modify Item" class="d-none" id="btnModifyInventory"> </div>
</div>
<div class="col-md">
<div class='button' style='display:inline;background-color:lightgreen;display:none' ID='children' onclick="loadKit();">
KIT ITEMS
</div>
</div>
<div class="col-md">
<div class="form-group">
<div class='button' style='display:inline;background-color:lightblue;display:none' ID='modifier' data-bs-toggle="modal" data-bs-target="#pipetopost2" onclick="p2GetData('','0');">
MODIFIER
</div>
</div>
</div>
<div class="col">
<div class="alert alert-warning rounded" ID="add_item_info" style="display:none"></div>
</div>
<div class="col">
<div ID="supplierCodes" style="display:none;">
<select ID="supplierSelect" onchange='updatePrice()' class="form-control">
<option data-price="" value="0">Standard Cost</option>
<option data-price="" value="0">Average Cost</option>
</select>
</div>
</div>
<div class="col">
<div ID="priceOptions" style="display:none;margin-left:20px;">
<select ID="priceSelector" onchange=document.getElementById("price").value=this.value;>
<option>Standard</option>
<option>Pricing B</option>
<option>Pricing C</option>
<option>Pricing D</option>
</select>
</div>
</div>

<!-- END ROW -->
</div>
<!-- END CONTAINER -->
</div>
<!-- ##### PLACE HOLDER FOR SUPPLIER CODES AND PRICING -->




<input type="hidden" name="locked" ID="locked" value="0">
<input type="hidden" name="contractid" id="contractid" value="0">
<input type="hidden" name="contractsiteid" id="contractsiteid" value="0">
<fieldset class="ajax_form">
<div class="table-responsive" style="min-height:400px; margin-right:25px">
<table class='table datatable' style="min-width:1200px">
<thead>
<tr class='datatabletitle nope'>
<th style="width:220px">Item Code</th>
<th style="min-width:275px">Description</th>
<th style="width:100px" class="costplus">Unit Cost</th>
<th style="width:100px" class="discount">
<div id="priceCol">Unit Price </div>
</th>
<th style="width:100px">Qty</th>
<th style="width:100px;" class="costplus d-none">Line Cost</th>
<th style="width:80px;">
<div id="markupCol">Disc. %</div>
</th>
<th style="width:100px">Unit Sell</th>
<th style="width:100px;">Tax</th>
<th style="width:100px;">Subtotal</th>
<th style="width:75px;"></th>
</tr>
</thead>
<tbody>
<tr style="height:50px;padding:0;margin:0px;vertical-align:top;" class="formRow ajax_fordm" ID="formRow">
<td style="height:40px;">
<div class="input-group bg-secondary bg-opacity-25">
<div class="input-group-text material-symbols-rounded">search</div>
<input type='text' name='filter' data-branch = "1" ID='itemFilter' class="form-control" value="" placeholder="Search Here" onkeyup="filterSelect('inv',this.id);removeBOMConfigueIcon ();" onpaste="filterSelect('inv',this.id);removeBOMConfigueIcon ();" onfocus=document.getElementById("itemFilterSelect").style.display="inline" ;this.select(); onblur=document.getElementById("itemFilterSelect").display="none" ; autocomplete="off">
</div>
<div class="filtered_list">
<select name="code" ID="itemFilterSelect" size="14" style="display:none" class="filtered_list" donmouseup="getProducts();" onclick='getProducts();this.style.display="none";' onmouseenter="this.focus();" onblur='this.style.display="none";'>
<option value='0'>Please Select Code</option>
</select>
</div>
</td>
<td>
<div class="row">
<div class="col">
<div class='expandingArea'>
<pre><span></span><br></pre>
<textarea ID="theDescription" name="description" class='datainput'></textarea>
</div>
</div>
<div class="col-1">
<span class="material-symbols-rounded pointer" data-bs-toggle="collapse" data-bs-target="#customer_notes_container">notes</span>
</div>
</div>
<div class="collapse" id="customer_notes_container">
<textarea style="" class="form-control" name="customer_notes" id="customer_notes" placeholder="Enter internal notes here. These carry over to production team"></textarea>
</div>
</td>
<td class="costplus">
<input type="text" name="cost" ID="cost" size="3" class='form-control' onkeydown="return isNumberKey(event);" onchange=" updateNew();">
</td>
<td class="discount">
<input type="text" name="price" ID="price" size="5" class='datainput' onkeydown="return isNumberKey(event);" onchange=" updateNew();">
</td>
<td style="width:100px">

<input type="text" name="qty" onchange="updateNew();" ID='qty' size="3" value="" class="form-control" onkeydown="return isNumberKey(event);">
<input type="hidden" name="extra" ID="extra">
<textarea style="display:none" name="bom" ID="bom"></textarea>
<input type="text" style="display:none" name="mfroute" id="mfroute" value="0">
</td>
<td class="costplus d-none" ID="lineCost">
</td>
<td style="width:80px" nowrap><input type="text" name="discount" ID="discount" size="2" class='form-control' onkeydown="return isNumberKey(event);" value="0" onchange=" updateNew();"></td>
<td style="width:100px"><input type="text" name="adjPrice" ID="adjPrice" size="" class='form-control' onkeydown="return isNumberKey(event);updateNew()" onchange="updateNew()"></td>
<td style="width:100px">
<select name='tax' ID='tax' class="form-select">
<option value='10' >GST</option><option value='29' >WET</option><option value='-46' >ABNW</option><option value='0' >FREE</option> </select>
</td>
<td class='align-top' style="width:100px" ID="newItemTotal"></td>
<td style="text-align:center;width:90px" ID="newItemEndCell">
<i class="material-symbols-rounded pointer" onclick="if(document.getElementById('itemFilterSelect').options[document.getElementById('itemFilterSelect').selectedIndex] > '0') { addDataRow('dataTableBody'); }">add_circle_outline</i>
<i class="pointer material-symbols-rounded" onclick="$('#uomModal').modal('show');" style="display:none" ID="uommore_icon">ad_units</i>
<i class="pointer material-symbols-rounded" ID="alertIcon" onclick="hideAll();document.getElementById('invAlert').classList.toggle('popupDivFade');" style="display:none;">warning</i>
</td>
</tr>

</tbody>
</table>

<div class="scrollingDiv" ID="scrollContainer" style="min-width:1200px">
<table ID="dataTable" class='table datatable'>
<thead>
<tr style="height:1px;opacity:0;">
<th style="width:220px">
<div style="width:180px"></div>
</th>
<th style="min-width:275px"></th>
<th style="width:100px" class="costplus"></th>
<th style="width:100px" class="discount"></th>
<th style="width:100px;"></th>
<th style="width:100px;" class="costplus d-none"></th>
<th style="width:80px"></th>
<th style="width:100px"></th>
<th style="width:100px;"></th>
<th style="width:100px;"></th>
<th style="width:75px;"></th>
</tr>
</thead>
<tbody ID="dataTableBody">
<tr data-kits-separated='0' class='quoteitemrow0 0 deleted ' style="display:none;color:red" ID="0" >
<td style="cursor:move;" class="draggable" draggable=true>
<a onclick="editInvItem(3207);this.form.submit();">FREIGHT/CW/2101-2400</a>
<input type=hidden name='inventoryid[]' value='3207'>
<input type=hidden name='rowId[]' value='0'>
<input type=hidden name='sectionName[]' value='ALL'>
<input type=hidden name='parent[]' ID='qParent0' value='0'>
<input type='hidden' ID='itaxName0' name='itaxName[]' value='GST'>
<input type='hidden' ID='itaxValue0' name='itaxValue[]' value='10' autocomplete='off'>
<input type=hidden name='deleteInvItem[]' ID='deleteInvItem0' value='1'>
<textarea style='display:none' name='bom[]' ID='bom0'></textarea>
<input type=hidden name='quoteitemid[]' ID='qItemId0' value='7495'>
<input type=hidden name='extra[]' ID='extra0' value=''>
<input type=hidden name='weight[]' ID='weight0' value='0'>
<input type=hidden id='parentid0' value='0'>
<input type=hidden id='referenceid0' value='7495'>
<input type=hidden id='contractid0' name='contractid[]' value='0'>
<input type=hidden id='contractsiteid0' name='contractsiteid[]' value='0'>
</td>
<td>
<div class='expandingArea'>
<pre><span></span><br></pre>
<textarea class=""
name='itemdescription[]'
id='desc0'
onchange="toggleClass('unsaved','1')" style='color:red;'>Freight for Chainwire Fencing - overall height 2101mm to 2400mm - all materials - per 100m of fencing per km travelled</textarea>
</div>
</td>
<td class="costplus currency">
<input type="text" name='itemcost[]' ID='itemcost0' value='0.4750'
class='datainput' data-invcost = '0.475' onchange="updateRow(0, 1, 'itemCost');" autocomplete='off' style='color:red;'>
</td>
<td class="discount currency">
<input type='text' name='itemprice[]' ID='itemprice0' value='0.7200'
class='datainput' onkeydown='' onchange="updateRow(0, 1, 'itemPrice');" autocomplete='off' style='color:red;'>
</td>
<td style="width:100px">
<input type='text' name='itemqty[]' ID='qty0' value='49.00'
style="width:100%; color:red;" class="datainput" onchange="updateRow(0, 1, 'itemQty');" autocomplete='off'>
</td>
<td class="costplus d-none" ID="linecost0" style='color:red;'>
$23.28
</td>
<td >
<input type='text' name='itemdiscount[]' ID='discount0'
value='25.0105' class='datainput' onblur="updateRow(0, 1, 'itemDisc');" style='color:red;'>
</td>
<td class="currency">
<input type='text'
name='adjPrice[]'
ID='adjPrice0'
value='0.5938'
size='4'
class='datainput '
onkeydown=''
onchange="updateRow(0, 1, 'adjPrice');"
autocomplete='off' style='color:red;'>
</td>
<td style="width:100px">
<input type='hidden' ID='itaxAmount0' class='datainput' name='itaxAmount[]' newval='0.0594'
value='0.0594' autocomplete='off'>
<div ID='itaxAmountText0'>2.9106</div>
</td>
<td ID='subTotal0' style="width:100px" data-itemtotal=\'0.59" data-total="29.10">29.10</td>
<td class="pe-2" style="width:90px"><div ID='actionIcon[]' class="actionIcon0 text-end" style="width:auto;float:right;display:inline-block;position:relative"><span class=" float-right material-symbols-rounded pointer" onclick='hideRows(0);' ID='delIcon0' >undo</span>
<span class='float-right' class='morebtn' data-id='7495' href="#" onclick="hideAll();document.getElementById('moreItem0').classList.toggle('popupDivFade'); return false;" style='cursor:pointer;'>
<i class="material-symbols-rounded" dataclass="morebtn" ID="more0" data-quote='2266' data-id='7495' data-cat='74' style="color:">more_vert</i>
</span></div>
<div id="moreItem0" class="popupDiv quoteItemMore">
<div class='popupDivHeader container-fluid'>
<div class='row'>
<div class='col h3'>
ADVANCED FREIGHT/CW/2101-2400
</div>
<div class='col-1'>
<a style='float:right' onclick="hideAll(); quoteAutosave();";>
<i class="material-symbols-rounded">close</i></a>
</div>
</div>
</div>
<div class='navbar-collapse d-flex mt-3' id='navbarNavPopupDiv0'><ul class='navbar-nav' style='flex-direction:row;'><li class='nav-item active'><a class='smpd pointer nav-link' id='smpdpddetails0' onclick="quoteItemTab('0','pddetails');" style='text-decoration:underline;color:var(--main-selected-color);'>Details</a></li><li class='nav-item' style='margin-left:-1px;'><a class='smpd pointer nav-link' id='smpdpdfiles0' onclick="quoteItemTab('0','pdfiles');" style='text-decoration:none;'>Files</a></li></ul></div><div id='pddetails0' class='menupd'><textarea class='form-control' rows="10">Freight for Chainwire Fencing - overall height 2101mm to 2400mm - all materials - per 100m of fencing per km travelled</textarea>
<br><br><a style="height:auto;" class="pointer" onmouseup="setCosttoInv('0','0.475')">Inventory Cost: $0.48</a>
<br>Weight: 0 KG<hr>
<div class='form-group'>
<label>Notes:</label>
<textarea name=itemnotes[] class='form-control'></textarea>
</div>
<div class='form-group'>
<label>Tab:</label>
<select name="sectionId[]" class='form-control'>
<option value="0">Unassigned</option><option value="413" >1. FENCE</option><option value="414" >2. INSTALLATION</option><option value="415" >3. GATES</option> </select>
</div>
<div class='form-group'>
<label>Supplier Code:</label>
<select name="supplier[]" ID="supplier0" class='form-control'>
<option value="0">N/A</option> <option value="297" >FREIGHT/CW/2101-2400 Fencetech Australia Pty Ltd t/a Otter Fencing 0.38</option> </select>
</div>
<font style="color:red" ID="warning0"></font><div class="col for_review">
<label><input type="checkbox" class="for_review_checkbox" style="float: left;" data-quoteitemid="7495" /><input type="hidden" name="for_review[]" value="0" /><span style="display:inline-block;margin-left:5px;"> Mark this item for review </span></label>
</div><br>
<span class='pointer'
onclick="getUOM('3207','0');">
Manage Unit of Measure
<i class="material-symbols-rounded" >ad_units</i>
</span><div class="custom-fields custom-field7495"></div></div><div id='pdfiles0' class='menupd' style='display:none;'><div class='sidebar-attachedment-container'>
<div class="h4 mb-3 mt-3 text-start">File Upload
<div id="sidebarDropboxBtnContainer" class="d-inline"><!--Do not delete this part, this is for dropbox button--></div>
<div id="mfilesBtnContainer" class="d-inline"><!--Do not delete this part, this is for mfiles button--></div>
</div>
<div class="row">
<div class="col">
<div data-action="uploadsave.php"
data-cat="Select"
data-sourceid="7495"
data-sourcemodule="6"
data-subtype="quoteitem"
data-quote="2266"
class="sdropzone border border-2 p-3 mb-2 dropzone_quoteitem"
id="quoteitem_dropzone_0" >
<!--
<input type='hidden' name='category' value="Select">
<input type='hidden' name='sourceid' id="sourceid" value="">
<input type='hidden' name='sourcemodule' value="">
<input type='hidden' name='subtype' value="">
-->
<div class="mb-1">
<div class="dz-message" data-dz-message>
<div class="h5">Drag and Drop to upload files or click here</div>
<p>Files uploaded here will not be placed in a category. To upload files into specific categories use the "+" icon above</p>
</div>
</div>
</div>
</div>
</div>

<div> <table class="upload-card w-100" data-category="$row->category" id="file_card_">
<tbody class="uploadedFiles">
</tbody>
</table>
</div></div></div></div></td></tr><tr data-kits-separated='0' class='quoteitemrow1 0 deleted ' style="display:none;color:red" ID="1" >
<td style="cursor:move;" class="draggable" draggable=true>
<a onclick="editInvItem(1899);this.form.submit();">FREIGHT</a>
<input type=hidden name='inventoryid[]' value='1899'>
<input type=hidden name='rowId[]' value='1'>
<input type=hidden name='sectionName[]' value='ALL'>
<input type=hidden name='parent[]' ID='qParent1' value='0'>
<input type='hidden' ID='itaxName1' name='itaxName[]' value='GST'>
<input type='hidden' ID='itaxValue1' name='itaxValue[]' value='10' autocomplete='off'>
<input type=hidden name='deleteInvItem[]' ID='deleteInvItem1' value='1'>
<textarea style='display:none' name='bom[]' ID='bom1'></textarea>
<input type=hidden name='quoteitemid[]' ID='qItemId1' value='7497'>
<input type=hidden name='extra[]' ID='extra1' value=''>
<input type=hidden name='weight[]' ID='weight1' value='0'>
<input type=hidden id='parentid1' value='0'>
<input type=hidden id='referenceid1' value='7497'>
<input type=hidden id='contractid1' name='contractid[]' value='0'>
<input type=hidden id='contractsiteid1' name='contractsiteid[]' value='0'>
</td>
<td>
<div class='expandingArea'>
<pre><span></span><br></pre>
<textarea class=""
name='itemdescription[]'
id='desc1'
onchange="toggleClass('unsaved','1')" style='color:red;'>FREIGHT</textarea>
</div>
</td>
<td class="costplus currency">
<input type="text" name='itemcost[]' ID='itemcost1' value='1.0000'
class='datainput' data-invcost = '1' onchange="updateRow(1, 1, 'itemCost');" autocomplete='off' style='color:red;'>
</td>
<td class="discount currency">
<input type='text' name='itemprice[]' ID='itemprice1' value='1.0000'
class='datainput' onkeydown='' onchange="updateRow(1, 1, 'itemPrice');" autocomplete='off' style='color:red;'>
</td>
<td style="width:100px">
<input type='text' name='itemqty[]' ID='qty1' value='29.00'
style="width:100%; color:red;" class="datainput" onchange="updateRow(1, 1, 'itemQty');" autocomplete='off'>
</td>
<td class="costplus d-none" ID="linecost1" style='color:red;'>
$29.00
</td>
<td >
<input type='text' name='itemdiscount[]' ID='discount1'
value='25' class='datainput' onblur="updateRow(1, 1, 'itemDisc');" style='color:red;'>
</td>
<td class="currency">
<input type='text'
name='adjPrice[]'
ID='adjPrice1'
value='1.2500'
size='4'
class='datainput '
onkeydown=''
onchange="updateRow(1, 1, 'adjPrice');"
autocomplete='off' style='color:red;'>
</td>
<td style="width:100px">
<input type='hidden' ID='itaxAmount1' class='datainput' name='itaxAmount[]' newval='0.1250'
value='0.1250' autocomplete='off'>
<div ID='itaxAmountText1'>3.6250</div>
</td>
<td ID='subTotal1' style="width:100px" data-itemtotal=\'1.25" data-total="36.25">36.25</td>
<td class="pe-2" style="width:90px"><div ID='actionIcon[]' class="actionIcon1 text-end" style="width:auto;float:right;display:inline-block;position:relative"><span class=" float-right material-symbols-rounded pointer" onclick='hideRows(1);' ID='delIcon1' >undo</span>
<span class='float-right' class='morebtn' data-id='7497' href="#" onclick="hideAll();document.getElementById('moreItem1').classList.toggle('popupDivFade'); return false;" style='cursor:pointer;'>
<i class="material-symbols-rounded" dataclass="morebtn" ID="more1" data-quote='2266' data-id='7497' data-cat='84' style="color:">more_vert</i>
</span></div>
<div id="moreItem1" class="popupDiv quoteItemMore">
<div class='popupDivHeader container-fluid'>
<div class='row'>
<div class='col h3'>
ADVANCED FREIGHT
</div>
<div class='col-1'>
<a style='float:right' onclick="hideAll(); quoteAutosave();";>
<i class="material-symbols-rounded">close</i></a>
</div>
</div>
</div>
<div class='navbar-collapse d-flex mt-3' id='navbarNavPopupDiv1'><ul class='navbar-nav' style='flex-direction:row;'><li class='nav-item active'><a class='smpd pointer nav-link' id='smpdpddetails1' onclick="quoteItemTab('1','pddetails');" style='text-decoration:underline;color:var(--main-selected-color);'>Details</a></li><li class='nav-item' style='margin-left:-1px;'><a class='smpd pointer nav-link' id='smpdpdfiles1' onclick="quoteItemTab('1','pdfiles');" style='text-decoration:none;'>Files</a></li></ul></div><div id='pddetails1' class='menupd'><textarea class='form-control' rows="10">FREIGHT</textarea>
<br><br><a style="height:auto;" class="pointer" onmouseup="setCosttoInv('1','1')">Inventory Cost: $1.00</a>
<br>Weight: 0 KG<hr>
<div class='form-group'>
<label>Notes:</label>
<textarea name=itemnotes[] class='form-control'></textarea>
</div>
<div class='form-group'>
<label>Tab:</label>
<select name="sectionId[]" class='form-control'>
<option value="0">Unassigned</option><option value="413" >1. FENCE</option><option value="414" >2. INSTALLATION</option><option value="415" >3. GATES</option> </select>
</div>
<div class='form-group'>
<label>Supplier Code:</label>
<select name="supplier[]" ID="supplier1" class='form-control'>
<option value="0">N/A</option> </select>
</div>
<font style="color:red" ID="warning1"></font><div class="col for_review">
<label><input type="checkbox" class="for_review_checkbox" style="float: left;" data-quoteitemid="7497" /><input type="hidden" name="for_review[]" value="0" /><span style="display:inline-block;margin-left:5px;"> Mark this item for review </span></label>
</div><br>
<span class='pointer'
onclick="getUOM('1899','1');">
Manage Unit of Measure
<i class="material-symbols-rounded" >ad_units</i>
</span><div class="custom-fields custom-field7497"></div></div><div id='pdfiles1' class='menupd' style='display:none;'><div class='sidebar-attachedment-container'>
<div class="h4 mb-3 mt-3 text-start">File Upload
<div id="sidebarDropboxBtnContainer" class="d-inline"><!--Do not delete this part, this is for dropbox button--></div>
<div id="mfilesBtnContainer" class="d-inline"><!--Do not delete this part, this is for mfiles button--></div>
</div>
<div class="row">
<div class="col">
<div data-action="uploadsave.php"
data-cat="Select"
data-sourceid="7497"
data-sourcemodule="6"
data-subtype="quoteitem"
data-quote="2266"
class="sdropzone border border-2 p-3 mb-2 dropzone_quoteitem"
id="quoteitem_dropzone_1" >
<!--
<input type='hidden' name='category' value="Select">
<input type='hidden' name='sourceid' id="sourceid" value="">
<input type='hidden' name='sourcemodule' value="">
<input type='hidden' name='subtype' value="">
-->
<div class="mb-1">
<div class="dz-message" data-dz-message>
<div class="h5">Drag and Drop to upload files or click here</div>
<p>Files uploaded here will not be placed in a category. To upload files into specific categories use the "+" icon above</p>
</div>
</div>
</div>
</div>
</div>

<div> <table class="upload-card w-100" data-category="$row->category" id="file_card_">
<tbody class="uploadedFiles">
</tbody>
</table>
</div></div></div></div></td></tr><tr data-kits-separated='0' class='quoteitemrow2 0 ' style="display:;color:black" ID="2" >
<td style="cursor:move;" class="draggable" draggable=true>
<a onclick="editInvItem(3427);this.form.submit();">127x127POST</a>
<input type=hidden name='inventoryid[]' value='3427'>
<input type=hidden name='rowId[]' value='2'>
<input type=hidden name='sectionName[]' value='ALL'>
<input type=hidden name='parent[]' ID='qParent2' value='0'>
<input type='hidden' ID='itaxName2' name='itaxName[]' value='GST'>
<input type='hidden' ID='itaxValue2' name='itaxValue[]' value='10' autocomplete='off'>
<input type=hidden name='deleteInvItem[]' ID='deleteInvItem2' value='0'>
<textarea style='display:none' name='bom[]' ID='bom2'></textarea>
<input type=hidden name='quoteitemid[]' ID='qItemId2' value='7502'>
<input type=hidden name='extra[]' ID='extra2' value=''>
<input type=hidden name='weight[]' ID='weight2' value='0'>
<input type=hidden id='parentid2' value='0'>
<input type=hidden id='referenceid2' value='7502'>
<input type=hidden id='contractid2' name='contractid[]' value='0'>
<input type=hidden id='contractsiteid2' name='contractsiteid[]' value='0'>
</td>
<td>
<div class='expandingArea'>
<pre><span></span><br></pre>
<textarea class=""
name='itemdescription[]'
id='desc2'
onchange="toggleClass('unsaved','1')" style='color:black;'>Concrete reinforcing - Square Mesh - (S)quare spaced, (L)ow ductility, (8)mm assigned diameter main wire and (1)00mm aperture.</textarea>
</div>
</td>
<td class="costplus currency">
<input type="text" name='itemcost[]' ID='itemcost2' value='210.0000'
class='datainput' data-invcost = '44.9' onchange="updateRow(2, 1, 'itemCost');" autocomplete='off' style='color:black;'>
</td>
<td class="discount currency">
<input type='text' name='itemprice[]' ID='itemprice2' value='262.5000'
class='datainput' onkeydown='' onchange="updateRow(2, 1, 'itemPrice');" autocomplete='off' style='color:black;'>
</td>
<td style="width:100px">
<input type='text' name='itemqty[]' ID='qty2' value='1.00'
style="width:100%; color:black;" class="datainput" onchange="updateRow(2, 1, 'itemQty');" autocomplete='off'>
</td>
<td class="costplus d-none" ID="linecost2" style='color:black;'>
$210.00
</td>
<td >
<input type='text' name='itemdiscount[]' ID='discount2'
value='25' class='datainput' onblur="updateRow(2, 1, 'itemDisc');" style='color:black;'>
</td>
<td class="currency">
<input type='text'
name='adjPrice[]'
ID='adjPrice2'
value='262.5000'
size='4'
class='datainput '
onkeydown=''
onchange="updateRow(2, 1, 'adjPrice');"
autocomplete='off' style='color:black;'>
</td>
<td style="width:100px">
<input type='hidden' ID='itaxAmount2' class='datainput' name='itaxAmount[]' newval='26.2500'
value='26.2500' autocomplete='off'>
<div ID='itaxAmountText2'>26.2500</div>
</td>
<td ID='subTotal2' style="width:100px" data-itemtotal=\'262.5" data-total="262.50">262.50</td>
<td class="pe-2" style="width:90px"><div ID='actionIcon[]' class="actionIcon2 text-end" style="width:auto;float:right;display:inline-block;position:relative"><span class=" float-right material-symbols-rounded pointer" onclick='hideRows(2);' ID='delIcon2' >delete</span>
<span class='float-right' class='morebtn' data-id='7502' href="#" onclick="hideAll();document.getElementById('moreItem2').classList.toggle('popupDivFade'); return false;" style='cursor:pointer;'>
<i class="material-symbols-rounded" dataclass="morebtn" ID="more2" data-quote='2266' data-id='7502' data-cat='24' style="color:">more_vert</i>
</span></div>
<div id="moreItem2" class="popupDiv quoteItemMore">
<div class='popupDivHeader container-fluid'>
<div class='row'>
<div class='col h3'>
ADVANCED 127x127POST
</div>
<div class='col-1'>
<a style='float:right' onclick="hideAll(); quoteAutosave();";>
<i class="material-symbols-rounded">close</i></a>
</div>
</div>
</div>
<div class='navbar-collapse d-flex mt-3' id='navbarNavPopupDiv2'><ul class='navbar-nav' style='flex-direction:row;'><li class='nav-item active'><a class='smpd pointer nav-link' id='smpdpddetails2' onclick="quoteItemTab('2','pddetails');" style='text-decoration:underline;color:var(--main-selected-color);'>Details</a></li><li class='nav-item' style='margin-left:-1px;'><a class='smpd pointer nav-link' id='smpdpdfiles2' onclick="quoteItemTab('2','pdfiles');" style='text-decoration:none;'>Files</a></li></ul></div><div id='pddetails2' class='menupd'><textarea class='form-control' rows="10">Concrete reinforcing - Square Mesh - (S)quare spaced, (L)ow ductility, (8)mm assigned diameter main wire and (1)00mm aperture.</textarea>
<br><br><a style="height:auto;" class="pointer" onmouseup="setCosttoInv('2','44.9')">Inventory Cost: $44.90</a>
<br>Weight: 0 KG<hr>
<div class='form-group'>
<label>Notes:</label>
<textarea name=itemnotes[] class='form-control'></textarea>
</div>
<div class='form-group'>
<label>Tab:</label>
<select name="sectionId[]" class='form-control'>
<option value="0">Unassigned</option><option value="413" >1. FENCE</option><option value="414" >2. INSTALLATION</option><option value="415" >3. GATES</option> </select>
</div>
<div class='form-group'>
<label>Supplier Code:</label>
<select name="supplier[]" ID="supplier2" class='form-control'>
<option value="0">N/A</option> </select>
</div>
<font style="color:red" ID="warning2"></font><div class="col for_review">
<label><input type="checkbox" class="for_review_checkbox" style="float: left;" data-quoteitemid="7502" /><input type="hidden" name="for_review[]" value="0" /><span style="display:inline-block;margin-left:5px;"> Mark this item for review </span></label>
</div><br>
<span class='pointer'
onclick="getUOM('3427','2');">
Manage Unit of Measure
<i class="material-symbols-rounded" >ad_units</i>
</span><div class="custom-fields custom-field7502"></div></div><div id='pdfiles2' class='menupd' style='display:none;'><div class='sidebar-attachedment-container'>
<div class="h4 mb-3 mt-3 text-start">File Upload
<div id="sidebarDropboxBtnContainer" class="d-inline"><!--Do not delete this part, this is for dropbox button--></div>
<div id="mfilesBtnContainer" class="d-inline"><!--Do not delete this part, this is for mfiles button--></div>
</div>
<div class="row">
<div class="col">
<div data-action="uploadsave.php"
data-cat="Select"
data-sourceid="7502"
data-sourcemodule="6"
data-subtype="quoteitem"
data-quote="2266"
class="sdropzone border border-2 p-3 mb-2 dropzone_quoteitem"
id="quoteitem_dropzone_2" >
<!--
<input type='hidden' name='category' value="Select">
<input type='hidden' name='sourceid' id="sourceid" value="">
<input type='hidden' name='sourcemodule' value="">
<input type='hidden' name='subtype' value="">
-->
<div class="mb-1">
<div class="dz-message" data-dz-message>
<div class="h5">Drag and Drop to upload files or click here</div>
<p>Files uploaded here will not be placed in a category. To upload files into specific categories use the "+" icon above</p>
</div>
</div>
</div>
</div>
</div>

<div> <table class="upload-card w-100" data-category="$row->category" id="file_card_">
<tbody class="uploadedFiles">
</tbody>
</table>
</div></div></div></div></td></tr><tr data-kits-separated='0' class='quoteitemrow3 0 deleted ' style="display:none;color:red" ID="3" >
<td style="cursor:move;" class="draggable" draggable=true>
<a onclick="editInvItem(2888);this.form.submit();"> REO/SL81</a>
<input type=hidden name='inventoryid[]' value='2888'>
<input type=hidden name='rowId[]' value='3'>
<input type=hidden name='sectionName[]' value='ALL'>
<input type=hidden name='parent[]' ID='qParent3' value='0'>
<input type='hidden' ID='itaxName3' name='itaxName[]' value='GST'>
<input type='hidden' ID='itaxValue3' name='itaxValue[]' value='10' autocomplete='off'>
<input type=hidden name='deleteInvItem[]' ID='deleteInvItem3' value='1'>
<textarea style='display:none' name='bom[]' ID='bom3'></textarea>
<input type=hidden name='quoteitemid[]' ID='qItemId3' value='7503'>
<input type=hidden name='extra[]' ID='extra3' value=''>
<input type=hidden name='weight[]' ID='weight3' value='0'>
<input type=hidden id='parentid3' value='0'>
<input type=hidden id='referenceid3' value='7503'>
<input type=hidden id='contractid3' name='contractid[]' value='0'>
<input type=hidden id='contractsiteid3' name='contractsiteid[]' value='0'>
</td>
<td>
<div class='expandingArea'>
<pre><span></span><br></pre>
<textarea class=""
name='itemdescription[]'
id='desc3'
onchange="toggleClass('unsaved','1')" style='color:red;'>Concrete reinforcing - Square Mesh - (S)quare spaced, (L)ow ductility, (8)mm assigned diameter main wire and (1)00mm aperture.</textarea>
</div>
</td>
<td class="costplus currency">
<input type="text" name='itemcost[]' ID='itemcost3' value='210.0000'
class='datainput' data-invcost = '210' onchange="updateRow(3, 1, 'itemCost');" autocomplete='off' style='color:red;'>
</td>
<td class="discount currency">
<input type='text' name='itemprice[]' ID='itemprice3' value='262.5000'
class='datainput' onkeydown='' onchange="updateRow(3, 1, 'itemPrice');" autocomplete='off' style='color:red;'>
</td>
<td style="width:100px">
<input type='text' name='itemqty[]' ID='qty3' value='1.00'
style="width:100%; color:red;" class="datainput" onchange="updateRow(3, 1, 'itemQty');" autocomplete='off'>
</td>
<td class="costplus d-none" ID="linecost3" style='color:red;'>
$210.00
</td>
<td >
<input type='text' name='itemdiscount[]' ID='discount3'
value='25' class='datainput' onblur="updateRow(3, 1, 'itemDisc');" style='color:red;'>
</td>
<td class="currency">
<input type='text'
name='adjPrice[]'
ID='adjPrice3'
value='262.5000'
size='4'
class='datainput '
onkeydown=''
onchange="updateRow(3, 1, 'adjPrice');"
autocomplete='off' style='color:red;'>
</td>
<td style="width:100px">
<input type='hidden' ID='itaxAmount3' class='datainput' name='itaxAmount[]' newval='26.2500'
value='26.2500' autocomplete='off'>
<div ID='itaxAmountText3'>26.2500</div>
</td>
<td ID='subTotal3' style="width:100px" data-itemtotal=\'262.5" data-total="262.50">262.50</td>
<td class="pe-2" style="width:90px"><div ID='actionIcon[]' class="actionIcon3 text-end" style="width:auto;float:right;display:inline-block;position:relative"><span class=" float-right material-symbols-rounded pointer" onclick='hideRows(3);' ID='delIcon3' >undo</span>
<span class='float-right' class='morebtn' data-id='7503' href="#" onclick="hideAll();document.getElementById('moreItem3').classList.toggle('popupDivFade'); return false;" style='cursor:pointer;'>
<i class="material-symbols-rounded" dataclass="morebtn" ID="more3" data-quote='2266' data-id='7503' data-cat='34' style="color:">more_vert</i>
</span></div>
<div id="moreItem3" class="popupDiv quoteItemMore">
<div class='popupDivHeader container-fluid'>
<div class='row'>
<div class='col h3'>
ADVANCED REO/SL81
</div>
<div class='col-1'>
<a style='float:right' onclick="hideAll(); quoteAutosave();";>
<i class="material-symbols-rounded">close</i></a>
</div>
</div>
</div>
<div class='navbar-collapse d-flex mt-3' id='navbarNavPopupDiv3'><ul class='navbar-nav' style='flex-direction:row;'><li class='nav-item active'><a class='smpd pointer nav-link' id='smpdpddetails3' onclick="quoteItemTab('3','pddetails');" style='text-decoration:underline;color:var(--main-selected-color);'>Details</a></li><li class='nav-item' style='margin-left:-1px;'><a class='smpd pointer nav-link' id='smpdpdfiles3' onclick="quoteItemTab('3','pdfiles');" style='text-decoration:none;'>Files</a></li></ul></div><div id='pddetails3' class='menupd'><textarea class='form-control' rows="10">Concrete reinforcing - Square Mesh - (S)quare spaced, (L)ow ductility, (8)mm assigned diameter main wire and (1)00mm aperture.</textarea>
<br><br><a style="height:auto;" class="pointer" onmouseup="setCosttoInv('3','210')">Inventory Cost: $210.00</a>
<br>Weight: 0 KG<hr>
<div class='form-group'>
<label>Notes:</label>
<textarea name=itemnotes[] class='form-control'></textarea>
</div>
<div class='form-group'>
<label>Tab:</label>
<select name="sectionId[]" class='form-control'>
<option value="0">Unassigned</option><option value="413" >1. FENCE</option><option value="414" >2. INSTALLATION</option><option value="415" >3. GATES</option> </select>
</div>
<div class='form-group'>
<label>Supplier Code:</label>
<select name="supplier[]" ID="supplier3" class='form-control'>
<option value="0">N/A</option> </select>
</div>
<font style="color:red" ID="warning3"></font><div class="col for_review">
<label><input type="checkbox" class="for_review_checkbox" style="float: left;" data-quoteitemid="7503" /><input type="hidden" name="for_review[]" value="0" /><span style="display:inline-block;margin-left:5px;"> Mark this item for review </span></label>
</div><br>
<span class='pointer'
onclick="getUOM('2888','3');">
Manage Unit of Measure
<i class="material-symbols-rounded" >ad_units</i>
</span><div class="custom-fields custom-field7503"></div></div><div id='pdfiles3' class='menupd' style='display:none;'><div class='sidebar-attachedment-container'>
<div class="h4 mb-3 mt-3 text-start">File Upload
<div id="sidebarDropboxBtnContainer" class="d-inline"><!--Do not delete this part, this is for dropbox button--></div>
<div id="mfilesBtnContainer" class="d-inline"><!--Do not delete this part, this is for mfiles button--></div>
</div>
<div class="row">
<div class="col">
<div data-action="uploadsave.php"
data-cat="Select"
data-sourceid="7503"
data-sourcemodule="6"
data-subtype="quoteitem"
data-quote="2266"
class="sdropzone border border-2 p-3 mb-2 dropzone_quoteitem"
id="quoteitem_dropzone_3" >
<!--
<input type='hidden' name='category' value="Select">
<input type='hidden' name='sourceid' id="sourceid" value="">
<input type='hidden' name='sourcemodule' value="">
<input type='hidden' name='subtype' value="">
-->
<div class="mb-1">
<div class="dz-message" data-dz-message>
<div class="h5">Drag and Drop to upload files or click here</div>
<p>Files uploaded here will not be placed in a category. To upload files into specific categories use the "+" icon above</p>
</div>
</div>
</div>
</div>
</div>

<div> <table class="upload-card w-100" data-category="$row->category" id="file_card_">
<tbody class="uploadedFiles">
</tbody>
</table>
</div></div></div></div></td></tr><tr data-kits-separated='0' class='quoteitemrow4 0 deleted ' style="display:none;color:red" ID="4" >
<td style="cursor:move;" class="draggable" draggable=true>
<a onclick="editInvItem(2888);this.form.submit();"> REO/SL81</a>
<input type=hidden name='inventoryid[]' value='2888'>
<input type=hidden name='rowId[]' value='4'>
<input type=hidden name='sectionName[]' value='ALL'>
<input type=hidden name='parent[]' ID='qParent4' value='0'>
<input type='hidden' ID='itaxName4' name='itaxName[]' value='GST'>
<input type='hidden' ID='itaxValue4' name='itaxValue[]' value='10' autocomplete='off'>
<input type=hidden name='deleteInvItem[]' ID='deleteInvItem4' value='1'>
<textarea style='display:none' name='bom[]' ID='bom4'></textarea>
<input type=hidden name='quoteitemid[]' ID='qItemId4' value='7504'>
<input type=hidden name='extra[]' ID='extra4' value=''>
<input type=hidden name='weight[]' ID='weight4' value='0'>
<input type=hidden id='parentid4' value='0'>
<input type=hidden id='referenceid4' value='7504'>
<input type=hidden id='contractid4' name='contractid[]' value='0'>
<input type=hidden id='contractsiteid4' name='contractsiteid[]' value='0'>
</td>
<td>
<div class='expandingArea'>
<pre><span></span><br></pre>
<textarea class=""
name='itemdescription[]'
id='desc4'
onchange="toggleClass('unsaved','1')" style='color:red;'>Concrete reinforcing - Square Mesh - (S)quare spaced, (L)ow ductility, (8)mm assigned diameter main wire and (1)00mm aperture.</textarea>
</div>
</td>
<td class="costplus currency">
<input type="text" name='itemcost[]' ID='itemcost4' value='210.0000'
class='datainput' data-invcost = '210' onchange="updateRow(4, 1, 'itemCost');" autocomplete='off' style='color:red;'>
</td>
<td class="discount currency">
<input type='text' name='itemprice[]' ID='itemprice4' value='262.5000'
class='datainput' onkeydown='' onchange="updateRow(4, 1, 'itemPrice');" autocomplete='off' style='color:red;'>
</td>
<td style="width:100px">
<input type='text' name='itemqty[]' ID='qty4' value='1.00'
style="width:100%; color:red;" class="datainput" onchange="updateRow(4, 1, 'itemQty');" autocomplete='off'>
</td>
<td class="costplus d-none" ID="linecost4" style='color:red;'>
$210.00
</td>
<td >
<input type='text' name='itemdiscount[]' ID='discount4'
value='25' class='datainput' onblur="updateRow(4, 1, 'itemDisc');" style='color:red;'>
</td>
<td class="currency">
<input type='text'
name='adjPrice[]'
ID='adjPrice4'
value='262.5000'
size='4'
class='datainput '
onkeydown=''
onchange="updateRow(4, 1, 'adjPrice');"
autocomplete='off' style='color:red;'>
</td>
<td style="width:100px">
<input type='hidden' ID='itaxAmount4' class='datainput' name='itaxAmount[]' newval='26.2500'
value='26.2500' autocomplete='off'>
<div ID='itaxAmountText4'>26.2500</div>
</td>
<td ID='subTotal4' style="width:100px" data-itemtotal=\'262.5" data-total="262.50">262.50</td>
<td class="pe-2" style="width:90px"><div ID='actionIcon[]' class="actionIcon4 text-end" style="width:auto;float:right;display:inline-block;position:relative"><span class=" float-right material-symbols-rounded pointer" onclick='hideRows(4);' ID='delIcon4' >undo</span>
<span class='float-right' class='morebtn' data-id='7504' href="#" onclick="hideAll();document.getElementById('moreItem4').classList.toggle('popupDivFade'); return false;" style='cursor:pointer;'>
<i class="material-symbols-rounded" dataclass="morebtn" ID="more4" data-quote='2266' data-id='7504' data-cat='34' style="color:">more_vert</i>
</span></div>
<div id="moreItem4" class="popupDiv quoteItemMore">
<div class='popupDivHeader container-fluid'>
<div class='row'>
<div class='col h3'>
ADVANCED REO/SL81
</div>
<div class='col-1'>
<a style='float:right' onclick="hideAll(); quoteAutosave();";>
<i class="material-symbols-rounded">close</i></a>
</div>
</div>
</div>
<div class='navbar-collapse d-flex mt-3' id='navbarNavPopupDiv4'><ul class='navbar-nav' style='flex-direction:row;'><li class='nav-item active'><a class='smpd pointer nav-link' id='smpdpddetails4' onclick="quoteItemTab('4','pddetails');" style='text-decoration:underline;color:var(--main-selected-color);'>Details</a></li><li class='nav-item' style='margin-left:-1px;'><a class='smpd pointer nav-link' id='smpdpdfiles4' onclick="quoteItemTab('4','pdfiles');" style='text-decoration:none;'>Files</a></li></ul></div><div id='pddetails4' class='menupd'><textarea class='form-control' rows="10">Concrete reinforcing - Square Mesh - (S)quare spaced, (L)ow ductility, (8)mm assigned diameter main wire and (1)00mm aperture.</textarea>
<br><br><a style="height:auto;" class="pointer" onmouseup="setCosttoInv('4','210')">Inventory Cost: $210.00</a>
<br>Weight: 0 KG<hr>
<div class='form-group'>
<label>Notes:</label>
<textarea name=itemnotes[] class='form-control'></textarea>
</div>
<div class='form-group'>
<label>Tab:</label>
<select name="sectionId[]" class='form-control'>
<option value="0">Unassigned</option><option value="413" >1. FENCE</option><option value="414" >2. INSTALLATION</option><option value="415" >3. GATES</option> </select>
</div>
<div class='form-group'>
<label>Supplier Code:</label>
<select name="supplier[]" ID="supplier4" class='form-control'>
<option value="0">N/A</option> </select>
</div>
<font style="color:red" ID="warning4"></font><div class="col for_review">
<label><input type="checkbox" class="for_review_checkbox" style="float: left;" data-quoteitemid="7504" /><input type="hidden" name="for_review[]" value="0" /><span style="display:inline-block;margin-left:5px;"> Mark this item for review </span></label>
</div><br>
<span class='pointer'
onclick="getUOM('2888','4');">
Manage Unit of Measure
<i class="material-symbols-rounded" >ad_units</i>
</span><div class="custom-fields custom-field7504"></div></div><div id='pdfiles4' class='menupd' style='display:none;'><div class='sidebar-attachedment-container'>
<div class="h4 mb-3 mt-3 text-start">File Upload
<div id="sidebarDropboxBtnContainer" class="d-inline"><!--Do not delete this part, this is for dropbox button--></div>
<div id="mfilesBtnContainer" class="d-inline"><!--Do not delete this part, this is for mfiles button--></div>
</div>
<div class="row">
<div class="col">
<div data-action="uploadsave.php"
data-cat="Select"
data-sourceid="7504"
data-sourcemodule="6"
data-subtype="quoteitem"
data-quote="2266"
class="sdropzone border border-2 p-3 mb-2 dropzone_quoteitem"
id="quoteitem_dropzone_4" >
<!--
<input type='hidden' name='category' value="Select">
<input type='hidden' name='sourceid' id="sourceid" value="">
<input type='hidden' name='sourcemodule' value="">
<input type='hidden' name='subtype' value="">
-->
<div class="mb-1">
<div class="dz-message" data-dz-message>
<div class="h5">Drag and Drop to upload files or click here</div>
<p>Files uploaded here will not be placed in a category. To upload files into specific categories use the "+" icon above</p>
</div>
</div>
</div>
</div>
</div>

<div> <table class="upload-card w-100" data-category="$row->category" id="file_card_">
<tbody class="uploadedFiles">
</tbody>
</table>
</div></div></div></div></td></tr><tr data-kits-separated='0' class='quoteitemrow5 413 Quotation_Inclusion ' style="display:;color:black" ID="5" >
<td style="cursor:move;" class="draggable" draggable=true>
<a onclick="editInvItem(2541);this.form.submit();">SAWSPEARPANELPKT</a>
<input type=hidden name='inventoryid[]' value='2541'>
<input type=hidden name='rowId[]' value='5'>
<input type=hidden name='sectionName[]' value='1. FENCE'>
<input type=hidden name='parent[]' ID='qParent5' value='0'>
<input type='hidden' ID='itaxName5' name='itaxName[]' value='GST'>
<input type='hidden' ID='itaxValue5' name='itaxValue[]' value='10' autocomplete='off'>
<input type=hidden name='deleteInvItem[]' ID='deleteInvItem5' value='0'>
<textarea style='display:none' name='bom[]' ID='bom5'></textarea>
<input type=hidden name='quoteitemid[]' ID='qItemId5' value='7481'>
<input type=hidden name='extra[]' ID='extra5' value=''>
<input type=hidden name='weight[]' ID='weight5' value='0'>
<input type=hidden id='parentid5' value='0'>
<input type=hidden id='referenceid5' value='7481'>
<input type=hidden id='contractid5' name='contractid[]' value='0'>
<input type=hidden id='contractsiteid5' name='contractsiteid[]' value='0'>
</td>
<td>
<div class='expandingArea'>
<pre><span></span><br></pre>
<textarea class=""
name='itemdescription[]'
id='desc5'
onchange="toggleClass('unsaved','1')" style='color:black;'>SA Water Spear Top - 2400hx2000w - Panel with brackets and fixings</textarea>
</div>
</td>
<td class="costplus currency">
<input type="text" name='itemcost[]' ID='itemcost5' value='497.2700'
class='datainput' data-invcost = '497.27' onchange="updateRow(5, 1, 'itemCost');" autocomplete='off' style='color:black;'>
</td>
<td class="discount currency">
<input type='text' name='itemprice[]' ID='itemprice5' value='621.5900'
class='datainput' onkeydown='' onchange="updateRow(5, 1, 'itemPrice');" autocomplete='off' style='color:black;'>
</td>
<td style="width:100px">
<input type='text' name='itemqty[]' ID='qty5' value='35.00'
style="width:100%; color:black;" class="datainput" onchange="updateRow(5, 1, 'itemQty');" autocomplete='off'>
</td>
<td class="costplus d-none" ID="linecost5" style='color:black;'>
$17,404.45
</td>
<td >
<input type='text' name='itemdiscount[]' ID='discount5'
value='33' class='datainput' onblur="updateRow(5, 1, 'itemDisc');" style='color:black;'>
</td>
<td class="currency">
<input type='text'
name='adjPrice[]'
ID='adjPrice5'
value='661.3691'
size='4'
class='datainput Quotation_Inclusion'
onkeydown=''
onchange="updateRow(5, 1, 'adjPrice');"
autocomplete='off' style='color:black;'>
</td>
<td style="width:100px">
<input type='hidden' ID='itaxAmount5' class='datainput' name='itaxAmount[]' newval='66.1369'
value='66.1369' autocomplete='off'>
<div ID='itaxAmountText5'>2,314.7915</div>
</td>
<td ID='subTotal5' style="width:100px" data-itemtotal=\'661.37" data-total="23147.92">23147.92</td>
<td class="pe-2" style="width:90px"><div ID='actionIcon[]' class="actionIcon5 text-end" style="width:auto;float:right;display:inline-block;position:relative"><span class=" float-right material-symbols-rounded pointer" onclick='hideRows(5);' ID='delIcon5' >delete</span>
<span class='float-right' class='morebtn' data-id='7481' href="#" onclick="hideAll();document.getElementById('moreItem5').classList.toggle('popupDivFade'); return false;" style='cursor:pointer;'>
<i class="material-symbols-rounded" dataclass="morebtn" ID="more5" data-quote='2266' data-id='7481' data-cat='27' style="color:">more_vert</i>
</span></div>
<div id="moreItem5" class="popupDiv quoteItemMore">
<div class='popupDivHeader container-fluid'>
<div class='row'>
<div class='col h3'>
ADVANCED SAWSPEARPANELPKT
</div>
<div class='col-1'>
<a style='float:right' onclick="hideAll(); quoteAutosave();";>
<i class="material-symbols-rounded">close</i></a>
</div>
</div>
</div>
<div class='navbar-collapse d-flex mt-3' id='navbarNavPopupDiv5'><ul class='navbar-nav' style='flex-direction:row;'><li class='nav-item active'><a class='smpd pointer nav-link' id='smpdpddetails5' onclick="quoteItemTab('5','pddetails');" style='text-decoration:underline;color:var(--main-selected-color);'>Details</a></li><li class='nav-item' style='margin-left:-1px;'><a class='smpd pointer nav-link' id='smpdpdfiles5' onclick="quoteItemTab('5','pdfiles');" style='text-decoration:none;'>Files</a></li></ul></div><div id='pddetails5' class='menupd'><textarea class='form-control' rows="10">SA Water Spear Top - 2400hx2000w - Panel with brackets and fixings</textarea>
<br><br><a style="height:auto;" class="pointer" onmouseup="setCosttoInv('5','497.27')">Inventory Cost: $497.27</a>
<br>Weight: 0 KG<hr>
<div class='form-group'>
<label>Notes:</label>
<textarea name=itemnotes[] class='form-control'></textarea>
</div>
<div class='form-group'>
<label>Tab:</label>
<select name="sectionId[]" class='form-control'>
<option value="0">Unassigned</option><option value="413" selected>1. FENCE</option><option value="414" >2. INSTALLATION</option><option value="415" >3. GATES</option> </select>
</div>
<div class='form-group'>
<label>Supplier Code:</label>
<select name="supplier[]" ID="supplier5" class='form-control'>
<option value="0">N/A</option> </select>
</div>
<font style="color:red" ID="warning5"></font><div class="col for_review">
<label><input type="checkbox" class="for_review_checkbox" style="float: left;" data-quoteitemid="7481" /><input type="hidden" name="for_review[]" value="0" /><span style="display:inline-block;margin-left:5px;"> Mark this item for review </span></label>
</div><br>
<span class='pointer'
onclick="getUOM('2541','5');">
Manage Unit of Measure
<i class="material-symbols-rounded" >ad_units</i>
</span><div class="custom-fields custom-field7481"></div></div><div id='pdfiles5' class='menupd' style='display:none;'><div class='sidebar-attachedment-container'>
<div class="h4 mb-3 mt-3 text-start">File Upload
<div id="sidebarDropboxBtnContainer" class="d-inline"><!--Do not delete this part, this is for dropbox button--></div>
<div id="mfilesBtnContainer" class="d-inline"><!--Do not delete this part, this is for mfiles button--></div>
</div>
<div class="row">
<div class="col">
<div data-action="uploadsave.php"
data-cat="Select"
data-sourceid="7481"
data-sourcemodule="6"
data-subtype="quoteitem"
data-quote="2266"
class="sdropzone border border-2 p-3 mb-2 dropzone_quoteitem"
id="quoteitem_dropzone_5" >
<!--
<input type='hidden' name='category' value="Select">
<input type='hidden' name='sourceid' id="sourceid" value="">
<input type='hidden' name='sourcemodule' value="">
<input type='hidden' name='subtype' value="">
-->
<div class="mb-1">
<div class="dz-message" data-dz-message>
<div class="h5">Drag and Drop to upload files or click here</div>
<p>Files uploaded here will not be placed in a category. To upload files into specific categories use the "+" icon above</p>
</div>
</div>
</div>
</div>
</div>

<div> <table class="upload-card w-100" data-category="$row->category" id="file_card_">
<tbody class="uploadedFiles">
</tbody>
</table>
</div></div></div></div></td></tr><tr data-kits-separated='0' class='quoteitemrow6 413 Quotation_Inclusion ' style="display:;color:black" ID="6" >
<td style="cursor:move;" class="draggable" draggable=true>
<a onclick="editInvItem(2492);this.form.submit();">SAWSPEARPOST75</a>
<input type=hidden name='inventoryid[]' value='2492'>
<input type=hidden name='rowId[]' value='6'>
<input type=hidden name='sectionName[]' value='1. FENCE'>
<input type=hidden name='parent[]' ID='qParent6' value='0'>
<input type='hidden' ID='itaxName6' name='itaxName[]' value='GST'>
<input type='hidden' ID='itaxValue6' name='itaxValue[]' value='10' autocomplete='off'>
<input type=hidden name='deleteInvItem[]' ID='deleteInvItem6' value='0'>
<textarea style='display:none' name='bom[]' ID='bom6'></textarea>
<input type=hidden name='quoteitemid[]' ID='qItemId6' value='7482'>
<input type=hidden name='extra[]' ID='extra6' value=''>
<input type=hidden name='weight[]' ID='weight6' value='0'>
<input type=hidden id='parentid6' value='0'>
<input type=hidden id='referenceid6' value='7482'>
<input type=hidden id='contractid6' name='contractid[]' value='0'>
<input type=hidden id='contractsiteid6' name='contractsiteid[]' value='0'>
</td>
<td>
<div class='expandingArea'>
<pre><span></span><br></pre>
<textarea class=""
name='itemdescription[]'
id='desc6'
onchange="toggleClass('unsaved','1')" style='color:black;'>SA Water Spear Top - Post - 75mmx3200mm</textarea>
</div>
</td>
<td class="costplus currency">
<input type="text" name='itemcost[]' ID='itemcost6' value='95.2960'
class='datainput' data-invcost = '95.296' onchange="updateRow(6, 1, 'itemCost');" autocomplete='off' style='color:black;'>
</td>
<td class="discount currency">
<input type='text' name='itemprice[]' ID='itemprice6' value='119.3600'
class='datainput' onkeydown='' onchange="updateRow(6, 1, 'itemPrice');" autocomplete='off' style='color:black;'>
</td>
<td style="width:100px">
<input type='text' name='itemqty[]' ID='qty6' value='36.00'
style="width:100%; color:black;" class="datainput" onchange="updateRow(6, 1, 'itemQty');" autocomplete='off'>
</td>
<td class="costplus d-none" ID="linecost6" style='color:black;'>
$3,430.66
</td>
<td >
<input type='text' name='itemdiscount[]' ID='discount6'
value='33' class='datainput' onblur="updateRow(6, 1, 'itemDisc');" style='color:black;'>
</td>
<td class="currency">
<input type='text'
name='adjPrice[]'
ID='adjPrice6'
value='126.7437'
size='4'
class='datainput Quotation_Inclusion'
onkeydown=''
onchange="updateRow(6, 1, 'adjPrice');"
autocomplete='off' style='color:black;'>
</td>
<td style="width:100px">
<input type='hidden' ID='itaxAmount6' class='datainput' name='itaxAmount[]' newval='12.6744'
value='12.6744' autocomplete='off'>
<div ID='itaxAmountText6'>456.2784</div>
</td>
<td ID='subTotal6' style="width:100px" data-itemtotal=\'126.74" data-total="4562.77">4562.77</td>
<td class="pe-2" style="width:90px"><div ID='actionIcon[]' class="actionIcon6 text-end" style="width:auto;float:right;display:inline-block;position:relative"><span class=" float-right material-symbols-rounded pointer" onclick='hideRows(6);' ID='delIcon6' >delete</span>
<span class='float-right' class='morebtn' data-id='7482' href="#" onclick="hideAll();document.getElementById('moreItem6').classList.toggle('popupDivFade'); return false;" style='cursor:pointer;'>
<i class="material-symbols-rounded" dataclass="morebtn" ID="more6" data-quote='2266' data-id='7482' data-cat='27' style="color:">more_vert</i>
</span></div>
<div id="moreItem6" class="popupDiv quoteItemMore">
<div class='popupDivHeader container-fluid'>
<div class='row'>
<div class='col h3'>
ADVANCED SAWSPEARPOST75
</div>
<div class='col-1'>
<a style='float:right' onclick="hideAll(); quoteAutosave();";>
<i class="material-symbols-rounded">close</i></a>
</div>
</div>
</div>
<div class='navbar-collapse d-flex mt-3' id='navbarNavPopupDiv6'><ul class='navbar-nav' style='flex-direction:row;'><li class='nav-item active'><a class='smpd pointer nav-link' id='smpdpddetails6' onclick="quoteItemTab('6','pddetails');" style='text-decoration:underline;color:var(--main-selected-color);'>Details</a></li><li class='nav-item' style='margin-left:-1px;'><a class='smpd pointer nav-link' id='smpdpdfiles6' onclick="quoteItemTab('6','pdfiles');" style='text-decoration:none;'>Files</a></li></ul></div><div id='pddetails6' class='menupd'><textarea class='form-control' rows="10">SA Water Spear Top - Post - 75mmx3200mm</textarea>
<br><br><a style="height:auto;" class="pointer" onmouseup="setCosttoInv('6','95.296')">Inventory Cost: $95.30</a>
<br>Weight: 0 KG<hr>
<div class='form-group'>
<label>Notes:</label>
<textarea name=itemnotes[] class='form-control'></textarea>
</div>
<div class='form-group'>
<label>Tab:</label>
<select name="sectionId[]" class='form-control'>
<option value="0">Unassigned</option><option value="413" selected>1. FENCE</option><option value="414" >2. INSTALLATION</option><option value="415" >3. GATES</option> </select>
</div>
<div class='form-group'>
<label>Supplier Code:</label>
<select name="supplier[]" ID="supplier6" class='form-control'>
<option value="0">N/A</option> </select>
</div>
<font style="color:red" ID="warning6"></font><div class="col for_review">
<label><input type="checkbox" class="for_review_checkbox" style="float: left;" data-quoteitemid="7482" /><input type="hidden" name="for_review[]" value="0" /><span style="display:inline-block;margin-left:5px;"> Mark this item for review </span></label>
</div><br>
<span class='pointer'
onclick="getUOM('2492','6');">
Manage Unit of Measure
<i class="material-symbols-rounded" >ad_units</i>
</span><div class="custom-fields custom-field7482"></div></div><div id='pdfiles6' class='menupd' style='display:none;'><div class='sidebar-attachedment-container'>
<div class="h4 mb-3 mt-3 text-start">File Upload
<div id="sidebarDropboxBtnContainer" class="d-inline"><!--Do not delete this part, this is for dropbox button--></div>
<div id="mfilesBtnContainer" class="d-inline"><!--Do not delete this part, this is for mfiles button--></div>
</div>
<div class="row">
<div class="col">
<div data-action="uploadsave.php"
data-cat="Select"
data-sourceid="7482"
data-sourcemodule="6"
data-subtype="quoteitem"
data-quote="2266"
class="sdropzone border border-2 p-3 mb-2 dropzone_quoteitem"
id="quoteitem_dropzone_6" >
<!--
<input type='hidden' name='category' value="Select">
<input type='hidden' name='sourceid' id="sourceid" value="">
<input type='hidden' name='sourcemodule' value="">
<input type='hidden' name='subtype' value="">
-->
<div class="mb-1">
<div class="dz-message" data-dz-message>
<div class="h5">Drag and Drop to upload files or click here</div>
<p>Files uploaded here will not be placed in a category. To upload files into specific categories use the "+" icon above</p>
</div>
</div>
</div>
</div>
</div>

<div> <table class="upload-card w-100" data-category="$row->category" id="file_card_">
<tbody class="uploadedFiles">
</tbody>
</table>
</div></div></div></div></td></tr><tr data-kits-separated='0' class='quoteitemrow7 413 Quotation_Inclusion ' style="display:;color:black" ID="7" >
<td style="cursor:move;" class="draggable" draggable=true>
<a onclick="editInvItem(2493);this.form.submit();">SAWSPEARPOST100</a>
<input type=hidden name='inventoryid[]' value='2493'>
<input type=hidden name='rowId[]' value='7'>
<input type=hidden name='sectionName[]' value='1. FENCE'>
<input type=hidden name='parent[]' ID='qParent7' value='0'>
<input type='hidden' ID='itaxName7' name='itaxName[]' value='GST'>
<input type='hidden' ID='itaxValue7' name='itaxValue[]' value='10' autocomplete='off'>
<input type=hidden name='deleteInvItem[]' ID='deleteInvItem7' value='0'>
<textarea style='display:none' name='bom[]' ID='bom7'></textarea>
<input type=hidden name='quoteitemid[]' ID='qItemId7' value='7484'>
<input type=hidden name='extra[]' ID='extra7' value=''>
<input type=hidden name='weight[]' ID='weight7' value='0'>
<input type=hidden id='parentid7' value='0'>
<input type=hidden id='referenceid7' value='7484'>
<input type=hidden id='contractid7' name='contractid[]' value='0'>
<input type=hidden id='contractsiteid7' name='contractsiteid[]' value='0'>
</td>
<td>
<div class='expandingArea'>
<pre><span></span><br></pre>
<textarea class=""
name='itemdescription[]'
id='desc7'
onchange="toggleClass('unsaved','1')" style='color:black;'>SA Water Spear Top - Post - 100mmx3600mm</textarea>
</div>
</td>
<td class="costplus currency">
<input type="text" name='itemcost[]' ID='itemcost7' value='180.1100'
class='datainput' data-invcost = '180.11' onchange="updateRow(7, 1, 'itemCost');" autocomplete='off' style='color:black;'>
</td>
<td class="discount currency">
<input type='text' name='itemprice[]' ID='itemprice7' value='225.1400'
class='datainput' onkeydown='' onchange="updateRow(7, 1, 'itemPrice');" autocomplete='off' style='color:black;'>
</td>
<td style="width:100px">
<input type='text' name='itemqty[]' ID='qty7' value='7.00'
style="width:100%; color:black;" class="datainput" onchange="updateRow(7, 1, 'itemQty');" autocomplete='off'>
</td>
<td class="costplus d-none" ID="linecost7" style='color:black;'>
$1,260.77
</td>
<td >
<input type='text' name='itemdiscount[]' ID='discount7'
value='33' class='datainput' onblur="updateRow(7, 1, 'itemDisc');" style='color:black;'>
</td>
<td class="currency">
<input type='text'
name='adjPrice[]'
ID='adjPrice7'
value='239.5463'
size='4'
class='datainput Quotation_Inclusion'
onkeydown=''
onchange="updateRow(7, 1, 'adjPrice');"
autocomplete='off' style='color:black;'>
</td>
<td style="width:100px">
<input type='hidden' ID='itaxAmount7' class='datainput' name='itaxAmount[]' newval='23.9546'
value='23.9546' autocomplete='off'>
<div ID='itaxAmountText7'>167.6822</div>
</td>
<td ID='subTotal7' style="width:100px" data-itemtotal=\'239.55" data-total="1676.82">1676.82</td>
<td class="pe-2" style="width:90px"><div ID='actionIcon[]' class="actionIcon7 text-end" style="width:auto;float:right;display:inline-block;position:relative"><span class=" float-right material-symbols-rounded pointer" onclick='hideRows(7);' ID='delIcon7' >delete</span>
<span class='float-right' class='morebtn' data-id='7484' href="#" onclick="hideAll();document.getElementById('moreItem7').classList.toggle('popupDivFade'); return false;" style='cursor:pointer;'>
<i class="material-symbols-rounded" dataclass="morebtn" ID="more7" data-quote='2266' data-id='7484' data-cat='27' style="color:">more_vert</i>
</span></div>
<div id="moreItem7" class="popupDiv quoteItemMore">
<div class='popupDivHeader container-fluid'>
<div class='row'>
<div class='col h3'>
ADVANCED SAWSPEARPOST100
</div>
<div class='col-1'>
<a style='float:right' onclick="hideAll(); quoteAutosave();";>
<i class="material-symbols-rounded">close</i></a>
</div>
</div>
</div>
<div class='navbar-collapse d-flex mt-3' id='navbarNavPopupDiv7'><ul class='navbar-nav' style='flex-direction:row;'><li class='nav-item active'><a class='smpd pointer nav-link' id='smpdpddetails7' onclick="quoteItemTab('7','pddetails');" style='text-decoration:underline;color:var(--main-selected-color);'>Details</a></li><li class='nav-item' style='margin-left:-1px;'><a class='smpd pointer nav-link' id='smpdpdfiles7' onclick="quoteItemTab('7','pdfiles');" style='text-decoration:none;'>Files</a></li></ul></div><div id='pddetails7' class='menupd'><textarea class='form-control' rows="10">SA Water Spear Top - Post - 100mmx3600mm</textarea>
<br><br><a style="height:auto;" class="pointer" onmouseup="setCosttoInv('7','180.11')">Inventory Cost: $180.11</a>
<br>Weight: 0 KG<hr>
<div class='form-group'>
<label>Notes:</label>
<textarea name=itemnotes[] class='form-control'></textarea>
</div>
<div class='form-group'>
<label>Tab:</label>
<select name="sectionId[]" class='form-control'>
<option value="0">Unassigned</option><option value="413" selected>1. FENCE</option><option value="414" >2. INSTALLATION</option><option value="415" >3. GATES</option> </select>
</div>
<div class='form-group'>
<label>Supplier Code:</label>
<select name="supplier[]" ID="supplier7" class='form-control'>
<option value="0">N/A</option> </select>
</div>
<font style="color:red" ID="warning7"></font><div class="col for_review">
<label><input type="checkbox" class="for_review_checkbox" style="float: left;" data-quoteitemid="7484" /><input type="hidden" name="for_review[]" value="0" /><span style="display:inline-block;margin-left:5px;"> Mark this item for review </span></label>
</div><br>
<span class='pointer'
onclick="getUOM('2493','7');">
Manage Unit of Measure
<i class="material-symbols-rounded" >ad_units</i>
</span><div class="custom-fields custom-field7484"></div></div><div id='pdfiles7' class='menupd' style='display:none;'><div class='sidebar-attachedment-container'>
<div class="h4 mb-3 mt-3 text-start">File Upload
<div id="sidebarDropboxBtnContainer" class="d-inline"><!--Do not delete this part, this is for dropbox button--></div>
<div id="mfilesBtnContainer" class="d-inline"><!--Do not delete this part, this is for mfiles button--></div>
</div>
<div class="row">
<div class="col">
<div data-action="uploadsave.php"
data-cat="Select"
data-sourceid="7484"
data-sourcemodule="6"
data-subtype="quoteitem"
data-quote="2266"
class="sdropzone border border-2 p-3 mb-2 dropzone_quoteitem"
id="quoteitem_dropzone_7" >
<!--
<input type='hidden' name='category' value="Select">
<input type='hidden' name='sourceid' id="sourceid" value="">
<input type='hidden' name='sourcemodule' value="">
<input type='hidden' name='subtype' value="">
-->
<div class="mb-1">
<div class="dz-message" data-dz-message>
<div class="h5">Drag and Drop to upload files or click here</div>
<p>Files uploaded here will not be placed in a category. To upload files into specific categories use the "+" icon above</p>
</div>
</div>
</div>
</div>
</div>

<div> <table class="upload-card w-100" data-category="$row->category" id="file_card_">
<tbody class="uploadedFiles">
</tbody>
</table>
</div></div></div></div></td></tr><tr data-kits-separated='0' class='quoteitemrow8 413 deleted Quotation_Inclusion ' style="display:none;color:red" ID="8" >
<td style="cursor:move;" class="draggable" draggable=true>
<a onclick="editInvItem(2533);this.form.submit();">CWRAZORRINGS100m/MAT</a>
<input type=hidden name='inventoryid[]' value='2533'>
<input type=hidden name='rowId[]' value='8'>
<input type=hidden name='sectionName[]' value='1. FENCE'>
<input type=hidden name='parent[]' ID='qParent8' value='0'>
<input type='hidden' ID='itaxName8' name='itaxName[]' value='GST'>
<input type='hidden' ID='itaxValue8' name='itaxValue[]' value='10' autocomplete='off'>
<input type=hidden name='deleteInvItem[]' ID='deleteInvItem8' value='1'>
<textarea style='display:none' name='bom[]' ID='bom8'></textarea>
<input type=hidden name='quoteitemid[]' ID='qItemId8' value='7498'>
<input type=hidden name='extra[]' ID='extra8' value=''>
<input type=hidden name='weight[]' ID='weight8' value='0'>
<input type=hidden id='parentid8' value='0'>
<input type=hidden id='referenceid8' value='7498'>
<input type=hidden id='contractid8' name='contractid[]' value='0'>
<input type=hidden id='contractsiteid8' name='contractsiteid[]' value='0'>
</td>
<td>
<div class='expandingArea'>
<pre><span></span><br></pre>
<textarea class=""
name='itemdescription[]'
id='desc8'
onchange="toggleClass('unsaved','1')" style='color:red;'>Razor rings clipped to 100m of chainwire - materials only</textarea>
</div>
</td>
<td class="costplus currency">
<input type="text" name='itemcost[]' ID='itemcost8' value='316.6100'
class='datainput' data-invcost = '316.61' onchange="updateRow(8, 1, 'itemCost');" autocomplete='off' style='color:red;'>
</td>
<td class="discount currency">
<input type='text' name='itemprice[]' ID='itemprice8' value='395.7600'
class='datainput' onkeydown='' onchange="updateRow(8, 1, 'itemPrice');" autocomplete='off' style='color:red;'>
</td>
<td style="width:100px">
<input type='text' name='itemqty[]' ID='qty8' value='1.00'
style="width:100%; color:red;" class="datainput" onchange="updateRow(8, 1, 'itemQty');" autocomplete='off'>
</td>
<td class="costplus d-none" ID="linecost8" style='color:red;'>
$316.61
</td>
<td >
<input type='text' name='itemdiscount[]' ID='discount8'
value='25' class='datainput' onblur="updateRow(8, 1, 'itemDisc');" style='color:red;'>
</td>
<td class="currency">
<input type='text'
name='adjPrice[]'
ID='adjPrice8'
value='395.7625'
size='4'
class='datainput Quotation_Inclusion'
onkeydown=''
onchange="updateRow(8, 1, 'adjPrice');"
autocomplete='off' style='color:red;'>
</td>
<td style="width:100px">
<input type='hidden' ID='itaxAmount8' class='datainput' name='itaxAmount[]' newval='39.5763'
value='39.5763' autocomplete='off'>
<div ID='itaxAmountText8'>39.5763</div>
</td>
<td ID='subTotal8' style="width:100px" data-itemtotal=\'395.76" data-total="395.76">395.76</td>
<td class="pe-2" style="width:90px"><div ID='actionIcon[]' class="actionIcon8 text-end" style="width:auto;float:right;display:inline-block;position:relative"><span class=" float-right material-symbols-rounded pointer" onclick='hideRows(8);' ID='delIcon8' >undo</span>
<span class='float-right' class='morebtn' data-id='7498' href="#" onclick="hideAll();document.getElementById('moreItem8').classList.toggle('popupDivFade'); return false;" style='cursor:pointer;'>
<i class="material-symbols-rounded" dataclass="morebtn" ID="more8" data-quote='2266' data-id='7498' data-cat='25' style="color:">more_vert</i>
</span></div>
<div id="moreItem8" class="popupDiv quoteItemMore">
<div class='popupDivHeader container-fluid'>
<div class='row'>
<div class='col h3'>
ADVANCED CWRAZORRINGS100m/MAT
</div>
<div class='col-1'>
<a style='float:right' onclick="hideAll(); quoteAutosave();";>
<i class="material-symbols-rounded">close</i></a>
</div>
</div>
</div>
<div class='navbar-collapse d-flex mt-3' id='navbarNavPopupDiv8'><ul class='navbar-nav' style='flex-direction:row;'><li class='nav-item active'><a class='smpd pointer nav-link' id='smpdpddetails8' onclick="quoteItemTab('8','pddetails');" style='text-decoration:underline;color:var(--main-selected-color);'>Details</a></li><li class='nav-item' style='margin-left:-1px;'><a class='smpd pointer nav-link' id='smpdpdfiles8' onclick="quoteItemTab('8','pdfiles');" style='text-decoration:none;'>Files</a></li></ul></div><div id='pddetails8' class='menupd'><textarea class='form-control' rows="10">Razor rings clipped to 100m of chainwire - materials only</textarea>
<br><br><a style="height:auto;" class="pointer" onmouseup="setCosttoInv('8','316.61')">Inventory Cost: $316.61</a>
<br>Weight: 0 KG<hr>
<div class='form-group'>
<label>Notes:</label>
<textarea name=itemnotes[] class='form-control'></textarea>
</div>
<div class='form-group'>
<label>Tab:</label>
<select name="sectionId[]" class='form-control'>
<option value="0">Unassigned</option><option value="413" selected>1. FENCE</option><option value="414" >2. INSTALLATION</option><option value="415" >3. GATES</option> </select>
</div>
<div class='form-group'>
<label>Supplier Code:</label>
<select name="supplier[]" ID="supplier8" class='form-control'>
<option value="0">N/A</option> </select>
</div>
<font style="color:red" ID="warning8"></font><div class="col for_review">
<label><input type="checkbox" class="for_review_checkbox" style="float: left;" data-quoteitemid="7498" /><input type="hidden" name="for_review[]" value="0" /><span style="display:inline-block;margin-left:5px;"> Mark this item for review </span></label>
</div><br>
<span class='pointer'
onclick="getUOM('2533','8');">
Manage Unit of Measure
<i class="material-symbols-rounded" >ad_units</i>
</span><div class="custom-fields custom-field7498"></div></div><div id='pdfiles8' class='menupd' style='display:none;'><div class='sidebar-attachedment-container'>
<div class="h4 mb-3 mt-3 text-start">File Upload
<div id="sidebarDropboxBtnContainer" class="d-inline"><!--Do not delete this part, this is for dropbox button--></div>
<div id="mfilesBtnContainer" class="d-inline"><!--Do not delete this part, this is for mfiles button--></div>
</div>
<div class="row">
<div class="col">
<div data-action="uploadsave.php"
data-cat="Select"
data-sourceid="7498"
data-sourcemodule="6"
data-subtype="quoteitem"
data-quote="2266"
class="sdropzone border border-2 p-3 mb-2 dropzone_quoteitem"
id="quoteitem_dropzone_8" >
<!--
<input type='hidden' name='category' value="Select">
<input type='hidden' name='sourceid' id="sourceid" value="">
<input type='hidden' name='sourcemodule' value="">
<input type='hidden' name='subtype' value="">
-->
<div class="mb-1">
<div class="dz-message" data-dz-message>
<div class="h5">Drag and Drop to upload files or click here</div>
<p>Files uploaded here will not be placed in a category. To upload files into specific categories use the "+" icon above</p>
</div>
</div>
</div>
</div>
</div>

<div> <table class="upload-card w-100" data-category="$row->category" id="file_card_">
<tbody class="uploadedFiles">
</tbody>
</table>
</div></div></div></div></td></tr><tr data-kits-separated='0' class='quoteitemrow9 413 Quotation_Inclusion ' style="display:;color:black" ID="9" >
<td style="cursor:move;" class="draggable" draggable=true>
<a onclick="editInvItem(1837);this.form.submit();">RZRRNG550pk</a>
<input type=hidden name='inventoryid[]' value='1837'>
<input type=hidden name='rowId[]' value='9'>
<input type=hidden name='sectionName[]' value='1. FENCE'>
<input type=hidden name='parent[]' ID='qParent9' value='0'>
<input type='hidden' ID='itaxName9' name='itaxName[]' value='GST'>
<input type='hidden' ID='itaxValue9' name='itaxValue[]' value='10' autocomplete='off'>
<input type=hidden name='deleteInvItem[]' ID='deleteInvItem9' value='0'>
<textarea style='display:none' name='bom[]' ID='bom9'></textarea>
<input type=hidden name='quoteitemid[]' ID='qItemId9' value='7499'>
<input type=hidden name='extra[]' ID='extra9' value=''>
<input type=hidden name='weight[]' ID='weight9' value='11'>
<input type=hidden id='parentid9' value='0'>
<input type=hidden id='referenceid9' value='7499'>
<input type=hidden id='contractid9' name='contractid[]' value='0'>
<input type=hidden id='contractsiteid9' name='contractsiteid[]' value='0'>
</td>
<td>
<div class='expandingArea'>
<pre><span></span><br></pre>
<textarea class=""
name='itemdescription[]'
id='desc9'
onchange="toggleClass('unsaved','1')" style='color:black;'>Flat Loop Razor Wire (Single Rings) - 70 Loops per Pack - Length per pack 20m @ 275mm centres</textarea>
</div>
</td>
<td class="costplus currency">
<input type="text" name='itemcost[]' ID='itemcost9' value='62.4750'
class='datainput' data-invcost = '62.475' onchange="updateRow(9, 1, 'itemCost');" autocomplete='off' style='color:black;'>
</td>
<td class="discount currency">
<input type='text' name='itemprice[]' ID='itemprice9' value='93.7200'
class='datainput' onkeydown='' onchange="updateRow(9, 1, 'itemPrice');" autocomplete='off' style='color:black;'>
</td>
<td style="width:100px">
<input type='text' name='itemqty[]' ID='qty9' value='0.20'
style="width:100%; color:black;" class="datainput" onchange="updateRow(9, 1, 'itemQty');" autocomplete='off'>
</td>
<td class="costplus d-none" ID="linecost9" style='color:black;'>
$12.50
</td>
<td >
<input type='text' name='itemdiscount[]' ID='discount9'
value='25.0001' class='datainput' onblur="updateRow(9, 1, 'itemDisc');" style='color:black;'>
</td>
<td class="currency">
<input type='text'
name='adjPrice[]'
ID='adjPrice9'
value='78.0938'
size='4'
class='datainput Quotation_Inclusion'
onkeydown=''
onchange="updateRow(9, 1, 'adjPrice');"
autocomplete='off' style='color:black;'>
</td>
<td style="width:100px">
<input type='hidden' ID='itaxAmount9' class='datainput' name='itaxAmount[]' newval='7.8094'
value='7.8094' autocomplete='off'>
<div ID='itaxAmountText9'>1.5619</div>
</td>
<td ID='subTotal9' style="width:100px" data-itemtotal=\'78.1" data-total="15.62">15.62</td>
<td class="pe-2" style="width:90px"><div ID='actionIcon[]' class="actionIcon9 text-end" style="width:auto;float:right;display:inline-block;position:relative"><span class=" float-right material-symbols-rounded pointer" onclick='hideRows(9);' ID='delIcon9' >delete</span>
<span class='float-right' class='morebtn' data-id='7499' href="#" onclick="hideAll();document.getElementById('moreItem9').classList.toggle('popupDivFade'); return false;" style='cursor:pointer;'>
<i class="material-symbols-rounded" dataclass="morebtn" ID="more9" data-quote='2266' data-id='7499' data-cat='82' style="color:">more_vert</i>
</span></div>
<div id="moreItem9" class="popupDiv quoteItemMore">
<div class='popupDivHeader container-fluid'>
<div class='row'>
<div class='col h3'>
ADVANCED RZRRNG550pk
</div>
<div class='col-1'>
<a style='float:right' onclick="hideAll(); quoteAutosave();";>
<i class="material-symbols-rounded">close</i></a>
</div>
</div>
</div>
<div class='navbar-collapse d-flex mt-3' id='navbarNavPopupDiv9'><ul class='navbar-nav' style='flex-direction:row;'><li class='nav-item active'><a class='smpd pointer nav-link' id='smpdpddetails9' onclick="quoteItemTab('9','pddetails');" style='text-decoration:underline;color:var(--main-selected-color);'>Details</a></li><li class='nav-item' style='margin-left:-1px;'><a class='smpd pointer nav-link' id='smpdpdfiles9' onclick="quoteItemTab('9','pdfiles');" style='text-decoration:none;'>Files</a></li></ul></div><div id='pddetails9' class='menupd'><textarea class='form-control' rows="10">Flat Loop Razor Wire (Single Rings) - 70 Loops per Pack - Length per pack 20m @ 275mm centres</textarea>
<br><br><a style="height:auto;" class="pointer" onmouseup="setCosttoInv('9','62.475')">Inventory Cost: $62.48</a>
<br>Weight: 11 KG<hr>
<div class='form-group'>
<label>Notes:</label>
<textarea name=itemnotes[] class='form-control'></textarea>
</div>
<div class='form-group'>
<label>Tab:</label>
<select name="sectionId[]" class='form-control'>
<option value="0">Unassigned</option><option value="413" selected>1. FENCE</option><option value="414" >2. INSTALLATION</option><option value="415" >3. GATES</option> </select>
</div>
<div class='form-group'>
<label>Supplier Code:</label>
<select name="supplier[]" ID="supplier9" class='form-control'>
<option value="0">N/A</option> </select>
</div>
<font style="color:red" ID="warning9"></font><div class="col for_review">
<label><input type="checkbox" class="for_review_checkbox" style="float: left;" data-quoteitemid="7499" /><input type="hidden" name="for_review[]" value="0" /><span style="display:inline-block;margin-left:5px;"> Mark this item for review </span></label>
</div><br>
<span class='pointer'
onclick="getUOM('1837','9');">
Manage Unit of Measure
<i class="material-symbols-rounded" >ad_units</i>
</span><div class="custom-fields custom-field7499"></div></div><div id='pdfiles9' class='menupd' style='display:none;'><div class='sidebar-attachedment-container'>
<div class="h4 mb-3 mt-3 text-start">File Upload
<div id="sidebarDropboxBtnContainer" class="d-inline"><!--Do not delete this part, this is for dropbox button--></div>
<div id="mfilesBtnContainer" class="d-inline"><!--Do not delete this part, this is for mfiles button--></div>
</div>
<div class="row">
<div class="col">
<div data-action="uploadsave.php"
data-cat="Select"
data-sourceid="7499"
data-sourcemodule="6"
data-subtype="quoteitem"
data-quote="2266"
class="sdropzone border border-2 p-3 mb-2 dropzone_quoteitem"
id="quoteitem_dropzone_9" >
<!--
<input type='hidden' name='category' value="Select">
<input type='hidden' name='sourceid' id="sourceid" value="">
<input type='hidden' name='sourcemodule' value="">
<input type='hidden' name='subtype' value="">
-->
<div class="mb-1">
<div class="dz-message" data-dz-message>
<div class="h5">Drag and Drop to upload files or click here</div>
<p>Files uploaded here will not be placed in a category. To upload files into specific categories use the "+" icon above</p>
</div>
</div>
</div>
</div>
</div>

<div> <table class="upload-card w-100" data-category="$row->category" id="file_card_">
<tbody class="uploadedFiles">
</tbody>
</table>
</div></div></div></div></td></tr><tr data-kits-separated='0' class='quoteitemrow10 413 Quotation_Inclusion ' style="display:;color:black" ID="10" >
<td style="cursor:move;" class="draggable" draggable=true>
<a onclick="editInvItem(2540);this.form.submit();">VTEKP121425PBLK</a>
<input type=hidden name='inventoryid[]' value='2540'>
<input type=hidden name='rowId[]' value='10'>
<input type=hidden name='sectionName[]' value='1. FENCE'>
<input type=hidden name='parent[]' ID='qParent10' value='0'>
<input type='hidden' ID='itaxName10' name='itaxName[]' value='GST'>
<input type='hidden' ID='itaxValue10' name='itaxValue[]' value='10' autocomplete='off'>
<input type=hidden name='deleteInvItem[]' ID='deleteInvItem10' value='0'>
<textarea style='display:none' name='bom[]' ID='bom10'></textarea>
<input type=hidden name='quoteitemid[]' ID='qItemId10' value='7500'>
<input type=hidden name='extra[]' ID='extra10' value=''>
<input type=hidden name='weight[]' ID='weight10' value='0'>
<input type=hidden id='parentid10' value='0'>
<input type=hidden id='referenceid10' value='7500'>
<input type=hidden id='contractid10' name='contractid[]' value='0'>
<input type=hidden id='contractsiteid10' name='contractsiteid[]' value='0'>
</td>
<td>
<div class='expandingArea'>
<pre><span></span><br></pre>
<textarea class=""
name='itemdescription[]'
id='desc10'
onchange="toggleClass('unsaved','1')" style='color:black;'>12-14X25 Pan Head Pentaforce Tek Screw - Black</textarea>
</div>
</td>
<td class="costplus currency">
<input type="text" name='itemcost[]' ID='itemcost10' value='0.3700'
class='datainput' data-invcost = '0.37' onchange="updateRow(10, 1, 'itemCost');" autocomplete='off' style='color:black;'>
</td>
<td class="discount currency">
<input type='text' name='itemprice[]' ID='itemprice10' value='0.4600'
class='datainput' onkeydown='' onchange="updateRow(10, 1, 'itemPrice');" autocomplete='off' style='color:black;'>
</td>
<td style="width:100px">
<input type='text' name='itemqty[]' ID='qty10' value='40.00'
style="width:100%; color:black;" class="datainput" onchange="updateRow(10, 1, 'itemQty');" autocomplete='off'>
</td>
<td class="costplus d-none" ID="linecost10" style='color:black;'>
$14.80
</td>
<td >
<input type='text' name='itemdiscount[]' ID='discount10'
value='25' class='datainput' onblur="updateRow(10, 1, 'itemDisc');" style='color:black;'>
</td>
<td class="currency">
<input type='text'
name='adjPrice[]'
ID='adjPrice10'
value='0.4625'
size='4'
class='datainput Quotation_Inclusion'
onkeydown=''
onchange="updateRow(10, 1, 'adjPrice');"
autocomplete='off' style='color:black;'>
</td>
<td style="width:100px">
<input type='hidden' ID='itaxAmount10' class='datainput' name='itaxAmount[]' newval='0.0463'
value='0.0463' autocomplete='off'>
<div ID='itaxAmountText10'>1.8520</div>
</td>
<td ID='subTotal10' style="width:100px" data-itemtotal=\'0.46" data-total="18.50">18.50</td>
<td class="pe-2" style="width:90px"><div ID='actionIcon[]' class="actionIcon10 text-end" style="width:auto;float:right;display:inline-block;position:relative"><span class=" float-right material-symbols-rounded pointer" onclick='hideRows(10);' ID='delIcon10' >delete</span>
<span class='float-right' class='morebtn' data-id='7500' href="#" onclick="hideAll();document.getElementById('moreItem10').classList.toggle('popupDivFade'); return false;" style='cursor:pointer;'>
<i class="material-symbols-rounded" dataclass="morebtn" ID="more10" data-quote='2266' data-id='7500' data-cat='26' style="color:">more_vert</i>
</span></div>
<div id="moreItem10" class="popupDiv quoteItemMore">
<div class='popupDivHeader container-fluid'>
<div class='row'>
<div class='col h3'>
ADVANCED VTEKP121425PBLK
</div>
<div class='col-1'>
<a style='float:right' onclick="hideAll(); quoteAutosave();";>
<i class="material-symbols-rounded">close</i></a>
</div>
</div>
</div>
<div class='navbar-collapse d-flex mt-3' id='navbarNavPopupDiv10'><ul class='navbar-nav' style='flex-direction:row;'><li class='nav-item active'><a class='smpd pointer nav-link' id='smpdpddetails10' onclick="quoteItemTab('10','pddetails');" style='text-decoration:underline;color:var(--main-selected-color);'>Details</a></li><li class='nav-item' style='margin-left:-1px;'><a class='smpd pointer nav-link' id='smpdpdfiles10' onclick="quoteItemTab('10','pdfiles');" style='text-decoration:none;'>Files</a></li></ul></div><div id='pddetails10' class='menupd'><textarea class='form-control' rows="10">12-14X25 Pan Head Pentaforce Tek Screw - Black</textarea>
<br><br><a style="height:auto;" class="pointer" onmouseup="setCosttoInv('10','0.37')">Inventory Cost: $0.37</a>
<br>Weight: 0 KG<hr>
<div class='form-group'>
<label>Notes:</label>
<textarea name=itemnotes[] class='form-control'></textarea>
</div>
<div class='form-group'>
<label>Tab:</label>
<select name="sectionId[]" class='form-control'>
<option value="0">Unassigned</option><option value="413" selected>1. FENCE</option><option value="414" >2. INSTALLATION</option><option value="415" >3. GATES</option> </select>
</div>
<div class='form-group'>
<label>Supplier Code:</label>
<select name="supplier[]" ID="supplier10" class='form-control'>
<option value="0">N/A</option> </select>
</div>
<font style="color:red" ID="warning10"></font><div class="col for_review">
<label><input type="checkbox" class="for_review_checkbox" style="float: left;" data-quoteitemid="7500" /><input type="hidden" name="for_review[]" value="0" /><span style="display:inline-block;margin-left:5px;"> Mark this item for review </span></label>
</div><br>
<span class='pointer'
onclick="getUOM('2540','10');">
Manage Unit of Measure
<i class="material-symbols-rounded" >ad_units</i>
</span><div class="custom-fields custom-field7500"></div></div><div id='pdfiles10' class='menupd' style='display:none;'><div class='sidebar-attachedment-container'>
<div class="h4 mb-3 mt-3 text-start">File Upload
<div id="sidebarDropboxBtnContainer" class="d-inline"><!--Do not delete this part, this is for dropbox button--></div>
<div id="mfilesBtnContainer" class="d-inline"><!--Do not delete this part, this is for mfiles button--></div>
</div>
<div class="row">
<div class="col">
<div data-action="uploadsave.php"
data-cat="Select"
data-sourceid="7500"
data-sourcemodule="6"
data-subtype="quoteitem"
data-quote="2266"
class="sdropzone border border-2 p-3 mb-2 dropzone_quoteitem"
id="quoteitem_dropzone_10" >
<!--
<input type='hidden' name='category' value="Select">
<input type='hidden' name='sourceid' id="sourceid" value="">
<input type='hidden' name='sourcemodule' value="">
<input type='hidden' name='subtype' value="">
-->
<div class="mb-1">
<div class="dz-message" data-dz-message>
<div class="h5">Drag and Drop to upload files or click here</div>
<p>Files uploaded here will not be placed in a category. To upload files into specific categories use the "+" icon above</p>
</div>
</div>
</div>
</div>
</div>

<div> <table class="upload-card w-100" data-category="$row->category" id="file_card_">
<tbody class="uploadedFiles">
</tbody>
</table>
</div></div></div></div></td></tr><tr data-kits-separated='0' class='quoteitemrow11 413 Quotation_Inclusion ' style="display:;color:black" ID="11" >
<td style="cursor:move;" class="draggable" draggable=true>
<a onclick="editInvItem(1212);this.form.submit();">MB*</a>
<input type=hidden name='inventoryid[]' value='1212'>
<input type=hidden name='rowId[]' value='11'>
<input type=hidden name='sectionName[]' value='1. FENCE'>
<input type=hidden name='parent[]' ID='qParent11' value='0'>
<input type='hidden' ID='itaxName11' name='itaxName[]' value='GST'>
<input type='hidden' ID='itaxValue11' name='itaxValue[]' value='10' autocomplete='off'>
<input type=hidden name='deleteInvItem[]' ID='deleteInvItem11' value='0'>
<textarea style='display:none' name='bom[]' ID='bom11'></textarea>
<input type=hidden name='quoteitemid[]' ID='qItemId11' value='7501'>
<input type=hidden name='extra[]' ID='extra11' value=''>
<input type=hidden name='weight[]' ID='weight11' value='0.0127'>
<input type=hidden id='parentid11' value='0'>
<input type=hidden id='referenceid11' value='7501'>
<input type=hidden id='contractid11' name='contractid[]' value='0'>
<input type=hidden id='contractsiteid11' name='contractsiteid[]' value='0'>
</td>
<td>
<div class='expandingArea'>
<pre><span></span><br></pre>
<textarea class=""
name='itemdescription[]'
id='desc11'
onchange="toggleClass('unsaved','1')" style='color:black;'>Weldmesh Fixing Bracket</textarea>
</div>
</td>
<td class="costplus currency">
<input type="text" name='itemcost[]' ID='itemcost11' value='0.2210'
class='datainput' data-invcost = '0.2205' onchange="updateRow(11, 1, 'itemCost');" autocomplete='off' style='color:black;'>
</td>
<td class="discount currency">
<input type='text' name='itemprice[]' ID='itemprice11' value='0.3300'
class='datainput' onkeydown='' onchange="updateRow(11, 1, 'itemPrice');" autocomplete='off' style='color:black;'>
</td>
<td style="width:100px">
<input type='text' name='itemqty[]' ID='qty11' value='40.00'
style="width:100%; color:black;" class="datainput" onchange="updateRow(11, 1, 'itemQty');" autocomplete='off'>
</td>
<td class="costplus d-none" ID="linecost11" style='color:black;'>
$8.84
</td>
<td >
<input type='text' name='itemdiscount[]' ID='discount11'
value='24.7059' class='datainput' onblur="updateRow(11, 1, 'itemDisc');" style='color:black;'>
</td>
<td class="currency">
<input type='text'
name='adjPrice[]'
ID='adjPrice11'
value='0.2756'
size='4'
class='datainput Quotation_Inclusion'
onkeydown=''
onchange="updateRow(11, 1, 'adjPrice');"
autocomplete='off' style='color:black;'>
</td>
<td style="width:100px">
<input type='hidden' ID='itaxAmount11' class='datainput' name='itaxAmount[]' newval='0.0276'
value='0.0276' autocomplete='off'>
<div ID='itaxAmountText11'>1.1040</div>
</td>
<td ID='subTotal11' style="width:100px" data-itemtotal=\'0.28" data-total="11.02">11.02</td>
<td class="pe-2" style="width:90px"><div ID='actionIcon[]' class="actionIcon11 text-end" style="width:auto;float:right;display:inline-block;position:relative"><span class=" float-right material-symbols-rounded pointer" onclick='hideRows(11);' ID='delIcon11' >delete</span>
<span class='float-right' class='morebtn' data-id='7501' href="#" onclick="hideAll();document.getElementById('moreItem11').classList.toggle('popupDivFade'); return false;" style='cursor:pointer;'>
<i class="material-symbols-rounded" dataclass="morebtn" ID="more11" data-quote='2266' data-id='7501' data-cat='66' style="color:">more_vert</i>
</span></div>
<div id="moreItem11" class="popupDiv quoteItemMore">
<div class='popupDivHeader container-fluid'>
<div class='row'>
<div class='col h3'>
ADVANCED MB*
</div>
<div class='col-1'>
<a style='float:right' onclick="hideAll(); quoteAutosave();";>
<i class="material-symbols-rounded">close</i></a>
</div>
</div>
</div>
<div class='navbar-collapse d-flex mt-3' id='navbarNavPopupDiv11'><ul class='navbar-nav' style='flex-direction:row;'><li class='nav-item active'><a class='smpd pointer nav-link' id='smpdpddetails11' onclick="quoteItemTab('11','pddetails');" style='text-decoration:underline;color:var(--main-selected-color);'>Details</a></li><li class='nav-item' style='margin-left:-1px;'><a class='smpd pointer nav-link' id='smpdpdfiles11' onclick="quoteItemTab('11','pdfiles');" style='text-decoration:none;'>Files</a></li></ul></div><div id='pddetails11' class='menupd'><textarea class='form-control' rows="10">Weldmesh Fixing Bracket</textarea>
<br><br><a style="height:auto;" class="pointer" onmouseup="setCosttoInv('11','0.2205')">Inventory Cost: $0.22</a>
<br>Weight: 0.0127 KG<hr>
<div class='form-group'>
<label>Notes:</label>
<textarea name=itemnotes[] class='form-control'></textarea>
</div>
<div class='form-group'>
<label>Tab:</label>
<select name="sectionId[]" class='form-control'>
<option value="0">Unassigned</option><option value="413" selected>1. FENCE</option><option value="414" >2. INSTALLATION</option><option value="415" >3. GATES</option> </select>
</div>
<div class='form-group'>
<label>Supplier Code:</label>
<select name="supplier[]" ID="supplier11" class='form-control'>
<option value="0">N/A</option> <option value="646" >MB Vater Hardware Australia 0.2205</option> </select>
</div>
<font style="color:red" ID="warning11"></font><div class="col for_review">
<label><input type="checkbox" class="for_review_checkbox" style="float: left;" data-quoteitemid="7501" /><input type="hidden" name="for_review[]" value="0" /><span style="display:inline-block;margin-left:5px;"> Mark this item for review </span></label>
</div><br>
<span class='pointer'
onclick="getUOM('1212','11');">
Manage Unit of Measure
<i class="material-symbols-rounded" >ad_units</i>
</span><div class="custom-fields custom-field7501"></div></div><div id='pdfiles11' class='menupd' style='display:none;'><div class='sidebar-attachedment-container'>
<div class="h4 mb-3 mt-3 text-start">File Upload
<div id="sidebarDropboxBtnContainer" class="d-inline"><!--Do not delete this part, this is for dropbox button--></div>
<div id="mfilesBtnContainer" class="d-inline"><!--Do not delete this part, this is for mfiles button--></div>
</div>
<div class="row">
<div class="col">
<div data-action="uploadsave.php"
data-cat="Select"
data-sourceid="7501"
data-sourcemodule="6"
data-subtype="quoteitem"
data-quote="2266"
class="sdropzone border border-2 p-3 mb-2 dropzone_quoteitem"
id="quoteitem_dropzone_11" >
<!--
<input type='hidden' name='category' value="Select">
<input type='hidden' name='sourceid' id="sourceid" value="">
<input type='hidden' name='sourcemodule' value="">
<input type='hidden' name='subtype' value="">
-->
<div class="mb-1">
<div class="dz-message" data-dz-message>
<div class="h5">Drag and Drop to upload files or click here</div>
<p>Files uploaded here will not be placed in a category. To upload files into specific categories use the "+" icon above</p>
</div>
</div>
</div>
</div>
</div>

<div> <table class="upload-card w-100" data-category="$row->category" id="file_card_">
<tbody class="uploadedFiles">
</tbody>
</table>
</div></div></div></div></td></tr><tr data-kits-separated='0' class='quoteitemrow12 414 Quotation_Inclusion ' style="display:;color:black" ID="12" >
<td style="cursor:move;" class="draggable" draggable=true>
<a onclick="editInvItem(2556);this.form.submit();">OpsInst-DAYRATELAFHA</a>
<input type=hidden name='inventoryid[]' value='2556'>
<input type=hidden name='rowId[]' value='12'>
<input type=hidden name='sectionName[]' value='NEW TAB 2'>
<input type=hidden name='parent[]' ID='qParent12' value='0'>
<input type='hidden' ID='itaxName12' name='itaxName[]' value='GST'>
<input type='hidden' ID='itaxValue12' name='itaxValue[]' value='10' autocomplete='off'>
<input type=hidden name='deleteInvItem[]' ID='deleteInvItem12' value='0'>
<textarea style='display:none' name='bom[]' ID='bom12'></textarea>
<input type=hidden name='quoteitemid[]' ID='qItemId12' value='7480'>
<input type=hidden name='extra[]' ID='extra12' value=''>
<input type=hidden name='weight[]' ID='weight12' value='0'>
<input type=hidden id='parentid12' value='0'>
<input type=hidden id='referenceid12' value='7480'>
<input type=hidden id='contractid12' name='contractid[]' value='0'>
<input type=hidden id='contractsiteid12' name='contractsiteid[]' value='0'>
</td>
<td>
<div class='expandingArea'>
<pre><span></span><br></pre>
<textarea class=""
name='itemdescription[]'
id='desc12'
onchange="toggleClass('unsaved','1')" style='color:black;'>Installation of Fencing - per person per day - working away</textarea>
</div>
</td>
<td class="costplus currency">
<input type="text" name='itemcost[]' ID='itemcost12' value='965.0000'
class='datainput' data-invcost = '965' onchange="updateRow(12, 1, 'itemCost');" autocomplete='off' style='color:black;'>
</td>
<td class="discount currency">
<input type='text' name='itemprice[]' ID='itemprice12' value='1285.0000'
class='datainput' onkeydown='' onchange="updateRow(12, 1, 'itemPrice');" autocomplete='off' style='color:black;'>
</td>
<td style="width:100px">
<input type='text' name='itemqty[]' ID='qty12' value='4.00'
style="width:100%; color:black;" class="datainput" onchange="updateRow(12, 1, 'itemQty');" autocomplete='off'>
</td>
<td class="costplus d-none" ID="linecost12" style='color:black;'>
$3,860.00
</td>
<td >
<input type='text' name='itemdiscount[]' ID='discount12'
value='33' class='datainput' onblur="updateRow(12, 1, 'itemDisc');" style='color:black;'>
</td>
<td class="currency">
<input type='text'
name='adjPrice[]'
ID='adjPrice12'
value='1283.4500'
size='4'
class='datainput Quotation_Inclusion'
onkeydown=''
onchange="updateRow(12, 1, 'adjPrice');"
autocomplete='off' style='color:black;'>
</td>
<td style="width:100px">
<input type='hidden' ID='itaxAmount12' class='datainput' name='itaxAmount[]' newval='128.3450'
value='128.3450' autocomplete='off'>
<div ID='itaxAmountText12'>513.3800</div>
</td>
<td ID='subTotal12' style="width:100px" data-itemtotal=\'1283.45" data-total="5133.80">5133.80</td>
<td class="pe-2" style="width:90px"><div ID='actionIcon[]' class="actionIcon12 text-end" style="width:auto;float:right;display:inline-block;position:relative"><span class=" float-right material-symbols-rounded pointer" onclick='hideRows(12);' ID='delIcon12' >delete</span>
<span class='float-right' class='morebtn' data-id='7480' href="#" onclick="hideAll();document.getElementById('moreItem12').classList.toggle('popupDivFade'); return false;" style='cursor:pointer;'>
<i class="material-symbols-rounded" dataclass="morebtn" ID="more12" data-quote='2266' data-id='7480' data-cat='73' style="color:">more_vert</i>
</span></div>
<div id="moreItem12" class="popupDiv quoteItemMore">
<div class='popupDivHeader container-fluid'>
<div class='row'>
<div class='col h3'>
ADVANCED OpsInst-DAYRATELAFHA
</div>
<div class='col-1'>
<a style='float:right' onclick="hideAll(); quoteAutosave();";>
<i class="material-symbols-rounded">close</i></a>
</div>
</div>
</div>
<div class='navbar-collapse d-flex mt-3' id='navbarNavPopupDiv12'><ul class='navbar-nav' style='flex-direction:row;'><li class='nav-item active'><a class='smpd pointer nav-link' id='smpdpddetails12' onclick="quoteItemTab('12','pddetails');" style='text-decoration:underline;color:var(--main-selected-color);'>Details</a></li><li class='nav-item' style='margin-left:-1px;'><a class='smpd pointer nav-link' id='smpdpdfiles12' onclick="quoteItemTab('12','pdfiles');" style='text-decoration:none;'>Files</a></li></ul></div><div id='pddetails12' class='menupd'><textarea class='form-control' rows="10">Installation of Fencing - per person per day - working away</textarea>
<br><br><a style="height:auto;" class="pointer" onmouseup="setCosttoInv('12','965')">Inventory Cost: $965.00</a>
<br>Weight: 0 KG<hr>
<div class='form-group'>
<label>Notes:</label>
<textarea name=itemnotes[] class='form-control'></textarea>
</div>
<div class='form-group'>
<label>Tab:</label>
<select name="sectionId[]" class='form-control'>
<option value="0">Unassigned</option><option value="413" >1. FENCE</option><option value="414" selected>2. INSTALLATION</option><option value="415" >3. GATES</option> </select>
</div>
<div class='form-group'>
<label>Supplier Code:</label>
<select name="supplier[]" ID="supplier12" class='form-control'>
<option value="0">N/A</option> </select>
</div>
<font style="color:red" ID="warning12"></font><div class="col for_review">
<label><input type="checkbox" class="for_review_checkbox" style="float: left;" data-quoteitemid="7480" /><input type="hidden" name="for_review[]" value="0" /><span style="display:inline-block;margin-left:5px;"> Mark this item for review </span></label>
</div><br>
<span class='pointer'
onclick="getUOM('2556','12');">
Manage Unit of Measure
<i class="material-symbols-rounded" >ad_units</i>
</span><div class="custom-fields custom-field7480"></div></div><div id='pdfiles12' class='menupd' style='display:none;'><div class='sidebar-attachedment-container'>
<div class="h4 mb-3 mt-3 text-start">File Upload
<div id="sidebarDropboxBtnContainer" class="d-inline"><!--Do not delete this part, this is for dropbox button--></div>
<div id="mfilesBtnContainer" class="d-inline"><!--Do not delete this part, this is for mfiles button--></div>
</div>
<div class="row">
<div class="col">
<div data-action="uploadsave.php"
data-cat="Select"
data-sourceid="7480"
data-sourcemodule="6"
data-subtype="quoteitem"
data-quote="2266"
class="sdropzone border border-2 p-3 mb-2 dropzone_quoteitem"
id="quoteitem_dropzone_12" >
<!--
<input type='hidden' name='category' value="Select">
<input type='hidden' name='sourceid' id="sourceid" value="">
<input type='hidden' name='sourcemodule' value="">
<input type='hidden' name='subtype' value="">
-->
<div class="mb-1">
<div class="dz-message" data-dz-message>
<div class="h5">Drag and Drop to upload files or click here</div>
<p>Files uploaded here will not be placed in a category. To upload files into specific categories use the "+" icon above</p>
</div>
</div>
</div>
</div>
</div>

<div> <table class="upload-card w-100" data-category="$row->category" id="file_card_">
<tbody class="uploadedFiles">
</tbody>
</table>
</div></div></div></div></td></tr><tr data-kits-separated='0' class='quoteitemrow13 414 Quotation_Inclusion ' style="display:;color:black" ID="13" >
<td style="cursor:move;" class="draggable" draggable=true>
<a onclick="editInvItem(2548);this.form.submit();">OpsInst-FOOTINGS-CONC</a>
<input type=hidden name='inventoryid[]' value='2548'>
<input type=hidden name='rowId[]' value='13'>
<input type=hidden name='sectionName[]' value='2. INSTALLATION'>
<input type=hidden name='parent[]' ID='qParent13' value='0'>
<input type='hidden' ID='itaxName13' name='itaxName[]' value='GST'>
<input type='hidden' ID='itaxValue13' name='itaxValue[]' value='10' autocomplete='off'>
<input type=hidden name='deleteInvItem[]' ID='deleteInvItem13' value='0'>
<textarea style='display:none' name='bom[]' ID='bom13'></textarea>
<input type=hidden name='quoteitemid[]' ID='qItemId13' value='7483'>
<input type=hidden name='extra[]' ID='extra13' value=''>
<input type=hidden name='weight[]' ID='weight13' value='0'>
<input type=hidden id='parentid13' value='0'>
<input type=hidden id='referenceid13' value='7483'>
<input type=hidden id='contractid13' name='contractid[]' value='0'>
<input type=hidden id='contractsiteid13' name='contractsiteid[]' value='0'>
</td>
<td>
<div class='expandingArea'>
<pre><span></span><br></pre>
<textarea class=""
name='itemdescription[]'
id='desc13'
onchange="toggleClass('unsaved','1')" style='color:black;'>Install Footings in normal conditions, including filling with 25mpa concrete - Per 100cm3</textarea>
</div>
</td>
<td class="costplus currency">
<input type="text" name='itemcost[]' ID='itemcost13' value='0.0930'
class='datainput' data-invcost = '0.0934' onchange="updateRow(13, 1, 'itemCost');" autocomplete='off' style='color:black;'>
</td>
<td class="discount currency">
<input type='text' name='itemprice[]' ID='itemprice13' value='0.1200'
class='datainput' onkeydown='' onchange="updateRow(13, 1, 'itemPrice');" autocomplete='off' style='color:black;'>
</td>
<td style="width:100px">
<input type='text' name='itemqty[]' ID='qty13' value='13000.00'
style="width:100%; color:black;" class="datainput" onchange="updateRow(13, 1, 'itemQty');" autocomplete='off'>
</td>
<td class="costplus d-none" ID="linecost13" style='color:black;'>
$1,209.00
</td>
<td >
<input type='text' name='itemdiscount[]' ID='discount13'
value='33.5484' class='datainput' onblur="updateRow(13, 1, 'itemDisc');" style='color:black;'>
</td>
<td class="currency">
<input type='text'
name='adjPrice[]'
ID='adjPrice13'
value='0.1242'
size='4'
class='datainput Quotation_Inclusion'
onkeydown=''
onchange="updateRow(13, 1, 'adjPrice');"
autocomplete='off' style='color:black;'>
</td>
<td style="width:100px">
<input type='hidden' ID='itaxAmount13' class='datainput' name='itaxAmount[]' newval='0.0124'
value='0.0124' autocomplete='off'>
<div ID='itaxAmountText13'>161.2000</div>
</td>
<td ID='subTotal13' style="width:100px" data-itemtotal=\'0.12" data-total="1614.60">1614.60</td>
<td class="pe-2" style="width:90px"><div ID='actionIcon[]' class="actionIcon13 text-end" style="width:auto;float:right;display:inline-block;position:relative"><span class=" float-right material-symbols-rounded pointer" onclick='hideRows(13);' ID='delIcon13' >delete</span>
<span class='float-right' class='morebtn' data-id='7483' href="#" onclick="hideAll();document.getElementById('moreItem13').classList.toggle('popupDivFade'); return false;" style='cursor:pointer;'>
<i class="material-symbols-rounded" dataclass="morebtn" ID="more13" data-quote='2266' data-id='7483' data-cat='73' style="color:">more_vert</i>
</span></div>
<div id="moreItem13" class="popupDiv quoteItemMore">
<div class='popupDivHeader container-fluid'>
<div class='row'>
<div class='col h3'>
ADVANCED OpsInst-FOOTINGS-CONC
</div>
<div class='col-1'>
<a style='float:right' onclick="hideAll(); quoteAutosave();";>
<i class="material-symbols-rounded">close</i></a>
</div>
</div>
</div>
<div class='navbar-collapse d-flex mt-3' id='navbarNavPopupDiv13'><ul class='navbar-nav' style='flex-direction:row;'><li class='nav-item active'><a class='smpd pointer nav-link' id='smpdpddetails13' onclick="quoteItemTab('13','pddetails');" style='text-decoration:underline;color:var(--main-selected-color);'>Details</a></li><li class='nav-item' style='margin-left:-1px;'><a class='smpd pointer nav-link' id='smpdpdfiles13' onclick="quoteItemTab('13','pdfiles');" style='text-decoration:none;'>Files</a></li></ul></div><div id='pddetails13' class='menupd'><textarea class='form-control' rows="10">Install Footings in normal conditions, including filling with 25mpa concrete - Per 100cm3</textarea>
<br><br><a style="height:auto;" class="pointer" onmouseup="setCosttoInv('13','0.0934')">Inventory Cost: $0.09</a>
<br>Weight: 0 KG<hr>
<div class='form-group'>
<label>Notes:</label>
<textarea name=itemnotes[] class='form-control'></textarea>
</div>
<div class='form-group'>
<label>Tab:</label>
<select name="sectionId[]" class='form-control'>
<option value="0">Unassigned</option><option value="413" >1. FENCE</option><option value="414" selected>2. INSTALLATION</option><option value="415" >3. GATES</option> </select>
</div>
<div class='form-group'>
<label>Supplier Code:</label>
<select name="supplier[]" ID="supplier13" class='form-control'>
<option value="0">N/A</option> </select>
</div>
<font style="color:red" ID="warning13"></font><div class="col for_review">
<label><input type="checkbox" class="for_review_checkbox" style="float: left;" data-quoteitemid="7483" /><input type="hidden" name="for_review[]" value="0" /><span style="display:inline-block;margin-left:5px;"> Mark this item for review </span></label>
</div><br>
<span class='pointer'
onclick="getUOM('2548','13');">
Manage Unit of Measure
<i class="material-symbols-rounded" >ad_units</i>
</span><div class="custom-fields custom-field7483"></div></div><div id='pdfiles13' class='menupd' style='display:none;'><div class='sidebar-attachedment-container'>
<div class="h4 mb-3 mt-3 text-start">File Upload
<div id="sidebarDropboxBtnContainer" class="d-inline"><!--Do not delete this part, this is for dropbox button--></div>
<div id="mfilesBtnContainer" class="d-inline"><!--Do not delete this part, this is for mfiles button--></div>
</div>
<div class="row">
<div class="col">
<div data-action="uploadsave.php"
data-cat="Select"
data-sourceid="7483"
data-sourcemodule="6"
data-subtype="quoteitem"
data-quote="2266"
class="sdropzone border border-2 p-3 mb-2 dropzone_quoteitem"
id="quoteitem_dropzone_13" >
<!--
<input type='hidden' name='category' value="Select">
<input type='hidden' name='sourceid' id="sourceid" value="">
<input type='hidden' name='sourcemodule' value="">
<input type='hidden' name='subtype' value="">
-->
<div class="mb-1">
<div class="dz-message" data-dz-message>
<div class="h5">Drag and Drop to upload files or click here</div>
<p>Files uploaded here will not be placed in a category. To upload files into specific categories use the "+" icon above</p>
</div>
</div>
</div>
</div>
</div>

<div> <table class="upload-card w-100" data-category="$row->category" id="file_card_">
<tbody class="uploadedFiles">
</tbody>
</table>
</div></div></div></div></td></tr><tr data-kits-separated='0' class='quoteitemrow14 414 Quotation_Inclusion ' style="display:;color:black" ID="14" >
<td style="cursor:move;" class="draggable" draggable=true>
<a onclick="editInvItem(3207);this.form.submit();">FREIGHT/CW/2101-2400</a>
<input type=hidden name='inventoryid[]' value='3207'>
<input type=hidden name='rowId[]' value='14'>
<input type=hidden name='sectionName[]' value='2. INSTALLATION'>
<input type=hidden name='parent[]' ID='qParent14' value='0'>
<input type='hidden' ID='itaxName14' name='itaxName[]' value='GST'>
<input type='hidden' ID='itaxValue14' name='itaxValue[]' value='10' autocomplete='off'>
<input type=hidden name='deleteInvItem[]' ID='deleteInvItem14' value='0'>
<textarea style='display:none' name='bom[]' ID='bom14'></textarea>
<input type=hidden name='quoteitemid[]' ID='qItemId14' value='7486'>
<input type=hidden name='extra[]' ID='extra14' value=''>
<input type=hidden name='weight[]' ID='weight14' value='0'>
<input type=hidden id='parentid14' value='0'>
<input type=hidden id='referenceid14' value='7486'>
<input type=hidden id='contractid14' name='contractid[]' value='0'>
<input type=hidden id='contractsiteid14' name='contractsiteid[]' value='0'>
</td>
<td>
<div class='expandingArea'>
<pre><span></span><br></pre>
<textarea class=""
name='itemdescription[]'
id='desc14'
onchange="toggleClass('unsaved','1')" style='color:black;'>Freight for Chainwire Fencing - overall height 2101mm to 2400mm - all materials - per 100m of fencing per km travelled</textarea>
</div>
</td>
<td class="costplus currency">
<input type="text" name='itemcost[]' ID='itemcost14' value='0.4750'
class='datainput' data-invcost = '0.475' onchange="updateRow(14, 1, 'itemCost');" autocomplete='off' style='color:black;'>
</td>
<td class="discount currency">
<input type='text' name='itemprice[]' ID='itemprice14' value='0.7200'
class='datainput' onkeydown='' onchange="updateRow(14, 1, 'itemPrice');" autocomplete='off' style='color:black;'>
</td>
<td style="width:100px">
<input type='text' name='itemqty[]' ID='qty14' value='49.00'
style="width:100%; color:black;" class="datainput" onchange="updateRow(14, 1, 'itemQty');" autocomplete='off'>
</td>
<td class="costplus d-none" ID="linecost14" style='color:black;'>
$23.28
</td>
<td >
<input type='text' name='itemdiscount[]' ID='discount14'
value='25.0105' class='datainput' onblur="updateRow(14, 1, 'itemDisc');" style='color:black;'>
</td>
<td class="currency">
<input type='text'
name='adjPrice[]'
ID='adjPrice14'
value='0.5938'
size='4'
class='datainput Quotation_Inclusion'
onkeydown=''
onchange="updateRow(14, 1, 'adjPrice');"
autocomplete='off' style='color:black;'>
</td>
<td style="width:100px">
<input type='hidden' ID='itaxAmount14' class='datainput' name='itaxAmount[]' newval='0.0594'
value='0.0594' autocomplete='off'>
<div ID='itaxAmountText14'>2.9106</div>
</td>
<td ID='subTotal14' style="width:100px" data-itemtotal=\'0.59" data-total="29.10">29.10</td>
<td class="pe-2" style="width:90px"><div ID='actionIcon[]' class="actionIcon14 text-end" style="width:auto;float:right;display:inline-block;position:relative"><span class=" float-right material-symbols-rounded pointer" onclick='hideRows(14);' ID='delIcon14' >delete</span>
<span class='float-right' class='morebtn' data-id='7486' href="#" onclick="hideAll();document.getElementById('moreItem14').classList.toggle('popupDivFade'); return false;" style='cursor:pointer;'>
<i class="material-symbols-rounded" dataclass="morebtn" ID="more14" data-quote='2266' data-id='7486' data-cat='74' style="color:">more_vert</i>
</span></div>
<div id="moreItem14" class="popupDiv quoteItemMore">
<div class='popupDivHeader container-fluid'>
<div class='row'>
<div class='col h3'>
ADVANCED FREIGHT/CW/2101-2400
</div>
<div class='col-1'>
<a style='float:right' onclick="hideAll(); quoteAutosave();";>
<i class="material-symbols-rounded">close</i></a>
</div>
</div>
</div>
<div class='navbar-collapse d-flex mt-3' id='navbarNavPopupDiv14'><ul class='navbar-nav' style='flex-direction:row;'><li class='nav-item active'><a class='smpd pointer nav-link' id='smpdpddetails14' onclick="quoteItemTab('14','pddetails');" style='text-decoration:underline;color:var(--main-selected-color);'>Details</a></li><li class='nav-item' style='margin-left:-1px;'><a class='smpd pointer nav-link' id='smpdpdfiles14' onclick="quoteItemTab('14','pdfiles');" style='text-decoration:none;'>Files</a></li></ul></div><div id='pddetails14' class='menupd'><textarea class='form-control' rows="10">Freight for Chainwire Fencing - overall height 2101mm to 2400mm - all materials - per 100m of fencing per km travelled</textarea>
<br><br><a style="height:auto;" class="pointer" onmouseup="setCosttoInv('14','0.475')">Inventory Cost: $0.48</a>
<br>Weight: 0 KG<hr>
<div class='form-group'>
<label>Notes:</label>
<textarea name=itemnotes[] class='form-control'></textarea>
</div>
<div class='form-group'>
<label>Tab:</label>
<select name="sectionId[]" class='form-control'>
<option value="0">Unassigned</option><option value="413" >1. FENCE</option><option value="414" selected>2. INSTALLATION</option><option value="415" >3. GATES</option> </select>
</div>
<div class='form-group'>
<label>Supplier Code:</label>
<select name="supplier[]" ID="supplier14" class='form-control'>
<option value="0">N/A</option> <option value="297" >FREIGHT/CW/2101-2400 Fencetech Australia Pty Ltd t/a Otter Fencing 0.38</option> </select>
</div>
<font style="color:red" ID="warning14"></font><div class="col for_review">
<label><input type="checkbox" class="for_review_checkbox" style="float: left;" data-quoteitemid="7486" /><input type="hidden" name="for_review[]" value="0" /><span style="display:inline-block;margin-left:5px;"> Mark this item for review </span></label>
</div><br>
<span class='pointer'
onclick="getUOM('3207','14');">
Manage Unit of Measure
<i class="material-symbols-rounded" >ad_units</i>
</span><div class="custom-fields custom-field7486"></div></div><div id='pdfiles14' class='menupd' style='display:none;'><div class='sidebar-attachedment-container'>
<div class="h4 mb-3 mt-3 text-start">File Upload
<div id="sidebarDropboxBtnContainer" class="d-inline"><!--Do not delete this part, this is for dropbox button--></div>
<div id="mfilesBtnContainer" class="d-inline"><!--Do not delete this part, this is for mfiles button--></div>
</div>
<div class="row">
<div class="col">
<div data-action="uploadsave.php"
data-cat="Select"
data-sourceid="7486"
data-sourcemodule="6"
data-subtype="quoteitem"
data-quote="2266"
class="sdropzone border border-2 p-3 mb-2 dropzone_quoteitem"
id="quoteitem_dropzone_14" >
<!--
<input type='hidden' name='category' value="Select">
<input type='hidden' name='sourceid' id="sourceid" value="">
<input type='hidden' name='sourcemodule' value="">
<input type='hidden' name='subtype' value="">
-->
<div class="mb-1">
<div class="dz-message" data-dz-message>
<div class="h5">Drag and Drop to upload files or click here</div>
<p>Files uploaded here will not be placed in a category. To upload files into specific categories use the "+" icon above</p>
</div>
</div>
</div>
</div>
</div>

<div> <table class="upload-card w-100" data-category="$row->category" id="file_card_">
<tbody class="uploadedFiles">
</tbody>
</table>
</div></div></div></div></td></tr><tr data-kits-separated='0' class='quoteitemrow15 415 Quotation_Inclusion ' style="display:;color:black" ID="15" >
<td style="cursor:move;" class="draggable" draggable=true>
<a onclick="editInvItem(3144);this.form.submit();">SAWSPEARDBLGATE4.5m</a>
<input type=hidden name='inventoryid[]' value='3144'>
<input type=hidden name='rowId[]' value='15'>
<input type=hidden name='sectionName[]' value='3. GATES'>
<input type=hidden name='parent[]' ID='qParent15' value='0'>
<input type='hidden' ID='itaxName15' name='itaxName[]' value='GST'>
<input type='hidden' ID='itaxValue15' name='itaxValue[]' value='10' autocomplete='off'>
<input type=hidden name='deleteInvItem[]' ID='deleteInvItem15' value='0'>
<textarea style='display:none' name='bom[]' ID='bom15'></textarea>
<input type=hidden name='quoteitemid[]' ID='qItemId15' value='7485'>
<input type=hidden name='extra[]' ID='extra15' value=''>
<input type=hidden name='weight[]' ID='weight15' value='0'>
<input type=hidden id='parentid15' value='0'>
<input type=hidden id='referenceid15' value='7485'>
<input type=hidden id='contractid15' name='contractid[]' value='0'>
<input type=hidden id='contractsiteid15' name='contractsiteid[]' value='0'>
</td>
<td>
<div class='expandingArea'>
<pre><span></span><br></pre>
<textarea class=""
name='itemdescription[]'
id='desc15'
onchange="toggleClass('unsaved','1')" style='color:black;'>SA Water Spear Top - Double Gate Leaf - 4.5m opening - supplied and installed</textarea>
</div>
</td>
<td class="costplus currency">
<input type="text" name='itemcost[]' ID='itemcost15' value='5254.0990'
class='datainput' data-invcost = '5266.5122' onchange="updateRow(15, 1, 'itemCost');" autocomplete='off' style='color:black;'>
</td>
<td class="discount currency">
<input type='text' name='itemprice[]' ID='itemprice15' value='6987.9500'
class='datainput' onkeydown='' onchange="updateRow(15, 1, 'itemPrice');" autocomplete='off' style='color:black;'>
</td>
<td style="width:100px">
<input type='text' name='itemqty[]' ID='qty15' value='1.00'
style="width:100%; color:black;" class="datainput" onchange="updateRow(15, 1, 'itemQty');" autocomplete='off'>
</td>
<td class="costplus d-none" ID="linecost15" style='color:black;'>
$5,254.10
</td>
<td >
<input type='text' name='itemdiscount[]' ID='discount15'
value='33' class='datainput' onblur="updateRow(15, 1, 'itemDisc');" style='color:black;'>
</td>
<td class="currency">
<input type='text'
name='adjPrice[]'
ID='adjPrice15'
value='6987.9518'
size='4'
class='datainput Quotation_Inclusion'
onkeydown=''
onchange="updateRow(15, 1, 'adjPrice');"
autocomplete='off' style='color:black;'>
</td>
<td style="width:100px">
<input type='hidden' ID='itaxAmount15' class='datainput' name='itaxAmount[]' newval='698.7952'
value='698.7952' autocomplete='off'>
<div ID='itaxAmountText15'>698.7952</div>
</td>
<td ID='subTotal15' style="width:100px" data-itemtotal=\'6987.95" data-total="6987.95">6987.95</td>
<td class="pe-2" style="width:90px"><div ID='actionIcon[]' class="actionIcon15 text-end" style="width:auto;float:right;display:inline-block;position:relative"><span class=" float-right material-symbols-rounded pointer" onclick='hideRows(15);' ID='delIcon15' >delete</span>
<span class='float-right' class='morebtn' data-id='7485' href="#" onclick="hideAll();document.getElementById('moreItem15').classList.toggle('popupDivFade'); return false;" style='cursor:pointer;'>
<i class="material-symbols-rounded" dataclass="morebtn" ID="more15" data-quote='2266' data-id='7485' data-cat='24' style="color:">more_vert</i>
</span></div>
<div id="moreItem15" class="popupDiv quoteItemMore">
<div class='popupDivHeader container-fluid'>
<div class='row'>
<div class='col h3'>
ADVANCED SAWSPEARDBLGATE4.5m
</div>
<div class='col-1'>
<a style='float:right' onclick="hideAll(); quoteAutosave();";>
<i class="material-symbols-rounded">close</i></a>
</div>
</div>
</div>
<div class='navbar-collapse d-flex mt-3' id='navbarNavPopupDiv15'><ul class='navbar-nav' style='flex-direction:row;'><li class='nav-item active'><a class='smpd pointer nav-link' id='smpdpddetails15' onclick="quoteItemTab('15','pddetails');" style='text-decoration:underline;color:var(--main-selected-color);'>Details</a></li><li class='nav-item' style='margin-left:-1px;'><a class='smpd pointer nav-link' id='smpdpdfiles15' onclick="quoteItemTab('15','pdfiles');" style='text-decoration:none;'>Files</a></li></ul></div><div id='pddetails15' class='menupd'><textarea class='form-control' rows="10">SA Water Spear Top - Double Gate Leaf - 4.5m opening - supplied and installed</textarea>
<br><br><a style="height:auto;" class="pointer" onmouseup="setCosttoInv('15','5266.5122')">Inventory Cost: $5,266.51</a>
<br>Weight: 0 KG<hr>
<div class='form-group'>
<label>Notes:</label>
<textarea name=itemnotes[] class='form-control'></textarea>
</div>
<div class='form-group'>
<label>Tab:</label>
<select name="sectionId[]" class='form-control'>
<option value="0">Unassigned</option><option value="413" >1. FENCE</option><option value="414" >2. INSTALLATION</option><option value="415" selected>3. GATES</option> </select>
</div>
<div class='form-group'>
<label>Supplier Code:</label>
<select name="supplier[]" ID="supplier15" class='form-control'>
<option value="0">N/A</option> </select>
</div>
<font style="color:red" ID="warning15"></font><div class="col for_review">
<label><input type="checkbox" class="for_review_checkbox" style="float: left;" data-quoteitemid="7485" /><input type="hidden" name="for_review[]" value="0" /><span style="display:inline-block;margin-left:5px;"> Mark this item for review </span></label>
</div><br>
<span class='pointer'
onclick="getUOM('3144','15');">
Manage Unit of Measure
<i class="material-symbols-rounded" >ad_units</i>
</span><div class="custom-fields custom-field7485"></div></div><div id='pdfiles15' class='menupd' style='display:none;'><div class='sidebar-attachedment-container'>
<div class="h4 mb-3 mt-3 text-start">File Upload
<div id="sidebarDropboxBtnContainer" class="d-inline"><!--Do not delete this part, this is for dropbox button--></div>
<div id="mfilesBtnContainer" class="d-inline"><!--Do not delete this part, this is for mfiles button--></div>
</div>
<div class="row">
<div class="col">
<div data-action="uploadsave.php"
data-cat="Select"
data-sourceid="7485"
data-sourcemodule="6"
data-subtype="quoteitem"
data-quote="2266"
class="sdropzone border border-2 p-3 mb-2 dropzone_quoteitem"
id="quoteitem_dropzone_15" >
<!--
<input type='hidden' name='category' value="Select">
<input type='hidden' name='sourceid' id="sourceid" value="">
<input type='hidden' name='sourcemodule' value="">
<input type='hidden' name='subtype' value="">
-->
<div class="mb-1">
<div class="dz-message" data-dz-message>
<div class="h5">Drag and Drop to upload files or click here</div>
<p>Files uploaded here will not be placed in a category. To upload files into specific categories use the "+" icon above</p>
</div>
</div>
</div>
</div>
</div>

<div> <table class="upload-card w-100" data-category="$row->category" id="file_card_">
<tbody class="uploadedFiles">
</tbody>
</table>
</div></div></div></div></td></tr> </tbody>
</table>
</div>
</div>
</fieldset>
<div class="custom-modals-container">
</div>
<table style='width:100%;'>
<tr class='nope'>
<td colspan='7'>
<div class="container-fluid">
<div class="row" ID="sectionList" style="min-height:50px;">
<div class="col-1">
TABS
<i class="material-symbols-rounded pointer" ID='manageSections'>add_circle_outline</i>
</div>
<div style='border:1px solid black;background-color: lightgrey;' ID='secall' class='pointer taball col-1' onclick='sectionFilter("all","all","dataTable");'>ALL
</div>

<div class='col-1 p-2
sectionCount tab413'
style="border:1px solid black">

<a class="pointer tab_navigation"
data-id="413"
data-name="1. FENCE"
ID='sec413'
title="1. FENCE">1. FENCE</a>

<a class='tab_edit pointer'
data-id="413"
data-name="1. FENCE"
data-notes="&lt;p&gt;Approximately 69m of 2400H Spear Top Fence - TS0121&lt;/p&gt;
&lt;p&gt;550mm Razor Wire Flat Loops - Approximately 3m&lt;/p&gt;"
data-type="Quotation Inclusion"
class="pointer"
onmouseup="sectionShowEdit(this.getAttribute('data-id'),this.getAttribute('data-name'),this.getAttribute('data-notes'),this.getAttribute('data-type'));">
<b><i class="material-symbols-rounded">more_vert</i></b></a>
</div><div class='col-1 p-2
sectionCount tab414'
style="border:1px solid black">

<a class="pointer tab_navigation"
data-id="414"
data-name="2. INSTALLATION"
ID='sec414'
title="2. INSTALLATION">2. INSTALLAT</a>

<a class='tab_edit pointer'
data-id="414"
data-name="2. INSTALLATION"
data-notes="&lt;p&gt;2 People x 2 Days Allowed&lt;/p&gt;"
data-type="Quotation Inclusion"
class="pointer"
onmouseup="sectionShowEdit(this.getAttribute('data-id'),this.getAttribute('data-name'),this.getAttribute('data-notes'),this.getAttribute('data-type'));">
<b><i class="material-symbols-rounded">more_vert</i></b></a>
</div><div class='col-1 p-2
sectionCount tab415'
style="border:1px solid black">

<a class="pointer tab_navigation"
data-id="415"
data-name="3. GATES"
ID='sec415'
title="3. GATES">3. GATES</a>

<a class='tab_edit pointer'
data-id="415"
data-name="3. GATES"
data-notes="&lt;p&gt;3x 4m Double Gate&lt;/p&gt;"
data-type="Quotation Inclusion"
class="pointer"
onmouseup="sectionShowEdit(this.getAttribute('data-id'),this.getAttribute('data-name'),this.getAttribute('data-notes'),this.getAttribute('data-type'));">
<b><i class="material-symbols-rounded">more_vert</i></b></a>
</div><script>
var sectionObj=new Object();
sectionObj[0]={id:'0',name:'ALL'};sectionObj[1]={id:'413',name:"1. FENCE"};sectionObj[2]={id:'414',name:"2. INSTALLATION"};sectionObj[3]={id:'415',name:"3. GATES"};sectionObj.length='4';
</script><div style='display:table-cell;border:1px solid black;'
ID="secunassigned"
class='pointer tab0 col-1 p-1'
onclick='sectionFilter("0","unassigned","dataTable");'>UNASSIGNED</div></div>
</div>
</div></td>
</tr><tr>
<td width='50%' style='background:#FFF;'>
<div style="width:100%;text-align:left;padding-left:94px;margin-bottom:10px;">
<input onchange="doNotice ('Dragging an item to a tab will <b class=\'text-danger\'>' + (this.checked ? 'also include' : ' not include') + '</b> any child/kit items from being moved.' + (this.checked ? '' : '<br><br>The kit items can be dragged separately into a different tab.'), 5000);" type="checkbox" class="form-check pointer d-inline align-bottom" id="dragKitIncluded" checked title="When this is unchecked, dragging the main / kit item to a section/tab moves only the parent / kit item being moved."><label for="dragKitIncluded" class="pointer" title="When this is unchecked, dragging the main / kit item to a section/tab moves only the parent / kit item being moved.">&nbsp;&nbsp;Group Kit Items with main item</label>
</div><script>
var climit='0';
var balance=0;
</script>
<div style='float:auto'>Customer Balance: $0 - Customer Credit Limit: Unlimited</div></td>
<td align='right'></td>
<td width='10%'></td>
<td width='2.5%' align='right' nowrap></td>
</tr>
</table> <div class="parent-container">
<div class="row">
<div class="d-none d-sm-none d-md-block col-md-7 text-start">
<br><div class="h4 text-uppercase">Total Weight: 2.708 KG</div><div id="historyDiv" class="mt-4">

<div class="jumbotron text-start">
<div class="display-6 m-2">HISTORY</div>
<hr>
<div class="table-responsive" style="max-height:250px; min-height:250px">
<div class="container-fluid" ID="global_history_list">

<div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 12:50 PM </div>
<div class="col">Evolution Support</div>
<div class="col-6">Required by changed from '0000-00-00' to '(blank)' </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 12:50 PM </div>
<div class="col">Evolution Support</div>
<div class="col-6">Save Quote 43460.6 </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 12:50 PM </div>
<div class="col">Evolution Support</div>
<div class="col-6">DELETED ITEM 7504 Concrete reinforcing - Square Mesh - (S) (qty 1 @ 262.5) </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 12:26 PM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">Quote manually marked as Sent from the opportunity screen </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 11:56 AM </div>
<div class="col">Shane Cosgrove</div>
<div class="col-6">Required by changed from '0000-00-00' to '(blank)' </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 11:56 AM </div>
<div class="col">Shane Cosgrove</div>
<div class="col-6">Save Quote 43460.6 </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 11:56 AM </div>
<div class="col">Shane Cosgrove</div>
<div class="col-6">DELETED ITEM 7503 Concrete reinforcing - Square Mesh - (S) (qty 1 @ 262.5) </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 11:51 AM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">QUOTE 2266 PRINTED 11-08-2026 </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 11:32 AM </div>
<div class="col">Edward Walton</div>
<div class="col-6">ITEM 7501: Discount 25 > 24.7059 </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 11:32 AM </div>
<div class="col">Edward Walton</div>
<div class="col-6">ITEM 7499: Discount 25 > 25.0001 </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 11:32 AM </div>
<div class="col">Edward Walton</div>
<div class="col-6">Required by changed from '0000-00-00' to '(blank)' </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 11:32 AM </div>
<div class="col">Edward Walton</div>
<div class="col-6">Save Quote 43198.1 </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 11:32 AM </div>
<div class="col">Edward Walton</div>
<div class="col-6">ITEM 7501: Cost 0.2205 > 0.221 </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 11:31 AM </div>
<div class="col">Edward Walton</div>
<div class="col-6">Required by changed from '0000-00-00' to '(blank)' </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 11:31 AM </div>
<div class="col">Edward Walton</div>
<div class="col-6">Save Quote 43168.58 </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 11:31 AM </div>
<div class="col">Edward Walton</div>
<div class="col-6">DELETED ITEM 7498 Razor rings clipped to 100m of chainwire (qty 1 @ 395.7625) </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 11:22 AM </div>
<div class="col">Bessie McInnes</div>
<div class="col-6">Required by changed from '0000-00-00' to '(blank)' </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 11:22 AM </div>
<div class="col">Bessie McInnes</div>
<div class="col-6">Save Quote 43152.96 </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 11:22 AM </div>
<div class="col">Bessie McInnes</div>
<div class="col-6">DELETED ITEM 7495 Freight for Chainwire Fencing - overall (qty 49 @ 0.5938) </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 11:22 AM </div>
<div class="col">Bessie McInnes</div>
<div class="col-6">DELETED ITEM 7497 FREIGHT (qty 29 @ 1.25) </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 11:11 AM </div>
<div class="col">Peter Spooner</div>
<div class="col-6">Required by changed from '0000-00-00' to '(blank)' </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 11:11 AM </div>
<div class="col">Peter Spooner</div>
<div class="col-6">Save Quote 43152.96 </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 11:11 AM </div>
<div class="col">Peter Spooner</div>
<div class="col-6">ITEM 7486: Discount 25 > 25.0105 </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 11:11 AM </div>
<div class="col">Peter Spooner</div>
<div class="col-6">DELETED ITEM 7495 Freight for Chainwire Fencing - overall (qty 49 @ 0.5938) </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 10:45 AM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">QUOTE 2266 PRINTED 11-08-2026 </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 10:12 AM </div>
<div class="col">Peter Spooner</div>
<div class="col-6">Required by changed from '0000-00-00' to '(blank)' </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 10:12 AM </div>
<div class="col">Peter Spooner</div>
<div class="col-6">Save Quote 43152.96 </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 09:55 AM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">Required by changed from '0000-00-00' to '(blank)' </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 09:55 AM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">Save Quote 43123.86 </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 09:55 AM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">ITEM 7482: Qty 35.00 > 36 </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 09:55 AM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">ITEM 7481: Qty 40.00 > 35 </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 09:55 AM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">ITEM 7485: Cost 5254.0991 > 5254.099 </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 09:53 AM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">SECTION 413: Section notes changed from '<p>Approximately 80.7m of 2400H Spear Top Fence - TS0121</p </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 08:45 AM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">Required by changed from '0000-00-00' to '(blank)' </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 08:45 AM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">Save Quote 39316.01 </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 08:45 AM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">ITEM 7482: Qty 41.00 > 35 </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 08:45 AM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">ITEM 7483: Discount 33 > 33.5484 </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 08:44 AM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">Required by changed from '0000-00-00' to '(blank)' </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 08:44 AM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">Save Quote 40076.47 </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 08:44 AM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">ITEM 7483: Cost 0.0934 > 0.093 </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 08:36 AM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">Required by changed from '0000-00-00' to '(blank)' </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 08:36 AM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">Save Quote 36785.05 </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 08:35 AM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">Required by changed from '0000-00-00' to '(blank)' </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 08:35 AM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">Save Quote 31588.56 </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 08:31 AM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">SECTION 415: Section notes changed from '(blank)' to '<p>3x 4m Double Gate</p>' </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 08:31 AM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">SECTION 415: Section name changed from 'NEW TAB 3' to '3. GATES' </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 08:30 AM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">SECTION ADDED NEW TAB 3 (415) </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 08:27 AM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">SECTION 414: Section notes changed from '(blank)' to '<p>2 People x 2 Days Allowed</p>' </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 08:27 AM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">SECTION 414: Section name changed from 'NEW TAB 2' to '2. INSTALLATION' </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 08:27 AM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">SECTION ADDED NEW TAB 2 (414) </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 08:27 AM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">SECTION 413: Section notes changed from '<p>Approximately 80.7m of 2400H Spear Top Fence - TS0121</p </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 08:26 AM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">SECTION 413: Section notes changed from '(blank)' to '<p>Approximately 80.7m of 2400H Spear Top Fenc </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 08:26 AM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">SECTION 413: Section name changed from 'NEW TAB 1' to '1. FENCE' </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 08:23 AM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">SECTION ADDED NEW TAB 1 (413) </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 08:09 AM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">Cost Plus ENABLED </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 08:09 AM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">Cost Plus / markup changed from '0' to '1' </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 08:09 AM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">Required by changed from '0000-00-00' to '(blank)' </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">13-08-2026 08:09 AM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">Save Quote 0 </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">11-08-2026 12:28 PM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">Branch changed from '0' to '1' </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">11-08-2026 12:28 PM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">Quote type changed from '0' to '3' </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">11-08-2026 12:28 PM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">Required by changed from '0000-00-00' to '(blank)' </div>
</div><div class="row" onmouseout="this.style.background = '';" onmouseover="this.style.background = 'lightgray';">
<div class="col">11-08-2026 12:28 PM </div>
<div class="col">Maria Colorado</div>
<div class="col-6">Save Quote 0 </div>
</div></div>
</div>
</div></div> <br>
</div>
<div class="col-md-5 col-sm-12 col-xs-12">
<div class="container text-start" ID="quoteValueSummary">
<div style="height:40px" class="row justify-content-end">
<div class="col border ">Cost </div>
<div class="col border quoteCost">$32,688.39</div>
</div>
<div style="height:40px" class="row justify-content-end">
<div class="col border ">Margin</div>
<div class="col border quoteMargin" ID="margin">$10,772.22</div>
</div>
<div style="height:40px" class="row justify-content-end">
<div class="col border ">GP</div>
<div class="col border quoteGP" ID="gp">
N/A </div>
</div>
<div style="height:40px" class="row justify-content-end">
<div class="col border boldText2">Total</div>
<div class="col border boldText2 quoteTotal">$43,460.60</div>
</div>
<div style="height:40px" class="row justify-content-end">
<div class="col border boldText2">Tax</div>
<div class="col border boldText2 quoteTax">$0.00</div>
</div>
<div style="height:40px" class="row justify-content-end" style="border-top:2px solid black;">
<div class="col border boldText2">Total <sup>(Inc. Tax)</sup></div>
<div ID="quoteTotalInc" class="col border boldText2 quoteTotalInc">$43,460.60</div>
</div>
<br>
<hr>
<div style="height:40px" class="row justify-content-end">
<div class="col border boldText2">Inclusions <sup>(Exc. Tax)</sup></div>
<div class="col border boldText2 quoteInclusionsTotal">$0.00</div>
</div>
<div style="height:40px" class="row justify-content-end">
<div class="col border boldText2">Options <sup>(Exc. Tax)</sup></div>
<div class="col border boldText2 quoteOptionsTotal">$0.00</div>
</div>
<div style="height:40px" class="row">
</div>
</div>

</div>
</div>
<div class="row">
<div class="d-none d-sm-none d-md-block col-md-6 text-start">
<div class='col fs-4 fw-bold pointer text-center' data-bs-toggle="modal" data-bs-target="#pricingSummaryModal">PRICE ANALYSIS</div>
</div>
<div class="col-md-3 col-sm-12 col-xs-12">
<input type="hidden" ID="quoteCostVal" value="32688.385">
<input type="hidden" ID="quoteTotalTally" value="43460.6">
<input type="hidden" ID="quoteTotalVal" value="0">
<div ID='misc'></div>
<input type="hidden" value="Toggle Scrollbars" onclick="toggleTable();">
</div>
<div class="col-md-3 col-sm-12 col-xs-12">
<INPUT class='form-control'
type="button"
value="Show Deleted"
onclick="showDeletedRows()"
ID='delToggleButton'
name='delToggleButton'>
<input name='delToggle
'type='hidden'
ID='delToggle'
value='1'> </div>
</div>
</form>
<br>
<hr>
<div class="row">
<div class="d-none d-sm-none d-md-block col-md text-start">
<div class="card" style="min-height:300px">
<div class="card-title bg-secondary p-2">
<div class="row">
<div class="col text-light h2 text-start">Notes</div>
<div class="col text-end">
<a data-bs-toggle="modal" data-bs-target="#addNoteModal" href="#"><i class="material-symbols-rounded text-light">add_circle_outline</i></a>
</div>
</div>
</div>
<div class="card-body">
<div class="table-responsive" style="max-height:300px">
<table class="table">
<thead>
<tr>
<th>Date</th>
<th>Category</th>
<th style="width:60%">Note</th>
<th>Staff</th>
<th></th>
</tr><tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>



<style>
.pac-container {
z-index: 10000 !important;
}
</style>
<div class="modal fade" id="addNoteModal" tabindex="-1" role="dialog" aria-labelledby="addNoteModalLabel" aria-hidden="true">
<div class="modal-dialog modal-md" role="document">
<div class="modal-content">
<div class="modal-header">
<div ID="addNoteModalTitle" class="h2">New Note</div>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" ID="addNoteModalBody">

<form method="post" name="notesForm" action="notesave.php">


<input type="hidden" name="noteclientid" value=>
<input type="hidden" name="notesupplierid" value="">
<input type="hidden" name="noteowner" value="2266">
<input type="hidden" name="notetype" value="Quote">
<input type="hidden" name="notereferer" value="index.php?page=quotedit&quoteid=2266">

<div class="container text-start">

<div class="form-group">
<label>Category:</label>
<select name="category" class="form-control">
<option>Accounts</option>
<option>Delivery</option>
<option selected>General</option>
<option>Manufacturing</option>
<option>Service</option>
</select>
</div>
<div class="form-group">
<label>Note</label>
<textarea name="note" rows="14" cols="100" class="form-control"> </textarea>
</div>


<div ID="followup" class = "alert bg-light followup" sstyle="display:none">
<h4>Set a Follow Up Task</h4>
<div class="form-group">
<select name="followup_type" ID="followup_type" class="form-control" onchange='followup(this.value)'>
<option>Not Required</option>
<option>Call</option>
<option style="display:none">General</option>
<option style="display:none">Meet</option>
<option>Task</option>
</select>
</div>
<div class="form-group followup_detail" style="display:none">
<label for="start-date" class=" ">Follow Up Time</label>
<select name="followup_time" ID="followup_time" class="form-control" onchange="console.log($(this).parent().parent().find('.followup_date').val(this.value)); " sonchange='followup_date_set($(this).parent().parent());'>
<option>Please Select</option>
<option value="2026-08-14">1 Day</option>
<option value="2026-08-20">1 Week</option>
<option value="2026-09-13">1 Month</option>
<option selected>Pick a Date</option>
</select>
</div>
<div class="form-group followup_detail" style="display:none">
<label for="start-date" class=" ">Follow Up Time</label>
<input type = "date" name = "followup_date" class="form-control followup_date">
</div>
</div>
<script>

function followup(val = null){
if(val == 'Not Required'){
toggleClass("followup_detail",'0');
} else toggleClass("followup_detail",'1');
}

function followup_date_set(date = null){
console.log(date);
var top = date.querySelector('.followup_date');

console.log(top);
//$('#followup_date').val(date);
}

</script>
<div class="form-group">
<input type="submit" class='form-control' name="addNote" value="Add Note">
</div>

</div>

</form>

</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
</div>
<div class="col-md">
<div class="card" style="min-height:300px">
<div class="card-title bg-secondary p-2">
<div class="row">
<div class="col text-light h2 text-start">Tasks</div>
<div class="col text-end">
<a data-bs-toggle="modal" data-bs-target="#addTaskModal" href="#"><i class="material-symbols-rounded text-light">add_circle_outline</i></a>
</div>
</div>
</div>
<div class="card-body">
<div class="table-responsive" style="max-height:300px">
<table class="table">
<thead>
<tr>
<th style="width:20px;"></th>
<th style="width: 50%;">Title</th>
<th>Assigned To</th>
<th>Due</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="assets/jscripts/dropzone/min/dropzone.min.js"></script>
<link rel="stylesheet" href="assets/jscripts/dropzone/min/dropzone.min.css">
<style>
.pac-container {
z-index: 10000 !important;
}
</style>
<div class="modal fade" id="aImportFileModal" tabindex="-1" role="dialog" aria-labelledby="aImportFileModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<div ID="aImportFileModalTitle" class="h2">IMPORT EXISTING FILE</div>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body text-left" ID="aImportFileModalBody">
<div class="row" id="aifBody">
<div class="col-12">
<div class="alert aifAlert d-none mt-2"></div>
</div>
<div class="col-md-6 col-12 mt-2">
<label class="form-label">Keyword</label>
<input type="text" class="form-control" id="aifKeyword" placeholder="File name or description">
</div>
<div class="col-md-3 col-6 mt-2">
<label class="form-label">Object Type</label>
<select class="form-select" id="aifSubtype">
<option value="">All</option>
<option value="Delivery Docket">Delivery Docket</option>
<option value="fsinstruction">Fsinstruction</option>
<option value="importer">Importer</option>
<option value="inventory">Inventory</option>
<option value="Inventory Attribute File">Inventory Attribute File</option>
<option value="Invoice">Invoice</option>
<option value="Job">Job</option>
<option value="Opportunity">Opportunity</option>
<option value="Other">Other</option>
<option value="Picking Slip">Picking Slip</option>
<option value="Please Select">Please Select</option>
<option value="Pricing File">Pricing File</option>
<option value="Production Order">Production Order</option>
<option value="Purchase">Purchase</option>
<option value="Quote">Quote</option>
<option value="quoteType">QuoteType</option>
<option value="Shop Order">Shop Order</option>
<option value="Staff Qualifications">Staff Qualifications</option>
</select>
</div>
<div class="col-md-3 col-6 mt-2">
<label class="form-label">Object #</label>
<input type="number" class="form-control" id="aifSourceId" placeholder="e.g. 7444" min="0">
</div>
<div class="col-12 mt-2 text-end">
<button type="button" class="btn btn-secondary" id="aifClearBtn">Clear</button>
<button type="button" class="btn btn-primary" id="aifSearchBtn">Search</button>
</div>
<div class="col-12 mt-3">
<div class="aifResults table-responsive" style="max-height:50vh;overflow:auto;">
<p class="text-muted m-0">Enter a keyword or filter and click Search.</p>
</div>
</div>
</div>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
<!--
<script src="assets/jscripts/dropzone/min/dropzone.min.js"></script>
<link rel="stylesheet" href="assets/jscripts/dropzone/min/dropzone.min.css">
-->

<!-- //################# HIDDEN DIV PRINT ##################//-->
<div ID='attachment' class="popupDiv container-fluid text-start">
<div class="row p-4">
<div class="col h2">FILE ATTACHMENTS</div>
<div class="col">
<a class="pointer" style='float:right' onclick="hideAll()">
<i class="material-symbols-rounded">close</i>
</a>
</div>
</div>
<input type='hidden' name='ajax' value="1">
<div class="form-group ">
<select name='category' class="form-control required" id="uploadcat">
<option>Select</option>
<option value='5'>Customer Documents</option><option value='3'>Product Uploads</option><option value='4'>Project Photos and Files</option><option value='2'>Shop Drawings</option><option value='6'>Tender Documents</option><option value='7'>Tender Schedules</option> </select>
</div>

<div class="row">
<div class="col">

<form action="uploadsave.php" class="dropzone" id="my-awesome-dropzone">
<input type='hidden' name='sourceid' id="sourceid" value="2266">
<input type='hidden' name='sourcemodule' value="6">
<input type='hidden' name='subtype' value="quote">
<div class="form-group">
<div class="dz-message" data-dz-message>
<div class="h5">Drag and Drop to upload files or click here</div>
<p>Files uploaded here will not be placed in a category. To upload files into specific categories use the "+" icon above</p>
</div>
<div class="fallback" style="position:relative">
<input name="source[]" type="file" multiple />
</div>
</div>
</form>

<br>
<hr>
<table class="table table-hover table-sm">
<thead class="thead-dark">
<tr>
<th>Name</th>
<th>Cat</th>
<th>Source</th>
<th>Date</th>
<th></th>
</tr>
</thead>
<tbody ID="uploadedFiles" class="uploadedFiles">

<h3>EXISTING FILES</h3><tr CLASS="file_1345">
<td> <a href='download.php?id=1345' target='_blank' title="16009_PAEC FENCING_REV C_2017-03-01.pdf">16009_PAEC FENCING_REV C_2017-03-01.pdf</a></td>
<td> <a href='download.php?id=1345' target='_blank' title="N/A">N/A</a></td>
<td> <a href='download.php?id=1345' target='_blank'>opportunity</a></td>
<td>11-08-2026 07:37 AM</td>
<td><a href="#" onmouseup="deleteFile(1345);"><i class="material-symbols-rounded">delete</i></a></td>
</tr><tr CLASS="file_1344">
<td> <a href='download.php?id=1344' target='_blank' title="Carlisle Pump Station fencing GA diagram 2026.pdf">Carlisle Pump Station fencing GA diagram 2026.pdf</a></td>
<td> <a href='download.php?id=1344' target='_blank' title="N/A">N/A</a></td>
<td> <a href='download.php?id=1344' target='_blank'>opportunity</a></td>
<td>11-08-2026 07:37 AM</td>
<td><a href="#" onmouseup="deleteFile(1344);"><i class="material-symbols-rounded">delete</i></a></td>
</tr><tr CLASS="file_1346">
<td> <a href='download.php?id=1346' target='_blank' title="FW_ Quote, fence replacement Carlisle St Pump station.eml">FW_ Quote, fence replacement Carlisle St Pump stat</a></td>
<td> <a href='download.php?id=1346' target='_blank' title="N/A">N/A</a></td>
<td> <a href='download.php?id=1346' target='_blank'>opportunity</a></td>
<td>11-08-2026 07:37 AM</td>
<td><a href="#" onmouseup="deleteFile(1346);"><i class="material-symbols-rounded">delete</i></a></td>
</tr><tr CLASS="file_1376">
<td> <a href='download.php?id=1376' target='_blank' title="Q2266-CityofPortAdelaide.pdf">Q2266-CityofPortAdelaide.pdf</a></td>
<td> <a href='download.php?id=1376' target='_blank' title="N/A">N/A</a></td>
<td> <a href='download.php?id=1376' target='_blank'>Quote</a></td>
<td>13-08-2026 11:51 AM</td>
<td><a href="#" onmouseup="deleteFile(1376);"><i class="material-symbols-rounded">delete</i></a></td>
</tr><tr CLASS="file_1374">
<td> <a href='download.php?id=1374' target='_blank' title="Q2266.pdf">Q2266.pdf</a></td>
<td> <a href='download.php?id=1374' target='_blank' title="N/A">N/A</a></td>
<td> <a href='download.php?id=1374' target='_blank'>Quote</a></td>
<td>13-08-2026 10:45 AM</td>
<td><a href="#" onmouseup="deleteFile(1374);"><i class="material-symbols-rounded">delete</i></a></td>
</tr> </tbody>
</table>
</div>
</div>

</div>
<script>
Dropzone.options.myAwesomeDropzone = {
parallelUploads: 6,
uploadMultiple: true,
paramName: "source", // The name that will be used to transfer the file
/*
accept: function(file, done) {
if (file.name == "justinbieber.jpg") {
done("Naha, you don't.");
}
else { done(); }
},
*/
sending: function(file, xhr, formData) {
formData.append("category", document.getElementById('uploadcat').value);
//formData.append("category", '0');
formData.append("pageupload", "1");
formData.append("ajax", "1");
//formData.append("source", "Asset 2266");
console.log(formData);
},
success: function(file, response) {
console.log(response);
},

complete: function(file) {
if (this.getUploadingFiles().length === 0 && this.getQueuedFiles().length === 0) {
window.location = "index.php?page=quotedit&quoteid=2266";
//console.log("Upload Complete");
}
}
};
</script><script>document.getElementById('main_content_div').appendChild(document.getElementById('attachment'));</script><style>
.bg_preview {
height:165px;
background-size: contain;
background-repeat: no-repeat;
background-position: 50% 0%;
text-align:center;
}

.subsection {
display:none;
width:100%;
}

#attachmentlist td {
padding-left: 10px;
}

#categorylist ul {
list-style-type: none;
}

#categorylist > ul {
margin: 0px;
padding: 0px;
}

#attachmentlistheader th {
vertical-align: top !important;
}

#categorylist .text-muted {
color: #BBB !important;
}

#categorylist li:has(.active) i,
#categorylist li:has(.active) {
color: darkgreen !important;
font-weight: bold;
}

.catdrag {
border: solid 1px white;
white-space: nowrap;
margin-right:10px;
}
.dropcon.highlight td {
background: lightgray !important;
}
.dropcon.highlight,
.catdrag.highlight {
border: solid 1px lightgray !important;
background: lightgray !important;
}

.catdrag.indent1 {
margin-left: 20px;
}

.catdrag.indent2 {
margin-left: 40px;
}

.catdrag.indent3 {
margin-left: 60px;
}

.catdrag.indent4 {
margin-left: 80px;
}

.catdrag.indent5 {
margin-left: 100px;
}

.catdrag.indent6 {
margin-left: 120px;
}

.catdrag.indent7 {
margin-left: 120px;
}

.catdrag.indent8 {
margin-left: 120px;
}

.catdrag.indent9 {
margin-left: 120px;
}

.catdrag.indent10 {
margin-left: 120px;
}

.dropcon.highlight:has(td) {
border: none !important;
}
.dropzone .dz-preview .dz-details .dz-filename:not(:hover) {
display: block !important;
padding-top: 10px !important;
}

.card-title .h5 {
font-size: 1rem;
}

.fileinfo {
font-size: 0.9rem;
}

.input-group:has(#attachmentfilter) {
width: 50% !important;
}

.attachmentslistviewx.compact .card-body,
.attachmentslistviewx.compact .card-footer {
display: none;
}

.attachmentslistviewx.compact .upload-card,
.attachmentslistviewx.compact .card {
height: 167px !important;
width: 167px !important;
min-height: auto !important;
}

.attachmentslistviewx .upload-card.col-xl-3,
.attachmentslistviewx .upload-card.col-lg-4,
.attachmentslistviewx .upload-card.col-md-6,
.attachmentslistviewx .upload-card.col-sm-12 {
width: 250px !important;
}

.attachmentslistviewx.compact .upload-card {
width: auto !important;
}

.athumbtext {
position: absolute;
bottom: 0px;
width: 100%;
overflow: hidden;
background: white;
opacity: 0.6;
max-height: 44px;
padding: 2px;
}

.attachmentslistviewx:not(.compact) .athumbtext {
display: none;
}

.attachmentslistviewx .card {
border-radius: 3px !important;
}

.catsettings {
display: none;
}

.catdrag:hover > .catsettings {
display: inline-block !important;
margin-left: 20px;
}

.catfolderadd {
display: none;
}

.catdrag:hover > .catfolderadd {
display: inline-block !important;
margin-left: 0px;
}

.attachmentslistviewx:not(.compact) #filelist .cardparent > .row,
.attachmentslistviewx:not(.compact) #filelist .attachmentsiconsview,
.attachmentslistviewx:not(.compact) #filelist .cardparent {
min-height: 550px;
min-height: auto;
}

.attachmentslistviewx:not(.compact) #filelist .cardparent > .row.empty {
min-height: calc(100vh - 300px);
}

.attachmentslistviewx.expand {
min-height: auto !important;
max-height: 999999px !important;
}

.attachmentslistviewx.compact #filelist .cardparent > .row,
.attachmentslistviewx.compact #filelist .attachmentsiconsview,
.attachmentslistviewx.compact #filelist .cardparent {
min-height: inherit;
}

.attachmentslistviewx:not(.compact) .upload-card {
min-height: fit-content;
height: auto !important;
}

.attachmentslistviewx .upload-card {
margin-bottom: 20px;
}
.attachmentslistviewx:not(.compact) .card {
height: inherit;
}

.attachmentslistviewx:not(.compact) .bg_preview {
min-height: 165px;
}

.attachmentslistviewx:not(.compact) .card-body {
min-height: 115px;
}

.attachmentslistviewx:not(.compact) .card-title > .row {
height: 3rem;
}

.attachmentslistviewx:not(.compact) .card-footer {
height: 3rem;
}

.folderuploader {
position: absolute;
top: 245px;
height: calc(100vh - 251px) !important;
width: calc(100vw - 454px) !important;
z-index: 1;
}

.compedit,
.compdel {
position: absolute;
top: 5px;
color: #fff;
border-radius: 50%;
padding: 2px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
text-shadow: none;
display: none;
}

.compedit {
right: 5px;
background: rgba(0, 0, 0, 0.65);
}

.compdel {
right: 40px;
background: rgba(180, 30, 30, 0.85);
}

.upload-card:hover .compedit,
.upload-card:hover .compdel {
display: inline-block;
}

#categorylist {
min-width: fit-content;
}

.dropcon:hover {
cursor: crosshair;
}

my-awesome-dropzone-full2 {
display: none !important;
}

.listdrag {
cursor: move;
}

.attachmentsiconsview {
max-height: calc(100vh - 180px);
overflow-y: scroll;
overflow-x: hidden;
}

</style>

<br>
<div class="display-6 mb-3 text-start d-none">File Upload <div id="dropboxBtnContainer" class="d-inline"><!--Do not delete this part, this is for dropbox button--></div><div id="mfilesBtnContainer" class="d-inline"><!--Do not delete this part, this is for mfiles button--></div></div>
<div class="row d-none">
<div class="col">

<form action="uploadsave.php" class="dropzone" id="my-awesome-dropzone-full">
<input type='hidden' name='category' value="Select">
<input type='hidden' name='sourceid' id="sourceid" value="2266">
<input type='hidden' name='sourcemodule' value="6">
<input type='hidden' name='subtype' value="quote">
<div class="form-group">
<div class="dz-message" data-dz-message>
<div class="h5">Drag and Drop to upload files or click here</div>
<p id="uploadcategoryname">Files uploaded here will not be placed in a category. To upload files into specific categories use the "+" icon above.</p>
</div>
<div class="fallback" style="position:relative">
<input name="source[]" type="file" multiple />
</div>
</div>
</form>
</div>
</div>

<hr class="d-none">


<div class="row text-start attachmentheader p-0 m-0">
<div class="col">
<div class="text-start text-uppercase display-6 mb-3">
<div class="row">
<div class="col-4 mt-1">
Attachments
<i class="attachmentviewicon material-symbols-rounded pointer attachmenticonview border border-dark" onmouseup="toggleAttachmentView('thumbnail');">view_cozy</i>
<i class="attachmentviewicon material-symbols-rounded pointer attachmentlistview" onmouseup="toggleAttachmentView('list');">list</i>
<i class="attachmentviewicon material-symbols-rounded pointer attachmentexpandview" onmouseup="toggleAttachmentView('expand');">expand_content</i>
<i data-bs-toggle="modal"
data-bs-target="#uploadAddModal"
class="pointer material-symbols-rounded d-none">add_circle_outline</i>
</div>
<div class="col-8 text-end">
<div class="input-group d-inline-flex">
<div class="input-group-text"><i class="material-symbols-rounded">search</i></div>
<input style="float:right;" id="attachmentfilter" class="form-control d-inline w-75" type="text" value="" placeholder="enter keyword to filter by filename / description / source / date" onkeyup="filterAttachments()">
</div>
<div class="input-group d-inline-flex w-auto compactcon mx-3">
<input class="form-check" type="checkbox" id="attachmentcompact" onchange="toggleattachmentcompact(this.checked);" style="transform:scale(1.25);" >
<label for="attachmentcompact" style="font-size:1rem;">
&nbsp;&nbsp;
Compact
</label>
</div>
<i class="material-symbols-rounded pointer attachmentdropzonetoggle" id="attachmentDropzoneToggle" style="vertical-align:unset;" onmouseup="toggleAttachmentDropzone();" title="Show or hide the upload area">cloud_upload</i>
<i class="material-symbols-rounded pointer addfilesicon" style="vertical-align:unset;" title="Click this to upload a file to this category">add_circle_outline</i>
<i class="material-symbols-rounded pointer importfilesicon" style="vertical-align:unset;" title="Click this to import an existing file to this category">download</i>
</div>
</div>
</div>
</div>

<div class="dropbox-attachment"></div>
<div class="mfiles-attachment"></div>
</div>
<div class="row attachmentslistviewx table-responsive d-none p-0 m-0" style="min-height:calc(100vh - 250px);xmax-height:calc(100vh - 270px);overflow:visible;opacity:0;">
<div class="col-auto" id="categorylist" style="overflow:visible;border-right:solid;text-align:left;">
</div>
<div class="col text-start dropcon" id="filelist" style="overflow:visible;">
<div id="attachmentMainDropzone" class="mb-3" style="display: block;">
<form action="uploadsave.php" class="dropzone w-100" id="my-awesome-dropzone-main" style="min-height:80px;border:2px dashed #bbb;background:#fafafa;">
<input type='hidden' name='sourceid' value="2266">
<input type='hidden' name='sourcemodule' value="6">
<input type='hidden' name='subtype' value="quote">
<div class="form-group m-0">
<div class="dz-message" data-dz-message>
<div class="h5 m-0">Click or drag and drop files here to upload</div>
<small class="text-muted">Files upload to the currently selected category.</small>
</div>
<div class="fallback" style="position:relative">
<input name="source[]" type="file" multiple />
</div>
</div>
</form>
</div>
<div class="d-block text-end mb-2 ">
<label for="attpagination">Go to page </label>
<i class="material-symbols-rounded pointer attachmentpageprev" onmouseup="attachmentPageStep(-1);" title="Previous page" style="vertical-align:middle;">chevron_left</i>
<select class="form-select d-inline w-auto" id="attpagination"></select>
<i class="material-symbols-rounded pointer attachmentpagenext" onmouseup="attachmentPageStep(1);" title="Next page" style="vertical-align:middle;">chevron_right</i>
&nbsp;&nbsp;
<label for="attpaginationcount">Items per page </label>
<select class="form-select d-inline w-auto" id="attpaginationcount">
<option>20</option>
<option>25</option>
<option>30</option>
</select>
</div>
<div class="attachmentsiconsview d-none">
<!-- HERE ARE THE FILES IN CARD FORMAT -->
<div ID="upload_cat_0" data-id="0" style="display:" class="cardparent dropcon" title="Click this to upload a file to this category" data-page="0">
<div class="h4 pt-4 cat_0">&nbsp;&nbsp;&nbsp;Uncategorized</div>
<div class="row p-3 justify-content-start cat_0" ID="upload_cat_row_0"> <div class="col-sm-12 col-md-6 col-lg-4 col-xl-3 upload-card " draggable="true" data-category="0" data-db="" id="file_card_1345">
<div pid="file_1345" class="card" style="min-width:150px">
<div class="card-img-top bg_preview align-middle"
style="background-image:url(assets/images/pdf.png);background-size:cover;">
<a class="pointer" onmouseup="downloadFile(1345, 'pdf', '')">
<span style="display:block;height:100%;width:100%"></span>
</a>
<div class="athumbtext">
16009_PAEC FENCING_REV C_2017-03-01.pdf </div>
<i class="material-symbols-rounded pointer compedit" onclick="editAttachment(3, this.parentNode.parentNode, 'upload', '1345');">edit</i>
<i class="material-symbols-rounded pointer compdel" onclick="deleteFile('1345', '');">delete</i>
</div>
<div class="card-body">
<div class="card-title pointer" data-bs-toggle="collapse" href="#upload_1345" role="button">
<div class="row">
<div class="col-10 h5 upload_label_1345">16009_PAEC FENCING_REV C_2017-03-01...</div>
<div class="col m-0 p-0 text-end"><i class="material-symbols-rounded">expand_more</i></div>
</div>
</div>
<div class="card-text">
<div class="collapse" ID="upload_1345">
<div class="form-group">
<label>Name</label>
<input class="form-control"
ID="name_1345" name="name_1345"
onchange="saveUpload('1345');"
type="text"
value="16009_PAEC FENCING_REV C_2017-03-01.pdf">
</div>
<div class="form-group">
<label>Category</label>
<select class="form-control" onchange="saveUpload('1345');" ID="cat_1345">
<option value="0">N/A</option>
<option value='5' >Customer Documents</option><option value='3' >Product Uploads</option><option value='4' >Project Photos and Files</option><option value='2' >Shop Drawings</option><option value='6' >Tender Documents</option><option value='7' >Tender Schedules</option> <option value="-1" >Recycle Bin</option>
</select>
</div>
<div class="form-group">
<label>Descripiton</label>
<textarea class="form-control"
ID="description_1345"
onchange="saveUpload('1345');">Upload opportunity-110</textarea>
</div>
</div>
<div class="row">
<div class="col">Type: <span class="fileinfo">PDF</span></div>
<div class="col-8">Source: <span class="fileinfo">Opportunity (110)</span>
</div>
</div>
</div>
</div>
<div class="card-footer" style="font-size:11px;">
<div class="row">
<div class="col p-0 m-0 text-nowrap">
&nbsp;
<small class="">
Update 11-08-2026 07:37 AM </small>
</div>
<div class="col-2 p-0 m-0 text-end">
<i class="pointer material-symbols-rounded" onclick="deleteFile('1345', '');">delete</i>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-12 col-md-6 col-lg-4 col-xl-3 upload-card " draggable="true" data-category="0" data-db="" id="file_card_1344">
<div pid="file_1344" class="card" style="min-width:150px">
<div class="card-img-top bg_preview align-middle"
style="background-image:url(assets/images/pdf.png);background-size:cover;">
<a class="pointer" onmouseup="downloadFile(1344, 'pdf', '')">
<span style="display:block;height:100%;width:100%"></span>
</a>
<div class="athumbtext">
Carlisle Pump Station fencing GA diagram 2026.pdf </div>
<i class="material-symbols-rounded pointer compedit" onclick="editAttachment(3, this.parentNode.parentNode, 'upload', '1344');">edit</i>
<i class="material-symbols-rounded pointer compdel" onclick="deleteFile('1344', '');">delete</i>
</div>
<div class="card-body">
<div class="card-title pointer" data-bs-toggle="collapse" href="#upload_1344" role="button">
<div class="row">
<div class="col-10 h5 upload_label_1344">Carlisle Pump Station fencing GA di...</div>
<div class="col m-0 p-0 text-end"><i class="material-symbols-rounded">expand_more</i></div>
</div>
</div>
<div class="card-text">
<div class="collapse" ID="upload_1344">
<div class="form-group">
<label>Name</label>
<input class="form-control"
ID="name_1344" name="name_1344"
onchange="saveUpload('1344');"
type="text"
value="Carlisle Pump Station fencing GA diagram 2026.pdf">
</div>
<div class="form-group">
<label>Category</label>
<select class="form-control" onchange="saveUpload('1344');" ID="cat_1344">
<option value="0">N/A</option>
<option value='5' >Customer Documents</option><option value='3' >Product Uploads</option><option value='4' >Project Photos and Files</option><option value='2' >Shop Drawings</option><option value='6' >Tender Documents</option><option value='7' >Tender Schedules</option> <option value="-1" >Recycle Bin</option>
</select>
</div>
<div class="form-group">
<label>Descripiton</label>
<textarea class="form-control"
ID="description_1344"
onchange="saveUpload('1344');">Upload opportunity-110</textarea>
</div>
</div>
<div class="row">
<div class="col">Type: <span class="fileinfo">PDF</span></div>
<div class="col-8">Source: <span class="fileinfo">Opportunity (110)</span>
</div>
</div>
</div>
</div>
<div class="card-footer" style="font-size:11px;">
<div class="row">
<div class="col p-0 m-0 text-nowrap">
&nbsp;
<small class="">
Update 11-08-2026 07:37 AM </small>
</div>
<div class="col-2 p-0 m-0 text-end">
<i class="pointer material-symbols-rounded" onclick="deleteFile('1344', '');">delete</i>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-12 col-md-6 col-lg-4 col-xl-3 upload-card " draggable="true" data-category="0" data-db="" id="file_card_1346">
<div pid="file_1346" class="card" style="min-width:150px">
<div class="card-img-top bg_preview align-middle"
style="background-image:url(assets/images/download.png);background-size:cover;">
<a class="pointer" onmouseup="downloadFile(1346, 'eml', '')">
<span style="display:block;height:100%;width:100%"></span>
</a>
<div class="athumbtext">
FW_ Quote, fence replacement Carlisle St Pump station.eml </div>
<i class="material-symbols-rounded pointer compedit" onclick="editAttachment(3, this.parentNode.parentNode, 'upload', '1346');">edit</i>
<i class="material-symbols-rounded pointer compdel" onclick="deleteFile('1346', '');">delete</i>
</div>
<div class="card-body">
<div class="card-title pointer" data-bs-toggle="collapse" href="#upload_1346" role="button">
<div class="row">
<div class="col-10 h5 upload_label_1346">FW_ Quote, fence replacement Carlis...</div>
<div class="col m-0 p-0 text-end"><i class="material-symbols-rounded">expand_more</i></div>
</div>
</div>
<div class="card-text">
<div class="collapse" ID="upload_1346">
<div class="form-group">
<label>Name</label>
<input class="form-control"
ID="name_1346" name="name_1346"
onchange="saveUpload('1346');"
type="text"
value="FW_ Quote, fence replacement Carlisle St Pump station.eml">
</div>
<div class="form-group">
<label>Category</label>
<select class="form-control" onchange="saveUpload('1346');" ID="cat_1346">
<option value="0">N/A</option>
<option value='5' >Customer Documents</option><option value='3' >Product Uploads</option><option value='4' >Project Photos and Files</option><option value='2' >Shop Drawings</option><option value='6' >Tender Documents</option><option value='7' >Tender Schedules</option> <option value="-1" >Recycle Bin</option>
</select>
</div>
<div class="form-group">
<label>Descripiton</label>
<textarea class="form-control"
ID="description_1346"
onchange="saveUpload('1346');">Upload opportunity-110</textarea>
</div>
</div>
<div class="row">
<div class="col">Type: <span class="fileinfo">EML</span></div>
<div class="col-8">Source: <span class="fileinfo">Opportunity (110)</span>
</div>
</div>
</div>
</div>
<div class="card-footer" style="font-size:11px;">
<div class="row">
<div class="col p-0 m-0 text-nowrap">
&nbsp;
<small class="">
Update 11-08-2026 07:37 AM </small>
</div>
<div class="col-2 p-0 m-0 text-end">
<i class="pointer material-symbols-rounded" onclick="deleteFile('1346', '');">delete</i>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-12 col-md-6 col-lg-4 col-xl-3 upload-card " draggable="true" data-category="0" data-db="" id="file_card_1376">
<div pid="file_1376" class="card" style="min-width:150px">
<div class="card-img-top bg_preview align-middle"
style="background-image:url(assets/images/pdf.png);background-size:cover;">
<a class="pointer" onmouseup="downloadFile(1376, 'pdf', '')">
<span style="display:block;height:100%;width:100%"></span>
</a>
<div class="athumbtext">
Q2266-CityofPortAdelaide.pdf </div>
<i class="material-symbols-rounded pointer compedit" onclick="editAttachment(3, this.parentNode.parentNode, 'upload', '1376');">edit</i>
<i class="material-symbols-rounded pointer compdel" onclick="deleteFile('1376', '');">delete</i>
</div>
<div class="card-body">
<div class="card-title pointer" data-bs-toggle="collapse" href="#upload_1376" role="button">
<div class="row">
<div class="col-10 h5 upload_label_1376">Q2266-CityofPortAdelaide.pdf...</div>
<div class="col m-0 p-0 text-end"><i class="material-symbols-rounded">expand_more</i></div>
</div>
</div>
<div class="card-text">
<div class="collapse" ID="upload_1376">
<div class="form-group">
<label>Name</label>
<input class="form-control"
ID="name_1376" name="name_1376"
onchange="saveUpload('1376');"
type="text"
value="Q2266-CityofPortAdelaide.pdf">
</div>
<div class="form-group">
<label>Category</label>
<select class="form-control" onchange="saveUpload('1376');" ID="cat_1376">
<option value="0">N/A</option>
<option value='5' >Customer Documents</option><option value='3' >Product Uploads</option><option value='4' >Project Photos and Files</option><option value='2' >Shop Drawings</option><option value='6' >Tender Documents</option><option value='7' >Tender Schedules</option> <option value="-1" >Recycle Bin</option>
</select>
</div>
<div class="form-group">
<label>Descripiton</label>
<textarea class="form-control"
ID="description_1376"
onchange="saveUpload('1376');">Printed Quote</textarea>
</div>
</div>
<div class="row">
<div class="col">Type: <span class="fileinfo">PDF</span></div>
<div class="col-8">Source: <span class="fileinfo">Quote (2266)</span>
</div>
</div>
</div>
</div>
<div class="card-footer" style="font-size:11px;">
<div class="row">
<div class="col p-0 m-0 text-nowrap">
&nbsp;
<small class="">
Update 13-08-2026 11:51 AM </small>
</div>
<div class="col-2 p-0 m-0 text-end">
<i class="pointer material-symbols-rounded" onclick="deleteFile('1376', '');">delete</i>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-12 col-md-6 col-lg-4 col-xl-3 upload-card " draggable="true" data-category="0" data-db="" id="file_card_1374">
<div pid="file_1374" class="card" style="min-width:150px">
<div class="card-img-top bg_preview align-middle"
style="background-image:url(assets/images/pdf.png);background-size:cover;">
<a class="pointer" onmouseup="downloadFile(1374, 'pdf', '')">
<span style="display:block;height:100%;width:100%"></span>
</a>
<div class="athumbtext">
Q2266.pdf </div>
<i class="material-symbols-rounded pointer compedit" onclick="editAttachment(3, this.parentNode.parentNode, 'upload', '1374');">edit</i>
<i class="material-symbols-rounded pointer compdel" onclick="deleteFile('1374', '');">delete</i>
</div>
<div class="card-body">
<div class="card-title pointer" data-bs-toggle="collapse" href="#upload_1374" role="button">
<div class="row">
<div class="col-10 h5 upload_label_1374">Q2266.pdf...</div>
<div class="col m-0 p-0 text-end"><i class="material-symbols-rounded">expand_more</i></div>
</div>
</div>
<div class="card-text">
<div class="collapse" ID="upload_1374">
<div class="form-group">
<label>Name</label>
<input class="form-control"
ID="name_1374" name="name_1374"
onchange="saveUpload('1374');"
type="text"
value="Q2266.pdf">
</div>
<div class="form-group">
<label>Category</label>
<select class="form-control" onchange="saveUpload('1374');" ID="cat_1374">
<option value="0">N/A</option>
<option value='5' >Customer Documents</option><option value='3' >Product Uploads</option><option value='4' >Project Photos and Files</option><option value='2' >Shop Drawings</option><option value='6' >Tender Documents</option><option value='7' >Tender Schedules</option> <option value="-1" >Recycle Bin</option>
</select>
</div>
<div class="form-group">
<label>Descripiton</label>
<textarea class="form-control"
ID="description_1374"
onchange="saveUpload('1374');">Printed Quote</textarea>
</div>
</div>
<div class="row">
<div class="col">Type: <span class="fileinfo">PDF</span></div>
<div class="col-8">Source: <span class="fileinfo">Quote (2266)</span>
</div>
</div>
</div>
</div>
<div class="card-footer" style="font-size:11px;">
<div class="row">
<div class="col p-0 m-0 text-nowrap">
&nbsp;
<small class="">
Update 13-08-2026 10:45 AM </small>
</div>
<div class="col-2 p-0 m-0 text-end">
<i class="pointer material-symbols-rounded" onclick="deleteFile('1374', '');">delete</i>
</div>
</div>
</div>
</div>
</div>
</div>
</div><div ID="upload_cat_5" data-id="5" style="display: none;" class="cardparent dropcon" data-page="0">
<div class="h4 pt-4 cat_5">&nbsp;&nbsp;&nbsp;Customer Documents</div>
<div class="row p-3 justify-content-start cat_5" ID="upload_cat_row_5" title="Click this to upload a file to this category"></div>
</div><div ID="upload_cat_1" data-id="1" style="display: none;" class="cardparent dropcon" data-page="0">
<div class="h4 pt-4 cat_1">&nbsp;&nbsp;&nbsp;Forms and Templates</div>
<div class="row p-3 justify-content-start cat_1" ID="upload_cat_row_1" title="Click this to upload a file to this category"></div>
</div><div ID="upload_cat_3" data-id="3" style="display: none;" class="cardparent dropcon" data-page="0">
<div class="h4 pt-4 cat_3">&nbsp;&nbsp;&nbsp;Product Uploads</div>
<div class="row p-3 justify-content-start cat_3" ID="upload_cat_row_3" title="Click this to upload a file to this category"></div>
</div><div ID="upload_cat_4" data-id="4" style="display: none;" class="cardparent dropcon" data-page="0">
<div class="h4 pt-4 cat_4">&nbsp;&nbsp;&nbsp;Project Photos and Files</div>
<div class="row p-3 justify-content-start cat_4" ID="upload_cat_row_4" title="Click this to upload a file to this category"></div>
</div><div ID="upload_cat_2" data-id="2" style="display: none;" class="cardparent dropcon" data-page="0">
<div class="h4 pt-4 cat_2">&nbsp;&nbsp;&nbsp;Shop Drawings</div>
<div class="row p-3 justify-content-start cat_2" ID="upload_cat_row_2" title="Click this to upload a file to this category"></div>
</div><div ID="upload_cat_6" data-id="6" style="display: none;" class="cardparent dropcon" data-page="0">
<div class="h4 pt-4 cat_6">&nbsp;&nbsp;&nbsp;Tender Documents</div>
<div class="row p-3 justify-content-start cat_6" ID="upload_cat_row_6" title="Click this to upload a file to this category"></div>
</div><div ID="upload_cat_7" data-id="7" style="display: none;" class="cardparent dropcon" data-page="0">
<div class="h4 pt-4 cat_7">&nbsp;&nbsp;&nbsp;Tender Schedules</div>
<div class="row p-3 justify-content-start cat_7" ID="upload_cat_row_7" title="Click this to upload a file to this category"></div>
</div><div ID="upload_cat_-1" data-id="-1" style="display:none" class="cardparent dropcon" title="Click this to upload a file to this category" data-page="0">
<div class="h4 pt-4 cat_-1">&nbsp;&nbsp;&nbsp;Recycle Bin</div>
<div class="row p-3 justify-content-start cat_-1" ID="upload_cat_row_-1"></div>
</div> </div>
<table class="table table-sm table-hover table-fixed attachmentslistview d-none dropcon">
<thead class="thead-dark">
<tr id="attachmentlistheader">
<th></th>
<th>No.</th>
<th>Name</th>
<th>Description</th>
<th>Category</th>
<th>Type</th>
<th>Source</th>
<th>Date</th>
<th style="width:1px;">&nbsp;</th>
</tr>
</thead>
<tbody id="attachmentlist">
</tbody>
</table>
<div class="w-100 d-none">
<form action="uploadsave.php" class="dropzone w-100 border-0 p-0 m-0" id="my-awesome-dropzone-full2">
<input type='hidden' name='category' value="Select">
<input type='hidden' name='sourceid' id="sourceid" value="2266">
<input type='hidden' name='sourcemodule' value="6">
<input type='hidden' name='subtype' value="quote">
<div class="form-group">
<div class="dz-message" data-dz-message>
<div class="h5 text-muted">Click or Drag and Drop to Upload a File to the category selected</div>
</div>
<div class="fallback" style="position:relative">
<input name="source[]" type="file" multiple />
</div>
</div>
</form>
</div>
<div class="w-100 folderuploader d-none" style="border: none !important;">
</div>
<input type="file" multiple id="nuploader" class="form-control d-none" style="display: none !important;">
</div>
</div>
<script> var catarr = 'Customer Documents|5||0|1|0|0|0-|-Product Uploads|3||0|1|0|0|0-|-Project Photos and Files|4||0|1|0|0|0-|-Shop Drawings|2||0|1|0|0|0-|-Tender Documents|6||0|1|0|0|0-|-Tender Schedules|7||0|1|0|0|0-|-Uncategorized|0'.split('-|-'); </script> <script> var catarrjson = [{"id":5,"parent":0,"name":"Customer Documents","type":"User","description":"","module":"0","status":1,"editable":1,"production_flag":0,"whs_flag":0,"purchase_flag":0,"dispatch_flag":0,"enable_email_flag":1,"default_view":0,"desc":""},{"id":3,"parent":0,"name":"Product Uploads","type":"User","description":"Upload your product brochures and sales information her","module":"0","status":1,"editable":1,"production_flag":0,"whs_flag":0,"purchase_flag":0,"dispatch_flag":0,"enable_email_flag":0,"default_view":0,"desc":""},{"id":4,"parent":0,"name":"Project Photos and Files","type":"User","description":"Upload site \/ project files and photos here","module":"0","status":1,"editable":1,"production_flag":0,"whs_flag":0,"purchase_flag":0,"dispatch_flag":0,"enable_email_flag":0,"default_view":0,"desc":""},{"id":2,"parent":0,"name":"Shop Drawings","type":"User","description":"Upload your drawings for manufacturing here","module":"0","status":1,"editable":1,"production_flag":1,"whs_flag":0,"purchase_flag":0,"dispatch_flag":0,"enable_email_flag":0,"default_view":0,"desc":""},{"id":6,"parent":0,"name":"Tender Documents","type":"User","description":"","module":"0","status":1,"editable":1,"production_flag":0,"whs_flag":0,"purchase_flag":0,"dispatch_flag":0,"enable_email_flag":0,"default_view":0,"desc":""},{"id":7,"parent":0,"name":"Tender Schedules","type":"User","description":"","module":"0","status":1,"editable":1,"production_flag":0,"whs_flag":0,"purchase_flag":0,"dispatch_flag":0,"enable_email_flag":0,"default_view":0,"desc":""}]; </script> <script> var catmodules = []; </script> <script> var attachmentDivFileListPageSize = 20; </script> <script> var attachmentDivFileThumbnailPageSize = 20; </script> <script> var attachmentDivFileListPagination = '1' == 1; </script>

<script>
function saveUpload(id=null, move = 0){
var name=document.getElementById("name_"+id).value;
var description=document.getElementById("description_"+id).value;
var cat=document.getElementById("cat_"+id);
var labels=document.getElementsByClassName("upload_label_"+id);
var catname=cat.options[cat.selectedIndex].innerHTML;
var card = document.getElementById("file_card_"+id);
var url = "uploadsave.php?call=ajax_quick_save&name="+name+"&cat="+cat.value+"&id="+id+"&description="+description+'&page=' + page + (move == 1 ? '&movefolder=1' : '');
var xmlhttp1=new XMLHttpRequest();
xmlhttp1.onreadystatechange=function(){
if (xmlhttp1.readyState=="4" && xmlhttp1.status=="200"){
var xmlDoc = JSON.parse(xmlhttp1.responseText);
if(xmlDoc=="1"){
for(x=0;x<labels.length;x++){
labels[x].innerHTML=name;
}
$('#upload_'+id).collapse('toggle');
if(card.getAttribute("data-category")!=cat.value){
var tgt_cat = document.getElementById("upload_cat_"+cat.value);
var tgt_row = document.getElementById("upload_cat_row_"+cat.value);
tgt_row.appendChild(card);
if(tgt_cat.style.display=="none"){
tgt_cat.style.display="";
}
// HIDE EMPTY CAT
var src_cat = document.getElementById("upload_cat_"+card.getAttribute("data-category"));
var src_row = document.getElementById("upload_cat_row_"+card.getAttribute("data-category"));
console.log(src_row);
if(src_row.childElementCount==0){
src_cat.style.display="none";
}
card.setAttribute("data-category",cat.value);
}
doNotice("File saved <br> "+name+"<br>"+catname);
}
else {
doAlert("Failed to save");
console.log(xmlDoc);
}
}
}
xmlhttp1.open("POST", url, true);
xmlhttp1.send();
}

function deleteFile (x=null, page=null) {
if(confirm("Are you sure you want to delete this file?")){
var url = "uploadsave.php?id="+x+"&call=delUpload&page="+page;
var xmlhttp1=new XMLHttpRequest();
if(x>0){
xmlhttp1.onreadystatechange=function(){
if (xmlhttp1.readyState=="4" && xmlhttp1.status=="200"){
xmlDoc=xmlhttp1.responseText;
//console.log(xmlDoc);
// REMOVE ROWS FROM UPLOAD TABLE IF THE TABLE EXISTS
var y = document.getElementsByClassName("uploadedFiles");
for(z=0;z<y.length;z++){
for(i=0;i<y[z].rows.length;i++){
//console.log(y.rows[i].className);
if(y[z].rows[i].className=="file_"+x || y[z].rows[i].className.includes("file_"+x)){
y[z].deleteRow(i);
}
}
}
// REMOVE CARDS FROM ATTACHMENT LIST IF EXISTS
var y = document.getElementsByClassName("upload-card");
for(z=0;z<y.length;z++){
if(y[z].id=="file_card_"+x){
console.log("removing card");
var rcat = y[z].querySelector('select').value;
y[z].remove();
if (document.querySelector('#upload_cat_row_' + rcat).innerHTML.replaceAll('\t', '').replaceAll('\n', '').replaceAll('\r', '').trim() == '' && attachmentcategory == 'All')
document.querySelector('#upload_cat_' + rcat).style.display = 'none';
if (document.querySelectorAll('.cardparent:not([style*="display: none;"])').length == 0 && attachmentcategory == 'All')
document.querySelector('#upload_cat_0').style.display = '';
if (document.querySelector(`#attachmentlist [data-attachmentid="${x}"]`) != undefined)
document.querySelector(`#attachmentlist [data-attachmentid="${x}"]`).remove();
document.querySelectorAll(`#attachmentlist > tr`).forEach ((e, i) => {
e.children[1].innerHTML = (i + 1);
});
refreshFolderCounts ();
}
}
}
}
}
xmlhttp1.open("POST", url, true);
xmlhttp1.send();
}
}


//Dropzone.autoDiscover = false;
Dropzone.options.myAwesomeDropzoneFull = {
maxFilesize: 40000000,
parallelUploads:6,
uploadMultiple:true,
paramName: "source", // The name that will be used to transfer the file
error: function (file, message) {
if (file.previewElement.parentNode.querySelectorAll('.dz-file-preview').length == 1)
file.previewElement.parentNode.classList.remove('dz-started');
file.previewElement.remove();
if (message.indexOf('Max filesize') != -1) {
var maxSize = message.split('Max filesize: ')[1];
maxSize = maxSize.replace('MiB.', ' megabyte(s).');
maxSize = maxSize.replace('KiB.', ' kilobyte(s).');
maxSize = maxSize.replace('GiB.', ' gigabyte(s).');
doAlertModal ('The file <b>' + file.name + '</b> you are uploading is too big.&nbsp;&nbsp;The maximum file size allowed is ' + maxSize, undefined, 'Upload Error');
} else {
doAlertModal (message);
}
},
sending: function(file,xhr,formData) {
//formData.append("category", document.getElementById('uploadcat').value);
formData.append("category", '0');
formData.append("pageupload", "1");
formData.append("ajax", "1");
formData.append("source", "quote 2266");
//console.log(formData);
},
success: function(file,response){
//console.log(response);
},
complete: function (file) {
if (file.status != 'error' && this.getUploadingFiles().length === 0 && this.getQueuedFiles().length === 0) {
window.location="index.php?page=quotedit&quoteid=2266";
//console.log("Upload Complete");
}
}
};


Dropzone.options.myAwesomeDropzoneFull2 = {
maxFilesize: 40000000,
parallelUploads:6,
uploadMultiple:true,
paramName: "source", // The name that will be used to transfer the file
error: function (file, message) {
if (file.previewElement.parentNode.querySelectorAll('.dz-file-preview').length == 1)
file.previewElement.parentNode.classList.remove('dz-started');
file.previewElement.remove();
if (message.indexOf('Max filesize') != -1) {
var maxSize = message.split('Max filesize: ')[1];
maxSize = maxSize.replace('MiB.', ' megabyte(s).');
maxSize = maxSize.replace('KiB.', ' kilobyte(s).');
maxSize = maxSize.replace('GiB.', ' gigabyte(s).');
doAlertModal ('The file <b>' + file.name + '</b> you are uploading is too big.&nbsp;&nbsp;The maximum file size allowed is ' + maxSize, undefined, 'Upload Error');
} else {
doAlertModal (message);
}
},
sending: function(file,xhr,formData) {
//formData.append("category", document.getElementById('uploadcat').value);
formData.append("category", '0');
formData.append("pageupload", "1");
formData.append("ajax", "1");
formData.append("source", "quote 2266");
//console.log(formData);
},
success: function(file,response){
//console.log(response);
},
complete: function (file) {
if (file.status != 'error' && this.getUploadingFiles().length === 0 && this.getQueuedFiles().length === 0) {
window.location="index.php?page=quotedit&quoteid=2266";
//console.log("Upload Complete");
}
}
};

Dropzone.options.myAwesomeDropzoneMain = {
maxFilesize: 40000000,
parallelUploads: 6,
uploadMultiple: true,
paramName: "source",
error: function (file, message) {
if (file.previewElement.parentNode.querySelectorAll('.dz-file-preview').length == 1)
file.previewElement.parentNode.classList.remove('dz-started');
file.previewElement.remove();
if (typeof message == 'string' && message.indexOf('Max filesize') != -1) {
var maxSize = message.split('Max filesize: ')[1];
maxSize = maxSize.replace('MiB.', ' megabyte(s).').replace('KiB.', ' kilobyte(s).').replace('GiB.', ' gigabyte(s).');
doAlertModal('The file <b>' + file.name + '</b> you are uploading is too big.&nbsp;&nbsp;The maximum file size allowed is ' + maxSize, undefined, 'Upload Error');
} else {
doAlertModal(message);
}
},
sending: function (file, xhr, formData) {
// Upload into the currently selected category (uncategorized if none).
var cat = (typeof attachmentcategoryid != 'undefined' && parseInt(attachmentcategoryid) > 0) ? attachmentcategoryid : '0';
formData.append("category", cat);
formData.append("pageupload", "1");
formData.append("ajax", "1");
formData.append("source", "quote 2266");
},
success: function (file, response) {},
complete: function (file) {
if (file.status != 'error' && this.getUploadingFiles().length === 0 && this.getQueuedFiles().length === 0) {
window.location = "index.php?page=quotedit&quoteid=2266";
}
}
};


function toggleAttachmentDropzone () {
var zone = document.getElementById('attachmentMainDropzone');
if (!zone) return;
var nowHidden = (zone.style.display !== 'none');
zone.style.display = nowHidden ? 'none' : 'block';
var icon = document.getElementById('attachmentDropzoneToggle');
if (icon) icon.innerHTML = nowHidden ? 'cloud_off' : 'cloud_upload';
// Store "1" to hide, "0" to show. Default (unset) = show.
setUserSetting('attachmentDropzoneHidden', nowHidden ? '1' : '0', true, false, '/');
}

function toggleattachmentcompact (checked) {
if (checked)
document.querySelector('.attachmentslistviewx').classList.add('compact');
else
document.querySelector('.attachmentslistviewx').classList.remove('compact');
setUserSetting ('attachmentcompact', checked, true, false, '/');
}

var currentAttachmentView = 'list';
function toggleAttachmentView (view) {
var icons = document.querySelectorAll('.attachmentviewicon');
var a = 0;
var b = 1;
var c = 2;
document.querySelector('.attachmentsiconsview').classList.remove('d-none');
document.querySelector('.attachmentslistview').classList.add('d-none');
document.querySelector('#categorylist').classList.remove('d-none');
document.querySelector('#filelist').classList.add('w-75');
document.querySelector('#filelist').classList.remove('w-100');
document.querySelector('#filelist').style = 'overflow: auto; height: 570px;';
document.querySelector('#filelist').style = 'overflow: visible; height: 570px;';
document.querySelector('.attachmentslistviewx').style = 'min-height: calc(100vh - 250px); overflow: hidden; opacity: 0;';
currentAttachmentView = view;
document.querySelector('.compactcon').classList.remove('d-none');
document.querySelector('.attachmentslistviewx').classList.remove('expand');
if (view == 'list') {
a = 1;
b = 0;
c = 2;
document.querySelector('.attachmentsiconsview').classList.add('d-none');
document.querySelector('.attachmentslistview').classList.remove('d-none');
document.querySelector('.compactcon').classList.add('d-none');
document.querySelector('#attpaginationcount').value = attachmentDivFileListPageSize;
buildAttachmentList ();
} else if (view == 'thumbnail') {
document.querySelector('#uploadcategoryname').innerHTML = 'Files uploaded here will not be placed in a category. To upload files into specific categories use the "+" icon above.';
document.querySelector('#attachmentlistheader').children[4].classList.remove('d-none');
document.querySelector('#attpaginationcount').value = attachmentDivFileThumbnailPageSize;
} else if (view == 'expand') {
a = 2;
b = 0;
c = 1;
document.querySelector('#categorylist').classList.add('d-none');
document.querySelector('.attachmentslistviewx').classList.add('expand');
document.querySelector('#filelist').classList.remove('w-75');
document.querySelector('#filelist').classList.add('w-100');
document.querySelector('#filelist').style = 'padding: 0px !important;';
setTimeout ("document.querySelector('#filelist').style = 'padding: 0px !important;';", 1000);
attachmentcategory = 'All';
attachmentcategoryid = 0;
document.querySelector('#attpaginationcount').value = attachmentDivFileThumbnailPageSize;
}
icons[a].classList.add('border');
icons[a].classList.add('border-dark');
icons[b].classList.remove('border');
icons[b].classList.remove('border-dark');
icons[c].classList.remove('border');
icons[c].classList.remove('border-dark');
setUserSetting ('attachmentview', view, true, false, '/');
filterAttachmentsShown ();
filterAttachments ();
document.querySelector('.attachmentslistviewx').classList.remove('d-none');
setFileListHeight ();
setTimeout ("document.querySelector('.attachmentslistviewx').style.opacity = 1;", initialLoad ? 1000 : 0);
document.querySelector('#upload_cat_' + attachmentcategoryid).dataset.page = 0;
}

var attachmentcategory = 'All';
var attachmentcategoryid = 0;
var tattachmentcategory = 'All';
var tattachmentcategoryid = 0;
var prevattachmentcategoryid = 0;
var prevcatobj = undefined;
var clicktimer;
const attachmentuploadmax = 40000000;
const attachmentpostmax = 40000000;
function buildAttachmentList () {
var list = document.querySelector('.attachmentslistview #attachmentlist');
var catlist = document.querySelector('.attachmentslistviewx #categorylist');
var attachmentlistheader = document.querySelector('#attachmentlistheader');
if (list.innerHTML.trim() != '') {
filterAttachments
return false;
}
catlist.innerHTML = '';
var h = '';
var c = 0;
var catarrused = [];
var catdnone = '';
var catcount = [0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
attachmentlistheader.children[4].classList.remove('d-none');
if (attachmentcategory != 'All') {
attachmentlistheader.children[4].classList.add('d-none');
catdnone = 'd-none';
}
document.querySelectorAll('.attachmentsiconsview .card').forEach (attachment => {
c++;
var inps = attachment.querySelectorAll('input, select, textarea');
var name = inps[0].value;
var desc = inps[2].value;
var cat = inps[1].options[inps[1].selectedIndex].text;
var catid = inps[1].options[inps[1].selectedIndex].value;
var ahtml = attachment.innerHTML;
var source = ahtml.split('Source:')[1].split('</')[0].trim();
var type = ahtml.split('Type:')[1].split('</')[0].trim();
var date = attachment.querySelector('small').innerHTML.replace('Update ', '');
var id = attachment.parentNode.id.replace('file_card_', '');
// Clean file type for the preview/download decision. The `type` var above
// can still contain span markup (quotes), so read the first .fileinfo
// (the Type span) text directly to keep the onmouseup attribute valid.
var ftype = (attachment.querySelector('.fileinfo') ? attachment.querySelector('.fileinfo').textContent : '').trim().toLowerCase();
// data-db carries the source-database hint (ticket files live in EVO/ESS).
var fdb = attachment.parentNode.getAttribute('data-db') || '';
if (attachment.querySelector('a') != undefined && attachment.querySelector('a').getAttribute('onmouseup') != undefined)
var link = `onmouseup="downloadFile(${id}, '${ftype}', '${fdb}');"`;
else
var link = '';
attachment.classList.add('attachmentid' + c);
if (cat == 'N/A') {
cat = 'Uncategorized';
catid = 0;
}
h += `
<tr data-id="${catid}" data-attachmentid="${id}">
<td draggable="true"><i class="material-symbols-rounded move listdrag">drag_handle</i></td>
<td ${link}>${c}</td>
<td ${link}>${name}</td>
<td ${link}>${desc}</td>
<td class="${catdnone}" ${link}>${cat}</td>
<td ${link}>${type}</td>
<td ${link}>${source}</td>
<td ${link}>${date}</td>
<td class="text-nowrap"><i class="material-symbols-rounded pointer" onmouseup="editAttachment(${c}, this.parentNode.parentNode, 'upload');">edit</i> <i class="material-symbols-rounded pointer" onmouseup="deleteFile('${id}', '');">delete</i></td>
</tr>
`;
if (catarrused.indexOf(cat) == -1)
catarrused.push(cat.trim());
catcount[catid]++;
});
list.innerHTML = h;
var cats = '<ul>';
cats += '<li class="attachmentmainevofolder" data-id="0" data-nosel="1"><i class="material-symbols-rounded">files</i> ' + document.title.split(' ')[0].toProperCase() + ' Files </li>';
cats += '<ul data-parent="0">';
cats += '<li class="pointer catdrag" data-id="-1"><i class="material-symbols-rounded active">keyboard_arrow_down</i><i class="material-symbols-rounded">auto_delete</i><span data-id="-1"> <span class="catname">Recycle Bin</span> <span class="catcount d-none"> (2)</span></span></li>';
cats += '<li class="pointer catdrag" data-id="0"><i class="material-symbols-rounded active">keyboard_arrow_down</i><i class="material-symbols-rounded">folder</i><span> All</span></li>';
cats += '</ul>';
cats += '</ul>';
catlist.innerHTML = cats;
for (var c = 0; c < catarr.length; c++) {
for (var d = c + 1; d < catarr.length; d++) {
var a = catarr[c];
var b = catarr[d];
var ap = a.split('|')[6];
var bp = b.split('|')[6];
var an = a.split('|')[0].toUpperCase();
var bn = b.split('|')[0].toUpperCase();
if (ap == bp && an < bn && ap > 0) {
catarr[c] = b;
catarr[d] = a;
}
}
}
catarri = [];
for (var it2 = 0; it2 < 2; it2++) {
for (var it = 0; it < 10; it++) {
var catarrproc = false;
catarr.forEach((e, ei) => {
var ae = e.split('|');
var p = ae[6];
var h = ae[7];
var e2 = e.split('|')[0].trim();
// START :: File Uploads - Free Time TIcket - https://my.evolutionerp.com.au/index.php?page=support_ticketedit&id=1127
// 1. Add default view to Category EG, set image categories to thumbnails and document categories to list and have the views default when you select the folder.
var e3 = e.split('|')[2] != undefined ? e.split('|')[2].trim() : 0;
// END :: File Uploads - Free Time TIcket - https://my.evolutionerp.com.au/index.php?page=support_ticketedit&id=1127
e = e.split('|')[1].trim();
var aej = JSON.stringify(ae);
if (p == undefined)
p = 0;
var a = catlist.querySelector('[data-parent="' + p + '"]');
if (e != '' && e2 != '' && (a != undefined || it2 == 1) && catarri.indexOf(ei) == -1) {
var tm = '';
if (catarrused.indexOf(e2) == -1)
tm = 'text-muted';
var l = document.createElement('LI');
l.className = `catdrag ${tm}`;
l.dataset.id = e;
l.dataset.json = aej;
l.dataset.default = e3;
l.dataset.parent = e;
l.dataset.parentid = p;
l.innerHTML = `<i class="material-symbols-rounded">keyboard_arrow_right</i><i class="material-symbols-rounded">folder</i><span data-id="${e}" style="display: inline-block;padding-left:5px;width: auto;vertical-align: top;"> <span class="catname pointer" onmouseover="showHelper(this, '<span style=font-size:11px;>CTRL + Click to upload a file to this category</span>', 0, [0, 50]);">${e2}</span> <input class="form-control p-1 d-none" data-id="${e}" value="${e2}" onchange="saveNewCat(this);" data-module="${ae[3]}" data-desc="${ae[2]}" data-status="${ae[4]}"> <span class="catcount d-none">(0)</span></span>` + (e != 0 ? `` : '');
if (p > 0) {
var oa = a;
a = document.querySelector('.catdrag[data-id="' + p + '"]');
if (a != undefined) {
l.dataset.level = parseInt(a.dataset.level) + 1;
l.classList.add('indent' + l.dataset.level);
if (a.parentNode != undefined)
if (a.nextSibling != undefined) {
a.parentNode.insertBefore (l, a.nextSibling);
} else {
oa.appendChild (l);
}
} else if (it2 == 1) {
var ah = h.split('.');
for (var z = 0; z < ah.length; z++) {
a = catlist.querySelector('[data-parent="' + ah[z] + '"]');
if (a != undefined) {
if (ah[z] > 0) {
l.dataset.level = parseInt(a.dataset.level) + 1;
a.parentNode.insertBefore (l, a.nextElementSibling);
l.classList.add('indent' + l.dataset.level);
break;
} else {
l.dataset.level = 0;
for (var x = 2; x < a.parentNode.children[1].children.length - 1; x++)
if (a.parentNode.children[1].children[x].querySelector('.catname') != undefined && a.parentNode.children[1].children[x].querySelector('.catname').innerText.toUpperCase() > e2.toUpperCase()) {
a.parentNode.children[1].insertBefore (l, a.parentNode.children[1].children[x]);
break;
}
break;
}
}
}
}
} else {
l.dataset.level = 0;
a.appendChild (l);
}
catarri.push(ei);
catarrproc = true;
}
});
if (!catarrproc)
break;
}
}
for (var c = 0; c < catcount.length; c++) {
if (catcount[c] == 0)
continue;
e = c;
var countcon = document.querySelector('#categorylist [data-id="' + c + '"] .catcount');
if (countcon != undefined) {
countcon.innerHTML = ' (' + catcount[c] + ')';
countcon.classList.remove('d-none');
}
}
document.querySelectorAll('.attachmentslistviewx #categorylist li').forEach (e => {
e.addEventListener ('mouseup', function (e) {
if (e.ctrlKey) {
nuploadercat = 0;
if (this.dataset != undefined && this.dataset.id != undefined)
nuploadercat = this.dataset.id;
document.querySelector('#nuploader').click ();
e.preventDefault();
e.stopPropagation();
} else
selectAttachmentCategory (this);
});
});
filterAttachments ();
document.querySelector('.attachmentslistviewx').classList.remove('d-none');
setFileListHeight ();
hookFolders ();
prevcatobj = document.querySelector('#categorylist ul ul li');
document.querySelectorAll('.catsettings').forEach (e => {
e.classList.remove('catsettings');
e.classList.add('catsettings2');
});
setTimeout (function () {
document.querySelector('#categorylist').style.setProperty('width', parseInt(document.querySelector('#categorylist').getBoundingClientRect().width) + 'px', 'important');
}, 1000);
document.querySelectorAll('.catsettings2').forEach (e => {
e.classList.remove('catsettings2');
e.classList.add('catsettings');
});
document.querySelector('#categorylist').style.paddingRight = '20px';
}

function selectAttachmentCategory (obj) {
tattachmentcategoryid = 0;
tattachmentcategory = 'All';
if (obj.querySelector('.catname') != undefined) {
tattachmentcategory = obj.querySelector('.catname').innerHTML.substr(0, 99).split('<')[0].trim();
tattachmentcategoryid = obj.querySelector('span').dataset.id;
}
if (tattachmentcategoryid.toString().indexOf('new') != -1) {
// Clicked on a folder that hasn't been persisted yet — just leave the
// editor focused so the user can finish naming it. Previously this
// called showOverlay() with no hideOverlay() on the early-return path,
// which produced a sticky loading animation.
return false;
}
if (obj.classList.contains('attachmentmainevofolder'))
return false;
if (ignoreclick) {
ignoreclick = false;
return false;
}
if (document.querySelector('#attachmentlist tr.nofiles') != undefined)
document.querySelector('#attachmentlist tr.nofiles').remove();
if (prevcatobj != obj) {
prevcatobj = obj;
prevattachmentcategoryid = attachmentcategoryid;
}
// START :: File Uploads - Free Time TIcket - https://my.evolutionerp.com.au/index.php?page=support_ticketedit&id=1127
// 1. Add default view to Category EG, set image categories to thumbnails and document categories to list and have the views default when you select the folder.
if (isJson(obj.dataset.json)) {
if (JSON.parse(obj.dataset.json)[5] == 1)
toggleAttachmentView('list');
else
toggleAttachmentView('thumbnail');
}
// END :: File Uploads - Free Time TIcket - https://my.evolutionerp.com.au/index.php?page=support_ticketedit&id=1127
attachmentcategoryid = 0;
attachmentcategory = 'All';
if (obj.querySelector('.catname') != undefined) {
attachmentcategory = obj.querySelector('.catname').innerHTML.substr(0, 99).split('<')[0].trim();
attachmentcategoryid = obj.querySelector('span').dataset.id;
}
document.querySelector('.attachmentslistviewx #categorylist li i.active').innerHTML = 'keyboard_arrow_right';
document.querySelector('.attachmentslistviewx #categorylist li i.active').classList.remove('active');
obj.querySelector('i').classList.add('active');
obj.querySelector('i').innerHTML = 'keyboard_arrow_down';
if (attachmentcategory != 'All') {
document.querySelector('#upload_cat_' + attachmentcategoryid).style.display = '';
setTimeout ("document.querySelector('#upload_cat_' + attachmentcategoryid + ' .h4').classList.remove('d-none')", 50);
}
filterAttachmentsShown ();
filterAttachments ();
if (document.querySelector('#fileUpload') != undefined)
document.querySelector('#fileUpload [name=category]').value = attachmentcategoryid;
document.querySelector('#my-awesome-dropzone-full [name=category]').value = attachmentcategoryid;
document.querySelector('#my-awesome-dropzone-full2 [name=category]').value = attachmentcategoryid;
setUserSetting ('attachmentcategory', attachmentcategoryid, true);
}

function setFileListHeight () {
}

function editAttachment (id, row, source, oattachmentid = 0) {
if (source == 'upload') {
if (oattachmentid > 0)
var attachment = document.querySelector('#file_card_' + oattachmentid + ' .card');
else
var attachment = document.querySelector('.attachmentid' + id);
var thumb = attachment.querySelector('.card-img-top').outerHTML.replace('athumbtext', 'athumbtext d-none');
var inps = attachment.querySelectorAll('input, select, textarea');
var catopts = inps[1].innerHTML;
var name = inps[0].value;
var desc = inps[2].value;
var attachmentid = attachment.innerHTML.split("saveUpload('")[1].split("'")[0];
doConfirm (`
${thumb}
<br>
<div class="form-group">
<label>Name</label>
<input class="form-control" id="attachmenteditname" type="text" value="${name}">
</div>
<div class="form-group">
<label>Category</label>
<select class="form-select" id="attachmenteditcat">
${catopts}
</select>
</div>
<div class="form-group">
<label>Descripiton</label>
<textarea class="form-control" id="attachmenteditdesc">${desc}</textarea>
</div>
`,
function () {
var newname = document.querySelector('#attachmenteditname').value;
var newdesc = document.querySelector('#attachmenteditdesc').value;
var newcat = document.querySelector('#attachmenteditcat').options[document.querySelector('#attachmenteditcat').selectedIndex].text;
inps[0].value = newname;
inps[1].value = document.querySelector('#attachmenteditcat').value;
inps[2].value = newdesc;
if (oattachmentid > 0) {
attachment.querySelector('.athumbtext').innerHTML = newname;
} else {
row.querySelectorAll('td')[1].innerHTML = newname;
row.querySelectorAll('td')[2].innerHTML = newdesc;
row.querySelectorAll('td')[3].innerHTML = newcat;
}
saveUpload (attachmentid);
},
function () {
},
'Save Changes',
'Cancel',
'Edit Attachment');
if (document.querySelector('#yesNoModal .modal-footer .btn-danger') != undefined)
document.querySelector('#yesNoModal .modal-footer .btn-danger').remove();
document.querySelector('#yesNoModal .modal-footer .btn-primary').insertAdjacentHTML ('beforebegin', '<button class="btn btn-danger bg-opacity-50" type="button" onmouseup="$(\'#yesNoModal\').hide();$(\'.yesNoModalBackground\').remove();deleteFile(' + attachmentid + ');">Delete Attachment</button');
document.querySelector('#attachmenteditcat').value = inps[1].value;
}
}
var aview = 'thumbnail';
if (aview == '') aview == 'thumbnail';
document.addEventListener('DOMContentLoaded', function () {
document.querySelector('.attachmentslistviewx').style.opacity = 0;
document.querySelector('.attachmentheader').style.opacity = 0;
buildAttachmentList ();
if (isJson(aview)) {
val = JSON.parse(aview);
} else {
val = { result : 'true' }
}
if (val.result == undefined)
val = { result : 'thumbnail' }
currentAttachmentView = val.result;
if (currentAttachmentView == 'false' || currentAttachmentView == 'list')
toggleAttachmentView ('list');
else if (currentAttachmentView == 'true' || currentAttachmentView == 'thumbnail')
toggleAttachmentView ('thumbnail');
else if (currentAttachmentView == 'expand') {
toggleAttachmentView ('expand');
document.querySelector('#filelist').style = 'padding: 0px !important;';
setTimeout ("document.querySelector('#filelist').style = 'padding: 0px !important;';", 1000);
}
// document.querySelector('.attachmentslistviewx').style.opacity = 1;
document.querySelector('.attachmentheader').style.opacity = 1;
unifyHeight ();
setTimeout (function () {
document.querySelector('.attachmentmainevofolder').innerHTML = '<i class="material-symbols-rounded">files</i> ' + ('' == '' ? document.title.split(' - ')[0].toProperCase() : '') + ' Files ';
initialLoad = 0;
}, 1000);
getUserSetting('attachmentcategory', window.location.href.split('?')[1], true, '', function (response) {
if (response != undefined && response > 0) {
var li = document.querySelector('li.catdrag[data-id="' + response + '"]');
if (li != undefined)
selectAttachmentCategory(li);
} else
selectAttachmentCategory(document.querySelector('li.catdrag[data-id="0"]'));
});
});

function updateCategoryCounts () {
if (currentAttachmentView == 'false') {
}
}

function filterAttachments () {
var v = document.querySelector('#attachmentfilter').value.toLowerCase();
var av = v.split(' ');
if (currentAttachmentView == 'false' || currentAttachmentView == 'list') {
if (document.querySelector('#attachmentlist tr.nofiles') != undefined)
document.querySelector('#attachmentlist tr.nofiles').remove();
var scnt = 0;
document.querySelectorAll('#attachmentlist tr').forEach (e => {
e.classList.add('d-none');
e.children[4].classList.add('d-none');
if (attachmentcategory == 'All' || attachmentcategory.toLowerCase().replaceAll(' ', '') == e.children[4].innerText.toLowerCase().replaceAll(' ', '')) {
e.classList.remove('d-none');
if (attachmentcategory == 'All')
e.children[4].classList.remove('d-none');
}
});
document.querySelectorAll('#attachmentlist tr:not(.d-none)').forEach (e => {
var found = true;
for (var c = 0; c < av.length; c++)
if (e.innerText.toLowerCase().indexOf(av[c]) == -1)
found = false;
if (found) {
scnt++;
e.children[1].innerHTML = scnt;
} else {
e.classList.add('d-none');
}
});
if (scnt == 0) {
var tr = document.createElement('TR');
tr.className = 'nofiles';
tr.innerHTML = '<td colspan="99">No files found for the category and/or keyword entered</td';
document.querySelector('#attachmentlist').appendChild(tr);
}
} else {
v = v.toLowerCase().replaceAll(' ', '');
document.querySelectorAll('.upload-card').forEach (e => {
var foundininp = true;
var h = '';
e.querySelectorAll('input, select').forEach (e2 => {
h += ' ' + e2.value.toLowerCase();
});
for (var c = 0; c < av.length; c++) {
if (h.indexOf(av[c]) == -1)
foundininp = false;
}
if (e.innerText.toLowerCase().replaceAll(' ', '').indexOf(v) != -1 || foundininp)
e.classList.remove('d-none');
else
e.classList.add('d-none');
});
}
document.querySelector('#attpagination').value = 1;
document.querySelector('#upload_cat_' + attachmentcategoryid).dataset.page = 0;
filterByPagination ();
checkFolderEmpty ();
}

function filterByPagination () {
if (!attachmentDivFileListPagination)
return false;
var thumbs = document.querySelectorAll('#upload_cat_row_' + attachmentcategoryid + ' .upload-card:not(.d-none)');
var page = document.querySelector('#upload_cat_' + attachmentcategoryid).dataset.page;
var lpage = page;
var limit = (currentAttachmentView == 'list' ? attachmentDivFileListPageSize : attachmentDivFileThumbnailPageSize);
if (page == -1) {
page = 0;
var start = page * limit;
var end = start + 999999;
} else {
var start = page * limit;
var end = start + limit;
}
page = parseInt(page);
if (currentAttachmentView == 'list') {
var thumbs = document.querySelectorAll('#attachmentlist tr[data-id="' + attachmentcategoryid + '"]:not(.d-none)');
}
var trows = thumbs.length;
for (var c = 0; c < trows; c++) {
if (c >= start && c < end)
thumbs[c].style.display = '';
else
thumbs[c].style.display = 'none';
}
var maxpage = parseInt(thumbs.length / limit);
if (thumbs.length % limit > 0)
maxpage++;
var h = '';
for (var c = 1; c <= maxpage; c++)
h += '<option>' + c + '</option>';
document.querySelector('#attpagination').innerHTML = h;
if (lpage == -1)
document.querySelector('#attpagination').value = -1;
else
document.querySelector('#attpagination').value = page + 1;
refreshFolderCounts ();
}

function attachmentPageStep (dir) {
var sel = document.getElementById('attpagination');
if (!sel || sel.options.length == 0)
return;
var cur = parseInt(sel.value);
if (isNaN(cur) || cur < 1)
cur = 1;
var next = cur + dir;
if (next < 1)
next = 1;
if (next > sel.options.length)
next = sel.options.length;
if (next == cur)
return;
sel.value = next;
document.querySelector('#upload_cat_' + attachmentcategoryid).dataset.page = next - 1;
filterByPagination ();
}

function checkFolderEmpty () {
document.querySelectorAll('.cardparent:not(.d-none) > .row').forEach (e => {
if (e.children.length == 0)
e.classList.add('empty');
else
e.classList.remove('empty');
});
}

function filterAttachmentsShown () {
if (currentAttachmentView != 'expand')
document.querySelector('#filelist').style.height = '';
else
document.querySelector('#filelist').style.height = '';
if (currentAttachmentView == "false" || currentAttachmentView == "list") {
var scnt = 0;
document.querySelectorAll('#attachmentlist tr').forEach (e => {
e.classList.add('d-none');
if (e.children[4] != undefined)
e.children[4].classList.add('d-none');
if (attachmentcategory == 'All') {
e.classList.remove('d-none');
if (e.children[4] != undefined)
e.children[4].classList.remove('d-none');
scnt++;
if (e.children[1] != undefined)
e.children[1].innerHTML = scnt;
}
});
attachmentlistheader.children[4].classList.remove('d-none');
if (attachmentcategory != 'All') {
attachmentlistheader.children[4].classList.add('d-none');
document.querySelector('#uploadcategoryname').innerHTML = `Files uploaded here will be placed in the <b>${attachmentcategory}</b> category.`;
} else {
document.querySelector('#uploadcategoryname').innerHTML = 'Files uploaded here will not be placed in a category. To upload files into specific categories use the "+" icon above.';
}
} else {
document.querySelectorAll('.attachmentsiconsview .h4').forEach (e => {
e.parentNode.classList.add('d-none');
if (attachmentcategory == 'All' || e.classList.contains('cat_' + attachmentcategoryid))
e.parentNode.classList.remove('d-none');
if (attachmentcategory != 'All')
e.classList.add('d-none');
else {
e.classList.remove('d-none');
e.parentNode.classList.remove('d-none');
}
});
}
}

function unifyHeight () {
document.querySelector('.attachmentslistviewx').style.maxHeight = '';
}

var filescomp = 0;
var fileind = 0;
var allHooked = false;
var attachParallelUpload = true;
var attachDraggedItem = undefined;
var attachDraggedItemList = undefined;
var initialLoad = 1;
function hookFolders () {
if (!allHooked) {
document.querySelectorAll('.attachmentslistviewx *').forEach (e => {
['dragenter', 'dragover', 'dragleave', 'drop'].forEach(evt => {
if (!e.classList.contains('catdrag') && !e.classList.contains('dropzone') && !e.classList.contains('dropcon') && !e.classList.contains('listdrag')) {
e.addEventListener(evt, function (e) {
e.preventDefault();
});
}
});
});
document.querySelectorAll('.dropcon').forEach (e => {
['dragenter', 'dragover', 'dragleave', 'drop'].forEach(evt => {
e.addEventListener(evt, function (e) {
e.preventDefault();
e.stopPropagation();
}, false);
});
e.addEventListener('dragover', function () {
this.classList.add('highlight');
}, false);
e.addEventListener('dragleave', function () {
this.classList.remove('highlight');
}, false);
e.addEventListener('drop', function (e) {
processDroppedFiles (e, this);
});
// Click-to-upload-anywhere on .dropcon was removed because it
// surprised users — clicking the file area would open a system
// file picker. The dedicated dropzone at the top of #filelist
// plus the .addfilesicon button now own click-to-upload.
});
document.querySelector('.addfilesicon').addEventListener('mouseup', function (e) {
nuploadercat = attachmentcategoryid;
document.querySelector('#nuploader').click();
e.preventDefault();
e.stopPropagation();
});
document.querySelector('.importfilesicon').addEventListener('mouseup', function (e) {
openImportFileModal();
});
allHooked = true;
}
document.querySelectorAll('#categorylist ul ul li').forEach (e => {
['dragenter', 'dragover', 'dragleave', 'drop'].forEach(evt => {
e.addEventListener(evt, function (e) {
e.preventDefault();
e.stopPropagation();
}, false);
});
e.addEventListener('dragover', function () {
this.classList.add('highlight');
}, false);
e.addEventListener('dragleave', function () {
this.classList.remove('highlight');
}, false);
e.addEventListener('drop', function (e) {
if (attachDraggedItem) {
processttachDraggedItem (this);
} else if (attachDraggedItemList) {
processattachDraggedItemList (this);
} else
processDroppedFiles (e, this);
}, false);
});
document.querySelectorAll('.upload-card').forEach (e => {
e.addEventListener ('dragstart', function (e) {
attachDraggedItem = this;
});
});
document.querySelectorAll('#attachmentlist td').forEach (e => {
e.addEventListener('dragstart', function (e) {
if (e.target.tagName == 'TR')
attachDraggedItemList = e.target;
if (e.target.tagName == 'TD')
attachDraggedItemList = e.target.parentNode;
if (e.target.tagName == 'I')
attachDraggedItemList = e.target.parentNode.parentNode;
});
});
document.querySelector('#attpagination').addEventListener('change', function () {
document.querySelector('#upload_cat_' + attachmentcategoryid).dataset.page = parseInt(this.value) - 1;
setTimeout ("filterByPagination ();", 250);
});
document.querySelector('#attpaginationcount').addEventListener('change', function () {
if (currentAttachmentView == 'list') {
attachmentDivFileListPageSize = this.value;
} else {
attachmentDivFileThumbnailPageSize = this.value;
}
setUserSetting (currentAttachmentView == 'list' ? 'attachmentListSize' : 'attachmentThumbSize', this.value, true, false, 'quote');
setTimeout ("filterByPagination ();", 250);
});
getUserSetting ('attachmentListSize', 'job', true, '', function (response) {
if (response != '')
attachmentDivFileListPageSize = response;
});
getUserSetting ('attachmentThumbSize', 'job', true, '', function (response) {
if (response != '')
attachmentDivFileThumbnailPageSize = response;
});
}

function refreshFolderCounts () {
var c = 0;
var catcount = [0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
document.querySelectorAll('.attachmentsiconsview .card').forEach (attachment => {
c++;
var inps = attachment.querySelectorAll('input, select, textarea');
var name = inps[0].value;
var desc = inps[2].value;
var cat = inps[1].options[inps[1].selectedIndex].text;
var catid = inps[1].options[inps[1].selectedIndex].value;
if (typeof catcount[catid] == 'undefined')
catcount[catid] = 0;
catcount[catid]++;
});
document.querySelectorAll('#categorylist ul ul li').forEach ((e, i) => {
if (i > 1) {
if (catcount[e.dataset.id] > 0) {
e.classList.remove('text-muted');
e.querySelector('.catcount').classList.remove('d-none');
e.querySelector('.catcount').innerHTML = '(' + catcount[e.dataset.id] + ')';
} else {
e.classList.add('text-muted');
e.querySelector('.catcount').classList.add('d-none');
}
}
});
checkFolderEmpty ();
}

function processDroppedFiles (e, obj) {
e.target.classList.remove('highlight');
if (obj.tagName == 'INPUT') {
var files = obj.files;
} else {
var dt = e.dataTransfer;
var files = dt.files;
}
filescomp = 0;
var fileind = 0;
var tgt = document.querySelector('.folderuploader');
var tgt2 = document.querySelector('#my-awesome-dropzone-full2');
var c = 0;
var msg = '';
var fi = 0;
for (const file of files) {
fi++;
tgt2.parentNode.classList.add('d-none');
document.querySelector('.attachmentsiconsview').classList.add('d-none');
document.querySelector('.attachmentslistview').classList.add('d-none');
tgt.classList.remove('d-none');
tgt.classList.add('dropzone');
var filesize = file.size;
var filesize2 = 'B';
if (filesize > 1000 * 1000) {
filesize = filesize / 1000 / 1000;
filesize2 = 'MB';
} else if (filesize < 1000 * 1000) {
filesize = filesize / 1000;
filesize2 = 'KB';
}
filesize = parseInt(filesize);
var nprev = `
<div class="dz-preview dz-file-preview dz-processing nprev" data-ind="${c}">
<div class="dz-image"><img data-dz-thumbnail=""></div>
<div class="dz-details">
<div class="dz-size"><span data-dz-size=""><strong>${filesize}</strong> ${filesize2}</span></div>
<div class="dz-filename"><span data-dz-name="">${file.name}</span></div>
</div>
<div class="dz-progress"> <span class="dz-upload nprevprog${c}" data-dz-uploadprogress="" style="width: 0%;"></span> </div>
<div class="dz-error-message"><span data-dz-errormessage=""></span></div>
<div class="dz-success-mark">
<svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Check</title>
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" stroke-opacity="0.198794158" stroke="#747474" fill-opacity="0.816519475" fill="#FFFFFF"></path>
</g>
</svg>
</div>
<div class="dz-error-mark">
<svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Error</title>
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g stroke="#747474" stroke-opacity="0.198794158" fill="#FFFFFF" fill-opacity="0.816519475">
<path d="M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887 38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458 L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915 C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564 L21.3431458,29 L15.6893022,34.6538436 C14.1228979,36.2202479 14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578 36.7547899,41.8726271 38.3137085,40.3137085 C39.8758057,38.7516113 39.8771021,36.2202479 38.3106978,34.6538436 L32.6568542,29 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z"></path>
</g>
</g>
</svg>
</div>
</div>
`;
var csize = attachmentuploadmax;
var csizes = csize;
if (csizes > 1000 * 1000) {
csizes = csizes / 1000 / 1000;
csizes += ' MB';
} else if (csizes < 1000 * 1000) {
csizes = filesize / 1000;
csizes += ' KB';
} else
csizes += ' B';
if (file.size <= csize) {
if (tgt.querySelector('.dz-preview') == undefined)
tgt.innerHTML = nprev;
else
tgt.querySelectorAll('.dz-preview')[tgt.querySelectorAll('.dz-preview').length - 1].insertAdjacentHTML ('afterend', nprev);
c++;
if (attachParallelUpload) {
uploadFile (files, fileind, (obj.dataset.id != undefined ? obj.dataset.id : (obj.tagName == 'INPUT' ? nuploadercat : attachmentcategoryid)), tgt, tgt2);
fileind++;
}
} else {
msg += `<li>${file.name}, the file size of ${filesize} ${filesize2}</li>`;
}
if (fi == files.length) {
if (msg != '')
doAlertModal (`The following files cannot be uploaded as the size exceeds the maximum allowed size of ${csizes}.<ul>${msg}</ul>`);
setTimeout (function () {
if (currentAttachmentView == 'list')
document.querySelector('.attachmentslistview').classList.remove('d-none');
else
document.querySelector('.attachmentsiconsview').classList.remove('d-none');
tgt2.parentNode.classList.add('d-none');
tgt.classList.add('d-none');
tgt.classList.remove('dropzone');
refreshFolderCounts ();
filterAttachments ();
filterAttachmentsShown ();
tgt.classList.add('d-none');
tgt.innerHTML = '';
}, 2000);
}
}
if (!attachParallelUpload)
uploadFile (files, fileind, (obj.dataset.id != undefined ? obj.dataset.id : (obj.tagName == 'INPUT' ? nuploadercat : attachmentcategoryid)), tgt, tgt2);
}

function uploadFile (files, fileind, category, tgt, tgt2) {
var file = files[fileind];
var fd = new FormData();
fd.append('source', file, file.name);
fd.append('upload', 1);
fd.append('nprev', fileind);
fd.append("category", category);
fd.append("sourceid", tgt2.querySelector('[name="sourceid"]').value);
fd.append("sourcemodule", tgt2.querySelector('[name="sourcemodule"]').value);
fd.append("subtype", tgt2.querySelector('[name="subtype"]').value);
fd.append("ajax", "1");
var xmlhttp1 = new XMLHttpRequest();
fd.append ('isajax', 1);
xmlhttp1.onreadystatechange = function () {
if (xmlhttp1.readyState == "4" && xmlhttp1.status == "200") {
var xmlDoc = xmlhttp1.responseText;
checkAjaxSession (xmlDoc);
if (isJson(xmlDoc)) {
xmlDoc = JSON.parse(xmlDoc);
if (Object.keys(xmlDoc).length == "0") { if (!silent) doAlert("Failed to retreive any results"); }
}
Object.entries(ajaxSubmitTimer).forEach((e, i) => {
if (e[0] == caller)
try { ajaxSubmitTimer.splice(i, 1); } catch (errr) { }
});
response = xmlDoc;
if (response.nprev != undefined) {
document.querySelector('.nprevprog' + response.nprev).style.width = '100%';
filescomp++;
if (filescomp == files.length) {
if (typeof attachmentDivUploadCompleteCallback != 'undefined')
attachmentDivUploadCompleteCallback (files);
document.querySelector('#upload_cat_' + category).classList.remove('highlight');
}
addFileToThumbnails (response, category);
addFileToList (response, category);
}
if (fileind + 1 < files.length && !attachParallelUpload) {
fileind++;
uploadFile (files, fileind, category, tgt, tgt2);
}
}
}
xmlhttp1.open('POST', 'uploadsave.php?call=fupload&ind=' + fileind + '&comp=' + filescomp, true);
xmlhttp1.send(fd);
}

function addFileToThumbnails (response, category) {
var catoptions = `
<option value='5' >Customer Documents</option><option value='3' >Product Uploads</option><option value='4' >Project Photos and Files</option><option value='2' >Shop Drawings</option><option value='6' >Tender Documents</option><option value='7' >Tender Schedules</option> <option value="-1">Recycle Bin</option>
`;
var thumb = 'assets/images/broken_image.svg';
switch (response.fext.toLowerCase()) {
case 'png' :
case 'jpg' :
case 'jpeg' :
case 'gif' :
case 'webp' :
thumb = response.thumb;
break;
case 'xls' :
case 'xlsx' :
case 'csv' :
thumb = 'assets/images/Microsoft_Excel-Logo.png';
break;
case 'doc' :
case 'docx' :
thumb = 'assets/images/Microsoft_Word-Logo.wine.png';
break;
case 'ppt' :
case 'pptx' :
thumb = 'assets/images/Microsoft_powerpoint.png';
break;
case 'pdf' :
thumb = 'assets/images/pdf.png';
break;
case 'pdf' :
thumb = 'assets/images/msg_logo.png';
break;
default :
thumb = 'assets/images/download.png';
break;
}
var card = `
<div class="col-sm-12 col-md-6 col-lg-4 col-xl-3 upload-card" draggable="true" data-category="${category}" id="file_card_${response.id}">
<div pid="file_${response.id}" class="card attachmentid2" style="min-width: 150px; height: fit-content; min-height: fit-content;">
<div class="card-img-top bg_preview align-middle"
style="background-image:url(${thumb});background-size:cover;">
<a class="pointer" onmouseup="downloadFile(${response.id}, '${(response.fext || '').toLowerCase()}')">
<span style="display:block;height:100%;width:100%"></span>
</a>
<div class="athumbtext">
${response.name} </div>
<i class="material-symbols-rounded pointer compedit" onclick="editAttachment(3, this.parentNode.parentNode, 'upload', '${response.id}');">edit</i>
<i class="material-symbols-rounded pointer compdel" onclick="deleteFile('${response.id}', '');">delete</i>
</div>
<div class="card-body">
<div class="card-title pointer" data-bs-toggle="collapse" href="#upload_${response.id}" role="button">
<div class="row">
<div class="col-10 h5 upload_label_${response.id}">${response.name}</div>
<div class="col m-0 p-0 text-end"><i class="material-symbols-rounded">expand_more</i></div>
</div>
</div>
<div class="card-text">
<div class="collapse" id="upload_${response.id}">
<div class="form-group">
<label>Name</label>
<input class="form-control" id="name_${response.id}" name="name_${response.id}" onchange="saveUpload('${response.id}');"
type="text" value="${response.name}">
</div>
<div class="form-group">
<label>Category</label>
<select class="form-select" onchange="saveUpload('${response.id}');" id="cat_${response.id}">
<option value="0">N/A</option>
${catoptions}
</select>
</div>
<div class="form-group">
<label>Descripiton</label>
<textarea class="form-control" id="description_${response.id}"
onchange="saveUpload('${response.id}');">${response.desc}</textarea>
</div>
</div>
<div class="row">
<div class="col">Type: <span class="fileinfo">${response.fext}</span></div>
<div class="col-8">Source: <span class="fileinfo">${response.subtype}</span>
</div>
</div>
</div>
</div>
<div class="card-footer" style="font-size:11px;">
<div class="row">
<div class="col p-0 m-0 text-nowrap">
&nbsp;
<small class="">
${response.timestamp} </small>
</div>
<div class="col-2 p-0 m-0 text-end">
<i class="pointer material-symbols-rounded" onclick="deleteFile('${response.id}', 'quotedit');">delete</i>
</div>
</div>
</div>
</div>
</div>
`;
if (document.querySelector('#upload_cat_row_' + category + ' .upload-card') == undefined)
document.querySelector('#upload_cat_row_' + category).innerHTML = card;
else
document.querySelectorAll('#upload_cat_row_' + category + ' .upload-card')[document.querySelectorAll('#upload_cat_row_' + category + ' .upload-card').length - 1].insertAdjacentHTML ('afterend', card);
document.querySelector(`#file_card_${response.id} select`).value = category;
['dragenter', 'dragover', 'dragleave', 'drop'].forEach(evt => {
document.querySelector(`#file_card_${response.id}`).addEventListener(evt, function () {
e.preventDefault();
});
});
document.querySelector(`#file_card_${response.id}`).addEventListener('dragstart', function () {
attachDraggedItem = this;
});
document.querySelector('#upload_cat_' + category).style.display = '';
refreshFolderCounts ();
}

function addFileToList (response, category) {
var list = document.querySelector('#attachmentlist');
var catid = category;
var id = response.id;
var link = `onmouseup="downloadFile(${id}, '${(response.fext || '').toLowerCase()}');"`;
var c = list.children.length + 1;
var name = response.name;
var desc = response.desc;
var cat = response.category;
var type = response.fext;
var source = response.desc;
var date = response.timestamp;
if (attachmentcategory != 'All') {
catdnone = 'd-none';
}
var h = `
<tr data-id="${catid}" data-attachmentid="${id}">
<td draggable="true"><i class="material-symbols-rounded move listdrag">drag_handle</i></td>
<td ${link}>${c}</td>
<td ${link}>${name}</td>
<td ${link}>${desc}</td>
<td class="${catdnone}" ${link}>${cat}</td>
<td ${link}>${type.toUpperCase()}</td>
<td ${link}>${source}</td>
<td ${link}>${date}</td>
<td class="text-nowrap"><i class="material-symbols-rounded pointer" onmouseup="editAttachment(${c}, this.parentNode.parentNode, 'upload');">edit</i> <i class="material-symbols-rounded pointer" onmouseup="deleteFile('${id}', '');">delete</i></td>
</tr>
`;
if (list.children.length == 0)
list.innerHTML = h;
else
list.children[list.children.length - 1].insertAdjacentHTML ('afterend', h);
document.querySelector(`#attachmentlist tr[data-attachmentid="${id}"]`).addEventListener('dragstart', function (e) {
if (e.target.tagName == 'TR')
attachDraggedItemList = e.target;
if (e.target.tagName == 'TD')
attachDraggedItemList = e.target.parentNode;
if (e.target.tagName == 'I')
attachDraggedItemList = e.target.parentNode.parentNode;
});
refreshFolderCounts ();
}

var nuploadercat = 0;
document.querySelector('#nuploader').addEventListener ('change', function (e) {
processDroppedFiles (e, this);
});

var ignoreclick = false;
var cancelnewfolder = false;
var nf = undefined;

// --- Import existing file modal (search + filter) ---
var aifWired = false;
function openImportFileModal () {
var modal = document.querySelector('#aImportFileModal');
if (modal == null) {
doAlert('Import is not available on this page.');
return;
}
modal.querySelector('#aifKeyword').value = '';
modal.querySelector('#aifSubtype').value = '';
modal.querySelector('#aifSourceId').value = '';
modal.querySelector('.aifResults').innerHTML = '<p class="text-muted m-0">Enter a keyword or filter and click Search.</p>';
modal.querySelector('.aifAlert').classList.add('d-none');
if (!aifWired) {
modal.querySelector('#aifSearchBtn').addEventListener('mouseup', runImportSearch);
modal.querySelector('#aifClearBtn').addEventListener('mouseup', function () {
modal.querySelector('#aifKeyword').value = '';
modal.querySelector('#aifSubtype').value = '';
modal.querySelector('#aifSourceId').value = '';
modal.querySelector('.aifResults').innerHTML = '<p class="text-muted m-0">Enter a keyword or filter and click Search.</p>';
});
modal.querySelector('#aifKeyword').addEventListener('keydown', function (e) {
if (e.key === 'Enter') { e.preventDefault(); runImportSearch(); }
});
modal.querySelector('#aifSourceId').addEventListener('keydown', function (e) {
if (e.key === 'Enter') { e.preventDefault(); runImportSearch(); }
});
aifWired = true;
}
modalOpen('aImportFileModal');
}

function runImportSearch () {
var modal = document.querySelector('#aImportFileModal');
var kw = modal.querySelector('#aifKeyword').value.trim();
var st = modal.querySelector('#aifSubtype').value;
var sid = modal.querySelector('#aifSourceId').value.trim();
var results = modal.querySelector('.aifResults');
if (kw === '' && st === '' && (sid === '' || sid === '0')) {
results.innerHTML = '<p class="text-danger m-0">Provide at least one filter (keyword, object type, or object #).</p>';
return;
}
results.innerHTML = '<p class="text-muted m-0">Searching...</p>';
var call = 'searchuploads'
+ '&kw=' + encodeURIComponent(kw)
+ '&st=' + encodeURIComponent(st)
+ '&sid=' + encodeURIComponent(sid)
+ '&dst=quote'
+ '&dsid=2266';
ajaxSubmit(function (response) {
if (!Array.isArray(response) || response.length === 0) {
results.innerHTML = '<p class="text-muted m-0">No matching files found.</p>';
return;
}
var h = '<table class="table table-sm table-hover align-middle">'
+ '<thead><tr><th></th><th>Name</th><th>Description</th><th>Source</th><th></th></tr></thead><tbody>';
for (var c = 0; c < response.length; c++) {
var r = response[c];
var ftype = (r.filetype || '').toLowerCase();
var isImg = ['jpg', 'jpeg', 'png', 'webp', 'image'].indexOf(ftype) !== -1;
var thumbSrc = (r.thumbnail && r.thumbnail.trim() !== '') ? r.thumbnail : (isImg ? r.path : '');
var iconCell = thumbSrc
? '<img src="' + aifEscapeAttr(thumbSrc) + '" style="max-height:36px;max-width:48px;">'
: '<i class="material-symbols-rounded">description</i>';
h += '<tr>'
+ '<td>' + iconCell + '</td>'
+ '<td><a href="' + aifEscapeAttr(r.path) + '" target="_blank">' + aifEscapeHtml(r.name) + '</a></td>'
+ '<td>' + aifEscapeHtml(r.description || '') + '</td>'
+ '<td>' + aifEscapeHtml(aifProper(r.subtype)) + ' ' + parseInt(r.sourceid || 0) + '</td>'
+ '<td><button type="button" class="btn btn-sm btn-primary aifImportBtn" '
+ 'data-id="' + parseInt(r.id) + '" data-name="' + aifEscapeAttr(r.name) + '">Import</button></td>'
+ '</tr>';
}
h += '</tbody></table>';
if (response.length >= 200) {
h += '<p class="text-muted small">Showing first 200 results — narrow your filters to see more.</p>';
}
results.innerHTML = h;
results.querySelectorAll('.aifImportBtn').forEach(function (btn) {
btn.addEventListener('mouseup', function () {
importExistingFile(parseInt(btn.dataset.id), btn.dataset.name, btn);
});
});
}, new FormData(), 'uploadsave.php', call);
}

function importExistingFile (uploadId, name, btn) {
if (attachmentcategoryid === 0 || attachmentcategoryid === '0' || attachmentcategoryid === undefined) {
doAlert('Select a category on the left before importing.');
return;
}
var modal = document.querySelector('#aImportFileModal');
var alertBox = modal.querySelector('.aifAlert');
btn.disabled = true;
btn.innerHTML = 'Importing...';
var call = 'importfile&id=' + uploadId
+ '&cat=' + attachmentcategoryid
+ '&srcid=2266'
+ '&stype=quote'
+ '&page=' + (window.location.href.split('page=')[1] + '&').split('&')[0];
ajaxSubmit(function (response) {
if (!response || !response.id) {
btn.disabled = false;
btn.innerHTML = 'Import';
alertBox.classList.remove('d-none');
alertBox.classList.remove('alert-success');
alertBox.classList.add('alert-danger');
alertBox.innerHTML = 'Import failed.';
return;
}
response.final = response.path;
response.fext = response.filetype;
response.desc = response.description;
response.thumb = response.thumbnail !== '' ? response.thumbnail : response.path;
addFileToThumbnails(response, attachmentcategoryid);
addFileToList(response, attachmentcategoryid);
btn.disabled = true;
btn.innerHTML = 'Imported';
btn.classList.remove('btn-primary');
btn.classList.add('btn-success');
alertBox.classList.remove('d-none');
alertBox.classList.remove('alert-danger');
alertBox.classList.add('alert-success');
alertBox.innerHTML = 'Imported "' + aifEscapeHtml(name) + '". Continue searching or close.';
}, new FormData(), 'uploadsave.php', call);
}

function aifEscapeHtml (s) {
s = String(s == null ? '' : s);
return s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
}
function aifEscapeAttr (s) {
s = String(s == null ? '' : s);
return s.replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
}
function aifProper (s) {
s = String(s || '');
return s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();
}

function downloadFile (id, ext, db) {
// Images and PDFs preview in a new tab; everything else downloads. Keep this
// list in sync with the $inlineTypes map in download.php.
// `db` ('evo'|'ess'|'') tells download.php which database to look the id up in.
// Ticket attachments live in the shared support databases, not the tenant DB.
ext = (ext || '').toString().toLowerCase().trim();
db = (db || '').toString().toLowerCase().trim();
var dbparam = db ? ('&db=' + encodeURIComponent(db)) : '';
var previewable = ['pdf', 'jpg', 'jpeg', 'png', 'gif', 'webp', 'bmp'];
if (previewable.indexOf(ext) != -1) {
window.open ('download.php?id=' + id + '&inline=1' + dbparam, '_blank');
return;
}
doNotice ('Downloading file, please wait...');
var aif = document.querySelector('#filedownloader' + id);
if (aif != undefined)
aif.remove ();
document.querySelector('head').insertAdjacentHTML ('afterend', '<iframe src="download.php?id=' + id + dbparam + '" class="d-none" id="filedownloader' + id + '"></iframe>');
}

</script>

<style>
.pac-container {
z-index: 10000 !important;
}
</style>
<div class="modal fade" id="sectionOptions" tabindex="-1" role="dialog" aria-labelledby="sectionOptionsLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<div ID="sectionOptionsTitle" class="h2">Manage Tab</div>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body text-left" ID="sectionOptionsBody">
<div class="container-fluid text-start">
<div class="row">
<div class='col'>
<div class='form-group hidden'>
<label>ID</label>
<div id='sectionIdDisplay' class="form-control"></div>
</div>
<div class='form-group'>
<label>Name</label>
<input type='text' ID='section_name' class="form-control" value='all'>
</div>
<div class='form-group'>
<label>Pricing Type</label>
<select ID='section_type' class='form-control'>
<option selected>Quotation Inclusion</option>
<option>Optional Extra</option>
</select>
</div>
<div class='form-group'>
<label>Notes</label>
<textarea ID='section_notes' class='section_notes' style="height:350px"></textarea>
</div>
<div class='form-group'>
<div class='form-check'>
<input type='checkbox' ID='section_delItems' class="form-check-input">
<label class="form-check-label">Delete Items</label>
</div>
</div>
<div class='form-group'>
<div class='row'>
<div class='col'>
<input type='button' class="form-control bg-danger" value='Delete' ID='sectionDel'>
</div>
<div class='col'>
<input type='button' class="form-control" value='Clone' ID='sectionClone'>
</div>
<div class='col'>
<input type='button' class="form-control" value='Save' ID='sectionEdit'>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
<div ID='info'></div>

<style>
.pac-container {
z-index: 10000 !important;
}
</style>
<div class="modal fade" id="addInventoryModal" tabindex="-1" role="dialog" aria-labelledby="addInventoryModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<div ID="addInventoryModalTitle" class="h2">Add Inventory Item</div>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body text-left" ID="addInventoryModalBody">
<script>
function autocode(){
if(document.getElementById("autoCode").value){
xstring = document.getElementById("autoCode").value;
///document.getElementById("aiValue").value="";
document.getElementById("code").value="";
var n = xstring.split(",");
for(i=0;i<n.length;i++){
//############### SPECIFICATION #########
if(n[i].substring(0,1)=="$" && n[i].substring(1,2)=="S"){
y = n[i].indexOf("{")+1;
z = n[i].indexOf("}");
specidLength=n[i].substring(y,z);
specidValue=n[i].substring(2,y-1);
//var element_type = document.getElementById(specidValue).tagName;
var portion = document.getElementById(specidValue).value.substring(0,specidLength);
document.getElementById("code").value=document.getElementById("code").value+portion;
}
//############### FORM UON #########
if(n[i].substring(0,1)=="$" && n[i].substring(1,2)=="U"){
y = n[i].indexOf("{")+1;
z = n[i].indexOf("}");
specidLength=n[i].substring(y,z);
uomValue=document.getElementById("uom").value;
uomValue=uomValue.replace(/[^a-zA-Z0-9]/g, '');
var portion = uomValue.substring(0,specidLength);
document.getElementById("code").value=document.getElementById("code").value+portion;
}
//############### CATEGORY #########
if(n[i].substring(0,1)=="$" && n[i].substring(1,2)=="C"){
y = n[i].indexOf("{")+1;
z = n[i].indexOf("}");
specidLength=n[i].substring(y,z);
var portion = document.getElementById("catShort").value.substring(0,specidLength);
document.getElementById("code").value=document.getElementById("code").value+portion;
}
//############### AUTO INCREMENT NUMBER #########
if(n[i].substring(0,1)=="$" && n[i].substring(1,2)=="#"){
y = n[i].indexOf("{")+1;
z = n[i].indexOf("}");
specidLength=n[i].substring(y,z);
//x = document.getElementById("code").value.substring(0,y);
x = document.getElementById("code").value;
fetchPhp(x,specidLength);
document.getElementById("code").value+=document.getElementById("aiValue").value;
}
//############### PLAIN TEXT #########
if(n[i].substring(0,1)!="$" && n[i].substring(1,2)!="C"){
var portion=n[i];
document.getElementById("code").value=document.getElementById("code").value+portion;
}
document.getElementById("code").value=document.getElementById("code").value.toUpperCase();
}
}
}
</script>

<form name="formInvAdd" id="formInvAdd" method="post" action="invaddsave.php" onsubmit="return validateForm(null,this);">
<input type="hidden" id="inv_quick_add" name="invquickadd" value="1">
<input type='hidden' name='invoiceid' value=''>
<input type='hidden' name='string' value=''>
<input type='hidden' name='referer' value='index.php?page=quotedit&quoteid=2266'>
<div class="text-start">
<div class="row">
<div class='alert alert-primary'><div class='h4'>HINT:</div>This will not add an item in the quote. The item will be added to the inventory which you can later add into your quote using the item code search.</div> <div class="form-group col-6">
<label for="code">Item Code (Will be checked Dynamically for conflicts)</label>
<input name="code"
ID="code"
onkeyup="checkCode();"
type="text"
value=''
class="form-control required">
</div>
<div class="form-group col-4 hidden">
<label for=""></label>
<input type='button' onclick="autocode();" value="AUTO" class="button form-control">
</div>
</div>
<div class="form-group" xstyle="display:none;">
<label ID="codeCheck"></label>
</div>
<div class="form-group">
<label for="category">Category</label>
<select class="form-select required" name="cat" onchange='addSpecRow(); applyCatDefaults();
setDefaultValues(this.options[this.selectedIndex]);'
ID='category' onmouseup="checkCode();" >
<option value="">Please Select</option>
<option value='86' >! Legacy Codes</option><option value='45' >!. Codes for Recycling</option><option value='24' >!Generic Fencing Prices</option><option value='31' >Bluedog Spear Top</option><option value='2' >Chainlink Fittings </option><option value='14' >Chainlink Gates</option><option value='25' >Chainwire Fencing</option><option value='30' >Colorbond Fencing</option><option value='34' >Concreting</option><option value='3' >Eltrak Gate Systems</option><option value='33' >Gate Automation</option><option value='87' >Gate Sub-assemblies</option><option value='1' >Miscellaneous</option><option value='68' >Operations</option><option value='73' >Operations - Installation</option><option value='74' >Ops - Materials</option><option value='70' >Ops - Plant</option><option value='72' >Ops - Services</option><option value='71' >Ops - Subcontracting</option><option value='69' >Ops - XX Labour</option><option value='32' >Palisade Fencing</option><option value='5' >PIPE</option><option value='47' >PLCx Chainlink</option><option value='12' >PLCx Chainlink Fabric</option><option value='85' >PLCx Custom Items</option><option value='36' >PLCx External Production </option><option value='49' >PLCx Fabrication</option><option value='80' >PLCx Fasteners</option><option value='66' >PLCx Fittings</option><option value='84' >PLCx Freight</option><option value='51' >PLCx Hollow Section</option><option value='52' >PLCx Hot Rolled</option><option value='79' >PLCx Palisade</option><option value='50' >PLCx Pipe</option><option value='59' >PLCx Post</option><option value='64' >PLCx Products</option><option value='53' >PLCx Raw Steel</option><option value='81' >PLCx Timber</option><option value='63' >PLCx Weld Mesh</option><option value='58' >PLCx Weldmesh</option><option value='82' >PLCx Wire</option><option value='83' >PLCx Wire - Bundled</option><option value='67' >PLCx Z Ed Working</option><option value='56' >PLCx Z Mitch Working</option><option value='57' >PLCx Z Pat Working </option><option value='42' >PLCx Z Pete Working</option><option value='21' >Rural Fencing</option><option value='23' >SA WATER RURAL</option><option value='27' >SA Water Spear Top</option><option value='38' >SAPN Fencing</option><option value='22' >Signage</option><option value='17' >Steel</option><option value='19' >Steel - Commercial Pipe</option><option value='20' >Steel - Commercial Pipe H</option><option value='8' >Steel - Flat Bar</option><option value='18' >Steel - RHS</option><option value='26' >Tubular Fencing</option><option value='4' >Tubular Gate Fittings</option><option value='28' >Tubular Gates</option><option value='11' >Unapproved</option><option value='35' >Weldmesh Fencing</option><option value='9' >Weldmesh Raw Materials</option> </select>
<span id="category_error" class="text-danger"></span>
<input type="hidden" name="catShort" ID="catShort">
<input type="hidden" name="autoCode" ID="autoCode">
<script>
var categories = new Array();
categories.push(new Array("86","! Legacy Codes","LEGACY","0","Legacy Codes that are inactive but still feed BOMs - Do not use","0","0","0","0","0","","0","0","20","50","20.000","Percentage"));categories.push(new Array("45","!. Codes for Recycling","Z","0","Overwrite codes from this category when starting new inventory item","0","0","0","0","0","","0","0","0","0","0.000","Percentage"));categories.push(new Array("24","!Generic Fencing Prices","GEN","0","Generic Pricing for all Fence Types","33","0","0","1","0","","0","0","0","0","0.000",""));categories.push(new Array("31","Bluedog Spear Top","Spear To","26","Tubular Fencing Spear Top","25","1","84","155","17","","4","4","5","30","5.000","Percentage"));categories.push(new Array("2","Chainlink Fittings ","CLFIT","0","XX Chainlink Fittings-all items require review-price, supplier etc. XX","80","1","84","1","0","","0","0","0","0","0.000","Percentage"));categories.push(new Array("14","Chainlink Gates","CLG","0","Chainlink Gates","30","1","84","1","20","","0","0","0","0","0.000","Percentage"));categories.push(new Array("25","Chainwire Fencing","CW","0","Chainwire Fencing materials and install separate rates","25","0","0","1","0","","0","0","0","0","0.000","Percentage"));categories.push(new Array("30","Colorbond Fencing","CBOND","0","Colorbond Fencing Install and material separate rate","25","0","0","1","0","","0","0","0","0","0.000",""));categories.push(new Array("34","Concreting","CONCR","0","Concreting inventory items","25","1","84","1","0","","0","0","0","0","0.000","Percentage"));categories.push(new Array("3","Eltrak Gate Systems","ELTRAK","0","Vater Gate Fittings","30","1","84","155","17","","4","4","5","30","5.000","Percentage"));categories.push(new Array("33","Gate Automation","AUTO","0","Automation for Gates","25","0","84","1","0","","0","0","0","0","0.000",""));categories.push(new Array("87","Gate Sub-assemblies","GATESUB","0","To capture all pre-manufactured gate sub-assemblies, eg, hinges, etc","25","1","0","155","19","","0","4","5","30","0.000","Percentage"));categories.push(new Array("1","Miscellaneous","MISC","0","Default Miscellaneous category for Evolution ERP","20","1","84","1","20","","0","0","0","0","0.000",""));categories.push(new Array("68","Operations","OPS","0","Operations and Installation","33","0","0","1","0","","0","4","5","45","0.000","Percentage"));categories.push(new Array("73","Operations - Installation","OPSLBR","0","Installation Charge Out Rates","33","0","0","1","0","","0","0","5","28","0.000","Fixed"));categories.push(new Array("74","Ops - Materials","OPSMAT","68","Operations and Installation - Materials and Consumables","33","1","84","1","17","","4","4","5","45","0.000","Percentage"));categories.push(new Array("70","Ops - Plant","OPSPLANT","68","Operations and Installation - Plant and Equipment","33","0","0","1","0","","0","4","5","45","0.000","Percentage"));categories.push(new Array("72","Ops - Services","OPSSERV","68","Operations and Installation - External Services","33","0","84","1","0","","4","4","5","45","0.000","Percentage"));categories.push(new Array("71","Ops - Subcontracting","OPSSUB","68","Operations and Installation - Subcontracting","33","0","84","1","0","","4","4","5","45","0.000","Percentage"));categories.push(new Array("69","Ops - XX Labour","OPSLBR","68","Operations and Installation - Labour - Workings only do not charge","33","0","0","1","0","","0","4","5","45","0.000","Percentage"));categories.push(new Array("32","Palisade Fencing","Palisade","0","Palisade Fencing","25","0","0","1","0","","0","0","0","0","0.000",""));categories.push(new Array("5","PIPE","PI","0","Round Hollow Pipe","25","1","84","1","20","","0","0","0","0","0.000",""));categories.push(new Array("47","PLCx Chainlink","PLCxCL","0","PLCx Saleable Items - Chainlink Fencing Products","50","1","84","155","20","","4","4","5","45","5.000","Percentage"));categories.push(new Array("12","PLCx Chainlink Fabric","CL","47","Chainlink Rolls","25","1","84","155","17","","4","4","5","30","15.000","Percentage"));categories.push(new Array("85","PLCx Custom Items","custom","0","Contains codes which can be BOM modified to enter anything onto a quote","50","0","0","155","0","","0","4","5","30","0.000","Percentage"));categories.push(new Array("36","PLCx External Production ","Fact/Ext","0","Factory Production Costs - External","25","0","0","1","0","","0","0","0","0","0.000","Percentage"));categories.push(new Array("49","PLCx Fabrication","WS-","0","Used to capture standard internal factory, workshop, labour, plant and processing charge rates","0","0","0","155","0","","0","4","0.1","0.1","0.000","Fixed"));categories.push(new Array("80","PLCx Fasteners","plcxfast","0","For all screws, bolts, nuts, fasteners, etc","25","1","84","155","17","","4","4","5","30","5.000","Percentage"));categories.push(new Array("66","PLCx Fittings","FIT","0","caps-fittings-hinges-rollers-gate components","50","1","84","155","17","","4","4","5","30","5.000","Percentage"));categories.push(new Array("84","PLCx Freight","PLCXFREI","0","For all materials related freight","25","0","84","155","0","","4","4","5","30","0.000","Percentage"));categories.push(new Array("51","PLCx Hollow Section","HS","53","PLCx Hollow Section","50","1","84","155","19","","4","4","5","30","5.000","Percentage"));categories.push(new Array("52","PLCx Hot Rolled","Black","53","PLCx- PFC, UB, ANGLE, FLAT, SOLID etc.","50","1","84","155","19","","4","4","5","30","5.000","Percentage"));categories.push(new Array("79","PLCx Palisade","PLCXPAL","0","PLCx Saleable Items - Palisade Fencing Products","50","1","0","155","20","","0","4","5","45","0.000","Percentage"));categories.push(new Array("50","PLCx Pipe","PIPE","53","NB PIPE","50","1","84","155","19","","4","4","5","30","5.000","Percentage"));categories.push(new Array("59","PLCx Post","PLCxP","47","Chainlink post","0","1","0","155","0","","0","4","5","50","5.000","Percentage"));categories.push(new Array("64","PLCx Products","PLCxP","0","PLCx manufactured/supplied products","80","1","84","155","17","","4","4","5","30","5.000","Percentage"));categories.push(new Array("53","PLCx Raw Steel","Raw Stee","0","PLCx Raw Steel ","50","1","84","155","19","","4","4","5","30","5.000","Percentage"));categories.push(new Array("81","PLCx Timber","plcxtimb","0","For timber products","25","1","84","155","17","","4","4","5","28","5.000","Percentage"));categories.push(new Array("63","PLCx Weld Mesh","WM","58","Weld Mesh panels","33","1","84","155","18","","4","4","5","45","5.000","Percentage"));categories.push(new Array("58","PLCx Weldmesh","WM-","0","PLCx Weldmesh Products","33","1","84","155","18","","4","4","5","45","5.000","Percentage"));categories.push(new Array("82","PLCx Wire","plcxwire","0","For wire products other than chainlink, including raw wire","25","1","84","155","17","","4","4","5","30","8.000","Percentage"));categories.push(new Array("83","PLCx Wire - Bundled","plcxwire","82","Bundled Wire Rolls","50","0","0","155","0","","0","4","5","30","5.000","Fixed"));categories.push(new Array("67","PLCx Z Ed Working","ED","0","Ed custom products","0","1","0","155","19","","0","4","5","30","0.000","Percentage"));categories.push(new Array("56","PLCx Z Mitch Working","PLCxM","0","Working Folder for MW","0","0","0","155","0","","0","4","5","45","0.000","Fixed"));categories.push(new Array("57","PLCx Z Pat Working ","PLCxP","0","Working folder for PL","0","0","0","155","0","","0","4","5","45","0.000","Fixed"));categories.push(new Array("42","PLCx Z Pete Working","ZS","0","xx","0","0","0","0","0","","0","0","0","0","0.000","Percentage"));categories.push(new Array("21","Rural Fencing","rural","0","Rural Fencing Materials","25","1","84","1","18","","0","0","0","0","0.000",""));categories.push(new Array("23","SA WATER RURAL","SAWRURAL","21","SA Water Rural to TS0121","25","0","0","1","0","","0","0","0","0","0.000",""));categories.push(new Array("27","SA Water Spear Top","SAWSPEAR","26","SA Water Spear Top","0","0","84","0","0","","0","0","0","0","0.000",""));categories.push(new Array("38","SAPN Fencing","SAPN Gen","0","SAPN Generic Rates for Fencing","33","0","0","0","0","","0","0","0","0","0.000",""));categories.push(new Array("22","Signage","SIGN","0","Signage","25","1","84","1","20","","0","0","0","0","0.000",""));categories.push(new Array("17","Steel","ST","0","Parent category for purchased steel products","0","1","84","1","20","","0","0","0","0","0.000",""));categories.push(new Array("19","Steel - Commercial Pipe","STCP","17","Commercial Galvanized Pipe","25","1","84","1","20","","0","0","0","0","0.000",""));categories.push(new Array("20","Steel - Commercial Pipe H","STCPHDG","17","Hot dipped glavanized Pipe","30","1","84","1","20","","0","0","0","0","0.000",""));categories.push(new Array("8","Steel - Flat Bar","SFL","17","Flat Bar","25","1","84","77","18","","0","0","0","0","0.000",""));categories.push(new Array("18","Steel - RHS","ST-RHS","17","Rectangular Hollow section and Square hollow section","0","1","84","1","20","","0","0","0","0","0.000",""));categories.push(new Array("26","Tubular Fencing","TUBULAR","0","Tubular Fencing","25","0","0","1","0","","0","0","0","0","0.000",""));categories.push(new Array("4","Tubular Gate Fittings","GF-TUBUL","0","Tubular Gate Fittings and Hardware that is Purchased","100","1","84","155","17","","4","4","5","28","5.000","Percentage"));categories.push(new Array("28","Tubular Gates","TSG","0","Tubular Sliding, Cantilever and Swing Gates","33","1","0","155","17","","0","4","5","30","0.000","Percentage"));categories.push(new Array("11","Unapproved","TBP","0","Unappoved imports","1","0","0","1","0","","0","0","0","0","0.000",""));categories.push(new Array("35","Weldmesh Fencing","Weldmesh","0","Weldmesh Fencing Materials &amp; Installation","25","0","0","1","0","","0","0","0","0","0.000",""));categories.push(new Array("9","Weldmesh Raw Materials","wldmsh","0","Weldmesh Raw Materials","25","0","84","77","0","","0","0","0","0","0.000","")); </script>
</div>
<div class="alert alert-secondary">Selecting a category will fill in the below fields with the defaults specified for the selection. <div id='invAddCatWarn'></div></div>
<div class="form-group">
<label for="description">Description</label>
<textarea name="description"
rows="3"
cols="50"
ID="description"
class="form-control required"></textarea>
</div>

<div class="form-group ">
<div class="form-row">
<div class="col-2">
<label for="notes">Internal Notes</label>
</div>
</div>
<textarea name="notes" rows="2" id="notes" class="form-control"></textarea>
<div class="col text-bold text-end text-uppercase">
Specifiy supplier, item code, contact details, etc
</div>
</div>

<div class="form-group hidden">
<div class="form-row">
<div class="col-12">
<label for="customer_notes">Additional Notes (Customer Facing)</label>
</div>
</div>
<textarea name="customer_notes" rows="2" ID="customer_notes" class="form-control"></textarea>
<div class="col text-bold text-end text-uppercase">
Based on system settings this note can added to the Quote Line Item Description
</div>
</div>

<br>
<div ID="quick_add" class="hidden">
<div class="row">
<div class="form-group col-8">
<label for="purAcc">Purchase/Expense Account</label>
<select name="eaccount" ID="purAcc" class="form-control">
<option value="0">This Item is Not purchased</option>
<option value='84' >5000-Cost of Sales</option><option value='87' >5500-Direct Labour Costs</option><option value='89' >5700-Inventory Adjustment</option><option value='85' >5100-Production Expenses</option><option value='91' >5900-Purchase Discounts</option><option value='90' >5800-Purchase Returns & Allowances</option><option value='86' >5200-Purchases Exchange Gains/Losses</option><option value='115' >7200-Accounting Fees</option><option value='92' >61200-Advertising & Marketing</option><option value='136' >7700-Ammortization Expenses</option><option value='116' >7210-Audit Fees</option><option value='139' >61500-Bad Debt Expense</option><option value='117' >61300-Bank Fees</option><option value='100' >6590-Benefits</option><option value='112' >7090-Benefits</option><option value='122' >7300-Business Tax</option><option value='119' >61610-Consultants</option><option value='124' >7390-Corporation Capital Tax</option><option value='118' >7230-Credit Card Fees</option><option value='137' >7750-Depreciation Expenses</option><option value='110' >7070-Director / Partner Deductions</option><option value='109' >7060-Director / Partner Fees</option><option value='114' >7150-Dues & Subscriptions</option><option value='94' >61705-Filing Fees</option><option value='135' >61703-Fines</option><option value='97' >61704-Freight / Courier</option><option value='148' >61702-Fuel & Oil</option><option value='154' >61800-Gas Expenses</option><option value='126' >61804-Hire Fee</option><option value='125' >61801-Hire of Equipment</option><option value='131' >61803-Insurance</option><option value='138' >7800-Interest Expense</option><option value='149' >61802-Internet</option><option value='120' >61900-Legal Fees</option><option value='107' >7040-Management Salaries</option><option value='108' >7050-Management Salary deductions</option><option value='153' >61902-Meals</option><option value='95' >6250-Meeting Expenses</option><option value='133' >7640-Miscellaneous Expenses</option><option value='121' >7280-Other Professional Fees</option><option value='101' >6600-Other Selling Expenses</option><option value='111' >7080-Payroll Tax</option><option value='102' >61901-Permits, Licenses & License Fees</option><option value='132' >61904-Postage</option><option value='127' >61905-Printing</option><option value='104' >6900-Professional Services</option><option value='129' >61908-Registration</option><option value='128' >62200-Repairs & Maintenance - Equipment</option><option value='123' >62300-Repairs & Maintenance - General</option><option value='150' >62301-Repairs & Maintenance - MV</option><option value='103' >6800-Research & Development</option><option value='98' >6500-Sales Salaries & Commission</option><option value='99' >6550-Sales Salaries & Commission Deductions</option><option value='113' >62307-Staff Training & Testing</option><option value='29' >61906-Stationery & Office Supplies</option><option value='105' >7020-Support Salaries & Wages</option><option value='106' >7030-Support Salary & Wage Deductions</option><option value='130' >62400-Telephone Expenses</option><option value='134' >62403-Travel & Accommodation Expenses</option><option value='96' >6300-Travelling Expenses</option> </select>
</div>
<div class="form-group col-4">
<label for="taxBuy">Tax when purchased</label>
<select name="taxBuy" ID="taxBuy" class="form-control">
<option value='0'>None</option>
<option value='4' >GST</option><option value='5' >WET</option><option value='6' >ABNW</option><option value='7' >FREE</option> </select>
</div>
</div>
<div class="row">
<div class="form-group col-8">
<label for="salesAcc">Income / Sales account</label>
<select name="iaccount" ID="salesAcc" class="form-control $quickadd_class required">
<option value=''>Please Select</option>
<option value='1' >42000-Contract Fencing Income</option><option value='161' >44000-Equipment Hire</option><option value='81' >4700-Finance Charge Income</option><option value='156' >45000-Freight Income</option><option value='140' >8100-Gain on Sale of Assets</option><option value='141' >8200-Interest Income</option><option value='144' >8500-Loss on Sale of Assets</option><option value='155' >42500-Materials Income</option><option value='157' >45005-Mobilisation / Demobilisation</option><option value='146' >8900-Other Expenses</option><option value='143' >8400-Other Revenue</option><option value='160' >45006-Post Knocking</option><option value='142' >8300-Recovery on Bad Debt</option><option value='80' >4600-Rentals</option><option value='145' >11360-Retention Held</option><option value='159' >45003-Rock Drilling</option><option value='77' >4100-Sales</option><option value='79' > --- 4500-Consulting Services</option><option value='83' >4900-Sales Discounts</option><option value='78' >4200-Sales Exchange Gains/Losses</option><option value='82' >4800-Sales Returns & Allowances</option><option value='158' >41000-Service & Repair Income</option><option value='162' >43000-Sundry Income</option> </select>
</div>
<div class="form-group col-4">
<label for="taxSell">Tax when sold</label>
<td> <select name="taxSell" ID="taxSell" class="form-control">
<option value='0'>None</option>
<option value='4' >GST</option><option value='5' >WET</option><option value='6' >ABNW</option><option value='7' >FREE</option> </select>
</div>
</div>
<div class="row">
<div class="form-group col-8">
<label for="assetacc">Inventory Asset account</label>
<select name="aaccount" ID='assetacc' class="form-control">
<option value="0">This is a non-inventory item</option>
<option value='16' >1350-Advances</option><option value='12' >1150-Allowance for Doubtful Accounts</option><option value='2' >10999-Bank Guarantee</option><option value='3' >11000-Cash on Hand</option><option value='14' >1250-Income Tax Receivable</option><option value='10' >1090-Interest Receivable</option><option value='13' >1200-Notes Receivable</option><option value='4' >11110-PLC Fencing Business Account</option><option value='15' >1300-Prepaid Expenses</option><option value='5' >11005-Square Clearing Account</option><option value='6' >11300-Sundry Debtors</option><option value='17' >1400-Supplies Inventory</option><option value='11' >11310-Trade Debtors</option><option value='19' >1440-Work in Progress Inventory</option> </select>
</div>
<div class="form-check-group col">
<br>
<label class="form-check-label" for="stocked">Stocked item</label>
<input type='checkbox' name='stocked' ID='stocked' value='1' class="form-check-input"
>
</div>
</div>

</div>
<br>
<div class="form-row">
<div class="row">
<div class="form-group col-3 hidden">
<label for="weight">Weight (KG)</label>
<input name="weight" ID="weight" type="number" step="0.001" size="4" value='' class="form-control">
</div>
<div class="form-group col-3">
<label for="uom">UOM</label>
<select name="uom" ID="uom" class="form-control">
<option value='0' >N/A</option>
<option value="BX">BX - Box</option>
<option value="EA">EA - Each</option>
<option value="HR">HR - Hour</option>
<option value="KG">KG - Kilogram</option>
<option value="LM">LM - Lineal Meter</option>
<option value="M2">M2 - Meters Square</option>
<option value="M3">M3 - Meters Cubed</option>
<option value="PA">PA - Pallet</option>
<option value="TN">TN - Tonne</option>
</select>
</div>
</div>
<div class="row fw-bold">
<div class="form-group col-3">
<label for="buyPrice">Item Cost</label>
<input name="cost" type="number" min="0" step="0.01" value='' ID="buyPrice" class="form-control required" onkeyup="setPrice();">
</div>
<div class="form-group col-3 hidden">
<label>Oncost Calculation Type</label>
<select name="oncosttype" id="oncosttype" onchange="setPrice();" class="form-control required">
<option value="Percentage">Percentage</option>
<option value="Fixed">Fixed</option>
</select>
</div>
<div class="form-group col-3 hidden">
<label for="oncost">Oncost</label>
<input name="oncost" type="number" min="0" step="0.01" value='' ID="oncost" class="form-control" onkeyup="setPrice();">
</div>
<div class="form-group col-3 hidden">
<label for="oncost">Landed Value</label>
<div ID="landedValue" class="form-control ">N/A</div>
</div>
</div>
<div class="row hidden">
<div class="form-group col-3">
<label for="">Minimum Markup</label>
<input name="minMarkup" type="number" min="0" step="0.01" value='' ID="minMarkup" class="form-control" onkeyup="setPrice();">
</div>
<div class="form-group col-3">
<label for="">Maximum Discount</label>
<input name="maxDiscount" type="number" min="0" step="0.01" value='' ID="maxDiscount" class="form-control " onkeyup="setPrice();">
</div>
</div>
<div class = "alert alert-secondary ">
<div class="row mb-3">
<div class="row">
<div class="form-group col-3 fw-bold"><label for="sellPrice">Sell Price</label></div>
<div class="col-7 text-end fw-normal">Price after Maximum Discount <span ID='inv_price_after_discount'>N/A</span></div>
</div>
<div class="row">
<div class="col-6"><input name="price" type="number" min="0.01" step="0.01" value='' ID="sellPrice" class="form-control required"></div>
<div class="col"><div ID="recprice" class="btn btn-warning text-uppercase mt-2 form-control " style="display:none" onclick="setPrice('1');"></div></div>
</div>
</div>
</div>
</div>


<div class="container" ID="specs">

</div>

<div class="form-group">
<input type="submit" value="Add Item" name="additem" ID="addItem" class="btn btn-primary form-control">
<button type="button" value="Advanced Option" name="addItemAdvancedOption" ID="addItemAdvancedOption" class="btn btn-info text-uppercase d-none" style="font-size:16px;padding:3px 10px !important;display:none;" onclick="modifyItem = false;">Advanced Option</button></div>
</div>
</form>

<input type=hidden ID=aiValue>



<script>
var mySpecs = new Array();
var advBomTimer;
mySpecs.push(new Array("68","! A reuse","32","53","PLEASE SELECT,300,250","Drop Down Menu"));mySpecs.push(new Array("87","! A reuse","32","57","PLEASE SELECT,300,250","Drop Down Menu"));mySpecs.push(new Array("2","! B REUSE","2","19","Galvanised, Powder Coated Black, Powder Coated Green, N/A","Drop Down Menu"));mySpecs.push(new Array("4","! B REUSE","2","5","Galvanised, Powder Coated Black, Powder Coated Green, N/A","Drop Down Menu"));mySpecs.push(new Array("3","!E REUSE","3","19","","Text Value"));mySpecs.push(new Array("5","!E REUSE","3","5","","Text Value"));mySpecs.push(new Array("9","!J REUSE","6","5","Commercial Galv Pipe, Pre-Galv Tube, Black Pipe, Painted","Drop Down Menu"));mySpecs.push(new Array("10","!M REUSE","7","5","","Text Value"));mySpecs.push(new Array("16","CHAINLINK-DIAMOND SIZE ","13","12","","Text Value"));mySpecs.push(new Array("19","CHAINLINK-HEIGHT","10","12","","Text Value"));mySpecs.push(new Array("18","CHAINLINK-SELVEDE","15","12","KK, KB, BB","Drop Down Menu"));mySpecs.push(new Array("132","COATING (FINISHED PRODUCT)","33","52","PLEASE SELECT,BLACK-RAW,GALVANISED,HDG,POWDER COAT,PAINTED","Drop Down Menu"));mySpecs.push(new Array("90","COATING (FINISHED PRODUCT)","33","58","PLEASE SELECT,BLACK-RAW,GALVANISED,HDG,POWDER COAT,PAINTED","Drop Down Menu"));mySpecs.push(new Array("91","COATING (FINISHED PRODUCT)","33","59","PLEASE SELECT,BLACK-RAW,GALVANISED,HDG,POWDER COAT,PAINTED","Drop Down Menu"));mySpecs.push(new Array("120","COATING (FINISHED PRODUCT)","33","50","PLEASE SELECT,BLACK-RAW,GALVANISED,HDG,POWDER COAT,PAINTED","Drop Down Menu"));mySpecs.push(new Array("118","COATING (FINISHED PRODUCT)","33","66","PLEASE SELECT,BLACK-RAW,GALVANISED,HDG,POWDER COAT,PAINTED","Drop Down Menu"));mySpecs.push(new Array("111","COATING (FINISHED PRODUCT)","33","63","PLEASE SELECT,BLACK-RAW,GALVANISED,HDG,POWDER COAT,PAINTED","Drop Down Menu"));mySpecs.push(new Array("114","COATING (FINISHED PRODUCT)","33","64","PLEASE SELECT,BLACK-RAW,GALVANISED,HDG,POWDER COAT,PAINTED","Drop Down Menu"));mySpecs.push(new Array("135","COATING (FINISHED PRODUCT)","33","51","PLEASE SELECT,BLACK-RAW,GALVANISED,HDG,POWDER COAT,PAINTED","Drop Down Menu"));mySpecs.push(new Array("62","COATING (FROM SUPPLIER)","29","51","PLEASE SELECT,BLACK,HD GALVANISED,PAINTED,ZINC,PVC,FUSION BONDED,POWDER COATED,DURA GALV","Drop Down Menu"));mySpecs.push(new Array("66","COATING (FROM SUPPLIER)","29","53","PLEASE SELECT,BLACK,HD GALVANISED,PAINTED,ZINC,PVC,FUSION BONDED,POWDER COATED,DURA GALV","Drop Down Menu"));mySpecs.push(new Array("59","COATING (FROM SUPPLIER)","29","50","PLEASE SELECT,BLACK,HD GALVANISED,PAINTED,ZINC,PVC,FUSION BONDED,POWDER COATED,DURA GALV","Drop Down Menu"));mySpecs.push(new Array("78","COATING (FROM SUPPLIER)","29","52","PLEASE SELECT,BLACK,HD GALVANISED,PAINTED,ZINC,PVC,FUSION BONDED,POWDER COATED,DURA GALV","Drop Down Menu"));mySpecs.push(new Array("85","COATING (FROM SUPPLIER)","29","57","PLEASE SELECT,BLACK,HD GALVANISED,PAINTED,ZINC,PVC,FUSION BONDED,POWDER COATED,DURA GALV","Drop Down Menu"));mySpecs.push(new Array("89","COATING (FROM SUPPLIER)","29","58","PLEASE SELECT,BLACK,HD GALVANISED,PAINTED,ZINC,PVC,FUSION BONDED,POWDER COATED,DURA GALV","Drop Down Menu"));mySpecs.push(new Array("138","COATING (FROM SUPPLIER)","29","80","PLEASE SELECT,BLACK,HD GALVANISED,PAINTED,ZINC,PVC,FUSION BONDED,POWDER COATED,DURA GALV","Drop Down Menu"));mySpecs.push(new Array("122","COATING (FROM SUPPLIER)","29","59","PLEASE SELECT,BLACK,HD GALVANISED,PAINTED,ZINC,PVC,FUSION BONDED,POWDER COATED,DURA GALV","Drop Down Menu"));mySpecs.push(new Array("112","COATING (FROM SUPPLIER)","29","63","PLEASE SELECT,BLACK,HD GALVANISED,PAINTED,ZINC,PVC,FUSION BONDED,POWDER COATED,DURA GALV","Drop Down Menu"));mySpecs.push(new Array("116","COATING (FROM SUPPLIER)","29","64","PLEASE SELECT,BLACK,HD GALVANISED,PAINTED,ZINC,PVC,FUSION BONDED,POWDER COATED,DURA GALV","Drop Down Menu"));mySpecs.push(new Array("144","COATING (FROM SUPPLIER)","29","82","PLEASE SELECT,BLACK,HD GALVANISED,PAINTED,ZINC,PVC,FUSION BONDED,POWDER COATED,DURA GALV","Drop Down Menu"));mySpecs.push(new Array("149","COATING (FROM SUPPLIER)","29","83","PLEASE SELECT,BLACK,HD GALVANISED,PAINTED,ZINC,PVC,FUSION BONDED,POWDER COATED,DURA GALV","Drop Down Menu"));mySpecs.push(new Array("131","COATING COLOUR","34","52","PLEASE SELECT,BLACK,WHITE,GREEN,GREY,CUSTOM","Drop Down Menu"));mySpecs.push(new Array("123","COATING COLOUR","34","59","PLEASE SELECT,BLACK,WHITE,GREEN,GREY,CUSTOM","Drop Down Menu"));mySpecs.push(new Array("121","COATING COLOUR","34","50","PLEASE SELECT,BLACK,WHITE,GREEN,GREY,CUSTOM","Drop Down Menu"));mySpecs.push(new Array("109","COATING COLOUR","34","58","PLEASE SELECT,BLACK,WHITE,GREEN,GREY,CUSTOM","Drop Down Menu"));mySpecs.push(new Array("113","COATING COLOUR","34","63","PLEASE SELECT,BLACK,WHITE,GREEN,GREY,CUSTOM","Drop Down Menu"));mySpecs.push(new Array("115","COATING COLOUR","34","64","PLEASE SELECT,BLACK,WHITE,GREEN,GREY,CUSTOM","Drop Down Menu"));mySpecs.push(new Array("124","COATING COLOUR","34","53","PLEASE SELECT,BLACK,WHITE,GREEN,GREY,CUSTOM","Drop Down Menu"));mySpecs.push(new Array("136","COATING COLOUR","34","51","PLEASE SELECT,BLACK,WHITE,GREEN,GREY,CUSTOM","Drop Down Menu"));mySpecs.push(new Array("145","COATING COLOUR","34","82","PLEASE SELECT,BLACK,WHITE,GREEN,GREY,CUSTOM","Drop Down Menu"));mySpecs.push(new Array("150","COATING COLOUR","34","83","PLEASE SELECT,BLACK,WHITE,GREEN,GREY,CUSTOM","Drop Down Menu"));mySpecs.push(new Array("14","COATINGS-CHAINLINK","11","12","Heavy Gal, Standard Gal, PVC Black, PVC Green, Fuse Bonded","Drop Down Menu"));mySpecs.push(new Array("86","FASTENERS (BOLT TYPE)","40","57","PLEASE SELECT,HEX,SKT HD,CSK,CUP HEAD,DOME","Drop Down Menu"));mySpecs.push(new Array("141","FASTENERS (BOLT TYPE)","40","80","PLEASE SELECT,HEX,SKT HD,CSK,CUP HEAD,DOME","Drop Down Menu"));mySpecs.push(new Array("142","FASTENERS (GRADE)","42","80","","Text Value"));mySpecs.push(new Array("83","FASTENERS (NUTS TYPE)","38","57","PLEASE SELECT,Shear Nut ,Nyloc Nut,PLAIN NUT","Drop Down Menu"));mySpecs.push(new Array("140","FASTENERS (NUTS TYPE)","38","80","PLEASE SELECT,Shear Nut ,Nyloc Nut,PLAIN NUT","Drop Down Menu"));mySpecs.push(new Array("82","FASTENERS (SIZE METRIC)","39","57","PLEASE SELECT,M6,M8,M10,M12,M16,M20","Drop Down Menu"));mySpecs.push(new Array("139","FASTENERS (SIZE METRIC)","39","80","PLEASE SELECT,M6,M8,M10,M12,M16,M20","Drop Down Menu"));mySpecs.push(new Array("21","Gate Colour","24","28","Galvanized, PVC BLK , PVC GRN ","Drop Down Menu"));mySpecs.push(new Array("24","gate height","14","28","","Text Value"));mySpecs.push(new Array("22","Gate Style","23","28","Single, Double, Sliding, Custom","Drop Down Menu"));mySpecs.push(new Array("23","Gate Type","20","28","PT Plain Top, PT Barb Wire Top","Drop Down Menu"));mySpecs.push(new Array("25","gate width","19","28","","Text Value"));mySpecs.push(new Array("20","Gate-Finish","18","28","Galvanized, Galvabond","Drop Down Menu"));mySpecs.push(new Array("67","STEEL GRADE (ALL STEEL SECTIONS)","31","53","PLEASE SELECT,250,300,350,450","Drop Down Menu"));mySpecs.push(new Array("61","STEEL GRADE (ALL STEEL SECTIONS)","31","51","PLEASE SELECT,250,300,350,450","Drop Down Menu"));mySpecs.push(new Array("88","STEEL GRADE (ALL STEEL SECTIONS)","31","57","PLEASE SELECT,250,300,350,450","Drop Down Menu"));mySpecs.push(new Array("129","STEEL GRADE (ALL STEEL SECTIONS)","31","52","PLEASE SELECT,250,300,350,450","Drop Down Menu"));mySpecs.push(new Array("126","STEEL GRADE (ALL STEEL SECTIONS)","31","50","PLEASE SELECT,250,300,350,450","Drop Down Menu"));mySpecs.push(new Array("151","STEEL GRADE (ALL STEEL SECTIONS)","31","59","PLEASE SELECT,250,300,350,450","Drop Down Menu"));mySpecs.push(new Array("70","STEEL PIPE (PIPE SIZE NB)","30","53","PLEASE SELECT,15,20,25,32,40,50,60,65,80,100,150","Drop Down Menu"));mySpecs.push(new Array("60","STEEL PIPE (PIPE SIZE NB)","30","50","PLEASE SELECT,15,20,25,32,40,50,60,65,80,100,150","Drop Down Menu"));mySpecs.push(new Array("65","STEEL PIPE (PIPE SIZE NB)","30","45","PLEASE SELECT,15,20,25,32,40,50,60,65,80,100,150","Drop Down Menu"));mySpecs.push(new Array("92","STEEL PIPE (PIPE SIZE NB)","30","59","PLEASE SELECT,15,20,25,32,40,50,60,65,80,100,150","Drop Down Menu"));mySpecs.push(new Array("1","STEEL PIPE H-M-L-XL","1","19","PLEASE SELECT,Extra Light, Light, Medium, Heavy, Extra Heavy,OTHER","Drop Down Menu"));mySpecs.push(new Array("6","STEEL PIPE H-M-L-XL","1","5","PLEASE SELECT,Extra Light, Light, Medium, Heavy, Extra Heavy,OTHER","Drop Down Menu"));mySpecs.push(new Array("69","STEEL PIPE H-M-L-XL","1","53","PLEASE SELECT,Extra Light, Light, Medium, Heavy, Extra Heavy,OTHER","Drop Down Menu"));mySpecs.push(new Array("64","STEEL PIPE H-M-L-XL","1","45","PLEASE SELECT,Extra Light, Light, Medium, Heavy, Extra Heavy,OTHER","Drop Down Menu"));mySpecs.push(new Array("58","STEEL PIPE H-M-L-XL","1","50","PLEASE SELECT,Extra Light, Light, Medium, Heavy, Extra Heavy,OTHER","Drop Down Menu"));mySpecs.push(new Array("93","STEEL PIPE H-M-L-XL","1","59","PLEASE SELECT,Extra Light, Light, Medium, Heavy, Extra Heavy,OTHER","Drop Down Menu"));mySpecs.push(new Array("71","STEEL PROFILE ","35","51","PLEASE SELECT,SHS,SHS PTR,RHS,CHS,NB PIPE,FLAT,SOLID ROUND,SOLID SQUARE,PFC,UB,UC,EA,UA","Drop Down Menu"));mySpecs.push(new Array("133","STEEL PROFILE ","35","52","PLEASE SELECT,SHS,SHS PTR,RHS,CHS,NB PIPE,FLAT,SOLID ROUND,SOLID SQUARE,PFC,UB,UC,EA,UA","Drop Down Menu"));mySpecs.push(new Array("72","STEEL PROFILE ","35","53","PLEASE SELECT,SHS,SHS PTR,RHS,CHS,NB PIPE,FLAT,SOLID ROUND,SOLID SQUARE,PFC,UB,UC,EA,UA","Drop Down Menu"));mySpecs.push(new Array("73","STEEL PROFILE ","35","50","PLEASE SELECT,SHS,SHS PTR,RHS,CHS,NB PIPE,FLAT,SOLID ROUND,SOLID SQUARE,PFC,UB,UC,EA,UA","Drop Down Menu"));mySpecs.push(new Array("119","STEEL PROFILE ","35","59","PLEASE SELECT,SHS,SHS PTR,RHS,CHS,NB PIPE,FLAT,SOLID ROUND,SOLID SQUARE,PFC,UB,UC,EA,UA","Drop Down Menu"));mySpecs.push(new Array("110","STEEL PROFILE ","35","58","PLEASE SELECT,SHS,SHS PTR,RHS,CHS,NB PIPE,FLAT,SOLID ROUND,SOLID SQUARE,PFC,UB,UC,EA,UA","Drop Down Menu"));mySpecs.push(new Array("117","STEEL PROFILE ","35","64","PLEASE SELECT,SHS,SHS PTR,RHS,CHS,NB PIPE,FLAT,SOLID ROUND,SOLID SQUARE,PFC,UB,UC,EA,UA","Drop Down Menu"));mySpecs.push(new Array("12","STEEL-WALL THICKNESS ","9","5","","Text Value"));mySpecs.push(new Array("134","STEEL-WALL THICKNESS ","9","52","","Text Value"));mySpecs.push(new Array("125","STEEL-WALL THICKNESS ","9","53","","Text Value"));mySpecs.push(new Array("127","STEEL-WALL THICKNESS ","9","50","","Text Value"));mySpecs.push(new Array("137","STEEL-WALL THICKNESS ","9","51","","Text Value"));mySpecs.push(new Array("152","STEEL-WALL THICKNESS ","9","59","","Text Value"));mySpecs.push(new Array("15","WIRE DIAMETER (ANYTHING MADE OF WIR","12","12","","Text Value"));mySpecs.push(new Array("143","WIRE DIAMETER (ANYTHING MADE OF WIR","12","82","","Text Value"));mySpecs.push(new Array("147","WIRE DIAMETER (ANYTHING MADE OF WIR","12","83","","Text Value"));mySpecs.push(new Array("146","WIRE TYPE","43","82","PLEASE SELECT,LACING WIRE,TIE WIRE,PLAIN WIRE,","Drop Down Menu"));mySpecs.push(new Array("148","WIRE TYPE","43","83","PLEASE SELECT,LACING WIRE,TIE WIRE,PLAIN WIRE,","Drop Down Menu"));mySpecs.push(new Array("74","WORKSHOP HR (WORK TYPE)","36","49","PLEASE SELECT,PACK CUT,SAW CUT,WELD,CRIMP,CAP,DRILL,LACING","Drop Down Menu"));mySpecs.push(new Array("75","WORKSHOP HR (xxxx)","28","49","PLEASE SELECT,XXXX,","Drop Down Menu"));mySpecs.push(new Array("76","WORKSHOP HR (YYYY)","37","49","PLEASE SELECT,","Drop Down Menu"));
function applyCatDefaults() {
if(document.getElementById("inv_quick_add").value=="1"){
//return;
}
var catWarnTgt = document.getElementById("invAddCatWarn");
catWarnTgt.innerHTML = "";
var e = document.getElementById('category');
for(i=0; i<categories.length; i++) {
if(categories[i][0]==e.options[e.selectedIndex].value && categories[i][0]>="1"){
// NOTIFY USER IS CATEGORY IS NOT SETUP CORRECTLY
console.log(categories[i]);
//if(categories[i][7]=="0") { catWarnTgt.innerHTML += " -Purchase account is set to 'This Item is Not Purchased' <br>"}
if(categories[i][11]=="0") { catWarnTgt.innerHTML += " -Tax when purchased missing <br>"}
if(categories[i][8]==0) { catWarnTgt.innerHTML += " -Income account missing <br>"}
if(categories[i][12]==0) { catWarnTgt.innerHTML += " -Tax when sold missing <br>"}
if(categories[i][9]==0) { catWarnTgt.innerHTML += " -Asset account missing <br>"}
if(categories[i][13]==0) { catWarnTgt.innerHTML += " -Default minimum markup <br>"}
if(categories[i][14]==0) { catWarnTgt.innerHTML += " -Default maximum discount <br>"}
if(categories[i][15]==0) { catWarnTgt.innerHTML += " -Default oncost <br>"}
if(categories[i][16]==0) { catWarnTgt.innerHTML += " -Default oncost type <br>"}
if(catWarnTgt.innerHTML != "" ) {
catWarnTgt.innerHTML = "<br>The following fields are missing on the category setup. <br> " + catWarnTgt.innerHTML;
catWarnTgt.innerHTML += "<br> <a href='index.php?page=invcatedit&id="+categories[i][0]+"'>Click Here to Edit Category</a>";
}

if(categories[i][6]>"0"){
document.getElementById("stocked").checked=true;
} else {
document.getElementById("stocked").checked=false;
}

//document.getElementById("assetacc").disabled=true;
document.getElementById("purAcc").value=categories[i][7];
document.getElementById("taxBuy").value=categories[i][11];
document.getElementById("salesAcc").value=categories[i][8];
document.getElementById("taxSell").value=categories[i][12];
document.getElementById("assetacc").value=categories[i][9];
document.getElementById("catShort").value=categories[i][2];
document.getElementById("autoCode").value=categories[i][10];
document.getElementById("minMarkup").value=categories[i][13];
document.getElementById("maxDiscount").value=categories[i][14];
document.getElementById("oncost").value=categories[i][15];
if(categories[i][15] != '') { document.getElementById("oncosttype").value=categories[i][16]; }
document.getElementById("sellPrice").value=document.getElementById("buyPrice").value * ((categories[i][5]/100)+1);
}
}
}


//CHECK IF CODE EXISTS
function checkCode(){
var ms=600;
clearTimeout(timeout);
timeout=setTimeout(function () {
var code = document.getElementById("code").value;
if(code.length == 0) { return; }
var url = "invaddsave.php?call=getCodes&string="+code;
var xmlhttp1=new XMLHttpRequest();
xmlhttp1.onreadystatechange=function(){
if (xmlhttp1.readyState=="4" && xmlhttp1.status=="200"){
var resp=JSON.parse(xmlhttp1.responseText);
//console.log(resp);
document.getElementById("codeCheck").parentNode.style.display = 'block';
err = false;
if (document.getElementById('category').value == 0 || document.getElementById('category').value == "") {
document.getElementById('category_error').innerHTML = 'ERROR: Please select a Category for this Item';
err = true;
document.getElementById('category').classList.add('error');
} else {
document.getElementById('category_error').innerHTML = '';
document.getElementById('category').classList.remove('error');
}
if (resp.count > "0") {
err = true;
document.getElementById("codeCheck").style.color="red";
document.getElementById("codeCheck").innerHTML="ERROR:THIS CODE IS TAKEN";
document.getElementById('code').classList.add('error');
document.querySelector('#addItemAdvancedOption').style.display = 'none';
} else {
document.getElementById("codeCheck").style.color="green";
document.getElementById("codeCheck").innerHTML="SUCCESS: CODE IS NOT USED";
document.getElementById('code').classList.remove('error');
document.querySelector('#addItemAdvancedOption').style.display = '';
}
if (err) {
document.getElementById("addItem").disabled=true;
if (document.getElementById("addItemAdvancedOption") != undefined) document.getElementById("addItemAdvancedOption").disabled = true;
} else {
document.getElementById("addItem").disabled=false;
if (document.getElementById("addItemAdvancedOption") != undefined) document.getElementById("addItemAdvancedOption").disabled = false;
}
}
}
xmlhttp1.open("POST", url, true);
xmlhttp1.send();
},ms);
}

function addSpecRow() {
if(document.getElementById("inv_quick_add").value=="1"){
return;
}
var specdiv = document.getElementById('specs');
specdiv.innerHTML="";
var e = document.getElementById('category');
for(i=0; i<mySpecs.length; i++) {
if(mySpecs[i][3]==e.options[e.selectedIndex].value && mySpecs[i][3]>="1"){
//CREATE DIV
var xdiv=document.createElement("div");
xdiv.className="form-group";
//CREATE AND APPEND LABEL
var xLabel=document.createElement("label");
xLabel.innerHTML=mySpecs[i][1];
xLabel.for=mySpecs[i][0];
xdiv.appendChild(xLabel);
if(mySpecs[i][5]=="Drop Down Menu"){
var xSelect = document.createElement("select");
xSelect.id=mySpecs[i][0];
xSelect.name="specvalue[]";
xSelect.className="form-control";
var options = mySpecs[i][4].split(",");
for(x=0;x<options.length;x++){
var opt = document.createElement("option");
opt.text = options[x];
xSelect.options.add(opt);
}
xdiv.appendChild(xSelect);
var xhidden = document.createElement("input");
xhidden.name="specid[]";
xhidden.type="hidden";
xhidden.value=mySpecs[i][2];
}
else {
var xInput =document.createElement("input");
xInput.name="specvalue[]";
xInput.type="text";
xInput.className="form-control";
xInput.id=mySpecs[i][0];
xdiv.appendChild(xInput);
var xhidden = document.createElement("input");
xhidden.name="specid[]";
xhidden.type="hidden";
xhidden.value=mySpecs[i][2];
}
xdiv.appendChild(xhidden);
specdiv.appendChild(xdiv);
}
}
}

if (document.getElementById('addItemAdvancedOption') != undefined) document.getElementById('addItemAdvancedOption').addEventListener ('mouseup', function (e) {
modifyItem = false;
invAddForm = document.querySelector('#formInvAdd');
modalClose ('addInventoryModal');
modalOpen ('addInventoryAdvancedOptionModal');
document.getElementById('invAddItemName').innerHTML = invAddForm.querySelector('#description').value + ' (' + invAddForm.querySelector('#code').value + ')';
return false;
//if (validateForm (null, document.getElementById('formInvAdd'))) {
//}
});

document.getElementById('addInventoryModalBody').addEventListener('keyup', function (e) {
saveAddItemForm ();
});

document.getElementById('addInventoryModalBody').addEventListener('change', function (e) {
saveAddItemForm ();
});

function saveAddItemForm () {
clearTimeout (advBomTimer);
advBomTimer = setTimeout (function () {
form = document.querySelector('#formInvAdd');
fdata = {}
for (fcnt = 0; fcnt < form.elements.length; fcnt++)
if (form.elements[fcnt].id != undefined && form.elements[fcnt].id != '')
eval ('fdata.' + form.elements[fcnt].id + ' = "' + form.elements[fcnt].value + '"');
if (window.location.href != undefined && window.location.href.split('quoteid')[1] != undefined)
setUserSetting ('advBOMAddItem', JSON.stringify(fdata), false, true, (window.location.href.split('quoteid=')[0] + 'quoteid' + window.location.href.split('quoteid')[1].split('&')[0]).split('?')[1]);
}, 1000);
}

document.getElementById('addInventoryModal').addEventListener('show.bs.modal', function (e) {
restoreItemAdd();
});

function clearSavedAdvBOMData () {
clearUserSetting ('advBOM%');
document.querySelector('#formInvAdd #code').focus();
}

function restoreItemAdd () {
try { savedData = findUserSetting('advBOMAddItem', [], '', (window.location.href.split('quoteid=')[0] + 'quoteid' + window.location.href.split('quoteid')[1].split('&')[0]).split('?')[1]);
if (document.querySelector('.invaddwarning') != undefined) document.querySelector('.invaddwarning').remove();
if (savedData.code != undefined) {
for (var x in savedData)
document.querySelector('#formInvAdd').querySelector('#' + x).value = savedData[x];
d = document.createElement ('div');
d.classList.add('alert');
d.classList.add('alert-warning');
d.classList.add('invaddwarning');
d.innerHTML = 'Pending Item: You have unsaved New Item for this quote, would you like to continue working on it?<br><br><button class="btn btn-primary" onclick="this.parentNode.remove();document.querySelector(\'#formInvAdd #code\').focus();checkCode();">Continue</button>&nbsp;<button class="btn btn-primary" onclick="this.parentNode.nextSibling.reset();clearSavedAdvBOMData();this.parentNode.remove();">Discard Pending Item</button>';
formInvAdd = document.getElementById('formInvAdd');
formInvAdd.parentNode.insertBefore(d, formInvAdd);
checkCode();
} } catch (err) { }
setTimeout (function () { try { document.querySelector('#addItemAdvancedOption').style.display = '';
if (document.querySelector('#code').value.trim() == '' || document.querySelector('#codeCheck').innerHTML.indexOf('ERROR') != -1) document.querySelector('#addItemAdvancedOption').style.display = 'none'; } catch (err) { } }, 500);
setTimeout (function () { try { document.querySelector('#addItemAdvancedOption').style.display = '';
if (document.querySelector('#code').value.trim() == '' || document.querySelector('#codeCheck').innerHTML.indexOf('ERROR') != -1) document.querySelector('#addItemAdvancedOption').style.display = 'none'; } catch (err) { } }, 1000);
setTimeout (function () { document.querySelector('#code').focus();
document.querySelector('#code').select(); }, 200);
}

function setDefaultValues (opt) {
return;
if (opt.dataset.data == undefined) return false;
var catdata = JSON.parse(opt.dataset.data);
if (catdata == {}) return false;
document.querySelector('#taxSell').value = catdata.taxSell;
document.querySelector('#taxBuy').value = catdata.taxBuy;
document.querySelector('#purAcc').value = catdata.purAcc;
document.querySelector('#salesAcc').value = catdata.salesAcc;
document.querySelector('#assetacc').value = catdata.assAcc;
}

//####################################
//# APPLY THE CATEGORY DEFAULTS
//####################################
function setPrice(update=null) {
calcLandedNewItem();
target = document.getElementById("recprice");
cst = document.getElementById("buyPrice");
landed = parseFloat(document.getElementById("landedValue").innerHTML);
x = parseFloat(document.getElementById("maxDiscount").value);
y = parseFloat(document.getElementById("minMarkup").value);
if(x==0 || x==null || y==0 || y==null){
doAlert("The Minimum Markup and Maximum Discount must be set for Sell Price Calculation");
}
//CATEGORY MARKUP
if(document.getElementById("minMarkup").value >= "1") {
target.innerHTML="Category based Sell Price $"+Math.round(cst.value*(document.getElementById("minMarkup").value/100+1)*1000)/1000;
}
//MIN MARKUP MAX DISCOUNT
if(x>"0" && y>"0"){
z = Math.round((landed + (landed * (y/100) ))/((100-x)/100)*100)/100;
target.innerHTML="Click for suggested Price $"+z;
if (z != document.getElementById("sellPrice").value ) {
target.style.display="";
} else target.style.display="none";
max_discount_price = Math.round ((z - (z * (x / 100))) * 100)/100;
document.getElementById("inv_price_after_discount").innerHTML = max_discount_price;
if(update=="1"){
document.getElementById("sellPrice").value=z;
//document.getElementById('invedit_form').submit();
}

}
}

//####################################
//# APPLY THE CATEGORY DEFAULTS
//####################################
function checkAddItemMarkup(update=null) {
calcLandedNewItem();
target = document.getElementById("recprice");
cst = document.getElementById("buyPrice");
landed = parseFloat(document.getElementById("landedValue").innerHTML);
x = parseFloat(document.getElementById("maxDiscount").value);
y = parseFloat(document.getElementById("minMarkup").value);
if(x==0 || x==null || y==0 || y==null){
doAlert("The Minimum Markup and Maximum Discount must be set for Sell Price Calculation");
}
//CATEGORY MARKUP
if(document.getElementById("minMarkup").value >= "1") {
target.innerHTML="Category based Sell Price $"+Math.round(cst.value*(document.getElementById("minMarkup").value/100+1)*1000)/1000;
}
//MIN MARKUP MAX DISCOUNT
if(x>"0" && y>"0"){
z = Math.round((landed + (landed * (y/100) ))/((100-x)/100)*100)/100;
target.innerHTML="Click for suggested Price $"+z;
if (z != document.getElementById("sellPrice").value ) {
target.style.display="";
} else target.style.display="none";
max_discount_price = Math.round ((z - (z * (x / 100))) * 100)/100;
document.getElementById("inv_price_after_discount").innerHTML = max_discount_price;
if(update=="1"){
document.getElementById("sellPrice").value=z;
}
}
}

//####################################
//# GET LANDED COST
//####################################
function calcLandedNewItem (){
x = parseFloat(document.getElementById("buyPrice").value);
if (document.getElementById('oncosttype').value == 'Percentage') {
y = parseFloat(document.getElementById("oncost").value);
z = (x + (x * (y/100) ) );
} else {
z = x + parseFloat(document.getElementById("oncost").value);
}

z = (Math.round(z * 100) / 100).toFixed(2);
document.getElementById("landedValue").innerHTML = z;
}


</script>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
<script src="assets/js/modules/printdiv.js"></script>

<!-- //################# HIDDEN DIV PRINT ##################//-->
<div ID='print' class="popupDiv printDiv text-start">
<div class="popupDivHeader text-uppercase row">
<div class="col h2">Print Options</div>
<div class="col text-end">
<a onclick="if (document.getElementById('print') != undefined) document.getElementById('print').classList.toggle('popupDivFadee');">
<i class="pointer material-symbols-rounded">close</i>
</a>
</div>
</div>
<form action="print.php" method="POST" ID="printerForm" name="printerForm" target="_blank" onsubmit="return printButtonValidate();">
<fieldset >
<div style="mb-3">
<label>Name: </label>
<input type='text' class='form-control' name='printName' ID='printName' value='Q2266'>
</div>
<div style="display:table-row;width:100%">
<div style='display:table-col;width:120px;float:left'><b>Overwrite: </b></div>
<div style = "display:table-col;width:auto;float:left">
<input type='checkbox' name='printOverwrite' ID='printOverewrite' class='checkbox' checked>
</div>
</div>
<br>
<hr style="width:98%;margin:auto;">
<br>
<input type="hidden" name="id" value="2266">
<input type="hidden" name="subtype" value="Quote">
<div ID="printOptions">
<div class="mb-2">
<label>Choose a Template:</label>
<select name='printTemplate' class="printTemplate form-control" onchange="document.querySelector('#defaultTemplate').checked = (this.options[this.selectedIndex].dataset.default == '1'); setDefaultPrintOptions(this);">
<option data-default="0" value=6 data-printoptions="">Quote Basic EVO</option><option data-default="1" value=10 selected data-printoptions="">Quote Optioned Evo</option><option data-default="0" value=286 data-printoptions="[]">Quote Modern - With Cover Page</option><option data-default="0" value=437 data-printoptions="[]">Quote Modern - PLC</option> </select>
<script>
defaultPrintOptions = {"printStaff":"checked","printPrices":"checked","printNotes":"checked","printDel":"checked","printCombine":"checked"};
function setDefaultPrintOptions (tgt) {
var selPrintOptions = tgt.options[tgt.selectedIndex].dataset.printoptions;
if (selPrintOptions != '')
selPrintOptions = JSON.parse(decodeURIComponent(selPrintOptions))
else
selPrintOptions = defaultPrintOptions;
var flds = ['printStaff', 'printItems', 'printPrices', 'printNotes', 'printDel', 'printShip', 'printDisc', 'printChild', 'printBin', 'printCombine'];
flds.forEach (e => {
if (document.querySelector('#printOptions #' + e) != undefined)
document.querySelector('#printOptions #' + e).checked = false;
});
Object.entries(selPrintOptions).forEach(e => {
if (isNaN(parseInt(e[0])))
e = document.querySelector('#printOptions #' + e[0]);
else
e = document.querySelector('#printOptions #' + e[1]);
if (e != undefined)
e.checked = true;
});
}
</script> <input type="hidden" id="printLayout" name="printLayout" value="">
</div>
<div class="d-none">
<input type="checkbox" name="defaultTemplate" id="defaultTemplate" class="form-check-input" value="1" checked>
<label class="form-check-label" for="defaultTemplate">
Default template for <span class="subtypename">Quote</span>s
</label>
</div>
<br>
<hr style="width:98%;margin:auto;">
<br>
<div class="container">
<div class="row">
<div class="col form-check form-check-inline">
<input type="checkbox" name="printStaff" id="printStaff" class="form-check-input prntOption" checked>
<label class="form-check-label" for="printStaff">
Estimator Info
</label>
</div>
<div class="col form-check form-check-inline">
<input type="checkbox" name="printItems" id="printItems" class="form-check-input prntOption" >
<label class="form-check-label" for="printItems">
Item List
</label>
</div>
</div>
<div class="row">
<div class="col form-check form-check-inline">
<input type="checkbox" name="printPrices" id="printPrices" class="form-check-input prntOption" checked>
<label class="form-check-label" for="printPrices">
Prices
</label>
</div>
<div class="col form-check form-check-inline">
<input type="checkbox" name="printNotes" id="printNotes" class="form-check-input prntOption" checked>
<label class="form-check-label" for="printNotes">
Notes
</label>
</div>
</div>
<div class="row">
<div class="col form-check form-check-inline">
<input type="checkbox" name="printDelivery" id="printDelivery" class="form-check-input prntOption" checked>
<label class="form-check-label" for="printDelivery">
Delivery Address
</label>
</div>
<div class="col form-check form-check-inline">
<input type="checkbox" name="printShipVia" id="printShipVia" class="form-check-input prntOption" >
<label class="form-check-label" for="printShipVia">
Ship Via
</label>
</div>
</div>
<div class="row">
<div class="col form-check form-check-inline">
<input type="checkbox" name="printDiscount" id="printDiscount" class="form-check-input prntOption" >
<label class="form-check-label" for="printDiscount">
Discount
</label>
</div>
<div class="col form-check form-check-inline">
<input type="checkbox" name="printSection" id="printSection" class="form-check-input prntOption" checked>
<label class="form-check-label" for="printSection">
Tab Sections
</label>
</div>
</div>
<div class="row">
<div class="col form-check form-check-inline hidden">
<input type="checkbox" name="printChildren" id="printChildren" class="form-check-input prntOption" checked>
<label class="form-check-label" for="printChildren">
Kit Items
</label>
</div>
</div>
<br>
</div>
<!-- CLOSE PRINT OPTION -->
</div>
<input type="submit" name="printFormSubmit" id="printFormSubmit"
class="button form-control"
value="Print"
onclick="">
</fieldset>
<br>
<hr style="width:98%;margin:auto;">
<br>

<div class="h4 text-start mt-2 ">EXISTING FILES</div>
<div class="table-responsive " style="max-height:220px">
<table class="table table-sm table-hover">
<thead>
<tr>
<th></th>
<th>Name</th>
<th>Category</th>
<th>Src</th>
<th>Date</th>
</tr>
</thead>
<tbody class="uploadedFiles">
</tbody>
</table>
</div>
</form>
</div>

</div>

<style>
.printDiv input[type="checkbox"],
.printDiv label {
cursor: pointer;
}
</style>
<script>
// Each submit spawns a wkhtmltopdf process on the server. A user who thinks the print
// is slow and clicks again spawns another render of the same document, which is how a
// slow server becomes an unresponsive one. Lock the button while a render is in flight.
var printSubmitLocked = false;

function lockPrintButton(){
// The flag alone blocks the second submit, and it is set synchronously.
printSubmitLocked = true;
var btn = document.getElementById("printFormSubmit");
if(!btn) return;
// Defer the DOM changes: print.php:436 reads $_REQUEST['printFormSubmit'], and a
// control disabled during onsubmit is not submitted with the form.
setTimeout(function(){
btn.disabled = true;
btn.value = "Generating…";
}, 0);
setTimeout(function(){
printSubmitLocked = false;
btn.disabled = false;
btn.value = "Print";
}, 8000);
}

function printButtonValidate(){
if(printSubmitLocked) return false;
hideAll();
if(current_page == "quotedit" && document.getElementById("printSection").checked == true && document.getElementById("printPrices").checked == true){
//alert("Do validation");
var validateSectionIds = document.getElementsByName("sectionId[]");
var printValidateFail = 0;
validateSectionIds.forEach( function (e) {
if(e.value == 0) {
printValidateFail++;
}
});
if( printValidateFail > 0 ) {
alert("There are items in the unassigned tab and you are printing a quote with sections displayed, This may exclude items from your quote. <br>Do you wish to continue?");
//return false;
}
lockPrintButton();
return true;
}
lockPrintButton();
}
</script>
<!-- //################# HIDDEN DIV EMAIL ##################//-->
<script>
var allowTemplates=0;
var company=null;
var contactP;
var email;
var phone;
</script>
<script>
allowTemplates++;
var contactP = 'Thomas Campbell';
var company = 'City Port Adelaide Enfield';
var email = 'thomas.campbell@cityofpae.sa.gov.au';
var phone = '(08) 8405 60';
</script>
<div ID='emailDiv' class="popupDiv text-start" >
<div class="popupDivHeader text-uppercase row">
<div class="col h2">Email Options</div>
<div class="col text-end">
<a onclick="document.getElementById('emailDiv').classList.toggle('popupDivLarge');">
<i class="pointer material-symbols-rounded">close</i>
</a>
</div>
</div>
<form action="print.php" method="POST" ID="emailForm" name="emailForm" target="_blank" onsubmit="return emailFormValidate();">
<input type="hidden" name="id" value="2266">
<input type="hidden" name="printOverwrite" value="1">
<input type="hidden" name="printName" value="Q2266">
<input type="hidden" name="subtype" value="Quote">
<div class="container-fluid text-start">
<div class="form-group row">
<label class="col-1">SEND</label>
<div class="col">
<select name='printTemplate' class="printTemplate form-control">
<option value=6 >Quote Basic EVO</option><option value=10 selected>Quote Optioned Evo</option><option value=286 >Quote Modern - With Cover Page</option><option value=437 >Quote Modern - PLC</option> </select>
</div>
<div class="col-3"><a class="pointer" onclick="toggleClass('extraHeaders');">Toggle all Headers</a></div>
</div>
<div class="form-group row extraHeaders">
<label class="col-1">NAME</label>
<div class="col">
<input type='text' id="emailName" name='emailName' class="form-control" value='Maria Colorado' placeholder="This is your name as you would like the customer to see it">
</div>
</div>
<div class="form-group row">
<label class="col-1">FROM</label>
<div class="col">
<input type='email' class="form-control required" name='emailFrom' value='maria@plcfencing.com.au' >
</div>
</div>
<div class="form-group row">
<label class="col-1">TO:</label>
<div class="col">
<input type='email'
name='emailTo'
class="form-control required"
value="thomas.campbell@cityofpae.sa.gov.au"
placeholder="Seperate multiple emails with commas">
</div>
</div>
<div class="form-group row extraHeaders">
<label class="col-1">CC:</label>
<div class="col">
<input type='text'
name='emailCCTo'
value=''
class="form-control"
placeholder="Seperate multiple emails with commas">
</div>
<div class="col-4">
<div class="form-check form-check-inline">
<input checked type="checkbox" name="ccsender" value="1" class="form-check-input">
<label class="form-check-label">CC SENDER</label>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-1">SUBJ</label>
<div class="col">
<input type='text' name='emailSubject' value='Quotation 2266' class="form-control required" ID='emailSubject'>
</div>
</div>
<div class="form-group">
<textarea name="emailText" ID="emailText" class="emailmce"> <p>Dear Thomas Campbell,</p>
<p>Your quotation is attached as a pdf file to this email.</p><p>Please let me know if you require anything further.</p><p><br>Kind Regards
<br>Maria Colorado
<br><b>PLC Fencing</b>
<br> Mob:0414 440 651 Ph: 08 85344009
<br> Website: <a href='https://plcfencing.com.au'>https://plcfencing.com.au</a>
<br> Email: <a href='mailto:maria@plcfencing.com.au'>maria@plcfencing.com.au</a></p></textarea>
</div>
<div class="h4 text-start">PRINT OPTIONS</div>
<div class="row">
<div class="col">
<div class="form-check form-check-inline" style="min-width:130px">
<input type="checkbox" name="printStaff" id = "emailStaff"
class="form-check-input prntOption"
checked>
<label class="form-check-label" for="emailStaff">
Estimator Info
</label>
</div>
<div class="form-check form-check-inline" style="min-width:130px">
<input type="checkbox"
name="printItems" id = "emailItemList"
class="form-check-input prntOption"
>
<label class="form-check-label" for="emailItemList">
Item List
</label>
</div>
<div class="form-check form-check-inline" style="min-width:130px">
<input type="checkbox" name="printPrices" ID="emailPrices"
class="form-check-input prntOption"
checked>
<label class="form-check-label" for="emailPrices">
Prices
</label>
</div>
<div class="form-check form-check-inline" style="min-width:130px">
<input type="checkbox"
name="printNotes" id="emailNotes"
class="form-check-input prntOption"
checked>
<label class="form-check-label" for="emailNotes">
Notes
</label>
</div>
<div class="form-check form-check-inline" style="min-width:130px">
<input type="checkbox" name="printDelivery" id="emailDelivery"
class="form-check-input prntOption"
checked>
<label class="form-check-label" for="emailDelivery">
Delivery Address
</label>
</div>
<div class="form-check form-check-inline" style="min-width:130px">
<input type="checkbox" name="printShipVia" ID="emailShipVia"
class="form-check-input prntOption"
>
<label class="form-check-label" for="emailShipVia">
Ship Via
</label>
</div>
<div class="form-check form-check-inline" style="min-width:130px">
<input type="checkbox" name="printDiscount" id="emailDiscount"
class="form-check-input prntOption"
>
<label class="form-check-label" for="emailDiscount">
Discount
</label>
</div>
<div class="form-check form-check-inline" style="min-width:130px">
<input type="checkbox" name="printSection" id="emailSection" class="form-check-input prntOption" >
<label class="form-check-label" for="emailSection">Tab Sections</label>
</div>
<div class="form-check form-check-inline hidden" style="min-width:130px">
<input type="checkbox" name="printChildren" class="form-check-input prntOption">
<label class="form-check-label" for="inlineCheckbox1">
Kit Items
</label>
</div>
</div>
</div>
<div class="row">
<div class="col">

<div class="h4 text-start mt-2">ATTACH FILES - EMAIL ENABLED CATEGORIES</div>
<div class="table-responsive" style="max-height:220px">
<table class="table table-sm table-hover">
<thead>
<tr>
<th><input ID='fileAttachmentsSelectAllCheck' type=checkbox onchange=""></th>
<th>Name</th>
<th>Category</th>
<th>Src</th>
<th>Date</th>
</tr>
</thead>
<tbody class="uploadedFiles emailAttachments">
<tr class="file_1345">
<td><input type="checkbox" name="attachments[]" value="1345" ></td>
<td><a href='./companies/304-1726626400/files/opportunity/110/fa4197220554b4a8.pdf' target='_blank' title='16009_PAEC FENCING_REV C_2017-03-01.pdf'>16009_PAEC FENCING_REV C_2017-03-01.pdf</a></td>
<td><a href='./companies/304-1726626400/files/opportunity/110/fa4197220554b4a8.pdf' target='_blank' title='N/A'>N/A</a></td>
<td><a href='./companies/304-1726626400/files/opportunity/110/fa4197220554b4a8.pdf' target='_blank'>opportunity</a></td>
<td>11-08-2026 </td>
</tr><tr class="file_1344">
<td><input type="checkbox" name="attachments[]" value="1344" ></td>
<td><a href='./companies/304-1726626400/files/opportunity/110/cae69b7fa649cf2c.pdf' target='_blank' title='Carlisle Pump Station fencing GA diagram 2026.pdf'>Carlisle Pump Station fencing GA diagram 2026.pdf</a></td>
<td><a href='./companies/304-1726626400/files/opportunity/110/cae69b7fa649cf2c.pdf' target='_blank' title='N/A'>N/A</a></td>
<td><a href='./companies/304-1726626400/files/opportunity/110/cae69b7fa649cf2c.pdf' target='_blank'>opportunity</a></td>
<td>11-08-2026 </td>
</tr><tr class="file_1346">
<td><input type="checkbox" name="attachments[]" value="1346" ></td>
<td><a href='./companies/304-1726626400/files/opportunity/110/3b23ad1020d824a6.eml' target='_blank' title='FW_ Quote, fence replacement Carlisle St Pump station.eml'>FW_ Quote, fence replacement Carlisle St Pump station.eml</a></td>
<td><a href='./companies/304-1726626400/files/opportunity/110/3b23ad1020d824a6.eml' target='_blank' title='N/A'>N/A</a></td>
<td><a href='./companies/304-1726626400/files/opportunity/110/3b23ad1020d824a6.eml' target='_blank'>opportunity</a></td>
<td>11-08-2026 </td>
</tr> </tbody>
</table>
</div>
<input class="form-control"
name="sendEmail"
id="sendEmail"
type="submit"
class="button"
value="Send Email"
onclick="return validateForm(null, document.getElementById('emailForm')); hideAll(); document.getElementById('delete').style.display='none';">
<br><hr>
</div>
</div>
</div>
</form>
<script>
document.getElementById("fileAttachmentsSelectAllCheck").addEventListener( "change", function () {
var fileCheckAllTgts = document.getElementsByName("attachments[]");
fileCheckAllTgts.forEach( e => {
if(this.checked === true) e.checked=true;
if(this.checked === false) e.checked=false;
})
});

toggleClass("extraHeaders");
var emailSelector = [];
//var companyName = '';
var sig = '<p><br>Kind Regards <br>Maria Colorado <br><b>PLC Fencing</b> <br> Mob:0414 440 651 Ph: 08 85344009 <br> Website: <a href=\'https://plcfencing.com.au\'>https://plcfencing.com.au</a> <br> Email: <a href=\'mailto:maria@plcfencing.com.au\'>maria@plcfencing.com.au</a></p>';
//console.log(company);
tinymce.init({
selector:'textarea.emailmce',
plugins: "lists table code preview",
browser_spellcheck: true,
height : 400,
promotion: false,
toolbar: "templates undo redo | forecolor backcolor | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
setup: function (editor) {
let toggleState = false;
if(allowTemplates > 0){
editor.ui.registry.addMenuButton('templates', {
text: 'Templates',
search: {
placeholder: 'Search...'
},
fetch: (callback, fetchContext) => {
if (fetchContext.pattern.length > 0) {
callback([
{
type: 'menuitem',
text: `You searched for: "${fetchContext.pattern}"`,
onAction: () => editor.insertContent(`<strong>Inserted selected search result</strong>`)
}
]);
} else {
const items = [
{type: 'menuitem', text: 'Manage Templates', icon:'edit-block', onAction: () => window.location="index.php?page=messageTemplates"}
];
emailSelector.forEach(element => {
if(typeof contactP !== 'undefined'){element.message = element.message.replace('@contactName;', contactP); }
if(typeof company !== 'undefined'){ element.message = element.message.replace('@company;', company); }
if(typeof email !== 'undefined'){element.message = element.message.replace('@email;', email); }
if(typeof phone !== 'undefined'){element.message = element.message.replace('@phone;', phone); }
//console.log(element.message)
items.push({
type: 'menuitem',
text: element.name,
onAction: () => editor.setContent(element.message + sig)
});
});
callback(items);
}
}
});
}
}
});


function emailFormValidate(){
hideAll();
if(current_page == "quotedit" && document.getElementById("emailSection").checked == true && document.getElementById("emailPrices").checked == true){
//alert("Do validation");
var validateSectionIds = document.getElementsByName("sectionId[]");
var printValidateFail = 0;
validateSectionIds.forEach( function (e) {
if(e.value == 0) {
printValidateFail++;
}
});
if( printValidateFail > 0 ) {
alert("There are items in the unassigned tab and you are printing a quote with sections displayed, This may exclude items from your quote. <br>Do you wish to continue?");
return false;
} else return true;
}
}

</script>
</div>
<style>
.pac-container {
z-index: 10000 !important;
}
</style>
<div class="modal fade" id="copyQuoteModal" tabindex="-1" role="dialog" aria-labelledby="copyQuoteModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<div ID="copyQuoteModalTitle" class="h2">Quotation Cloning Tool</div>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body text-left" ID="copyQuoteModalBody">
<div class="container-fluid text-start">
<form action='quoteditsave.php' method='POST' name='cloneQuote' ID="cloneQuoteForm" onsubmit="return validateForm(null,this);">
<div class="row">
<div class="col">
<h4>Sales Opportunity Info</h4>
<a href="index.php?page=opportunityedit&opportunityid=110">This quotation belongs to sales opportunity 110</a> <br>
Client Contact for this Opportunity is Thomas Campbell</div>
<div class="col">
Site address is <br>
Carlisle St,
<br>
Northfield<br>
<hr>
</div>
</div>

<input type="hidden" name="cloneQuoteID" value="2266">
<input type="hidden" name="cloneParentID" value="0">
<div class="form-group">
<label for="cloneQuoteAction">What do you want to do</label>
<select class="form-control required" data-label="Clone quote rev or copy" name="cloneQuoteAction" ID="cloneQuoteAction">
<option>Please Select</option>
<option>Create a revision</option>
<option>Copy quotation</option>
</select>
</div>

<div class="form-group " ID="lead-handle">
<label for="cloneQuoteLead">Is the new quote related to Sales opportunity 110</label>
<select class="form-control " data-label="Is clone quote revision?" name="cloneQuoteLead" ID="cloneQuoteLead">
<option>Please Select</option>
<option value="0">No, do not attach the new quote to sales opportunity 110</option>
<option value="1">Yes, the new quote relates to sales opportunity 110</option>
</select>
</div>

<div class="form-group">
<label for="">What do you want to copy</label>
<br>
<div class="form-check form-check-inline">
<input class="form-check-input" type="checkbox" name="cloneQuoteLines" id="cloneQuoteLines" value="1" checked>
<label class="form-check-label" for="cloneQuoteLines">Quote Lines</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="checkbox" name="cloneQuoteNotes" id="cloneQuoteNotes" value="1" checked>
<label class="form-check-label" for="cloneQuoteNotes">Customer Notes</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="checkbox" name="cloneQuoteNotes2" id="cloneQuoteNotes2" value="1" checked>
<label class="form-check-label" for="cloneQuoteNotes2">Internal Notes</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="checkbox" name="cloneQuoteSite" id="cloneQuoteSite" value="1" checked>
<label class="form-check-label" for="cloneQuoteSite">Site Information</label>
</div>
</div>

<div class="form-group">
<label for="cloneQuoteRef">Quote Reference for new quote</label>
<input type="text" data-label="Cloned Quote Reference" name="cloneQuoteRef" value="Carlisle St, Pump Station 1" class="form-control required">
</div>

<div ID="cloneTabList" class="form-group cloneQuoteTabsGroup">
<label>Item List Tabs</label>
<div class="row">
<div class="col form-group form-check">
<input class="form-check-input cloneQuoteTabs"
type="checkbox"
name="cloneQuoteTab[]"
value="413"
id="cloneQuoteTab1" value="1" checked>
<label class="form-check-label" for="cloneQuoteTab1">
1. FENCE </label>
</div>
<div class="col form-group form-check">
<input class="form-check-input cloneQuoteTabs"
type="checkbox"
name="cloneQuoteTab[]"
value="414"
id="cloneQuoteTab2" value="1" checked>
<label class="form-check-label" for="cloneQuoteTab2">
2. INSTALLATION </label>
</div>
<div class="col form-group form-check">
<input class="form-check-input cloneQuoteTabs"
type="checkbox"
name="cloneQuoteTab[]"
value="415"
id="cloneQuoteTab3" value="1" checked>
<label class="form-check-label" for="cloneQuoteTab3">
3. GATES </label>
</div>
</div>
</div>
<div class="form-group">
<label>Attachments</label>
<table class="table table-hover table-sm">
<tr class="file_1376">
<td><input type="checkbox" name="attachments[]" value="1376" ></td>
<td><a href='./companies/304-1726626400/quotations/Q2266-CityofPortAdelaide.pdf' target='_blank'>Q2266-CityofPortAdelaide.pdf</a></td>
<td><a href='./companies/304-1726626400/quotations/Q2266-CityofPortAdelaide.pdf' target='_blank'>System Generated</a></td>
<td><a href='./companies/304-1726626400/quotations/Q2266-CityofPortAdelaide.pdf' target='_blank'>Quote</a></td>
<td>13-08-2026 </td>
</tr><tr class="file_1374">
<td><input type="checkbox" name="attachments[]" value="1374" ></td>
<td><a href='./companies/304-1726626400/quotations/Q2266.pdf' target='_blank'>Q2266.pdf</a></td>
<td><a href='./companies/304-1726626400/quotations/Q2266.pdf' target='_blank'>System Generated</a></td>
<td><a href='./companies/304-1726626400/quotations/Q2266.pdf' target='_blank'>Quote</a></td>
<td>13-08-2026 </td>
</tr></table>
</div>


<div class="form-group">
<label for=""></label>
<input type="submit" name="cloneQuoteSubmit" value="Clone Quotation" class="form-control">
</form>
</div>
</div>

<script>
document.getElementById("cloneQuoteLines").addEventListener("click", function () {
if(this.checked===true){ document.getElementById("cloneTabList").style.display=""; }
if(this.checked===false){ document.getElementById("cloneTabList").style.display="none"; }
});
document.getElementById("cloneQuoteAction").addEventListener("mouseup", function () {
if(this.selectedIndex=="1"){
document.getElementById("cloneQuoteLead").style.display="none";
document.getElementById("lead-handle").style.display="none";
}
if(this.selectedIndex=="2"){
document.getElementById("cloneQuoteLead").style.display="";
document.getElementById("lead-handle").style.display="";
}
});
</script>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
<style>
.pac-container {
z-index: 10000 !important;
}
</style>
<div class="modal fade" id="quickSaleModal" tabindex="-1" role="dialog" aria-labelledby="quickSaleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-md" role="document">
<div class="modal-content">
<div class="modal-header">
<div ID="quickSaleModalTitle" class="h2">Quick Supply</div>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" ID="quickSaleModalBody">
<div id='quickSaleResult' class='alert alert-info' style='display:none;'></div>
<div id='quickSaleSpinner' style='display:none;' class='text-center my-3'>Working&hellip;</div>
<!-- Step 1: choose action -->
<div id='quickSaleActions'>
<div class='d-grid gap-3'>
<button type='button' class='btn btn-primary btn-lg' id='qsInvoiceDispatch'>
<i class='material-symbols-rounded align-middle'>receipt_long</i> Invoice and Dispatch All
</button>
<button type='button' class='btn btn-secondary btn-lg' id='qsPickDispatch'>
<i class='material-symbols-rounded align-middle'>inventory_2</i> Pick and Dispatch
</button>
<button type='button' class='btn btn-secondary btn-lg' id='qsQuickJob'>
<i class='material-symbols-rounded align-middle'>build</i> Quick Job
</button>
</div>
</div>
<!-- Step 2 (Pick & Dispatch / Quick Job): choose target job when open jobs exist -->
<div id='quickSaleJobSelect' class='text-start' style='display:none;'>
<div class='d-flex align-items-center mb-2'>
<i id='qsJobSelectIcon' class='material-symbols-rounded align-middle me-2'></i>
<span id='qsJobSelectTitle' class='h5 mb-0'></span>
</div>
<p class='text-muted mb-3'>This customer has open jobs. Add these items to an existing job, or create a new one.</p>
<div class='form-group'>
<label class='form-label fw-bold' for='qsJobTarget'>Target job</label>
<select id='qsJobTarget' class='form-control' style='text-align:left;'>
<option value=''>Please Select&hellip;</option>
</select>
</div>
<div class='d-grid gap-2 mt-4'>
<button type='button' class='btn btn-primary' id='qsPickConfirm'>Generate Picking Slip</button>
<button type='button' class='btn btn-link' id='qsBack'>Back</button>
</div>
</div>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
<style>
.pac-container {
z-index: 10000 !important;
}
</style>
<div class="modal fade" id="editTaskModal" tabindex="-1" role="dialog" aria-labelledby="editTaskModalLabel" aria-hidden="true">
<div class="modal-dialog modal-md" role="document">
<div class="modal-content">
<div class="modal-header">
<div ID="editTaskModalTitle" class="h2">Edit Task</div>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" ID="editTaskModalBody">
</script>
<style>
.pac-container { z-index: 100000; }

</style>
<form ID="editTask" class="text-start" method="POST" action="tasksave.php" onsubmit="return validateForm(null, this, 0, 0); ">
<input type='hidden' ID='task_edit_id' name="id" value=''>
<input type='hidden' ID='task_edit_source' name="source" value='quote'>
<input type='hidden' ID='task_edit_sourceid' name="sourceid" value='2266'>
<input type='hidden' name="date" value='13-08-2026'>
<input type='hidden' name="redirect" value='quotedit&id='>
<div class="form-group ">
<label for="title" class=" ">Title</label>
<input type="text" class="form-control required" id="task_edit_title" name="title">
</div>
<div class="form-group ">
<label for="title" class=" ">Source</label>
<div id="task_edit_source_link"></div>
</div>
<div class="form-group">
<label for="description" class=" ">Description</label>
<textarea class="form-control" id="task_edit_description" name="description"></textarea>
</div>
<div class="form-group">
<label for="">Assigned To / Completed By</label>
<div class="input-group">
<div class="input-group-text"><i class="material-symbols-rounded">search</i></div>
<input type="text" ID="task_edit_staff"
name="staffFilter"
class="form-control required_always"
evo-filter-tgt="task_edit_staffSelect"
evo-filter-type="staff"
autocomplete="off"
onfocus="document.getElementById('task_edit_staffSelect').style.display='inline-block';">
</div>
<div class="filtered_list" style="position: absolute;z-index: 99999;background: white;box-shadow:10px 10px 5px #777;">
<select ID="task_edit_staffSelect" name="staff" class="form-control" size="30" style="display:none" onmouseup="this.style.display='none'" onblur="this.style.display='none'">
<option value="">Please Select</option>
</select>
</div>
</div>
<div class="form-group" ID="task_edit_subscribed_group">
<label for="task_edit_requiredby" class="">Additional Staff</label>
<select ID="task_edit_subscribed" name="staffid" class="form-control hidden" multiple>
<option>Not Required</option>
<option value='1' >Shane Cosgrove</option><option value='2' >Evolution Support</option><option value='3' >Shane Cosgrove</option><option value='4' >Mitch Wyatt</option><option value='7' >Bessie McInnes</option><option value='8' >Betty Shanley</option><option value='9' >Cody Bannister</option><option value='11' >Daniel Spaan</option><option value='12' >Dougal Colquhoun</option><option value='13' >Edward Walton</option><option value='14' >Ian Gisborne</option><option value='16' >Jayden Lee</option><option value='17' >Jed Lienert</option><option value='19' >Julian Pett</option><option value='21' >Liam Clark</option><option value='26' >Oliver Bley</option><option value='27' >Patric Levi</option><option value='28' >Samara Wyatt</option><option value='29' >Warren Wright</option><option value='30' >William Humphries</option><option value='31' >Leo Enter</option><option value='34' >Kristen Hartmann</option><option value='35' >Frazer Spaan</option><option value='38' >Zachary Zerk</option><option value='41' >Maria Colorado</option><option value='43' >Kelton Holme </option><option value='45' >Tyson Fowler</option><option value='46' >Peter Spooner</option><option value='48' >Brandon Nicolle</option><option value='50' >Jack Blackwell</option><option value='51' >Ashley Cole</option><option value='52' >Nash Attrill</option><option value='53' >Adam Love</option><option value='54' >Matthew Smith</option> </select>
<br>
</div>
<div class="form-group">
<label for="task_edit_requiredby" class="">Required By</label>
<input type="date" class="form-control required" id="task_edit_requiredby" name="requiredby">
</div>
<div class="form-group development">
<label for="task_edit_requiredtime" class="">Time</label>
<input type="time" class="form-control" id="task_edit_requiredtime" name="requiredtime">
</div>
<div class="form-group">
<div class="alert alert-secondary">
<div class="row">
<div class="col-5 fw-bold text-uppercase">Close Out Task</div>
<div class="col">
<div class="form-check form-check-inline">
<input type="checkbox" class="form-check-input" onchange = "if(this.checked == true ) { document.getElementById('task_edit_cancelled').checked = false; }" id="task_edit_complete" name="complete" value="2" >
<label for="task_edit_requiredtime" class="form-check-label">Completed</label>
</div>
<div class="form-check form-check-inline">
<input type="checkbox" class="form-check-input" id="task_edit_cancelled" name="cancelled" onchange = " if(this.checked == true ) { document.getElementById('task_edit_complete').checked = false; }">
<label for="task_edit_requiredtime" class="form-check-label">Cancelled</label>
</div>
</div>
</div>
</div>
</div>
<div class="form-group">
<input type="submit" class="btn btn-primary form-control" value="Save Task" id="task_edit_form_submit" name="updateTask">
</div>
</form>

<hr>

<div class="container">
<div class="row text-start">
<div class="col">
<h2>HISTORY</h2>

<div class="table-responsive" style="max-height:80px">
<table class="table table-sm">
<tbody ID="task_history">
</tbody>
</table>
</div>

</div>
</div>
</div>

<script>
/*
var cfilter = new mySelectFilter('staff','task_edit_staff');
document.getElementById("task_edit_staff").addEventListener("keyup",
function() {
cfilter.init();
}
);

document.getElementById("task_edit_staff").addEventListener("blur",
function() { hideTargetonBlur(document.getElementById("task_edit_staffSelect")); }, false);
*/
var multiSelectTaskSubscribers = new multiSelector({
unSelectWhenIndex0Selected : true,
container: '#task_edit_subscribed'
});

document.querySelector('#editTaskModal [type="submit"]').addEventListener ('mouseup', function (e) {
showErrorMessageInline ('', document.querySelector('#editTaskModal form'));
});


</script>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
<style>
.pac-container {
z-index: 10000 !important;
}
</style>
<div class="modal fade" id="addTaskModal" tabindex="-1" role="dialog" aria-labelledby="addTaskModalLabel" aria-hidden="true">
<div class="modal-dialog modal-md" role="document">
<div class="modal-content">
<div class="modal-header">
<div ID="addTaskModalTitle" class="h2">New Task</div>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" ID="addTaskModalBody">
<script>
if (typeof taskEdit == "undefined") {
var e = document.createElement("script");
e.src = "assets/js/modules/tasks.js";
e.type = "text/javascript";
document.getElementsByTagName("head")[0].appendChild(e);
}
</script>
<form ID="newTask" class="text-start" method="POST" action="tasksave.php" onsubmit="return validateForm(null, this, 0, 0); ">
<input type='hidden' name="source" value="quote">
<input type='hidden' id="task_add_srcid" name="sourceid" value="2266 ">
<input type='hidden' name="date" value="13-08-2026">
<div class="text-start">
<div class="form-group ">
<label for="title" class="">Title</label>
<input type="text" class="form-control required" id="title" name="title">
</div>
<div class="form-group">
<label for="task_add_description" class=" ">Description</label>
<textarea class="form-control" id="task_add_description" name="description"></textarea>
</div>
<div class="form-group">
<label for="">Staff Member</label>
<select ID="task_add_staffSelect"
name="staff"
class="form-control required_always"
style=""
data-static-options="1">
<option value="">Please Select</option>
<option value='1'>Shane Cosgrove</option><option value='2'>Evolution Support</option><option value='3'>Shane Cosgrove</option><option value='4'>Mitch Wyatt</option><option value='7'>Bessie McInnes</option><option value='8'>Betty Shanley</option><option value='9'>Cody Bannister</option><option value='11'>Daniel Spaan</option><option value='12'>Dougal Colquhoun</option><option value='13'>Edward Walton</option><option value='14'>Ian Gisborne</option><option value='16'>Jayden Lee</option><option value='17'>Jed Lienert</option><option value='19'>Julian Pett</option><option value='21'>Liam Clark</option><option value='26'>Oliver Bley</option><option value='27'>Patric Levi</option><option value='28'>Samara Wyatt</option><option value='29'>Warren Wright</option><option value='30'>William Humphries</option><option value='31'>Leo Enter</option><option value='34'>Kristen Hartmann</option><option value='35'>Frazer Spaan</option><option value='38'>Zachary Zerk</option><option value='41'>Maria Colorado</option><option value='43'>Kelton Holme </option><option value='45'>Tyson Fowler</option><option value='46'>Peter Spooner</option><option value='48'>Brandon Nicolle</option><option value='50'>Jack Blackwell</option><option value='51'>Ashley Cole</option><option value='52'>Nash Attrill</option><option value='53'>Adam Love</option><option value='54'>Matthew Smith</option> </select>
</div>
<div class="mb-1">
<label for="start-date" class=" ">Select additional staff</label>
<select ID="task_add_additional_staff" name="staffid" class="form-control" multiple>
<option>Not Required</option>
<option value='1'>Shane Cosgrove</option><option value='2'>Evolution Support</option><option value='3'>Shane Cosgrove</option><option value='4'>Mitch Wyatt</option><option value='7'>Bessie McInnes</option><option value='8'>Betty Shanley</option><option value='9'>Cody Bannister</option><option value='11'>Daniel Spaan</option><option value='12'>Dougal Colquhoun</option><option value='13'>Edward Walton</option><option value='14'>Ian Gisborne</option><option value='16'>Jayden Lee</option><option value='17'>Jed Lienert</option><option value='19'>Julian Pett</option><option value='21'>Liam Clark</option><option value='26'>Oliver Bley</option><option value='27'>Patric Levi</option><option value='28'>Samara Wyatt</option><option value='29'>Warren Wright</option><option value='30'>William Humphries</option><option value='31'>Leo Enter</option><option value='34'>Kristen Hartmann</option><option value='35'>Frazer Spaan</option><option value='38'>Zachary Zerk</option><option value='41'>Maria Colorado</option><option value='43'>Kelton Holme </option><option value='45'>Tyson Fowler</option><option value='46'>Peter Spooner</option><option value='48'>Brandon Nicolle</option><option value='50'>Jack Blackwell</option><option value='51'>Ashley Cole</option><option value='52'>Nash Attrill</option><option value='53'>Adam Love</option><option value='54'>Matthew Smith</option> </select>
</div>
<div class="form-group">
<label for="start-date" class=" ">Required By</label>
<input type="date" class="form-control required" id="requiredby" name="requiredby">
</div>
<div class="form-group">
<input type="submit" class="form-control" value="Add Task" name="addTask">
</div>
</div>
</form>
<script>
/*
var task_add_staff = new mySelectFilter('staff','task_add_staff');
task_add_staff.init();
document.getElementById("task_add_staff").addEventListener("keyup",
function() {
task_add_staff.init();
}
);
*/
/*
var task_add_staff_picker = new mySelectFilter('staff','task_add_staff_picker');
task_add_staff_picker.init();
document.getElementById("task_add_staff_picker").addEventListener("keyup",
function() {
task_add_staff_picker.init();
}
);
*/
var multiSelectObjects = new multiSelector({
unSelectWhenIndex0Selected : true,
container: '#task_add_additional_staff'
});

var multiSelectstaff = new multiSelector({
unSelectWhenIndex0Selected : true,
container: '#task_add_staffSelect'
});

document.querySelector('#addTaskModal').addEventListener ('shown.bs.modal', function (e) {
MS("task_add_staffSelect").val(0);
});

document.querySelector('#addTaskModal [type="submit"]').addEventListener ('mouseup', function (e) {
showErrorMessageInline ('', document.querySelector('#addTaskModal form'));
});


</script>

</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
<script>
document.addEventListener("DOMContentLoaded", () => {
if(document.getElementById("sites").value > 0 && 145 < 1 ) loadSite();
});

//################################
//# DEFINE EVENT LISTENERS
//################################
costPlusToggle(1);
//invoiceTotal();
var nav_tab_buttons = document.getElementsByClassName("tab_navigation");
nav_tab_buttons.forEach(el => el.addEventListener("click", function () { sectionFilter(el.getAttribute("data-id"), el.getAttribute("data-name"),"dataTable"); console.log(el.getAttribute("data-name")); }));
/*
ddEventListener("click", function () {
sectionFilter(this.data-id, this.data-name, 'datatable');
});
*/
//###SHOW IMPORT QUOTE OPTIONS####
document.getElementById("quoteFunction").addEventListener("change", function() {
enableFunction();
}, false);
document.getElementById("invCategory").addEventListener("change", function() {
filterSelect("inv", "itemFilter");
}, false);
/*
document.getElementById("userEdit").addEventListener("mouseup", function() {
var y = document.getElementById("clientSelect").selectedIndex;
var x = document.getElementById("clientSelect").options[y].value;
window.location.href = 'index.php?page=clientedit&clientid=' + x;
}, false);
*/
//###CREATE INVOICE####
document.getElementById("invoiceCreate").addEventListener("mouseup", function() {
if (confirm("Create an invoice from this quotation?")) {
invoiceCreate();
}
}, false);

//###DROP DOWN FILTERS####
document.getElementById("quoteImportList").addEventListener("change", function() {
document.getElementById("quoteImportId").value = this.options[this.selectedIndex].text;
},
false);

document.getElementById("quoteImportId").addEventListener("keyup", function() {
filterQuotes();
}, false);
document.getElementById("quoteImportId").addEventListener("paste", function() {
filterQuotes();
}, false);
document.getElementById("quoteImportList").addEventListener("blur", function() {
this.style.display = "none";
}, false);
document.getElementById("loadNoteTemplate").addEventListener("mouseup", function() {
loadNoteTemplate();
}, false);
document.getElementById("clientFilter").addEventListener("blur", function() {
hideTargetonBlur(document.getElementById("clientSelect"));
}, false);
document.getElementById("quoteImportId").addEventListener("blur", function() {
hideTargetonBlur(document.getElementById("quoteImportList"));
}, false);
document.getElementById("contact").addEventListener("blur", function() {
hideTargetonBlur(document.getElementById("contacts"));
}, false);
document.getElementById("itemFilter").addEventListener("blur", function() {
hideTargetonBlur(document.getElementById("itemFilterSelect"));
}, false);
document.getElementById("site").addEventListener("blur", function() {
hideTargetonBlur(document.getElementById("sites"));
}, false);
document.getElementById("sites").addEventListener("change", function() {
loadSite();
}, false);

document.getElementById("contacts").addEventListener("mouseup", function() {
var x = document.getElementById("contacts").selectedIndex;
document.getElementById("primaryEmail").value = document.getElementById("contacts").options[x].getAttribute("data-email");
document.getElementById("primaryPhone").value = document.getElementById("contacts").options[x].getAttribute("data-phone");
document.getElementById("mobile").value = document.getElementById("contacts").options[x].getAttribute("data-mobile");
}, false);

//## COST PLUS TOGGLE
document.getElementById("costplus").addEventListener("change", function() {
costPlusToggle();
}, false);
document.getElementById("priceOverride").addEventListener("input", function() {
delay(pricingOverride);
document.getElementById("sliderVal").innerHTML = this.value;
}, false);

//## SECTION MANAGEMENT
var sectDelChk = document.getElementById("section_delItems");
document.getElementById("manageSections").addEventListener("mouseup", function() {
if (document.getElementById("locked").value == "1") {
alert("This quotation is locked");
} else {
sectionAdd();
}
}, false);
document.getElementById("sectionEdit").addEventListener("mouseup", function() {
sectionEdit();
}, false);
document.getElementById("sectionClone").addEventListener("mouseup", function() {
sectionClone();
}, false);
document.getElementById("sectionDel").addEventListener("mouseup", function() {
if (sectDelChk.checked == true && confirm("This will delete the section and ALL ITEMS in it")) {
sectionEdit(2);
}
if (sectDelChk.checked != true && confirm("This will delete the section, items will be kept")) {
sectionEdit(1);
}
}, false);
//costPlusToggle();

//## PROMPT SAVES AND WARN IF LEAVING
var unsaved = false;
var submitted = false;
document.getElementById("savebutton").addEventListener("mouseup", function() {
if (document.getElementById("locked").value > "1") {
alert("This quotation is locked");
} else {
submitted = true;
if (validateForm(null, document.getElementById('form')) == true) {
document.getElementById('form').submit();
}
}
}, false);
document.getElementById("autoMargin").addEventListener("click", function() {
autoMargin();
if (document.getElementById("locked").value == "1") {
alert("This quotation is locked");
} else {
submitted = true;
if (validateForm(null, document.getElementById("form")) == true && isNaN(parseFloat(document.getElementById("targetVal").value)) == false) {
document.getElementById('form').submit();
}
}
}, false);
document.querySelector('#markQuoteAsSentBtn').addEventListener('mouseup', function () {
if (document.getElementById("locked").value > "1") {
alert("This quotation is locked");
} else {
submitted = true;
document.querySelector('#status').value = 1;
if (validateForm(null, document.getElementById('form')) == true) {
document.getElementById('form').submit();
}
}
});
document.querySelector('#unmarkQuoteAsSentBtn').addEventListener('mouseup', function () {
if (document.getElementById("locked").value > "1") {
alert("This quotation is locked");
} else {
submitted = true;
document.querySelector('#status').value = 0;
if (validateForm(null, document.getElementById('form')) == true) {
document.getElementById('form').submit();
}
}
});

document.getElementById("form").addEventListener("submit", function() {
submitted = true;
});

function unloadPage() {
if (unsaved && !submitted) {
return "You have unsaved changes on this page. Do you want to leave this page and discard your changes or stay on this page?";
}
}
window.onbeforeunload = unloadPage;


var lockedItems = document.getElementsByClassName("locked");
for (i = 0; i < lockedItems.length; i++) {
lockedItems[i].addEventListener("mousedown", function(e) {
e.preventDefault();
doWarning("This item description cannot be changed");
}, false);
}

function lockedItem() {
e.preventDefault();
doWarning("This item description cannot be changed");
//document.getElementById('0').focus();
}
//########################
//# EXPANDING TEXTAREA
//########################
function makeExpandingArea(container) {
var area = container.querySelector('textarea');
var span = container.querySelector('span');
if (area.addEventListener) {
area.addEventListener('input', function() {
span.textContent = area.value;
}, false);
span.textContent = area.value;
} else if (area.attachEvent) {
// IE8 compatibility
area.attachEvent('onpropertychange', function() {
span.innerText = area.value;
});
span.innerText = area.value;
}
// Enable extra CSS
container.className += " active";
}

function toggleTable() {
var x = "550px";
var y = document.getElementById("dataTableBody");
if (y.style.maxHeight == x) {
y.style.maxHeight = "3000px";
y.style.height = "3000px";
return;
}
if (y.style.maxHeight == "3000px") {
y.style.maxHeight = x;
}
}

//NOTES CLAUSES AND TEMPLATES
var triggerTabList = [].slice.call(document.querySelectorAll('#myTab a'))
triggerTabList.forEach(function(triggerEl) {
var tabTrigger = new bootstrap.Tab(triggerEl)

triggerEl.addEventListener('click', function(event) {
event.preventDefault()
tabTrigger.show()
})
});

var clauses = document.getElementsByClassName("quote_clause");
for (i = 0; i < clauses.length; i++) {
clauses[i].addEventListener("click", function() {
loadNoteTemplate(this.value, "clause");
}, false);
}

function showNotes() {
var existing = tinyMCE.get("notes1").dom.select(".clause");
//console.log("Marking active clauses");
if (existing.length == 0) {
return;
}
for (i = 0; i < existing.length; i++) {
for (x = 0; x < clauses.length; x++) {
if (clauses[x].value == existing[i].id) {
//console.log(existing[i].id);
clauses[x].checked = "true";
}
}
}
}
initQuoteItemDropzone();
const draggables = document.querySelectorAll('.draggable')
const containers = document.querySelectorAll('.sectionCount')

draggables.forEach(draggable => {
makeRowDraggable(draggable);
})

containers.forEach(container => {
makeTabDroppable(container);
})

if (document.getElementById('addInventoryAdvancedOptionModal') != undefined) document.getElementById('addInventoryAdvancedOptionModal').addEventListener ('hidden.bs.modal', function (e) {
if (advBomComplete != 1) {
if (modifyItem != true)
modalOpen ('addInventoryModal');
}
});

var advBomComplete = 0;
var stepsRestored = [0, 0, 0, 0, 0, 0];
var selectedRoute = 0;
var routeData = {};
var lastSelectedRoute = 0;
var dupProcess;
var dupMessage;
var dupProcessId;
var dupProcessTimer;
var labour = 'LABOUR';
var routeJSONData = {};
var adbBomGetRoute;
var originalRouteData = undefined;
var bomPrevRow = undefined;
var procPrevRow = undefined;
var advBomMFProcTimeEntryRow = undefined;
var navButtons = undefined;
var cloneKitPreviewTable = undefined;
var cloneKitPreviewRow = undefined;
var advBomExplanation = 'Labour Cost is the sum of all executing all the processes in the selected route.<br>* <i>If the "Include Setup Time and Cost in \'Factory Labour Item\' is checked, the Labour Cost will include sum of the [Setup Cost] for each of the processes.</i><br><br><h4><b>The formulas are:</b></h4><br><b>Labour Cost</b> = SUM ( <span style="color:red;">[Unit Cost]</span> ) + SUM ( <span style="color:red;">[Setup Cost]</span> ) + SUM ( <span style="color:red;">[ Process Cost ]</span> ) - SUM ( <span style="color:red;">[ Take Up Cost ]</span> )<br><br><b>Setup Cost</b> = <span style="color:red;">[Setup Time]</span> * <span style="color:red;">[Unit Cost]</span> / 60 minutes<br><br><br><h4><b>Notes:</b></h4><br>1. Items in <span style="color:red;">[RED]</span> are values filled up on the page.<br><Br>2. Take Up<br><ul><li>The expense that the company will cover in manufacturing the item</li></ul>3. Qty Break<br><ul><li>The number of items created per batch</li></ul>4. Time<ul><li>The time in minutes to complete the process</li></ul>5. Setup Time<ul><li>The tmie in minutes to setup the process</li></ul><br><h4><b>Overrides:</b></h4><br> When an existing labour item is selected as the Factory Labour Item for the new item being created, the Factor Labour Quantity is the selected labour item cost divided by the [Labour Cost]';
var BOMprices = [];
var aquoteURL = (window.location.href != undefined ? window.location.href.split('quoteid=') : '');
var advBomBaseURL = (aquoteURL.length > 1 ? (aquoteURL[0] + 'quoteid' + aquoteURL[1].split('&')[0]).split('?')[1] : '');
var currencyCode = '$ ';
var oldinvarray;

function showInvAddAdvanceOptionStep(advOptStep = document.getElementById('advOptCurStep').value) {
if (advOptStep <= 0) {
if (modifyItem == true && advancedBOMBuilder != undefined) {
} else {
modalClose('addInventoryAdvancedOptionModal');
modalOpen('addInventoryModal');
setTimeout (function () { restoreItemAdd(); }, 100);
document.querySelector('#addItem').disabled = false;
document.querySelector('#addItemAdvancedOption').disabled = false;
}
return false;
}
if (document.querySelectorAll('#advancedBOMBuilder .nav-item')[advOptStep - 1].disabled == true) return false;
if (advOptStep - document.getElementById('advOptCurStep').value == 1) {
if (!validateCurrentStep()) return false;
}
if (advOptStep == 3 && document.querySelector('.advBomDuplicateProcessError') != undefined) {
document.querySelector('#advancedOptionsStep2').scrollTo(0, document.querySelector('#advancedOptionsStep2').getBoundingClientRect().height);
return false;
}
document.getElementById('actImportBOM').style.display = 'none';
document.querySelector('.AdvBomImportBOM').style.display = 'none';
document.querySelector('.custProcess1').style.display = 'none';
document.querySelector('.custProcess2').style.display = 'none';
if (advOptStep == 3 && selectedRoute == 0) advOptStep = 4;
document.querySelector('#advancedOptionsStep1').style.display = 'none';
document.querySelector('#advancedOptionsStep2').style.display = 'none';
document.querySelector('#advancedOptionsStep3').style.display = 'none';
document.querySelector('#advancedOptionsStep4').style.display = 'none';
document.querySelector('#advancedOptionsStep5').style.display = 'none';
document.querySelector('#advancedOptionsStep' + advOptStep).style.display = '';
document.getElementById('advOptCurStep').value = advOptStep;
document.getElementById('btnAdvOptPrev').style.display = 'inline-block';
document.getElementById('btnAdvOptNext').style.display = 'inline-block';
document.getElementById('btnAdvOptFinish').style.display = 'none';
document.getElementById('btnAdvOptRestart').style.display = 'none';
document.querySelector('.advBomSTCCB').style.display = 'none';
document.querySelectorAll('.advOptTabCons').forEach(advOptElem => {
advOptElem.style.display = 'none';
});
document.querySelectorAll('.advOptTabCons')[advOptStep - 1].style.display = '';
if (advOptStep == 1) {
} else if (advOptStep == 5) {
document.getElementById('btnAdvOptNext').style.display = 'none';
} else { }
document.querySelector('#navbarNav').querySelectorAll('.nav-item').forEach((elem, ind) => {
elem.classList.remove('active');
if (elem.dataset.index == advOptStep) {
elem.classList.add('active');
elem.style.display = '';
elem.classList.remove('d-none');
if (elem.nextElementSibling != undefined) {
elem.nextElementSibling.style.display = '';
elem.nextElementSibling.classList.remove('d-none');
}
}
});
document.querySelector('#advancedOptionsStep' + advOptStep).scrollTo(0, 0);
switch (parseInt(advOptStep)) {
case 1:
document.querySelectorAll('.inv_values').forEach(p => { advBomupdateRow (p); });
document.getElementById('actImportBOM').style.display = '';
break;
case 2:
if (document.querySelector('#advBomRoutePreviewName').innerHTML != document.querySelector('#advBomRoute').options[document.querySelector('#advBomRoute').selectedIndex].text) { selectRoute (document.querySelector('#advBomRoute').value); }
document.getElementById('processList2').style.height = document.getElementById('processList').offsetHeight + 'px';
showHideStep2Buttons();
break;
case 3:
document.querySelector('#advancedOptionsStep3').classList.add('d-none');
goToStep3();
document.querySelectorAll('#advBomMFProcTimeEntry tr:not(.mfproctimecostrow)').forEach (e => {
bval = e.querySelector('[name="advbommfp_alloc_qty[]"]').getAttribute('bval');
if (bval != undefined)
e.querySelector('[name="advbommfp_alloc_qty[]"]').value = bval;
});
invAddComputeAll ();
updateLabourData(); document.querySelector('#advancedOptionsStep3').classList.remove('d-none');
break;
case 4:
var sel = document.querySelector('#advBomLabourIdSelect');
if (sel.selectedIndex == -1 && sel.dataset.oldval != undefined) {
sel.value = sel.dataset.oldval;
updateLabourData();
}
previewNewItem();
document.querySelector('#advancedOptionsStep4').scrollTo(0, 0);
break;
case 5:
if (modifyItem == true && advancedBOMBuilder != undefined) {
} else {
document.getElementById('btnAdvOptPrev').style.display = 'none';
document.querySelector('#advancedOptionsStep5').scrollTo(0, 0);
document.querySelector('#addInventoryAdvancedOptionModal .close').style.display = 'none';
setTimeout ("document.querySelector('#addInventoryAdvancedOptionModal .close').style.display = '';", 5000);
addNewItem();
}
break;
}
selectOnFocus();
checkAdvBomScroll();
if (selectedRoute == 0) {
document.querySelector('#advBomBuilderForm .nav-item[data-index="3"]').nextElementSibling.style.display = 'none';
document.querySelector('#advBomBuilderForm .nav-item[data-index="3"]').style.display = 'none';
} else {
document.querySelector('#advBomBuilderForm .nav-item[data-index="3"]').nextElementSibling.style.display = '';
document.querySelector('#advBomBuilderForm .nav-item[data-index="3"]').style.display = '';
}
}

function advOptPrevStep() {
if (selectedRoute == 0 && parseInt(document.getElementById('advOptCurStep').value) == 4)
document.getElementById('advOptCurStep').value = parseInt(document.getElementById('advOptCurStep').value) - 1;
document.querySelectorAll('#advBomMFProcTimeEntry tr:not(.mfproctimecostrow)').forEach (e => {
e.querySelector('[name="advbommfp_alloc_qty[]"]').setAttribute('bval', e.querySelector('[name="advbommfp_alloc_qty[]"]').value);
});
document.getElementById('advOptCurStep').value = parseInt(document.getElementById('advOptCurStep').value) - 1;
showInvAddAdvanceOptionStep();
}

function advOptNextStep() {
if (validateCurrentStep('next')) {
document.getElementById('advOptCurStep').value = parseInt(document.getElementById('advOptCurStep').value) + 1;
showInvAddAdvanceOptionStep();
}
}

function advOptCancel () {
clearUserSetting('advBOM%')
modalClose ('addInventoryAdvancedOptionModal');
}

if (typeof advanceOptionModal != 'undefined' && advanceOptionModal == 1) {
document.getElementById('addInventoryAdvancedOptionModal').addEventListener('show.bs.modal', function () {
document.querySelector('#addInventoryAdvancedOptionModal .modal-dialog').style.minWidth = '1024px';
oldinvarray = invArray;
document.querySelector('#advBomLabourIdSelect').style.display = 'none';
while (document.querySelector('#dataTableAdvBomBody').children.length > 2) {
document.querySelector('#dataTableAdvBomBody tr:last-child').remove();
}
calculateAdvBTotal();
stepsRestored = [0, 0, 0, 0, 0, 0];
document.querySelectorAll('#advancedBOMBuilder .nav-item').forEach(ni => { ni.disabled = false; ni.removeAttribute('disabled'); });
document.getElementById('advOptCurStep').value = 1;
advBomComplete = 0;
selectedRoute = 0;
document.querySelector('#advBomRoute').value = 0;
if (navButtons == undefined) navButtons = document.querySelector('.navigationButtons').innerHTML;
document.querySelector('.navigationButtons').innerHTML = '';
document.querySelector('#addInventoryAdvancedOptionModal').querySelector('.modal-footer').innerHTML = navButtons;
if (bomPrevRow == undefined) bomPrevRow = document.querySelector('.advBomPrevBOM').children[0].outerHTML;
if (procPrevRow == undefined) procPrevRow = document.querySelector('#advBomPreviewProcess').children[0].outerHTML;
if (advBomMFProcTimeEntryRow == undefined) advBomMFProcTimeEntryRow = document.querySelector('#advBomMFProcTimeEntry').innerHTML;
if (cloneKitPreviewRow == undefined) cloneKitPreviewRow = document.querySelector('.cloneKitPreview table tbody').innerHTML;
document.querySelector('.cloneKitPreview table tbody').innerHTML = '${cloneKitPreviewRows}';
if (cloneKitPreviewTable == undefined) cloneKitPreviewTable = document.querySelector('.cloneKitPreview').innerHTML;
showInvAddAdvanceOptionStep(1);
document.getElementById('processList2').style.height = document.getElementById('processList').offsetHeight + 'px';
restorePendingWork();
document.querySelector('#advancedOptionsStep2').style.display = 'none';
document.querySelector('#advancedOptionsStep3').style.display = 'none';
document.querySelector('#advancedOptionsStep4').style.display = 'none';
document.querySelector('#advancedOptionsStep5').style.display = 'none';
mergeDuplicateBoms();
getRealTimeBOMPricing();
document.querySelectorAll('[action="quoteditsave.php"]').forEach(e => {
e.setAttribute('xonsubmit', e.getAttribute('onsubmit'));
e.setAttribute('onsubmit', 'return false');
});
document.querySelector('#addInventoryAdvancedOptionModal .close').classList.add('d-none');
document.querySelector('.reviewentryheading').innerHTML = 'Review entry';
if (document.querySelector('.AdvBomImportBOM').nextElementSibling.tagName == 'BR')
document.querySelector('.AdvBomImportBOM').nextElementSibling.remove();
if (document.querySelector('.AdvBomImportBOM').nextElementSibling.tagName == 'BR')
document.querySelector('.AdvBomImportBOM').nextElementSibling.remove();
});
document.getElementById('addInventoryAdvancedOptionModal').addEventListener('hidden.bs.modal', function () {
invArray = oldinvarray;
document.querySelectorAll('[action="quoteditsave.php"]').forEach(e => {
e.setAttribute('onsubmit', e.getAttribute('xonsubmit'));
e.setAttribute('xonsubmit', '');
});
setTimeout (function () { restoreItemAdd(); }, 100);
});
} else {
showInvAddAdvanceOptionStep(1);
restorePendingWork();
}

document.querySelector('#advancedOptionsStep2').style.display = 'none';
document.querySelector('#advancedOptionsStep3').style.display = 'none';
document.querySelector('#advancedOptionsStep4').style.display = 'none';
document.querySelector('#advancedOptionsStep5').style.display = 'none';

function restorePendingWork() {
if (modifyItem) return false;
advOptStep = 1;
if (stepsRestored[advOptStep] == 0) {
savedData = findUserSetting('advBOMStep' + advOptStep, [], new Date('2024-06-30'), advBomBaseURL);
if (savedData.length > 0) {
table = document.getElementById('dataTableAdvBomBody');
table.rows[1].insertAdjacentHTML('afterend', savedData.join(' '));
document.querySelectorAll('#dataTableAdvBomBody .AdvBomcostvalue').forEach(invtd => {
if (invtd.tagName == 'TD') {
invtd.classList.remove('AdvBomcostvalue');
invtd.innerHTML = '$ <input type="text" class="AdvBomcostvalue selfocus datainput" value="' + invtd.innerHTML.replace('$','').trim() + '">';
}
});
document.querySelectorAll('#dataTableAdvBomBody .AdvBomcostvalue').forEach(invtd => {
if (invtd.tagName == 'INPUT' && !invtd.classList.contains('datainput'))
invtd.classList.add('datainput');
});
initialize_select_filters ();
}
stepsRestored[advOptStep] = 1;
}
advOptStep = 2;
originalRouteData = undefined;
if (stepsRestored[advOptStep] == 0) {
savedData = findUserSetting('advBOMStep' + advOptStep, [], new Date('2024-06-30'), advBomBaseURL);
if (savedData.route != undefined) {
importRes = savedData.routedata;
selectedRoute = savedData.route;
document.querySelector('#importedRoute').value = importRes.importedRoute;
if (savedData.route < 0)
selectedRoute = document.querySelector('#importedRoute').value;
document.getElementById('advBomRoute').value = selectedRoute;
var formData = new FormData;
formData.append('id', selectedRoute);
document.querySelectorAll('#advancedBOMBuilder .nav-item')[2].classList.remove('d-none');
document.querySelectorAll('#advancedBOMBuilder .nav-item')[2].nextElementSibling.classList.remove('d-none');
rdata = {};
rdata.route = selectedRoute;
rdata.routedata = {};
if (savedData.route >= 0) {
ajaxSubmit(function (importRes) {
originalRouteData = importRes;
routeJSONData = importRes;
routeData = importRes;
rdata.routedata = routeData;
toggleProcessTimeEntry();
setTimeout (function () { selectRoute (document.querySelector('#advBomRoute').value); }, 100);
}, formData, 'invaddadvanced.php', 'importRoute', 0);
}
if (savedData.route < 0) {
toggleProcessTimeEntry();
document.querySelector('#advBomRoute').value = selectedRoute;
selectRoute (selectedRoute, function () {
rdata.route = savedData.route;
originalRouteData = importRes;
routeJSONData = importRes;
routeData = importRes;
rdata.routedata = routeData;
selectedRoute = savedData.route;
if (savedData.route == -1)
advBomImportProcess ();
if (savedData.route == -2)
advBomCreateProcess ();
document.querySelector('#AdvBomRouteName').value = importRes.name;
document.querySelector('#AdvBomRouteDescription').value = importRes.description;
document.querySelector('.custProcess1').style.display = 'none';
document.querySelector('.custProcess2').style.display = 'none';
document.querySelector('.custProcess4').style.display = 'none';
});
setTimeout (function () {
}, 2000);
}
}
stepsRestored[advOptStep] = 1;
}
getRealTimeBOMPricing();
}

function getAdvBOMProduct() {
if (document.getElementById("AdvBomitemFilterSelect").selectedIndex == -1) return false;
srcopt = document.getElementById("AdvBomitemFilterSelect").options[document.getElementById("AdvBomitemFilterSelect").selectedIndex];
document.getElementById("AdvBomqty").value = "";
document.getElementById("AdvBomtheDescription").value = setDefaultValue(srcopt.getAttribute("data-description"), "") + '\n\n' + setDefaultValue(srcopt.getAttribute("data-customer_notes"), "");
document.getElementById("AdvBomuom").innerHTML = srcopt.getAttribute("data-uom");
document.getElementById("AdvBomsohcol").innerHTML = srcopt.getAttribute("data-soh");
document.getElementById("AdvBomcostcol").innerHTML = Math.round(srcopt.getAttribute("data-cost") * 100) / 100;
document.getElementById("AdvBomcost").value = Math.round(srcopt.getAttribute("data-cost") * 100) / 100;
document.getElementById("AdvBomavgcostcol").innerHTML = Math.round(srcopt.getAttribute("data-costavg") * 100) / 100;
document.getElementById("AdvBomavgcost").value = Math.round(srcopt.getAttribute("data-costavg") * 100) / 100;
document.getElementById("AdvBomcostmethod").value = srcopt.getAttribute("data-costmethod");
document.getElementById("AdvBomproductionmethod").value = srcopt.getAttribute("data-productionmethod");
document.getElementById("AdvBomallocated").value = srcopt.getAttribute("data-allocated");
var availVal = ((parseFloat(srcopt.getAttribute("data-soh")) - parseFloat(srcopt.getAttribute("data-allocated"))) * 100) / 100;
var branchs = document.querySelector('select[name="branch"]');
var branch = branchs.value;
var branchSOH = JSON.parse(srcopt.getAttribute('data-branchsoh'));
var branchSOHHTML = '';
for (var c = 0; c < branchSOH.length; c++) {
var avail = ((parseFloat(branchSOH[c].soh) - parseFloat(branchSOH[c].allocated)) * 100) / 100;
branchSOHHTML += `<tr><td>${branchSOH[c].name}</td><td class=text-end>${branchSOH[c].soh}</td><td class=text-end>${branchSOH[c].allocated}</td><td class=text-end>${avail}</td></tr>`;
if (branchSOH[c].branchid == branch) {
availVal = avail;
doNotice ('Stock on-hand shown is for branch ' + branchs.options[branchs.selectedIndex].text + '.<br>You may click on the SOH value to view SOH for all branches.', 10000);
break;
}
}
if (branchSOHHTML != '') {
branchSOHHTML = '<table class=table><thead><tr><th>Branch</th><th>SOH</th><th>Allocated</th><th>Available</th></tr></thead><tbody' + branchSOHHTML + '</tbody></table>';
if (document.querySelector('.sohpopup') != undefined)
document.querySelector('.sohpopup').remove();
setTimeout ("if (document.querySelector('.sohpopup') != undefined) document.querySelector('.sohpopup').remove();", 5000);
} else
branchSOHHTML = 'No branch SOH information found';
if (isNaN(availVal)) availVal = 0;
availVal = Math.round(availVal * 1000) / 1000;
document.getElementById("AdvBomavailText").innerHTML = '<a href="javascript:;" onmouseup="doAlertModal(\'' + branchSOHHTML + '\', undefined, \'Stock Information\');">' + availVal + '<div style="position:absolute;" class="sohpopup mt-3 p-2 bg bg-light border border-dark"><span class="material-symbols-rounded" style="font-size: 5rem;position: absolute;top: -2.9rem;left: 20px;color: black;">arrow_drop_up</span>Click me to see all Branches SOH</div>' + '</a>';
document.getElementById("AdvBomavail").value = availVal;
document.getElementById('AdvBomqty').value = '1';
document.getElementById('AdvBomqty').focus();
document.getElementById('AdvBomqty').select();
setTimeout (function () { document.getElementById('AdvBomitemFilter').value = (srcopt.getAttribute('data-code') != undefined) ? srcopt.getAttribute('data-code').trim().replaceAll(String.fromCharCode(9),'') : ''; }, 20);
}

function addAdvBOMDataRow(tableID, from = '', bomData = undefined) {
if (bomData == undefined) {
if (document.getElementById('AdvBomitemFilter').value.trim() == 'Please Select') {
doAlertModal('Please select an item from the list', document.getElementById('AdvBomitemFilter'));
document.getElementById("AdvBomitemFilterSelect").selectedIndex = -1;
document.getElementById("AdvBomitemFilter").value = '';
return false;
}

if (isNaN(parseFloat(document.getElementById('AdvBomqty').value.trim())) || parseFloat(document.getElementById('AdvBomqty').value.trim()) <= 0) {
doAlertModal('Quantity cannot be zero', document.getElementById('AdvBomqty'));
return false;
}
}

var element0a = document.getElementById("AdvBomitemFilterSelect").selectedIndex;
if ((bomData != undefined ? bomData.code : document.getElementById("AdvBomitemFilterSelect").options[element0a].dataset.code) == undefined) {
document.getElementById("AdvBomitemFilterSelect").selectedIndex = -1;
document.getElementById("AdvBomitemFilter").value = '';
doAlertModal('Please select an item from the list', document.getElementById('AdvBomitemFilter'));
return false;
}

var table = from == 'bom' ? document.getElementById(tableID).getElementsByTagName('tbody')[0] : document.getElementById(tableID);
var rowCount = table.rows.length;
var row = table.insertRow(0);
row.classList.add("inv_values");
row.id = "AdvBomRowLine" + rowCount;
row.setAttribute('bomdata', JSON.stringify(bomData));
var rowNumber = (rowCount + 1);
var costValue = (bomData != undefined ? bomData.cost : document.getElementById("AdvBomcost").value);
var costavgValue = (bomData != undefined ? bomData.costavg : document.getElementById("AdvBomavgcost").value);

var cell0 = row.insertCell(0);
var element0 = document.createElement("input");
cell0.classList.add("AdvBomabtd0");
element0.name = "AdvBomitemid[]";
element0.type = "hidden";
element0.value = (bomData != undefined ? bomData.id : document.getElementById("AdvBomitemFilterSelect").options[element0a].value);
h = '<div class="form-group row m-0 p-0 w-100">';
h += '<div class="input-group p-0 w-0">';
h += '<b class="advBomRowsLbl">' + (rowCount + 1) + '.</b>&nbsp;&nbsp;';
h += '<div class="input-group-text d-none"><i class="material-symbols-rounded">search</i></div>';
h += '<input onkeyup="checkrestoreAdvBomDesc(this);" onblur="this.previousElementSibling.classList.add(\'d-none\');" onfocus="this.previousElementSibling.classList.remove(\'d-none\');this.dataset.oldval = this.value;document.querySelector(\'#AdvBomitemFilterSelect' + rowCount + '\').dataset.oldval = document.querySelector(\'#AdvBomitemFilterSelect' + rowCount + '\').value;" type="text" name="AdvBomitemFilter' + rowCount + '" class="form-control advbomitemfilter" ID="AdvBomitemFilter' + rowCount + '" evo-filter-tgt="AdvBomitemFilterSelect' + rowCount + '" evo-filter-type="inv" value="' + (bomData != undefined ? bomData.code : document.getElementById("AdvBomitemFilterSelect").options[element0a].dataset.code) + '" placeholder="Item Code" data-selected="' + (bomData != undefined ? bomData.id : document.getElementById("AdvBomitemFilterSelect").options[element0a].value) + '">';
h += '</div>';
h += '<div class="filtered_list">';
h += '<select class="filtered_list form-control AdvBomitemFilterSelect" name="AdvBomitemFilterSelect' + rowCount + '" id="AdvBomitemFilterSelect' + rowCount + '" size=8 onmouseup="updateAdvBomLineItem(this);" data-selected="' + (bomData != undefined ? bomData.id : document.getElementById("AdvBomitemFilterSelect").options[element0a].value) + '">';
h += '<option>Please Select</option>';
h += '</select>';
h += '</div>';
h += '<textarea name="AdvBomitemdescription[]" placeholder="Description" id="AdvBomdesc' + rowCount + '" class="datainput AdvBomitemDesc mx-0" onfocus="this.style.backgroundColor = \'#CCCCCC\';" onblur="hideFormBorder(this.id);" data-code="' + (modifyQuoteItemID != 0 && bomData != undefined ? bomData.code : '') + '" data-desc="' + (modifyQuoteItemID != 0 && bomData != undefined ? bomData.bomdescription : '') + '" ' + (modifyQuoteItemID ? ' onkeyup="restoreAdvBomDesc(this);" ' : '') + '>' + (bomData != undefined ? bomData.bomdescription : document.getElementById("AdvBomtheDescription").value) + '</textarea><input type="hidden" name="AdvBomItemCat[]" class="AdvBomItemCat" value="' + (bomData != undefined ? bomData.cat : document.getElementById("AdvBomitemFilterSelect").options[element0a].dataset.cat) + '">';
h += '</div>';
cell0.innerHTML = h;
cell0.appendChild(element0);

var cell2 = row.insertCell(1);
cell2.classList.add("AdvBomsohvalue");
cell2.innerHTML = (bomData != undefined ? bomData.soh : (document.getElementById("AdvBomsohcol").innerHTML.trim() == '' ? 0 : document.getElementById("AdvBomsohcol").innerHTML));
cell2.classList.add('d-none');

var cell2a = row.insertCell(1);
cell2a.classList.add("AdvBomuom");
cell2a.innerHTML = (bomData != undefined ? bomData.uom : (document.getElementById("AdvBomuom").innerHTML.trim() == '' ? 0 : document.getElementById("AdvBomuom").innerHTML));

var cell3 = row.insertCell(2);
cell3.classList.add("AdvBomavailvalue");
var availVal = numWithDec ((bomData != undefined ? bomData.soh - bomData.allocated : parseFloat(document.getElementById("AdvBomsohcol").innerHTML) - document.getElementById("AdvBomallocated").value), 2);
if (isNaN(availVal)) availVal = 0;
cell3.innerHTML = availVal;

var cell4 = row.insertCell(3);
var element4 = document.createElement("input");
element4.classList.add("AdvBomcostvalue");
element4.classList.add("selfocus");
element4.classList.add("datainput");
element4.classList.add("navkey");
cell4.innerHTML = currencyCode;
element4.value = numWithDec (bomData != undefined ? bomData.cost : document.getElementById("AdvBomcostcol").innerHTML, 3);
cell4.appendChild(element4);

if (from == 'bom') {
var cell5 = row.insertCell(4);
cell5.classList.add("AdvBomavgcostvalue");
cell5.innerHTML = currencyCode + (bomData != undefined ? bomData.costavg : document.getElementById("AdvBomavgcostcol").innerHTML);
cell5.classList.add('d-none');
}

let qtycell = from == 'bom' ? 5 : 4;
var cell6 = row.insertCell(qtycell);
cell6.width = "5%";
cell6.classList.add("AdvBomqtyvalue");
var qtyelement = document.createElement("input");
qtyelement.type = "text";
qtyelement.name = "AdvBomqty[]";
qtyelement.size = "5";
qtyelement.className = "datainput selfocus AdvBomqtyfld navkey";
qtyelement.id = "AdvBomqty" + rowCount;
qtyelement.onfocus = function () {
this.style.backgroundColor = '#CCCCCC';
}
qtyelement.onclick = "style";
qtyelement.onchange = function () {
advBomupdateRow(this.parentNode.parentNode);
}
qtyelement.onblur = function () {
this.style.backgroundColor = '#FFFFFF';
}
qval = parseFloat((bomData != undefined ? bomData.bomqty : document.getElementById("AdvBomqty").value)).toFixed(3);
qtyelement.value = numWithDec (qval, 3);
qtyelement.setAttribute('value', qval);
cell6.appendChild(qtyelement);

var subTotal = document.getElementById("AdvBomcost").value * (bomData != undefined ? bomData.bomqty : document.getElementById("AdvBomqty").value);

let calc_check = from == 'bom' ? 6 : 5;
var cell7 = row.insertCell(calc_check);
cell7.style.textAlign = "right";
cell7.classList.add("AdvBomallvalue");

var costmethod = (bomData != undefined ? bomData.costmethod : document.getElementById("AdvBomcostmethod").value);
var badge = costmethod == 'Average Cost' ? '<span style="min-width: 39.75px;" class="badge rounded-pill bg-info" title="the cost for this material">AVG</span>' : '<span style="min-width: 39.75px;" class="badge rounded-pill bg-info" title="the cost for this material">COST</span>';
var cnewcost = costmethod == 'Average Cost' ? costavgValue : costValue;

cell7.innerHTML += "<div class='AdvBomtotal_cost_calc'>$" + numWithDec(Math.round(cnewcost * (bomData != undefined ? bomData.bomqty : document.getElementById("AdvBomqty").value) * 100) / 100) + '&nbsp;' + badge + "</div>";

let delcheck = from == 'bom' ? 7 : 6;
var temprn = "deleteInvItem" + rowCount;
var cell8 = row.insertCell(delcheck);
cell8.width = "20px";
cell8.innerHTML += "<div id='AdvBomactionIcon[]' style='float:right'><a href='javascript:;' onclick='deleteAdBeRow(\"dataTableAdvBom\",\"" + rowCount + "\");'><i class=\"material-symbols-rounded\" alt='DELETE THIS LINE' id='AdvBomdelIcon" + rowCount + "'>" +
"delete</i></a></div>" +
"<input type=hidden name='AdvBomdeleteBomId[]' id='AdvBom" + temprn + "' value='0'>" +
"<input type=hidden name='AdvBombomid[]' value='0'>" +
"<input type=\"hidden\" name=\"AdvBomcost[]\" value=\"" + costValue + "\">";

if (bomData == undefined) {
bomData = {};
bomData.bomqty = document.getElementById("AdvBomqty").value;
bomData.cost = document.getElementById("AdvBomcostcol").innerHTML;
bomData.costavg = document.getElementById("AdvBomavgcostcol").innerHTML;
bomData.costmethod = document.getElementById("AdvBomcostmethod").value;
bomData.costValue = document.getElementById("AdvBomcost").value;
bomData.costavgValue = document.getElementById("AdvBomavgcost").value;
row.setAttribute('bomdata', JSON.stringify(bomData));
}

document.getElementById("AdvBomqty").value = "";
document.getElementById("AdvBomtheDescription").value = "";
document.getElementById("AdvBomsohcol").innerHTML = "";
document.getElementById("AdvBomcostcol").innerHTML = "";
document.getElementById("AdvBomcost").value = "";
document.getElementById("AdvBomavgcostcol").innerHTML = "";
document.getElementById("AdvBomavgcost").value = "";
document.getElementById("AdvBomcostmethod").value = "";
document.getElementById("AdvBomproductionmethod").value = "";
document.getElementById("AdvBomavailText").innerHTML = "";
document.getElementById("AdvBomavail").value = "";
document.getElementById("AdvBomuom").innerHTML = "";

mergeDuplicateBoms();
calculateAdvBTotal();
initialize_select_filters();
document.getElementById('AdvBomitemFilter').value = '';
saveStep1 ();

}

function calculateAdvBTotal() {
var totalsoh = 0,
totalavail = 0,
totalcost = 0,
totalavgcost = 0,
totalqty = 0,
alltotal = 0;
document.querySelector('#dataTableAdvBom').querySelectorAll('.inv_values').forEach((obj, i) => {
soh = obj.querySelector('.AdvBomsohvalue').innerHTML.replaceAll("$", "").replaceAll(",", "");
totalsoh = totalsoh + (soh == '' ? 0 : parseFloat(soh));
avail = obj.querySelector('.AdvBomavailvalue').innerHTML.replaceAll("$", "").replaceAll(",", "");
totalavail = totalavail + (avail == '' ? 0 : parseFloat(avail));
cost = obj.querySelector('.AdvBomcostvalue').value.replaceAll("$", "").replaceAll(",", "");
totalcost = totalcost + (cost == '' ? 0 : parseFloat(cost));
avgcost = obj.querySelector('.AdvBomavgcostvalue').innerHTML.replaceAll("$", "").replaceAll(",", "");
totalavgcost = totalavgcost + (avgcost == '' ? 0 : parseFloat(avgcost));
totalqty = totalqty + parseFloat(obj.querySelector(".AdvBomqtyvalue input").value);
allval = obj.querySelector('.AdvBomtotal_cost_calc').innerHTML.replaceAll("$", "").replaceAll(",", "");
alltotal = alltotal + (allval == '' ? 0 : parseFloat(allval));
});
document.querySelector(".AdvBomtotalsoh").innerHTML = (totalsoh.toFixed(2));
document.querySelector(".AdvBomtotalavail").innerHTML = (totalavail.toFixed(2));
document.querySelector(".AdvBomtotalcost").innerHTML = ("$" + totalcost.toFixed(2));
document.querySelector(".AdvBomtotalavgcost").innerHTML = ("$" + totalavgcost.toFixed(2));
document.querySelector(".AdvBomtotalqty").innerHTML = (totalqty.toFixed(4));
document.querySelector(".AdvBomalltotal").innerHTML = ("$" + alltotal.toFixed(2));
document.querySelector('#advBomCount').innerHTML = document.querySelector('#dataTableAdvBomBody').children.length;
}

function deleteAdBeRow(tableID, target) {
try {
var table = document.getElementById(tableID);
row = document.querySelector('#AdvBomRowLine' + target);
if (row != undefined)
row.remove();
else
table.deleteRow(table.rows.length - 2);
var advBomRows = document.querySelectorAll('#dataTableAdvBomBody tr');
advBomRows.forEach((e, i) => {
e.querySelector('.advBomRowsLbl').innerHTML = (advBomRows.length - i) + '.';
});
} catch (e) {
}
calculateAdvBTotal();
}

function showAdvBomDeletedRows() {
var table = document.getElementById("dataTableAdvBom");
var rowCount = table.rows.length;
var y = document.getElementById("AdvBomdelToggle").value;
var z = document.getElementById("AdvBomdelToggleButton").value;
for (var i = 2; i < rowCount; i++) {
var x = "AdvBomdeleteInvItem" + i;
if (y == "1" && document.getElementById(x).value == "1") {
table.rows[i].style.display = "none";
document.getElementById("AdvBomdelToggle").value = "0";
document.getElementById("AdvBomdelToggleButton").value = "Show Deleted";
}
if (y == "0") {
table.rows[i].style.display = "";
document.getElementById("AdvBomdelToggle").value = "1";
document.getElementById("AdvBomdelToggleButton").value = "Hide Deleted";
}
}
}

function previewCloneKit () {
if (document.querySelector('#AdvBomitemFilterImportSelect').selectedIndex == -1) {
return false;
}
code = document.getElementById('AdvBomitemFilterImportSelect').value;
document.querySelector('#AdvBomitemFilterImport').value = document.querySelector('#AdvBomitemFilterImportSelect').options[document.querySelector('#AdvBomitemFilterImportSelect').selectedIndex].dataset.code;
if (code == '' || document.getElementById('AdvBomitemFilterImportSelect').selectedIndex == -1) {
document.getElementById('getcloneKit').style.display = 'none';
return false;
}
document.querySelector('.advBomImportBomList').innerHTML = '';
bomItems = JSON.parse(document.querySelector('#AdvBomitemFilterImportSelect').options[document.querySelector('#AdvBomitemFilterImportSelect').selectedIndex].dataset.clonekit);
cloneKitPreviewRows = '';
bomItems.forEach(bomItem => {
if (!exCats.includes(parseInt(bomItem.cat)))
cloneKitPreviewRows += eval("`" + cloneKitPreviewRow + "`");
});
document.querySelector('.advBomImportBomList').innerHTML = eval("`" + cloneKitPreviewTable + "`");
document.getElementById('getcloneKit').style.display = '';
}

function getCloneKit() {
code = document.getElementById('AdvBomitemFilterImportSelect').value;
if (code == '') {
doAlertModal('Please select an item from the list', document.getElementById('AdvBomitemFilterImport'));
return false;
}
document.getElementById('getcloneKit').style.display = 'none';
document.getElementById('cancelgetcloneKit').style.display = 'none';
modalClose('importAdvBomModal');
bomItems = JSON.parse(document.querySelector('#AdvBomitemFilterImportSelect').options[document.querySelector('#AdvBomitemFilterImportSelect').selectedIndex].dataset.clonekit);
bomItems.forEach(bomItem => {
if (!exCats.includes(parseInt(bomItem.cat))) addAdvBOMDataRow('dataTableAdvBom', 'bom', bomItem);
});
mergeDuplicateBoms();
getRealTimeBOMPricing();
cancelImportBOM();
}

function cancelImportBOM() {
document.querySelectorAll('.advOptTabCons')[document.getElementById('advOptCurStep').value - 1].style.display = 'block';
document.querySelector('.AdvBomImportBOM').style.display = 'none';
document.getElementById('AdvBomitemFilterSelect').value = '';
document.getElementById('btnAdvOptNext').removeAttribute('disabled');
document.getElementById('actImportBOM').style.display = '';
document.getElementById('getcloneKit').style.display = 'none';
document.getElementById('cancelgetcloneKit').style.display = 'none';
document.querySelector('#btnAdvOptPrev').style.display = '';
document.querySelector('#btnAdvOptNext').style.display = '';
}

var advBomPreviewMarkupTimer;
document.querySelector('#advBomPreviewMarkup').addEventListener ('keyup', function (e) {
clearTimeout (advBomPreviewMarkupTimer);
advBomPreviewMarkupTimer = setTimeout (function () {
updateItemSellPrice();
}, 250);
});
document.querySelector('#advBomPreviewMarkup').addEventListener ('change', function (e) {
updateItemSellPrice();
});
function updateItemSellPrice() {
var price = parseFloat(con.querySelector('#buyPrice').value);
var markup = parseFloat(document.querySelector('#advBomPreviewMarkup').value.replace(/([^0-9])/gi, '').trim());
if (isNaN(markup) || markup == '')
markup = 0;
document.querySelector('#advBomPreviewMarkup').innerHTML = markup;
document.querySelector('.advBomPrevsellprice').innerHTML = currencyCode + numWithDec(price * (1 + (markup / 100)));
document.querySelector('.advBomPrevbuyprice').innerHTML = currencyCode + con.querySelector('#buyPrice').value;
}

function previewNewItem() {
document.querySelector('.pricingcard').classList.remove('d-none');
document.querySelector('.advBomPrevsellprice').classList.remove('d-none');
document.querySelector('.advBomPrevsellpriceLabel').classList.remove('d-none');
document.querySelectorAll('input[name="advbommfp_alloc_cost[]"]').forEach(obj => {
computeBatch(obj, true, true);
});
con = document.querySelector('#addInventoryModalBody');
html = '';
price = 0;
cnt = 1;
document.querySelector('#dataTableAdvBom').querySelectorAll('.inv_values').forEach(erow => {
code = erow.children[0].querySelector('[type="text"]').value;
desc = erow.children[0].querySelector('.AdvBomitemDesc').value.replaceAll('\n','<br>');
soh = erow.children[1].innerHTML;
avail = erow.children[2].innerHTML;
cost = numWithDec(erow.children[3].querySelector('.datainput').value, 3);
avgcost = numWithDec(erow.children[4].innerHTML.replace('$', ''), 3);
qty = numWithDec(erow.children[5].querySelector('.datainput').value, 3);
subtotal = numWithDec(parseFloat(erow.children[3].querySelector('.datainput').value) * parseFloat(erow.children[5].querySelector('.datainput').value));
html += eval("`" + bomPrevRow + "`");
st = parseFloat(erow.children[6].innerText.replaceAll('$', '').replaceAll(' COST'));
price += (isNaN(st) ? 0 : st);
cnt++;
});
if (selectedRoute != 0) {
code = document.querySelector('#advBomLabourCode').value;
desc= document.querySelector('#advBomLabourDesc').value.replaceAll('\n','<br>');
soh = 0;
avail = 0;
cost = numWithDec(document.querySelector('#advLabourCost').value);
avgcost = numWithDec(document.querySelector('#advLabourSellPrice').value);
qty = numWithDec(document.querySelector('#advLabourQty').value, 4);
subtotal = numWithDec(document.querySelector('#advLabourSellCost').value);
html += eval("`" + bomPrevRow + "`");
}
st = parseFloat(document.querySelector('#advLabourSellCost').value);
price += (isNaN(st) ? 0 : st);
document.querySelector('.advBomPrevBOMTotal').innerHTML = numWithDec(price);
con.querySelector('#buyPrice').value = numWithDec(price);
if (con != undefined) {
document.querySelector('.advBomPrevitemcode').innerHTML = con.querySelector('#code').value;
document.querySelector('.advBomPrevitemdesc').innerHTML = setDefaultValue ( (typeof modifyItem == 'undefined' || modifyItem == false) ? con.querySelector('#description').value : document.querySelector('#modInvdescription').value, '').replaceAll('\n', '<br>');
document.querySelector('.advBomPrevnotes').innerHTML = setDefaultValue ((typeof modifyItem == 'undefined' || modifyItem == false) ? con.querySelector('#notes').value : document.querySelector('#modInvcustomer_notes').value, '').replaceAll('\n', '<br>');
document.querySelector('.advBomPrevcategory').innerHTML = (con.querySelector('#category').selectedIndex != -1 ? con.querySelector('#category').options[con.querySelector('#category').selectedIndex].text : '');
document.querySelector('.advBomPrevbuyprice').innerHTML = currencyCode + con.querySelector('#buyPrice').value;
document.querySelector('.advBomPrevuom').innerHTML = (con.querySelector('#uom').selectedIndex != -1 ? con.querySelector('#uom').options[con.querySelector('#uom').selectedIndex].text : '');
}
document.querySelector('.advBomPrevBOM').innerHTML = html;
if (selectedRoute != 0) {
document.getElementsByClassName('advBomPrevProcesses')[0].parentNode.style.display = '';
document.querySelector('.advBomRouteName').innerHTML = (selectedRoute < 0 ? document.getElementById('AdvBomRouteName').value : document.getElementById('advBomRoute').options[document.getElementById('advBomRoute').selectedIndex].text);
document.querySelector('.advBomRouteDesc').innerHTML = (selectedRoute < 0 ? document.getElementById('AdvBomRouteDescription').value : '');
html = '';
subt1 = 0;
subt2 = 0;
subt3 = 0;
subt4 = 0;
subt5 = 0;
document.querySelectorAll('#advBomMFProcTimeEntry .formListDiv').forEach((pelem, pind) => {
if (document.querySelectorAll('#advancedOptionsStep3 input[name="advbommfp_alloc_time[]"]')[pind].value.trim() == '') document.querySelectorAll('#advancedOptionsStep3 input[name="advbommfp_alloc_time[]"]')[pind].value = '0';
if (document.querySelectorAll('#advancedOptionsStep3 input[name="advbommfp_alloc_qty[]"]')[pind].value.trim() == '') document.querySelectorAll('#advancedOptionsStep3 input[name="advbommfp_alloc_qty[]"]')[pind].value = '1';
if (document.querySelectorAll('#advancedOptionsStep3 input[name="advbommfp_alloc_cost[]"]')[pind].value.trim() == '') document.querySelectorAll('#advancedOptionsStep3 input[name="advbommfp_alloc_cost[]"]')[pind].value = '0';
margin = (pelem.dataset.depth * 25 + 8);
process = pelem.innerHTML.replace('<span class="advbomspacer"></span>', '').replace('<span class="proctype">unit</span>', '').replace('<span class="proctype">batch</span>', '');
unit = (pelem.innerHTML.indexOf('batch') == -1 ? 'unit' : 'batch');
notes = document.querySelectorAll('#advancedOptionsStep3 textarea[name="advbommfp_notes[]"]')[pind].value;
time = numWithDec(document.querySelectorAll('#advancedOptionsStep3 input[name="advbommfp_alloc_time[]"]')[pind].value);
qty = numWithDec(document.querySelectorAll('#advancedOptionsStep3 input[name="advbommfp_alloc_qty[]"]')[pind].value);
unitcost = parseFloat(document.querySelectorAll('#advancedOptionsStep3 input[name="advbommfp_alloc_cost[]"]')[pind].value);
document.querySelectorAll('input[name="advbomfp_setupcost[]"]')[pind].value = parseFloat(document.querySelectorAll('input[name="advbommfp_alloc_cost[]"]')[pind].value) * parseFloat(document.querySelectorAll('input[name="advbomfp_setuptime[]"]')[pind].value / 60);
if (document.querySelector('#chkIncludeSetupTime').checked) {
unitcost += parseFloat(document.querySelectorAll('input[name="advbomfp_setupcost[]"]')[pind].value);
unitcost += parseFloat(document.querySelectorAll('input[name="advbomfp_processcost[]"]')[pind].value);
unitcost -= parseFloat(document.querySelectorAll('input[name="advbomfp_takeup[]"]')[pind].value);
}
subt1 += parseFloat(time);
subt2 += parseFloat(qty);
subt3 += parseFloat(unitcost);
unitcost = numWithDec(unitcost);
if (manufacturingEnableProcessTypes) {
totaltime = document.querySelectorAll('#advancedOptionsStep3 input[name="advbommfpbatch_alloc_time[]"]')[pind].value;
// document.querySelectorAll('#advancedOptionsStep3 input[name="advbommfpbatch_alloc_cost[]"]')[pind].value = numWithDec(parseFloat(qty) * parseFloat(unitcost));
totalcost = numWithDec(document.querySelectorAll('#advancedOptionsStep3 input[name="advbommfpbatch_alloc_cost[]"]')[pind].value);
subt4 += parseFloat(totaltime);
subt5 += parseFloat(totalcost);
}
totalcost = numWithDec(document.querySelectorAll('#advancedOptionsStep3 input[name="advbommfpbatch_alloc_cost[]"]')[pind].value);
html += eval ("`" + procPrevRow + "`");
});
document.querySelector('.ptime').innerHTML = numWithDec(subt1);
document.querySelector('.pqty').innerHTML = numWithDec(subt2, 3);
document.querySelector('.pcost').innerHTML = currencyCode + numWithDec(subt3);
if (manufacturingEnableProcessTypes) {
document.querySelector('.pbtime').innerHTML = numWithDec(cleanValue(numWithDec(subt4)),2);
document.querySelector('.pbcost').innerHTML = currencyCode + numWithDec(subt5);
}
document.querySelector('#advBomPreviewProcess').innerHTML = html;
document.getElementsByClassName('advBomPrevProcesses')[0].parentNode.style.display = '';
} else {
document.getElementsByClassName('advBomPrevProcesses')[0].parentNode.style.display = 'none';
}
checkAdvBomScroll();
updateLabourData ();
// document.querySelector('.advBomPrevBOMTotal').parentNode.parentNode.style.display = 'inline-block';
// document.querySelector('.advBomPrevBOMTotal').parentNode.parentNode.style.float = 'right';
// document.querySelector('.advBomPrevBOMTotal').parentNode.parentNode.style.marginRight = '-7px';
document.querySelector('.advBomPrevBOMTotal').parentNode.parentNode.style.textAlign = 'right !important';
document.querySelectorAll('#advBomPreviewProcess tr').forEach(e => {
e.children[0].style.textAlign = 'left';
e.children[1].style.textAlign = 'left';
});
if (document.querySelector('.advBomPrevProcesses tfoot').children[0].children.length == 8)
document.querySelector('.advBomPrevProcesses tfoot').children[0].children[0].remove();
if (!manufacturingEnableProcessTypes) {
document.querySelectorAll('#advBomPreviewProcess tr').forEach(e => {
e.children[2].style.textAlign = 'right !important';
e.children[3].style.textAlign = 'right !important';
e.children[4].style.textAlign = 'right !important';
});
} else {
document.querySelectorAll('#advBomPreviewProcess tr').forEach(e => {
e.children[2].style.textAlign = 'left';
});
document.querySelectorAll('#advBomPreviewProcess tr').forEach(e => {
e.children[2].style.textAlign = 'right !important';
e.children[3].style.textAlign = 'right !important';
e.children[4].style.textAlign = 'right !important';
});
}
updateItemSellPrice ();
}

document.addEventListener('DOMContentLoaded', function () {

if (!modifyItem) getUserSetting('', advBomBaseURL, true, '2024-06-30');

setTimeout(function () {
document.getElementById('processList2').style.height = document.getElementById('processList').offsetHeight + 'px';
}, 500);

document.querySelector('#navbarNav').querySelectorAll('.nav-item').forEach((navi, i) => {
navi.addEventListener('mouseup', function (e) {
setTimeout(function() { document.querySelectorAll('#advBomBuilderForm .nav-item').forEach (n => { n.classList.remove('active'); }); document.querySelector('#advBomBuilderForm .nav-item[data-index="' + document.querySelector('#advOptCurStep').value + '"]').classList.add('active'); }, 50);
});
});

if (document.getElementById('importAdvBomModal') != undefined) document.getElementById('importAdvBomModal').addEventListener('show.bs.modal', function () {
document.getElementById('btnAdvOptNext').setAttribute('disabled', 'disabled');
});

if (document.getElementById('importAdvBomModal') != undefined) document.getElementById('importAdvBomModal').addEventListener('hidden.bs.modal', function () {
document.getElementById('btnAdvOptNext').style.display = 'none';
document.getElementById('btnAdvOptNext').removeAttribute('disabled');
});

var sourceDiv, indentX, offsetX, margin, depth, parentid;
indentX = 40;
offsetX = 50;

$(function () {
$("#route").sortable({
revertDuration: 0,
smooth: false,
placeholder: "myPlaceholder",
sort: function (e, ui) {
var index = ui.item.index();
var baseOffset = parseInt($('#route li')[0].getBoundingClientRect().left);
document.getElementById("Parent").value = baseOffset;
var activeOffset = parseInt($('#route li')[index].getBoundingClientRect().left);
document.getElementById("offset").value = activeOffset;
unit = 'unit';
notes = '';
if (index > 0) {
parent = $('#route li')[index - 1];
var parentOffset = parseInt(parent.getBoundingClientRect().left);
var parentDepth = parseInt(parent.getAttribute('data-depth'));
parentid = parseInt(parent.getAttribute('data-id'));
document.getElementById("poffset").value = parentOffset;
document.getElementById("depth").value = parentDepth;
depth = Math.round((activeOffset - baseOffset) / indentX);
if (depth > parentDepth) {
depth = parentDepth + 1;
}
if (depth < 0) {
depth = 0;
}
ui.item.attr('data-depth', depth);
margin = Math.round(depth * parseInt(indentX));
document.getElementById("depth").value = depth;
} else {
ui.item.attr('data-depth', 0);
}


},
stop: function (e, ui) {
ui.item.children('input[name="depth[]"]').val(depth);
ui.item[0].style.marginLeft = margin + "px"
checkProcessContents();
},
update: function (e, ui) {
var index = ui.item.index();
var depth = parseInt(ui.item.attr('data-depth'));
var margin = depth * parseInt(indentX);
if (isNaN(depth)) {
depth = 0;
alert("ERROR SETTING " + parentDepth + " to 0");
}
ui.item[0].style.marginLeft = margin + "px"

if (startDiv == "processList") {
if (index == 0) {
depth = 0;
}
var y = ui.item.attr('data-id');
var notes = ui.item.attr('data-notes');
$('<input>').attr({
type: 'hidden',
name: 'process[]',
value: y,
'data-id': y
}).appendTo(ui.item[0]);
$('<input>').attr({
type: 'hidden',
name: 'depth[]',
value: depth
}).appendTo(ui.item[0]);
$('<input>').attr({
type: 'hidden',
name: 'notes[]',
value: notes
}).appendTo(ui.item[0]);
if (manufacturingEnableProcessTypes)
ui.item[0].innerHTML += '<span class="advbomspacer"></span><span class="proctype">unit</span><input type="hidden" name="proctype[]" value="unit">';
ui.item[0].innerHTML += " <a onclick='doRemoveProcess(this);checkProcessContents();checkDuplicateProcess();' style='cursor:pointer;'> <i class=\"material-symbols-rounded \" style='cursor:pointer;font-size: ;'>remove_circle_outline</i> </a>"
startDiv = "null";
setTimeout(function () {
document.querySelectorAll('.AdvBomRouteCreator #processList2 .proctype').forEach(procelem => {
procelem.addEventListener('mouseup', function (e) {
toggleProcessUnit(e.target);
});
});
refreshProcessTimeAndNotes(1);
}, 1000);
checkDuplicateProcess();
setTimeout(function() {
h = (document.querySelector('.AdvBomRouteCreator #processList2 li:last-child').getBoundingClientRect().bottom - document.querySelector('.AdvBomRouteCreator #processList2').getBoundingClientRect().top + 30);
h2 = (document.querySelector('.AdvBomRouteCreator #processList li:last-child').getBoundingClientRect().bottom - document.querySelector('.AdvBomRouteCreator #processList2').getBoundingClientRect().top + 30);
if (h2 > h) h = h2;
document.querySelector('.AdvBomRouteCreator #processList2').style.height = h + 'px';
document.querySelector('.AdvBomRouteCreator #processList').style.height = h + 'px'; }, 100);
setProcessHeirarchy();
}
}
});
$(".process").draggable({
connectToSortable: "#route",
helper: "clone",
revert: "invalid",
revertDuration: 0,
start: function (evt, ui) {
startDiv = "processList";
}
});
$("ul, li").disableSelection();
});

document.addEventListener("dragover", function (e) {
e = e || window.event;
var dragX = e.pageX,
dragY = e.pageY;
document.getElementById("offset").value = dragX;
}, false);

document.getElementById('processList2').style.height = document.getElementById('processList').offsetHeight + 'px';

document.querySelector('.AdvBomRouteCreator').style.display = 'none';

document.querySelector('#advBomRoute').addEventListener('change', function (e) {
selectRoute(e.target.value);
showHideStep2Buttons();
});

['mouseup', 'paste', 'change'].forEach (e => {
document.querySelector('#advancedOptionsStep3').addEventListener(e, function () {
invAddComputeAll ();
}, true);
});

});

function invAddComputeAll () {
document.querySelectorAll('input[name="advbommfp_alloc_cost[]"]').forEach(obj => {
obj.setAttribute('oval', obj.value);
obj.setAttribute('ocost', obj.value);
computeBatch(obj, true);
});
}

function selectRoute(id = undefined, cb = undefined) {
if (id == undefined) return false;
document.querySelector('#advBomLabourId').value = '';
document.querySelector('#advBomLabourIdSelect').selectedIndex = -1;
stepsRestored[3] = 1;
rdata = {};
rdata.route = id;
rdata.routedata = {};
document.querySelector('.AdvBomRouteCreator').style.display = 'none';
document.querySelector('#AdvBomRouteName').value = '';
document.querySelector('#AdvBomRouteNameMessage').value = '';
document.querySelector('.AdvBomRouteCreator #route').innerHTML = '';
document.querySelector('#advBomMFProcTimeEntry').innerHTML = '';
routeData = {};
process = [];
depth = [];
units = [];
notes = [];
routeData.processes = process;
routeData.depth = depth;
routeData.units = units;
routeData.notes = notes;
originalRouteData = undefined;
if (id == 0) {
toggleProcessTimeEntry(0);
selectedRoute = 0;
if (!modifyItem) setUserSetting('advBOMStep2', JSON.stringify(rdata), false, false, advBomBaseURL);
refreshProcessTimeAndNotes();
document.querySelector('.custProcess1').style.display = 'none';
document.querySelector('.custProcess2').style.display = '';
document.querySelector('.custProcess3').style.display = 'none';
document.querySelector('#advBomRoutePreview').style.display = 'none';
document.querySelector('#advancedBOMBuilder li:nth-child(5)').style.display = 'none';
document.querySelector('#advancedBOMBuilder li:nth-child(6)').style.display = 'none';
document.querySelector('#btnAdvOptNext').disabled = false;
} else {
selectedRoute = id;
var formData = new FormData;
formData.append('id', selectedRoute);
document.querySelectorAll('#advancedBOMBuilder .nav-item')[2].classList.remove('d-none');
document.querySelectorAll('#advancedBOMBuilder .nav-item')[2].nextElementSibling.classList.remove('d-none');
toggleProcessTimeEntry();
if (!modifyItem) setUserSetting('advBOMStep2', JSON.stringify(rdata), false, false, advBomBaseURL);
refreshProcessTimeAndNotes();
showProcessPreview ();
document.querySelector('#btnAdvOptNext').disabled = false;
if (cb != undefined) cb();
if (document.getElementById('advOptCurStep').value == '2') {
document.querySelector('.custProcess1').style.display = '';
document.querySelector('.custProcess2').style.display = '';
document.querySelector('.custProcess3').style.display = '';
}
document.querySelector('#advancedBOMBuilder li:nth-child(5)').style.display = '';
document.querySelector('#advancedBOMBuilder li:nth-child(6)').style.display = '';
}
document.querySelector('#AdvBomRouteNameMessage').innerHTML = 'Please enter a descriptive name for your manufacturing route / process';
document.querySelector('#AdvBomRouteNameMessage').classList.add('text-muted');
document.querySelector('#AdvBomRouteNameMessage').classList.remove('text-danger');
if (selectedRoute == 0) {
document.querySelector('#advBomBuilderForm .nav-item[data-index="3"]').nextElementSibling.style.display = 'none';
document.querySelector('#advBomBuilderForm .nav-item[data-index="3"]').style.display = 'none';
} else {
document.querySelector('#advBomBuilderForm .nav-item[data-index="3"]').nextElementSibling.style.display = '';
document.querySelector('#advBomBuilderForm .nav-item[data-index="3"]').style.display = '';
}
if (document.getElementById('advOptCurStep').value != '2') document.querySelector('.custProcess2').style.display = 'none';
}

function saveCustomRoute () {
if (selectedRoute < 0) {
routeData = {};
process = [];
depth = [];
units = [];
notes = [];
costs = [];
takeup = [];
pcosts = [];
setupcost = [];
setuptime = [];
leadtime = [];
external = [];
document.querySelectorAll('#processList2 #route li').forEach((newroute, routeind) => {
process.push(newroute.dataset.id);
depth.push(newroute.dataset.depth);
units.push(newroute.dataset.unit == undefined ? '' : newroute.dataset.unit);
notes.push(newroute.dataset.notes == undefined ? '' : newroute.dataset.notes);
costs.push(newroute.dataset.cost == undefined ? '' : newroute.dataset.cost);
takeup.push(newroute.dataset.takeup == undefined ? 0 : newroute.dataset.takeup);
pcosts.push(newroute.dataset.pcosts == undefined ? 0 : newroute.dataset.pcosts);
setupcost.push(newroute.dataset.setupcost == undefined ? 0 : newroute.dataset.setupcost);
setuptime.push(newroute.dataset.setuptime == undefined ? 0 : newroute.dataset.setuptime);
leadtime.push(newroute.dataset.leadtime == undefined ? 0 : newroute.dataset.leadtime);
external.push(newroute.dataset.external == undefined ? 0 : newroute.dataset.external);
});
routeData.processes = process;
routeData.depth = depth;
routeData.units = units;
routeData.notes = notes;
routeData.costs = costs;
routeData.takeup = takeup;
routeData.pcost = pcosts;
routeData.setupcost = setupcost;
routeData.setuptime = setuptime;
routeData.leadtime = leadtime;
routeData.external = external;
routeData.importedRoute = document.querySelector('#importedRoute').value;
routeData.name = document.querySelector('#AdvBomRouteName').value;
routeData.description = document.querySelector('#AdvBomRouteDescription').value;
}
rdata = {};
rdata.route = selectedRoute;
rdata.routedata = routeData;
if (!modifyItem) setUserSetting('advBOMStep2', JSON.stringify(rdata), false, false, advBomBaseURL);
}

function refreshProcessTimeAndNotes(force = 0) {
try {
saveCustomRoute ();
routeCon = document.querySelector('#advBomMFProcTimeEntry');
if (selectedRoute != 0) {
html = '';
routeData.processes.forEach((route, ind) => {
id = route;
name = processListNames[id].replace('undefined', '');
depth = routeData.depth[ind].replace('undefined', '');
if (depth == '' || depth == undefined) depth = 0;
margin = (depth * 40) + 'px';
spacer = '<span class="advbomspacer"></span>';
if (manufacturingEnableProcessTypes) {
unit = routeData.units[ind].replace('undefined', '');
unittext = `<span class="proctype">${unit}</span>`;
} else {
unit = '';
unittext = '';
}
notes = routeData.notes[ind].replace('undefined', '');
cost = isNaN(parseFloat(routeData.pcost[ind])) ? 0 : parseFloat(routeData.pcost[ind]);
takeup = numWithDec(routeData.takeup[ind]);
setupcost = numWithDec(routeData.setupcost[ind]);
processcost = numWithDec(routeData.pcost[ind]);
setuptime = routeData.setuptime[ind];
leadtime = routeData.leadtime[ind];
isexternal = routeData.external[ind];
hidelead = '';
if (isexternal == '0') hidelead = 'class="d-none"';
qty = '';
html += eval("`" + advBomMFProcTimeEntryRow + "`");
});
routeCon.innerHTML = html;
}
document.querySelector('#advancedOptionsStep3 .form-control').focus();
tcost = 0;
document.querySelectorAll('input[name="advbommfp_alloc_cost[]"]').forEach(ac => {
tcost += (isNaN(parseFloat(ac.value)) ? 0 : parseFloat(ac.value));
});
cost = tcost;
tcost = numWithDec(cost * 1);
cost = numWithDec(tcost);
sellprice = cost;
desc = '';
icode = document.querySelector('#formInvAdd #code').value;
lcode = icode + (icode.isUpperCase() ? labour : (icode.isProperCase() ? labour.properCase() : labour.toLowerCase()));
idesc = document.querySelector('#formInvAdd #description').value;
document.querySelector('#advBomLabourCode').value = '';
document.querySelector('#advBomLabourId').value = '';
document.querySelector('#advBomLabourIdSelect').selectedIndex = -1;
routeCon.addEventListener('change', function (e) {
tcost = 0;
document.querySelectorAll('input[name="advbommfp_alloc_cost[]"]').forEach(ac => {
tcost += (isNaN(parseFloat(ac.value)) ? 0 : parseFloat(ac.value));
});
if (document.querySelector('#advBomLabourIdSelect').value == '-1') {
cost = tcost;
tcost = numWithDec(cost * 1);
cost = numWithDec(tcost);
sellprice = (cost * (1 + (document.querySelector('#advBomLabourCat').options[document.querySelector('#advBomLabourCat').selectedIndex].dataset.markup / 100)));
document.querySelector('#advLabourCost').value = numWithDec(cost);
document.querySelector('#advLabourSellPrice').value = numWithDec(sellprice);
q = parseFloat(document.querySelector('#advLabourQty').value);
q = isNaN(q) ? 1 : q;
document.querySelector('#advLabourQty').value = numWithDec(cleanValue(q), 4);
s = parseFloat(document.querySelector('#advLabourSellPrice').value);
s = isNaN(s) ? 1 : s;
document.querySelector('#advLabourSellPrice').value = numWithDec(s);
document.querySelector('#advLabourSellCost').value = numWithDec(q * s);
}
updateLabourData();
});
document.querySelector('#advLabourQty').addEventListener('mouseup', function () {
clearTimeout(timeoutTimer);
timeoutTimer = setTimeout("updateLabourPricing ();", 500);
});
document.querySelector('#advLabourSellPrice').addEventListener('mouseup', function () {
clearTimeout(timeoutTimer);
timeoutTimer = setTimeout("updateLabourPricing ();", 500);
});
addHourToMinPlaceholders ();
selectOnFocus ();
updateLabourData ();
checkAdvBomScroll();
} catch (err) { }
}

function toggleProcessTimeEntry(show = 1) {
document.querySelectorAll('#advancedBOMBuilder .nav-item')[2].classList.remove('d-none');
document.querySelectorAll('#advancedBOMBuilder .nav-item')[2].nextElementSibling.classList.remove('d-none');
if (show != 1) {
document.querySelectorAll('#advancedBOMBuilder .nav-item')[2].classList.add('d-none');
document.querySelectorAll('#advancedBOMBuilder .nav-item')[2].nextElementSibling.classList.add('d-none');
}
document.querySelectorAll('#processList2 .proctype').forEach(procelem => {
procelem.addEventListener('mouseup', function (e) {
toggleProcessUnit(e.target);
});
});
}

function checkProcessContents() {
toggleProcessTimeEntry(1);
if (document.querySelectorAll('#advancedBOMBuilder #processList2 .formListDiv').length == 0)
toggleProcessTimeEntry(0);
}

function toggleProcessUnit(obj) {
procobj = obj.parentNode.querySelector('input[name="proctype[]"]');
if (obj.innerHTML == 'unit') {
obj.innerHTML = 'batch';
procobj.value = 'batch';
} else {
obj.innerHTML = 'unit';
procobj.value = 'unit';
}
}

(function () {
document.onmousemove = handleMouseMove;
function handleMouseMove(event) {
var dot, eventDoc, doc, body, pageX, pageY;

event = event || window.event;
if (event.pageX == null && event.clientX != null) {
eventDoc = (event.target && event.target.ownerDocument) || document;
doc = eventDoc.documentElement;
body = eventDoc.body;

event.pageX = event.clientX +
(doc && doc.scrollLeft || body && body.scrollLeft || 0) -
(doc && doc.clientLeft || body && body.clientLeft || 0);
event.pageY = event.clientY +
(doc && doc.scrollTop || body && body.scrollTop || 0) -
(doc && doc.clientTop || body && body.clientTop || 0);
}
document.getElementById("Coords2").value = event.pageX;
}
})();

function showCoords(event, element = 0) {
var w = element.getBoundingClientRect();
var x = event.clientX;
var y = event.clientY;
var coords = "X coords: " + x + ", Y coords: " + y;
document.getElementById("Coords0").value = x - w.x;
}

function verifyAdvBomRouteName(obj) {
objs = document.querySelector('#AdvBomRouteNameMessage');
objs.classList.remove('error');
objs.innerHTML = 'Please enter a descriptive name for your manufacturing route / process ';
document.querySelector('#AdvBomRouteNameMessage').classList.add('text-muted');
document.querySelector('#AdvBomRouteNameMessage').classList.remove('text-danger');
f = false;
document.querySelectorAll('#advBomRoute option').forEach(oelem => {
if (oelem.text.trim().toLowerCase() == obj.value.trim().toLowerCase())
f = true;
});
if (f) {
objs.innerHTML = 'This route name already exists';
document.querySelector('#AdvBomRouteNameMessage').classList.remove('text-muted');
document.querySelector('#AdvBomRouteNameMessage').classList.add('text-danger');
document.querySelector('#AdvBomRouteNameMessage').classList.add('exists');
obj.classList.add('error');
} else {
obj.classList.remove('error');
document.querySelector('#AdvBomRouteNameMessage').classList.remove('exists');
}
validateCurrentStep ('next');
}

function advBomImportProcess() {
document.querySelector('.custProcess1').style.display = 'none';
document.querySelector('.custProcess2').style.display = 'none';
document.querySelector('.custProcess3').style.display = 'none';
document.querySelector('.custProcess3').previousElementSibling.style.display = 'none';
document.querySelector('.custProcess4').style.display = '';
if (document.getElementById('advBomRoute').value == '0') {
doAlertModal('Please select an item from the list', document.getElementById('advBomRoute'));
return false;
}
document.querySelector('#advBomRoutePreview').style.display = 'none';
document.querySelector('.AdvBomRouteCreator').style.display = 'block';
document.getElementById('processList2').style.height = document.getElementById('processList').offsetHeight + 'px';
document.getElementById('AdvBomRouteName').value = '';
document.getElementById('AdvBomRouteDescription').value = '';
importRes = routeData;
originalRouteData = importRes;
routeCon = document.querySelector('.AdvBomRouteCreator #route');
routeCon.innerHTML = '';
html = '';
importRes.processes.forEach((route, ind) => {
routeJSONData = {};
id = route;
name = '';
document.querySelectorAll('.AdvBomRouteCreator #processList li').forEach((proc, ind) => {
if (id == proc.dataset.id)
name = proc.innerHTML;
});
depth = importRes.depth[ind];
if (depth == '' || depth == undefined) depth = 0;
margin = (depth * 40) + 'px';
unit = importRes.units[ind] != '' ? importRes.units[ind] : 'unit';
unittext = `<span class="proctype">${unit}</span>`;
notes = importRes.notes[ind];
isexternal = importRes.external[ind];
leadtime = importRes.leadtime[ind];
setupcost = importRes.setupcost[ind];
setuptime = importRes.setuptime[ind];
takeup = importRes.takeup[ind];
processcost = importRes.pcost[ind];
cost = importRes.costs[ind];
process = importRes.processes[ind];
html += `<li id="mfRoute${id}" data-cost="${cost}" data-process="${process}" data-external="${isexternal}" data-leadtime="${leadtime}" data-setupcost="${setupcost}" data-setuptime="${setuptime}" data-pcosts="${processcost}" data-takeup="${takeup}" data-id="${id}" data-depth="${depth}" data-unit="${unit}" data-notes="${notes}" class="formListDiv process" onmousedown="showCoords(event,this)" style="margin-left:${margin};xwidth:250px">${name} <span class="advbomspacer"></span>${unittext}<input type="hidden" name="process[]" value="${id}"><input type="hidden" name="proctype[]" value="${unit}"><input type="hidden" name="notes[]" value="${notes}"><input type="hidden" name="depth[]" value="${depth}"><a onclick="doRemoveProcess(this);checkProcessContents();checkDuplicateProcess();" style='cursor:pointer;'> <i class="material-symbols-rounded " style='cursor:pointer;font-size: ;'>remove_circle_outline</i> </a></li>`;
});
routeCon.innerHTML = html;
if (advanceOptionModal == 1) {
document.getElementById('advancedOptionsStep2').scrollTo(0, document.getElementById('AdvBomRouteName').offsetTop - 120);
} else {
window.scrollTo(0, document.getElementById('AdvBomRouteName').offsetTop - 60);
}
document.getElementById('AdvBomRouteName').focus();
toggleProcessTimeEntry();
setProcessHeirarchy();
document.querySelector('#btnAdvOptNext').disabled = false;
document.querySelector('#importedRoute').value = selectedRoute;
selectedRoute = -1;
saveCustomRoute ();
}

function advBomCreateProcess() {
document.querySelector('.custProcess1').style.display = 'none';
document.querySelector('.custProcess2').style.display = 'none';
document.querySelector('.custProcess3').style.display = 'none';
document.querySelector('.custProcess3').previousElementSibling.style.display = 'none';
document.querySelector('.custProcess4').style.display = '';
document.querySelector('#advBomRoutePreview').style.display = 'none';
document.getElementById('AdvBomRouteName').value = '';
document.getElementById('AdvBomRouteDescription').value = '';
document.querySelector('.AdvBomRouteCreator').style.display = 'block';
document.getElementById('processList2').style.height = document.getElementById('processList').offsetHeight + 'px';
if (advanceOptionModal == 1) {
document.getElementById('advancedOptionsStep2').scrollTo(0, document.getElementById('AdvBomRouteName').offsetTop - 120);
} else {
window.scrollTo(0, document.getElementById('AdvBomRouteName').offsetTop - 60);
}
routeCon = document.querySelector('.AdvBomRouteCreator').querySelector('#route');
routeCon.innerHTML = '';
document.getElementById('AdvBomRouteName').focus();
toggleProcessTimeEntry();
selectedRoute = -2;
document.querySelector('#importedRoute').value = '0';
saveCustomRoute ();
}

function saveStep1(from = 'bom', tableID = 'dataTableAdvBom') {
var table = from == 'bom' ? document.getElementById(tableID).getElementsByTagName('tbody')[0] : document.getElementById(tableID);
var rowCount = table.rows.length;
if (rowCount > 2) {
trs = [];
for (ctr = 2; ctr < rowCount; ctr++) {
table.rows[ctr].querySelectorAll('input').forEach(relem => {
if (relem.value != '')
if (relem.outerHTML.indexOf('value=') == -1)
relem.setAttribute('value', relem.value);
});
trs.push(table.rows[ctr].outerHTML);
}
if (!modifyItem) setUserSetting('advBOMStep1', JSON.stringify(trs), false, false, advBomBaseURL);
}
}

function saveStep2() {
if (selectedRoute < 0) {
routeData = {};
process = [];
depth = [];
units = [];
notes = [];
costs = [];
leadtime = [];
isexternal = [];
processtime = [];
setupcost = [];
setuptime = [];
takeup = [];
document.querySelectorAll('#processList2 #route li').forEach((newroute, routeind) => {
process.push(newroute.dataset.id);
depth.push(newroute.dataset.depth);
units.push(newroute.dataset.unit == undefined ? '' : newroute.dataset.unit);
notes.push(newroute.dataset.notes == undefined ? '' : newroute.dataset.notes);
leadtime.push(newroute.dataset.leadtime == undefined ? 0 : newroute.dataset.leadtime);
isexternal.push(newroute.dataset.external == undefined ? 0 : newroute.dataset.external);
processtime.push(newroute.dataset.processtime == undefined ? 0 : newroute.dataset.processtime);
setupcost.push(newroute.dataset.setupcost == undefined ? 0 : newroute.dataset.setupcost);
setuptime.push(newroute.dataset.setuptime == undefined ? 0 : newroute.dataset.setuptime);
takeup.push(newroute.dataset.takeup == undefined ? 0 : newroute.dataset.takeup);
});
routeData.processes = process;
routeData.depth = depth;
routeData.units = units;
routeData.notes = notes;
routeData.costs = costs;
routeData.leadtime = leadtime;
routeData.external = isexternal;
routeData.processtime = processtime;
routeData.setupcost = setupcost;
routeData.setuptime = setuptime;
routeData.takeup = takeup;
}
rdata = {};
rdata.route = selectedRoute;
rdata.routedata = routeData;
if (!modifyItem) setUserSetting('advBOMStep2', JSON.stringify(rdata), false, false, advBomBaseURL);
}

function saveStep3() {
trs = {};
notes = [];
document.querySelectorAll('#advancedOptionsStep3 textarea[name="advbommfp_notes[]"]').forEach(elem => {
notes.push(elem.value);
});
trs.notes = notes;
time = [];
document.querySelectorAll('#advancedOptionsStep3 input[name="advbommfp_alloc_time[]"]').forEach(elem => {
time.push(elem.value);
});
trs.time = time;
qty = [];
batch = [];
cost = [];
batchcost = [];
takeup = [];
processcost = [];
setuptime = [];
document.querySelectorAll('#advancedOptionsStep3 input[name="advbommfp_alloc_qty[]"]').forEach(elem => {
if (cleanValue(elem.value) == '' || cleanValue(elem.value) == '0')
elem.value = 1;
qty.push(elem.value);
batch.push(0);
});
trs.qty = qty;
if (manufacturingEnableProcessTypes) {
document.querySelectorAll('#advancedOptionsStep3 input[name="advbommfpbatch_alloc_time[]"]').forEach((elem, ind) => {
batch[ind] = elem.value;
});
trs.batch = batch;
}
document.querySelectorAll('#advancedOptionsStep3 input[name="advbommfp_alloc_cost[]"]').forEach((elem, ind) => {
cost[ind] = elem.value;
});
trs.cost = cost;
if (manufacturingEnableProcessTypes) {
document.querySelectorAll('#advancedOptionsStep3 input[name="advbommfpbatch_alloc_cost[]"]').forEach((elem, ind) => {
batchcost[ind] = elem.value;
});
trs.batchcost = batchcost;
}
proctype = [];
document.querySelectorAll('#advancedOptionsStep3 .proctype').forEach((elem, ind) => {
proctype.push(elem.innerHTML);
});
trs.proctype = proctype;
document.querySelectorAll('#advancedOptionsStep3 input[name="advbomfp_takeup[]"]').forEach(elem => {
if (cleanValue(elem.value) == '' || cleanValue(elem.value) == '0')
elem.value = 0;
takeup.push(elem.value);
});
trs.takeup = takeup;
document.querySelectorAll('#advancedOptionsStep3 input[name="advbomfp_processcost[]"]').forEach(elem => {
if (cleanValue(elem.value) == '' || cleanValue(elem.value) == '0')
elem.value = 0;
processcost.push(elem.value);
});
trs.processcost = processcost;
document.querySelectorAll('#advancedOptionsStep3 input[name="advbomfp_setuptime[]"]').forEach(elem => {
if (cleanValue(elem.value) == '' || cleanValue(elem.value) == '0')
elem.value = 0;
setuptime.push(elem.value);
});
trs.setuptime = setuptime;
labourData = {};
labourData.id = document.querySelector('#advBomLabourIdSelect').value;
labourData.desc = document.querySelector('#advBomLabourDesc').value;
labourData.cost = document.querySelector('#advLabourCost').value;
labourData.sell = document.querySelector('#advLabourSellPrice').value;
labourData.qty = document.querySelector('#advLabourQty').value;
labourData.sellcost = document.querySelector('#advLabourSellCost').value;
labourData.code = document.querySelector('#advBomLabourCode').value;
labourData.markup = document.querySelector('#advBomLabourMarkup').value;
trs.labour = labourData;
if (!modifyItem) setUserSetting('advBOMStep3', trs, false, false, advBomBaseURL);
}

var newItem = {};

function addNewItem() {
document.querySelectorAll('#advancedBOMBuilder .nav-item').forEach((nelem, nind) => {
if (nind != 4) {
nelem.disabled = true;
nelem.setAttribute('disabled', 'disabled');
}
});
newItem = {};
document.querySelector('#advancedOptionsStep5 .alert').innerHTML = 'Please do not leave this page while we finish this activity.';
document.querySelector('#advancedOptionsStep5 .alert').classList.remove('alert-danger');
document.querySelector('#advancedOptionsStep5 .alert').classList.add('alert-warning');
document.querySelector('.step51').classList.remove('d-none');
document.querySelector('.step51').innerHTML = 'sprint';
document.querySelector('.step52').classList.add('d-none');
document.querySelector('.step53').classList.add('d-none');
document.querySelector('.step54').classList.add('d-none');
document.querySelector('.step55').classList.add('d-none');
ajaxSubmit(function (ret) {
newItem = ret;
if (ret.id == undefined || ret.id == '0' || ret.id == '') {
document.querySelector('#advancedOptionsStep5 .alert').innerHTML = 'Sorry, there was a problem adding this item, please review your entry and try again.';
document.querySelector('#advancedOptionsStep5 .alert').classList.remove('alert-warning');
document.querySelector('#advancedOptionsStep5 .alert').classList.add('alert-danger');
return false;
}
document.querySelector('.step51').innerHTML = 'check';
document.querySelector('.step52').classList.remove('d-none');
document.querySelector('.step52').innerHTML = 'sprint';
if (typeof saveAddItemForm == 'function') saveAddItemForm();
var formData = new FormData(document.querySelector('#addInventoryAdvancedOptionModal form'));
formData.append('id', ret.id);
formData.append('selectedroute', selectedRoute);
formData.append('routedata', JSON.stringify(routeData));
ajaxSubmit(function (ret) {
document.querySelector('.step52').innerHTML = 'check';
document.querySelector('.step53').classList.remove('d-none');
document.querySelector('.step53').innerHTML = 'sprint';
if (selectedRoute < 0) {
formData.delete('selectedroute');
formData.append('selectedroute', selectedRoute);
ajaxSubmit(function (ret) {
document.querySelector('.step53').innerHTML = 'check';
document.querySelector('.step54').classList.remove('d-none');
document.querySelector('.step54').innerHTML = 'sprint';
if (ret != '' && ret != '0') {
formData.delete('selectedroute');
formData.append('selectedroute', ret);
ajaxSubmit(function (ret) {
document.querySelector('.step54').innerHTML = 'check';
document.querySelector('.step55').classList.remove('d-none');
document.querySelector('.step55').innerHTML = 'sprint';
addNewItemToQuote();
}, formData, 'invaddadvanced.php', 'additemAdvancedUpdateBOM');
}
}, formData, 'invaddadvanced.php', 'additemAdvancedCreateProcess');
} else {
document.querySelector('.step53').innerHTML = 'check';
document.querySelector('.step54').classList.remove('d-none');
document.querySelector('.step54').innerHTML = 'sprint';
formData.delete('selectedroute');
formData.append('selectedroute', selectedRoute);
ajaxSubmit(function (ret) {
document.querySelector('.step54').innerHTML = 'check';
document.querySelector('.step55').classList.remove('d-none');
document.querySelector('.step55').innerHTML = 'sprint';
addNewItemToQuote();
}, formData, 'invaddadvanced.php', 'additemAdvancedUpdateBOM');
}
}, formData, 'invaddadvanced.php', 'additemAdvanced');
}, 'formInvAdd', 'invaddadvanced.php', 'additem');

}

function validateCurrentStep(direction = 'next') {
ret = true;
if (direction != 'next') return ret;
errors = [];
document.querySelector('.alertDiv').style.display = 'none';
switch (parseInt(document.getElementById('advOptCurStep').value)) {
case 1:
document.querySelectorAll('#advancedOptionsStep1 input[name="AdvBomqty[]"]').forEach(elem => {
v = parseFloat(cleanValue(elem.value.trim())).toFixed(3);
elem.value = v;
elem.classList.remove("error");
if (isNaN(parseFloat(v)) || v <= 0) {
if (errors.join(' ').indexOf('- The quantity for a BOM must be above 0') == -1) errors.push('- The quantity for a BOM must be above 0');
elem.classList.add("error");
ret = false;
}
});
if (!restoreItemData()) {
errors.push('- A BOM was edited, please reselect the items marked in red from the list before proceeding.');
ret = false;
}
break;
case 2:
if (selectedRoute < 0) {
document.querySelector('#AdvBomRouteNameMessage').classList.add('text-muted');
document.querySelector('#AdvBomRouteNameMessage').classList.remove('text-danger');
checkDuplicateProcess();
document.querySelector('#AdvBomRouteName').classList.remove('error');
if (document.querySelector('#AdvBomRouteName').value.trim() == '') {
errors.push('- Route name cannot be blank');
document.querySelector('#AdvBomRouteNameMessage').innerHTML = 'Please enter a descriptive name for your manufacturing route / process';
document.querySelector('#AdvBomRouteNameMessage').classList.add('error');
document.querySelector('#AdvBomRouteNameMessage').classList.remove('text-muted');
document.querySelector('#AdvBomRouteNameMessage').classList.add('text-danger');
document.querySelector('#AdvBomRouteName').classList.add('error');
ret = false;
}
if (document.querySelector('#AdvBomRouteNameMessage').className.indexOf('exists') != -1) {
document.querySelector('#AdvBomRouteNameMessage').classList.remove('text-muted');
document.querySelector('#AdvBomRouteNameMessage').classList.add('text-danger');
errors.push('- Route name already exists');
ret = false;
document.querySelector('#AdvBomRouteName').classList.add('error');
break;
}
if (document.querySelectorAll('#advancedOptionsStep2 #processList2 li').length == 0) {
errors.push('- New route must have at least one process');
ret = false;
}
if (dupProcess) {
doAlert(dupMessage);
document.querySelector('.advBomCancelCreation').classList.add('danger');
ret = false;
}
}
if (document.querySelectorAll('#advancedOptionsStep2 .error').length == 0) document.querySelector('#btnAdvOptNext').disabled = false;
break;
case 3:
if (selectedRoute != 0) {
var sel = document.querySelector('#advBomLabourIdSelect');
if (sel.value == -1 || sel.value < 1) {
doAlertModal ('Please select a Factory Labour Item');
ret = false;
}
if (ret && setDefaultValue(parseFloat(document.querySelector('#advLabourSellCost').value), 0) <= 0) {
doAlertModal ('The labour cost cannot be zero.&nbsp;&nbsp;Please update your Process costs.');
ret = false;
}
price = 0;
cost = 0;
document.querySelector('#dataTableAdvBom').querySelectorAll('.inv_values').forEach(erow => {
st = parseFloat(erow.children[6].innerText.replaceAll('$', '').replaceAll(' COST'));
cost += (isNaN(st) ? 0 : st);
price += (isNaN(st) ? 0 : st);
});
st = parseFloat(document.querySelector('#advLabourSellCost').value);
price += (isNaN(st) ? 0 : st);
if (ret && price < cost) {
doAlertModal ('The price is below the cost of the item.&nbsp;&nbsp;The total cost is $' + numWithDec(cost) + '<br><br>Please update the BOM, Process and Labour Costs to reflect the cost of this item');
ret = false;
}
}
break;
case 4:
break;
case 5:
break;
}
if (errors.length > 0) {
document.querySelector('#advancedOptionsStep1 h4').insertAdjacentHTML ('beforebegin', '<div class="alert alert-danger mt-4 step1ErrorInpt">Sorry, there were problems found for this tab:<br><br>' + errors.join('<br>').replaceAll('- ', '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;') + '</div>');
focusOnError();
}
return ret;
}

var aniqtimerc = 0;

function addNewItemToQuote2 () {
var errorMessage = 'There was a problem adding the new Item to the Quote, please refresh the page and search the item via the Item Code column';
var found = false;
var sel = document.querySelector('#itemFilterSelect').options;
for (var cnt = 0; cnt < sel.length; cnt++) {
if (sel[cnt].dataset.code == newItem.code) {
document.querySelector('#itemFilterSelect').value = sel[cnt].value;
document.getElementById('itemFilterSelect').click();
found = true;
break;
}
}
if (!found && aniqtimerc < 10) setTimeout (function () { aniqtimerc++; addNewItemToQuote2() }, 100);
if (aniqtimerc > 9 || found) {
if (document.getElementById('itemFilterSelect').value.toString() == newItem.id.toString()) {
document.querySelector('.step55').innerHTML = 'check';
document.querySelector('#advancedOptionsStep5 .alert').innerHTML = 'Item added in quote. You may now close this window or start over to add another item.';
document.querySelector('#advancedOptionsStep5 .alert').classList.remove('alert-warning');
document.querySelector('#advancedOptionsStep5 .alert').classList.add('alert-success');
document.getElementById('btnAdvOptRestart').style.display = '';
document.getElementById('itemFilter').value = newItem.code;
document.getElementById('addInventoryModal').style.opacity = 0;
setTimeout(function () {
document.querySelector('.step55').innerHTML = 'check';
document.getElementById('addInventoryModal').style.opacity = 1;
document.getElementById('qty').value = 1;
document.getElementById('qty').focus();
document.getElementById('qty').select();
var processData = [];
var fpids = document.querySelectorAll('[name="advbommfp_alloc_id[]"]');
var fpnotes = document.querySelectorAll('[name="advbommfp_notes[]"]');
var fptime = document.querySelectorAll('[name="advbommfp_alloc_time[]"]');
var fpqtybreak = document.querySelectorAll('[name="advbommfp_alloc_qty[]"]');
var fpunitcost = document.querySelectorAll('[name="advbommfp_alloc_cost[]"]');
var fpbatchtime = document.querySelectorAll('[name="advbommfpbatch_alloc_time[]"]');
var fptotalcost = document.querySelectorAll('[name="advbommfpbatch_alloc_cost[]"]');
var fptakeup = document.querySelectorAll('[name="advbomfp_takeup[]"]');
var fpprocesscost = document.querySelectorAll('[name="advbomfp_processcost[]"]');
var fpsetuptime = document.querySelectorAll('[name="advbomfp_setuptime[]"]');
fpids.forEach ((e, i) => {
var data = {};
data.id = fpids[i].value;
data.notes = fpnotes[i].value;
data.time = fptime[i].value;
data.qtybreak = fpqtybreak[i].value;
data.unitcost = fpunitcost[i].value;
data.batchtime = fpbatchtime[i].value;
data.totalcost = fptotalcost[i].value;
data.takeup = fptakeup[i].value;
data.processcost = fpprocesscost[i].value;
data.setuptime = fpsetuptime[i].value;
processData.push(data);
});
var labourData = {};
labourData.id = document.querySelector('#advBomLabourIdSelect').value;
labourData.code = document.querySelector('#advBomLabourId').value;
labourData.desc = document.querySelector('#advBomLabourDesc').value;
labourData.cost = document.querySelector('#advLabourCost').value;
labourData.qty = document.querySelector('#advLabourQty').value;
labourData.selcost = document.querySelector('#advLabourSellCost').value;
document.getElementById('qty').dataset.processData = JSON.stringify(processData);
document.getElementById('qty').dataset.labourData = JSON.stringify(labourData);
var bomraw = {};
bomraw.processData = processData;
bomraw.labourData = labourData;
setUserSetting ('newItemBomRaw' + newItem.id, bomraw, false, false, '/');
document.querySelector('#addInventoryModal').style.opacity = 0;
modalClose('addInventoryAdvancedOptionModal'); setTimeout(function () { modalClose('addInventoryModal'); document.querySelector('#addInventoryModal').style.opacity = 1; }, 100);
advBomComplete = 1;
}, 100);
var popupDiv = document.querySelector('#kitform.popupDiv');
if (popupDiv != undefined)
if (document.querySelector('#kitform.popupDiv').classList.length > 1)
document.querySelector('#kitform.popupDiv').className = 'popupDiv';
} else {
doAlert(errorMessage);
}
}
}

function addNewItemToQuote() {
aniqtimerc = 0;
document.querySelector('.step54').innerHTML = 'check';
document.querySelector('.step55').classList.remove('d-none');
document.querySelector('.step55').innerHTML = 'sprint';
if (newItem.id < 1) {
doAlert('There was a problem adding the new Item, please refresh the page and search the item via the Item Code column. If it does not exist, please try adding it again.');
return false;
}
document.querySelector('#advancedOptionsStep5 .alert').innerHTML = 'Item added in the inventory. Please wait while we add this to your quote.';
clearUserSetting('advBOM%')
document.querySelector('#itemFilter').value = newItem.code;
document.querySelector('#itemFilterSelect').value = '';
filterSelect('inv', 'itemFilter');
setTimeout (function () {
addNewItemToQuote2();
}, 300);
}

function advOptFinish(nc = 1) {
document.querySelector('#addInventoryModal form').reset();
document.querySelector('#addInventoryAdvancedOptionModal form').reset();
document.querySelectorAll('#dataTableAdvBom .inv_values').forEach(elem => {
elem.remove();
});
document.querySelector('.AdvBomRouteCreator').style.display = 'none';
document.querySelector('#AdvBomRouteName').value = '';
document.querySelector('#AdvBomRouteNameMessage').value = '';
document.querySelector('.AdvBomRouteCreator #route').innerHTML = '';
document.querySelector('#advBomMFProcTimeEntry').innerHTML = '';
selectedRoute = 0;
routeData = {};
stepsRestored = [1, 1, 1, 1, 1, 1];
lastSelectedRoute = 0;
advBomComplete = 1;
document.getElementById('advOptCurStep').value = 1;
document.getElementById('btnAdvOptPrev').style.display = '';
document.getElementById('btnAdvOptNext').style.display = '';
document.getElementById('btnAdvOptFinish').style.display = 'none';
document.getElementById('btnAdvOptRestart').style.display = 'none';
document.querySelectorAll('.advOptTabCons').forEach(advOptElem => {
advOptElem.style.display = 'none';
});
document.querySelectorAll('#advancedBOMBuilder .nav-item').forEach((nelem, nind) => {
if (nind != 4) {
nelem.disabled = false;
nelem.removeAttribute('disabled');
}
});
showInvAddAdvanceOptionStep(1);
if (nc == 1) modalClose('addInventoryAdvancedOptionModal');
}

function advOptRestart() {
advOptFinish();
modalOpen('addInventoryModal');
}

function advBomCancelCreation() {
document.querySelector('.custProcess1').style.display = 'none';
document.querySelector('.custProcess2').style.display = 'none';
document.querySelector('.custProcess3').style.display = 'none';
document.querySelector('.custProcess3').previousElementSibling.style.display = '';
document.querySelector('.custProcess4').style.display = 'none';
document.getElementById('AdvBomRouteName').value = '';
document.getElementById('AdvBomRouteDescription').value = '';
document.querySelector('.AdvBomRouteCreator').style.display = 'none';
document.getElementById('processList2').style.height = document.getElementById('processList').offsetHeight + 'px';
if (advanceOptionModal == 1) {
document.getElementById('advancedOptionsStep2').scrollTo(0, 0);
} else {
window.scrollTo(0, 0);
}
routeCon = document.querySelector('.AdvBomRouteCreator').querySelector('#route');
routeCon.innerHTML = '';
if (dupProcessId == undefined)
dupProcessId = document.getElementById('advBomRoute').value;
document.getElementById('advBomRoute').focus();
document.getElementById('advBomRoute').value = dupProcessId;
selectedRoute = dupProcessId;
selectRoute(dupProcessId);
toggleProcessTimeEntry();
document.getElementById('advBomRoute').focus();
document.querySelector('.custProcess3').style.display = '';
if (dupProcessId > 0) document.querySelector('.custProcess3').style.display = '';
}

function checkDuplicateProcess() {
clearTimeout(dupProcessTimer);
dupProcessTimer = setTimeout(function () {
dupProcess = false;
dupProcessId = 0;
dupMessage = '';
document.querySelector('.advBomCancelCreation').classList.add('remove');
fd = new FormData;
document.querySelectorAll('#advancedBOMBuilder #processList2 li').forEach((e, i) => {
fd.append('depth[]', e.dataset.depth);
fd.append('process[]', e.dataset.id);
});
ajaxSubmit(function (ret) {
if (document.querySelector('#advBomDuplicateProcessError') != undefined) document.querySelector('#advBomDuplicateProcessError').remove();
if (ret.res == 1 || ret.res == 'true') {
dupProcessId = ret.id;
dupProcess = true;
dupMessage = 'This process already exists as <b>' + document.querySelector('#advBomRoute option[value="' + ret.id + '"]').text + '</b>. Please use this process instead or continue updating the processes for this new route.';
document.querySelector('.advBomCancelCreation').classList.add('danger');
document.querySelector('#advancedBOMBuilder #processList').parentNode.parentNode.insertAdjacentHTML('beforebegin', '<div id="advBomDuplicateProcessError" class="alert alert-danger m-3 mt-2 mb-1 error">' + dupMessage + '</div>');
if (document.querySelectorAll('#advancedOptionsStep2 .error').length == 0) document.querySelector('#btnAdvOptNext').disabled = false;
} else {
saveCustomRoute ();
}
}, fd, 'invaddadvanced.php', 'checkProcesses');
}, 100);
}

function setProcessHeirarchy() {
setTimeout (function () {
var procs = document.querySelectorAll ('.AdvBomRouteCreator #route li');
ldepth = -1;
for (cnt = 0; cnt < procs.length; cnt++) {
elem = procs[cnt];
depth = parseInt(elem.dataset.depth);
if (depth - ldepth > 1) {
for (var ctr = cnt; ctr < procs.length; ctr++) {
ldepth = (depth - (depth - (ldepth + 1)));
if (parseInt(procs[ctr].dataset.depth) > ldepth) {
procs[ctr].dataset.depth = ldepth;
procs[ctr].style.marginLeft = (procs[ctr].dataset.depth * 40) + 'px';
} else break;
}
}
ldepth = parseInt(elem.dataset.depth);
}
}, 50);
}

var cbTimer = [];
function computeBatch(obj, upcost = false, all = false) {
var oa = Array.from(document.querySelectorAll('[name="' + obj.name + '"]'));
var oi = oa.indexOf(obj);
if (!all) to = 500; else to = 0;
clearTimeout (cbTimer[oi]);
cbTimer[oi] = setTimeout(function () {
cRow = obj.parentNode.parentNode;
nRow = cRow.nextElementSibling;
obj = cRow.querySelector('input[name="advbommfp_alloc_cost[]"]');
cost = obj;
if (cost.getAttribute('ocost') == undefined) {
cost = parseFloat((isNaN(parseFloat(obj.value)) ? 0 : parseFloat(obj.value)));
} else {
cost = parseFloat(cost.getAttribute('ocost'));
cost = parseFloat((isNaN(cost) ? 0 : cost));
}
obj.setAttribute('ocost', cost);
cRow.querySelector('input[name="advbommfp_alloc_cost[]"]').value = trimZeros(numWithDec(cRow.querySelector('input[name="advbommfp_alloc_cost[]"]').value));
qty = cRow.querySelector('input[name="advbommfp_alloc_qty[]"]').value;
qty = (isNaN(parseFloat(qty)) ? 1 : parseFloat(qty));
cRow.querySelector('input[name="advbommfp_alloc_qty[]"]').value = qty;
if (document.querySelector('#chkIncludeSetupTime').checked)
obj.value = trimZeros(cost);
var bc = parseFloat(qty * cost);
bc = parseFloat((isNaN(bc) ? 0 : bc));
if (manufacturingEnableProcessTypes) {
cRow.querySelector('input[name="advbommfpbatch_alloc_cost[]"]').value = numWithDec(bc);
cRow.querySelector('input[name="advbommfpbatch_alloc_cost[]"]').setAttribute('ovalue', numWithDec(bc));
}
if (cRow.querySelector('input[name="advbommfp_alloc_time[]"]').value < 1 && cRow.querySelector('input[name="advbommfp_alloc_time[]"]').value > 0) {
doNotice ('Looks like you are entering a fraction of an hour, converting these to minutes.&nbsp;&nbsp;You may also use the following formats or a combination of:<br><br><ul style="text-transform:lowercase;"><li>1 hour</li><li>1 hours</li><li>1 hr</li><li>5 minutes</li><li>5 minute</li><li>5 min</li><li>1 hr 5 min</li><li>1h15m</li></ul>', 10000);
cRow.querySelector('input[name="advbommfp_alloc_time[]"]').value = trimZeros(60 * cRow.querySelector('input[name="advbommfp_alloc_time[]"]').value);
}
time = convertHrToMin(cRow.querySelector('input[name="advbommfp_alloc_time[]"]').value);
time = (isNaN(parseFloat(time)) ? 0 : parseFloat(time));
if (document.querySelector('#chkIncludeSetupTime').checked)
cRow.querySelector('input[name="advbommfp_alloc_time[]"]').value = trimZeros(time);
var bt = parseFloat(qty * time);
bt = parseFloat((isNaN(bt) ? 0 : bt));
if (manufacturingEnableProcessTypes) {
cRow.querySelector('input[name="advbommfpbatch_alloc_time[]"]').value = trimZeros(numWithDec(bt));
cRow.querySelector('input[name="advbommfpbatch_alloc_time[]"]').setAttribute('ovalue', numWithDec(bt));
}
cRow.querySelector('input[name="advbommfpbatch_alloc_time[]"]').value = 0;
cRow.nextElementSibling.querySelector('input[name="advbomfp_takeup[]"]').value = 0;
cRow.nextElementSibling.querySelector('input[name="advbomfp_leadtime[]"]').value = 0;
cRow.nextElementSibling.querySelector('input[name="advbomfp_setupcost[]"]').value = 0;
cRow.nextElementSibling.querySelector('input[name="advbomfp_processcost[]"]').value = 0;
var st = parseFloat(cRow.nextElementSibling.querySelector('input[name="advbomfp_setuptime[]"]').value);
st = parseFloat((isNaN(st) ? 0 : st));
bt = (((time * qty) + st) / 60) * cost;
cRow.querySelector('input[name="advbommfpbatch_alloc_cost[]"]').value = numWithDec(bt);
cRow.querySelector('input[name="advbommfpbatch_alloc_cost[]"]').setAttribute('ovalue', numWithDec(bt));
setTimeout (function () { updateLabourData(); document.querySelector('#btnAdvOptNext').disabled = false; }, 50);
hideLabour = false;
document.querySelectorAll('[name="advbommfp_alloc_cost[]"]').forEach (e => {
v = e.value;
if (v.trim() == '')
v = 0;
e.classList.remove('border-danger');
if (v == 0) {
hideLabour = true;
e.classList.add('border-danger');
}
});
if (hideLabour) {
document.querySelector('.labouritemcon').classList.add('d-none');
document.querySelector('.labouritemcon2').classList.remove('d-none');
} else {
document.querySelector('.labouritemcon').classList.remove('d-none');
document.querySelector('.labouritemcon2').classList.add('d-none');
}
}, to);
}

function updateLabourData() {
document.querySelector('#advLabourCatMarkup').innerHTML = document.querySelector('#advBomLabourCat').options[document.querySelector('#advBomLabourCat').selectedIndex].dataset.markup;
tcost = 0;
document.querySelectorAll('input[name="advbommfpbatch_alloc_cost[]"]').forEach(ac => {
tcost += (isNaN(parseFloat(ac.value)) ? 0 : parseFloat(ac.value));
});
if (document.querySelector('#chkIncludeSetupTime').checked) {
document.querySelectorAll('input[name="advbomfp_setupcost[]"]').forEach((ac,aci) => {
ac.value = parseFloat(document.querySelectorAll('input[name="advbommfp_alloc_cost[]"]')[aci].value) * parseFloat(document.querySelectorAll('input[name="advbomfp_setuptime[]"]')[aci].value / 60);
tcost += (isNaN(parseFloat(ac.value)) ? 0 : parseFloat(ac.value));
});
document.querySelectorAll('input[name="advbomfp_processcost[]"]').forEach(ac => {
tcost += (isNaN(parseFloat(ac.value)) ? 0 : parseFloat(ac.value));
});
document.querySelectorAll('input[name="advbomfp_takeup[]"]').forEach(ac => {
tcost -= (isNaN(parseFloat(ac.value)) ? 0 : parseFloat(ac.value));
});
}
cost = tcost;
tcost = numWithDec(cost * 1);
cost = numWithDec(tcost);
sellprice = (cost * (1 + (document.querySelector('#advBomLabourCat').options[document.querySelector('#advBomLabourCat').selectedIndex].dataset.markup / 100)));
document.querySelector('#advLabourSellPrice').value = numWithDec(sellprice);
if (document.querySelector('#advBomLabourCatText') != undefined) document.querySelector('#advBomLabourCatText').remove();
if (document.querySelector('#advBomLabourIdSelect').value == undefined) document.querySelector('#advBomLabourIdSelect').value = -1;
if (document.querySelector('#advBomLabourIdSelect').value == '0') {
document.querySelector('#advLabourMUCon').style.display = '';
document.querySelector('#advBomLabourCat').style.display = '';
document.querySelector('#advLabourQty').value = 1;
document.querySelector('#advLabourCost').value = numWithDec(tcost);
document.querySelector('#advLabourSellCost').value = numWithDec(sellprice);
updateLabourPricing();
} else {
selopt = document.querySelector('#advBomLabourIdSelect').options[document.querySelector('#advBomLabourIdSelect').selectedIndex].dataset;
icost = selopt.cost;
document.querySelector('#advLabourMUCon').style.display = 'none';
document.querySelector('#advBomLabourCat').style.display = 'none';
document.querySelector('#advLabourCost').value = numWithDec(icost);
document.querySelector('#advLabourSellPrice').value = numWithDec(icost);
document.querySelector('#advLabourQty').value = numWithDec(cleanValue(tcost / icost), 4);
document.querySelector('#advLabourSellCost').value = numWithDec(tcost);
document.querySelector('#advBomLabourDesc').value = selopt.desc.replaceAll('\\n','\n').replaceAll('\\r','\r');
document.getElementById('advLabourMUCon').insertAdjacentHTML('afterend', '<div id="advBomLabourCatText">' + (selopt.cat != undefined ? selopt.cat : '') + '</div>');
}
document.querySelector('#advLabourSellCost').setAttribute('ovalue', document.querySelector('#advLabourSellCost').value);
document.querySelector('#advBomLabourCode').value = document.querySelector('#advBomLabourIdSelect').options[document.querySelector('#advBomLabourIdSelect').selectedIndex].text;
}

function updateLabourPricing() {
q = parseFloat(document.querySelector('#advLabourQty').value);
q = isNaN(q) ? 1 : q;
document.querySelector('#advLabourQty').value = numWithDec(cleanValue(q), 4);
s = parseFloat(document.querySelector('#advLabourSellPrice').value);
s = isNaN(s) ? 1 : s;
document.querySelector('#advLabourSellPrice').value = numWithDec(s);
document.querySelector('#advLabourSellCost').value = numWithDec(q * s);
}

var mergeDuplicateBomsTimer;
function mergeDuplicateBoms() {
clearTimeout (mergeDuplicateBomsTimer);
mergeDuplicateBomsTimer = setTimeout (function () {
var boms = document.querySelectorAll('#advancedBOMBuilder input[name="AdvBomitemid[]"]');
var desc = document.querySelectorAll('#advancedBOMBuilder textarea[name="AdvBomitemdescription[]"]');
for (var bcnt = 0; bcnt < boms.length - 1; bcnt++) {
for (var bcnt2 = bcnt + 1; bcnt2 < boms.length; bcnt2++) {
if (boms[bcnt].value == boms[bcnt2].value && desc[bcnt].value.trim() == desc[bcnt2].value.trim()) {
boms[bcnt].parentNode.parentNode.querySelector('input[name="AdvBomqty[]"]').value = parseFloat(boms[bcnt].parentNode.parentNode.querySelector('input[name="AdvBomqty[]"]').value) + parseFloat(boms[bcnt2].parentNode.parentNode.querySelector('input[name="AdvBomqty[]"]').value);
boms[bcnt2].parentNode.parentNode.classList.add('deletebom');
}
}
}
document.querySelectorAll('#advancedBOMBuilder .deletebom').forEach(bd => { bd.remove(); });
}, 1000);
}

var getRealTimeBOMPricingTimer;

function getRealTimeBOMPricing(from = 'bom', tableID = 'dataTableAdvBom') {
clearTimeout (getRealTimeBOMPricingTimer);
getRealTimeBOMPricingTimer = setTimeout (function () {
pricechanged = false;
abids = [];
document.querySelectorAll('input[name="AdvBomitemid[]"]').forEach(abid => {
if (BOMprices[abid.value] == undefined) {
abids.push(abid.value);
}
});
if (abids.length == 0) {
document.querySelector('#btnAdvOptNext').disabled = false;
return true;
}
ajaxSubmit(function (res) {
for (rcnt = 0; rcnt < res.length; rcnt++) {
document.querySelectorAll('input[name="AdvBomitemid[]"]').forEach(abid => {
if (abid.value == res[rcnt].id) {
pabid = abid.parentNode.parentNode;
if (pabid.getAttribute('override') == undefined)
for (pabidc = 0; pabidc < pabid.children.length; pabidc++) {
cpc = pabid.children[pabidc];
cpab = cpc.classList;
if (cpab.contains('AdvBomsohvalue'))
cpc.innerHTML = res[rcnt].soh;
if (cpab.contains('AdvBomavailvalue'))
cpc.innerHTML = res[rcnt].avail;
if (cpab.contains('AdvBomcostvalue'))
cpc.value = numWithDec(res[rcnt].cost);
if (cpab.contains('AdvBomavgcostvalue'))
cpc.innerHTML = currencyCode + numWithDec(res[rcnt].costavg);
if (cpab.contains('AdvBomqtyvalue')) {
cpc.querySelector('.datainput').value = numWithDec(cpc.querySelector('.datainput').value);
st = numWithDec(parseFloat(cpc.querySelector('.datainput').value) * parseFloat(res[rcnt].cost));
if (numWithDec(parseFloat(pabid.querySelector('input[name="AdvBomcost[]"]').value)) != st) pricechanged = true;
pabid.querySelector('.AdvBomtotal_cost_calc').innerHTML = currencyCode + st + '&nbsp;<span style="min-width: 39.75px;" class="badge rounded-pill bg-info" title="the cost for this material">COST</span>';
}
}
}
});
}
if (pricechanged) doAlert ('Bill of Material Items prices have changed since last save.&nbsp;&nbsp;Updates have been made to your Bill of Materials');
calculateAdvBTotal();
saveStep1(from, tableID);
document.querySelectorAll('input[name="AdvBomqty[]"]').forEach(abq => {
abq.addEventListener ('change', function (e) {
tgt = e.target;
cpc = tgt.parentNode;
pabid = cpc.parentNode;
cost = parseFloat(cpc.previousSibling.previousSibling.innerHTML.replace('$',''));
tgt.value = parseFloat(cleanValue(numWithDec(isNaN(parseFloat(tgt.value)) ? 0 : parseFloat(tgt.value)))).toFixed(3);
st = numWithDec(parseFloat(tgt.value) * cost);
pabid.querySelector('.AdvBomtotal_cost_calc').innerHTML = currencyCode + st + '&nbsp;<span style="min-width: 39.75px;" class="badge rounded-pill bg-info" title="the cost for this material">COST</span>';
pabid.querySelector('input[name="AdvBomcost[]"]').value = cost;
});
});
document.querySelector('#btnAdvOptNext').disabled = false;
}, null, 'invaddadvanced.php', 'getBOMPrices&ids=' + abids.join(','), 0); }, 1000);
}

document.querySelector('#advancedBOMBuilder').addEventListener('change', function () {
switch (parseInt(document.getElementById('advOptCurStep').value)) {
case 1:
saveStep1();
break;
case 2:
saveStep2();
break;
case 3:
saveStep3();
break;
}
});

function openImportModal () {
document.querySelector('.advBomImportBomList').innerHTML = '';
document.querySelectorAll('.advOptTabCons')[document.getElementById('advOptCurStep').value - 1].style.display = 'none';
document.querySelector('.AdvBomImportBOM').style.display = 'block';
document.getElementById('getcloneKit').style.display = 'none';
document.getElementById('cancelgetcloneKit').style.display = '';
document.getElementById('AdvBomitemFilterSelect').value = '';
document.getElementById('btnAdvOptNext').setAttribute ('disabled', 'disabled');
document.querySelector('#AdvBomitemFilterImport').value = '';
document.querySelector('#AdvBomitemFilterImport').setAttribute ('title', '');
document.querySelector('#AdvBomitemFilterImport').setAttribute ('placeholder', '');
document.querySelector('#AdvBomitemFilterImportSelect').value = '';
document.querySelector('#AdvBomitemFilterImportSelect').parentNode.querySelectorAll('.multiSelectOption.check').forEach(mso => {
mso.classList.remove ('check');
mso.previousSibling.innerHTML = '';
});
document.querySelector('#btnAdvOptPrev').style.display = 'none';
document.querySelector('#btnAdvOptNext').style.display = 'none';
setTimeout ("previewCloneKit ();", 2000);
}

function checkAdvBomScroll () {
document.querySelectorAll('.advOptTabCons').forEach(tcon => {
tcon.style.overflow = 'hidden auto';
p = tcon.getBoundingClientRect().width;
tcon.querySelectorAll('.advOptTabCons .row').forEach(ro => {
if (ro.getBoundingClientRect().width - p > 20) tcon.style.overflow = 'auto';
});
});
}

function goToStep3 () {
document.querySelector('#advancedOptionsStep3').style.display = 'none';
document.querySelector('#advancedOptionsStep3').style.display = '';
if (selectedRoute != document.querySelector('#advBomRoute').value) {
document.querySelector('#advBomRoute').value = selectedRoute;
lastSelectedRoute = 0;
setTimeout (function () { selectRoute (document.querySelector('#advBomRoute').value); }, 100);
}
advOptStep = 3;
document.querySelector('.custProcess1').style.display = 'none';
document.querySelector('.custProcess2').style.display = 'none';
document.querySelector('.custProcess3').style.display = 'none';
document.querySelector('.custProcess3').previousElementSibling.style.display = 'none';
document.querySelector('.custProcess4').style.display = 'none';
document.querySelector('.advBomSTCCB').style.display = '';
document.querySelector('#advancedOptionsStep3').addEventListener('change', function () {
clearTimeout(advBomTimer);
advBomTimer = setTimeout("saveStep3 ();", 2000);
});
if (lastSelectedRoute != selectedRoute) {
selectRoute(document.querySelector('#advBomRoute').value);
refreshProcessTimeAndNotes();
lastSelectedRoute = selectedRoute;
}
document.querySelector('#advBomLabourIdSelect').selectedIndex = -1;
if (!modifyItem) {
savedData = findUserSetting('advBOMStep' + advOptStep, [], new Date('2024-06-30'), advBomBaseURL);
if (savedData.cost != undefined) {
try {
document.querySelectorAll('#advancedOptionsStep3 textarea[name="advbommfp_notes[]"]').forEach((elem, ind) => {
elem.value = savedData.notes[ind] != undefined ? savedData.notes[ind] : '';
});
document.querySelectorAll('#advancedOptionsStep3 input[name="advbommfp_alloc_time[]"]').forEach((elem, ind) => {
elem.value = savedData.time[ind] != undefined ? savedData.time[ind] : '';
});
document.querySelectorAll('#advancedOptionsStep3 input[name="advbommfp_alloc_qty[]"]').forEach((elem, ind) => {
elem.value = savedData.qty[ind] != undefined ? savedData.qty[ind] : '';
});
if (manufacturingEnableProcessTypes) {
document.querySelectorAll('#advancedOptionsStep3 input[name="advbommfpbatch_alloc_time[]"]').forEach((elem, ind) => {
elem.value = savedData.batch[ind] != undefined ? savedData.batch[ind] : '';
});
}
document.querySelectorAll('#advancedOptionsStep3 input[name="advbommfp_alloc_cost[]"]').forEach((elem, ind) => {
elem.value = savedData.cost[ind] != undefined ? savedData.cost[ind] : '';
});
if (manufacturingEnableProcessTypes) {
document.querySelectorAll('#advancedOptionsStep3 input[name="advbommfpbatch_alloc_cost[]"]').forEach((elem, ind) => {
elem.value = savedData.batchcost[ind] != undefined ? savedData.batchcost[ind] : '';
});
}
document.querySelectorAll('#advancedOptionsStep3 .proctype').forEach((elem, ind) => {
elem.innerHTML = savedData.proctype[ind] != undefined ? savedData.proctype[ind] : 'unit';
});
document.querySelectorAll('#advancedOptionsStep3 input[name="advbomfp_takeup[]"]').forEach((elem, ind) => {
elem.value = savedData.takeup[ind] != undefined ? savedData.takeup[ind] : '0';
});
document.querySelectorAll('#advancedOptionsStep3 input[name="advbomfp_processcost[]"]').forEach((elem, ind) => {
elem.value = savedData.processcost[ind] != undefined ? savedData.processcost[ind] : '0';
});
document.querySelectorAll('#advancedOptionsStep3 input[name="advbomfp_setuptime[]"]').forEach((elem, ind) => {
elem.value = savedData.setuptime[ind] != undefined ? savedData.setuptime[ind] : '0';
});
document.querySelector('#advBomLabourIdSelect').value = setDefaultValue (savedData.labour.id, 0);
document.querySelector('#advBomLabourId').value = setDefaultValue (savedData.labour.code, 0);
document.querySelector('#advBomLabourDesc').value = setDefaultValue (savedData.labour.desc, '');
document.querySelector('#advLabourCost').value = setDefaultValue (savedData.labour.cost, 0);
document.querySelector('#advLabourSellPrice').value = setDefaultValue (savedData.labour.sell, 0);
document.querySelector('#advLabourQty').value = setDefaultValue (savedData.labour.qty, 1);
document.querySelector('#advLabourSellCost').value = setDefaultValue (savedData.labour.sellcost, 0);
document.querySelector('#advBomLabourCode').value = setDefaultValue (savedData.labour.code, '');
document.querySelector('#advBomLabourMarkup').value = setDefaultValue (savedData.labour.markup, 0);
} catch (err) { }
}
stepsRestored[advOptStep] = 1;
lastSelectedRoute = selectedRoute;
}
document.querySelectorAll('#advancedOptionsStep3 input[name="advbommfp_alloc_qty[]"]').forEach(telem => {
telem.addEventListener('change', function (e) {
v = this.value;
if (parseFloat(v) <= 0 || isNaN(v)) {
this.value = 1;
}
if (cleanValue(this.value) == '' || cleanValue(this.value) == '0')
this.value = 1;
});
});
setTimeout (function () { updateLabourData(); }, 250);
setTimeout (function () { updateLabourData(); }, 500);
document.querySelector('#chkIncludeSetupTime').addEventListener ('change', function (e) {
if (this.checked) {
document.querySelectorAll('.mfproctimecostrow').forEach(e => {
e.style.display = '';
e.previousElementSibling.children[0].setAttribute('rowspan', 2);
});
} else {
document.querySelectorAll('.mfproctimecostrow').forEach(e => {
e.style.display = 'none';
e.previousElementSibling.children[0].setAttribute('rowspan', 1);
});
}
document.querySelectorAll('input[name="advbommfp_alloc_time[]"]').forEach(obj => {
computeBatch(obj, false, true);
});
setTimeout (function () { updateLabourData (); }, 100);
});
var abit = document.querySelector('#advBomLabourId').value.trim().toLowerCase();
var advBomLabourIdSelect = document.querySelector('#advBomLabourIdSelect');
if (abit != '' && advBomLabourIdSelect.selectedIndex == -1)
for (var abic = 0; abic < advBomLabourIdSelect.options.length; abic++)
if (advBomLabourIdSelect.options[abic].text.trim().toLowerCase() == abit) {
advBomLabourIdSelect.selectedIndex = abic;
break;
}
}

function showHideStep2Buttons () {
if (selectedRoute < 0 || document.getElementById('advOptCurStep').value != 2) {
document.querySelector('.custProcess1').style.display = 'none';
document.querySelector('.custProcess2').style.display = 'none';
document.querySelector('.custProcess4').style.display = '';
document.querySelector('.custProcess3').style.display = 'none';
document.querySelector('.custProcess3').previousElementSibling.style.display = 'none';
} else {
document.querySelector('.custProcess1').style.display = '';
document.querySelector('.custProcess2').style.display = '';
document.querySelector('.custProcess4').style.display = 'none';
document.querySelector('.custProcess3').style.display = '';
document.querySelector('.custProcess3').previousElementSibling.style.display = '';
}
if (document.getElementById('advOptCurStep').value != 2) {
document.querySelector('.custProcess4').style.display = 'none';
document.querySelector('.custProcess3').previousElementSibling.style.display = 'none';
}
}

document.querySelector('#dataTableAdvBom').addEventListener('change', function (e) {
if (e.target.classList.contains('AdvBomcostvalue') || e.target.parentNode.classList.contains('AdvBomqtyvalue')) {
advBomupdateRow (e.target.parentNode.parentNode);
}
});

function advBomupdateRow (p) {
p.setAttribute('override', 1);
badge = '<span style="min-width: 39.75px;" class="badge rounded-pill bg-info" title="the cost for this material">COST</span>';
p.querySelector('.AdvBomtotal_cost_calc').innerHTML = numWithDec(Math.round(parseFloat(p.querySelector('.AdvBomcostvalue').value) * parseFloat(p.querySelector('.AdvBomqtyvalue input').value) * 100) / 100) + '&nbsp;' + badge;
p.querySelector('[name="AdvBomcost[]"]').value = parseFloat(p.querySelector('.AdvBomcostvalue').value);
calculateAdvBTotal();
saveStep1();
}

document.querySelector('#AdvBomqty').addEventListener('change', function () {
this.value = parseFloat(cleanValue(this.value)).toFixed(3);
});

function updateAdvBomLineItem (tgt) {
if (tgt.selectedIndex == -1) return false;
var row = tgt.parentNode.parentNode.parentNode.parentNode;
var id = row.id;
var rowNum = id.replace('AdvBomRowLine', '');
var bomData = tgt.options[tgt.selectedIndex].dataset;
tgt.dataset.selected = tgt.value;
row.setAttribute('bomdata', JSON.stringify(bomData));
row.querySelector('[name="AdvBomitemid[]"]').value = tgt.value;
row.querySelector('#AdvBomdesc' + rowNum).value = bomData.description;
row.querySelector('.AdvBomuom').innerHTML = setDefaultValue (bomData.uom, '');
var availVal = bomData.soh - bomData.allocated;
if (isNaN(availVal)) availVal = 0;
row.querySelector('.AdvBomavailvalue').innerHTML = setDefaultValue (availVal, 0);
row.querySelector('.AdvBomcostvalue').value = numWithDec (bomData.cost, 3);
row.querySelector('.AdvBomavgcostvalue').innerHTML = currencyCode + setDefaultValue (bomData.costavg, 0);
var costValue = bomData.cost;
var costavgValue = bomData.costavg;
var cnewcost = costmethod == 'Average Cost' ? costavgValue : costValue;
var costmethod = bomData.costmethod;
var badge = costmethod == 'Average Cost' ? '<span style="min-width: 39.75px;" class="badge rounded-pill bg-info" title="the cost for this material">AVG</span>' : '<span style="min-width: 39.75px;" class="badge rounded-pill bg-info" title="the cost for this material">COST</span>';
row.querySelector('.AdvBomallvalue').innerHTML = "<div class='AdvBomtotal_cost_calc'>$" + numWithDec(Math.round(cnewcost * row.querySelector("#AdvBomqty" + rowNum).value * 100) / 100) + '&nbsp;' + badge + "</div>";
row.querySelector('[name="AdvBomcost[]"]').value = costValue;
setTimeout (function () { row.querySelector('#AdvBomitemFilter' + rowNum).value = bomData.code.replaceAll(String.fromCharCode(9), '').trim() }, 20);
mergeDuplicateBoms();
calculateAdvBTotal();
}

function restoreItemData (tgt = undefined) {
return true;
if (document.querySelector('.step1ErrorInpt') != undefined)
document.querySelector('.step1ErrorInpt').remove();
if (tgt == undefined)
tgt = document.querySelectorAll('.AdvBomitemFilterSelect');
var allvalid = true;
tgt.forEach (e => {
if (e.selectedIndex == -1) {
var inp = document.querySelector('#' + e.id.replace('Select',''));
var sel = e.options;
if (inp.value.trim() == '' && inp.dataset.oldval != undefined)
inpv = inp.dataset.oldval;
else
inpv = inp.value;
for (var cnt = 0; cnt < sel.length; cnt++)
if (sel[cnt].dataset.code == inpv) {
e.selectedIndex = cnt;
break;
}
if (e.selectedIndex == -1) {
allvalid = false;
inp.classList.add('border');
inp.classList.add('border-danger');
} else {
inp.classList.remove('border');
inp.classList.remove('border-danger');
}
}
});
return allvalid;
}

document.querySelector('#addInventoryAdvancedOptionModal .close').classList.add('d-none');

function relocateLabourSelect () {
var sel = document.querySelector('#advBomLabourIdSelect');
var inp = document.querySelector('#advBomLabourId').parentNode.parentNode.getBoundingClientRect();
var height = (window.innerHeight - inp.y - 50);
sel.style.display = '';
sel.style.position = 'fixed';
sel.style.left = inp.x + 'px';
sel.style.width = '300px';
sel.style.maxWidth = '300px';
sel.style.height = height + 'px';
sel.style.top = (inp.bottom - height - inp.height) + 'px';
sel.style.left = 0 + 'px';
sel.style.top = (0 - height - inp.height) + 'px';
sel.style.position = 'absolute';
sel.style.width = 'fit-content';
sel.style.maxWidth = 'fit-content';
sel.style.minWidth = inp.width + 'px';
if (sel.selectedIndex == -1 && sel.dataset.oldval != undefined) {
sel.value = sel.dataset.oldval;
updateLabourData();
}
}

function restoreAdvBomDesc (textTgt = undefined) {
if (textTgt == undefined || modifyQuoteItemID == 0)
return false;
var txtInp = textTgt.previousElementSibling.previousElementSibling.querySelector('.form-control');
var resDesc = textTgt.previousElementSibling.previousElementSibling.querySelector('.resdesc');
if (resDesc != undefined)
resDesc.remove();
if (textTgt.dataset.code == txtInp.value && textTgt.dataset.desc != textTgt.value)
txtInp.insertAdjacentHTML ('afterend', '<input class="resdesc m-2" type="button" value="Restore Description" onclick="dorestoreAdvBomDesc (this);">');
}

function dorestoreAdvBomDesc (btnTgt = undefined) {
if (btnTgt == undefined || modifyQuoteItemID == 0)
return false;
var textTgt = btnTgt.parentNode.parentNode.querySelector('.AdvBomitemDesc');
textTgt.value = textTgt.dataset.desc;
btnTgt.remove();
}

function checkrestoreAdvBomDesc (txtInp = undefined) {
if (txtInp == undefined || modifyQuoteItemID == 0)
return false;
textTgt = txtInp.parentNode.parentNode.querySelector('.AdvBomitemDesc');
var resDesc = textTgt.previousElementSibling.previousElementSibling.querySelector('.resdesc');
if (txtInp.value != textTgt.dataset.code && resDesc != undefined)
resDesc.remove();

}

function setProcessHeirarchyChildren (delobj) {
var procs = document.querySelectorAll ('.AdvBomRouteCreator #route li');
var delproc = delobj.parentNode;
for (var cnt = 0; cnt < procs.length; cnt++)
if (procs[cnt] == delproc) {
for (var ctr = 0; ctr < procs.length; ctr++)
if (parseInt(procs[ctr].dataset.depth) > parseInt(procs[cnt].dataset.depth)) {
procs[ctr].dataset.depth = procs[ctr].dataset.depth - 1;
procs[ctr].style.marginLeft = (procs[ctr].dataset.depth * 40) + 'px';
}
}
}

function doRemoveProcess (obj) {
setProcessHeirarchyChildren (obj);
obj.parentNode.remove();
}

function showTotalCostComputation (obj) {
showHelper(obj, '<table border="0" cellspacing="0" cellpadding="0" style="display: inline-block;padding: 10px;"><tbody><tr><td></td><td>&nbsp;&nbsp;( [Time] * [Qty Break] ) + [Setup Time]</td></tr><tr><td style="line-height: 1px;">Total Cost = </td><td style="line-height: 1px;">___________________________________________ x [Unit Cost]</td></tr><tr><td></td><td style="line-height: 15px;vertical-align: top !important;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;60</td></tr></tbody></table>', 1);
}

var hch;
function hideComputationHelper () {
clearTimeout (hch);
hch = setTimeout (function () { if (document.querySelector('.popuphelper') != undefined) document.querySelector('.popuphelper').remove(); }, 100);
}var modifyItem = false;
var advancedBOMBuilder = undefined;;
var formInvAdd = undefined;
var modItem = undefined;
var bomExcluded = [];
var hookAdded = false;
var mfRoute = -1;
var quoteItemIDs = [];
var modInvFormData = undefined;
var lastAdvBomStep = 0;
var editItem = false;
var modifyQuoteItemID = 0;
var modifyRouteID = 0;
var modifyBomData = 0;
var quoteRow = undefined;
var quoteRowNum = -1;
var modifyQuoteLabourBom = [];
var modifyItemProcesses = undefined;
var modifyItemRoute = undefined;
var modifyBomRaw = '';
var itemModifyIntegrateWithBOMConfigurator = 1;
var itemModifyBOMConfiguratorDirect = 0;

document.addEventListener('DOMContentLoaded', function () {

if (itemModifyIntegrateWithBOMConfigurator != 1) {
itemFS = document.querySelector("#itemFilterSelect");
if (itemFS != undefined) {
itemFS.addEventListener ('mouseup', function () {
btnModify = document.querySelector('#btnModifyInventory');
if (btnModify != undefined)
if (document.getElementById("itemFilterSelect").selectedIndex != -1)
btnModify.classList.remove('d-none');
else
btnModify.classList.add('d-none');
});
}
}

document.getElementById('addInventoryAdvancedOptionModal').addEventListener('show.bs.modal', function (e) {
advancedBOMBuilder = document.querySelector('#advancedBOMBuilder');
if (modifyItem) {
while (document.querySelector('#dataTableAdvBomBody').children.length > 2) {
document.querySelector('#dataTableAdvBomBody tr:last-child').remove();
}
calculateAdvBTotal();
modInvAddUI ();
} else {
modItem = undefined;
}
setTimeout (function () {
document.querySelector('#btnAdvOptNext').addEventListener ('mouseup', function (e) {
if (modifyItem) {
switch (parseInt(document.querySelector('#advOptCurStep').value)) {
case 1 :
document.querySelector('#actImportBOM').style.display = '';
document.querySelector('#btnAdvOptPrev').style.display = '';
modInvShowTab (1);
setTimeout (function () { advancedBOMBuilder.querySelectorAll('.nav-item')[2].classList.remove('d-none');
advancedBOMBuilder.querySelectorAll('.nav-item')[2].style.display = '';
advancedBOMBuilder.querySelectorAll('.nav-item')[2].nextElementSibling.classList.remove('d-none');
advancedBOMBuilder.querySelectorAll('.nav-item')[2].nextElementSibling.style.display = ''; }, 1000);
break;
case 2 :
modInvShowTab (2);
setTimeout (function () { advancedBOMBuilder.querySelectorAll('.nav-item')[2].classList.remove('d-none');
advancedBOMBuilder.querySelectorAll('.nav-item')[2].style.display = '';
advancedBOMBuilder.querySelectorAll('.nav-item')[2].nextElementSibling.classList.remove('d-none');
advancedBOMBuilder.querySelectorAll('.nav-item')[2].nextElementSibling.style.display = ''; }, 100);
if (!editItem) {
document.querySelector('#advBomRoute').style.display = 'none';
// document.querySelector('#advBomRoute').value = 0;
document.querySelector('#advBomRoutePreviewProcesses').innerHTML = '';
document.querySelector('#advBomRoutePreviewName').innerHTML = '';
document.querySelector('#advBomRoute').style.display = '';
}
showProcessPreview ();
break;
case 3 :
if (!editItem) {
if (modifyItemRoute != undefined && document.querySelector('#advBomRoute').value == modifyItemRoute.id)
setTimeout (function () {
document.querySelectorAll('[name="advbommfp_alloc_id[]"]').forEach (e => {
var fc = 1;
document.querySelectorAll('[name="advbommfp_alloc_id[]"]').forEach (e2 => {
if (e.value == e2.value && e != e2) {
fc++;
}
});
e.dataset.fc = fc;
});
if (modifyItemProcesses != undefined) modifyItemProcesses.forEach (p => {
var fc = 1;
modifyItemProcesses.forEach (p2 => {
if (p.processid == p2.processid && p != p2)
fc++;
});
p.fc = fc;
});
setTimeout (function () {
document.querySelectorAll('[name="advbommfp_alloc_id[]"]').forEach (e => {
var pf = false;
var dv = 0;
var pr = e.parentNode.parentNode;
if (modifyItemProcesses != undefined) modifyItemProcesses.forEach (p => {
if (p.processid == e.value && (e.dataset.fc == undefined || e.dataset.fc == p.fc)) {
var prv = pr.querySelector('[name="advbommfp_alloc_time[]"]');
if (setDefaultValue(prv.value, 0) == 0 && setDefaultValue(p.estimated, 0) > 0)
prv.value = p.estimated;
var prv = pr.querySelector('[name="advbommfp_alloc_qty[]"]');
//if (setDefaultValue(prv.value, 0) == 0 && setDefaultValue(p.estimated, 0) > 0) {
if(p.qty == "" || p.qty==0) { p.qty = 1; }
prv.value = p.qty;
//}
var prv = pr.querySelector('[name="advbommfp_alloc_cost[]"');
if (setDefaultValue(prv.value, 0) == 0 && setDefaultValue(p.estimated, 0) > 0)
prv.value = p.unitcost;
}
});
});
}, 250);
}, 100);
}
if (editItem && modifyQuoteLabourBom.id != undefined)
setTimeout (function () {
var laboursel = document.querySelector('#advBomLabourIdSelect');
laboursel.value = modifyQuoteLabourBom.id;
document.querySelector('#advBomLabourId').value = modifyQuoteLabourBom.code;
if (laboursel.selectedIndex == -1) {
laboursel.options.length = laboursel.options.length + 1;
for (var cnt = 0; cnt < iecats.length; cnt++)
if (iecats[cnt].id == modifyQuoteLabourBom.id) {
var lselopt = laboursel.options[laboursel.options.length - 1];
lselopt.value = iecats[cnt].id;
lselopt.text = iecats[cnt].code;
lselopt.setAttribute ('markup', iecats[cnt].markup);
lselopt.setAttribute ('desc', iecats[cnt].desc);
lselopt.setAttribute ('cat', iecats[cnt].category);
lselopt.setAttribute ('data-markup', iecats[cnt].markup);
lselopt.setAttribute ('data-desc', iecats[cnt].desc);
lselopt.setAttribute ('data-cat', iecats[cnt].category);
lselopt.setAttribute ('id', iecats[cnt].id);
break;
}
}
updateLabourData();
setTimeout (function () {
updateLabourData();
document.querySelector('#advLabourCost').value = numWithDec (modifyQuoteLabourBom.qibcost / modifyQuoteLabourBom.qibqty, 2);
document.querySelector('#advLabourQty').value = numWithDec (modifyQuoteLabourBom.qibqty, 4);
document.querySelector('#advLabourSellCost').value = numWithDec (modifyQuoteLabourBom.qibcost, 2);
}, 100);
setTimeout (function () {
document.querySelector('#advLabourCost').value = numWithDec (modifyQuoteLabourBom.qibcost / modifyQuoteLabourBom.qibqty, 2);
document.querySelector('#advLabourQty').value = numWithDec (modifyQuoteLabourBom.qibqty, 4);
document.querySelector('#advLabourSellCost').value = numWithDec (modifyQuoteLabourBom.qibcost, 2);
if (modifyBomRaw != '' && modifyBomRaw != undefined && isJson(modifyBomRaw)) {
try { modifyBomRaw = modifyBomRaw = JSON.parse(modifyBomRaw); } catch (err) { }
if (modifyBomRaw.processData != undefined && isJson(modifyBomRaw.processData)) {
try { modifyBomRaw.processData = JSON.parse(modifyBomRaw.processData); } catch (err) { }
for (var pdc = 0; pdc < modifyBomRaw.processData.length; pdc++) {
var e = modifyBomRaw.processData[pdc];
if (e.id == undefined) continue;
var pid = document.querySelector('[name="advbommfp_alloc_id[]"][value="' + e.id + '"]');
if (pid == undefined) continue;
var parent = pid.parentNode.parentNode;
parent.querySelector('[name="advbommfp_notes[]"]').value = e.notes;
parent.querySelector('[name="advbommfp_alloc_time[]"]').value = e.time;
parent.querySelector('[name="advbommfp_alloc_qty[]"]').value = e.qtybreak;
parent.querySelector('[name="advbommfp_alloc_cost[]"]').value = e.unitcost;
parent.querySelector('[name="advbommfpbatch_alloc_time[]"]').value = e.batchtime;
parent.querySelector('[name="advbommfpbatch_alloc_cost[]"]').value = e.totalcost;
parent.nextElementSibling.querySelector('[name="advbomfp_takeup[]"]').value = e.takeup;
parent.nextElementSibling.querySelector('[name="advbomfp_processcost[]"]').value = e.processcost;
parent.nextElementSibling.querySelector('[name="advbomfp_setuptime[]"]').value = e.setuptime;
}
}
if (modifyBomRaw.labourData != undefined && isJson(modifyBomRaw.labourData)) {
try { modifyBomRaw.labourData = JSON.parse(modifyBomRaw.labourData); } catch (err) { }
document.querySelector('#advBomLabourIdSelect').value = modifyBomRaw.labourData.id;
document.querySelector('#advBomLabourId').value = modifyBomRaw.labourData.code;
updateLabourData();
document.querySelector('#advBomLabourDesc').value = modifyBomRaw.labourData.desc;
document.querySelector('#advLabourCost').value = modifyBomRaw.labourData.cost;
document.querySelector('#advLabourQty').value = modifyBomRaw.labourData.qty;
document.querySelector('#advLabourSellCost').value = modifyBomRaw.labourData.selcost;
}
if (modifyBomRaw.markup != undefined) {
document.querySelector('#advBomPreviewMarkup').value = modifyBomRaw.markup;
}
}
invAddComputeAll ();
}, 200);
}, 50);
break;
case 4 :
try { advancedBOMBuilder.querySelectorAll('.nav-item.active').forEach(ni => { ni.classList.remove('active'); } ); } catch (err) { }
advancedBOMBuilder.querySelectorAll('.nav-item')[4].classList.add('active');
document.querySelector('.pricingcard').classList.add('d-none');
document.querySelector('.advBomPrevsellprice').classList.add('d-none');
document.querySelector('.advBomPrevsellpriceLabel').classList.add('d-none');
if (modifyItem) {
var quoteEditTitle = document.querySelector('#addInventoryAdvancedOptionModal .modal-header');
if (quoteEditTitle != undefined && quoteEditTitle.innerText.toLowerCase() != 'Inventory Item and Bill of Materials Editor'.toLowerCase())
quoteEditTitle.innerHTML = quoteEditTitle.innerHTML.split(' @ ')[0] + ' @ ' + document.querySelector('.advBomPrevbuyprice').innerHTML + ' x ' + quoteEditTitle.innerHTML.split(' @ ')[1].split(' x ')[1];
}
break;
case 5 :
modInvStep6 ();
break;
}
setTimeout ( function () { lastAdvBomStep = document.querySelector('#advOptCurStep').value }, 25 );
}
});
document.querySelector('#btnAdvOptPrev').addEventListener ('mouseup', function (e) {
if (modifyItem) {
switch (parseInt(document.querySelector('#advOptCurStep').value)) {
case 0 :
modInvStep0 ();
break;
}
}
});
document.getElementById('addInventoryAdvancedOptionModal').addEventListener('hidden.bs.modal', function (e) {
modInvRemoveUI ();
editItem = false;
modifyQuoteItemID = 0;
modifyRouteID = 0;
modifyBomData = 0;
modifyBomRaw = '';
quoteRow = undefined;
quoteRowNum = -1;
modifyQuoteLabourBom = [];
hookAdded = false;
mfRoute = -1;
quoteItemIDs = [];
lastAdvBomStep = 0;
});
}, 250);
document.querySelector('.reviewentryheading').innerHTML = 'Review changes';
});

document.querySelector('#itemFilterSelect').addEventListener('change', function () {
var iid = document.querySelector('#itemFilterSelect').options[document.querySelector('#itemFilterSelect').selectedIndex];
if (iid != undefined) {
iid = iid.value;
modifyItemProcesses = undefined;
modifyItemRoute = undefined;
ajaxSubmit (function (data) {
modifyItemProcesses = data.processes;
modifyItemRoute = data.route;
}, new FormData(), 'itemModify.php', 'getInvMFMeta&modifyid=' + iid);
var formData = new FormData();
formData.append("code", iid);
ajaxSubmit(function (rbomItems) {
bomItems = rbomItems;
}, formData, 'itemModify.php', 'getBOM', 0);
}
});
});

function modInvAddUI () {
modifyItem = true;
modInvFormData = undefined;
if (advancedBOMBuilder.querySelector('.modInvNav') != undefined) {
advancedBOMBuilder.querySelector('.modInvNav').nextElementSibling.remove();
advancedBOMBuilder.querySelector('.modInvNav').remove();
}
advancedBOMBuilder.querySelector('#navbarNav li').classList.remove ('active');
advancedBOMBuilder.querySelector('#navbarNav li').insertAdjacentHTML ('beforebegin', document.querySelector('.modInvNavItem').innerHTML);
if (advancedBOMBuilder.querySelector('#modInvOptionStep0') == undefined) {
document.querySelector('#advancedOptionsStep1').insertAdjacentHTML ('beforebegin', document.querySelector('#modInvOptionStep0').outerHTML.replace('d-none', ''));
document.querySelector('#advancedOptionsStep5').insertAdjacentHTML ('afterend', document.querySelector('#modInvOptionStep6').outerHTML);
}
modItem = document.querySelector('#itemFilterSelect').options[document.querySelector('#itemFilterSelect').selectedIndex];
advancedBOMBuilder.querySelector('#modInvItemHead').innerHTML = modItem.dataset.code;
advancedBOMBuilder.querySelector('#modInvcode').value = modItem.dataset.code;
advancedBOMBuilder.querySelector('#modInvCodeDisp').innerHTML = modItem.dataset.code;
advancedBOMBuilder.querySelector('#modInvdescription').value = modItem.dataset.description;
advancedBOMBuilder.querySelector('#modInvcategory').value = modItem.dataset.cat;
advancedBOMBuilder.querySelector('#modInvbuyPrice').value = modItem.dataset.cost;
advancedBOMBuilder.querySelector('#modInvuom').value = modItem.dataset.uom;
formInvAdd = document.querySelector('#formInvAdd');
formInvAdd.querySelector('#code').value = modItem.dataset.code;
formInvAdd.querySelector('#description').value = modItem.dataset.desc;
formInvAdd.querySelector('#notes').value = modItem.dataset.notes;
formInvAdd.querySelector('#customer_notes').value = modItem.dataset.customer_notes;
formInvAdd.querySelector('#category').value = modItem.dataset.cat;
formInvAdd.querySelector('#buyPrice').value = modItem.dataset.cost;
formInvAdd.querySelector('#uom').value = modItem.dataset.uom;
modInvClearTabs ();
modInvGetBOMItems ();
modInvStep0 ();
advancedBOMBuilder.querySelector('.nav-item:last-child a').setAttribute ('oval', advancedBOMBuilder.querySelector('.nav-item:last-child a').innerHTML);
advancedBOMBuilder.querySelector('.nav-item:last-child a').innerHTML = 'Save Changes';
advancedBOMBuilder.insertAdjacentHTML ('afterbegin', '<input type="hidden" name="modifyItem" id="modifyItem" value="1"><input type="hidden" name="modifyid" id="modifyid" value="' + modItem.value + '">');
document.querySelector('#AdvBomitemFilterSelect').setAttribute('excludeids', modItem.value);
advancedBOMBuilder.querySelector('#advBomRoute').value = 0;
}

function modInvStep0 () {
document.querySelector('#advOptCurStep').value = '0';
document.querySelector('#advancedOptionsStep1').style.display = 'none';
document.querySelector('#actImportBOM').style.display = 'none';
document.querySelector('#btnAdvOptPrev').style.display = 'none';
modInvSaveStep0 ();
if (document.querySelector('#addInventoryAdvancedOptionModalTitle').getAttribute('oval') == undefined) document.querySelector('#addInventoryAdvancedOptionModalTitle').setAttribute('oval', document.querySelector('#addInventoryAdvancedOptionModalTitle').innerHTML);
document.querySelector('#addInventoryAdvancedOptionModalTitle').innerHTML = "Inventory Item and Bill of Materials Editor" + (editItem ? ' : <span class="text text-danger">Editing Quote Line Item ' + quoteRowNum + ' [' + modifyQuoteItemID + '] : ' + quoteRow.querySelector('a').innerHTML + ' @ $ ' + numWithDec (quoteRow.querySelector('[name="itemcost[]"]').value, 2) + ' x ' + numWithDec (quoteRow.querySelector('[name="itemqty[]"]').value, 4) + '</span>' : '');
document.querySelector('#addInventoryModal').style.opacity = 0;
advancedBOMBuilder.querySelector('#modInvOptionStep0').style.display = '';
advancedBOMBuilder.querySelector('#advancedOptionsStep1').style.display = 'none';
advancedBOMBuilder.querySelectorAll('.nav-item')[2].classList.remove('d-none');
advancedBOMBuilder.querySelectorAll('.nav-item')[2].style.display = '';
advancedBOMBuilder.querySelectorAll('.nav-item')[2].nextElementSibling.classList.remove('d-none');
advancedBOMBuilder.querySelectorAll('.nav-item')[2].nextElementSibling.style.display = '';
advancedBOMBuilder.querySelector('#modInvOptionStep6').classList.add('d-none');
setTimeout (function () {
if (parseInt(document.querySelector('#advOptCurStep').value) == 0 && !editItem && modifyItemRoute != undefined) {
document.querySelector('#advBomRoute').value = modifyItemRoute.id;
document.querySelector('#advBomRoute').dispatchEvent (new Event('change'));
refreshProcessTimeAndNotes ();
showHideStep2Buttons ();
}
}, 250);
}

function modInvClearTabs () {
childs = document.getElementById('dataTableAdvBomBody').children;
for (ccnt = childs.length - 1; ccnt > 1; ccnt--)
childs[ccnt].remove();
calculateAdvBTotal ();
}

function modInvSaveStep0 () {
fdata = {};
advancedBOMBuilder.querySelector('#modInvOptionStep0').querySelectorAll('input, textarea, select').forEach (i => {
eval ('fdata.' + i.id + ' = "' + i.value.replaceAll('\n', '<br>').replaceAll('\r', '') + '"');
});
setUserSetting ('modInvStep0', JSON.stringify(fdata));
if (document.querySelector('#advancedBOMBuilder .nav-item.active') != undefined) document.querySelector('#advancedBOMBuilder .nav-item.active').classList.remove('active');
document.querySelector('.modInvNav').classList.add('active');
document.querySelector('#advBomRoutePreview').style.display = 'none';
}

function modInvRestoreStep0 () {
savedData = findUserSetting('modInvStep0');
if (advancedBOMBuilder.querySelector('.invaddwarning') != undefined) advancedBOMBuilder.querySelector('.invaddwarning').remove();
if (savedData.code != undefined) {
for (var x in savedData)
advancedBOMBuilder.querySelector('#' + x).value = savedData[x].replaceAll('<br>', '\n');
d = document.createElement ('div');
d.classList.add('alert');
d.classList.add('alert-warning');
d.classList.add('invaddwarning');
d.innerHTML = 'Pending Item: You have unsaved New Item for this quote, would you like to continue working on it?<br><br><button class="btn btn-primary" onclick="this.parentNode.remove();advancedBOMBuilder.querySelector(\'#modInvdescription\').focus();">Continue</button>&nbsp;<button class="btn btn-primary" onclick="clearmodInvForm();this.parentNode.remove();">Discard Pending Item</button>';
advancedBOMBuilder.querySelector('#modInvOptionStep0').insertBefore(d, advancedBOMBuilder.querySelector('#modInvOptionStep0'));
}
}

function modInvRemoveUI () {
try {
modifyItem = false;
if (document.querySelector('#addInventoryAdvancedOptionModalTitle').getAttribute('oval') != undefined) document.querySelector('#addInventoryAdvancedOptionModalTitle').innerHTML = document.querySelector('#addInventoryAdvancedOptionModalTitle').getAttribute('oval');
document.querySelector('#formInvAdd').reset();
document.querySelector('#addInventoryModal').style.opacity = 1;
if (advancedBOMBuilder.querySelector('#advancedOptionsStep4 h4').getAttribute('oval') != undefined)
advancedBOMBuilder.querySelector('#advancedOptionsStep4 h4').innerHTML = advancedBOMBuilder.querySelector('#advancedOptionsStep4 h4').getAttribute('oval');
if (advancedBOMBuilder.querySelector('.nav-item:last-child a').getAttribute('oval') != undefined)
advancedBOMBuilder.querySelector('.nav-item:last-child a').innerHTML = advancedBOMBuilder.querySelector('.nav-item:last-child a').getAttribute('oval');
document.querySelector('#modifyItem').remove();
advancedBOMBuilder.querySelector('#modInvOptionStep0').remove();
advancedBOMBuilder.querySelectorAll('.navbar-nav li').forEach(li => { li.style.display = ''; li.classList.remove('d-none'); });
advancedBOMBuilder.querySelector('.navbar-nav li:first-child').nextElementSibling.remove();
advancedBOMBuilder.querySelector('.navbar-nav li:first-child').remove();
document.querySelector('#modifyid').remove();
advancedBOMBuilder.querySelector('#modInvOptionStep6').remove();
document.querySelector('#AdvBomitemFilterSelect').removeAttribute('excludeids');
document.querySelector('#btnAdvOptPrev').style.display = '';
document.querySelector('#btnAdvOptNext').style.display = '';
advancedBOMBuilder.querySelector('#advBomRoutePreviewProcesses').innerHTML = '';
if (advancedBOMBuilder.querySelector('.custProcess1') != undefined) {
advancedBOMBuilder.querySelector('.custProcess1').style.display = 'none';
advancedBOMBuilder.querySelector('.custProcess2').style.display = 'none';
}
document.querySelector('#advBomRoutePreview').style.display = 'none';
modInvFormData = undefined;
document.querySelector('#AdvBomtheDescription').value = '';
document.querySelector('#AdvBomavailText').value = '';
} catch (err) { }
}

function clearmodInvForm () {
advancedBOMBuilder.querySelector('#modInvOptionStep0').querySelectorAll('input, textarea, select').forEach (i => {
i.value = '';
});
clearUserSetting ('modInvStep0');
}

var bomItems = undefined;
function modInvGetBOMItems () {
advancedBOMBuilder = document.querySelector('#advancedBOMBuilder');
advancedBOMBuilder.querySelectorAll('.inv_values').forEach(bi=>{bi.remove();});
if (modifyQuoteItemID != 0) return true;
bomExcluded = [];
bomItems.forEach(bomItem => {
if (exCats.includes(bomItem.cat)) {
bomExcluded.push (bomItem);
} else {
addAdvBOMDataRow('dataTableAdvBom', 'bom', bomItem);
invlc = document.querySelector('.inv_values');
invlc.querySelector ('.AdvBomcostvalue').value = bomItem.cost;
invlc.querySelector ('[name="AdvBomcost[]"]').value = bomItem.cost;
invlc.querySelector ('[name="AdvBomqty[]"]').value = bomItem.bomqty;
invlc.querySelector ('[name="AdvBomitemdescription[]"]').value = bomItem.bomdescription;
advBomupdateRow (invlc);
}
});
if (bomExcluded.length > 0) {
bomList = '<ul>';
for (brc = 0; brc < bomExcluded.length; brc++)
bomList += '<li>' + bomExcluded[brc].code + ' - ' + bomExcluded[brc].desc + '</li>';
bomList += '</ul>';
if (document.querySelector('.bomlabouralert') != undefined)
document.querySelector('.bomlabouralert').remove();
document.querySelector('#modInvdescription').parentNode.insertAdjacentHTML ('afterend', '<div class="alert alert-warning bomlabouralert my-4">The following Bill of Materials were excluded as these items are labour items, please input your labour item once the route has been selected:' + bomList + '<span class="text-danger">* These items can be included in the BOM by clicking \'Include Labour Items\' when in the "Bill of Materials" step.</span></div><br>');
}
}

function modInvShowTab (n) {
try { advancedBOMBuilder.querySelectorAll('.nav-item.active').forEach(ni => { ni.classList.remove('active'); } ); } catch (err) { }
advancedBOMBuilder.querySelector('#modInvOptionStep0').style.display = 'none';
for (cnt = 1; cnt <= 5; cnt++) advancedBOMBuilder.querySelector('#advancedOptionsStep' + cnt).style.display = 'none';
advancedBOMBuilder.querySelector('#modInvOptionStep6').classList.add('d-none');
if (n == 0)
advancedBOMBuilder.querySelector('#modInvOptionStep0').style.display = '';
else if (n == 6)
advancedBOMBuilder.querySelector('#modInvOptionStep6').classList.remove('d-none');
else
document.querySelector('#advancedOptionsStep' + n).style.display = '';
advancedBOMBuilder.querySelectorAll('.nav-item')[n - (n == 6 ? 1 : 0)].classList.add('active');
setTimeout (function () { advancedBOMBuilder.querySelectorAll('.nav-item')[2].classList.remove('d-none');
advancedBOMBuilder.querySelectorAll('.nav-item')[2].style.display = '';
advancedBOMBuilder.querySelectorAll('.nav-item')[2].nextElementSibling.classList.remove('d-none');
advancedBOMBuilder.querySelectorAll('.nav-item')[2].nextElementSibling.style.display = ''; }, 250);
if (n == 1)
document.querySelector('#actImportBOM').insertAdjacentHTML ('beforebegin', '<button id="actRestoreLabourItems" class="btn btn-info text-uppercase" onmouseup="restoreLabourItems();">INCLUDE LABOUR ITEMS</button>');
else if (document.querySelector('#actRestoreLabourItems') != undefined)
document.querySelector('#actRestoreLabourItems').remove();
}

function modInvStep6 () {
modInvShowTab (6);
movInvcost = parseFloat(advancedBOMBuilder.querySelector('.advBomPrevbuyprice').innerHTML.replaceAll(currencyCode,''));
document.querySelectorAll('#advancedBOMBuilder .nav-item').forEach((nelem, nind) => {
if (nind != 4) {
nelem.disabled = true;
nelem.setAttribute('disabled', 'disabled');
}
});
newItem = {};
document.querySelector('.step61').classList.remove('d-none');
document.querySelector('.step61').innearHTML = 'sprint';
document.querySelector('.step62').classList.add('d-none');
document.querySelector('.step63').classList.add('d-none');
document.querySelector('#btnAdvOptPrev').style.display = 'none';
document.querySelector('#btnAdvOptNext').style.display = 'none';
modInvFormData = new FormData(document.querySelector('#addInventoryAdvancedOptionModal form'));
modInvFormData.append('selectedroute', selectedRoute);
modInvFormData.append('routedata', JSON.stringify(routeData));
setTimeout (function () {
document.querySelector('.step61').innerHTML = 'check';
document.querySelector('.step62').classList.remove('d-none');
document.querySelector('.step62').innerHTML = 'sprint';
setTimeout (function () {
document.querySelector('.step62').innerHTML = 'check';
document.querySelector('.step63').classList.remove('d-none');
document.querySelector('.step63').innerHTML = 'sprint';
document.getElementById('addInventoryModal').style.opacity = 0;
setTimeout(function () {
document.querySelector('.step63').innerHTML = 'check';
document.querySelector('.step64').classList.remove('d-none');
document.querySelector('.step64').innerHTML = 'sprint';
setTimeout(function () {
document.querySelector('.step64').innerHTML = 'check';
document.getElementById('addInventoryModal').style.opacity = 1;
document.getElementById('qty').value = 1;
document.getElementById('qty').focus();
document.getElementById('qty').select();
document.querySelector('#addInventoryModal').style.opacity = 0;
var processData = [];
var fpids = document.querySelectorAll('[name="advbommfp_alloc_id[]"]');
var fpnotes = document.querySelectorAll('[name="advbommfp_notes[]"]');
var fptime = document.querySelectorAll('[name="advbommfp_alloc_time[]"]');
var fpqtybreak = document.querySelectorAll('[name="advbommfp_alloc_qty[]"]');
var fpunitcost = document.querySelectorAll('[name="advbommfp_alloc_cost[]"]');
var fpbatchtime = document.querySelectorAll('[name="advbommfpbatch_alloc_time[]"]');
var fptotalcost = document.querySelectorAll('[name="advbommfpbatch_alloc_cost[]"]');
var fptakeup = document.querySelectorAll('[name="advbomfp_takeup[]"]');
var fpprocesscost = document.querySelectorAll('[name="advbomfp_processcost[]"]');
var fpsetuptime = document.querySelectorAll('[name="advbomfp_setuptime[]"]');
fpids.forEach ((e, i) => {
var data = {};
data.id = fpids[i].value;
data.notes = fpnotes[i].value;
data.time = fptime[i].value;
data.qtybreak = fpqtybreak[i].value;
data.unitcost = fpunitcost[i].value;
data.batchtime = fpbatchtime[i].value;
data.totalcost = fptotalcost[i].value;
data.takeup = fptakeup[i].value;
data.processcost = fpprocesscost[i].value;
data.setuptime = fpsetuptime[i].value;
processData.push(data);
});
var labourData = {};
labourData.id = document.querySelector('#advBomLabourIdSelect').value;
labourData.code = document.querySelector('#advBomLabourId').value;
labourData.desc = document.querySelector('#advBomLabourDesc').value;
labourData.cost = document.querySelector('#advLabourCost').value;
labourData.qty = document.querySelector('#advLabourQty').value;
labourData.selcost = document.querySelector('#advLabourSellCost').value;
var markup = document.querySelector('#advBomPreviewMarkup').value;
document.getElementById('qty').dataset.processData = JSON.stringify(processData);
document.getElementById('qty').dataset.labourData = JSON.stringify(labourData);
document.getElementById('qty').dataset.markup = markup;
setTimeout(function () {
if (editItem) {
modifyQuoteLineItem ([], modifyQuoteItemID);
} else {
modalClose('addInventoryAdvancedOptionModal'); setTimeout(function () { modalClose('addInventoryModal'); document.querySelector('#addInventoryModal').style.opacity = 1; }, 100);
advBomComplete = 1;
modifyItem = false;
var imitemFilterSelect = document.querySelector('#itemFilterSelect');
if (imitemFilterSelect.selectedIndex == -1) {
if (imitemFilterSelect.querySelector('[data-code="' + document.querySelector('#itemFilter').value + '"]') != undefined)
imitemFilterSelect.value = imitemFilterSelect.querySelector('[data-code="' + document.querySelector('#itemFilter').value + '"]').value;
}
isel = imitemFilterSelect.options[imitemFilterSelect.selectedIndex];
if (isel == undefined) {
doAlertModal ('Item cannot be found in the list, please reselect the item to be modified');
return false;
}
isel.dataset.cost = movInvcost;
isel.dataset.costmethod = 'Please Select';
isel.dataset.custombom = 1;
isel.desc = advancedBOMBuilder.querySelector('#modInvdescription').value;
isel.notes = advancedBOMBuilder.querySelector('#modInvnotes').value;
isel.customer_notes = advancedBOMBuilder.querySelector('#modInvcustomer_notes').value;
isel.cat = advancedBOMBuilder.querySelector('#modInvcategory').value;
isel.uom = advancedBOMBuilder.querySelector('#modInvuom').value;
isel.qibqiid = 0;
document.querySelector('#cost').value = numWithDec(cleanValue(movInvcost),2);
document.querySelector('#price').value = numWithDec(cleanValue(movInvcost),2);
document.querySelector('#lineCost').innerHTML = currencyCode + numWithDec(cFloat(movInvcost) * cFloat(document.querySelector('#qty').value),2);
if (document.querySelector('#costplus').checked)
document.querySelector('#discount').value = document.querySelector('#advBomPreviewMarkup').value;
else {
document.querySelector('#discount').value = 0;
}
document.querySelector('#adjPrice').value = numWithDec(cFloat(movInvcost) * parseFloat(100 + cFloat(document.querySelector('#discount').value)) / 100,2);
document.querySelector('#theDescription').value = advancedBOMBuilder.querySelector('#modInvdescription').value;
document.querySelector('#formInvAdd').reset();
document.querySelector('#codeCheck').parentNode.style.display = 'none';
updateNew ();
}
}, 50);
}, 50);
}, 50);
}, 50);
}, 50);
}

document.querySelector('#itemFilterSelect').addEventListener ('change', function (e) {
document.querySelectorAll('#itemFilterSelect option[data-custombom="1"]').forEach(e => {
e.removeAttribute ('data-custombom');
});
isel = document.querySelector('#itemFilterSelect').options[document.querySelector('#itemFilterSelect').selectedIndex];
mfRoute = -1;
quoteItemIDs = [];
document.querySelectorAll('[name="quoteitemid[]"]').forEach (e => {
quoteItemIDs.push(e.value);
});
});

function modifyQuoteLineItem (json, quoteItemId = -1) {
if (typeof btnModify != 'undefined') btnModify.classList.add('d-none');
if (modifyQuoteItemID != 0 && quoteItemId == -1) quoteItemId = modifyQuoteItemID;
if (typeof modItem != 'undefined')
if (modItem.dataset.custombom == 1 || quoteItemId != -1)
document.querySelectorAll('[name="quoteitemid[]"]').forEach (e => {
if (typeof json == 'object')
quoteeditsavejson = '';
else
quoteeditsavejson = json;
var qsj = quoteeditsavejson.split(';');
var qsji = -1;
var qiid = -1;
if (typeof quoteeditsavejson == 'string' && isJson(quoteeditsavejson) && (quoteItemId == undefined || quoteItemId == -1)) {
qiid = JSON.parse(quoteeditsavejson).quoteitemid;
quoteItemId = -1;
} else if (quoteItemId == -1) {
for (var cnt = 0; cnt < qsj.length; cnt++) {
qsjqiid = qsj[cnt].split('.value=')[1];
if (qsj[cnt].indexOf('parentid') != -1) qsjidx = qsj[cnt].split('parentid')[1].split('"')[0];
if (qsj[cnt].indexOf('parentid') != -1 && qsjqiid == 0) {
for (var ctr = 0; ctr < qsj.length; ctr++) {
if (qsj[ctr].indexOf('qItemId' + qsjidx) != -1) {
qsji = qsj[ctr].split('value=')[1];
break;
}
}
break;
}
}
if (qsji == -1)
qsji = quoteeditsavejson.split('.value=')[1].split(';')[0];
if (qsji != -1)
qiid = qsji;
else
qiid = -1;
} else if (quoteItemId != -1)
qiid = quoteItemId;
if (e.value == qiid && quoteItemId == -1 || (quoteItemId != -1 && quoteItemId == e.value)) {
modInvFormData = new FormData(document.querySelector('#addInventoryAdvancedOptionModal form'));
modInvFormData.append('selectedroute', selectedRoute);
modInvFormData.append('routedata', JSON.stringify(routeData));
modInvFormData.append('quoteitemid', e.value);
modInvFormData.append('modifyid', modItem.value);
if (quoteItemId != -1) {
modInvFormData.append('update', 1);
var quoteRowID = quoteRow.id;
quoteRow.querySelector('[name="itemdescription[]"]').value = advancedBOMBuilder.querySelector('#modInvdescription').value;
var h = quoteRow.querySelector('.popupDiv').innerHTML;
var sp = h.indexOf('Inventory Cost: ');
var ep = h.indexOf('</a>', sp);
var k = h.substr(sp, ep - sp);
var icost = parseFloat(document.querySelector('.advBomPrevbuyprice').innerHTML.replace(currencyCode, ''));
var iqty = parseFloat(quoteRow.querySelector('[name="itemqty[]"]').value);
// quoteitems.price / adjPrice / taxAmount are stored PER-UNIT;
// quoteitems.total is the LINE total (= adjPrice * qty). The unit
// sell basis must NOT be pre-multiplied by qty here — doing so
// (iprice = icost * iqty) made the persisted unit price qty-times
// too big, and the line total then multiplied by qty a second time.
var iprice = icost;
if (document.querySelector('#costplus').checked) {
if (quoteItemId == -1)
var markup = parseFloat(document.querySelector('#advBomPreviewMarkup').value.replace(/([^0-9])/gi, '').trim());
else
var markup = parseFloat(quoteRow.querySelector('[name="itemdiscount[]"]').value.replace(/([^0-9])/gi, '').trim());
var adjPrice = iprice * (1 + (markup / 100));
} else {
var disc = quoteRow.querySelector('[name="itemdiscount[]"]').value;
var adjPrice = iprice - (iprice * disc / 100);
}
// Per-unit tax off the row's actual tax rate (same basis updateRow uses).
var itaxRateEl = document.getElementById('itaxValue' + quoteRowID);
var taxPercent = (itaxRateEl != undefined) ? parseFloat(itaxRateEl.value) : 0;
if (isNaN(taxPercent)) taxPercent = 0;
var taxAmount = numWithDec(adjPrice * taxPercent / 100, 3);
var subTotal = Math.round((adjPrice * iqty) * 100)/100;
var qicost = icost;
modInvFormData.append('cost', icost);
modInvFormData.append('price', iprice);
modInvFormData.append('adjPrice', adjPrice);
modInvFormData.append('taxAmount', taxAmount);
modInvFormData.append('total', subTotal);
}
tds = e.parentNode.parentNode.children;
td = tds[tds.length - 1];
modInvFormData.append('processData', document.getElementById('qty').dataset.processData);
modInvFormData.append('labourData', document.getElementById('qty').dataset.labourData);
modInvFormData.append('markup', document.getElementById('qty').dataset.markup);
var bomraw = {};
bomraw.processData = document.getElementById('qty').dataset.processData;
bomraw.labourData = document.getElementById('qty').dataset.labourData;
bomraw.markup = document.getElementById('qty').dataset.markup;
ajaxSubmit (function (json) {
mfRoute = -1;
if (td.querySelector('.popupDiv') != undefined) {
if (td.querySelector('.moreinfobomtable') != undefined) {
td.querySelector('.moreinfobomtable').parentNode.parentNode.previousElementSibling.previousElementSibling.remove();
td.querySelector('.moreinfobomtable').parentNode.parentNode.previousElementSibling.remove();
if (td.querySelector('.moreinfobomtable').parentNode.parentNode.nextElementSibling != undefined)
if (td.querySelector('.moreinfobomtable').parentNode.parentNode.nextElementSibling.nextSibling != undefined) {
if (td.querySelector('.moreinfobomtable').parentNode.parentNode.nextElementSibling.nextSibling.innerHTML.indexOf('Route:') != -1)
td.querySelector('.moreinfobomtable').parentNode.parentNode.nextElementSibling.nextSibling.remove();
}
if (td.querySelector('.moreinfobomtable').parentNode.parentNode.nextElementSibling != undefined) td.querySelector('.moreinfobomtable').parentNode.parentNode.nextElementSibling.remove();
if (td.querySelector('.moreinfobomtable').parentNode.parentNode.nextElementSibling != undefined) td.querySelector('.moreinfobomtable').parentNode.parentNode.nextElementSibling.remove();
td.querySelector('.moreinfobomtable').remove();
}
var c = td.querySelector('.popupDiv').children;
var ia = c.length - 1;
for (var iac = ia; iac > 0; iac--) {
if (c[iac].innerHTML.indexOf('Manage Unit') != -1) {
ia = iac;
break;
}
}
if (ia == c.length - 1) {
for (iac = ia; iac > 0; iac--) {
if (c[iac].innerHTML.indexOf('id="warning2"') != -1) {
ia = iac;
break;
}
}
}
if (ia < c.length) {
var qiid = quoteItemId;
if (typeof quoteeditsavejson == 'string' && isJson(quoteeditsavejson) && (quoteItemId == undefined || quoteItemId == -1)) {
qiid = JSON.parse(quoteeditsavejson).quoteitemid;
quoteItemId = -1;
} else if (qiid == -1) {
var qsj = quoteeditsavejson.split(';');
var qsji = -1;
for (var cnt = 0; cnt < qsj.length; cnt++) {
qsjqiid = qsj[cnt].split('.value=')[1];
if (qsj[cnt].indexOf('parentid') != -1) qsjidx = qsj[cnt].split('parentid')[1].split('"')[0];
if (qsj[cnt].indexOf('parentid') != -1 && qsjqiid == 0) {
for (var ctr = 0; ctr < qsj.length; ctr++) {
if (qsj[ctr].indexOf('qItemId' + qsjidx) != -1) {
qsji = qsj[ctr].split('value=')[1];
break;
}
}
break;
}
}
if (qsji == -1)
qsji = quoteeditsavejson.split('.value=')[1].split(';')[0];
if (qsji != -1)
qiid = qsji;
else
qiid = -1;
}
var bomRowsJSON = [];
var advc = document.querySelector('#dataTableAdvBom').querySelectorAll('.inv_values');
var advq = document.querySelectorAll('[name="AdvBomqty[]"]');
var advcc = document.querySelectorAll('[name="AdvBomcost[]"]');
for (var ac = 0; ac < advq.length; ac++) {
var icode = advc[ac].children[0].querySelector('input').value;
var icost = numWithDec(cFloat(advcc[ac].value), 2);
var iqty = numWithDec(cFloat(advq[ac].value), 3);
var bomRowData = {};
bomRowData.code = icode;
bomRowData.qibinventorycode = icode;
bomRowData.qibqid = parseFloat(document.querySelector('#quoteId').value);
bomRowData.qibqiid = parseInt(qiid);
bomRowData.qibinventoryid = parseInt(advc[ac].children[0].querySelector('[name="AdvBomitemid[]"]').value);
bomRowData.qibparent = 0;
bomRowData.qibdescription = advc[ac].children[0].querySelector('.AdvBomitemDesc').value;
bomRowData.qibcost = parseFloat(icost);
bomRowData.qibqty = parseFloat(iqty);
bomRowData.uom = advc[ac].querySelector('.AdvBomuom').innerHTML;
bomRowData.cat = advc[ac].children[0].querySelector('.AdvBomItemCat').value;
bomRowsJSON.push (bomRowData);
}
var headhtml = '<hr class="mt-4"><div class="row"><div class="col-11 h4">Quote Item Bill of Materials</div><div class="col-1"><i class="float-right material-symbols-rounded pointer" onclick="editQuoteBOM(' + qiid + ', ' + selectedRoute + ', this.dataset.json, this.dataset.bomraw);" data-json=\'' + JSON.stringify(bomRowsJSON) + '\' data-bomraw=\'' + JSON.stringify(bomraw) + '\'>edit</i></div></div><div class="row mx-0 table-responsive" style="max-height:250px;"><div class="col px-0"><table class="table moreinfobomtable mb-0 table-fixed"><thead><th>Code</th><th>Qty</th><th>Cost</th></thead><tbody>';
if (document.querySelector('.quotemfroute') != undefined)
document.querySelector('.quotemfroute').remove();
var html = headhtml;
var tbomcost = 0;
for (var ac = 0; ac < advq.length; ac++) {
var icode = advc[ac].children[0].querySelector('input').value;
var icost = numWithDec(cFloat(advcc[ac].value), 2);
var iqty = numWithDec(cFloat(advq[ac].value), 4);
html += '<tr title="' + advc[ac].children[0].querySelector('.AdvBomitemDesc').value + '"><td>' + icode + '</td><td>' + iqty + '</td><td>$' + icost + '</td></tr>';
tbomcost += parseFloat(icost) * parseFloat(iqty);
}
if (selectedRoute != 0) {
html += '<tr><td>' + document.querySelector('#advBomLabourCode').value + '</td><td>' + numWithDec(cFloat(document.querySelector('#advLabourQty').value),4) + '</td><td>$' + numWithDec(cFloat(document.querySelector('#advLabourCost').value), 2) + '</td></tr>';
tbomcost += parseFloat(cFloat(document.querySelector('#advLabourCost').value)) * parseFloat(cFloat(document.querySelector('#advLabourQty').value));
}
if (html != headhtml) {
html += '</div></div><table class="fw-bold w-100 text-end mt-2"><tr><td class="w-100" style="border:none;">Total:</td><td style="border:none;">$' + numWithDec (tbomcost, 2) + '</td></tr>';
html += '</tbody></table>';
}
if (selectedRoute != 0)
html += '<span class="quotemfroute">Manufacturing Route: ' + document.querySelector('#advBomRoute').options[document.querySelector('#advBomRoute').selectedIndex].text + '</span><hr class="mb-4">';
if (html != headhtml && typeof c[ia] != 'undefined') {
c[ia].insertAdjacentHTML ('afterend', html);
if (td.querySelector('div > [title="Bill of Materials"]') == undefined) {
td.querySelector('div > i:last-child').insertAdjacentHTML ('afterend', '<div class="badge bg-success float-right mt-1" title="Bill of Materials">B</div>');
}
}
}
}
if (editItem) {
if (quoteItemId != -1) {
h = h.replace(k, 'Inventory Cost: $' + numWithDec (qicost, 2));
quoteRow.querySelector('[name="itemcost[]"]').value = qicost;
quoteRow.querySelector('[name="itemprice[]"]').value = qicost;
quoteRow.querySelector('.costplus input').value = iprice;
quoteRow.querySelector('[name="adjPrice[]"]').value = numWithDec (adjPrice, 4);
quoteRow.querySelector('[name="itaxAmount[]"]').value = taxAmount;
quoteRow.querySelector('#itaxAmountText' + quoteRowID).innerHTML = taxAmount;
quoteRow.querySelector('#subTotal' + quoteRowID).innerHTML = subTotal;
updateRow (quoteRow.id, 1);
}
if (page == 'quotedit') {
document.querySelector('#itemFilter').value = '';
document.querySelector('#itemFilterSelect').value = 0;
}
modalClose('addInventoryAdvancedOptionModal'); setTimeout(function () { modalClose('addInventoryModal'); document.querySelector('#addInventoryModal').style.opacity = 1; }, 100);
advBomComplete = 1;
modifyItem = false;
editItem = false;
}
document.querySelector('#itemFilterSelect').selectedIndex = 0;
document.getElementById('qty').dataset.processData = '';
document.getElementById('qty').dataset.labourData = '';
document.getElementById('qty').dataset.markup = '';
document.querySelector('#addInventoryAdvancedOptionModal form').reset();
modItem = undefined;
modInvFormData = undefined;
advancedBOMBuilder.querySelectorAll('.inv_values').forEach(bi=>{bi.remove();});

}, modInvFormData, 'itemModify.php', 'updateQuoteItem');
}
});
}

if (itemModifyIntegrateWithBOMConfigurator != 1) if (document.getElementById('btnModifyInventory') != undefined) document.getElementById('btnModifyInventory').addEventListener ('mouseup', function (e) {
modifyItem = true;
modalOpen ('addInventoryAdvancedOptionModal');
});

function callModifyItem () {
modifyItem = true;
modalOpen ('addInventoryAdvancedOptionModal');
}

var editQuoteBOMCount = 0;
function editQuoteBOM2 () {
bomExcluded = [];
document.querySelector('#itemFilterSelect').value = quoteRow.querySelector('[name="inventoryid[]"]').value;
if (document.querySelector('#itemFilterSelect').selectedIndex > 0) {
editQuoteBOMCount = 500;
modalOpen('addInventoryAdvancedOptionModal');
setTimeout (function () {
advancedBOMBuilder.querySelector('#modInvdescription').value = quoteRow.querySelector('[name="itemdescription[]"]').value;
advancedBOMBuilder.querySelector('#modInvbuyPrice').value = quoteRow.querySelector('[name="itemcost[]"]').value;
modifyBomData.forEach((bomItem, i) => {
bomItem.id = bomItem.qibinventoryid;
bomItem.cost = bomItem.qibcost;
bomItem.costavg = bomItem.qibcost;
bomItem.bomcost = bomItem.qibcost;
bomItem.bomcostavg = bomItem.qibcost;
bomItem.bomqty = bomItem.qibqty;
bomItem.bomdescription = bomItem.qibdescription;
if (!exCats.includes(parseInt(bomItem.cat)))
addAdvBOMDataRow('dataTableAdvBom', 'bom', bomItem);
else {
modifyQuoteLabourBom = bomItem;
bomExcluded.push (bomItem);
}
});
document.querySelector('#advBomRoute').value = modifyRouteID;
document.querySelector('#advBomRoute').dispatchEvent (new Event('change'));
refreshProcessTimeAndNotes ();
showHideStep2Buttons ();
hideOverlay();
if (bomExcluded.length > 0) {
bomList = '<ul>';
for (brc = 0; brc < bomExcluded.length; brc++)
bomList += '<li>' + bomExcluded[brc].code + ' - ' + bomExcluded[brc].desc + '</li>';
bomList += '</ul>';
if (document.querySelector('.bomlabouralert') != undefined)
document.querySelector('.bomlabouralert').remove();
document.querySelector('#modInvdescription').parentNode.insertAdjacentHTML ('afterend', '<div class="alert alert-warning bomlabouralert my-4">The following Bill of Materials were excluded as these items are labour items, please input your labour item once the route has been selected:' + bomList + '<span class="text-danger">* These items can be included in the BOM by clicking \'Include Labour Items\' when in the "Bill of Materials" step.</span></div><br>');
}
}, 150);
}
if (editQuoteBOMCount < 500) {
editQuoteBOMCount++;
setTimeout ('editQuoteBOM2()', 25);
}
}

function restoreLabourItems () {
if (editItem)
modifyBomData.forEach((bomItem, i) => {
bomItem.id = bomItem.qibinventoryid;
bomItem.cost = bomItem.qibcost;
bomItem.costavg = bomItem.qibcost;
bomItem.bomcost = bomItem.qibcost;
bomItem.bomcostavg = bomItem.qibcost;
bomItem.bomqty = bomItem.qibqty;
bomItem.bomdescription = bomItem.qibdescription;
if (exCats.includes(parseInt(bomItem.cat)))
addAdvBOMDataRow('dataTableAdvBom', 'bom', bomItem);
});
else
bomItems.forEach(bomItem => {
if (exCats.includes(bomItem.cat)) {
addAdvBOMDataRow('dataTableAdvBom', 'bom', bomItem);
invlc = document.querySelector('.inv_values');
invlc.querySelector ('.AdvBomcostvalue').value = bomItem.cost;
invlc.querySelector ('[name="AdvBomcost[]"]').value = bomItem.cost;
invlc.querySelector ('[name="AdvBomqty[]"]').value = bomItem.bomqty;
invlc.querySelector ('[name="AdvBomitemdescription[]"]').value = bomItem.bomdescription;
advBomupdateRow (invlc);
}
});
document.querySelector('#actRestoreLabourItems').remove();
}

function editQuoteBOM (quoteitemid = 0, routeid = 0, bomdata = [], bomraw = '') {
editItem = 1;
modifyItem = 1;
modifyQuoteItemID = quoteitemid;
modifyRouteID = routeid;
modifyBomData = (typeof bomdata == 'string') ? JSON.parse(decodeURIComponent(bomdata).replaceAll('\n','').replaceAll('\r','')) : bomdata;
modifyBomRaw = bomraw;
quoteRow = undefined;
document.querySelectorAll('[name="quoteitemid[]"]').forEach((e, i) => {
if (e.value.toString() == quoteitemid.toString()) {
quoteRow = e.parentNode.parentNode;
quoteRowNum = i + 1;
}
});
document.querySelector('#itemFilter').value = quoteRow.querySelector('a').innerHTML;
filterSelect('inv', 'itemFilter');
editQuoteBOMCount = 0;
setTimeout ('editQuoteBOM2()', 100);
doNotice ('Loading your Quote Item Bill of Materials, please wait...');
showOverlay();
}

if (itemModifyIntegrateWithBOMConfigurator != 1) document.querySelector('#itemFilter').addEventListener ('blur', function (e) {
if (setDefaultValue (document.querySelector('#itemFilterSelect').value, 0) == 0)
document.querySelectorAll('#btnModifyInventory').forEach (e => {
e.classList.add('d-none');
});
});

function itemModifyHookInsideBOMConfigurator (json) {
//# The configurator is usable whenever the item has a Bill of Materials at all
//# (json.b) - lines with no alternates can still be unticked to exclude them
//# from this quote item. Only an item with no BOM leaves nothing to configure.
//# json.c counts lines that have alternates, and now only drives the wording.
var bomLines = (json.b == undefined ? 0 : json.b);
var hasAlternates = (json.c > 0);
itemModifyBOMConfiguratorDirect = (bomLines > 0) ? 0 : 1;
if (document.querySelector('.itemModifyBOMConfiguratorContents') != undefined)
document.querySelector('.itemModifyBOMConfiguratorContents').remove();
var invid = document.querySelector('#itemFilterSelect').value;
var invcode = document.querySelector('#itemFilter').value;
var bomConfigNote = '';
if (itemModifyBOMConfiguratorDirect)
bomConfigNote = `<span class="text text-danger"><br><br>* ${invcode} has no Bill of Materials to configure.</span>`;
else if (!hasAlternates)
bomConfigNote = `<span class="text text-muted"><br><br>* There are no alternate BOMs set up for ${invcode} &mdash; you can still untick items to exclude them from this quote item.</span>`;
var frow = document.querySelector('#configureBOMModal .modal-body > .row');
if (frow.classList.contains('bomConfiguratorContents')) return false;
frow.classList.add('bomConfiguratorContents');
frow.classList.add('d-none');
frow.insertAdjacentHTML ('beforebegin', `<div class="row itemModifyBOMConfiguratorContents h3">
<center>
<span style="font-size:70px;" class="material-symbols-rounded">help</span>
<br>
What would you like to do?
<br><br>
<div class="row">
<div class="col card m-3 border-secondary py-4 px-2">
<h4><b>ITEM MODIFIER</b></h4>
<p class="h6 mt-2 text-start lh-base" style="height:200px;">
This feature allows you to modify ${invcode}, it's Bill of Materials, the Manufacturing Route and Pricing to arrive at a customized ${invcode} for your customer specific only to the quote item being added.
<br>
<br>
The modified item does not update the details or Bill of Materials of ${invcode}.&nbsp;&nbsp;The modifications are only available for this quote and the line item added.
</p>
<center>
<button class="mb-0 btn btn-dark w-50 mt-2" onmouseup="showModifyItem();">Modify this Item</button>
</center>
</div>
<div class="col card m-3 border-secondary py-4 px-2">
<h4><b>BOM CONFIGURATOR / ALTERNATE BOMs</b></h4>
<p class="h6 mt-2 text-start lh-base" style="height:200px;">
The BOM Configurator allows you to select alternate Bill of Materials for specific items under ${invcode}, or untick items to exclude them, and apply this only to the quote item being added.
<br>
<br>
You may go to <a href="?page=inveditsub&id=${invid}" target="_blank" class="align-bottom">Inventory > Edit > Bill of Materials</a> to configure your Alternate BOMs
${bomConfigNote}
</p>
<center>
<button class="mb-0 btn ` + (itemModifyBOMConfiguratorDirect ? 'btn-secondary' : 'btn-dark') + ` w-50 mt-2" onmouseup="showBOMConfigurator();"` + (itemModifyBOMConfiguratorDirect ? ' disabled' : '') + `>Configure Bill of Materials</button>
</center>
</div>
</div>
</center>
</div>`);
document.querySelector('#configureBOMModal').addEventListener ('shown.bs.modal', function () {
document.querySelector('#configureBOMModal .modal-footer .btn-dark').classList.add('d-none');
document.querySelector('#configureBOMModal').opacity = 0;
// if (itemModifyBOMConfiguratorDirect)
// showModifyItem ();
// else
// document.querySelector('#configureBOMModal').opacity = 1;
});
document.querySelector('#configureBOMModal').addEventListener ('hidden.bs.modal', function () {
// if (itemModifyBOMConfiguratorDirect)
// document.querySelector('#configureBOMModal').opacity = 0;
document.querySelector('.itemModifyBOMConfiguratorContents').classList.remove('d-none');
document.querySelector('.bomConfiguratorContents').classList.add('d-none');
});
}

function showModifyItem () {
modalClose ('configureBOMModal');
callModifyItem ();
}

function showBOMConfigurator () {
document.querySelector('.itemModifyBOMConfiguratorContents').classList.add('d-none');
document.querySelector('.bomConfiguratorContents').classList.remove('d-none');
document.querySelector('#configureBOMModal .modal-footer .btn-dark').classList.remove('d-none');
}

function showProcessPreview () {
document.querySelector('#advBomRoutePreview').style.display = 'none';
document.querySelector('#advBomRoutePreviewName').parentNode.style.display = 'none';
if (document.querySelector('#advBomRoute').options[document.querySelector('#advBomRoute').selectedIndex].dataset.route == undefined)
return false;
importRes = JSON.parse(document.querySelector('#advBomRoute').options[document.querySelector('#advBomRoute').selectedIndex].dataset.route);
document.querySelector('#advBomRoutePreview').style.display = '';
document.querySelector('#advBomRoutePreviewName').parentNode.style.display = '';
originalRouteData = importRes;
routeJSONData = importRes;
routeData = importRes;
rdata.routedata = routeData;
html = '<ul>';
importRes.processes.forEach((route, ind) => {
name = '';
id = route;
document.querySelectorAll('.AdvBomRouteCreator #processList li').forEach((proc, ind) => {
if (id == proc.dataset.id)
name = proc.innerHTML;
});
depth = importRes.depth[ind];
if (depth == '' || depth == undefined) depth = 0;
margin = (depth * 40) + 'px';
unit = importRes.units[ind] != '' ? importRes.units[ind] : 'unit';
unittext = '';
if (manufacturingEnableProcessTypes)
unittext = `<span class="proctype">${unit}</span>`;
notes = importRes.notes[ind];
isexternal = importRes.external[ind];
leadtime = importRes.leadtime[ind];
setupcost = importRes.setupcost[ind];
setuptime = importRes.setuptime[ind];
takeup = importRes.takeup[ind];
processcost = importRes.pcost[ind];
cost = importRes.costs[ind];
html += `<li id="mfRoute${id}" data-cost="${cost}" data-external="${isexternal}" data-leadtime="${leadtime}" data-setupcost="${setupcost}" data-setuptime="${setuptime}" data-takeup="${takeup}" data-pcosts="${processcost}" data-id="${id}" data-depth="${depth}" data-unit="${unit}" data-notes="${notes}" class="formListDiv process" onmousedown="showCoords(event,this)" style="margin-left:${margin};min-width:150px;max-width:350px;margin-bottom:10px;width:fit-content !important;">${name} <span class="advbomspacer"></span>${unittext}<input type="hidden" name="process[]" value="${id}"><input type="hidden" name="proctype[]" value="${unit}"><input type="hidden" name="notes[]" value="${notes}"><input type="hidden" name="depth[]" value="${depth}"></li>`;
document.querySelector('#advBomRoutePreview').style.display = '';
document.querySelector('#advBomRoutePreviewName').innerHTML = document.querySelector('#advBomRoute').options[document.querySelector('#advBomRoute').selectedIndex].text;
});
html += '</ul>';
document.querySelector('#advBomRoutePreviewProcesses').innerHTML = html;
}

if (page == 'jobedit') {
var advBomEditorJobInventoryHook = false;
var oldmodifyQuoteLineItem;
var jobItemEditItemFilterSelect;
var bomEditorJobInvID = 0;
var bomEditorJobItemID = 0;
var jobItemEditIndex = 0;
oldjobItemEdit = jobItemEdit;
jobItemEdit = function (index) {
oldjobItemEdit (index);
for (var cnt = 0; cnt < jobInventory.length; cnt++)
if (jobInventory[cnt].id == index) {
jobItemGetBOM (cnt);
jobItemEditIndex = cnt;
break;
}
}
if (typeof advBomComplete != 'undefined') {
document.getElementById('addInventoryAdvancedOptionModal').addEventListener('show.bs.modal', function (e) {
if (!advBomEditorJobInventoryHook)
document.querySelector('#btnAdvOptNext').addEventListener ('mouseup', function (e) {
if (modifyItem) {
switch (parseInt(document.querySelector('#advOptCurStep').value)) {
case 4 :
setTimeout (function () {
document.querySelector('.pricingcard').classList.remove('d-none');
document.querySelector('.advBomPrevsellprice').classList.remove('d-none');
document.querySelector('.advBomPrevsellpriceLabel').classList.remove('d-none');
var pcNote = document.querySelector('.pricingcard .text-danger');
if (pcNote) pcNote.remove();
// modal isn't rebuilt on re-open: clear any stale control so we never leave a duplicate #modifybomupdatejiprice
document.querySelectorAll('.modifybomupdatejipriceRow').forEach(function (el) { el.remove(); });
document.querySelector('.advBomPrevsellprice').insertAdjacentHTML ('afterend', `
<div class="col-4 offset-2 modifybomupdatejipriceRow">
<small class="text text-danger">* Changing the markup will update the Item Price</small>
</div>
<div class="col-2 px-4 text-danger pb-2 modifybomupdatejipriceRow">
Update Job Inventory Price?
</div>
<div class="col-4 pb-2 modifybomupdatejipriceRow">
<select class="form-select text-danger" id="modifybomupdatejiprice">
<option>No</option>
<option>Yes</option>
</select>
</div>
`);
document.querySelectorAll('.pricingcard .card-body > div').forEach (e => {
e.classList.remove('p-4');
e.classList.add('px-4');
e.classList.add('pt-2');
});
}, 250);
break;
}
}
});
advBomEditorJobInventoryHook = true;
});
document.getElementById('addInventoryAdvancedOptionModal').addEventListener('hidden.bs.modal', function () {
bomEditorJobInvID = 0;
bomEditorJobItemID = 0;
jobItemEditIndex = 0;
});
oldmodifyQuoteLineItem = modifyQuoteLineItem;
modifyQuoteLineItem = function (json, quoteItemId = -1) {
if (typeof btnModify != 'undefined') btnModify.classList.add('d-none');
if (modifyQuoteItemID != 0 && quoteItemId == -1) quoteItemId = modifyQuoteItemID;
if (typeof modItem != 'undefined')
if (modItem.dataset.custombom == 1 || quoteItemId != -1 || bomEditorJobInvID != 0) {
if (typeof json == 'object')
quoteeditsavejson = '';
else
quoteeditsavejson = json;
var qsj = quoteeditsavejson.split(';');
modInvFormData = new FormData(document.querySelector('#addInventoryAdvancedOptionModal form'));
modInvFormData.append('selectedroute', selectedRoute);
modInvFormData.append('routedata', JSON.stringify(routeData));
modInvFormData.append('quoteitemid', quoteItemId);
modInvFormData.append('modifyid', modItem.value);
var icost = parseFloat(document.querySelector('.advBomPrevbuyprice').innerHTML.replace(currencyCode, ''));
var iqty = document.querySelector('#addInventoryAdvancedOptionModalTitle .text-danger').innerText.toUpperCase().split(' X ')[1];
var iprice = parseFloat(document.querySelector('.advBomPrevsellprice').innerHTML.replace(currencyCode, '')) * 1;
var qty = iqty;
var taxPercent = 0;
var adjPrice = iprice;
var taxAmount = numWithDec(adjPrice * taxPercent * iqty, 3);
var subTotal = Math.round((adjPrice * qty) * 100)/100;
var qicost = icost;
modInvFormData.append('ncost', icost);
modInvFormData.append('nprice', iprice);
modInvFormData.append('adjPrice', adjPrice);
modInvFormData.append('taxAmount', taxAmount);
modInvFormData.append('total', subTotal);
modInvFormData.append('processData', document.getElementById('qty').dataset.processData);
modInvFormData.append('labourData', document.getElementById('qty').dataset.labourData);
modInvFormData.append('markup', document.getElementById('qty').dataset.markup);
modInvFormData.append('jobid', document.getElementById('jobid').value);
modInvFormData.append('jobinvid', bomEditorJobInvID);
var updateJiPriceEl = document.querySelector('#modifybomupdatejiprice');
var updateJiPrice = updateJiPriceEl ? updateJiPriceEl.value : 'No';
modInvFormData.append('updatejiprice', updateJiPrice);
var bomraw = {};
bomraw.processData = document.getElementById('qty').dataset.processData;
bomraw.labourData = document.getElementById('qty').dataset.labourData;
bomraw.markup = document.getElementById('qty').dataset.markup;
document.querySelector('#itemEditCost').value = icost;
document.querySelector('#itemEditMargin').value = bomraw.markup;
if (updateJiPrice == 'Yes')
document.querySelector('#itemEditPrice').value = iprice;
else
doAlertModal ('You have opted not to update the Job Inventory Price, please review curent pricing versus modified BOM cost');
if (page == 'jobedit')
document.querySelector('#itemEditDesc').value = document.querySelector('#modInvdescription').value;
ajaxSubmit (function (json) {
modalClose('addInventoryAdvancedOptionModal'); setTimeout(function () { modalClose('addInventoryModal'); document.querySelector('#addInventoryModal').style.opacity = 1; }, 100);
advBomComplete = 1;
modifyItem = false;
jobItemGetBOM (jobItemEditIndex);
document.querySelector('#itemFilterSelect').selectedIndex = 0;
document.querySelector('#addInventoryAdvancedOptionModal form').reset();
modItem = undefined;
modInvFormData = undefined;
advancedBOMBuilder.querySelectorAll('.inv_values').forEach(bi=>{bi.remove();});
}, modInvFormData, 'itemModify.php', 'addJobInventoryItem');
}
}
}

function jobItemGetBOM (index) {
var item = jobInventory[index];
item.remaining = item.qty - item.complete;
var fd = new FormData();
fd.append ('id', item.id);
fd.append ('qiid', item.referenceId);
fd.append ('invid', item.inventoryId);
if (document.querySelector('#itemEditBOM') != undefined)
document.querySelector('#itemEditBOM').remove();
document.querySelector('#itemFilter').value = (document.querySelector('#itemEditHeading').innerText + ':').split(':')[1].trim();
filterSelect('inv', 'itemFilter');
var iid = item.inventoryId;
modifyItemProcesses = undefined;
modifyItemRoute = undefined;
bomItems = [];
document.querySelector('#pdbomtab').innerHTML = `
<div id="itemEditBOM" class="my-4">
<div class="row">
<div class="col-11 ">Item Bill of Materials</div>
<div class="col-12 text-secondary">Loading, please wait...</div>
</div>
</div>
`;
setTimeout (function () {
ajaxSubmit (function (json) {
document.querySelector('#itemFilterSelect').value = item.inventoryId;
if (document.querySelector('#itemFilterSelect').selectedIndex == -1) {
setTimeout (function () {
jobItemEditSaveInvInfo ();
}, 2000);
} else {
jobItemEditSaveInvInfo ();
document.querySelector('#itemEditBOM').innerHTML = `
<div id="itemEditBOM" class="my-4">
${json}
<input name="quoteitemid[]" type="hidden" value="${item.referenceId}">
<input name="inventoryid[]" type="hidden" value="${item.inventoryId}">
<input name="itemdescription[]" type="hidden" value="${item.description}">
<input name="itemcost[]" type="hidden" value="${item.cost}">
<input name="itemqty[]" type="hidden" value="${item.qty_orig}">
<a class="d-none">${item.code}</a>
<input type="hidden" id="qty" value="">
</div>
`;
document.querySelector('#itemEditBOM .table-responsive').style.maxHeight = 'calc(70vh)';
if (item.remaining <= 0 || typeof advBomComplete == 'undefined')
document.querySelector('.quotebomediticon').setAttribute('onclick', `doAlertModal('BOM Editor not available for completed items');`);
}
}, fd, 'itemModify.php', 'getJobInvBOM');
}, 500);
showdivspopupdiv('pdgeneraltab');
}

function jobItemEditSaveInvInfo () {
jobItemEditItemFilterSelect = document.querySelector('#itemFilterSelect').innerHTML;
}

function editJobInvBOM (jobinvid = 0, jobitemid = 0, quoteitemid = 0, routeid = 0, bomdata = [], bomraw = '') {
bomEditorJobInvID = jobinvid;
bomEditorJobItemID = jobitemid;
document.querySelector('#itemFilterSelect').innerHTML = jobItemEditItemFilterSelect;
editQuoteBOM (quoteitemid, routeid, bomdata, bomraw);
var ch = document.getElementById('dataTableAdvBom').getElementsByTagName('tbody')[0].children;
for (var c = ch.length - 1; c >= 0; c--)
ch[c].remove();
setTimeout (function () {
document.querySelector('#addInventoryAdvancedOptionModalTitle').innerHTML = `Inventory Item and Bill of Materials Editor : <span class="text text-danger">Editing Job ` + document.querySelector('#itemEditHeading').innerText + ' @ $ ' + document.querySelector('#itemEditCost').value + ' x ' + document.querySelector('#itemEditQty').value + `</span>`;
}, 500);
}
}
jQuery(".nav-tabs li a,.nav-tabs li button").click( function() {
jQuery(this).parents().find("li .active").removeClass("active");
jQuery(this).addClass("active");
let tabcontent = jQuery(this).parents().next('.tab-content');
tabcontent.find("div.tab-pane.active").removeClass("active");
tabcontent.find("div.tab-pane.show").removeClass("show");
let target = jQuery(this).attr("href");
if ( jQuery(this).is( ":button" ) ) {
target = jQuery(this).attr("data-bs-target");
}
tabcontent.find(target).addClass("active");
tabcontent.find(target).addClass("show");
});

var ncato = {"86":{"id":86,"name":"! Legacy Codes","abbreviation":"LEGACY","parent":0,"description":"Legacy Codes that are inactive but still feed BOMs - Do not use","markup":0,"stocked":0,"purAcc":0,"salesAcc":0,"assAcc":0,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":0,"minmarkup":20,"maxdiscount":50,"oncost":"20.000","oncosttype":"Percentage"},"45":{"id":45,"name":"!. Codes for Recycling","abbreviation":"Z","parent":0,"description":"Overwrite codes from this category when starting new inventory item","markup":0,"stocked":0,"purAcc":0,"salesAcc":0,"assAcc":0,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":0,"minmarkup":0,"maxdiscount":0,"oncost":"0.000","oncosttype":"Percentage"},"24":{"id":24,"name":"!Generic Fencing Prices","abbreviation":"GEN","parent":0,"description":"Generic Pricing for all Fence Types","markup":33,"stocked":0,"purAcc":0,"salesAcc":1,"assAcc":0,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":0,"minmarkup":0,"maxdiscount":0,"oncost":"0.000","oncosttype":""},"31":{"id":31,"name":"Bluedog Spear Top","abbreviation":"Spear To","parent":26,"description":"Tubular Fencing Spear Top","markup":25,"stocked":1,"purAcc":84,"salesAcc":155,"assAcc":17,"autoCode":"","expiredpricingtime":0,"taxBuy":4,"taxSell":4,"minmarkup":5,"maxdiscount":30,"oncost":"5.000","oncosttype":"Percentage"},"2":{"id":2,"name":"Chainlink Fittings ","abbreviation":"CLFIT","parent":0,"description":"XX Chainlink Fittings-all items require review-price, supplier etc. XX","markup":80,"stocked":1,"purAcc":84,"salesAcc":1,"assAcc":0,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":0,"minmarkup":0,"maxdiscount":0,"oncost":"0.000","oncosttype":"Percentage"},"14":{"id":14,"name":"Chainlink Gates","abbreviation":"CLG","parent":0,"description":"Chainlink Gates","markup":30,"stocked":1,"purAcc":84,"salesAcc":1,"assAcc":20,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":0,"minmarkup":0,"maxdiscount":0,"oncost":"0.000","oncosttype":"Percentage"},"25":{"id":25,"name":"Chainwire Fencing","abbreviation":"CW","parent":0,"description":"Chainwire Fencing materials and install separate rates","markup":25,"stocked":0,"purAcc":0,"salesAcc":1,"assAcc":0,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":0,"minmarkup":0,"maxdiscount":0,"oncost":"0.000","oncosttype":"Percentage"},"30":{"id":30,"name":"Colorbond Fencing","abbreviation":"CBOND","parent":0,"description":"Colorbond Fencing Install and material separate rate","markup":25,"stocked":0,"purAcc":0,"salesAcc":1,"assAcc":0,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":0,"minmarkup":0,"maxdiscount":0,"oncost":"0.000","oncosttype":""},"34":{"id":34,"name":"Concreting","abbreviation":"CONCR","parent":0,"description":"Concreting inventory items","markup":25,"stocked":1,"purAcc":84,"salesAcc":1,"assAcc":0,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":0,"minmarkup":0,"maxdiscount":0,"oncost":"0.000","oncosttype":"Percentage"},"3":{"id":3,"name":"Eltrak Gate Systems","abbreviation":"ELTRAK","parent":0,"description":"Vater Gate Fittings","markup":30,"stocked":1,"purAcc":84,"salesAcc":155,"assAcc":17,"autoCode":"","expiredpricingtime":0,"taxBuy":4,"taxSell":4,"minmarkup":5,"maxdiscount":30,"oncost":"5.000","oncosttype":"Percentage"},"33":{"id":33,"name":"Gate Automation","abbreviation":"AUTO","parent":0,"description":"Automation for Gates","markup":25,"stocked":0,"purAcc":84,"salesAcc":1,"assAcc":0,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":0,"minmarkup":0,"maxdiscount":0,"oncost":"0.000","oncosttype":""},"87":{"id":87,"name":"Gate Sub-assemblies","abbreviation":"GATESUB","parent":0,"description":"To capture all pre-manufactured gate sub-assemblies, eg, hinges, etc","markup":25,"stocked":1,"purAcc":0,"salesAcc":155,"assAcc":19,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":4,"minmarkup":5,"maxdiscount":30,"oncost":"0.000","oncosttype":"Percentage"},"1":{"id":1,"name":"Miscellaneous","abbreviation":"MISC","parent":0,"description":"Default Miscellaneous category for Evolution ERP","markup":20,"stocked":1,"purAcc":84,"salesAcc":1,"assAcc":20,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":0,"minmarkup":0,"maxdiscount":0,"oncost":"0.000","oncosttype":""},"68":{"id":68,"name":"Operations","abbreviation":"OPS","parent":0,"description":"Operations and Installation","markup":33,"stocked":0,"purAcc":0,"salesAcc":1,"assAcc":0,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":4,"minmarkup":5,"maxdiscount":45,"oncost":"0.000","oncosttype":"Percentage"},"73":{"id":73,"name":"Operations - Installation","abbreviation":"OPSLBR","parent":0,"description":"Installation Charge Out Rates","markup":33,"stocked":0,"purAcc":0,"salesAcc":1,"assAcc":0,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":0,"minmarkup":5,"maxdiscount":28,"oncost":"0.000","oncosttype":"Fixed"},"74":{"id":74,"name":"Ops - Materials","abbreviation":"OPSMAT","parent":68,"description":"Operations and Installation - Materials and Consumables","markup":33,"stocked":1,"purAcc":84,"salesAcc":1,"assAcc":17,"autoCode":"","expiredpricingtime":0,"taxBuy":4,"taxSell":4,"minmarkup":5,"maxdiscount":45,"oncost":"0.000","oncosttype":"Percentage"},"70":{"id":70,"name":"Ops - Plant","abbreviation":"OPSPLANT","parent":68,"description":"Operations and Installation - Plant and Equipment","markup":33,"stocked":0,"purAcc":0,"salesAcc":1,"assAcc":0,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":4,"minmarkup":5,"maxdiscount":45,"oncost":"0.000","oncosttype":"Percentage"},"72":{"id":72,"name":"Ops - Services","abbreviation":"OPSSERV","parent":68,"description":"Operations and Installation - External Services","markup":33,"stocked":0,"purAcc":84,"salesAcc":1,"assAcc":0,"autoCode":"","expiredpricingtime":0,"taxBuy":4,"taxSell":4,"minmarkup":5,"maxdiscount":45,"oncost":"0.000","oncosttype":"Percentage"},"71":{"id":71,"name":"Ops - Subcontracting","abbreviation":"OPSSUB","parent":68,"description":"Operations and Installation - Subcontracting","markup":33,"stocked":0,"purAcc":84,"salesAcc":1,"assAcc":0,"autoCode":"","expiredpricingtime":0,"taxBuy":4,"taxSell":4,"minmarkup":5,"maxdiscount":45,"oncost":"0.000","oncosttype":"Percentage"},"69":{"id":69,"name":"Ops - XX Labour","abbreviation":"OPSLBR","parent":68,"description":"Operations and Installation - Labour - Workings only do not charge","markup":33,"stocked":0,"purAcc":0,"salesAcc":1,"assAcc":0,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":4,"minmarkup":5,"maxdiscount":45,"oncost":"0.000","oncosttype":"Percentage"},"32":{"id":32,"name":"Palisade Fencing","abbreviation":"Palisade","parent":0,"description":"Palisade Fencing","markup":25,"stocked":0,"purAcc":0,"salesAcc":1,"assAcc":0,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":0,"minmarkup":0,"maxdiscount":0,"oncost":"0.000","oncosttype":""},"5":{"id":5,"name":"PIPE","abbreviation":"PI","parent":0,"description":"Round Hollow Pipe","markup":25,"stocked":1,"purAcc":84,"salesAcc":1,"assAcc":20,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":0,"minmarkup":0,"maxdiscount":0,"oncost":"0.000","oncosttype":""},"47":{"id":47,"name":"PLCx Chainlink","abbreviation":"PLCxCL","parent":0,"description":"PLCx Saleable Items - Chainlink Fencing Products","markup":50,"stocked":1,"purAcc":84,"salesAcc":155,"assAcc":20,"autoCode":"","expiredpricingtime":1,"taxBuy":4,"taxSell":4,"minmarkup":5,"maxdiscount":45,"oncost":"5.000","oncosttype":"Percentage"},"12":{"id":12,"name":"PLCx Chainlink Fabric","abbreviation":"CL","parent":47,"description":"Chainlink Rolls","markup":25,"stocked":1,"purAcc":84,"salesAcc":155,"assAcc":17,"autoCode":"","expiredpricingtime":3,"taxBuy":4,"taxSell":4,"minmarkup":5,"maxdiscount":30,"oncost":"15.000","oncosttype":"Percentage"},"85":{"id":85,"name":"PLCx Custom Items","abbreviation":"custom","parent":0,"description":"Contains codes which can be BOM modified to enter anything onto a quote","markup":50,"stocked":0,"purAcc":0,"salesAcc":155,"assAcc":0,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":4,"minmarkup":5,"maxdiscount":30,"oncost":"0.000","oncosttype":"Percentage"},"36":{"id":36,"name":"PLCx External Production ","abbreviation":"Fact\/Ext","parent":0,"description":"Factory Production Costs - External","markup":25,"stocked":0,"purAcc":0,"salesAcc":1,"assAcc":0,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":0,"minmarkup":0,"maxdiscount":0,"oncost":"0.000","oncosttype":"Percentage"},"49":{"id":49,"name":"PLCx Fabrication","abbreviation":"WS-","parent":0,"description":"Used to capture standard internal factory, workshop, labour, plant and processing charge rates","markup":0,"stocked":0,"purAcc":0,"salesAcc":155,"assAcc":0,"autoCode":"","expiredpricingtime":12,"taxBuy":0,"taxSell":4,"minmarkup":0.1000000000000000055511151231257827021181583404541015625,"maxdiscount":0.1000000000000000055511151231257827021181583404541015625,"oncost":"0.000","oncosttype":"Fixed"},"80":{"id":80,"name":"PLCx Fasteners","abbreviation":"plcxfast","parent":0,"description":"For all screws, bolts, nuts, fasteners, etc","markup":25,"stocked":1,"purAcc":84,"salesAcc":155,"assAcc":17,"autoCode":"","expiredpricingtime":12,"taxBuy":4,"taxSell":4,"minmarkup":5,"maxdiscount":30,"oncost":"5.000","oncosttype":"Percentage"},"66":{"id":66,"name":"PLCx Fittings","abbreviation":"FIT","parent":0,"description":"caps-fittings-hinges-rollers-gate components","markup":50,"stocked":1,"purAcc":84,"salesAcc":155,"assAcc":17,"autoCode":"","expiredpricingtime":12,"taxBuy":4,"taxSell":4,"minmarkup":5,"maxdiscount":30,"oncost":"5.000","oncosttype":"Percentage"},"84":{"id":84,"name":"PLCx Freight","abbreviation":"PLCXFREI","parent":0,"description":"For all materials related freight","markup":25,"stocked":0,"purAcc":84,"salesAcc":155,"assAcc":0,"autoCode":"","expiredpricingtime":0,"taxBuy":4,"taxSell":4,"minmarkup":5,"maxdiscount":30,"oncost":"0.000","oncosttype":"Percentage"},"51":{"id":51,"name":"PLCx Hollow Section","abbreviation":"HS","parent":53,"description":"PLCx Hollow Section","markup":50,"stocked":1,"purAcc":84,"salesAcc":155,"assAcc":19,"autoCode":"","expiredpricingtime":12,"taxBuy":4,"taxSell":4,"minmarkup":5,"maxdiscount":30,"oncost":"5.000","oncosttype":"Percentage"},"52":{"id":52,"name":"PLCx Hot Rolled","abbreviation":"Black","parent":53,"description":"PLCx- PFC, UB, ANGLE, FLAT, SOLID etc.","markup":50,"stocked":1,"purAcc":84,"salesAcc":155,"assAcc":19,"autoCode":"","expiredpricingtime":1,"taxBuy":4,"taxSell":4,"minmarkup":5,"maxdiscount":30,"oncost":"5.000","oncosttype":"Percentage"},"79":{"id":79,"name":"PLCx Palisade","abbreviation":"PLCXPAL","parent":0,"description":"PLCx Saleable Items - Palisade Fencing Products","markup":50,"stocked":1,"purAcc":0,"salesAcc":155,"assAcc":20,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":4,"minmarkup":5,"maxdiscount":45,"oncost":"0.000","oncosttype":"Percentage"},"50":{"id":50,"name":"PLCx Pipe","abbreviation":"PIPE","parent":53,"description":"NB PIPE","markup":50,"stocked":1,"purAcc":84,"salesAcc":155,"assAcc":19,"autoCode":"","expiredpricingtime":12,"taxBuy":4,"taxSell":4,"minmarkup":5,"maxdiscount":30,"oncost":"5.000","oncosttype":"Percentage"},"59":{"id":59,"name":"PLCx Post","abbreviation":"PLCxP","parent":47,"description":"Chainlink post","markup":0,"stocked":1,"purAcc":0,"salesAcc":155,"assAcc":0,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":4,"minmarkup":5,"maxdiscount":50,"oncost":"5.000","oncosttype":"Percentage"},"64":{"id":64,"name":"PLCx Products","abbreviation":"PLCxP","parent":0,"description":"PLCx manufactured\/supplied products","markup":80,"stocked":1,"purAcc":84,"salesAcc":155,"assAcc":17,"autoCode":"","expiredpricingtime":3,"taxBuy":4,"taxSell":4,"minmarkup":5,"maxdiscount":30,"oncost":"5.000","oncosttype":"Percentage"},"53":{"id":53,"name":"PLCx Raw Steel","abbreviation":"Raw Stee","parent":0,"description":"PLCx Raw Steel ","markup":50,"stocked":1,"purAcc":84,"salesAcc":155,"assAcc":19,"autoCode":"","expiredpricingtime":1,"taxBuy":4,"taxSell":4,"minmarkup":5,"maxdiscount":30,"oncost":"5.000","oncosttype":"Percentage"},"81":{"id":81,"name":"PLCx Timber","abbreviation":"plcxtimb","parent":0,"description":"For timber products","markup":25,"stocked":1,"purAcc":84,"salesAcc":155,"assAcc":17,"autoCode":"","expiredpricingtime":0,"taxBuy":4,"taxSell":4,"minmarkup":5,"maxdiscount":28,"oncost":"5.000","oncosttype":"Percentage"},"63":{"id":63,"name":"PLCx Weld Mesh","abbreviation":"WM","parent":58,"description":"Weld Mesh panels","markup":33,"stocked":1,"purAcc":84,"salesAcc":155,"assAcc":18,"autoCode":"","expiredpricingtime":0,"taxBuy":4,"taxSell":4,"minmarkup":5,"maxdiscount":45,"oncost":"5.000","oncosttype":"Percentage"},"58":{"id":58,"name":"PLCx Weldmesh","abbreviation":"WM-","parent":0,"description":"PLCx Weldmesh Products","markup":33,"stocked":1,"purAcc":84,"salesAcc":155,"assAcc":18,"autoCode":"","expiredpricingtime":0,"taxBuy":4,"taxSell":4,"minmarkup":5,"maxdiscount":45,"oncost":"5.000","oncosttype":"Percentage"},"82":{"id":82,"name":"PLCx Wire","abbreviation":"plcxwire","parent":0,"description":"For wire products other than chainlink, including raw wire","markup":25,"stocked":1,"purAcc":84,"salesAcc":155,"assAcc":17,"autoCode":"","expiredpricingtime":12,"taxBuy":4,"taxSell":4,"minmarkup":5,"maxdiscount":30,"oncost":"8.000","oncosttype":"Percentage"},"83":{"id":83,"name":"PLCx Wire - Bundled","abbreviation":"plcxwire","parent":82,"description":"Bundled Wire Rolls","markup":50,"stocked":0,"purAcc":0,"salesAcc":155,"assAcc":0,"autoCode":"","expiredpricingtime":3,"taxBuy":0,"taxSell":4,"minmarkup":5,"maxdiscount":30,"oncost":"5.000","oncosttype":"Fixed"},"67":{"id":67,"name":"PLCx Z Ed Working","abbreviation":"ED","parent":0,"description":"Ed custom products","markup":0,"stocked":1,"purAcc":0,"salesAcc":155,"assAcc":19,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":4,"minmarkup":5,"maxdiscount":30,"oncost":"0.000","oncosttype":"Percentage"},"56":{"id":56,"name":"PLCx Z Mitch Working","abbreviation":"PLCxM","parent":0,"description":"Working Folder for MW","markup":0,"stocked":0,"purAcc":0,"salesAcc":155,"assAcc":0,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":4,"minmarkup":5,"maxdiscount":45,"oncost":"0.000","oncosttype":"Fixed"},"57":{"id":57,"name":"PLCx Z Pat Working ","abbreviation":"PLCxP","parent":0,"description":"Working folder for PL","markup":0,"stocked":0,"purAcc":0,"salesAcc":155,"assAcc":0,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":4,"minmarkup":5,"maxdiscount":45,"oncost":"0.000","oncosttype":"Fixed"},"42":{"id":42,"name":"PLCx Z Pete Working","abbreviation":"ZS","parent":0,"description":"xx","markup":0,"stocked":0,"purAcc":0,"salesAcc":0,"assAcc":0,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":0,"minmarkup":0,"maxdiscount":0,"oncost":"0.000","oncosttype":"Percentage"},"21":{"id":21,"name":"Rural Fencing","abbreviation":"rural","parent":0,"description":"Rural Fencing Materials","markup":25,"stocked":1,"purAcc":84,"salesAcc":1,"assAcc":18,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":0,"minmarkup":0,"maxdiscount":0,"oncost":"0.000","oncosttype":""},"23":{"id":23,"name":"SA WATER RURAL","abbreviation":"SAWRURAL","parent":21,"description":"SA Water Rural to TS0121","markup":25,"stocked":0,"purAcc":0,"salesAcc":1,"assAcc":0,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":0,"minmarkup":0,"maxdiscount":0,"oncost":"0.000","oncosttype":""},"27":{"id":27,"name":"SA Water Spear Top","abbreviation":"SAWSPEAR","parent":26,"description":"SA Water Spear Top","markup":0,"stocked":0,"purAcc":84,"salesAcc":0,"assAcc":0,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":0,"minmarkup":0,"maxdiscount":0,"oncost":"0.000","oncosttype":""},"38":{"id":38,"name":"SAPN Fencing","abbreviation":"SAPN Gen","parent":0,"description":"SAPN Generic Rates for Fencing","markup":33,"stocked":0,"purAcc":0,"salesAcc":0,"assAcc":0,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":0,"minmarkup":0,"maxdiscount":0,"oncost":"0.000","oncosttype":""},"22":{"id":22,"name":"Signage","abbreviation":"SIGN","parent":0,"description":"Signage","markup":25,"stocked":1,"purAcc":84,"salesAcc":1,"assAcc":20,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":0,"minmarkup":0,"maxdiscount":0,"oncost":"0.000","oncosttype":""},"17":{"id":17,"name":"Steel","abbreviation":"ST","parent":0,"description":"Parent category for purchased steel products","markup":0,"stocked":1,"purAcc":84,"salesAcc":1,"assAcc":20,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":0,"minmarkup":0,"maxdiscount":0,"oncost":"0.000","oncosttype":""},"19":{"id":19,"name":"Steel - Commercial Pipe","abbreviation":"STCP","parent":17,"description":"Commercial Galvanized Pipe","markup":25,"stocked":1,"purAcc":84,"salesAcc":1,"assAcc":20,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":0,"minmarkup":0,"maxdiscount":0,"oncost":"0.000","oncosttype":""},"20":{"id":20,"name":"Steel - Commercial Pipe H","abbreviation":"STCPHDG","parent":17,"description":"Hot dipped glavanized Pipe","markup":30,"stocked":1,"purAcc":84,"salesAcc":1,"assAcc":20,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":0,"minmarkup":0,"maxdiscount":0,"oncost":"0.000","oncosttype":""},"8":{"id":8,"name":"Steel - Flat Bar","abbreviation":"SFL","parent":17,"description":"Flat Bar","markup":25,"stocked":1,"purAcc":84,"salesAcc":77,"assAcc":18,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":0,"minmarkup":0,"maxdiscount":0,"oncost":"0.000","oncosttype":""},"18":{"id":18,"name":"Steel - RHS","abbreviation":"ST-RHS","parent":17,"description":"Rectangular Hollow section and Square hollow section","markup":0,"stocked":1,"purAcc":84,"salesAcc":1,"assAcc":20,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":0,"minmarkup":0,"maxdiscount":0,"oncost":"0.000","oncosttype":""},"26":{"id":26,"name":"Tubular Fencing","abbreviation":"TUBULAR","parent":0,"description":"Tubular Fencing","markup":25,"stocked":0,"purAcc":0,"salesAcc":1,"assAcc":0,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":0,"minmarkup":0,"maxdiscount":0,"oncost":"0.000","oncosttype":""},"4":{"id":4,"name":"Tubular Gate Fittings","abbreviation":"GF-TUBUL","parent":0,"description":"Tubular Gate Fittings and Hardware that is Purchased","markup":100,"stocked":1,"purAcc":84,"salesAcc":155,"assAcc":17,"autoCode":"","expiredpricingtime":0,"taxBuy":4,"taxSell":4,"minmarkup":5,"maxdiscount":28,"oncost":"5.000","oncosttype":"Percentage"},"28":{"id":28,"name":"Tubular Gates","abbreviation":"TSG","parent":0,"description":"Tubular Sliding, Cantilever and Swing Gates","markup":33,"stocked":1,"purAcc":0,"salesAcc":155,"assAcc":17,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":4,"minmarkup":5,"maxdiscount":30,"oncost":"0.000","oncosttype":"Percentage"},"11":{"id":11,"name":"Unapproved","abbreviation":"TBP","parent":0,"description":"Unappoved imports","markup":1,"stocked":0,"purAcc":0,"salesAcc":1,"assAcc":0,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":0,"minmarkup":0,"maxdiscount":0,"oncost":"0.000","oncosttype":""},"35":{"id":35,"name":"Weldmesh Fencing","abbreviation":"Weldmesh","parent":0,"description":"Weldmesh Fencing Materials & Installation","markup":25,"stocked":0,"purAcc":0,"salesAcc":1,"assAcc":0,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":0,"minmarkup":0,"maxdiscount":0,"oncost":"0.000","oncosttype":""},"9":{"id":9,"name":"Weldmesh Raw Materials","abbreviation":"wldmsh","parent":0,"description":"Weldmesh Raw Materials","markup":25,"stocked":0,"purAcc":84,"salesAcc":77,"assAcc":0,"autoCode":"","expiredpricingtime":0,"taxBuy":0,"taxSell":0,"minmarkup":0,"maxdiscount":0,"oncost":"0.000","oncosttype":""}};
var ncat = [];
Object.entries(ncato).forEach(e => {
ncat[parseInt(e[0])] = e[1];
});
</script>

<style>
.float-right {
float: right;
}
/* Advanced item popup tabs (Details / Bill of Materials) */
.quoteItemMore .navbar-collapse .navbar-nav .nav-item .smpd {
border: solid 1px lightgray;
border-bottom: none;
padding: 8px 16px;
border-radius: 4px 4px 0 0;
}
.quoteItemMore .navbar-collapse .navbar-nav .nav-item.active .smpd {
font-weight: bold;
}
.quoteItemMore .menupd {
border: solid 1px lightgray;
margin-top: -1px;
padding: 1rem;
}
.moreinfobomtable {
text-align: right;
}
.moreinfobomtable th:first-child,
.moreinfobomtable td:first-child {
text-align: left;
}
#secall,
#secunassigned {
padding-top: 10px !important;
margin-right: -1px !important;
height: 43px !important;
}
.sectionCount {
width: auto !important;
margin-right: -1px !important;
height: 43px !important;
padding-left: 17px !important;
padding: 0px !important;
}
.sectionCount a {
text-decoration: none;
padding: 9px 0px 10px 15px;
display: inline-block;
}
.sectionCount .tab_edit {
padding: 9px 6px 10px 0px;
}
#quoteValueSummary .row {
margin-top: -1px;
}
#quoteValueSummary .col {
margin-right: -1px;
padding-top: 10px;
}
table.datatable td {
padding: 5px;
vertical-align: top;
}
#alerts > li {
margin-left: 15px;
margin-top: 10px;
}
</style>
<script>
var quoteModeContractManyToOne = 'Enabled' == 'Enabled';var quoteModeRevertToRRP = 'Use Any Site Contract';var quoteLocked = ''; </script>
<br>
</div>
</div>
</div>
</div>
<div class="row align-items-end bg-light w-100">
<div class='col text-end border-top'>
&copy; Copyright 2009 Shane Cosgrove | Distributed by Cosgrove Creative PTY LTD
<br> 72A Mustand Drive, Rutherford NSW 2320
</div>
</div>
</div>

<style>
.pac-container {
z-index: 10000 !important;
}
</style>
<div class="modal fade" id="videoHelpModal" tabindex="-1" role="dialog" aria-labelledby="videoHelpModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header">
<div ID="videoHelpModalTitle" class="h2">EVOLUTION QUICK HELP Video</div>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" ID="videoHelpModalBody">
<div class="d-flex justify-content-center">
<iframe width="980" height="551.25" ID="evoHelpVideo"
src="" title="YouTube video player" frameborder="0"
allowscriptaccess="always"
referrerpolicy="strict-origin-when-cross-origin" allowfullscreen>
</iframe>
</div>
<div class="container-fluid mb-3 p-2" ID="supportVideoPageListDiv" style="display:none">
<div class="h5 fw-bold text-uppercase mt-3">Support Videos for this Page</div>
<table class="table table-sm table-hover table-fixed">
<thead>
<tr>
<th>Video</th>
<th>Level</th>
<th>Duration</th>
<th>Watched</th>
</tr>
</thead>
<tbody ID="supportVideoPageListTable"></tbody>
</table>
</div><br><br>
<div ID="supportVideoModuleListDiv" class="container-fluid mt-3" style="display:none">
<div class="h5 text-uppercase mt-4">Other Videos in this Module</div>
<table class="table table-sm table-hover table-fixed">
<thead style="display:none">
<tr>
<th>Video</th>
<th>Level</th>
<th>Duration</th>
<th>Watched</th>
</tr>
</thead>
<tbody ID="supportVideoModuleListTable"></tbody>
</table>
</div>
<div class="alert alert-info text-center"><a href="index.php?page=supportVideos" class='h4 text-uppercase'><i class="material-symbols-rounded">video_library</i>Click Here to see full video library</a></div>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
<script> const supportVideoObj = new SupportVideo(); </script>
<script>
// INITIALIZE CLASS
supportVideoObj.page="quotedit";
var supportVideoIcon = document.createElement("div");
supportVideoIcon.className = "pagebutton";
supportVideoIcon.innerHTML = '<i onclick ="supportVideoObj.showPageLibrary(\'quotedit\');" class="material-symbols-rounded">live_tv</i>';
document.getElementsByClassName("pageheader")[0].appendChild(supportVideoIcon);
</script>
<script>

// CHECK SESSION STATUS ON WINDOW FOCUS IF ON LOGIN SCREEN
//if(query_string_page.indexOf('login.inc') >= 0){
window.onfocus = function () {
timoutWarning = 30000;
session_heartbeat();
}
window.onblur = function () {
//console.log("Timeout Every 10 seconds")
timoutWarning = 108000;
}
//}
//#########################################################
//# UNIVERSAL EVENT LISTENERS
//#########################################################
//##### ON BODY DRAG AND DROP ALL ITEMS WITH CLASS POPUPDIV

Sortable.init();
$(document).mousedown(function (e){
//alert(e.target);
var container = $(".popupDiv");
var tinymce = $(".mce-container-body");
var tinytox = $(".tox");
var modal = $(".modal");
if ( (!container.is(e.target) && container.has(e.target).length === 0) && (!tinymce.is(e.target) && tinymce.has(e.target).length === 0) && (!modal.is(e.target) && modal.has(e.target).length === 0) && (!tinytox.is(e.target) && tinytox.has(e.target).length === 0)){
hideAll();
}
});
document.onload=menuStateSave();
document.onload=initialize_select_filters ();
document.onload=ajax_form_bindings();
setTimeout("document.getElementsByTagName('body')[0].style.display = '';", 2000);
</script>

</body>
</html>



<div class="development container">

<h2>Memory Usage is 3590312</h2><pre>Array
(
[0] => /home/evolution/my.evolutionerp.com.au/index.php
[1] => /home/evolution/my.evolutionerp.com.au/functions.php
[2] => /home/evolution/my.evolutionerp.com.au/.env
[3] => /home/evolution/my.evolutionerp.com.au/plugins/xero2/xero-php/xeroUtils.php
[4] => /home/evolution/vendor/autoload.php
[5] => /home/evolution/vendor/composer/autoload_real.php
[6] => /home/evolution/vendor/composer/ClassLoader.php
[7] => /home/evolution/vendor/composer/autoload_static.php
[8] => /home/evolution/vendor/symfony/polyfill-php80/bootstrap.php
[9] => /home/evolution/vendor/symfony/polyfill-php81/bootstrap.php
[10] => /home/evolution/vendor/symfony/polyfill-php82/bootstrap.php
[11] => /home/evolution/vendor/open-telemetry/context/fiber/initialize_fiber_handler.php
[12] => /home/evolution/vendor/ralouphie/getallheaders/src/getallheaders.php
[13] => /home/evolution/vendor/ramsey/uuid/src/functions.php
[14] => /home/evolution/vendor/open-telemetry/api/Trace/functions.php
[15] => /home/evolution/vendor/symfony/polyfill-mbstring/bootstrap.php
[16] => /home/evolution/vendor/open-telemetry/sdk/Common/Util/functions.php
[17] => /home/evolution/vendor/open-telemetry/sdk/Logs/Exporter/_register.php
[18] => /home/evolution/vendor/open-telemetry/sdk/Registry.php
[19] => /home/evolution/vendor/open-telemetry/sdk/Logs/Exporter/ConsoleExporterFactory.php
[20] => /home/evolution/vendor/open-telemetry/sdk/Logs/LogRecordExporterFactoryInterface.php
[21] => /home/evolution/vendor/open-telemetry/sdk/Logs/Exporter/InMemoryExporterFactory.php
[22] => /home/evolution/vendor/open-telemetry/sdk/Metrics/MetricExporter/_register.php
[23] => /home/evolution/vendor/open-telemetry/sdk/Metrics/MetricExporter/InMemoryExporterFactory.php
[24] => /home/evolution/vendor/open-telemetry/sdk/Metrics/MetricExporterFactoryInterface.php
[25] => /home/evolution/vendor/open-telemetry/sdk/Metrics/MetricExporter/ConsoleMetricExporterFactory.php
[26] => /home/evolution/vendor/open-telemetry/sdk/Metrics/MetricExporter/NoopMetricExporterFactory.php
[27] => /home/evolution/vendor/open-telemetry/sdk/Propagation/_register.php
[28] => /home/evolution/vendor/open-telemetry/sdk/Common/Configuration/KnownValues.php
[29] => /home/evolution/vendor/open-telemetry/api/Baggage/Propagation/BaggagePropagator.php
[30] => /home/evolution/vendor/open-telemetry/context/Propagation/TextMapPropagatorInterface.php
[31] => /home/evolution/vendor/open-telemetry/api/Trace/Propagation/TraceContextPropagator.php
[32] => /home/evolution/vendor/open-telemetry/context/Propagation/NoopTextMapPropagator.php
[33] => /home/evolution/vendor/open-telemetry/sdk/Trace/SpanExporter/_register.php
[34] => /home/evolution/vendor/open-telemetry/sdk/Trace/SpanExporter/ConsoleSpanExporterFactory.php
[35] => /home/evolution/vendor/open-telemetry/sdk/Trace/SpanExporter/SpanExporterFactoryInterface.php
[36] => /home/evolution/vendor/open-telemetry/sdk/Trace/SpanExporter/InMemorySpanExporterFactory.php
[37] => /home/evolution/vendor/open-telemetry/sdk/Common/Export/Stream/StreamTransportFactory.php
[38] => /home/evolution/vendor/open-telemetry/sdk/Common/Export/TransportFactoryInterface.php
[39] => /home/evolution/vendor/open-telemetry/sdk/Common/Dev/Compatibility/_load.php
[40] => /home/evolution/vendor/open-telemetry/sdk/_autoload.php
[41] => /home/evolution/vendor/open-telemetry/sdk/SdkAutoloader.php
[42] => /home/evolution/vendor/open-telemetry/sdk/Common/Configuration/Configuration.php
[43] => /home/evolution/vendor/open-telemetry/api/Behavior/LogsMessagesTrait.php
[44] => /home/evolution/vendor/open-telemetry/sdk/Common/Configuration/Variables.php
[45] => /home/evolution/vendor/open-telemetry/sdk/Common/Configuration/Resolver/CompositeResolver.php
[46] => /home/evolution/vendor/open-telemetry/sdk/Common/Configuration/Resolver/EnvironmentResolver.php
[47] => /home/evolution/vendor/open-telemetry/sdk/Common/Configuration/Resolver/ResolverInterface.php
[48] => /home/evolution/vendor/open-telemetry/sdk/Common/Configuration/Resolver/PhpIniResolver.php
[49] => /home/evolution/vendor/open-telemetry/sdk/Common/Configuration/Resolver/PhpIniAccessor.php
[50] => /home/evolution/vendor/open-telemetry/sdk/Common/Configuration/VariableTypes.php
[51] => /home/evolution/vendor/open-telemetry/sdk/Common/Util/ClassConstantAccessor.php
[52] => /home/evolution/vendor/open-telemetry/sdk/Common/Configuration/ValueTypes.php
[53] => /home/evolution/vendor/open-telemetry/sdk/Common/Configuration/Defaults.php
[54] => /home/evolution/vendor/open-telemetry/sdk/Common/Configuration/Parser/BooleanParser.php
[55] => /home/evolution/vendor/symfony/deprecation-contracts/function.php
[56] => /home/evolution/vendor/guzzlehttp/guzzle/src/functions_include.php
[57] => /home/evolution/vendor/guzzlehttp/guzzle/src/functions.php
[58] => /home/evolution/my.evolutionerp.com.au/plugins/xero2/xero-php/storage.php
[59] => /home/evolution/vendor/xeroapi/xero-php-oauth2/lib/Configuration.php
[60] => /home/evolution/vendor/xeroapi/xero-php-oauth2/lib/Api/AccountingApi.php
[61] => /home/evolution/vendor/guzzlehttp/guzzle/src/Client.php
[62] => /home/evolution/vendor/guzzlehttp/guzzle/src/ClientInterface.php
[63] => /home/evolution/vendor/psr/http-client/src/ClientInterface.php
[64] => /home/evolution/vendor/guzzlehttp/guzzle/src/ClientTrait.php
[65] => /home/evolution/vendor/guzzlehttp/guzzle/src/HandlerStack.php
[66] => /home/evolution/vendor/guzzlehttp/guzzle/src/Utils.php
[67] => /home/evolution/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php
[68] => /home/evolution/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php
[69] => /home/evolution/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php
[70] => /home/evolution/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php
[71] => /home/evolution/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php
[72] => /home/evolution/vendor/guzzlehttp/guzzle/src/Middleware.php
[73] => /home/evolution/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php
[74] => /home/evolution/vendor/xeroapi/xero-php-oauth2/lib/HeaderSelector.php
[75] => /home/evolution/my.evolutionerp.com.au/library/job.php
[76] => /home/evolution/my.evolutionerp.com.au/library/db.php
[77] => /home/evolution/my.evolutionerp.com.au/plugins/PluginEvents.php
[78] => /home/evolution/my.evolutionerp.com.au/plugins/controller.php
[79] => /home/evolution/my.evolutionerp.com.au/plugins/db-install.php
[80] => /home/evolution/my.evolutionerp.com.au/plugins/sql-file-scanner.php
[81] => /home/evolution/my.evolutionerp.com.au/plugins/csvexporter/plugin.php
[82] => /home/evolution/my.evolutionerp.com.au/plugins/costupdater/plugin.php
[83] => /home/evolution/my.evolutionerp.com.au/yesNoModal.inc
[84] => /home/evolution/my.evolutionerp.com.au/app/templates/menu.php
[85] => /home/evolution/my.evolutionerp.com.au/quotedit.inc
[86] => /home/evolution/my.evolutionerp.com.au/library/quote.php
[87] => /home/evolution/my.evolutionerp.com.au/library/contracts.php
[88] => /home/evolution/my.evolutionerp.com.au/library/inventory.php
[89] => /home/evolution/my.evolutionerp.com.au/plugins/pipe/pipetopost_2.php
[90] => /home/evolution/my.evolutionerp.com.au/uomprocess.inc
[91] => /home/evolution/my.evolutionerp.com.au/invaddadvanced.inc
[92] => /home/evolution/my.evolutionerp.com.au/assets/css/modules/invaddadvanced.css
[93] => /home/evolution/my.evolutionerp.com.au/itemModify.inc
[94] => /home/evolution/my.evolutionerp.com.au/assets/css/modules/itemModify.css
[95] => /home/evolution/my.evolutionerp.com.au/kits.inc
[96] => /home/evolution/my.evolutionerp.com.au/history.inc
[97] => /home/evolution/my.evolutionerp.com.au/notesdiv.inc
[98] => /home/evolution/my.evolutionerp.com.au/noteadd.inc
[99] => /home/evolution/my.evolutionerp.com.au/calendarFollowup.inc
[100] => /home/evolution/my.evolutionerp.com.au/attachmentdiv.inc
[101] => /home/evolution/my.evolutionerp.com.au/uploaddiv2.php
[102] => /home/evolution/my.evolutionerp.com.au/invadd.inc
[103] => /home/evolution/my.evolutionerp.com.au/printdiv.php
[104] => /home/evolution/my.evolutionerp.com.au/emaildiv.php
[105] => /home/evolution/my.evolutionerp.com.au/quotedit_copymodal.inc
[106] => /home/evolution/my.evolutionerp.com.au/taskedit.inc
[107] => /home/evolution/my.evolutionerp.com.au/taskadd.inc
[108] => /home/evolution/my.evolutionerp.com.au/assets/js/modules/invaddadvanced.js
[109] => /home/evolution/my.evolutionerp.com.au/assets/js/modules/itemModify.js
)
</pre><pre>Array
(
[staffname] => Maria Colorado
[firstname] => Maria
[lastname] => Colorado
[userid] => 631
[userdb] => 304-1726626400
[xero_auth_version] => 2
[LAST_ACTIVITY] => 1786590987
[ip] => 150.228.163.151
[id] => 18
[staffid] => 41
[mod_sales] => 2
[mod_pur] => 2
[mod_ap] => 2
[mod_ar] => 2
[mod_gl] => 2
[mod_jc] => 2
[mod_inv] => 2
[mod_pr] => 0
[mod_rep] => 2
[mod_cf] => 2
[mod_timesheet] => 2
[administrator] => 0
[branch] => %%
[status] => 1
[companyname] => PLC Fencing
[companyid] => 87
[sandbox] => 0
[companyplugins] => Array
(
[0] => Array
(
[id] => 4
[nav] => 0
[name] => ABN
[folder] => abn
[pages] => all
[php_path] =>
[js_path] =>
[is_active] => 1
[authenticated] => 0
[scanned_sql_files] => 1
)

[1] => Array
(
[id] => 5
[nav] => 0
[name] => Barcode
[folder] =>
[pages] => all
[php_path] =>
[js_path] =>
[is_active] => 1
[authenticated] => 0
[scanned_sql_files] => 1
)

[2] => Array
(
[id] => 8
[nav] => 0
[name] => Pipe
[folder] => pipe
[pages] => all
[php_path] =>
[js_path] =>
[is_active] => 1
[authenticated] => 0
[scanned_sql_files] => 1
)

[3] => Array
(
[id] => 10
[nav] => 0
[name] => QR Code
[folder] =>
[pages] => all
[php_path] =>
[js_path] =>
[is_active] => 1
[authenticated] => 0
[scanned_sql_files] => 1
)

[4] => Array
(
[id] => 11
[nav] => 0
[name] => Test and Tag
[folder] => testandtag
[pages] => all
[php_path] =>
[js_path] =>
[is_active] => 1
[authenticated] => 0
[scanned_sql_files] => 1
)

[5] => Array
(
[id] => 13
[nav] => 0
[name] => Xero
[folder] => xero2
[pages] => all
[php_path] =>
[js_path] =>
[is_active] => 1
[authenticated] => 0
[scanned_sql_files] => 1
)

[6] => Array
(
[id] => 18
[nav] => 0
[name] => csvexporter
[folder] => csvexporter
[pages] =>
[php_path] => csvexporter/plugin.php
[js_path] => csvexporter/plugin.js
[is_active] => 1
[authenticated] => 1
[scanned_sql_files] => 1
)

[7] => Array
(
[id] => 21
[nav] => 0
[name] => costupdater
[folder] => costupdater
[pages] => all
[php_path] => costupdater/plugin.php
[js_path] => costupdater/plugin.js
[is_active] => 1
[authenticated] => 1
[scanned_sql_files] => 1
)

)

[plugin_update_count] => 0
[oauth2] => Array
(
[token] => eyJhbGciOiJSUzI1NiIsImtpZCI6IjFDQUY4RTY2NzcyRDZEQzAyOEQ2NzI2RkQwMjYxNTgxNTcwRUZDMTkiLCJ4NXQiOiJISy1PWm5jdGJjQW8xbkp2MENZVmdWY09fQmsiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL2lkZW50aXR5Lnhlcm8uY29tIiwibmJmIjoxNzg2NTkwMzc1LCJpYXQiOjE3ODY1OTAzNzUsImV4cCI6MTc4NjU5MjE3NSwiYXVkIjoiaHR0cHM6Ly9pZGVudGl0eS54ZXJvLmNvbS9yZXNvdXJjZXMiLCJzY29wZSI6WyJlbWFpbCIsInByb2ZpbGUiLCJvcGVuaWQiLCJwcm9qZWN0cyIsImFjY291bnRpbmcuYXR0YWNobWVudHMiLCJhY2NvdW50aW5nLmpvdXJuYWxzLnJlYWQiLCJhc3NldHMiLCJhY2NvdW50aW5nLnRyYW5zYWN0aW9ucyIsImFjY291bnRpbmcuY29udGFjdHMiLCJhY2NvdW50aW5nLnNldHRpbmdzIiwiYWNjb3VudGluZy5yZXBvcnRzLnJlYWQiLCJvZmZsaW5lX2FjY2VzcyJdLCJhbXIiOlsicHdkIiwibWZhIiwib3RwIl0sImNsaWVudF9pZCI6IkZEQkE3MzEyOTIzRTQwQ0M4RkUzMTk0QjQxODY2RDcyIiwic3ViIjoiN2EyYTdlNGYzZWQ3NWE0NDk1NTQ3NjkyZTJlOGIwNTYiLCJhdXRoX3RpbWUiOjE3NzQzMDMxNDgsInhlcm9fdXNlcmlkIjoiYzI1YTFkNDYtZWUyOC00MmRiLWE1YzgtZjNkN2NkYTk3NmRkIiwiZ2xvYmFsX3Nlc3Npb25faWQiOiI0YjE1ZTBhODQ1NDQ0ZmZmYTVkOGJiOGYwMzU3YmM5NiIsInNpZCI6IjRiMTVlMGE4NDU0NDRmZmZhNWQ4YmI4ZjAzNTdiYzk2IiwiYXV0aGVudGljYXRpb25fZXZlbnRfaWQiOiIzZjNmMDVhMy00YWFkLTQ0NDItYWEzOC02ZTJjMzg5ZTFiMjEiLCJqdGkiOiI0M0MzMDY3NkNGODFENkI4RTI2MTQyNTk0RUMzNzc0MCJ9.cmiI8UWvPM1xIkyGsTVUesBdKDH7i2OxaEukm0nMdGO6wtIGg59WjrLFSh0Ro2ehMk5nrefPVyglaqqqSDQ2g-QLxfXqd2mR7JdgaMi2PMFq7UwC50k_5Cztw1rTo-kyqt5rU1d7CXCugkx_0r2OgFM4gOgkq9AtQVB534yESCKjc_nGZf1WA7G3moy2KFgq-rJjagCM9AvnCresvlzG65BEJiR5Xw-SwCuoZULtp-BjFG3eR9bSO3JeIWjd0556fr76q1aK0dQw-xScpbF-boYcWmF_VEa6ZvmETluVsCdFKUy8LiZ8RiIt9oEVSRStHEdU9NFI0di6ai4tLNdDkQ
[tenant_id] => 00b91af5-006b-451e-ae65-843be2c3d240
[refresh_token] => sqTgzmZ7qCnI43ds35JWlDQAvcauRvZ46FNDzzsB_Fo
[expires] => 1786592175
[id_token] => eyJhbGciOiJSUzI1NiIsImtpZCI6IjFDQUY4RTY2NzcyRDZEQzAyOEQ2NzI2RkQwMjYxNTgxNTcwRUZDMTkiLCJ4NXQiOiJISy1PWm5jdGJjQW8xbkp2MENZVmdWY09fQmsiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL2lkZW50aXR5Lnhlcm8uY29tIiwibmJmIjoxNzg2NTkwMzc1LCJpYXQiOjE3ODY1OTAzNzUsImV4cCI6MTc4NjU5MDY3NSwiYXVkIjoiRkRCQTczMTI5MjNFNDBDQzhGRTMxOTRCNDE4NjZENzIiLCJhbXIiOlsicHdkIiwibWZhIiwib3RwIl0sImF0X2hhc2giOiJDTTdOMUxPMUsyNWYtVFZYQk8ydmt3Iiwic3ViIjoiN2EyYTdlNGYzZWQ3NWE0NDk1NTQ3NjkyZTJlOGIwNTYiLCJhdXRoX3RpbWUiOjE3NzQzMDMxNDgsInhlcm9fdXNlcmlkIjoiYzI1YTFkNDYtZWUyOC00MmRiLWE1YzgtZjNkN2NkYTk3NmRkIiwiZ2xvYmFsX3Nlc3Npb25faWQiOiI0YjE1ZTBhODQ1NDQ0ZmZmYTVkOGJiOGYwMzU3YmM5NiIsInNpZCI6IjRiMTVlMGE4NDU0NDRmZmZhNWQ4YmI4ZjAzNTdiYzk2IiwiYXV0aGVudGljYXRpb25fZXZlbnRfaWQiOiIzZjNmMDVhMy00YWFkLTQ0NDItYWEzOC02ZTJjMzg5ZTFiMjEiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJtaXRjaEBwbGNmZW5jaW5nLmNvbS5hdSIsImVtYWlsIjoibWl0Y2hAcGxjZmVuY2luZy5jb20uYXUiLCJnaXZlbl9uYW1lIjoiTWl0Y2giLCJmYW1pbHlfbmFtZSI6Ild5YXR0IiwibmFtZSI6Ik1pdGNoIFd5YXR0In0.gs_sQBhWcgi-5l4iFgCdhe7GTBmydOF5nxXPySqtTgv2F3xzKyUkcBEa7NCCGGADvnhmJIyQfUk-H4W0XTN3puVksn97hmLSIgGm4-ew7tCvvRz5QBljyDBYNFl5u9a_DXns5fwtgq-Tcu4QY0LXAUXciqSEAMZ4Vk6GWiy4ZsTO-9jTN4HcgRL5wMLFeoJOGwSTWQoIShUBoXG9cEEe_aDoQ7HB5lMzkXKsHtJpnQzttmIawce3-6fnwzdd7uVOYIMPP-mB4sc1TpReYrY4h8vftdeS9XYysaeAR27p3U-T2ws2rUE0jM01zrw0XKvgGB1Y4MkwL0TFG4uA6lkuhA
)

[csrf_token] => 8a79a11eaa66cb241cb1f0e6488465a2227728ef8cb95559c62b0fa572416677
[support] => 0
[INVENTORY] => a:15:{s:4:"call";s:15:"fetch_inventory";s:4:"code";s:0:"";s:4:"desc";s:0:"";s:3:"cat";s:2:"%%";s:3:"sku";s:0:"";s:6:"status";s:1:"1";s:6:"branch";s:2:"%%";s:4:"page";s:1:"1";s:7:"specsel";s:0:"";s:20:"invspeccriteriacount";s:1:"0";s:22:"invspeccriteriaenabled";s:5:"false";s:6:"sortby";s:4:"code";s:7:"sortdir";s:3:"asc";s:7:"sortcol";s:1:"1";s:5:"stamp";i:1786589689;}
[JOBTIMESHEETS] => a:23:{s:4:"call";s:9:"getTimers";s:5:"hooks";a:2:{i:0;s:471:"{"callback":"timeSheetEntriesJSONtoHTML2a","script":"app/ajax.php","data":{"tsGetTimeEntries":1,"return":"json","call":"getTimers","tsact":1,"tsopportunity":"115","tsjobid":"0","tsSearchKeyword":"","tsSearchStatus":"Active and Deleted","tsSearchType":"Basic","tsSearchInvoiced":"All invoicing types","tsSearchResource":"All Resources","tsSearchDateStart":"","tsSearchDateEnd":"","tsSearchPageNo":"1","tsSearchPageLimit":"10"},"name":"refreshtimesheetsummary","useonce":0}";i:1;s:152:"{"callback":"timesheetTimer.getTimersResponse","script":"app/ajax.php","data":{"timerAct":1,"call":"getTimers","id":0},"name":"checktimers","useonce":0}";}s:6:"isajax";s:1:"1";s:8:"ajaxSync";s:1:"1";s:6:"nofunc";i:1;s:5:"nodie";i:1;s:4:"noob";i:1;s:16:"tsGetTimeEntries";i:1;s:6:"return";s:4:"json";s:5:"tsact";i:1;s:13:"tsopportunity";s:3:"115";s:7:"tsjobid";s:1:"0";s:15:"tsSearchKeyword";s:0:"";s:14:"tsSearchStatus";s:18:"Active and Deleted";s:12:"tsSearchType";s:5:"Basic";s:16:"tsSearchInvoiced";s:19:"All invoicing types";s:16:"tsSearchResource";s:13:"All Resources";s:17:"tsSearchDateStart";s:0:"";s:15:"tsSearchDateEnd";s:0:"";s:14:"tsSearchPageNo";s:1:"1";s:17:"tsSearchPageLimit";s:2:"10";s:8:"fromajax";s:1:"1";s:5:"stamp";i:1786588195;}
[cp_cache_clientid] => 3293
[cp_cache_contracts] =>
[cp_cache_expires] => 1786591143
[ALL CLIENTS] => a:18:{s:4:"call";s:10:"getClients";s:10:"searchtype";s:11:"ALL CLIENTS";s:7:"partial";s:3:"Yes";s:7:"keyword";s:7:"Team Ci";s:6:"suburb";s:0:"";s:4:"type";s:2:"%%";s:5:"staff";s:2:"%%";s:6:"sortby";s:7:"company";s:4:"page";s:1:"1";s:7:"company";s:0:"";s:5:"state";s:0:"";s:8:"postcode";s:0:"";s:6:"status";s:1:"1";s:10:"stopcredit";s:2:"%%";s:11:"contactType";s:3:"Any";s:7:"sortdir";s:3:"asc";s:7:"sortcol";s:1:"2";s:5:"stamp";i:1786589032;}
[QUOTES] => a:16:{s:4:"call";s:12:"getTheQuotes";s:7:"contact";s:0:"";s:7:"keyword";s:0:"";s:4:"type";s:2:"%%";s:5:"staff";s:2:"%%";s:10:"department";s:2:"%%";s:4:"page";s:1:"1";s:4:"from";s:0:"";s:2:"to";s:0:"";s:11:"amount_from";s:0:"";s:9:"amount_to";s:0:"";s:7:"deleted";s:2:"No";s:6:"sortby";s:4:"q.id";s:7:"sortdir";s:4:"desc";s:7:"sortcol";s:1:"1";s:5:"stamp";i:1786590780;}
[supportVideoFlags] => a:17:{i:0;O:8:"stdClass":1:{s:4:"page";s:13:"opportunities";}i:1;O:8:"stdClass":1:{s:4:"page";s:15:"opportunityedit";}i:2;O:8:"stdClass":1:{s:4:"page";s:8:"quotereg";}i:3;O:8:"stdClass":1:{s:4:"page";s:8:"quotedit";}i:4;O:8:"stdClass":1:{s:4:"page";s:11:"jobregister";}i:5;O:8:"stdClass":1:{s:4:"page";s:9:"dashboard";}i:6;O:8:"stdClass":1:{s:4:"page";s:8:"invspecs";}i:7;O:8:"stdClass":1:{s:4:"page";s:9:"inventory";}i:8;O:8:"stdClass":1:{s:4:"page";s:10:"clientlist";}i:9;O:8:"stdClass":1:{s:4:"page";s:9:"contracts";}i:10;O:8:"stdClass":1:{s:4:"page";s:10:"scheduling";}i:11;O:8:"stdClass":1:{s:4:"page";s:16:"timesheetHistory";}i:12;O:8:"stdClass":1:{s:4:"page";s:10:"activities";}i:13;O:8:"stdClass":1:{s:4:"page";s:11:"purchasereg";}i:14;O:8:"stdClass":1:{s:4:"page";s:33:"opportunityedit,quotedit,quotedit";}i:15;O:8:"stdClass":1:{s:4:"page";s:7:"jobedit";}i:16;O:8:"stdClass":1:{s:4:"page";s:32:"activities,clientlist,clientlist";}}
)
</pre><pre>Array
(
[expires] => 5400
[PHPSESSID] => 0f2b3cd757b5ddfbfd3010f6809be90c
[auth] => Array
(
[username] => maria@plcfencing.com.au
[id] => 631
[expiry] => 1786596376
)

[last-active] => #flush-ar
[bckgrd] => 15
)
</pre>PHPSESSID
</div>

<style>
.pac-container {
z-index: 10000 !important;
}
</style>
<div class="modal fade" id="detailedLogModal" tabindex="-1" role="dialog" aria-labelledby="detailedLogModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<div ID="detailedLogModalTitle" class="h2">Detailed Log</div>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body text-left" ID="detailedLogModalBody">
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>