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

361 lines
19 KiB
Smarty

<!-- Tablesorter -->
<script type="text/javascript" src="include/jQuery/jquery-ui-lite/jquery-1.12.4.js"></script>
<link class="theme" rel="stylesheet" href="include/jQuery/jquery-ui-lite/jquery-ui.css">
<script type="text/javascript" src="include/jQuery/jquery-ui-lite/jquery-ui.js"></script>
<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>
<script type="text/javascript" src="modules/EcmPaymentStates/javascript/AccountPaymentStates.js"></script>
<style type="text/css">
{literal}
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: #E8E8E8;
color: #343432;
}
table.tablesorter tbody tr.alt-row:hover td {
background: #E8E8E8;
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="themes/Sugar/images/EcmProducts.gif" style="margin-top: 3px; margin-right: 3px;" alt="EcmProducts" width="16" border="0" height="16">
</td>
<td>
<h2>{$MOD.LBL_ACCOUNTPAYMENTSTATES} {$ACCOUNT.NAME}</h2>
</td>
</tr>
</table>
<br />
{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">
<input name="account_id" id="account_id" value="{$ACCOUNT.ID}" type="hidden">
<input name="btn_account_name" tabindex="" title="Select [Alt+T]" accesskey="T" class="button" value="Wybierz" onclick='
{literal}
open_popup("Accounts", 600, 400, "", true, false, {
"call_back_function":"set_return",
"form_name":"searchForm",
"field_to_name_array":{
"id":"account_id",
"name":"account_name"
}
},
"single", true);
{/literal}'
type="button"></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';">
{else}
<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="show_settled" name="show_settled" value="{$SHOW_SETTLED}">
<input type="hidden" id="show_after_p" name="show_after_p" value="{$SHOW_AFTER_P}">
<input type="hidden" id="show_after_t" name="show_after_t" value="{$SHOW_AFTER_T}">
<input type="hidden" id="show_after_d" name="show_after_d" value="{$SHOW_AFTER_D}">
<input name="account_id" id="account_id" value="{$ACCOUNT.ID}" type="hidden">
<input class="button" name="switch" value="{if $SHOW_SETTLED}{$MOD.LBL_SHOW_SETTLED_OFF}{else}{$MOD.LBL_SHOW_SETTLED_ON}{/if}" onclick="sendPost();" type="button">
<input class="button" name="show_after_p" value="{if $SHOW_AFTER_P}{$MOD.LBL_AFER_P_OFF}{else}{$MOD.LBL_AFER_P_ON}{/if}" onclick="sendPost2();" type="button">
<input class="button" name="show_after_t" value="{if $SHOW_AFTER_T}{$MOD.LBL_AFER_T_OFF}{else}{$MOD.LBL_AFER_T_ON}{/if}" onclick="sendPost3();" type="button">
<input class="button" name="show_after_d" value="{if $SHOW_AFTER_D}Ukryj roz. wg daty{else}Pokaż roz. wg daty{/if}" onclick="sendPost4();" type="button">
<input autocomplete="off" name="date_to" id="date_to" value="{$date_to}" title="Data do" tabindex="" size="11" maxlength="10" type="text">
<img src="themes/default/images/jscalendar.gif" alt="Enter Date" id="date_to_trigger" align="absmiddle" border="0">
<script language="JavaScript" type="text/javascript">
Calendar.setup({ldelim}
inputField: "date_to",
daFormat: "%d.%m.%Y",
button: "date_to_trigger",
singleClick: true,
dateStr: "",
step: 1
{rdelim}
);
</script>
<input class="button" name="submit" id="submit" value="{$APP.LBL_SEARCH}" type="submit" style="display:none">
{/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="20%" 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="20%" 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="18%" 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="18%" 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="8%" 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="8%" 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="6%" 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>"}
{else}
{assign var="b" value=""}
{assign var="b2" value=""}
{/if}
<tr>
<td style="text-align: center;">{$b}{$w.register_date}{$b2}</td>
<td style="text-align: center;">{$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;">{$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="edit" onclick="editTransaction('{$w.id}');">Edytuj</li>
<li id="delete" onclick="deleteTransaction('{$w.id}');">Usuń</li>
{else}
<li id="settled" onclick="showDetails('{$w.id}')">Rozliczenia</li>
<li id="rel" onclick="deleteRelation('{$w.id}');">Usuń relacje</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' && $SHOW_AFTER_P && $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="6%" 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="8%" 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="8%" 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="18%" 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="18%" 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="20%" 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="20%" 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>"}
{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 ($w.is_settled==0)}
<li id="edit" onclick="editTransaction('{$m.id}');">Edytuj</li>
<li id="delete" onclick="deleteTransaction('{$m.id}');">Usuń</li>
{else}
<li id="settled" onclick="showDetails('{$m.id}')">Rozliczenia</li>
<li id="rel" onclick="deleteRelation('{$m.id}');">Usuń relacje</li>
{/if}
</ul>
</div>
<td style="text-align: right;">{$b}{$m.unsettled}{$b2}</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: center;">{$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>
<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}
</td>
<td align="center" style="width: 34%">
{$MOD.LBL_SALDO}
</td>
<td align="right" style="width: 33%">
{$MOD.LBL_TOTAL_MA}
</td>
</tr>
<tr>
<td align="left" style="width: 33%">
{$SUM.WINIEN} <span style="color: green">({$SUM.WINIEN_SETTLED})</span>
</td>
<td align="center" style="width: 34%">
<p {if $SUM.SALDO < 0} style="color: red;" {/if}>
{$SUM.SALDO}
</p>
</td>
<td align="right" style="width: 33%">
{$SUM.MA} <span style="color: green">({$SUM.MA_SETTLED})</span>
</td>
</tr>
</table>
</form>
<table style="width: 100%">
<tr>
<td align="left">
<a href="index.php?module=EcmTransactions&action=EditView&parent_id={$ACCOUNT.ID}&type=0&fromAccountPaymentStates=1">
<input type="button" value="Utwórz transakcje Winien"/>
</a>
</td>
<td align="right">
<a href="index.php?module=EcmTransactions&action=EditView&parent_id={$ACCOUNT.ID}&type=1&fromAccountPaymentStates=1">
<input type="button" value="Utwórz transakcje Ma"/>
</a>
</td>
</tr>
</table>
<div style="width:100%" align="center">
{if $SHOW_AFTER_P}
<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 $SHOW_AFTER_T}
<input type="button" class="button" value="Wyślij Monit" onclick="createMonit(0);"/>
<input type="button" class="button" value="Pobierz Monit" onclick="createMonit(1);"/>
{else}
<input type="button" class="button" value="Do rozliczenia" onclick="showSettlePanel();"/>
{/if}
</div>
<div class="settle_panel">
<div class="settle_panel_main">
</div>
</div>
{/if}