Example #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) FROM aos_invoices") : $this->number;
     parent::save($check_notify);
     if (isset($_POST['product_id']) && !empty($_POST['product_id'])) {
         $this->saveListItems();
     }
 }
 function mark_deleted($id)
 {
     $recordId = $this->id;
     $productQuote = new AOS_Products_Quotes();
     $sql = "SELECT id FROM aos_products_quotes WHERE parent_type = 'AOS_Invoices' 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']);
     }
 }
Example #3
0
 function mark_deleted($id)
 {
     $productQuote = new AOS_Products_Quotes();
     $productQuote->mark_lines_deleted($this);
     parent::mark_deleted($id);
 }