示例#1
0
 $comments = GETPOST('comments');
 $qty = GETPOST('qty');
 $value_unit = GETPOST('value_unit');
 $vatrate = GETPOST('vatrate');
 if (!GETPOST('fk_c_type_fees') > 0) {
     $error++;
     setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors');
     $action = '';
 }
 if (GETPOST('vatrate') < 0 || GETPOST('vatrate') == '') {
     $error++;
     setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Vat")), null, 'errors');
     $action = '';
 }
 if (!$error) {
     $result = $object->updateline($rowid, $type_fees_id, $projet_id, $vatrate, $comments, $qty, $value_unit, $date, $id);
     if ($result >= 0) {
         if ($result > 0) {
             // Define output language
             if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
                 $outputlangs = $langs;
                 $newlang = '';
                 if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) {
                     $newlang = GETPOST('lang_id', 'alpha');
                 }
                 if ($conf->global->MAIN_MULTILANGS && empty($newlang)) {
                     $newlang = $object->thirdparty->default_lang;
                 }
                 if (!empty($newlang)) {
                     $outputlangs = new Translate("", $conf);
                     $outputlangs->setDefaultLang($newlang);