Esempio n. 1
0
?>
</td>
		</tr>
	</tbody>
</table>

<table cellpadding="0" cellspacing="0">
	<thead>
		<th colspan="2"><?php 
\pi18n("Payments", PLUGIN_NAME);
?>
</th>
	</thead>
	<tbody>
<?php 
$currSrv = new \Pasteque\CurrenciesService();
foreach ($zticket->payments as $payment) {
    $currency = $currSrv->get($payment->currencyId);
    if ($currency->isMain) {
        $amount = \i18nCurr($payment->amount);
    } else {
        $amount = $currency->format($payment->currencyAmount) . " (" . \i18nCurr($payment->amount) . ")";
    }
    ?>
		<tr>
			<td><?php 
    \pi18n($payment->type);
    ?>
</td>
			<td class="numeric"><?php 
    echo $amount;
Esempio n. 2
0
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    Pastèque is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with Pastèque.  If not, see <http://www.gnu.org/licenses/>.
// categories action
namespace BaseCurrencies;

$message = NULL;
$error = NULL;
$currSrv = new \Pasteque\CurrenciesService();
if (isset($_POST['delete-currency'])) {
    if ($currSrv->delete($_POST['delete-currency'])) {
        $message = \i18n("Changes saved");
    } else {
        $error = \i18n("Unable to save changes");
    }
}
$currencies = $currSrv->getAll();
?>
<h1><?php 
\pi18n("Currencies", PLUGIN_NAME);
?>
</h1>

<?php 
Esempio n. 3
0
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    Pastèque is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with Pastèque.  If not, see <http://www.gnu.org/licenses/>.
// category_edit action
namespace BaseCurrencies;

$message = NULL;
$error = NULL;
$currSrv = new \Pasteque\CurrenciesService();
if (isset($_POST['id']) && isset($_POST['label'])) {
    $isMain = isset($_POST['isMain']) && $_POST['isMain'];
    $isActive = isset($_POST['isActive']) && $_POST['isActive'];
    $curr = \Pasteque\Currency::__build($_POST['id'], $_POST['label'], $_POST['symbol'], $_POST['decimalSeparator'], $_POST['thousandsSeparator'], $_POST['format'], $_POST['rate'], $isMain, $isActive);
    if ($currSrv->update($curr)) {
        $message = \i18n("Changes saved");
    } else {
        $error = \i18n("Unable to save changes");
    }
} else {
    if (isset($_POST['label'])) {
        $isMain = isset($_POST['isMain']) && $_POST['isMain'];
        $isActive = isset($_POST['isActive']) && $_POST['isActive'];
        $curr = new \Pasteque\Currency($_POST['label'], $_POST['symbol'], $_POST['decimalSeparator'], $_POST['thousandsSeparator'], $_POST['format'], $_POST['rate'], $isMain, $isActive);
        $id = $currSrv->create($curr);