Merge pull request #23480 from lamrani002/kanbanFournisseurCommande
NEW kanban mode for list of fournisseur commande
This commit is contained in:
commit
aa178c55ff
@ -3544,6 +3544,38 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return clicable link of object (with eventually picto)
|
||||||
|
*
|
||||||
|
* @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
|
||||||
|
* @return string HTML Code for Kanban thumb.
|
||||||
|
*/
|
||||||
|
public function getKanbanView($option = '')
|
||||||
|
{
|
||||||
|
global $langs;
|
||||||
|
$return = '<div class="box-flex-item box-flex-grow-zero">';
|
||||||
|
$return .= '<div class="info-box info-box-sm">';
|
||||||
|
$return .= '<span class="info-box-icon bg-infobox-action">';
|
||||||
|
$return .= img_picto('', $this->picto);
|
||||||
|
//$return .= '<i class="fa fa-dol-action"></i>'; // Can be image
|
||||||
|
$return .= '</span>';
|
||||||
|
$return .= '<div class="info-box-content">';
|
||||||
|
$return .= '<span class="info-box-ref">'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref).'</span>';
|
||||||
|
if (property_exists($this, 'socid') || property_exists($this, 'total_tva')) {
|
||||||
|
$return .='<br><span class="info-box-label amount">'.$this->socid.'</span>';
|
||||||
|
}
|
||||||
|
if (property_exists($this, 'billed')) {
|
||||||
|
$return .= '<br><span class="opacitymedium">'.$langs->trans("Billed").' : </span><span class="info-box-label">'.yn($this->billed).'</span>';
|
||||||
|
}
|
||||||
|
if (method_exists($this, 'getLibStatut')) {
|
||||||
|
$return .= '<br><div class="info-box-status margintoponly">'.$this->getLibStatut(5).'</div>';
|
||||||
|
}
|
||||||
|
$return .= '</div>';
|
||||||
|
$return .= '</div>';
|
||||||
|
$return .= '</div>';
|
||||||
|
return $return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -56,6 +56,7 @@ $show_files = GETPOST('show_files', 'int');
|
|||||||
$confirm = GETPOST('confirm', 'alpha');
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
$toselect = GETPOST('toselect', 'array');
|
$toselect = GETPOST('toselect', 'array');
|
||||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'supplierorderlist';
|
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'supplierorderlist';
|
||||||
|
$mode = GETPOST('mode', 'alpha');
|
||||||
|
|
||||||
// Search Criteria
|
// Search Criteria
|
||||||
$search_date_order_startday = GETPOST('search_date_order_startday', 'int');
|
$search_date_order_startday = GETPOST('search_date_order_startday', 'int');
|
||||||
@ -576,6 +577,9 @@ if (empty($reshook)) {
|
|||||||
|
|
||||||
// Make a redirect to avoid to bill twice if we make a refresh or back
|
// Make a redirect to avoid to bill twice if we make a refresh or back
|
||||||
$param = '';
|
$param = '';
|
||||||
|
if (!empty($mode)) {
|
||||||
|
$param .= '&mode='.urlencode($mode);
|
||||||
|
}
|
||||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||||
$param .= '&contextpage='.urlencode($contextpage);
|
$param .= '&contextpage='.urlencode($contextpage);
|
||||||
}
|
}
|
||||||
@ -998,6 +1002,9 @@ if ($resql) {
|
|||||||
llxHeader('', $title, $help_url);
|
llxHeader('', $title, $help_url);
|
||||||
|
|
||||||
$param = '';
|
$param = '';
|
||||||
|
if (!empty($mode)) {
|
||||||
|
$param .= '&mode='.urlencode($mode);
|
||||||
|
}
|
||||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||||
$param .= '&contextpage='.urlencode($contextpage);
|
$param .= '&contextpage='.urlencode($contextpage);
|
||||||
}
|
}
|
||||||
@ -1184,7 +1191,10 @@ if ($resql) {
|
|||||||
$url .= '&socid='.((int) $socid);
|
$url .= '&socid='.((int) $socid);
|
||||||
$url .= '&backtopage='.urlencode(DOL_URL_ROOT.'/fourn/commande/list.php?socid='.((int) $socid));
|
$url .= '&backtopage='.urlencode(DOL_URL_ROOT.'/fourn/commande/list.php?socid='.((int) $socid));
|
||||||
}
|
}
|
||||||
$newcardbutton = dolGetButtonTitle($langs->trans('NewSupplierOrderShort'), '', 'fa fa-plus-circle', $url, '', $permissiontoadd);
|
$newcardbutton = '';
|
||||||
|
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition'));
|
||||||
|
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition'));
|
||||||
|
$newcardbutton .= dolGetButtonTitle($langs->trans('NewSupplierOrderShort'), '', 'fa fa-plus-circle', $url, '', $permissiontoadd);
|
||||||
|
|
||||||
// Lines of title fields
|
// Lines of title fields
|
||||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
@ -1198,6 +1208,7 @@ if ($resql) {
|
|||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
print '<input type="hidden" name="socid" value="'.$socid.'">';
|
print '<input type="hidden" name="socid" value="'.$socid.'">';
|
||||||
|
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||||
|
|
||||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'supplier_order', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'supplier_order', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||||
|
|
||||||
@ -1660,344 +1671,365 @@ if ($resql) {
|
|||||||
$objectstatic->note_private = $obj->note_private;
|
$objectstatic->note_private = $obj->note_private;
|
||||||
$objectstatic->statut = $obj->fk_statut;
|
$objectstatic->statut = $obj->fk_statut;
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
if ($mode == 'kanban') {
|
||||||
// Action column
|
if ($i == 0) {
|
||||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
print '<tr><td colspan="12">';
|
||||||
print '<td class="nowrap center">';
|
print '<div class="box-flex-container">';
|
||||||
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 '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
|
||||||
}
|
}
|
||||||
print '</td>';
|
|
||||||
}
|
|
||||||
// Ref
|
|
||||||
if (!empty($arrayfields['cf.ref']['checked'])) {
|
|
||||||
print '<td class="nowrap">';
|
|
||||||
|
|
||||||
// Picto + Ref
|
|
||||||
print $objectstatic->getNomUrl(1, '', 0, -1, 1);
|
|
||||||
// Other picto tool
|
|
||||||
$filename = dol_sanitizeFileName($obj->ref);
|
|
||||||
$filedir = $conf->fournisseur->commande->dir_output.'/'.dol_sanitizeFileName($obj->ref);
|
|
||||||
print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
|
|
||||||
|
|
||||||
print '</td>'."\n";
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Ref Supplier
|
|
||||||
if (!empty($arrayfields['cf.ref_supplier']['checked'])) {
|
|
||||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->ref_supplier).'">'.dol_escape_htmltag($obj->ref_supplier).'</td>'."\n";
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Project
|
|
||||||
if (!empty($arrayfields['cf.fk_projet']['checked'])) {
|
|
||||||
$projectstatic->id = $obj->project_id;
|
|
||||||
$projectstatic->ref = $obj->project_ref;
|
|
||||||
$projectstatic->title = $obj->project_title;
|
|
||||||
print '<td>';
|
|
||||||
if ($obj->project_id > 0) {
|
|
||||||
print $projectstatic->getNomUrl(1);
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Author
|
|
||||||
$userstatic->id = $obj->fk_user_author;
|
|
||||||
$userstatic->lastname = $obj->lastname;
|
|
||||||
$userstatic->firstname = $obj->firstname;
|
|
||||||
$userstatic->login = $obj->login;
|
|
||||||
$userstatic->photo = $obj->photo;
|
|
||||||
$userstatic->email = $obj->user_email;
|
|
||||||
$userstatic->statut = $obj->user_status;
|
|
||||||
if (!empty($arrayfields['u.login']['checked'])) {
|
|
||||||
print '<td class="tdoverflowmax150">';
|
|
||||||
if ($userstatic->id) {
|
|
||||||
print $userstatic->getNomUrl(1);
|
|
||||||
}
|
|
||||||
print "</td>";
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Thirdparty
|
|
||||||
if (!empty($arrayfields['cf.fk_soc']['checked'])) {
|
|
||||||
print '<td class="tdoverflowmax150">';
|
|
||||||
$thirdpartytmp->id = $obj->socid;
|
$thirdpartytmp->id = $obj->socid;
|
||||||
$thirdpartytmp->name = $obj->name;
|
$thirdpartytmp->name = $obj->name;
|
||||||
$thirdpartytmp->email = $obj->email;
|
$thirdpartytmp->email = $obj->email;
|
||||||
$thirdpartytmp->name_alias = $obj->alias;
|
$thirdpartytmp->name_alias = $obj->alias;
|
||||||
$thirdpartytmp->client = $obj->client;
|
$thirdpartytmp->client = $obj->client;
|
||||||
$thirdpartytmp->fournisseur = $obj->fournisseur;
|
$thirdpartytmp->fournisseur = $obj->fournisseur;
|
||||||
print $thirdpartytmp->getNomUrl(1, 'supplier', 0, 0, -1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1);
|
$objectstatic->socid = $thirdpartytmp->getNomUrl('supplier', 0, 0, -1);
|
||||||
print '</td>'."\n";
|
// Output Kanban
|
||||||
if (!$i) {
|
print $objectstatic->getKanbanView('');
|
||||||
$totalarray['nbfield']++;
|
if ($i == (min($num, $limit) - 1)) {
|
||||||
|
print '</div>';
|
||||||
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
//alias
|
print '<tr class="oddeven">';
|
||||||
if (!empty($arrayfields['s.name_alias']['checked'])) {
|
// Action column
|
||||||
print '<td class="tdoverflowmax150">';
|
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
print $obj->alias;
|
print '<td class="nowrap center">';
|
||||||
print '</td>'."\n";
|
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||||
if (!$i) {
|
$selected = 0;
|
||||||
$totalarray['nbfield']++;
|
if (in_array($obj->rowid, $arrayofselected)) {
|
||||||
|
$selected = 1;
|
||||||
|
}
|
||||||
|
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
}
|
}
|
||||||
}
|
// Ref
|
||||||
// Town
|
if (!empty($arrayfields['cf.ref']['checked'])) {
|
||||||
if (!empty($arrayfields['s.town']['checked'])) {
|
print '<td class="nowrap">';
|
||||||
print '<td>';
|
|
||||||
print $obj->town;
|
|
||||||
print '</td>';
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Zip
|
|
||||||
if (!empty($arrayfields['s.zip']['checked'])) {
|
|
||||||
print '<td>';
|
|
||||||
print $obj->zip;
|
|
||||||
print '</td>';
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// State
|
|
||||||
if (!empty($arrayfields['state.nom']['checked'])) {
|
|
||||||
print "<td>".$obj->state_name."</td>\n";
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Country
|
|
||||||
if (!empty($arrayfields['country.code_iso']['checked'])) {
|
|
||||||
print '<td class="center">';
|
|
||||||
$tmparray = getCountry($obj->fk_pays, 'all');
|
|
||||||
print $tmparray['label'];
|
|
||||||
print '</td>';
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Type ent
|
|
||||||
if (!empty($arrayfields['typent.code']['checked'])) {
|
|
||||||
print '<td class="center">';
|
|
||||||
if (empty($typenArray)) {
|
|
||||||
$typenArray = $formcompany->typent_array(1);
|
|
||||||
}
|
|
||||||
print $typenArray[$obj->typent_code];
|
|
||||||
print '</td>';
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Order date
|
// Picto + Ref
|
||||||
if (!empty($arrayfields['cf.date_commande']['checked'])) {
|
print $objectstatic->getNomUrl(1, '', 0, -1, 1);
|
||||||
print '<td class="center">';
|
// Other picto tool
|
||||||
print dol_print_date($db->jdate($obj->date_commande), 'day');
|
$filename = dol_sanitizeFileName($obj->ref);
|
||||||
if ($objectstatic->statut != $objectstatic::STATUS_ORDERSENT && $objectstatic->statut != $objectstatic::STATUS_RECEIVED_PARTIALLY) {
|
$filedir = $conf->fournisseur->commande->dir_output.'/'.dol_sanitizeFileName($obj->ref);
|
||||||
if ($objectstatic->hasDelay()) {
|
print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
|
||||||
print ' '.img_picto($langs->trans("Late").' : '.$objectstatic->showDelay(), "warning");
|
|
||||||
|
print '</td>'."\n";
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</td>';
|
// Ref Supplier
|
||||||
if (!$i) {
|
if (!empty($arrayfields['cf.ref_supplier']['checked'])) {
|
||||||
$totalarray['nbfield']++;
|
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->ref_supplier).'">'.dol_escape_htmltag($obj->ref_supplier).'</td>'."\n";
|
||||||
}
|
if (!$i) {
|
||||||
}
|
$totalarray['nbfield']++;
|
||||||
// Plannned date of delivery
|
|
||||||
if (!empty($arrayfields['cf.date_livraison']['checked'])) {
|
|
||||||
print '<td class="center">';
|
|
||||||
print dol_print_date($db->jdate($obj->date_livraison), 'day');
|
|
||||||
if ($objectstatic->statut == $objectstatic::STATUS_ORDERSENT || $objectstatic->statut == $objectstatic::STATUS_RECEIVED_PARTIALLY) {
|
|
||||||
if ($objectstatic->hasDelay()) {
|
|
||||||
print ' '.img_picto($langs->trans("Late").' : '.$objectstatic->showDelay(), "warning");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</td>';
|
// Project
|
||||||
if (!$i) {
|
if (!empty($arrayfields['cf.fk_projet']['checked'])) {
|
||||||
$totalarray['nbfield']++;
|
$projectstatic->id = $obj->project_id;
|
||||||
}
|
$projectstatic->ref = $obj->project_ref;
|
||||||
}
|
$projectstatic->title = $obj->project_title;
|
||||||
// Amount HT
|
print '<td>';
|
||||||
if (!empty($arrayfields['cf.total_ht']['checked'])) {
|
if ($obj->project_id > 0) {
|
||||||
print '<td class="right"><span class="amount">'.price($obj->total_ht)."</span></td>\n";
|
print $projectstatic->getNomUrl(1);
|
||||||
if (!$i) {
|
}
|
||||||
$totalarray['nbfield']++;
|
print '</td>';
|
||||||
}
|
if (!$i) {
|
||||||
if (!$i) {
|
$totalarray['nbfield']++;
|
||||||
$totalarray['pos'][$totalarray['nbfield']] = 'cf.total_ht';
|
}
|
||||||
}
|
}
|
||||||
$totalarray['val']['cf.total_ht'] += $obj->total_ht;
|
// Author
|
||||||
}
|
$userstatic->id = $obj->fk_user_author;
|
||||||
// Amount VAT
|
$userstatic->lastname = $obj->lastname;
|
||||||
if (!empty($arrayfields['cf.total_tva']['checked'])) {
|
$userstatic->firstname = $obj->firstname;
|
||||||
print '<td class="right"><span class="amount">'.price($obj->total_tva)."</span></td>\n";
|
$userstatic->login = $obj->login;
|
||||||
if (!$i) {
|
$userstatic->photo = $obj->photo;
|
||||||
$totalarray['nbfield']++;
|
$userstatic->email = $obj->user_email;
|
||||||
}
|
$userstatic->statut = $obj->user_status;
|
||||||
if (!$i) {
|
if (!empty($arrayfields['u.login']['checked'])) {
|
||||||
$totalarray['pos'][$totalarray['nbfield']] = 'cf.total_tva';
|
print '<td class="tdoverflowmax150">';
|
||||||
}
|
if ($userstatic->id) {
|
||||||
$totalarray['val']['cf.total_tva'] += $obj->total_tva;
|
print $userstatic->getNomUrl(1);
|
||||||
}
|
}
|
||||||
// Amount TTC
|
print "</td>";
|
||||||
if (!empty($arrayfields['cf.total_ttc']['checked'])) {
|
if (!$i) {
|
||||||
print '<td class="right"><span class="amount">'.price($obj->total_ttc)."</span></td>\n";
|
$totalarray['nbfield']++;
|
||||||
if (!$i) {
|
}
|
||||||
$totalarray['nbfield']++;
|
}
|
||||||
}
|
// Thirdparty
|
||||||
if (!$i) {
|
if (!empty($arrayfields['cf.fk_soc']['checked'])) {
|
||||||
$totalarray['pos'][$totalarray['nbfield']] = 'cf.total_ttc';
|
print '<td class="tdoverflowmax150">';
|
||||||
}
|
$thirdpartytmp->id = $obj->socid;
|
||||||
$totalarray['val']['cf.total_ttc'] += $obj->total_ttc;
|
$thirdpartytmp->name = $obj->name;
|
||||||
}
|
$thirdpartytmp->email = $obj->email;
|
||||||
|
$thirdpartytmp->name_alias = $obj->alias;
|
||||||
// Currency
|
$thirdpartytmp->client = $obj->client;
|
||||||
if (!empty($arrayfields['cf.multicurrency_code']['checked'])) {
|
$thirdpartytmp->fournisseur = $obj->fournisseur;
|
||||||
print '<td class="nowrap">'.$obj->multicurrency_code.' - '.$langs->trans('Currency'.$obj->multicurrency_code)."</td>\n";
|
print $thirdpartytmp->getNomUrl(1, 'supplier', 0, 0, -1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1);
|
||||||
if (!$i) {
|
print '</td>'."\n";
|
||||||
$totalarray['nbfield']++;
|
if (!$i) {
|
||||||
}
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Currency rate
|
//alias
|
||||||
if (!empty($arrayfields['cf.multicurrency_tx']['checked'])) {
|
if (!empty($arrayfields['s.name_alias']['checked'])) {
|
||||||
print '<td class="nowrap">';
|
print '<td class="tdoverflowmax150">';
|
||||||
$form->form_multicurrency_rate($_SERVER['PHP_SELF'].'?id='.$obj->rowid, $obj->multicurrency_tx, 'none', $obj->multicurrency_code);
|
print $obj->alias;
|
||||||
print "</td>\n";
|
print '</td>'."\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Amount HT
|
// Town
|
||||||
if (!empty($arrayfields['cf.multicurrency_total_ht']['checked'])) {
|
if (!empty($arrayfields['s.town']['checked'])) {
|
||||||
print '<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ht)."</span></td>\n";
|
print '<td>';
|
||||||
if (!$i) {
|
print $obj->town;
|
||||||
$totalarray['nbfield']++;
|
print '</td>';
|
||||||
}
|
if (!$i) {
|
||||||
}
|
$totalarray['nbfield']++;
|
||||||
// Amount VAT
|
}
|
||||||
if (!empty($arrayfields['cf.multicurrency_total_tva']['checked'])) {
|
}
|
||||||
print '<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_tva)."</span></td>\n";
|
// Zip
|
||||||
if (!$i) {
|
if (!empty($arrayfields['s.zip']['checked'])) {
|
||||||
$totalarray['nbfield']++;
|
print '<td>';
|
||||||
}
|
print $obj->zip;
|
||||||
}
|
print '</td>';
|
||||||
// Amount TTC
|
if (!$i) {
|
||||||
if (!empty($arrayfields['cf.multicurrency_total_ttc']['checked'])) {
|
$totalarray['nbfield']++;
|
||||||
print '<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ttc)."</span></td>\n";
|
}
|
||||||
if (!$i) {
|
}
|
||||||
$totalarray['nbfield']++;
|
// State
|
||||||
}
|
if (!empty($arrayfields['state.nom']['checked'])) {
|
||||||
}
|
print "<td>".$obj->state_name."</td>\n";
|
||||||
|
if (!$i) {
|
||||||
// Extra fields
|
$totalarray['nbfield']++;
|
||||||
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);
|
// Country
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
|
if (!empty($arrayfields['country.code_iso']['checked'])) {
|
||||||
print $hookmanager->resPrint;
|
print '<td class="center">';
|
||||||
// Date creation
|
$tmparray = getCountry($obj->fk_pays, 'all');
|
||||||
if (!empty($arrayfields['cf.date_creation']['checked'])) {
|
print $tmparray['label'];
|
||||||
print '<td class="center nowrap">';
|
print '</td>';
|
||||||
print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
|
if (!$i) {
|
||||||
print '</td>';
|
$totalarray['nbfield']++;
|
||||||
if (!$i) {
|
}
|
||||||
$totalarray['nbfield']++;
|
}
|
||||||
}
|
// Type ent
|
||||||
}
|
if (!empty($arrayfields['typent.code']['checked'])) {
|
||||||
// Date modification
|
print '<td class="center">';
|
||||||
if (!empty($arrayfields['cf.tms']['checked'])) {
|
if (empty($typenArray)) {
|
||||||
print '<td class="center nowrap">';
|
$typenArray = $formcompany->typent_array(1);
|
||||||
print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
|
}
|
||||||
print '</td>';
|
print $typenArray[$obj->typent_code];
|
||||||
if (!$i) {
|
print '</td>';
|
||||||
$totalarray['nbfield']++;
|
if (!$i) {
|
||||||
}
|
$totalarray['nbfield']++;
|
||||||
}
|
|
||||||
// Status
|
|
||||||
if (!empty($arrayfields['cf.fk_statut']['checked'])) {
|
|
||||||
print '<td class="right nowrap">'.$objectstatic->LibStatut($obj->fk_statut, 5, $obj->billed).'</td>';
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Billed
|
|
||||||
if (!empty($arrayfields['cf.billed']['checked'])) {
|
|
||||||
print '<td class="center">'.yn($obj->billed).'</td>';
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// valid date
|
|
||||||
if (!empty($arrayfields['cf.date_valid']['checked'])) {
|
|
||||||
print '<td class="center">';
|
|
||||||
print dol_print_date($db->jdate($obj->date_valid), 'day');
|
|
||||||
print '</td>';
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// approve date
|
|
||||||
if (!empty($arrayfields['cf.date_approve']['checked'])) {
|
|
||||||
print '<td class="center">';
|
|
||||||
print dol_print_date($db->jdate($obj->date_approve), 'day');
|
|
||||||
print '</td>';
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Note public
|
|
||||||
if (!empty($arrayfields['cf.note_public']['checked'])) {
|
|
||||||
print '<td class="center">';
|
|
||||||
print dol_string_nohtmltag($obj->note_public);
|
|
||||||
print '</td>';
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Note private
|
|
||||||
if (!empty($arrayfields['cf.note_private']['checked'])) {
|
|
||||||
print '<td class="center">';
|
|
||||||
print dol_string_nohtmltag($obj->note_private);
|
|
||||||
print '</td>';
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Action column
|
|
||||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
|
||||||
print '<td class="nowrap center">';
|
|
||||||
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 '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
|
||||||
}
|
}
|
||||||
print '</td>';
|
|
||||||
}
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
|
|
||||||
print "</tr>\n";
|
// Order date
|
||||||
|
if (!empty($arrayfields['cf.date_commande']['checked'])) {
|
||||||
|
print '<td class="center">';
|
||||||
|
print dol_print_date($db->jdate($obj->date_commande), 'day');
|
||||||
|
if ($objectstatic->statut != $objectstatic::STATUS_ORDERSENT && $objectstatic->statut != $objectstatic::STATUS_RECEIVED_PARTIALLY) {
|
||||||
|
if ($objectstatic->hasDelay()) {
|
||||||
|
print ' '.img_picto($langs->trans("Late").' : '.$objectstatic->showDelay(), "warning");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Plannned date of delivery
|
||||||
|
if (!empty($arrayfields['cf.date_livraison']['checked'])) {
|
||||||
|
print '<td class="center">';
|
||||||
|
print dol_print_date($db->jdate($obj->date_livraison), 'day');
|
||||||
|
if ($objectstatic->statut == $objectstatic::STATUS_ORDERSENT || $objectstatic->statut == $objectstatic::STATUS_RECEIVED_PARTIALLY) {
|
||||||
|
if ($objectstatic->hasDelay()) {
|
||||||
|
print ' '.img_picto($langs->trans("Late").' : '.$objectstatic->showDelay(), "warning");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Amount HT
|
||||||
|
if (!empty($arrayfields['cf.total_ht']['checked'])) {
|
||||||
|
print '<td class="right"><span class="amount">'.price($obj->total_ht)."</span></td>\n";
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['pos'][$totalarray['nbfield']] = 'cf.total_ht';
|
||||||
|
}
|
||||||
|
$totalarray['val']['cf.total_ht'] += $obj->total_ht;
|
||||||
|
}
|
||||||
|
// Amount VAT
|
||||||
|
if (!empty($arrayfields['cf.total_tva']['checked'])) {
|
||||||
|
print '<td class="right"><span class="amount">'.price($obj->total_tva)."</span></td>\n";
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['pos'][$totalarray['nbfield']] = 'cf.total_tva';
|
||||||
|
}
|
||||||
|
$totalarray['val']['cf.total_tva'] += $obj->total_tva;
|
||||||
|
}
|
||||||
|
// Amount TTC
|
||||||
|
if (!empty($arrayfields['cf.total_ttc']['checked'])) {
|
||||||
|
print '<td class="right"><span class="amount">'.price($obj->total_ttc)."</span></td>\n";
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['pos'][$totalarray['nbfield']] = 'cf.total_ttc';
|
||||||
|
}
|
||||||
|
$totalarray['val']['cf.total_ttc'] += $obj->total_ttc;
|
||||||
|
}
|
||||||
|
|
||||||
$total += $obj->total_ht;
|
// Currency
|
||||||
$subtotal += $obj->total_ht;
|
if (!empty($arrayfields['cf.multicurrency_code']['checked'])) {
|
||||||
|
print '<td class="nowrap">'.$obj->multicurrency_code.' - '.$langs->trans('Currency'.$obj->multicurrency_code)."</td>\n";
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Currency rate
|
||||||
|
if (!empty($arrayfields['cf.multicurrency_tx']['checked'])) {
|
||||||
|
print '<td class="nowrap">';
|
||||||
|
$form->form_multicurrency_rate($_SERVER['PHP_SELF'].'?id='.$obj->rowid, $obj->multicurrency_tx, 'none', $obj->multicurrency_code);
|
||||||
|
print "</td>\n";
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Amount HT
|
||||||
|
if (!empty($arrayfields['cf.multicurrency_total_ht']['checked'])) {
|
||||||
|
print '<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ht)."</span></td>\n";
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Amount VAT
|
||||||
|
if (!empty($arrayfields['cf.multicurrency_total_tva']['checked'])) {
|
||||||
|
print '<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_tva)."</span></td>\n";
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Amount TTC
|
||||||
|
if (!empty($arrayfields['cf.multicurrency_total_ttc']['checked'])) {
|
||||||
|
print '<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ttc)."</span></td>\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['cf.date_creation']['checked'])) {
|
||||||
|
print '<td class="center nowrap">';
|
||||||
|
print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Date modification
|
||||||
|
if (!empty($arrayfields['cf.tms']['checked'])) {
|
||||||
|
print '<td class="center nowrap">';
|
||||||
|
print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Status
|
||||||
|
if (!empty($arrayfields['cf.fk_statut']['checked'])) {
|
||||||
|
print '<td class="right nowrap">'.$objectstatic->LibStatut($obj->fk_statut, 5, $obj->billed).'</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Billed
|
||||||
|
if (!empty($arrayfields['cf.billed']['checked'])) {
|
||||||
|
print '<td class="center">'.yn($obj->billed).'</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// valid date
|
||||||
|
if (!empty($arrayfields['cf.date_valid']['checked'])) {
|
||||||
|
print '<td class="center">';
|
||||||
|
print dol_print_date($db->jdate($obj->date_valid), 'day');
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// approve date
|
||||||
|
if (!empty($arrayfields['cf.date_approve']['checked'])) {
|
||||||
|
print '<td class="center">';
|
||||||
|
print dol_print_date($db->jdate($obj->date_approve), 'day');
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Note public
|
||||||
|
if (!empty($arrayfields['cf.note_public']['checked'])) {
|
||||||
|
print '<td class="center">';
|
||||||
|
print dol_string_nohtmltag($obj->note_public);
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Note private
|
||||||
|
if (!empty($arrayfields['cf.note_private']['checked'])) {
|
||||||
|
print '<td class="center">';
|
||||||
|
print dol_string_nohtmltag($obj->note_private);
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Action column
|
||||||
|
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
|
print '<td class="nowrap center">';
|
||||||
|
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 '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
$total += $obj->total_ht;
|
||||||
|
$subtotal += $obj->total_ht;
|
||||||
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user