Files
crm.e5.pl/modules/EcmProducts/tpls/stockAddress.tpl
2024-04-27 09:23:34 +02:00

242 lines
11 KiB
Smarty

<div class="loader" id="loader">
<img src="themes/default/images/loading.gif" />
</div>
<script>
var CODES = {$CODES};
</script>
<script type="text/javascript" src="modules/EcmProducts/javascript/stockAddress.js"></script>
<h2>Produkty: Adresy magazynowe</h2>
<div id="stockAddress_search" class="edit view search" style="width: 98%;">
<table width="100%" cellspacing="0" cellpadding="0">
<form type="GET" id="searchByAddressForm">
<tr>
<td scope="row" nowrap="nowrap" width='1%'>
Adres magazynowy
</td>
<td nowrap="nowrap" width='1%'>
<input type="text" name="address" id="address" size="30" value="{$CURRENT_ADDRESS}">
</td>
<td>
<input type="hidden" name="module" value="EcmProducts" />
<input type="hidden" name="action" value="stockAddress" />
<input type="hidden" name="searchType" value="address" />
<input type="button" id="searchByAddressTrigger" value="Szukaj adresu&nbsp;" class="button" />
<span style="color: red;" id="addressError"></span>
</td>
</tr>
</form>
<form type="GET" id="searchByIndexForm">
<tr>
<td scope="row" nowrap="nowrap" width="1%">
Indeks Produktu
</td>
<td nowrap="nowrap" width="1%">
<input type='text' name="index" id="index" size="30" value="{$CURRENT_INDEX}">
</td>
<td>
<input type="hidden" name="module" value="EcmProducts" />
<input type="hidden" name="action" value="stockAddress" />
<input type="hidden" name="searchType" value="index" />
<input type="hidden" name="productId" id="productId" value="" />
<input type="button" id="searchByIndexTrigger" value="Szukaj indeksu" class="button" />
<span style="color: red;" id="indexError"></span>
</td>
</tr>
</form>
<form type="GET" id="allAddressesForm">
<tr>
<td scope="row" nowrap="nowrap" width="1%">
Całe palety
<input type="checkbox" name="onlyFull" {if $ONLY_FULL}checked{/if} />
</td>
<td nowrap="nowrap" width="1%">
<select name="allType" value="{$ALL_TYPE}">
<option value="all" {if $ALL_TYPE=='all'}selected{/if}>Wszystkie adresy</option>
<option value="used" {if $ALL_TYPE=='used'}selected{/if}>Adresy zajęte</option>
<option value="empty" {if $ALL_TYPE=='empty'}selected{/if}>Adresy wolne</option>
</select>
</td>
<td>
<input type="hidden" name="module" value="EcmProducts" />
<input type="hidden" name="action" value="stockAddress" />
<input type="hidden" name="searchType" value="allAddresses" />
<input type="submit" id="searchByIndexTrigger" value="Pokaż adresy" class="button" />
</td>
</tr>
</form>
</table>
</div>
{if $PROCESS && $PROCESS=='ADDRESS'}
{if $PRODUCT}
{if $PRODUCT.is_not_full}<b>Paleta niepełna.</b>{/if}
<table cellpadding="0" cellspacing="0" class="list view">
<tr class="oddListRowS1">
<th style="width: 20%;"><b>Indeks</b></th>
<th><b>Nazwa</b></th>
<th><b>Stan</b></th>
<th><b>Akcje</b></th>
</tr>
<tr class="oddListRowS1">
<td valign="top" class="oddListRowS1"
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
{$PRODUCT.code}
</td>
<td valign="top" class="oddListRowS1"
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
{$PRODUCT.name}
</td>
<td valign="top" class="oddListRowS1"
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
{$PRODUCT.stock_state}
</td>
<td valign="top" class="oddListRowS1"
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
<input type="button" value="Karta produktu" class="button"
onclick="openProductCard('{$PRODUCT.ecmproduct_id}');" />&nbsp;&nbsp;
<input type="button" value="Wyszukaj wszystkie adresy" class="button"
onclick="searchByIndex('{$PRODUCT.code}')" />&nbsp;&nbsp;
<input type="button" value="Usuń produkt z adresu" class="button" onclick="removeProductFromAddress()" />
</td>
</tr>
</table>
{else}
<table cellpadding="0" cellspacing="0" class="list view">
<tr class="oddListRowS1">
<th style="width: 20%;"><b>Indeks</b></td>
<th><b>Nazwa</b></td>
<th><b>Akcje</b></td>
</tr>
<tr class="oddListRowS1">
<td valign="top" class="oddListRowS1"
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
<input type='text' id="addProductInput" size="10">
<span style="color: red;" id="addProductInputError"></span>
</td>
<td valign="top" class="oddListRowS1"
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
Brak produktu w wybranej lokalizacji.
</td>
<td valign="top" class="oddListRowS1"
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
<input type="button" value="Dodaj produkt" class="button" onclick="addProductToAddress()" />
</td>
</tr>
</table>
{/if}
{/if}
{if $PROCESS && $PROCESS=='PRODUCT'}
<h2>{$PRODUCT.code} {$PRODUCT.name} ( Stan: {$PRODUCT.ems_qty_in_stock} )&nbsp;<input type="button"
value="Karta produktu" class="button" onclick="openProductCard('{$PRODUCT.id}');" /></h2>
<table cellpadding="0" cellspacing="0" class="list view">
<tr class="oddListRowS1">
<th style="width: 15%;"><b>Adres</b></td>
<th style="width: 15%;"><b>Niepełny</b></td>
<th><b>Akcje</b></td>
</tr>
{foreach from=$ADDRESSES item=item key=item_name}
<tr class="oddListRowS1">
<td valign="top" class="oddListRowS1"
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
{$item.stock_address}
</td>
<td valign="top" class="oddListRowS1"
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
<input type="checkbox" {if $item.is_not_full}checked{/if}
onclick="setAddressIsNotFull('{$item.stock_address}', this)" />
</td>
<td valign="top" class="oddListRowS1"
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
<input type="button" value="Usuń lokalizację" class="button"
onclick="removeAddressFromProduct('{$item.stock_address}')" />
</td>
</tr>
{/foreach}
<tr class="oddListRowS1">
<td valign="top" class="oddListRowS1"
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
<input type="text" size="10" id="newAddress" />
<span style="color: red;" id="newAddressError"></span>
</td>
<td valign="top" class="oddListRowS1"
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
<input type="checkbox" id="isNotFull" />
</td>
<td valign="top" class="oddListRowS1"
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
<input type="button" value="Dodaj lokalizację" class="button" onclick="addAddressToProduct();" />
</td>
</tr>
</table>
{/if}
{if $PROCESS && $PROCESS=="ALL_ADDRESSES"}
<h3>Ilość: {$SUM}</h3>
<table cellpadding="0" cellspacing="0" class="list view">
<tr class="oddListRowS1">
<th style="width: 10%;"><b>Adres</b></th>
<th><b>Niepełny</b></th>
<th><b>Akcja</b></th>
<th><b>Nazwa</b></th>
<th><b>Stan</b></th>
</tr>
{foreach from=$ADDRESSES item=item key=item_name}
<tr class="oddListRowS1">
<td valign="top" class="oddListRowS1"
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
{$item.stock_address}
</td>
<td valign="top" class="oddListRowS1"
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
<input type="checkbox" {if $item.is_not_full}checked{/if} disabled />
</td>
<td valign="top" class="oddListRowS1"
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
<input type="button" value="Pokaż adres" class="button" name="showAddress-{$item.stock_address}" />
</td>
<td valign="top" class="oddListRowS1"
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
{if $item.name}
{$item.name}
{else}
Wolne miejsce.
{/if}
</td>
<td valign="top" class="oddListRowS1"
style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">
{if $item.name}
{$item.stock_state}
{/if}
</td>
</tr>
{/foreach}
</table>
{/if}
<style>
{literal}
.ui-autocomplete {
max-height: 200px;
overflow-y: auto;
overflow-x: hidden;
padding-right: 20px;
border-radius: 0;
}
.ui-corner-all {
border-radius: 0;
}
.loader {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
padding-top: 50vh;
text-align: center;
background-color: rgba(16, 16, 16, 0.5);
}
.loader>img {}
{/literal}
</style>