Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <th><select id="fclient" onchange="return xchange('client');" style="width:100%">
- <option value="">Покупатель</option>
- </select></th>
- <td style="font-size: 80%;" class="client">{$item.Client}</td>
- <tr>
- <td colspan="6" >Всего {$sumcount} на сумму:</td>
- <td colspan="1" id="sumall" data-sum='{$sum|round:"2"}'><b>{$sum|round:"2"}</b></td>
- <td>
- <script>
- /*фильтр*/
- function xfilter(cl){
- var supervise = {};
- $("."+cl).each(function() {
- var txt = $(this).text();
- if(txt=='')return;
- if (supervise[txt]){
- }else{
- ($('#f'+cl).append('<option value="'+txt+'">'+txt+'</option>'))
- supervise[txt] = true;
- };
- });
- }
- var xfilterLs = {};/*хранить классы предыдущих*/
- function xchange(cl){
- $("."+cl).parent().show();
- xfilterLs[cl]=true;
- for(var p in xfilterLs) {
- op=$( "#f"+p+" option:selected" ).val();
- $("."+p).each(function() {
- if($(this).text()==op){
- }else if(op!=='')$(this).parent().hide();
- });
- }
- var sump=0;
- var sumz=0;
- var sumo=0;
- $("."+cl).parent().each(function() {
- if($(this).css('display')=='none')return;
- sump+=Number($(this).find('.sump').text());
- sumz+=Number($(this).find('.sumz').text());
- sumo+=Number($(this).find('.sumo').text());
- });
- $('#sumall b').text(Math.round(sump));//.toFixed(2));/*сумма продажи*/
- $('#sumallz b').text(Math.round(sumz))//.toFixed(2));/*сумма закупки*/
- $('#sumallr b').text(Math.round(sump-sumz));/*разница*/
- $('#sumallrp b').text(Math.round(((sump-sumz)/sumz)*100));/*разница %*/
- $('#sumallo b').text(Math.round(sumo));/*отказы %*/
- }
- </script>
- <script>
- xfilter('seller');
- xfilter('client');
- xfilter('city');
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement