salesCalc.js
// using data from all existing ShopLocation objects

using data from all existing ShopLocation objects
using data from all existing ShopLocation objects
function hrlyTotals() {
    var footVals = [];
    var hourlyTotal;
    var allTotal = 0;
    for (var i = 0; i < openHours.length; i++) {
        hourlyTotal = 0;
        for (var j = 0; j < ShopLocation.allLocations.length; j++) {
            hourlyTotal += ShopLocation.allLocations[j].hrlyCookEstimate[i];
        }
        footVals.push(hourlyTotal);
        console.log('hourly total calced as ' + hourlyTotal);
        allTotal += hourlyTotal;
        console.log('allTotal is now ' + allTotal);
    }
    footVals.push(allTotal);
    console.log('footVals is ' + footVals);
    return footVals;
}
function hrlyTotals ( ) { var footVals = [ ] ; var hourlyTotal ; var allTotal = 0 ; for ( var i = 0 ; i < openHours . length ; i ++ ) { hourlyTotal = 0 ; for ( var j = 0 ; j < ShopLocation . allLocations . length ; j ++ ) { hourlyTotal += ShopLocation . allLocations [ j ] . hrlyCookEstimate [ i ] ; } footVals . push ( hourlyTotal ) ; console . log ( 'hourly total calced as ' + hourlyTotal ) ; allTotal += hourlyTotal ; console . log ( 'allTotal is now ' + allTotal ) ; } footVals . push ( allTotal ) ; console . log ( 'footVals is ' + footVals ) ; return footVals ; }
using data from all existing ShopLocation objects
using data from all existing ShopLocation objects