コード例 #1
0
 /**
  *    Return combo list of differents status of a orders
  *
  *    @param	string	$selected   Preselected value
  *    @param	int		$short		Use short labels
  *    @param	string	$hmlname	Name of HTML select element
  *    @return	void
  */
 function selectSupplierOrderStatus($selected = '', $short = 0, $hmlname = 'order_status')
 {
     $tmpsupplierorder = new CommandeFournisseur($db);
     print '<select class="flat" name="' . $hmlname . '">';
     print '<option value="-1">&nbsp;</option>';
     $statustohow = array('0' => '0', '1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6,7', '9' => '9');
     // 7 is same label than 6. 8 does not exists (billed is another field)
     foreach ($statustohow as $key => $value) {
         print '<option value="' . $value . '"' . ($selected == $key || $selected == $value ? ' selected' : '') . '>';
         $tmpsupplierorder->statut = $key;
         print $tmpsupplierorder->getLibStatut($short);
         print '</option>';
     }
     print '</select>';
 }
コード例 #2
0
                $var = True;
                while ($i < $num && $i < $conf->liste_limit) {
                    $objp = $db->fetch_object($result);
                    $var = !$var;
                    $commandestatic->id = $objp->commandeid;
                    $commandestatic->ref = $objp->ref;
                    $commandestatic->statut = $objp->statut;
                    print "<tr " . $bc[$var] . ">";
                    print '<td>' . $commandestatic->getNomUrl(1) . "</td>\n";
                    print "</a></td>\n";
                    print '<td><a href="' . DOL_URL_ROOT . '/fourn/card.php?socid=' . $objp->socid . '">' . img_object($langs->trans("ShowCompany"), "company") . ' ' . dol_trunc($objp->name, 44) . '</a></td>';
                    print "<td>" . $objp->code_client . "</td>\n";
                    print '<td align="center">' . dol_print_date($db->jdate($objp->date_commande)) . "</td>";
                    print "<td align=\"center\">" . $objp->qty . "</td>\n";
                    print '<td align="right">' . price($objp->total_ht) . "</td>\n";
                    print '<td align="right">' . $commandestatic->getLibStatut(4) . '</td>';
                    print "</tr>\n";
                    $i++;
                }
            }
        } else {
            dol_print_error($db);
        }
        print "</table>";
        print '<br>';
        $db->free($result);
    }
} else {
    dol_print_error();
}
llxFooter();
コード例 #3
0
         $var = !$var;
         print '<tr ' . $bc[$var] . '>';
         print '<td>';
         $supplierorderstatic->id = $objp->commandeid;
         $supplierorderstatic->ref = $objp->ref;
         $supplierorderstatic->statut = $objp->statut;
         print $supplierorderstatic->getNomUrl(1);
         print "</td>\n";
         $societestatic->fetch($objp->socid);
         print '<td>' . $societestatic->getNomUrl(1) . '</td>';
         print "<td>" . $objp->code_client . "</td>\n";
         print '<td align="center">';
         print dol_print_date($db->jdate($objp->date_commande)) . "</td>";
         print '<td align="center">' . $objp->qty . "</td>\n";
         print '<td align="right">' . price($objp->total_ht) . "</td>\n";
         print '<td align="right">' . $supplierorderstatic->getLibStatut(4) . '</td>';
         print "</tr>\n";
         $i++;
         if (!empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
             $total_ht += $objp->total_ht;
             $total_qty += $objp->qty;
         }
     }
 }
 print '<tr class="liste_total">';
 print '<td>' . $langs->trans('Total') . '</td>';
 print '<td colspan="3"></td>';
 print '<td align="center">' . $total_qty . '</td>';
 print '<td align="right">' . price($total_ht) . '</td>';
 print '<td></td>';
 print "</table>";
コード例 #4
0
ファイル: consumption.php プロジェクト: ADDAdev/Dolibarr
 $documentstatic->id = $objp->doc_id;
 $documentstatic->ref = $objp->doc_number;
 $documentstatic->type = $objp->type;
 $documentstatic->fk_statut = $objp->status;
 $documentstatic->fk_status = $objp->status;
 $documentstatic->statut = $objp->status;
 $documentstatic->status = $objp->status;
 $var = !$var;
 print "<tr " . $bc[$var] . ">";
 print '<td class="nobordernopadding nowrap" width="100">';
 print $documentstatic->getNomUrl(1);
 print '</td>';
 print '<td align="center" width="80">' . dol_print_date($db->jdate($objp->dateprint), 'day') . '</td>';
 // Status
 print '<td align="center">';
 print $documentstatic->getLibStatut(2);
 print '</td>';
 print '<td>';
 // Define text, description and type
 $text = '';
 $description = '';
 $type = 0;
 // Code to show product duplicated from commonobject->printObjectLine
 if ($objp->fk_product > 0) {
     $product_static = new Product($db);
     $product_static->type = $objp->fk_product_type;
     $product_static->id = $objp->fk_product;
     $product_static->ref = $objp->ref;
     $text = $product_static->getNomUrl(1);
 }
 // Product
コード例 #5
0
function _fiche(&$PDOdb, &$assetOf, $mode = 'edit', $fk_product_to_add = 0, $fk_nomenclature = 0)
{
    global $langs, $db, $conf, $user, $hookmanager;
    /***************************************************
     * PAGE
     *
     * Put here all code to build page
     ****************************************************/
    $parameters = array('id' => $assetOf->getId());
    $reshook = $hookmanager->executeHooks('doActions', $parameters, $assetOf, $mode);
    // Note that $action and $object may have been modified by hook
    //pre($assetOf,true);
    llxHeader('', $langs->trans('OFAsset'), '', '');
    print dol_get_fiche_head(ofPrepareHead($assetOf, 'assetOF'), 'fiche', $langs->trans('OFAsset'));
    ?>
<style type="text/css">
		#assetChildContener .OFMaster {
			
			background:#fff;
			-webkit-box-shadow: 4px 4px 5px 0px rgba(50, 50, 50, 0.52);
			-moz-box-shadow:    4px 4px 5px 0px rgba(50, 50, 50, 0.52);
			box-shadow:         4px 4px 5px 0px rgba(50, 50, 50, 0.52);
			
			margin-bottom:20px;
		}
		
	</style>
		<div class="OFContent" rel="<?php 
    echo $assetOf->getId();
    ?>
">	<?php 
    $TPrixFournisseurs = array();
    //$form=new TFormCore($_SERVER['PHP_SELF'],'formeq'.$assetOf->getId(),'POST');
    //Affichage des erreurs
    if (!empty($assetOf->errors)) {
        ?>
		<br><div class="error">
		<?php 
        foreach ($assetOf->errors as $error) {
            echo $error . "<br>";
            setEventMessage($error, 'errors');
        }
        $assetOf->errors = array();
        ?>
		</div><br>
		<?php 
    }
    $form = new TFormCore();
    $form->Set_typeaff($mode);
    $doliform = new Form($db);
    if (!empty($_REQUEST['fk_product'])) {
        echo $form->hidden('fk_product', $_REQUEST['fk_product']);
    }
    $TBS = new TTemplateTBS();
    $liste = new TListviewTBS('asset');
    $TBS->TBS->protect = false;
    $TBS->TBS->noerr = true;
    $PDOdb = new TPDOdb();
    $TNeeded = array();
    $TToMake = array();
    $TNeeded = _fiche_ligne($form, $assetOf, "NEEDED");
    $TToMake = _fiche_ligne($form, $assetOf, "TO_MAKE");
    $TIdCommandeFourn = $assetOf->getElementElement($PDOdb);
    $HtmlCmdFourn = '';
    if (count($TIdCommandeFourn)) {
        foreach ($TIdCommandeFourn as $idcommandeFourn) {
            $cmd = new CommandeFournisseur($db);
            $cmd->fetch($idcommandeFourn);
            $HtmlCmdFourn .= $cmd->getNomUrl(1) . " - " . $cmd->getLibStatut(0);
        }
    }
    ob_start();
    $doliform->select_produits('', 'fk_product', '', $conf->product->limit_size, 0, -1, 2, '', 3, array());
    $select_product = ob_get_clean();
    $Tid = array();
    //$Tid[] = $assetOf->rowid;
    if ($assetOf->getId() > 0) {
        $assetOf->getListeOFEnfants($PDOdb, $Tid);
    }
    $TWorkstation = array();
    foreach ($assetOf->TAssetWorkstationOF as $k => &$TAssetWorkstationOF) {
        $ws =& $TAssetWorkstationOF->ws;
        $TWorkstation[] = array('libelle' => '<a href="' . dol_buildpath('workstation/workstation.php?id=' . $ws->rowid . '&action=view', 2) . '">' . $ws->name . '</a>', 'fk_user' => visu_checkbox_user($PDOdb, $form, $ws->fk_usergroup, $TAssetWorkstationOF->users, 'TAssetWorkstationOF[' . $k . '][fk_user][]', $assetOf->status), 'fk_project_task' => visu_project_task($db, $TAssetWorkstationOF->fk_project_task, $form->type_aff, 'TAssetWorkstationOF[' . $k . '][progress]'), 'fk_task' => visu_checkbox_task($PDOdb, $form, $TAssetWorkstationOF->fk_asset_workstation, $TAssetWorkstationOF->tasks, 'TAssetWorkstationOF[' . $k . '][fk_task][]', $assetOf->status), 'nb_hour' => $assetOf->status == 'DRAFT' && $mode == "edit" ? $form->texte('', 'TAssetWorkstationOF[' . $k . '][nb_hour]', $TAssetWorkstationOF->nb_hour, 3, 10) : ($conf->global->ASSET_USE_CONVERT_TO_TIME ? convertSecondToTime($TAssetWorkstationOF->nb_hour * 3600) : price($TAssetWorkstationOF->nb_hour)), 'nb_hour_real' => $assetOf->status == 'OPEN' && $mode == "edit" ? $form->texte('', 'TAssetWorkstationOF[' . $k . '][nb_hour_real]', $TAssetWorkstationOF->nb_hour_real, 3, 10) : ($conf->global->ASSET_USE_CONVERT_TO_TIME ? convertSecondToTime($TAssetWorkstationOF->nb_hour_real * 3600) : price($TAssetWorkstationOF->nb_hour_real)), 'nb_days_before_beginning' => $assetOf->status == 'DRAFT' && $mode == "edit" ? $form->texte('', 'TAssetWorkstationOF[' . $k . '][nb_days_before_beginning]', $TAssetWorkstationOF->nb_days_before_beginning, 3, 10) : $TAssetWorkstationOF->nb_days_before_beginning, 'delete' => $mode == 'edit' && $assetOf->status == 'DRAFT' ? '<a href="javascript:deleteWS(' . $assetOf->getId() . ',' . $TAssetWorkstationOF->getId() . ');">' . img_picto('Supprimer', 'delete.png') . '</a>' : '', 'note_private' => $assetOf->status == 'DRAFT' && $mode == 'edit' ? $form->zonetexte('', 'TAssetWorkstationOF[' . $k . '][note_private]', $TAssetWorkstationOF->note_private, 50, 1) : $TAssetWorkstationOF->note_private, 'rang' => $assetOf->status == 'DRAFT' && $mode == "edit" ? $form->texte('', 'TAssetWorkstationOF[' . $k . '][rang]', $TAssetWorkstationOF->rang, 3, 10) : $TAssetWorkstationOF->rang, 'id' => $ws->getId());
    }
    $client = new Societe($db);
    if ($assetOf->fk_soc > 0) {
        $client->fetch($assetOf->fk_soc);
    }
    $commande = new Commande($db);
    if ($assetOf->fk_commande > 0) {
        $commande->fetch($assetOf->fk_commande);
    }
    $TOFParent = array_merge(array(0 => ''), $assetOf->getCanBeParent($PDOdb));
    $hasParent = false;
    if (!empty($assetOf->fk_assetOf_parent)) {
        $TAssetOFParent = new TAssetOF();
        $TAssetOFParent->load($PDOdb, $assetOf->fk_assetOf_parent);
        $hasParent = true;
    }
    $parameters = array('id' => $assetOf->getId());
    $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $assetOf, $mode);
    // Note that $action and $object may have been modified by hook
    if ($fk_product_to_add > 0) {
        $product_to_add = new Product($db);
        $product_to_add->fetch($fk_product_to_add);
        $link_product_to_add = $product_to_add->getNomUrl(1) . ' ' . $product_to_add->label;
        $quantity_to_create = $form->texte('', 'quantity_to_create', 1, 3, 255);
    } else {
        $link_product_to_add = '';
        $quantity_to_create = '';
    }
    print $TBS->render('tpl/fiche_of.tpl.php', array('TNeeded' => $TNeeded, 'TTomake' => $TToMake, 'workstation' => $TWorkstation), array('assetOf' => array('id' => $assetOf->getId(), 'numero' => $assetOf->getId() > 0 ? '<a href="fiche_of.php?id=' . $assetOf->getId() . '">' . $assetOf->getNumero($PDOdb) . '</a>' : $assetOf->getNumero($PDOdb), 'ordre' => $form->combo('', 'ordre', TAssetOf::$TOrdre, $assetOf->ordre), 'fk_commande' => $assetOf->fk_commande == 0 ? '' : $commande->getNomUrl(1), 'commande_fournisseur' => $HtmlCmdFourn, 'date_besoin' => $form->calendrier('', 'date_besoin', $assetOf->date_besoin, 12, 12), 'date_lancement' => $form->calendrier('', 'date_lancement', $assetOf->date_lancement, 12, 12), 'temps_estime_fabrication' => price($assetOf->temps_estime_fabrication, 0, '', 1, -1, 2), 'temps_reel_fabrication' => price($assetOf->temps_reel_fabrication, 0, '', 1, -1, 2), 'fk_soc' => $mode == 'edit' ? $doliform->select_company($assetOf->fk_soc, 'fk_soc', 'client=1', 1) : ($client->id ? $client->getNomUrl(1) : ''), 'fk_project' => custom_select_projects(-1, $assetOf->fk_project, 'fk_project', $mode), 'note' => $form->zonetexte('', 'note', $assetOf->note, 80, 5), 'quantity_to_create' => $quantity_to_create, 'product_to_create' => $link_product_to_add, 'status' => $form->combo('', 'status', TAssetOf::$TStatus, $assetOf->status), 'statustxt' => TAssetOf::$TStatus[$assetOf->status], 'idChild' => !empty($Tid) ? '"' . implode('","', $Tid) . '"' : '', 'url' => dol_buildpath('/of/fiche_of.php', 2), 'url_liste' => $assetOf->getId() ? dol_buildpath('/of/fiche_of.php?id=' . $assetOf->getId(), 2) : dol_buildpath('/of/liste_of.php', 2), 'fk_product_to_add' => $fk_product_to_add, 'fk_nomenclature' => $fk_nomenclature, 'fk_assetOf_parent' => $assetOf->fk_assetOf_parent ? $assetOf->fk_assetOf_parent : '', 'link_assetOf_parent' => $hasParent ? '<a href="' . dol_buildpath('/of/fiche_of.php?id=' . $TAssetOFParent->rowid, 2) . '">' . $TAssetOFParent->numero . '</a>' : '', 'total_cost' => price($assetOf->total_cost, 0, '', 1, -1, 2), 'total_estimated_cost' => price($assetOf->total_estimated_cost, 0, '', 1, -1, 2), 'mo_cost' => price($assetOf->mo_cost, 0, '', 1, -1, 2), 'mo_estimated_cost' => price($assetOf->mo_estimated_cost, 0, '', 1, -1, 2), 'compo_cost' => price($assetOf->compo_cost, 0, '', 1, -1, 2), 'compo_estimated_cost' => price($assetOf->compo_estimated_cost, 0, '', 1, -1, 2), 'current_cost_for_to_make' => price($assetOf->current_cost_for_to_make, 0, '', 1, -1, 2)), 'view' => array('mode' => $mode, 'status' => $assetOf->status, 'allow_delete_of_finish' => $user->rights->of->of->allow_delete_of_finish, 'ASSET_USE_MOD_NOMENCLATURE' => (int) $conf->nomenclature->enabled, 'OF_MINIMAL_VIEW_CHILD_OF' => (int) $conf->global->OF_MINIMAL_VIEW_CHILD_OF, 'select_product' => $select_product, 'select_workstation' => $form->combo('', 'fk_asset_workstation', TWorkstation::getWorstations($PDOdb), -1), 'actionChild' => $mode == 'edit' ? __get('actionChild', 'edit') : __get('actionChild', 'view'), 'use_lot_in_of' => (int) (!empty($conf->asset->enabled) && !empty($conf->global->USE_LOT_IN_OF)), 'use_project_task' => (int) $conf->global->ASSET_USE_PROJECT_TASK, 'defined_user_by_workstation' => (int) $conf->global->ASSET_DEFINED_USER_BY_WORKSTATION, 'defined_task_by_workstation' => (int) $conf->global->ASSET_DEFINED_OPERATION_BY_WORKSTATION, 'defined_workstation_by_needed' => (int) $conf->global->ASSET_DEFINED_WORKSTATION_BY_NEEDED, 'defined_manual_wharehouse' => (int) $conf->global->ASSET_MANUAL_WAREHOUSE, 'hasChildren' => (int) (!empty($Tid)), 'user_id' => $user->id, 'workstation_module_activate' => (int) $conf->workstation->enabled, 'show_cost' => (int) $user->rights->of->of->price), 'rights' => array('show_ws_time' => $user->rights->of->of->show_ws_time)));
    echo $form->end_form();
    llxFooter('$Date: 2011/07/31 22:21:57 $ - $Revision: 1.19 $');
}