This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('glassFactory').filter('gfHumanResourcesValue', function (currentProjectPlan, zoomLevel) { | |
function fUtil(val) { | |
console.log('fUtil', currentProjectPlan.settings.utilization, val) | |
switch (currentProjectPlan.settings.utilization) { | |
case 'perc': | |
return val + '%' | |
case 'mh': | |
return 8 * val / 100 + 'mh' | |
case 'md': | |
return val / 100 + 'md' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def call | |
@all_dishes = [] | |
# У нас есть требование чтобы одно блюдо встречалось не более трех раз в неделю | |
# Таким образом получается что нам нужно подобрать 3 рациона на пн, вт, ср | |
# а дальше мы просто повторим их же | |
variants = 3.times.map do | |
# недобор или перебор по конкретным материалам, изначально все в 0 | |
@diff = {} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
spree_orders.number, | |
date_trunc('day', spree_orders.completed_at at time zone 'utc' at time zone 'edt') as date, | |
total - additional_tax_total as revenue, | |
cost_total as items_cost, | |
COALESCE(SUM(shipping_cost), 0) as shipping_cost, | |
ARRAY_AGG(DISTINCT spree_suppliers.name) as suppliers | |
FROM "spree_orders" | |
LEFT JOIN "supplier_orders" ON "supplier_orders"."spree_order_id" = "spree_orders"."id" | |
LEFT JOIN "supplier_shipments" ON "supplier_shipments"."order_id" = "supplier_orders"."id" |