CORE POS - Fannie
The CORE POS back end
|
Public Member Functions | |
preprocess () | |
report_description_content () | |
fetch_report_data () | |
form_content () | |
Public Member Functions inherited from FannieReportPage | |
preprocess () | |
form_content () | |
bodyContent () | |
report_content () | |
both_content () | |
calculate_footers ($data) | |
assign_headers () | |
select_headers ($incrIndex=False) | |
report_description_content () | |
report_end_content () | |
fetch_report_data () | |
render_data ($data, $headers=array(), $footers=array(), $format='html') | |
dekey_array ($arr) | |
htmlLine ($row, $header=False) | |
csvLine ($row) | |
excelFormat ($item, $style='') | |
xlsMeta ($data) | |
setForm (COREPOS\common\mvc\ValueContainer $f) | |
requiredFields () | |
drawPage () | |
draw_page () | |
baseUnitTest ($phpunit) | |
Public Attributes | |
$page_set = 'Plugin :: Open Book Financing' | |
$report_set = 'Sales Reports' | |
$description = '[OBF Weekly Report] shows open book financing sales and labor data for a given week.' | |
$themed = true | |
Public Attributes inherited from FannieReportPage | |
$required = True | |
$description | |
$page_set = 'Reports' | |
$report_set = '' | |
$discoverable = true | |
const | META_BOLD = 1 |
const | META_BLANK = 2 |
const | META_REPEAT_HEADERS = 4 |
const | META_CHART_DATA = 8 |
const | META_COLOR = 16 |
Protected Member Functions | |
initTotalSales () | |
initTotalTrans () | |
initTotalHours () | |
initTotalWages () | |
getAverageWage ($labor) | |
projectHours ($splhGoal, $dept_proj, $dept_trend) | |
projectWages ($labor, $proj_hours, $trend_hours) | |
rewritePercentageOfSales ($data, $total_sales) | |
headerRow ($header, $text='black') | |
percentGrowth ($a, $b) | |
findYearMonth ($start_ts, $end_ts) | |
updateSalesCache ($week, $num_cached, $dateInfo) | |
prepareStatements ($dbc) | |
prepTrendsStatement ($dbc, $week) | |
getStock ($dbc, $args) | |
ownershipThisWeek ($dbc, $start_ts, $end_ts, $start_ly, $end_ly) | |
ownershipThisYear ($dbc, $end_ts) | |
calculateTrend ($dbc, $categoryID, $superID) | |
Protected Member Functions inherited from FannieReportPage | |
hasAllFields ($fields) | |
hasWarehouseSource () | |
getData () | |
multiContent ($data) | |
singleContent ($data) | |
format ($data) | |
checkDataCache () | |
freshenCache ($data) | |
defaultDescriptionContent ($rowcount, $datefields=array()) | |
formatCheck () | |
Protected Attributes | |
$header = 'OBF: Weekly Report' | |
$title = 'OBF: Weekly Report' | |
$required_fields = array('weekID') | |
$new_tablesorter = false | |
$report_headers | |
$class_lib = 'ObfLib' | |
$colors | |
$salesP = null | |
$quarterSalesP = null | |
$quarterLaborP = null | |
$quarterSplhP = null | |
$stockP = null | |
$trendP = null | |
Protected Attributes inherited from FannieReportPage | |
$content_function = "form_content" | |
$required_fields = array() | |
$report_headers = array() | |
$report_format = 'html' | |
$report_cache = 'none' | |
$multi_report_mode = False | |
$multi_counter = 1 | |
$header_index = 0 | |
$sortable = true | |
$no_sort_but_style = false | |
$sort_column = 0 | |
$sort_direction = 0 | |
$new_tablesorter = false | |
$no_jquery = false | |
$chart_label_column = 0 | |
$chart_data_columns = array() | |
$form | |
ObfWeeklyReport::fetch_report_data | ( | ) |
Timestamps for the start and end of the current week
Use the entire month from the previous calendar year as the time period for year-over-year comparisons
Sales information is cached to avoid expensive aggregate queries
LOOP ONE Examine OBF Categories that have sales. These will include both sales and labor information
Go through sales records for the category
total sales for the category
Now labor values based on sales calculationsabove
LOOP TWO Examine OBF Categories without sales. These will include only labor information
Storewide totals section
|
protected |
Determine which month a given week falls in. If the first and last day of the week are not in the same month, choose whichever month 4+ days of the week belong to
|
protected |
Information about labor hours
See sales above for more info about "Quarters"
|
protected |
Information about sales
"Quarter" is not necessarily a calendar quarter. It's whatever period is currently defined for the "long-term" over under column. This period can be defined separately for sales and labor. A separate sales number is always tracked in concert with the long-term labor period so that the long-term sales per labor hour number makes sense.
|
protected |
Information about number of transactions
See sales above for more info about "Quarters"
|
protected |
Information about wages. Fields are the same as hours.
|
protected |
Look up sales for the week in a given category
Look up sales for the [sales] quarter in a given category
Look up labor for the [labor] quarter in a given category
Look up sales for the [labor] quarter in a given category
Since the "quarter" can differ for long-term sales and long-term labor, this value is needed to calculate long-term SPLH correctly.
|
protected |
Trends are based on the previous thirteen weeks that contain sales data. First build a list of week IDs, then prepare statement to query a specific category of sales data.
|
protected |
Now that total sales for the all categories have been calculated, go back and divide specific columns by total sales to get percentage of sales
|
protected |
Lookup total sales for each category in a given date range
Lookup number of transactions in a given date range
Lookup tables for current week and year-over-year comparison
Lookup number of transactions for the current week and save that information if the week is complete
Lookup sales for the current week. Actual sales is zeroed out until the week is complete, but the records are saved as placeholders for later
Now lookup year-over-year info Since it examines a whole month rather than a single week, we'll take the average and then extend that out to seven days
Transactions last year, pro-rated
Sales last year, pro-rated
plugged new store numbers
|
protected |
|
protected |