示例#1
0
 function save($check_notify = FALSE)
 {
     // If new or duplicate entry, get a quote number otherwise already set.
     $this->number = empty($this->id) ? $this->db->getOne("SELECT count(id)+1 FROM aos_quotes") : $this->number;
     parent::save($check_notify);
     if (isset($_POST['product_id']) && !empty($_POST['product_id'])) {
         $this->saveListItems();
     }
 }
示例#2
0
 function mark_deleted($id)
 {
     $productQuote = new AOS_Products_Quotes();
     $productQuote->mark_lines_deleted($this);
     parent::mark_deleted($id);
 }
 function mark_deleted($id)
 {
     $recordId = $this->id;
     $productQuote = new AOS_Products_Quotes();
     $sql = "SELECT id FROM aos_products_quotes WHERE parent_type = 'AOS_Quotes' AND parent_id = '" . $recordId . "' AND deleted = 0";
     $result = $this->db->query($sql);
     parent::mark_deleted($id);
     while ($row = $this->db->fetchByAssoc($result)) {
         $productQuote->id = $row['id'];
         $productQuote->parent_id = $recordId;
         $productQuote->save();
         $productQuote->mark_deleted($row['id']);
     }
 }