public function add(array $data)
    {
        $defaults = array(
            "description" => null,
            "price"       => null,
            "discount"    => null,
            "qty"         => 1,
            "unit"        => null
        );

        $merged = array_merge($defaults, $data);

        $line = $this->create($this->invoiceHandle);

        if( isset($merged['product']) )
        {
            $this->product($line, $merged['product']);
            unset( $merged['product'] );
        }

        return $this->update($data, $line);
    }
public function add(array $data)
    {
        $defaults = array(
            "description" => null,
            "price"       => null,
            "discount"    => null,
            "qty"         => 1,
            "unit"        => null
        );

        $merged = array_merge($defaults, $data);

        $line = $this->create($this->invoiceHandle);

        if( isset($merged['product']) )
        {
            $this->product($line, $merged['product']);
            unset( $merged['product'] );
        }

        return $this->update($data, $line);
    }
public function add ( array $ data ) { $ defaults = array ( "description" => null , "price" => null , "discount" => null , "qty" => 1 , "unit" => null ) ; $ merged = array_merge ( $ defaults , $ data ) ; $ line = $ this -> create ( $ this -> invoiceHandle ) ; if ( isset ( $ merged [ 'product' ] ) ) { $ this -> product ( $ line , $ merged [ 'product' ] ) ; unset ( $ merged [ 'product' ] ) ; } return $ this -> update ( $ data , $ line ) ; }
Add Invoice line
@param array $data
Add Invoice line