Esempio n. 1
0
    $insert_data = array(
		'biller_id'		=> $_POST['biller_id'],
		'customer_id'	=> $_POST['customer_id'],
		'type_id'		=> $type,
		'preference_id'	=> $_POST['preference_id'],
		'date'			=> $_POST['date'],
		'note'			=> $_POST['note'],
		'custom_field1'	=> $_POST['customField1'],
		'custom_field2'	=> $_POST['customField2'],
		'custom_field3' => $_POST['customField3'],
		'custom_field4' => $_POST['customField4']
    );
    $saved = $SI_INVOICES->insert($insert_data);
    
	if($saved) {
		$invoice_id = $SI_INVOICES->getLastInsertId();
		saveCustomFieldValues($_POST['categorie'],$invoice_id);
	}

    /*
    * 1 = Total Invoices
    */

	if($type==1 && $saved) {
		(isset($_POST['enabled'])) ? $enabled = $_POST['enabled']  : $enabled = $enabled ;
        (isset($_POST['visible'])) ? $visible = $_POST['visible']  : $visible = $visible ;
        
        $data = array(
            'description'       => $_POST['description'],
            'detail'            => $_POST['detail'],
            'unit_price'        => $_POST['unit_price'],
Esempio n. 2
0
    $insert_data = array(
		'biller_id'		=> $_POST['biller_id'],
		'customer_id'	=> $_POST['customer_id'],
		'type_id'		=> $type,
		'preference_id'	=> $_POST['preference_id'],
		'date'			=> $_POST['date'],
		'note'			=> $_POST['note'],
		'custom_field1'	=> $_POST['customField1'],
		'custom_field2'	=> $_POST['customField2'],
		'custom_field3' => $_POST['customField3'],
		'custom_field4' => $_POST['customField4']
    );
    $saved = $SI_INVOICES->insert($insert_data);
    
    if ($saved) {
    	$id = $SI_INVOICES->getLastInsertId();
    }

    /*
    * 1 = Total Invoices
    */

	if($type==total_invoice && $saved) {

		$logger->log('Total style invoice created, ID: '.$id, Zend_Log::INFO);

        $data = array(
            'description'       => $_POST['description'],
            'detail'            => $_POST['detail'],
            'unit_price'        => $_POST['unit_price'],
            'default_tax_id'    => $_POST['default_tax_id'],