From d4657264166ab67353e9d787d5f8449aa7b997c5 Mon Sep 17 00:00:00 2001 From: Maxime Bourget Date: Thu, 30 May 2013 17:05:01 +0100 Subject: [PATCH] Formatting table --- haxe/ItemScheduler.hx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/haxe/ItemScheduler.hx b/haxe/ItemScheduler.hx index 8922be4..0446983 100644 --- a/haxe/ItemScheduler.hx +++ b/haxe/ItemScheduler.hx @@ -54,9 +54,10 @@ class ItemScheduler { } function tableHeader() { - return ["Order", "Customer", "Quantity", "Left", "On Hand", "Loc", "Required Date"]; + return ["Order", "Customer", "Quantity", "Before", "After", "Loc", "Required Date"]; } +/* function generateTablex(): Void { for(location in locations()) { formatLocation(location, null); @@ -65,6 +66,7 @@ class ItemScheduler { this.formatRow(order); } } +*/ function generateTable(): Void { var startDate = Date.fromTime(0); @@ -84,7 +86,7 @@ class ItemScheduler { var location = locationIter.next(); var qoh : Int = location.quantityOnHand(stock_id, null); var left = qoh; - formatLocation(location, left); + formatLocation(location, "Initial", left); // We display the order ordered by priority // But insert the location when needed (meaning @@ -98,8 +100,7 @@ class ItemScheduler { var quantityForLocation : Int = location.quantityOnHand(stock_id, null); if(quantityForLocation == null || quantityForLocation == 0) continue; left += quantityForLocation; - trace(quantityForLocation); - formatLocation(location, left); + formatLocation(location, "Delivery", left); } left -= quantity; @@ -163,12 +164,14 @@ class ItemScheduler { } - function formatLocation(location : Location, left : Int) { + function formatLocation(location : Location, type: String, left : Int) { var cells = [ - location.code + type ,location.name ,location.quantityOnHand(stock_id, null) + ,left-location.quantityOnHand(stock_id, null) ,left + ,location.code ,location.delivery ]; var status = 'header'; -- 2.30.2