projects
/
Pman.Xtuple
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5585fb9
)
DataObjects/Ipshead.php
author
Alan Knowles
<alan@roojs.com>
Mon, 30 Mar 2015 04:58:31 +0000
(12:58 +0800)
committer
Alan Knowles
<alan@roojs.com>
Mon, 30 Mar 2015 04:58:31 +0000
(12:58 +0800)
DataObjects/Ipshead.php
patch
|
blob
|
history
diff --git
a/DataObjects/Ipshead.php
b/DataObjects/Ipshead.php
index
e7e46a1
..
e3b6618
100644
(file)
--- a/
DataObjects/Ipshead.php
+++ b/
DataObjects/Ipshead.php
@@
-74,7
+74,16
@@
class Pman_Xtuple_DataObjects_Ipshead extends DB_DataObject
function beforeDelete($dependants_array, $roo)
{
function beforeDelete($dependants_array, $roo)
{
- print_R($dependants_array);exit;
+ // check if assigned.
+
+ $ass = DB_DataObject::factory('ipass');
+ $ass->ipsass_ipshead_id = $this->ipshead_id;
+ if ($ass->count()) {
+ $roo->jerr("This price list is assigned to a customer - please change that customer to another price list first");
+ }
+ $ass = DB_DataObject::factory('ipsiteminfo');
+ $ass->query("DELETE FROM ipsiteminfo WHERE ipsiteminfo_ipshead_id = {$this->id}");
+ return true;
}
}