Ejemplo n.º 1
0
                $sales->lastYearTransactions($avg_trans);
            } else {
                $sales->lastYearTransactions(0);
            }
            /**
              Sales last year, pro-rated
            */
            $twoQ = str_replace('__table__', $dlog2, $salesQ);
            $twoP = $dbc->prepare($twoQ);
            $twoR = $dbc->execute($twoP, $args);
            while ($row = $dbc->fetch_row($twoR)) {
                $sales->obfCategoryID($row['id']);
                $sales->superID($row['superID']);
                $avg_sales = $row['sales'] / $num_days * 7;
                $sales->lastYearSales($avg_sales);
                if ($future) {
                    $sales->actualSales(0);
                    $labor = $class_lib::getLabor($dbc);
                    $labor->obfWeekID($week->obfWeekID());
                    $labor->obfCategoryID($row['id']);
                    foreach ($labor->find() as $l) {
                        $sales->growthTarget($l->growthTarget());
                    }
                }
                $sales->save();
            }
        }
    }
}
FannieDispatch::conditionalExec();
Ejemplo n.º 2
0
                $this->stats['done']++;
            }
        }
        return $ret;
    }
    function form_content()
    {
        return '<div class="well"><legend>Instructions</legend>
        Upload a CSV or XLS file containing likecode #s and prices. Cost 
        may also optionally be included.
        <br />A preview helps you to choose and map columns to the database.
        <br />The uploaded file will be deleted after the load.
        </div><br />';
    }
    function results_content()
    {
        \COREPOS\Fannie\API\data\SyncLanes::pushTable('products');
        $ret = '<p>Import Complete</p>';
        $ret .= '<div class="alert alert-success">Updated ' . $this->stats['done'] . ' likecodes</div>';
        if (count($this->stats['error']) > 0) {
            $ret .= '<div class="alert alert-danger"><ul>';
            foreach ($this->stats['error'] as $error) {
                $ret .= '<li>' . $error . '</li>';
            }
            $ret .= '</ul></div>';
        }
        return $ret;
    }
}
FannieDispatch::conditionalExec(false);