default.php 7.32 KB
Newer Older
Reinhold Kainhofer's avatar
Reinhold Kainhofer committed
1
2
3
4
5
6
<?php
if( !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );

/**
*
* @package VirtueMart
7
8
9
* @subpackage EU Recapitulative Statement
* @copyright Copyright (C) 2015 Open Tools, Reinhold Kainhofer.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.txt
Reinhold Kainhofer's avatar
Reinhold Kainhofer committed
10
11
12
13
14
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
*
15
* http://www.open-tools.net
Reinhold Kainhofer's avatar
Reinhold Kainhofer committed
16
17
18
19
20
*/

AdminUIHelper::startAdminArea($this);

JHtml::_('behavior.framework', true);
21
22
23
24
25
if (!class_exists('CurrencyDisplay'))
    require(VMPATH_ADMIN . DS . 'helpers' . DS . 'currencydisplay.php');
$myCurrencyDisplay = CurrencyDisplay::getInstance();


Reinhold Kainhofer's avatar
Reinhold Kainhofer committed
26
?>
27

Reinhold Kainhofer's avatar
Reinhold Kainhofer committed
28
<form action="index.php" method="post" name="adminForm" id="adminForm">
29
30
	<?php echo $this->addStandardHiddenToForm(); ?>

Reinhold Kainhofer's avatar
Reinhold Kainhofer committed
31
32
    <div id="header">
        <h2><?php echo vmText::sprintf('VMEXT_EU_RECAP_VIEW_TITLE_DATE', vmJsApi::date( $this->from_period, 'LC',true) , vmJsApi::date( $this->until_period, 'LC',true) ); ?></h2>
33
        <p><?php echo vmText::_('VMEXT_EU_RECAP_VIEW_EXPLANATION'); ?> </p>
Reinhold Kainhofer's avatar
Reinhold Kainhofer committed
34
        <div id="filterbox">
35
36
37
            <table width="100%">
                <tr width="100%">
                    <td align="left">
38
						<div style="float: left">
39
40
41
42
43
44
						<?php 
						echo vmText::_('VMEXT_EU_RECAP_LIST_PERIOD');
						if ($this->frequency<12) {
							echo $this->period_lists['month_list']; 
						} 
						echo $this->period_lists['year_list'];
Reinhold Kainhofer's avatar
Reinhold Kainhofer committed
45
46
47
48

                        if(VmConfig::get('multix','none')!='none'){
                            $vendorId = vRequest::getInt('virtuemart_vendor_id',1);
                            echo ShopFunctions::renderVendorList($vendorId,false);
49
                        } ?><br>
50
                        <label><input type="checkbox" <?php if ($this->include_taxed_orders) { ?>checked <?php } ?> name="include_taxed_orders" value="true" style="vertical-align: top; position: relative; bottom: 1px;" onchange="this.form.submit();">&nbsp;<?php echo vmText::_('VMEXT_EU_RECAP_INCLUDE_TAXED'); ?></label>
51
52
                        </div>
                        <span><button class="btn btn-small" name="Go" onclick="this.form.task.value=''; this.form.submit();"><?php echo vmText::_('COM_VIRTUEMART_GO'); ?></button></span>
53
                    </td>
54
55
                    <td align="right" style="vertical-align: top">
						<div style="float: right"><?php echo $this->export_format_list; ?>
56
                        <button class="btn btn-small" name="format" value="raw"  style="vertical-align: top;"><?php echo vmText::_('VMEXT_EU_RECAP_EXPORT'); ?>
57
                        </button></div>
Reinhold Kainhofer's avatar
Reinhold Kainhofer committed
58
59
60
61
62
                    </td>
                </tr>
            </table>
        </div>
        <div id="resultscounter">
63
            <?php if ($this->pagination) echo $this->pagination->getResultsCounter();?>
Reinhold Kainhofer's avatar
Reinhold Kainhofer committed
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
        </div>
    </div>

    <div id="editcell">
	    <table class="adminlist table table-striped" cellspacing="0" cellpadding="0">
            <thead>
                <tr>
                    <th>
                        <?php echo $this->sort('`vatid`', 'VMEXT_EU_RECAP_VATID'); ?>
                    </th>
                    <th>
                        <?php echo $this->sort('`countrycode`', 'VMEXT_EU_RECAP_COUNTRYCODE') ; ?>
                    </th>
                    <th>
                        <?php echo $this->sort('`company`', 'VMEXT_EU_RECAP_COMPANY') ; ?>
                    </th>
                    <th>
                        <?php echo $this->sort('`last_name`', 'VMEXT_EU_RECAP_NAME') ; ?>
                    </th>
                    <th>
                        <?php echo $this->sort('`order_ids`', 'VMEXT_EU_RECAP_ORDERS') ; ?>
                    </th>
                    <th>
                        <?php echo $this->sort('`sum_order_total`', 'VMEXT_EU_RECAP_ORDERTOTALS') ; ?>
                    </th>
89
<?php if ($this->include_taxed_orders) { ?>
Reinhold Kainhofer's avatar
Reinhold Kainhofer committed
90
91
92
                    <th>
                        <?php echo $this->sort('`sum_order_tax`', 'VMEXT_EU_RECAP_ORDERTAXES') ; ?>
                    </th>
93
<?php } ?>
Reinhold Kainhofer's avatar
Reinhold Kainhofer committed
94
95
96
97
98
99
100
101
102
103
104
105
                </tr>
            </thead>
            <tbody>
                <?php
        $i = 0;
        foreach ($this->report as $r) {
            $userlink = JROUTE::_ ('index.php?option=com_virtuemart&view=user&task=edit&virtuemart_user_id[]=' . $r['virtuemart_user_id'], FALSE);
        ?>
                <tr class="row<?php echo $i;?>">
                    <td align="center">
                        <?php echo $r['vatid']; ?>
                    </td>
106
107
108
109
110
111
112
                    <?php 
                        $vatidcc = substr(trim($r['vatid']), 0, 2);
                        if ($vatidcc=="EL") $vatidcc="GR";
                        if ($vatidcc=="UK") $vatidcc="GB";
                        $countrymatch = ($vatidcc == $r['countrycode']);
                    ?>
                    <td align="center" <?php if (!$countrymatch) { echo "style=\"background: #FFBFBF;\""; }; ?>>
Reinhold Kainhofer's avatar
Reinhold Kainhofer committed
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
                        <?php echo $r['countrycode'];?>
                    </td>
                    <td align="left">
                        <?php 
                            if ($r['company']) { 
                                echo JHtml::_ ('link', JRoute::_ ($userlink, FALSE), $r['company'], array('title' => $r['company'])); 
                            } 
                        ?>
                    </td>
                    <td align="left">
                        <?php
                            $fullname = join(" ", array($r['first_name'], $r['last_name']));
                            if ($fullname) {
                                echo JHtml::_ ('link', JRoute::_ ($userlink, FALSE), $fullname, array('title' => $fullname));
                            } 
                        ?>
                    </td>
                    <td align="left">
                    <?php
                        $oids = explode(',', $r['order_ids']);
                        $onrs = explode(',', $r['order_numbers']);
                        $orders = array_combine($oids, $onrs);
                        $links = array();
                        foreach ($orders as $oid=>$onr) {
                            $orderlink = JROUTE::_ ('index.php?option=com_virtuemart&view=orders&task=edit&virtuemart_order_id=' . $oid, FALSE);
                            $links[] = JHtml::_ ('link', JRoute::_ ($orderlink, FALSE), $onr, array('title' => $onr));
                        }
                        echo join(", ", $links); 
                    ?>
                    </td>
                    <td align="right">
144
		                <?php echo $myCurrencyDisplay->priceDisplay($r['sum_order_total']); ?>
Reinhold Kainhofer's avatar
Reinhold Kainhofer committed
145
                    </td>
146
<?php if ($this->include_taxed_orders) { ?>
Reinhold Kainhofer's avatar
Reinhold Kainhofer committed
147
                    <td align="right">
148
		                <?php echo $myCurrencyDisplay->priceDisplay($r['sum_order_tax']); ?>
Reinhold Kainhofer's avatar
Reinhold Kainhofer committed
149
                    </td>
150
<?php } ?>
Reinhold Kainhofer's avatar
Reinhold Kainhofer committed
151
152
153
154
155
156
157
158
159
                </tr>
                <?php
	    	$i = 1-$i;
	    }
	    ?>
            </tbody>
            <tfoot>
                <tr>
                    <td colspan="10">
160
                        <?php if ($this->pagination) echo $this->pagination->getListFooter(); ?>
Reinhold Kainhofer's avatar
Reinhold Kainhofer committed
161
162
163
164
165
166
167
168
169
170
                    </td>
                </tr>
            </tfoot>
        </table>
    </div>

</form>

<?php AdminUIHelper::endAdminArea(); ?>