Files
crm.twinpol.com/modules/EcmPaymentStates/tpls/AccountPaymentStates.tpl
2025-05-12 15:46:37 +00:00

446 lines
22 KiB
Smarty
Executable File

<!-- Tablesorter -->
<img id = "loading" src = "ajax-loader.gif" alt = "Loading indicator" style="display:none;">
<script type="text/javascript" src="modules/EcmReports/TableSorter/js/jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="modules/EcmReports/TableSorter/js/jquery.tablesorter.staticrow.min.js"></script>
<link rel="stylesheet" type="text/css" href="modules/EcmInvoiceOuts/javascript/helper.css" media="screen" />
<div class="loading_panel" style="display:none"></div>
<input type="hidden" name="system_name" value="{$system_name}" id="system_name"/>
<script type="text/javascript" src="modules/EcmPaymentStates/javascript/AccountPaymentStates2.js"></script>
<style type="text/css">
{literal}
#loading {
position: absolute;
top: 50%;
left: 50%;
width: 100px;
height: 100px;
/* 1/2 of the height and width of the actual gif */
margin: -16px 0 0 -16px;
z-index: 100;
}
thead, tfoot {font-weight: bold;}
/* Extra selectors needed to override the default styling */
table.tablesorter tbody tr.normal-row td {
background: #EFEFF1;
color: #343432;
}
table.tablesorter tbody tr.alt-row td {
background: #FFF;
color: #343432;
}
/* Extra selectors needed to override the default styling */
table.tablesorter tbody tr.normal-row:hover td {
background: #B8E8E8;
color: #343432;
}
table.tablesorter tbody tr.alt-row:hover td {
background: #B8E8E8;
color: #343432;
}
table.tablesorter tbody tr.sumTr td {
background: #AAC1D5;
color: black;
}
table.tablesorter tbody tr.sumTr:hover td {
background: #9AAEC1;
color: black;
font-weight: bold;
}
.settle_panel {
display: none;
position: fixed;
z-index: 1000;
top: 0;
left: 0;
height: 100%;
width: 100%;
text-align: center;
padding-top: 5%;
background: rgba( 255, 255, 255, .8 );
text-align: center;
}
.settle_panel_main {
background: white;
border: 1px solid black;
width: 40%;
height: 40%;
display: inline-block;
}
#edit {
list-style-image: url('modules/EcmQuotes/images/edit_position.gif');
}
#delete {
list-style-image: url('modules/EcmSales/images/deleterow.gif');
}
#settled {
list-style-image: url('modules/EcmQuotes/images/search.gif');
}
#rel {
list-style-image: url('modules/EcmSales/images/relation.png');
}
#note {
list-style-image: url('modules/EcmQuotes/images/note.gif');
}
#email {
list-style-image: url('modules/EcmQuotes/images/email.gif');
}
{/literal}
</style>
<!-- begin header & search form -->
<table cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td>
<img src="modules/EcmQuotes/images/options.gif" style="margin-top: 3px; margin-right: 3px;" alt="Opcje" onclick="showOptions('1')">
{if $ACCOUNT.NAME!=''}
<div id="div_options_search_1" class="hide_all" style="border: 1px solid #cccccc;background:#e6e6e6;padding:5px;position:absolute;display:none;text-align:left;">
<form action="index.php" method="post" name="searchForm" id="searchForm">
<input type="hidden" name="module" value="EcmPaymentStates" />
<input type="hidden" name="action" value="AccountPaymentStates" />
<input name="account_name" tabindex="" id="account_name" size="" value="{$ACCOUNT.NAME}" title="" type="hidden">
<input type="hidden" id="switch_show" name="switch_show" value="{$SWITCH_SHOW}">
<input name="account_id" id="account_id" value="{$ACCOUNT.ID}" type="hidden">
<input class="button" name="switch_all" value="{if $SWITCH_SHOW==1}{$MOD.LBL_SHOW_ALL_OFF}{else}{$MOD.LBL_SHOW_ALL_ON}{/if}" onclick="sendPost();" type="button"><br><br>
<input class="button" name="switch" value="{if $SWITCH_SHOW==2}{$MOD.LBL_SHOW_SETTLED_OFF}{else}{$MOD.LBL_SHOW_SETTLED_ON}{/if}" onclick="sendPost2();" type="button"><br><br>
<input class="button" name="switch2" value="{if $SWITCH_SHOW==3}{$MOD.LBL_SHOW_NOT_SETTLED_OFF}{else}{$MOD.LBL_SHOW_NOT_SETTLED_ON}{/if}" onclick="sendPost3();" type="button"><br><br>
<input class="button" name="show_after_p" value="{if $SWITCH_SHOW==4}{$MOD.LBL_AFER_P_OFF}{else}{$MOD.LBL_AFER_P_ON}{/if}" onclick="sendPost4();" type="button"><br><br>
<input class="button" name="show_after_t" value="{if $SWITCH_SHOW==5}{$MOD.LBL_AFER_T_OFF}{else}{$MOD.LBL_AFER_T_ON}{/if}" onclick="sendPost5();" type="button">
<input class="hidden" name="toPDF" id="toPDF" value="0" type="hidden">
<input class="hidden" name="to_pdf" id="to_pdf" value="0" type="hidden">
<input class="button" name="submit" id="submit" value="{$APP.LBL_SEARCH}" type="submit" style="display:none">
</div>
{/if}
</td>
<td>
{if $umowy|@count>0}
Wybierz umowę:
<select name="agreement" id="agreement">
<option value="">brak</option>
{foreach from=$umowy item=umowa}
{$umowa}
<option value="{$umowa.id}" {if $umowa_sel==$umowa.id}selected="selected"{/if}>{$umowa.document_no}</option>
{/foreach}
</select><input type="button" value="Filtruj" onClick="submitForm();">
{/if}
<h2><a href="index.php?module=Accounts&action=DetailView&record={$ACCOUNT.ID}">{$ACCOUNT.NAME} ({$currency})</a></h2>
</td>
</tr>
</table>
</form>
<div style="width:100%" align="center">
{if $SWITCH_SHOW==4}
<form action="index.php" method="post" name="createNote" id="createNote">
<input type="hidden" name="module" value="EcmPaymentStates" />
<input type="hidden" name="action" value="createNote" />
<input type="hidden" name="id_list" value="" id="id_list"/>
<input type="hidden" name="to_pdf" value="1" id="to_pdf"/>
<input name="account_id" id="account_id" value="{$ACCOUNT.ID}" type="hidden">
<input type="button" class="button" value="Wystaw note(y)" onclick="makeNote();"/>
<input type="submit" id="submitNote" class="button" value="" style="display:none"/>
</form>
{elseif $SWITCH_SHOW==5}
<input type="button" class="button" value="Wyślij Monit" onclick="{literal}if($('#div_send_monit').css('display') == 'none'){$('#div_send_monit').show('slow'); }
else { $('#div_send_monit').hide('slow'); }{/literal}"/>
<input type="button" class="button" value="Pobierz Monit" onclick="createMonit(1);"/>
<input type="button" class="button" value="Wyślij SMS" onclick="{literal}if(createSmsFromError()!=false){createSmsText();if($('#div_send').css('display') == 'none'){$('#div_send').show('slow'); } }
else { $('#div_send').hide('slow'); }{/literal}"/>
<script src="include/ECM/comboselectbox.js"></script>
<link rel="stylesheet" type="text/css" href="include/ECM/EcmSendPdfButton/EcmSendPdfButton.css">
<!-- monit -->
<script src="include/ECM/EcmSendPdfButton/EcmSendPdfButton.js"></script>
{assign var='text' value='W załączniku przesyłamy informację o zaległości, włączając specyfikacje nierozliczonych faktur.'}
<div id="div_send_monit" style="border: 1px solid #cccccc;background:#e6e6e6;padding:5px;display:none;left:40% ">
Wybierz email:
<select name="addr_email" id="addr_email" style="width:250px;">
{foreach from=$EMAILLIST item=email}
<option value="{$email.email_address}">{$email.email_address}</option>
{/foreach}
</select>
{if !empty($PDF_OPT)}
{$PDF_OPT}
{/if}
<br>Treść:<br>
<textarea id="textarea" rows="7" style="width:250px;">
{$text}
</textarea><br>
<input name="send_mail" id="send_mail" title="Wyślij Email" accessKey="" class="button"
onclick=" createMonit(0)" type="button" value="Wyślij Email"><br /><br /></div>
<!-- koniec monitu -->
<div id="div_send" style="border: 1px solid #cccccc;background:#e6e6e6;padding:5px;display:none;">
Wybierz numer:
<select name="number_phone" id="number_phone" style="width:250px;">
<option value="{$number}">{$number}</option>
</select>
<br>Treść:<br>
<textarea id="textarea" rows="7" style="width:250px;">
Prosze o uregulowanie zaleglych platnosci na kwote {$SUM.WINIEN}. Firma {$CURRENT_COMPANY}.
</textarea><br>
<input name="cat_xls" id="cat_xls" title="Wyślij Email" accessKey="" class="button"
onclick="{literal}sendSMS();{/literal}" type="button" value="Wyślij"><br /><br /></div>
{else}
<input type="button" class="button" value="Do rozliczenia" onclick="showSettlePanel();"/>
{/if}
<input type="button" class="button" value="PDF" onclick="sendPDF();"/>
</div>
<table style="width: 100%">
<tr>
<td align="left">
<input type="button" value="Utwórz transakcje Winien" onClick="createTransactionWinien('{$ACCOUNT.ID}')"/>
</td>
<td align="right">
<input type="button" value="Utwórz transakcje Ma" onClick="createTransactionMa('{$ACCOUNT.ID}')"/>
</td>
</tr>
</table>
<table style="border-top: 0px none; margin-bottom: 4px;width:100%" class="tabForm" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left" style="width: 33%">
{$MOD.LBL_TOTAL_WINIEN}
<br>
<span id="w_ck"> </span>
</td>
<td align="center" style="width: 34%">
{$MOD.LBL_SALDO}
<br>
<span id="total_ck"> </span>
</td>
<td align="right" style="width: 33%">
{$MOD.LBL_TOTAL_MA}
<br>
<span id="m_ck"> </span>
</td>
</tr>
<tr>
<td align="left" style="width: 33%;font-size:14px;">
{$SUM.WINIEN}
</td>
<td align="center" style="width: 34%;font-size:14px;">
<p {if $SUM.SALDO < 0} style="color: red;" {/if}>
{$SUM.SALDO}
</p>
</td>
<td align="right" style="width: 33%;font-size:14px;">
{$SUM.MA}
</td>
</tr>
</table>
{if $ACCOUNT.NAME==''}
<form action="index.php" method="post" name="searchForm">
<input type="hidden" name="module" value="EcmPaymentStates" />
<input type="hidden" name="action" value="AccountPaymentStates" />
<table style="border-top: 0px none; margin-bottom: 4px;width:100%" class="tabForm" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="dataLabel" width="10%" nowrap="nowrap">{$MOD.LBL_ACCOUNT_NAME}</td>
<td class="dataField" width="30%" nowrap="nowrap">
<input name="account_name" tabindex="" id="account_name" size="" value="{$ACCOUNT.NAME}" title="" type="text" disabled>
<input name="account_id" id="account_id" value="{$ACCOUNT.ID}" type="hidden">
<span class="id-ff multiple">
{literal}
<button type="button" name="btn_account_name" id="btn_account_name" tabindex="103" title="Wybierz [Alt+T]" accessKey="T" class="button firstChild" value="Wybierz"
onclick='open_popup(
"Accounts",
800,
500,
"",
true,
false,
{"call_back_function":"set_return","form_name":"searchForm","field_to_name_array":{"id":"account_id","name":"account_name"}},
"single",
true
); {/literal}' ><img src="themes/default/images/id-ff-select.png?s=bed8cd35065048ceebdc639ebe305e2c&c=1"></button><button type="button" name="btn_clr_parent_name" id="btn_clr_parent_name" tabindex="103" title="Wyczyść[Alt+C]" accessKey="C" class="button lastChild"
onclick="this.form.account_name.value = ''; this.form.account_id.value = '';"
value="Wyczyść" ><img src="themes/default/images/id-ff-clear.png?s=bed8cd35065048ceebdc639ebe305e2c&c=1"></button>
</span>
</td>
<td class="dataLabel" width="10%" nowrap="nowrap">{$MOD.LBL_SHOW_SETTLED}</td>
<td class="dataField" width="30%" nowrap="nowrap">
<input type="checkbox" id="show_settled" name="show_settled" {$SHOW_SETTLED}>
</td>
<td class="dataLabel" width="10%" nowrap="nowrap">{$MOD.LBL_AFER_P}</td>
<td class="dataField" width="30%" nowrap="nowrap">
<input type="checkbox" id="show_after_p" name="show_after_p" {$SHOW_AFTER_P}>
</td>
</tr>
</tbody>
</table>
<input class="button" name="submit" value="{$APP.LBL_SEARCH}" type="submit">
<input class="button" name="clear" value="{$APP.LBL_CLEAR_BUTTON_LABEL}" type="button" onclick="location.href='index.php?module=EcmPaymentStates&action=AccountPaymentStates';">
{/if}
<br />
<!-- end header && search form-->
{if $PROCESS}
<div style="width: 100%; height: 500px; border: 1px sold blue; overflow: scrool;">
<div style="width: 49.8%; height: 500px; float: left; overflow: auto;">
<!-- WINIEN -->
<table id="winien" class="tablesorter tablesorter-blue" role="grid" style="width: 100%;">
<thead>
<tr class="tablesorter-headerRow" role="row">
<th width="5%" class="sorter-text tablesorter-header tablesorter-headerUnSorted" data-column="0" tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on" style="-moz-user-select: none; text-align: center;" aria-sort="none" aria-label="Name: No sort applied, activate to apply an ascending sort">{$MOD.LBL_DATE}</th>
<th width="35%" class="sorter-text tablesorter-header tablesorter-headerUnSorted" data-column="1" tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on" style="-moz-user-select: none; text-align: center;" aria-sort="none" aria-label="Name: No sort applied, activate to apply an ascending sort">{$MOD.LBL_NAME}</th>
<th width="10%" class="sorter-saas tablesorter-header tablesorter-headerUnSorted" data-column="2" tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on" style="-moz-user-select: none; text-align: right;" aria-sort="none" aria-label="Name: No sort applied, activate to apply an ascending sort">{$MOD.LBL_VALUE}</th>
<th width="10%" class="sorter-saas tablesorter-header tablesorter-headerUnSorted" data-column="3" tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on" style="-moz-user-select: none; text-align: right;" aria-sort="none" aria-label="Name: No sort applied, activate to apply an ascending sort">{$MOD.LBL_SETTLED}</th>
<th width="10%" class="sorter-saas tablesorter-header tablesorter-headerUnSorted" data-column="4" tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on" style="-moz-user-select: none; text-align: right;" aria-sort="none" aria-label="Name: No sort applied, activate to apply an ascending sort">{$MOD.LBL_UNSETTLED}</th>
<th width="2%" class="sorter-saas tablesorter-header tablesorter-headerUnSorted" data-column="4" tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on" style="-moz-user-select: none; text-align: center;" aria-sort="none" aria-label="Name: No sort applied, activate to apply an ascending sort">{$MOD.LBL_ACTIONS}</th>
<th width="5%" class="sorter-saas tablesorter-header tablesorter-headerUnSorted" data-column="5" tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on" style="-moz-user-select: none;" aria-sort="none" aria-label="Name: No sort applied, activate to apply an ascending sort">&nbsp;</th>
</tr>
</thead>
<tbody aria-live="polite" aria-relevant="all">
{foreach from=$WINIEN item=w}
{if $w.is_settled!=0}
{assign var="b" value="<b><span style=\"color:green;\">"}
{assign var="b2" value="</span></b>"}
{elseif $w.total!=$w.settled && $w.total!=$w.unsettled}
{assign var="b" value="<b><span style=\"color:orange;\">"}
{assign var="b2" value="</span></b>"}
{else}
{assign var="b" value=""}
{assign var="b2" value=""}
{/if}
<tr>
<td style="text-align: center;" id="trans_date_{$w.id}">{$b}{$w.register_date}{$b2}</td>
<td style="text-align: left;" id="trans_name_{$w.id}">{$b}{$w.document_no}{$b2}{if $w.note == '1'}(NOTA){/if}</td>
<td style="text-align: right;">{$b}{$w.total}{$b2}</td>
<td style="text-align: right;">{$b}{$w.settled}{$b2}</td>
<td style="text-align: right;" id="winien_val_{$w.id}">{$b}{$w.unsettled}{$b2}</td>
<td style="text-align:center;">
<img src="modules/EcmQuotes/images/options.gif" style="cursor: pointer;" onclick="showActions('{$w.id}')"/>
<div id="div_options_{$w.id}" class="hide_all" style="border: 1px solid #cccccc;background:#e6e6e6;padding:5px;position:absolute;display:none;text-align:left;">
<ul>
{if $w.is_settled!=0}
<li id="settled" onclick="showDetails('{$w.id}')">Rozliczenia</li>
<li id="rel" onclick="deleteRelation('{$w.id}');">Usuń relacje</li>
{elseif $w.total!=$w.settled && $w.total!=$w.unsettled}
<li id="settled" onclick="showDetails('{$w.id}')">Rozliczenia</li>
<li id="rel" onclick="deleteRelation('{$w.id}');">Usuń relacje</li>
{else}
<li id="edit" onclick="editTransaction('{$w.id}');">Edytuj</li>
<li id="delete" onclick="deleteTransaction('{$w.id}');">Usuń</li>
{/if}
{if $w.note == '1'}
<li id="note" onclick="showNote('{$w.note_id}');">Pokaż note</li>
<li id="email" onclick="sendNote('{$w.note_id}');">Wyślij note</li>
{/if}
</ul>
</div>
</td>
{if $w.is_settled == '0' ||( $w.is_settled != '0' && $SWITCH_SHOW==4 && $w.note != '1')}
<td style="text-align: center;"><input type="checkbox" name="winien[]" class="check" value="{$w.id}"/></td>
{else}
<td> &nbsp </td>
{/if}
</tr>
<tr id="details_{$w.id}" style="border-collapse: collapse; display:none;">
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><div id="details_div_{$w.id}" style="width: 100%"></div></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
<div style="width: 0.2%; height: 500px; float: left; background-color: #000000;"></div>
<div style="width: 49.8%; height: 500px; float: right; overflow: auto;">
<!-- MA -->
<table id="ma" class="tablesorter tablesorter-blue" role="grid" style="width: 100%;">
<thead>
<tr class="tablesorter-headerRow" role="row">
<th width="5%" class="sorter-text tablesorter-header tablesorter-headerUnSorted" data-column="0" tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on" style="-moz-user-select: none;" aria-sort="none; text-align: center;" aria-label="Name: No sort applied, activate to apply an ascending sort">&nbsp</th>
<th width="2%" class="sorter-saas tablesorter-header tablesorter-headerUnSorted" data-column="4" tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on" style="-moz-user-select: none; text-align: center;" aria-sort="none" aria-label="Name: No sort applied, activate to apply an ascending sort">{$MOD.LBL_ACTIONS}</th>
<th width="10%" class="sorter-text tablesorter-header tablesorter-headerUnSorted" data-column="1" tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on" style="-moz-user-select: none;" aria-sort="none; text-align: center;" aria-label="Name: No sort applied, activate to apply an ascending sort">{$MOD.LBL_UNSETTLED}</th>
<th width="10%" class="sorter-saas tablesorter-header tablesorter-headerUnSorted" data-column="2" tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on" style="-moz-user-select: none;" aria-sort="none; text-align: right;" aria-label="Name: No sort applied, activate to apply an ascending sort">{$MOD.LBL_SETTLED}</th>
<th width="10%" class="sorter-saas tablesorter-header tablesorter-headerUnSorted" data-column="3" tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on" style="-moz-user-select: none;" aria-sort="none; text-align: right;" aria-label="Name: No sort applied, activate to apply an ascending sort">{$MOD.LBL_VALUE}</th>
<th width="32%" class="sorter-saas tablesorter-header tablesorter-headerUnSorted" data-column="4" tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on" style="-moz-user-select: none;" aria-sort="none; text-align: right;" aria-label="Name: No sort applied, activate to apply an ascending sort">{$MOD.LBL_NAME}</th>
<th width="8%" class="sorter-saas tablesorter-header tablesorter-headerUnSorted" data-column="5" tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on" style="-moz-user-select: none;" aria-sort="none" aria-label="Name: No sort applied, activate to apply an ascending sort">{$MOD.LBL_DATE}</th>
</tr>
</thead>
<tbody aria-live="polite" aria-relevant="all">
{foreach from=$MA item=m}
{if $m.is_settled!=0}
{assign var="b" value="<b><span style=\"color:green;\">"}
{assign var="b2" value="</span></b>"}
{elseif $m.total!=$m.settled && $m.total!=$m.unsettled}
{assign var="b" value="<b><span style=\"color:orange;\">"}
{assign var="b2" value="</span></b>"}
{else}
{assign var="b" value=""}
{assign var="b2" value=""}
{/if}
<tr>
{if $m.is_settled == '0'}
<td style="text-align: center;"><input type="checkbox" class="check" name="ma[]" value="{$m.id}"/></td>
{else}
<td> &nbsp </td>
{/if}
<td style="text-align:center;">
<img src="modules/EcmQuotes/images/options.gif" style="cursor: pointer;" onclick="showActions('{$m.id}')"/>
<div id="div_options_{$m.id}" class="hide_all" style="border: 1px solid #cccccc;background:#e6e6e6;padding:5px;position:absolute;display:none;text-align:left;">
<ul>
{if $m.is_settled!=0}
<li id="settled" onclick="showDetails('{$m.id}')">Rozliczenia</li>
<li id="rel" onclick="deleteRelation('{$m.id}');">Usuń relacje</li>
{elseif $m.total!=$m.settled && $m.total!=$m.unsettled}
<li id="settled" onclick="showDetails('{$m.id}')">Rozliczenia</li>
<li id="rel" onclick="deleteRelation('{$m.id}');">Usuń relacje</li>
{else}
<li id="edit" onclick="editTransaction('{$m.id}');">Edytuj</li>
<li id="delete" onclick="deleteTransaction('{$m.id}');">Usuń</li>
{/if}
</ul>
</div>
<td style="text-align: right;" id="ma_val_{$m.id}">{$b}{$m.unsettled}{$b2}&nbsp&nbsp&nbsp</td>
<td style="text-align: right;">{$b}{$m.settled}{$b2}</td>
<td style="text-align: right;">{$b}{$m.total}{$b2}</td>
<td style="text-align: right;">{$b}{$m.name}{$b2}&nbsp</td>
<td style="text-align: center;">{$b}{$m.register_date}{$b2}</td>
</tr>
<tr id="details_{$m.id}" style="border-collapse: collapse; display:none;">
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><div id="details_div_{$m.id}" style="width: 100%"></div></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
</div>
</form>
<div class="settle_panel">
<div class="settle_panel_main">
</div>
</div>
{/if}