$id_title = $invoice["concept1"]; $data[1] = "<a title='$id_title' href='index.php?sec=customers&sec2=operation/companies/company_detail&view_invoice=1&id=".$invoice["id_company"]."&op=invoices&id_invoice=".$invoice["id"]."'>".$invoice["bill_id"]."</a>"; $amount = get_invoice_amount ($invoice["id"]); $discount_before = get_invoice_discount_before ($invoice["id"]); $tax = get_invoice_tax ($invoice["id"]); $taxlength = count($tax); $contador = 1; $result = 0; foreach ( $tax as $key => $campo) { $result = $result + $campo; $contador++; } $tax = $result; $irpf = get_invoice_irpf($invoice["id"]); //~ Descuento sobre el total $before_amount = $amount * ($discount_before/100); $total_before = round($amount - $before_amount, 2); //~ Se aplica sobre el descuento los task $tax_amount = $total_before * ($tax/100); //~ Se aplica sobre el descuento el irpf $irpf_amount = $total_before * ($irpf/100); $total = round($total_before + $tax_amount - $irpf_amount, 2); $final_total[strtoupper ($invoice["currency"])] += $total; $data[2] = $total; if (($tax != 0) && ($clean_output == 0)) $data[2] .= print_help_tip (__("With taxes"). ": ". format_numeric($amount,2), true);
echo '<h3 class="suc">'.__('Custom search saved').'</h3>'; echo '</div>'; if ($id_invoice != -1) { $amount = get_invoice_amount ($id_invoice); $discount_before = get_invoice_discount_before ($id_invoice); $tax = get_invoice_tax ($id_invoice); $taxlength = count($tax); $contador = 1; $result = 0; foreach ( $tax as $key => $campo) { $result = $result + $campo; $contador++; } $tax = $result; $irpf = get_invoice_irpf($id_invoice); //~ Descuento sobre el total $before_amount = $amount * ($discount_before/100); $total_before = round($amount - $before_amount, 2); //~ Se aplica sobre el descuento los task $tax_amount = $total_before * ($tax/100); //~ Se aplica sobre el descuento el irpf $irpf_amount = $total_before * ($irpf/100); $total = round($total_before + $tax_amount - $irpf_amount, 2); $table->data[15][0] = print_label(__('Total amount: ').format_numeric($total,2).' '.$invoice['currency'], 'total_amount', 'text', true); $table->data[15][1] = print_label(__('Total amount without taxes or discounts: ').format_numeric($amount,2).' '.$invoice['currency'], 'total_amount_without_taxes', 'text', true); } $table->colspan[16][0] = 2; $table->data[16][0] = print_textarea ('description', 5, 40, $description, '', true, __('Description'));