You are here

function pminvoice_insert in Drupal PM (Project Management) 7

Implements hook_insert().

1 call to pminvoice_insert()
pminvoice_update in pminvoice/pminvoice.module
Implements hook_update().

File

pminvoice/pminvoice.module, line 511
1: Hooks (help, perm, init, menu, theme, node_info) 2: Access functions 3: Load organization and project details 4: Invoice create / edit form 5: Invoice node manipulation functions 6: Admin settings 7: Views hook 8: Project Managementinvoiceitem…

Code

function pminvoice_insert($node) {
  _pminvoice_beforesave($node);
  $node->taxexempt = isset($node->taxexempt) ? $node->taxexempt : NULL;
  $node->src_nid = isset($node->src_nid) ? $node->src_nid : NULL;
  $node->src_vid = isset($node->src_vid) ? $node->src_vid : NULL;
  db_insert('pminvoice')
    ->fields(array(
    'vid' => $node->vid,
    'nid' => $node->nid,
    'number' => $node->number,
    'reference' => $node->reference,
    'organization_nid' => $node->organization_nid,
    'organization_title' => $node->organization_title,
    'project_nid' => $node->project_nid,
    'project_title' => $node->project_title,
    'taxexempt' => $node->taxexempt,
    'src_nid' => $node->src_nid,
    'src_vid' => $node->src_vid,
  ))
    ->execute();

  // Insert invoice items
  _pminvoice_insert_items($node);
  _pminvoice_aftersave($node);
}