$sql = "SELECT `id`,CONCAT(`name`, ' (',`uid`,')') `name` FROM `##_" . $_SESSION['space'] . "_entity` WHERE `deleted`=0 AND `id`>0 ORDER BY `name`;"; $DBO->query($sql); $cust = $DBO->result("objectlist"); if ($o->get("id") == -1) { $entity_id = $cust[0]->id; } else { $entity_id = $o->get("entity_id"); } $sql = "SELECT `id`,`reference` FROM `##_" . $_SESSION['space'] . "_offer` WHERE `deleted`=0 AND `id`>0 AND `entity_id`='" . $entity_id . "' ORDER BY `reference`;"; $DBO->query($sql); $offer = $DBO->result("objectlist"); if ($o->get("id") == -1) { $offer_id = $offer[0]->id; $OFFER = new offer($offer_id); $OFFER->details(); $deadline = $OFFER->get("payment"); } else { $offer_id = $o->get('offer_id'); $deadline = $o->get('deadline'); } $sql = "SELECT `a`.`id`,CONCAT(`a`.`sku`,' - ',`a`.`name`,' - ',`a`.`price`) `name`\n FROM `##_" . $_SESSION['space'] . "_offer_item` `a` \n WHERE `offer_id`='" . $offer_id . "'\n AND `id`>-1\n ORDER BY `name`;"; $DBO->query($sql); $items = $DBO->result("objectlist"); ?> <div class="title"><?php echo ucwords($o->get("id") == -1 ? TRANSACTION_NEW_TRANSACTION : TRANSACTION_EDIT_TRANSACTION); ?> </div> <div class="form"> <div class="column"> <?php
* showitem.offer.php * * showitem.offer dialog * */ // enable or disable logging error_reporting(E_ALL); ini_set('display_errors', '1'); // 0 - disabled; 1 - enabled // $o = new offer($data->data->id); $o->details(); $sql = "SELECT `id`,`name` FROM `##_" . $_SESSION['space'] . "_entity` WHERE `deleted`=0 AND `id`>0 ORDER BY `name`;"; $DBO->query($sql); $cust = $DBO->result("objectlist"); if ($o->get("entity_id") == null) { $o->set("entity_id", $cust[0]->id); } $sql = "SELECT `id`,`name` FROM `##_" . $_SESSION['space'] . "_vat` WHERE `deleted`=0 AND `id`>0 ORDER BY `name`;"; $DBO->query($sql); $vat = $DBO->result("objectlist"); $sql = "SELECT `id`,`name` FROM `##_" . $_SESSION['space'] . "_currency` WHERE `deleted`=0 AND `id`>0 ORDER BY `name`;"; $DBO->query($sql); $curr = $DBO->result("objectlist"); $sql = "SELECT `a`.`id`,CONCAT(`a`.`name`,' - ',`a`.`sku`,' - ',`b`.`sign`,' ',`a`.`indicative_price`) `name` \n FROM `##_" . $_SESSION['space'] . "_inventory_item` `a` \n LEFT JOIN `##_" . $_SESSION['space'] . "_currency` `b` ON (`a`.`indicative_currency_id` = `b`.`id`)\n WHERE `a`.`deleted`=0 AND `a`.`id`>0 ORDER BY `name`;"; $DBO->query($sql); $items = $DBO->result("objectlist"); $sql = "SELECT `id`,CONCAT(`address_type`,' (', `street`,', ',`code`,' ',`city`,')') `address_type` FROM `##_" . $_SESSION['space'] . "_entity_address` WHERE `deleted`=0 AND `id`>0 AND `entity_id`='" . $o->get("entity_id") . "' ORDER BY `address_type`;"; $DBO->query($sql); $eaddr = $DBO->result("objectlist"); ?>
<?php } ?> <div class="transaction" onclick="app.goto.transaction(<?php echo $row->id; ?> );"> <div class="cell uid"><a href="#"><?php echo $row->uid; ?> </a></div> <div class="cell duedate"><a href="#"><?php echo $row->duedate; ?> </a></div> <div class="cell reference"><a href="#"><?php echo $row->reference; ?> </a></div> <div class="cell amount"><a href="#"><?php echo number_format(array_sum($TRANSACTION->get("calculated_vat")), 2, APP_DECIMAL_SEPARATOR, APP_THOUSAND_SEPARATOR) . " " . $OFFER->get("currency_symbol"); ?> </a></div> </div> <?php $count++; } ?> </div> </div>