company_id in invoice

Discussion in 'ISPConfig 3 Priority Support' started by Davide, Apr 20, 2017.

  1. Davide

    Davide Member

    Hi

    Not all my clients have a vat_id, so I need to put "company_id" on invoices

    I've tried changing this code in make_pdf_invoice.php:


    > if($invoice['vat_id'] != '') $recipient_lines .= $this->lng('vat_id_no_txt').": ".$invoice['vat_id']."\n";

    with

    < if($invoice['vat_id'] != '') {$recipient_lines .= $this->lng('vat_id_no_txt').": ".$invoice['vat_id']."\n";
    < } elseif($invoice['company_id'] != '') $recipient_lines .= $this->lng('vat_id_no_txt').": ".$invoice['company_id']."\n";

    But it doesn't seem to work. Could you help me with this?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The $invoice array has no company_id field, the company_id field is in the $client array.
     
  3. Davide

    Davide Member

    I changed my code to:

    if($invoice['vat_id'] != '') {$recipient_lines .= $this->lng('vat_id_no_txt').": ".$invoice['vat_id']."\n";
    } elseif($client['company_id'] != '') $recipient_lines .= $this->lng('vat_id_no_txt').": ".$client['company_id']."\n";

    And now it's working perfectly!

    Thank you very much for your help
     
    till likes this.

Share This Page