Esempio n. 1
0
			$locked_id_user = crm_get_invoice_locked_id_user ($invoice["id"]);
		}
		
		$data = array ();
		
		if ($invoice["id_company"] != 0){
			$company_name = get_db_value ("name", "tcompany", "id", $invoice["id_company"]);
			$data[0] = "<a href='index.php?sec=customers&sec2=operation/companies/company_detail&view_invoice=1&id=".$invoice["id_company"]."&op=invoices&id_invoice=".$invoice["id"]."'>".$company_name."</a>";
		} else {
			$data[0] = __("N/A");
		}
		$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 
Esempio n. 2
0
		}
		$contcampo2++;
	}
}

$table->data[13][0] = print_input_text ('irpf', $irpf, '', 5, 20, true, __('Retention (%)'));
$table->data[13][1] = print_input_text ('concept_irpf', $concept_irpf, '', 20, 50, true, __('Concept Retention'));
$table->data[14][0] = print_input_text ('currency', $currency, '', 3, 3, true, __('Currency'));

echo '<div id="msg_ok_hidden" style="display:none;">';
	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);