CORE POS - IS4C
The CORE POS front end
Static Public Member Functions | Static Public Attributes | List of all members
PrehLib Class Reference
Inheritance diagram for PrehLib:
LibraryClass

Static Public Member Functions

static clearMember ()
 
static memberID ($member_number)
 
static requestInfoCallback ($info)
 
static setAltMemMsg ($store, $member, $personNumber, $row, $chargeOk)
 
static setMember ($member, $personNumber, $row=array())
 
static checkUnpaidAR ($cardno)
 
static check_unpaid_ar ($cardno)
 
static checkstatus ($num)
 
static tender ($right, $strl)
 
static deptkey ($price, $dept, $ret=array())
 
static ttl ()
 
static omtr_ttl ()
 
static wicableTotal ()
 
static peekItem ($full_record=false)
 
static finalttl ()
 
static fsEligible ()
 
static percentDiscount ($strl, $json=array())
 
static chargeOk ()
 

Static Public Attributes

static $requestInfoHeader = 'member gift'
 
static $requestInfoMsg = 'Card for which member?'
 

Detailed Description

A horrible, horrible catch-all clutter of functions

Member Function Documentation

static PrehLib::chargeOk ( )
static

Check whether the current member has store charge balance available.

Returns
1 - Yes 0 - No

Sets current balance in session as "balance". Sets available balance in session as "availBal".

static PrehLib::checkstatus (   $num)
static

Check if an item is voided or a refund

Parameters
$numitem trans_id in localtemptrans
Returns
array of status information with keys:
  • voided (int)
  • scaleprice (numeric)
  • discountable (int)
  • discounttype (int)
  • caseprice (numeric)
  • refund (boolean)
  • status (string)
static PrehLib::checkUnpaidAR (   $cardno)
static

Check if the member has overdue store charge balance

Parameters
$cardnomember number
Returns
True or False

The logic for what constitutes past due has to be built into the unpaid_ar_today view. Without that this function doesn't really do much.

static PrehLib::clearMember ( )
static

Remove member number from current transaction

static PrehLib::deptkey (   $price,
  $dept,
  $ret = array() 
)
static

Add an open ring to a department

Parameters
$priceamount in cents (100 = $1)
$deptPOS department an array of return values
Returns
An array. See Parser::default_json() for format explanation.

Enforce memberOnly flag

static PrehLib::finalttl ( )
static

Add tax and transaction discount records. This is called at the end of a transaction. There's probably no other place where calling this function is appropriate.

static PrehLib::fsEligible ( )
static

Add foodstamp elgibile total record

static PrehLib::memberID (   $member_number)
static

Begin setting a member number for a transaction

Parameters
$member_numberCardNo from custdata
Returns
An array. See Parser::default_json() for format.

This function will either assign the number to the current transaction or return a redirect request to get more input. If you want the cashier to verify member name from a list, use this function. If you want to force the number to be set immediately, use setMember().

If only a single record exists for the member number, the member will be set immediately if:

  • the account is the designated, catchall non-member
  • the verifyName setting is disabled

Go to member search page in all other cases. If zero matching records are found, member search should be next. If multiple records are found, picking the correct name should be next. If verifyName is enabled, confirming the name should be next.

static PrehLib::omtr_ttl ( )
static

Total the transaction, which the cashier thinks may be eligible for the Ontario Meal Tax Rebate.

Returns
True - total successfully String - URL

If ttl() returns a string, go to that URL for more information on the error or to resolve the problem.

The most common error, by far, is no member number in which case the return value is the member-entry page.

The Ontario Meal Tax Rebate refunds the provincial part of the Harmonized Sales Tax if the total of the transaction is not more than a certain amount.

If the transaction qualifies, change the tax status for each item at the higher rate to the lower rate. Display a message that a change was made. Otherwise display a message about that. Total the transaction as usual.

static PrehLib::peekItem (   $full_record = false)
static

See what the last item in the transaction is currently

Parameters
$full_record[boolean] return full database record. Default is false. Just returns description.
Returns
localtemptrans.description for the last item or localtemptrans record for the last item

If no record exists, returns false

static PrehLib::percentDiscount (   $strl,
  $json = array() 
)
static

Add a percent discount notification

Parameters
$strldiscount percentage
$jsonkeyed array
Returns
An array see Parser::default_json()
Deprecated:
Use discountnotify() instead. This just adds hard-coded percentages and PLUs that likely aren't applicable anywhere but the Wedge.
static PrehLib::setAltMemMsg (   $store,
  $member,
  $personNumber,
  $row,
  $chargeOk 
)
static

Assign store-specific alternate member message line

Parameters
$storecode for the coop
$memberCardNo from custdata
$personNumberpersonNum from custdata
$rowa record from custdata
$chargeOkwhether member can store-charge purchases
static PrehLib::setMember (   $member,
  $personNumber,
  $row = array() 
)
static

Assign a member number to a transaction

Parameters
$memberCardNo from custdata
$personNumberpersonNum from custdata

See memberID() for more information.

Look up the member information here. There's no good reason to have calling code pass in a specially formatted row of data

Optinonally use memtype table to normalize attributes by member type

Determine what string is shown in the upper left of the screen to indicate the current member

Set member number and attributes in the current transaction

Add the member discount

Log the member entry

Optionally add a subtotal line depending on member_subtotal setting.

static PrehLib::tender (   $right,
  $strl 
)
static

Add a tender to the transaction

tender amount in cents (100 = $1) tender code from tenders table

Returns
An array see Parser::default_json() for format explanation.

This function will automatically end a transaction if the amount due becomes <= zero.

First use base module to check for error conditions common to all tenders

Get a tender-specific module if one has been configured

Fetch module mapping from the database if the schema supports it 16Mar2015

Do tender-specific error checking and prereqs

static PrehLib::ttl ( )
static

Total the transaction

Returns
True - total successfully String - URL

If ttl() returns a string, go to that URL for more information on the error or to resolve the problem.

The most common error, by far, is no member number in which case the return value is the member-entry page.

static PrehLib::wicableTotal ( )
static

Calculate WIC eligible total

Returns
[number] WIC eligible items total

The documentation for this class was generated from the following file: