Add link to customer order view.
[order_line_extra.git] / haxe / Location.hx
1 /*
2 enum Either<U,V> {
3         
4 };
5 */
6 class Location {
7         public var code : String;
8         public var name : String;
9         public var comment : String;
10         public var delivery: Date;
11
12         private var qoh_cache : Int;
13         private var stock_id_cache : String;
14
15         public function new(row : Dynamic) {
16                 var obj = php.Lib.objectOfAssociativeArray(row);
17                 code = obj.loc_code;
18                 name = obj.location_name;
19                 comment = obj.delivery_address;
20                 delivery = Date.fromString("2013-06-10");
21         }
22
23         public function quantityOnHand(stock_id, date) : Null<Int> {
24                 if(qoh_cache == null || stock_id != stock_id_cache) {
25                         qoh_cache =  untyped __call__('get_qoh_on_date', stock_id,  code, date);
26                         stock_id_cache = stock_id;
27                 }
28                 return qoh_cache;
29         }
30 }