';
// Ref
if (! empty($arrayfields['c.ref']['checked']))
{
- print '| ';
- print '';
- print ' | ';
+ print '';
+ print '';
+ print ' | ';
}
// Ref customer
if (! empty($arrayfields['c.ref_client']['checked']))
{
- print '';
- print '';
- print ' | ';
+ print '';
+ print '';
+ print ' | ';
}
// Project ref
if (! empty($arrayfields['p.project_ref']['checked']))
@@ -804,9 +804,9 @@ if ($resql)
// Thirpdarty
if (! empty($arrayfields['s.nom']['checked']))
{
- print '';
- print '';
- print ' | ';
+ print '';
+ print '';
+ print ' | ';
}
// Town
if (! empty($arrayfields['s.town']['checked'])) print ' | ';
@@ -815,84 +815,84 @@ if ($resql)
// State
if (! empty($arrayfields['state.nom']['checked']))
{
- print '';
- print '';
- print ' | ';
+ print '';
+ print '';
+ print ' | ';
}
// Country
if (! empty($arrayfields['country.code_iso']['checked']))
{
- print '';
- print $form->select_country($search_country,'search_country','',0,'maxwidth100');
- print ' | ';
+ print '';
+ print $form->select_country($search_country,'search_country','',0,'maxwidth100');
+ print ' | ';
}
// Company type
if (! empty($arrayfields['typent.code']['checked']))
{
- print '';
- print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT));
- print ' | ';
+ print '';
+ print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT));
+ print ' | ';
}
// Date order
if (! empty($arrayfields['c.date_commande']['checked']))
{
- print '';
- if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '';
- print '';
- $formother->select_year($search_orderyear?$search_orderyear:-1,'search_orderyear',1, 20, 5);
- print ' | ';
+ print '';
+ if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '';
+ print '';
+ $formother->select_year($search_orderyear?$search_orderyear:-1,'search_orderyear',1, 20, 5);
+ print ' | ';
}
if (! empty($arrayfields['c.date_delivery']['checked']))
{
- print '';
- if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '';
- print '';
- $formother->select_year($search_deliveryyear?$search_deliveryyear:-1,'search_deliveryyear',1, 20, 5);
- print ' | ';
+ print '';
+ if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '';
+ print '';
+ $formother->select_year($search_deliveryyear?$search_deliveryyear:-1,'search_deliveryyear',1, 20, 5);
+ print ' | ';
}
if (! empty($arrayfields['c.total_ht']['checked']))
{
- // Amount
- print '';
- print '';
- print ' | ';
+ // Amount
+ print '';
+ print '';
+ print ' | ';
}
if (! empty($arrayfields['c.total_vat']['checked']))
{
- // Amount
- print '';
- print '';
- print ' | ';
+ // Amount
+ print '';
+ print '';
+ print ' | ';
}
if (! empty($arrayfields['c.total_ttc']['checked']))
{
- // Amount
- print '';
- print '';
- print ' | ';
+ // Amount
+ print '';
+ print '';
+ print ' | ';
}
// Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{
- foreach($extrafields->attribute_label as $key => $val)
- {
- if (! empty($arrayfields["ef.".$key]['checked']))
- {
- $align=$extrafields->getAlignFlag($key);
- $typeofextrafield=$extrafields->attribute_type[$key];
- print '';
- if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select')))
- {
- $crit=$val;
- $tmpkey=preg_replace('/search_options_/','',$key);
- $searchclass='';
- if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring';
- if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum';
- print '';
- }
- print ' | ';
- }
- }
+ foreach($extrafields->attribute_label as $key => $val)
+ {
+ if (! empty($arrayfields["ef.".$key]['checked']))
+ {
+ $align=$extrafields->getAlignFlag($key);
+ $typeofextrafield=$extrafields->attribute_type[$key];
+ print '';
+ if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select')))
+ {
+ $crit=$val;
+ $tmpkey=preg_replace('/search_options_/','',$key);
+ $searchclass='';
+ if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring';
+ if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum';
+ print '';
+ }
+ print ' | ';
+ }
+ }
}
// Fields from hook
$parameters=array('arrayfields'=>$arrayfields);
@@ -901,36 +901,36 @@ if ($resql)
// Date creation
if (! empty($arrayfields['c.datec']['checked']))
{
- print '';
- print ' | ';
+ print '';
+ print ' | ';
}
// Date modification
if (! empty($arrayfields['c.tms']['checked']))
{
- print '';
- print ' | ';
+ print '';
+ print ' | ';
}
// Status
if (! empty($arrayfields['c.fk_statut']['checked']))
{
- print '';
- $liststatus=array(
- Commande::STATUS_DRAFT=>$langs->trans("StatusOrderDraftShort"),
- Commande::STATUS_VALIDATED=>$langs->trans("StatusOrderValidated"),
- Commande::STATUS_ACCEPTED=>$langs->trans("StatusOrderSentShort"),
- Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"),
- -3=>$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort").'+'.$langs->trans("StatusOrderDelivered"),
- Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceledShort")
- );
- print $form->selectarray('viewstatut', $liststatus, $viewstatut, -4);
- print ' | ';
+ print '';
+ $liststatus=array(
+ Commande::STATUS_DRAFT=>$langs->trans("StatusOrderDraftShort"),
+ Commande::STATUS_VALIDATED=>$langs->trans("StatusOrderValidated"),
+ Commande::STATUS_SHIPMENTONPROCESS=>$langs->trans("StatusOrderSentShort"),
+ Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"),
+ -3=>$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort").'+'.$langs->trans("StatusOrderDelivered"),
+ Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceledShort")
+ );
+ print $form->selectarray('viewstatut', $liststatus, $viewstatut, -4);
+ print ' | ';
}
// Status billed
if (! empty($arrayfields['c.facture']['checked']))
{
- print '';
- print $form->selectyesno('billed', $billed, 1, 0, 1);
- print ' | ';
+ print '';
+ print $form->selectyesno('billed', $billed, 1, 0, 1);
+ print ' | ';
}
// Action column
print '';
@@ -938,7 +938,7 @@ if ($resql)
print $searchpicto;
print ' | ';
- print "
\n";
+ print "\n";
// Fields title
print '';
- // Ref
- if (! empty($arrayfields['c.ref']['checked']))
- {
- print '| ';
+ // Ref
+ if (! empty($arrayfields['c.ref']['checked']))
+ {
+ print ' | ';
- $generic_commande->lines=array();
- $generic_commande->getLinesArray();
+ $generic_commande->lines=array();
+ $generic_commande->getLinesArray();
- print '';
- print '| ';
- print $generic_commande->getNomUrl(1, ($viewstatut != 2?0:$obj->fk_statut), 0, 0, 0, 1);
- print ' | ';
+ print '';
+ print '| ';
+ print $generic_commande->getNomUrl(1, ($viewstatut != 2?0:$obj->fk_statut), 0, 0, 0, 1);
+ print ' | ';
- // Show shippable Icon (create subloop, so may be slow)
- if ($conf->stock->enabled)
- {
- $langs->load("stocks");
- if (($obj->fk_statut > 0) && ($obj->fk_statut < 3))
- {
- $numlines = count($generic_commande->lines); // Loop on each line of order
- for ($lig=0; $lig < $numlines; $lig++)
- {
- if ($generic_commande->lines[$lig]->product_type == 0 && $generic_commande->lines[$lig]->fk_product > 0) // If line is a product and not a service
- {
- $nbprod++; // order contains real products
- $generic_product->id = $generic_commande->lines[$lig]->fk_product;
+ // Show shippable Icon (create subloop, so may be slow)
+ if ($conf->stock->enabled)
+ {
+ $langs->load("stocks");
+ if (($obj->fk_statut > 0) && ($obj->fk_statut < 3))
+ {
+ $numlines = count($generic_commande->lines); // Loop on each line of order
+ for ($lig=0; $lig < $numlines; $lig++)
+ {
+ if ($generic_commande->lines[$lig]->product_type == 0 && $generic_commande->lines[$lig]->fk_product > 0) // If line is a product and not a service
+ {
+ $nbprod++; // order contains real products
+ $generic_product->id = $generic_commande->lines[$lig]->fk_product;
- // Get local and virtual stock and store it into cache
- if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product])) {
- $generic_product->load_stock('nobatch');
- //$generic_product->load_virtual_stock(); Already included into load_stock
- $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_reel;
- $productstat_cachevirtual[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_theorique;
- } else {
- $generic_product->stock_reel = $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stock_reel'];
- $generic_product->stock_theorique = $productstat_cachevirtual[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_theorique;
- }
+ // Get local and virtual stock and store it into cache
+ if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product])) {
+ $generic_product->load_stock('nobatch');
+ //$generic_product->load_virtual_stock(); Already included into load_stock
+ $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_reel;
+ $productstat_cachevirtual[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_theorique;
+ } else {
+ $generic_product->stock_reel = $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stock_reel'];
+ $generic_product->stock_theorique = $productstat_cachevirtual[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_theorique;
+ }
- if (empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) // Default code. Default is when this option is not set, setting it create strange result
- {
- $text_info .= $generic_commande->lines[$lig]->qty.' X '.$generic_commande->lines[$lig]->ref.' '.dol_trunc($generic_commande->lines[$lig]->product_label, 25);
- $text_info .= ' - '.$langs->trans("Stock").': '.$generic_product->stock_reel;
- $text_info .= ' - '.$langs->trans("VirtualStock").': '.$generic_product->stock_theorique;
- $text_info .= ' ';
+ if (empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) // Default code. Default is when this option is not set, setting it create strange result
+ {
+ $text_info .= $generic_commande->lines[$lig]->qty.' X '.$generic_commande->lines[$lig]->ref.' '.dol_trunc($generic_commande->lines[$lig]->product_label, 25);
+ $text_info .= ' - '.$langs->trans("Stock").': '.$generic_product->stock_reel;
+ $text_info .= ' - '.$langs->trans("VirtualStock").': '.$generic_product->stock_theorique;
+ $text_info .= ' ';
- if ($generic_commande->lines[$lig]->qty > $generic_product->stock_reel)
- {
- $notshippable++;
- }
- }
- else { // Detailed code, looks bugged
- // stock order and stock order_supplier
- $stock_order=0;
- $stock_order_supplier=0;
- if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) // What about other options ?
- {
- if (! empty($conf->commande->enabled))
- {
- if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'])) {
- $generic_product->load_stats_commande(0,'1,2');
- $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'] = $generic_product->stats_commande['qty'];
- } else {
- $generic_product->stats_commande['qty'] = $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'];
- }
- $stock_order=$generic_product->stats_commande['qty'];
- }
- if (! empty($conf->fournisseur->enabled))
- {
- if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'])) {
- $generic_product->load_stats_commande_fournisseur(0,'3');
- $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'] = $generic_product->stats_commande_fournisseur['qty'];
- } else {
- $generic_product->stats_commande_fournisseur['qty'] = $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'];
- }
- $stock_order_supplier=$generic_product->stats_commande_fournisseur['qty'];
- }
- }
- $text_info .= $generic_commande->lines[$lig]->qty.' X '.$generic_commande->lines[$lig]->ref.' '.dol_trunc($generic_commande->lines[$lig]->product_label, 25);
- $text_stock_reel = $generic_product->stock_reel.'/'.$stock_order;
- if ($stock_order > $generic_product->stock_reel && ! ($generic_product->stock_reel < $generic_commande->lines[$lig]->qty)) {
- $warning++;
- $text_warning.=''.$langs->trans('Available').' : '.$text_stock_reel.'';
- }
- if ($generic_product->stock_reel < $generic_commande->lines[$lig]->qty) {
- $notshippable++;
- $text_info.=''.$langs->trans('Available').' : '.$text_stock_reel.'';
- } else {
- $text_info.=''.$langs->trans('Available').' : '.$text_stock_reel.'';
- }
- if (! empty($conf->fournisseur->enabled)) {
- $text_info.= ' '.$langs->trans('SupplierOrder').' : '.$stock_order_supplier.' ';
- } else {
- $text_info.= ' ';
- }
- }
- }
- }
- if ($notshippable==0) {
- $text_icon = img_picto('', 'object_sending');
- $text_info = $langs->trans('Shippable').' '.$text_info;
- } else {
- $text_icon = img_picto('', 'error');
- $text_info = $langs->trans('NonShippable').' '.$text_info;
- }
- }
+ if ($generic_commande->lines[$lig]->qty > $generic_product->stock_reel)
+ {
+ $notshippable++;
+ }
+ }
+ else { // Detailed code, looks bugged
+ // stock order and stock order_supplier
+ $stock_order=0;
+ $stock_order_supplier=0;
+ if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) // What about other options ?
+ {
+ if (! empty($conf->commande->enabled))
+ {
+ if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'])) {
+ $generic_product->load_stats_commande(0,'1,2');
+ $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'] = $generic_product->stats_commande['qty'];
+ } else {
+ $generic_product->stats_commande['qty'] = $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'];
+ }
+ $stock_order=$generic_product->stats_commande['qty'];
+ }
+ if (! empty($conf->fournisseur->enabled))
+ {
+ if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'])) {
+ $generic_product->load_stats_commande_fournisseur(0,'3');
+ $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'] = $generic_product->stats_commande_fournisseur['qty'];
+ } else {
+ $generic_product->stats_commande_fournisseur['qty'] = $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'];
+ }
+ $stock_order_supplier=$generic_product->stats_commande_fournisseur['qty'];
+ }
+ }
+ $text_info .= $generic_commande->lines[$lig]->qty.' X '.$generic_commande->lines[$lig]->ref.' '.dol_trunc($generic_commande->lines[$lig]->product_label, 25);
+ $text_stock_reel = $generic_product->stock_reel.'/'.$stock_order;
+ if ($stock_order > $generic_product->stock_reel && ! ($generic_product->stock_reel < $generic_commande->lines[$lig]->qty)) {
+ $warning++;
+ $text_warning.=''.$langs->trans('Available').' : '.$text_stock_reel.'';
+ }
+ if ($generic_product->stock_reel < $generic_commande->lines[$lig]->qty) {
+ $notshippable++;
+ $text_info.=''.$langs->trans('Available').' : '.$text_stock_reel.'';
+ } else {
+ $text_info.=''.$langs->trans('Available').' : '.$text_stock_reel.'';
+ }
+ if (! empty($conf->fournisseur->enabled)) {
+ $text_info.= ' '.$langs->trans('SupplierOrder').' : '.$stock_order_supplier.' ';
+ } else {
+ $text_info.= ' ';
+ }
+ }
+ }
+ }
+ if ($notshippable==0) {
+ $text_icon = img_picto('', 'object_sending');
+ $text_info = $langs->trans('Shippable').' '.$text_info;
+ } else {
+ $text_icon = img_picto('', 'error');
+ $text_info = $langs->trans('NonShippable').' '.$text_info;
+ }
+ }
- print '';
- if ($nbprod)
- {
- print $form->textwithtooltip('',$text_info,2,1,$text_icon,'',2);
- }
- if ($warning) { // Always false in default mode
- print $form->textwithtooltip('', $langs->trans('NotEnoughForAllOrders').' '.$text_warning, 2, 1, img_picto('', 'error'),'',2);
- }
- print ' | ';
- }
+ print '';
+ if ($nbprod)
+ {
+ print $form->textwithtooltip('',$text_info,2,1,$text_icon,'',2);
+ }
+ if ($warning) { // Always false in default mode
+ print $form->textwithtooltip('', $langs->trans('NotEnoughForAllOrders').' '.$text_warning, 2, 1, img_picto('', 'error'),'',2);
+ }
+ print ' | ';
+ }
- // Warning late icon and note
- print '';
- if ($generic_commande->hasDelay()) {
- print img_picto($langs->trans("Late").' : '.$generic_commande->showDelay(), "warning");
- }
- if (!empty($obj->note_private) || !empty($obj->note_public))
- {
- print ' ';
- print ''.img_picto($langs->trans("ViewPrivateNote"),'object_generic').'';
- print '';
- }
- print ' | ';
+ // Warning late icon and note
+ print '';
+ if ($generic_commande->hasDelay()) {
+ print img_picto($langs->trans("Late").' : '.$generic_commande->showDelay(), "warning");
+ }
+ if (!empty($obj->note_private) || !empty($obj->note_public))
+ {
+ print ' ';
+ print ''.img_picto($langs->trans("ViewPrivateNote"),'object_generic').'';
+ print '';
+ }
+ print ' | ';
- print '';
- $filename=dol_sanitizeFileName($obj->ref);
- $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
- $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
- print $formfile->getDocumentsLink($generic_commande->element, $filename, $filedir);
- print ' | ';
- print ' ';
+ print '';
+ $filename=dol_sanitizeFileName($obj->ref);
+ $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
+ $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
+ print $formfile->getDocumentsLink($generic_commande->element, $filename, $filedir);
+ print ' | ';
+ print ' ';
- print ' | ';
- if (! $i) $totalarray['nbfield']++;
- }
+ print '';
+ if (! $i) $totalarray['nbfield']++;
+ }
// Ref customer
if (! empty($arrayfields['c.ref_client']['checked']))
{
- print ''.$obj->ref_client.' | ';
- if (! $i) $totalarray['nbfield']++;
+ print ''.$obj->ref_client.' | ';
+ if (! $i) $totalarray['nbfield']++;
}
// Project
@@ -1181,167 +1181,167 @@ if ($resql)
// Third party
if (! empty($arrayfields['s.nom']['checked']))
{
- print '';
- print $companystatic->getNomUrl(1,'customer');
+ print ' | ';
+ print $companystatic->getNomUrl(1,'customer');
- // If module invoices enabled and user with invoice creation permissions
- if (! empty($conf->facture->enabled) && ! empty($conf->global->ORDER_BILLING_ALL_CUSTOMER))
- {
- if ($user->rights->facture->creer)
- {
- if (($obj->fk_statut > 0 && $obj->fk_statut < 3) || ($obj->fk_statut == 3 && $obj->billed == 0))
- {
- print ' ';
- print img_picto($langs->trans("CreateInvoiceForThisCustomer").' : '.$companystatic->name, 'object_bill', 'hideonsmartphone').'';
- }
- }
- }
- print ' | ';
- if (! $i) $totalarray['nbfield']++;
+ // If module invoices enabled and user with invoice creation permissions
+ if (! empty($conf->facture->enabled) && ! empty($conf->global->ORDER_BILLING_ALL_CUSTOMER))
+ {
+ if ($user->rights->facture->creer)
+ {
+ if (($obj->fk_statut > 0 && $obj->fk_statut < 3) || ($obj->fk_statut == 3 && $obj->billed == 0))
+ {
+ print ' ';
+ print img_picto($langs->trans("CreateInvoiceForThisCustomer").' : '.$companystatic->name, 'object_bill', 'hideonsmartphone').'';
+ }
+ }
+ }
+ print '';
+ if (! $i) $totalarray['nbfield']++;
}
// Town
if (! empty($arrayfields['s.town']['checked']))
{
- print '';
- print $obj->town;
- print ' | ';
- if (! $i) $totalarray['nbfield']++;
+ 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']++;
+ 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']++;
+ 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']++;
+ 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 (count($typenArray)==0) $typenArray = $formcompany->typent_array(1);
- print $typenArray[$obj->typent_code];
- print ' | ';
- if (! $i) $totalarray['nbfield']++;
+ print '';
+ if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1);
+ print $typenArray[$obj->typent_code];
+ print ' | ';
+ if (! $i) $totalarray['nbfield']++;
}
// Order date
if (! empty($arrayfields['c.date_commande']['checked']))
{
- print '';
- print dol_print_date($db->jdate($obj->date_commande), 'day');
- print ' | ';
- if (! $i) $totalarray['nbfield']++;
+ print '';
+ print dol_print_date($db->jdate($obj->date_commande), 'day');
+ print ' | ';
+ if (! $i) $totalarray['nbfield']++;
}
// Plannned date of delivery
if (! empty($arrayfields['c.date_delivery']['checked']))
{
- print '';
- print dol_print_date($db->jdate($obj->date_delivery), 'day');
- print ' | ';
- if (! $i) $totalarray['nbfield']++;
+ print '';
+ print dol_print_date($db->jdate($obj->date_delivery), 'day');
+ print ' | ';
+ if (! $i) $totalarray['nbfield']++;
+ }
+ // Amount HT
+ if (! empty($arrayfields['c.total_ht']['checked']))
+ {
+ print ''.price($obj->total_ht)." | \n";
+ if (! $i) $totalarray['nbfield']++;
+ if (! $i) $totalarray['totalhtfield']=$totalarray['nbfield'];
+ $totalarray['totalht'] += $obj->total_ht;
+ }
+ // Amount VAT
+ if (! empty($arrayfields['c.total_vat']['checked']))
+ {
+ print ''.price($obj->total_tva)." | \n";
+ if (! $i) $totalarray['nbfield']++;
+ if (! $i) $totalarray['totalvatfield']=$totalarray['nbfield'];
+ $totalarray['totalvat'] += $obj->total_tva;
+ }
+ // Amount TTC
+ if (! empty($arrayfields['c.total_ttc']['checked']))
+ {
+ print ''.price($obj->total_ttc)." | \n";
+ if (! $i) $totalarray['nbfield']++;
+ if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield'];
+ $totalarray['totalttc'] += $obj->total_ttc;
}
- // Amount HT
- if (! empty($arrayfields['c.total_ht']['checked']))
- {
- print ''.price($obj->total_ht)." | \n";
- if (! $i) $totalarray['nbfield']++;
- if (! $i) $totalarray['totalhtfield']=$totalarray['nbfield'];
- $totalarray['totalht'] += $obj->total_ht;
- }
- // Amount VAT
- if (! empty($arrayfields['c.total_vat']['checked']))
- {
- print ''.price($obj->total_tva)." | \n";
- if (! $i) $totalarray['nbfield']++;
- if (! $i) $totalarray['totalvatfield']=$totalarray['nbfield'];
- $totalarray['totalvat'] += $obj->total_tva;
- }
- // Amount TTC
- if (! empty($arrayfields['c.total_ttc']['checked']))
- {
- print ''.price($obj->total_ttc)." | \n";
- if (! $i) $totalarray['nbfield']++;
- if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield'];
- $totalarray['totalttc'] += $obj->total_ttc;
- }
- // Extra fields
- if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
- {
- foreach($extrafields->attribute_label as $key => $val)
- {
- if (! empty($arrayfields["ef.".$key]['checked']))
- {
- print 'getAlignFlag($key);
- if ($align) print ' align="'.$align.'"';
- print '>';
- $tmpkey='options_'.$key;
- print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1);
- print ' | ';
- if (! $i) $totalarray['nbfield']++;
- }
- }
- }
- // Fields from hook
- $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
- $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
- print $hookmanager->resPrint;
- // Date creation
- if (! empty($arrayfields['c.datec']['checked']))
- {
- print '';
- print dol_print_date($db->jdate($obj->date_creation), 'dayhour');
- print ' | ';
- if (! $i) $totalarray['nbfield']++;
- }
- // Date modification
- if (! empty($arrayfields['c.tms']['checked']))
- {
- print '';
- print dol_print_date($db->jdate($obj->date_update), 'dayhour');
- print ' | ';
- if (! $i) $totalarray['nbfield']++;
- }
- // Status
- if (! empty($arrayfields['c.fk_statut']['checked']))
- {
- print ''.$generic_commande->LibStatut($obj->fk_statut, $obj->billed, 5, 1).' | ';
- if (! $i) $totalarray['nbfield']++;
- }
+ // Extra fields
+ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
+ {
+ foreach($extrafields->attribute_label as $key => $val)
+ {
+ if (! empty($arrayfields["ef.".$key]['checked']))
+ {
+ print 'getAlignFlag($key);
+ if ($align) print ' align="'.$align.'"';
+ print '>';
+ $tmpkey='options_'.$key;
+ print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1);
+ print ' | ';
+ if (! $i) $totalarray['nbfield']++;
+ }
+ }
+ }
+ // Fields from hook
+ $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
+ $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
+ print $hookmanager->resPrint;
+ // Date creation
+ if (! empty($arrayfields['c.datec']['checked']))
+ {
+ print '';
+ print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
+ print ' | ';
+ if (! $i) $totalarray['nbfield']++;
+ }
+ // Date modification
+ if (! empty($arrayfields['c.tms']['checked']))
+ {
+ print '';
+ print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
+ print ' | ';
+ if (! $i) $totalarray['nbfield']++;
+ }
+ // Status
+ if (! empty($arrayfields['c.fk_statut']['checked']))
+ {
+ print ''.$generic_commande->LibStatut($obj->fk_statut, $obj->billed, 5, 1).' | ';
+ if (! $i) $totalarray['nbfield']++;
+ }
// Billed
- if (! empty($arrayfields['c.facture']['checked']))
- {
- print ''.yn($obj->billed).' | ';
- if (! $i) $totalarray['nbfield']++;
- }
+ if (! empty($arrayfields['c.facture']['checked']))
+ {
+ print ''.yn($obj->billed).' | ';
+ if (! $i) $totalarray['nbfield']++;
+ }
- // Action 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']++;
+ // Action 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";
@@ -1351,29 +1351,29 @@ if ($resql)
}
// Show total line
- if (isset($totalarray['totalhtfield'])
+ if (isset($totalarray['totalhtfield'])
|| isset($totalarray['totalvatfield'])
|| isset($totalarray['totalttcfield'])
|| isset($totalarray['totalamfield'])
|| isset($totalarray['totalrtpfield'])
)
{
- print '