-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
146 additions
and
139 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
<? | ||
include '../scat.php'; | ||
include '../lib/catalog.php'; | ||
|
||
$name= $_REQUEST['name']; | ||
$slug= $_REQUEST['slug']; | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
<?php | ||
require '../scat.php'; | ||
require '../lib/catalog.php'; | ||
|
||
$verbose= (int)$_REQUEST['verbose']; | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
<?php | ||
require '../scat.php'; | ||
require '../lib/catalog.php'; | ||
|
||
$id= (int)$_REQUEST['id']; | ||
|
||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
<? | ||
include '../scat.php'; | ||
include '../lib/catalog.php'; | ||
|
||
$id= (int)$_REQUEST['id']; | ||
$name= $_REQUEST['name']; | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
<?php | ||
require '../scat.php'; | ||
require '../lib/catalog.php'; | ||
|
||
$parent= (int)$_REQUEST['parent']; | ||
|
||
|
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
<? | ||
include '../scat.php'; | ||
include '../lib/catalog.php'; | ||
|
||
$name= $_REQUEST['name']; | ||
$slug= $_REQUEST['slug']; | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
<? | ||
include '../scat.php'; | ||
include '../lib/catalog.php'; | ||
|
||
$term= $_REQUEST['term']; | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
<? | ||
include '../scat.php'; | ||
include '../lib/catalog.php'; | ||
|
||
$id= (int)$_REQUEST['id']; | ||
$name= $_REQUEST['name']; | ||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
<? | ||
require 'scat.php'; | ||
require 'lib/catalog.php'; | ||
|
||
head("Brands @ Scat", true); | ||
|
||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
<? | ||
require 'scat.php'; | ||
require 'lib/catalog.php'; | ||
|
||
$id= (int)$_REQUEST['id']; | ||
|
||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
<? | ||
require 'scat.php'; | ||
require 'lib/catalog.php'; | ||
|
||
head("Search Catalog @ Scat", true); | ||
|
||
|
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
namespace Scat; | ||
|
||
class Brand extends \Model { | ||
public function products() { | ||
return $this->has_many('Product'); | ||
} | ||
} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
namespace Scat; | ||
|
||
class Department extends \Model { | ||
public function parent() { | ||
return $this->belongs_to('Department', 'parent_id'); | ||
} | ||
|
||
public function departments() { | ||
return $this->has_many('Department', 'parent_id'); | ||
} | ||
|
||
public function products() { | ||
return $this->has_many('Product'); | ||
} | ||
} | ||
|
||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<? | ||
namespace Scat; | ||
|
||
class Item extends \Model { | ||
/* XXX Legacy, should get from parent product */ | ||
public function brand() { | ||
return $this->belongs_to('Brand', 'brand'); | ||
} | ||
|
||
public function product() { | ||
return $this->belongs_to('Product'); | ||
} | ||
|
||
public function barcodes() { | ||
return $this->has_many('Barcode', 'item'); | ||
} | ||
} | ||
|
||
class Barcode extends \Model { | ||
public function item() { | ||
return $this->belongs_to('Item', 'item'); | ||
} | ||
} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
namespace Scat; | ||
|
||
class Note extends \Model { | ||
public function person() { | ||
return $this->belongs_to('Person'); | ||
} | ||
|
||
public function parent() { | ||
return $this->belongs_to('Note', 'parent_id'); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
namespace Scat; | ||
|
||
class Payment extends \Model { | ||
public static $methods= array( | ||
'cash' => "Cash", | ||
'change' => "Change", | ||
'credit' => "Credit Card", | ||
'square' => "Square", | ||
'stripe' => "Stripe", | ||
'gift' => "Gift Card", | ||
'check' => "Check", | ||
'dwolla' => "Dwolla", | ||
'paypal' => "PayPal", | ||
'discount' => "Discount", | ||
'bad' => "Bad Debt", | ||
'donation' => "Donation", | ||
'withdrawal' => "Withdrawal", | ||
'internal' => "Internal", | ||
); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
namespace Scat; | ||
|
||
class Product extends \Model implements \JsonSerializable { | ||
public function brand() { | ||
return $this->belongs_to('Brand'); | ||
} | ||
|
||
public function items() { | ||
return $this->has_many('Item') | ||
->select('item.*') | ||
->select_expr('sale_price(item.retail_price, | ||
item.discount_type, | ||
item.discount)', | ||
'sale_price') | ||
->select_expr('(SELECT IFNULL(SUM(allocated),0) | ||
FROM txn_line | ||
WHERE txn_line.item = item.id)', | ||
'stock'); | ||
} | ||
|
||
public function jsonSerialize() { | ||
return $this->asArray(); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
namespace Scat; | ||
|
||
/* XXX add relationships, but just using these raw for now */ | ||
|
||
class Txn extends \Model { | ||
} | ||
|
||
class TxnLine extends \Model { | ||
} | ||
|
||
class PriceOverride extends \Model { | ||
} |
Oops, something went wrong.