Changeset 26267


Ignore:
Timestamp:
06/02/10 17:02:14 (7 years ago)
Author:
gudd
Message:

#Refs 1773

  • removed unnecessary distinction of invoice_items
  • added recalculation of invoice_items to projects:workflow
Location:
branches/ragnaroek/midcom
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/ragnaroek/midcom/org.openpsa.invoices/handler/action.php

    r26143 r26267  
    199199        }
    200200        //get invoice_items for this invoice
    201         //first invoice_items without task -> manualy created by user
    202         $this->_request_data['invoice_items_no_task'] = $this->_object->get_invoice_items(false);
    203 
    204         //invoice_items without task
    205         $this->_request_data['invoice_items_task'] = $this->_object->get_invoice_items(true);
    206 
     201        $this->_request_data['invoice_items_no_task'] = $this->_object->get_invoice_items();
    207202
    208203        return true;
  • branches/ragnaroek/midcom/org.openpsa.invoices/handler/crud.php

    r26257 r26267  
    586586        {
    587587            $this->_request_data['invoice_items'] = $this->_object->get_invoice_items();
    588             //merge the arrays to get all invoice_items
    589             $this->_request_data['invoice_items'] = array_merge($this->_request_data['invoice_items'] , $this->_object->get_invoice_items(true));
    590588        }
    591589    }
  • branches/ragnaroek/midcom/org.openpsa.invoices/invoice.php

    r26257 r26267  
    344344     * @param bool task indicates if invoice_item for tasks are wanted
    345345     */
    346     function get_invoice_items($task = false)
     346    function get_invoice_items()
    347347    {
    348348        $qb_invoice_items = org_openpsa_invoices_invoice_item_dba::new_query_builder();
    349349        $qb_invoice_items->add_constraint('invoice' , '=' , $this->id);
    350         if($task)
    351         {
    352             $qb_invoice_items->add_constraint('task' , '>' , 0);
    353         }
    354         else
    355         {
    356             $qb_invoice_items->add_constraint('task' , '=' , 0);
    357         }
    358350
    359351        return $qb_invoice_items->execute();
  • branches/ragnaroek/midcom/org.openpsa.projects/workflow.php

    r25136 r26267  
    394394        // Check how the agreement deals with hour reports
    395395        $check_approvals = false;
     396        $agreement = false;
    396397        if ($task->agreement)
    397398        {
     
    424425        }
    425426
     427        //calculate the invoice_items by actual units if set in agreement
     428        if($agreement)
     429        {
     430            $invoice->_recalculate_invoice_items(array( 0 => $task->id));
     431        }
     432
    426433        // Update hour caches to agreement
    427434        if(!$task->update_cache())
Note: See TracChangeset for help on using the changeset viewer.