Beispiel #1
0
// Payment on contract line
if (GETPOST("source") == 'contractline' && $valid) {
    $found = true;
    $langs->load("contracts");
    require_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php';
    $contractline = new ContratLigne($db);
    $result = $contractline->fetch('', $ref);
    if ($result < 0) {
        $mesg = $contractline->error;
        $error++;
    } else {
        if ($contractline->fk_contrat > 0) {
            $contract = new Contrat($db);
            $result = $contract->fetch($contractline->fk_contrat);
            if ($result > 0) {
                $result = $contract->fetch_thirdparty($contract->socid);
            } else {
                $mesg = $contract->error;
                $error++;
            }
        } else {
            $mesg = 'ErrorRecordNotFound';
            $error++;
        }
    }
    $amount = $contractline->total_ttc;
    if ($contractline->fk_product) {
        $product = new Product($db);
        $result = $product->fetch($contractline->fk_product);
        // We define price for product (TODO Put this in a method in product class)
        if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
 */
llxHeader('', $langs->trans("ContractCard"), "Contrat");
$form = new Form($db);
$formcompany = new FormCompany($db);
$contactstatic = new Contact($db);
$userstatic = new User($db);
dol_htmloutput_mesg($mesg);
/* *************************************************************************** */
/*                                                                             */
/* Mode vue et edition                                                         */
/*                                                                             */
/* *************************************************************************** */
if ($id > 0 || !empty($ref)) {
    if ($object->fetch($id, $ref) > 0) {
        dol_htmloutput_mesg($mesg);
        $object->fetch_thirdparty();
        $head = contract_prepare_head($object);
        $hselected = 1;
        dol_fiche_head($head, $hselected, $langs->trans("Contract"), 0, 'contract');
        /*
         *   Contrat
         */
        print '<table class="border" width="100%">';
        $linkback = '<a href="' . DOL_URL_ROOT . '/contrat/liste.php' . (!empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
        // Reference du contrat
        print '<tr><td width="25%">' . $langs->trans("Ref") . '</td><td colspan="3">';
        print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
        print "</td></tr>";
        // Customer
        print "<tr><td>" . $langs->trans("Customer") . "</td>";
        print '<td colspan="3">' . $object->thirdparty->getNomUrl(1) . '</td></tr>';