projects
/
order_line_extra.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'add_jquery_sortable'
[order_line_extra.git]
/
haxe
/
ItemScheduler.hx
diff --git
a/haxe/ItemScheduler.hx
b/haxe/ItemScheduler.hx
index e286bc0bc98277235b0cb498f0c7f5c54f99c50a..be596ac4d121b87f0f547ed3e59984c3c4dbf2fd 100644
(file)
--- a/
haxe/ItemScheduler.hx
+++ b/
haxe/ItemScheduler.hx
@@
-42,6
+42,10
@@
class FA {
static public function tb() : String {
return untyped __php__('TB_PREF');
}
static public function tb() : String {
return untyped __php__('TB_PREF');
}
+
+ static public function sql2date(sqlDate:Dynamic) : Null<Date> {
+ return sqlDate == null ? null : Date.fromString(sqlDate);
+ }
}
class ItemScheduler {
var stock_id:String;
}
class ItemScheduler {
var stock_id:String;
@@
-54,7
+58,7
@@
class ItemScheduler {
}
function tableHeader() {
}
function tableHeader() {
- return ["Order", "Customer", "Quantity", "Before", "After", "Loc", "From", "Required Date"];
+ return ["Order", "Customer", "Quantity", "Before", "After", "Loc", "From", "Required Date"
, "Comment"
];
}
/*
}
/*
@@
-112,16
+116,19
@@
class ItemScheduler {
function printRow(tds : Array<Dynamic>, attributes : Array<String>) {
php.Lib.print('<tr '+attributes.join(' ')+'>');
function printRow(tds : Array<Dynamic>, attributes : Array<String>) {
php.Lib.print('<tr '+attributes.join(' ')+'>');
+ var position : Int = 1;
for(td in tds) {
for(td in tds) {
- php.Lib.print('<td>');
- php.Lib.print(td);
+ php.Lib.print('<td
class="cell_'+position+'"
>');
+
if(td)
php.Lib.print(td);
php.Lib.print('</td>');
php.Lib.print('</td>');
+ position++;
}
php.Lib.print('</tr>');
}
function formatOrder(order : Dynamic, left : Int, date : Date) {
}
php.Lib.print('</tr>');
}
function formatOrder(order : Dynamic, left : Int, date : Date) {
- var attributes = [];
+ var row_id = 'order_'+order.id;
+ var attributes = ['id = "'+row_id+'"'];
var classes = [];
var before : Int = left + order.quantity;
/* We have basically 3 different cases;
var classes = [];
var before : Int = left + order.quantity;
/* We have basically 3 different cases;
@@
-142,10
+149,18
@@
class ItemScheduler {
/* The order can also be late if we need
* to wait for a delivery to get it
*/
/* The order can also be late if we need
* to wait for a delivery to get it
*/
+ var required_by : Date = FA.sql2date(order.required_date);
+ if(required_by == null) required_by = FA.sql2date(order.delivery_date);
+ if(required_by.getTime() < date.getTime()) {
+ classes.push('late');
+ }
+ else {
+ classes.push('on_time');
+ }
var cells : Array <Dynamic> = [
order.order_id
var cells : Array <Dynamic> = [
order.order_id
- ,
order.deliver_to
- ,order.quantity
+ ,
'<a href="/modules/order_line_extra/order_lines_view.php?customer_id='+Std.string(order.debtor_no)+'">'+order.deliver_to+'</a>'
+ ,'<input type="text" name="'+row_id+'[quantity]" value="'+order.quantity+'">'
,before
,left
,order.from_stk_loc
,before
,left
,order.from_stk_loc
@@
-170,7
+185,7
@@
class ItemScheduler {
var cells : Array<Dynamic> = [
array.get('order_id')
,array.get('deliver_to')
var cells : Array<Dynamic> = [
array.get('order_id')
,array.get('deliver_to')
- ,
quantity
+ ,
'<input type="text" name="quantity">'+quantity+'</input>'
,quantity_available-quantity
,quantity_available
,array.get('from_stk_loc')
,quantity_available-quantity
,quantity_available
,array.get('from_stk_loc')
@@
-197,9
+212,11
@@
class ItemScheduler {
,left
,location.code
,location.delivery
,left
,location.code
,location.delivery
+ ,""
+ ,""
];
];
- printRow(cells, ['class = "tableheader location"']);
+ printRow(cells, ['class = "tableheader location"'
, 'id = "loc_'+location.code+'"'
]);
}
/*
}
/*