}
+function aggregate_comment($row) {
+ $comment = $row['order_comment'].$row['detail_comment'];
+ if($comment) {
+ $comments = array_map('trim', explode(';', $comment));
+ $comments = array_filter($comments);
+ $first = array_shift($comments);
+ if(count($comments) == 0)
+ return $first;
+ else {
+ $tooltip = implode('<br>', $comments);
+ return "$first <span class='before-tooltip'>more</span><span class='tooltip'> $tooltip</span>";
+ }
+ }
+ return '';
+}
+
function input_date_details($row, $date) {
$row_id = $row['id'];
$name = compute_input_name($row, 'required_date');
, stk_code
, quantity - qty_sent
, required_date
- , comment
+ ,comment
FROM ".TB_PREF."sales_order_details sod
JOIN ".TB_PREF."sales_orders so ON (so.order_no = sod.order_no
AND so.trans_type = sod.trans_type
, sum(quantity - qty_sent) as quantity
, sum((quantity - qty_sent)*unit_price*(1-discount_percent/100)) as amount
, min(required_date)
- , min(comment)
+ , group_concat(distinct comments separator ';') as order_comment
+ , group_concat(distinct comment separator ';') as detail_comment
FROM ".TB_PREF."sales_order_details sod
JOIN ".TB_PREF."sales_orders so ON (so.order_no = sod.order_no
AND so.trans_type = sod.trans_type
start_row();
-if(isset($_GET['customer_id']) && !isset($_POST['customer_id'])) $_POST['customer_id']=$_GET['customer_id'];
-$customer_id = $_POST['customer_id'];
+if(!isset($_POST['customer_id'])) {
+ if(isset($_GET['customer_id'])) {
+ $customer_id = $_GET['customer_id'];
+ }
+else $customer_id = null;
+
+}
+else {
+ $customer_id = $_POST['customer_id'];
+}
customer_list_cells(_("Select a customer: "), 'customer_id', $customer_id, true, true);
'customer id' => 'skip',
_("Customer") => array('ord' => '', 'fun' => 'customer_link'),
_("Branch") => array('ord' => ''),
-_("Delivery Date") => array('ord' => ''),
+_("Delivery Date") => array('ord' => '', 'type' => 'date'),
_("Quantity") => array('ord' => ''),
_("Amount") => array('ord' => '', 'type' => 'amount'),
_("required date") => array('ord' => '', 'type' => 'date'),
-_("comment") => array('ord' => ''),
+_("Comments") => array('ord' => '', 'fun' => 'aggregate_comment'),
+_("comment 2 ") => 'skip'
);
}
end_form();
end_page();
?>
+<style>
+span.tooltip{ display:none;}
+span.tooltip {
+ position: absolute;
+ width: 200px;
+ color: rgb(113, 157, 171);
+ background: rgb(255, 255, 255);
+ border: 1px solid rgb(113, 157, 171);
+}
+.toto {
+ height: 20px;
+ line-height: 20px;
+ padding: 10px;
+ font-size: 14px;
+ text-align: center;
+ border: 4px solid rgb(255, 255, 255);
+ border-radius: 5px;
+ text-shadow: rgba(0, 0, 0, 0.1) 1px 1px 1px;
+ box-shadow: rgba(0, 0, 0, 0.1) 1px 1px 2px 0px;
+}
+
+:hover + span.tooltip, span.tooltip:hover {
+ display: inline;
+}
+span.before-tooltip {
+ color: #800;
+ font-style: italic;
+}
+
+</style>