| ';
+ print ' ';
}
- print ' | ';
- }
- if (!empty($arrayfields['sp.ref']['checked'])) {
- print '';
-
- print '';
+ if (!empty($arrayfields['sp.ref']['checked'])) {
+ print ' | ';
- print " | \n";
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
-
- // Thirdparty
- if (!empty($arrayfields['s.nom']['checked'])) {
- print '';
- print $companystatic->getNomUrl(1, 'supplier', 0, 0, -1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1);
- print ' | ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
-
- // Alias
- if (!empty($arrayfields['s.name_alias']['checked'])) {
- print '';
- print $companystatic->name_alias;
- print ' | ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
-
- // Town
- if (!empty($arrayfields['s.town']['checked'])) {
- print '';
- print $obj->town;
- print ' | ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
- // Zip
- if (!empty($arrayfields['s.zip']['checked'])) {
- print '';
- print $obj->zip;
- print ' | ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
- // State
- if (!empty($arrayfields['state.nom']['checked'])) {
- print "".$obj->state_name." | \n";
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
- // Country
- if (!empty($arrayfields['country.code_iso']['checked'])) {
- print '';
- $tmparray = getCountry($obj->fk_pays, 'all');
- print $tmparray['label'];
- print ' | ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
- // Type ent
- if (!empty($arrayfields['typent.code']['checked'])) {
- print '';
- if (empty($typenArray) || !is_array($typenArray) || count($typenArray) == 0) {
- $typenArray = $formcompany->typent_array(1);
- }
- print $typenArray[$obj->typent_code];
- print ' | ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
-
- // Date proposal
- if (!empty($arrayfields['sp.date_valid']['checked'])) {
- print '';
- print dol_print_date($db->jdate($obj->date_valid), 'day');
- print " | \n";
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
-
- // Date delivery
- if (!empty($arrayfields['sp.date_livraison']['checked'])) {
- print '';
- print dol_print_date($db->jdate($obj->dp), 'day');
- print " | \n";
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
-
- // Amount HT
- if (!empty($arrayfields['sp.total_ht']['checked'])) {
- print ''.price($obj->total_ht)." | \n";
- if (!$i) {
- $totalarray['nbfield']++;
- }
- if (!$i) {
- $totalarray['pos'][$totalarray['nbfield']] = 'sp.total_ht';
- }
- $totalarray['val']['sp.total_ht'] += $obj->total_ht;
- }
- // Amount VAT
- if (!empty($arrayfields['sp.total_tva']['checked'])) {
- print ''.price($obj->total_tva)." | \n";
- if (!$i) {
- $totalarray['nbfield']++;
- }
- if (!$i) {
- $totalarray['pos'][$totalarray['nbfield']] = 'sp.total_tva';
- }
- $totalarray['val']['sp.total_tva'] += $obj->total_tva;
- }
- // Amount TTC
- if (!empty($arrayfields['sp.total_ttc']['checked'])) {
- print ''.price($obj->total_ttc)." | \n";
- if (!$i) {
- $totalarray['nbfield']++;
- }
- if (!$i) {
- $totalarray['pos'][$totalarray['nbfield']] = 'sp.total_ttc';
- }
- $totalarray['val']['sp.total_ttc'] += $obj->total_ttc;
- }
-
- // Currency
- if (!empty($arrayfields['sp.multicurrency_code']['checked'])) {
- print ''.$obj->multicurrency_code.' - '.$langs->trans('Currency'.$obj->multicurrency_code)." | \n";
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
-
- // Currency rate
- if (!empty($arrayfields['sp.multicurrency_tx']['checked'])) {
- print '';
- $form->form_multicurrency_rate($_SERVER['PHP_SELF'].'?id='.$obj->rowid, $obj->multicurrency_tx, 'none', $obj->multicurrency_code);
- print " | \n";
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
- // Amount HT
- if (!empty($arrayfields['sp.multicurrency_total_ht']['checked'])) {
- print ''.price($obj->multicurrency_total_ht)." | \n";
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
- // Amount VAT
- if (!empty($arrayfields['sp.multicurrency_total_vat']['checked'])) {
- print ''.price($obj->multicurrency_total_vat)." | \n";
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
- // Amount TTC
- if (!empty($arrayfields['sp.multicurrency_total_ttc']['checked'])) {
- print ''.price($obj->multicurrency_total_ttc)." | \n";
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
-
- $userstatic->id = $obj->fk_user_author;
- $userstatic->login = $obj->login;
- $userstatic->status = $obj->ustatus;
- $userstatic->lastname = $obj->name;
- $userstatic->firstname = $obj->firstname;
- $userstatic->photo = $obj->photo;
- $userstatic->admin = $obj->admin;
- $userstatic->ref = $obj->fk_user_author;
- $userstatic->employee = $obj->employee;
- $userstatic->email = $obj->uemail;
-
- // Author
- if (!empty($arrayfields['u.login']['checked'])) {
- print '';
- if ($userstatic->id > 0) {
- print $userstatic->getNomUrl(-1, '', 0, 0, 24, 1, 'login', '', 1);
- } else {
- print ' ';
- }
- print " | \n";
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
-
- // Extra fields
- include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
- // Fields from hook
- $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
- $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
- print $hookmanager->resPrint;
- // Date creation
- if (!empty($arrayfields['sp.datec']['checked'])) {
- print '';
- print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
- print ' | ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
- // Date modification
- if (!empty($arrayfields['sp.tms']['checked'])) {
- print '';
- print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
- print ' | ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
- // Status
- if (!empty($arrayfields['sp.fk_statut']['checked'])) {
- print ''.$objectstatic->getLibStatut(5)." | \n";
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
-
- // Action column
- if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
- print '';
- if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
- $selected = 0;
- if (in_array($obj->rowid, $arrayofselected)) {
- $selected = 1;
+ print '';
+ // Picto + Ref
+ print '| ';
+ print $objectstatic->getNomUrl(1, '', '', 0, -1, 1);
+ print ' | ';
+ // Warning
+ $warnornote = '';
+ //if ($obj->fk_statut == 1 && $db->jdate($obj->date_valid) < ($now - $conf->supplier_proposal->warning_delay)) $warnornote .= img_warning($langs->trans("Late"));
+ if ($warnornote) {
+ print '';
+ print $warnornote;
+ print ' | ';
+ }
+ // Other picto tool
+ print '';
+ $filename = dol_sanitizeFileName($obj->ref);
+ $filedir = $conf->supplier_proposal->dir_output.'/'.dol_sanitizeFileName($obj->ref);
+ $urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->rowid;
+ print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
+ print ' | ';
+
+ print " | \n";
+ if (!$i) {
+ $totalarray['nbfield']++;
}
- print '';
}
- print '';
+
+ // Thirdparty
+ if (!empty($arrayfields['s.nom']['checked'])) {
+ print '';
+ print $companystatic->getNomUrl(1, 'supplier', 0, 0, -1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1);
+ print ' | ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+
+ // Alias
+ if (!empty($arrayfields['s.name_alias']['checked'])) {
+ print '';
+ print $companystatic->name_alias;
+ print ' | ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+
+ // Town
+ if (!empty($arrayfields['s.town']['checked'])) {
+ print '';
+ print $obj->town;
+ print ' | ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+ // Zip
+ if (!empty($arrayfields['s.zip']['checked'])) {
+ print '';
+ print $obj->zip;
+ print ' | ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+ // State
+ if (!empty($arrayfields['state.nom']['checked'])) {
+ print "".$obj->state_name." | \n";
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+ // Country
+ if (!empty($arrayfields['country.code_iso']['checked'])) {
+ print '';
+ $tmparray = getCountry($obj->fk_pays, 'all');
+ print $tmparray['label'];
+ print ' | ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+ // Type ent
+ if (!empty($arrayfields['typent.code']['checked'])) {
+ print '';
+ if (empty($typenArray) || !is_array($typenArray) || count($typenArray) == 0) {
+ $typenArray = $formcompany->typent_array(1);
+ }
+ print $typenArray[$obj->typent_code];
+ print ' | ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+
+ // Date proposal
+ if (!empty($arrayfields['sp.date_valid']['checked'])) {
+ print '';
+ print dol_print_date($db->jdate($obj->date_valid), 'day');
+ print " | \n";
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+
+ // Date delivery
+ if (!empty($arrayfields['sp.date_livraison']['checked'])) {
+ print '';
+ print dol_print_date($db->jdate($obj->dp), 'day');
+ print " | \n";
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+
+ // Amount HT
+ if (!empty($arrayfields['sp.total_ht']['checked'])) {
+ print ''.price($obj->total_ht)." | \n";
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ if (!$i) {
+ $totalarray['pos'][$totalarray['nbfield']] = 'sp.total_ht';
+ }
+ $totalarray['val']['sp.total_ht'] += $obj->total_ht;
+ }
+ // Amount VAT
+ if (!empty($arrayfields['sp.total_tva']['checked'])) {
+ print ''.price($obj->total_tva)." | \n";
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ if (!$i) {
+ $totalarray['pos'][$totalarray['nbfield']] = 'sp.total_tva';
+ }
+ $totalarray['val']['sp.total_tva'] += $obj->total_tva;
+ }
+ // Amount TTC
+ if (!empty($arrayfields['sp.total_ttc']['checked'])) {
+ print ''.price($obj->total_ttc)." | \n";
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ if (!$i) {
+ $totalarray['pos'][$totalarray['nbfield']] = 'sp.total_ttc';
+ }
+ $totalarray['val']['sp.total_ttc'] += $obj->total_ttc;
+ }
+
+ // Currency
+ if (!empty($arrayfields['sp.multicurrency_code']['checked'])) {
+ print ''.$obj->multicurrency_code.' - '.$langs->trans('Currency'.$obj->multicurrency_code)." | \n";
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+
+ // Currency rate
+ if (!empty($arrayfields['sp.multicurrency_tx']['checked'])) {
+ print '';
+ $form->form_multicurrency_rate($_SERVER['PHP_SELF'].'?id='.$obj->rowid, $obj->multicurrency_tx, 'none', $obj->multicurrency_code);
+ print " | \n";
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+ // Amount HT
+ if (!empty($arrayfields['sp.multicurrency_total_ht']['checked'])) {
+ print ''.price($obj->multicurrency_total_ht)." | \n";
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+ // Amount VAT
+ if (!empty($arrayfields['sp.multicurrency_total_vat']['checked'])) {
+ print ''.price($obj->multicurrency_total_vat)." | \n";
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+ // Amount TTC
+ if (!empty($arrayfields['sp.multicurrency_total_ttc']['checked'])) {
+ print ''.price($obj->multicurrency_total_ttc)." | \n";
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+
+ $userstatic->id = $obj->fk_user_author;
+ $userstatic->login = $obj->login;
+ $userstatic->status = $obj->ustatus;
+ $userstatic->lastname = $obj->name;
+ $userstatic->firstname = $obj->firstname;
+ $userstatic->photo = $obj->photo;
+ $userstatic->admin = $obj->admin;
+ $userstatic->ref = $obj->fk_user_author;
+ $userstatic->employee = $obj->employee;
+ $userstatic->email = $obj->uemail;
+
+ // Author
+ if (!empty($arrayfields['u.login']['checked'])) {
+ print '';
+ if ($userstatic->id > 0) {
+ print $userstatic->getNomUrl(-1, '', 0, 0, 24, 1, 'login', '', 1);
+ } else {
+ print ' ';
+ }
+ print " | \n";
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+
+ // Extra fields
+ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
+ // Fields from hook
+ $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
+ $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
+ print $hookmanager->resPrint;
+ // Date creation
+ if (!empty($arrayfields['sp.datec']['checked'])) {
+ print '';
+ print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
+ print ' | ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+ // Date modification
+ if (!empty($arrayfields['sp.tms']['checked'])) {
+ print '';
+ print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
+ print ' | ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+ // Status
+ if (!empty($arrayfields['sp.fk_statut']['checked'])) {
+ print ''.$objectstatic->getLibStatut(5)." | \n";
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+
+ // Action column
+ if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
+ print '';
+ if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
+ $selected = 0;
+ if (in_array($obj->rowid, $arrayofselected)) {
+ $selected = 1;
+ }
+ print '';
+ }
+ print ' | ';
+ }
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+
+ print "
\n";
+
+ $total += $obj->total_ht;
+ $subtotal += $obj->total_ht;
}
- if (!$i) {
- $totalarray['nbfield']++;
- }
-
- print "\n";
-
- $total += $obj->total_ht;
- $subtotal += $obj->total_ht;
-
$i++;
}