本文整理汇总了PHP中Commande类的典型用法代码示例。如果您正苦于以下问题:PHP Commande类的具体用法?PHP Commande怎么用?PHP Commande使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Commande类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getList
public function getList($order, $critere, $debut, $nbres)
{
$query = $this->getRequest('list', $order, $critere, $debut, $nbres);
$resul = $this->query($query);
$retour = array();
while ($resul && ($row = $this->fetch_object($resul))) {
$thisClient = array();
$thisClient['ref'] = $row->ref;
$thisClient['entreprise'] = $row->entreprise;
$thisClient['nom'] = $row->nom;
$thisClient['prenom'] = $row->prenom;
$thisClient['email'] = $row->email;
$commande = new Commande();
$devise = new Devise();
$querycom = "SELECT id FROM {$commande->table} WHERE client={$row->id} AND statut NOT IN(" . Commande::NONPAYE . "," . Commande::ANNULE . ") ORDER BY date DESC LIMIT 0,1";
$resulcom = $commande->query($querycom);
if ($commande->num_rows($resulcom) > 0) {
$idcom = $commande->get_result($resulcom, 0, "id");
$commande->charger($idcom);
$devise->charger($commande->devise);
$thisClient['date'] = strftime("%d/%m/%Y %H:%M:%S", strtotime($commande->date));
$thisClient['somme'] = formatter_somme($commande->total(true, true)) . ' ' . $devise->symbole;
} else {
$thisClient['date'] = '';
$thisClient['somme'] = '';
}
$retour[] = $thisClient;
}
return $retour;
}
开发者ID:anti-conformiste,项目名称:thelia1,代码行数:30,代码来源:ClientAdmin.class.php
示例2: loadBox
/**
* Load data for box to show them later
*
* @param int $max Maximum number of records to load
* @return void
*/
function loadBox($max = 5)
{
global $user, $langs, $db, $conf;
$this->max = $max;
include_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php';
$commandestatic = new Commande($db);
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastCustomerOrders", $max));
if ($user->rights->commande->lire) {
$sql = "SELECT s.nom, s.rowid as socid,";
$sql .= " c.ref, c.tms, c.rowid,";
$sql .= " c.fk_statut, c.facture";
$sql .= " FROM " . MAIN_DB_PREFIX . "societe as s";
$sql .= ", " . MAIN_DB_PREFIX . "commande as c";
if (!$user->rights->societe->client->voir && !$user->societe_id) {
$sql .= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc";
}
$sql .= " WHERE c.fk_soc = s.rowid";
$sql .= " AND c.entity = " . $conf->entity;
if (!$user->rights->societe->client->voir && !$user->societe_id) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . $user->id;
}
if ($user->societe_id) {
$sql .= " AND s.rowid = " . $user->societe_id;
}
$sql .= " ORDER BY c.date_commande DESC, c.ref DESC ";
$sql .= $db->plimit($max, 0);
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
$i = 0;
while ($i < $num) {
$objp = $db->fetch_object($result);
$datem = $db->jdate($objp->tms);
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, 'url' => DOL_URL_ROOT . "/commande/fiche.php?id=" . $objp->rowid);
$this->info_box_contents[$i][1] = array('td' => 'align="left"', 'text' => $objp->ref, 'url' => DOL_URL_ROOT . "/commande/fiche.php?id=" . $objp->rowid);
$this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"', 'logo' => 'company', 'url' => DOL_URL_ROOT . "/comm/fiche.php?socid=" . $objp->socid);
$this->info_box_contents[$i][3] = array('td' => 'align="left"', 'text' => $objp->nom, 'url' => DOL_URL_ROOT . "/comm/fiche.php?socid=" . $objp->socid);
$this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => dol_print_date($datem, 'day'));
$this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"', 'text' => $commandestatic->LibStatut($objp->fk_statut, $objp->facture, 3));
$i++;
}
if ($num == 0) {
$this->info_box_contents[$i][0] = array('td' => 'align="center"', 'text' => $langs->trans("NoRecordedOrders"));
}
$db->free($result);
} else {
$this->info_box_contents[0][0] = array('td' => 'align="left"', 'maxlength' => 500, 'text' => $db->error() . ' sql=' . $sql);
}
} else {
$this->info_box_contents[0][0] = array('align' => 'left', 'text' => $langs->trans("ReadPermissionNotAllowed"));
}
}
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:58,代码来源:box_commandes.php
示例3: getInstance
public static function getInstance($typeMatch, $phase, $place, $typeBillet, $nomUtilisateur, $password)
{
if (is_null(self::$_instance)) {
self::$_instance = new Commande($typeMatch, $phase, $place, $typeBillet, $nomUtilisateur, $password);
}
return self::$_instance;
}
开发者ID:pduthoit,项目名称:CPOA-S3,代码行数:7,代码来源:Commande.php
示例4: confirmedCart
public function confirmedCart()
{
//on récupère l'id du client
$id = Session::get('client_id');
//on trouve le client avec son id
$user = User::find($id);
//on charge les données pour la création de la commande
$data = array('id_client' => $user->id);
//on créer une nouvelle commande
$commande = Commande::create($data);
//on récupère les données de la session cart
$cart_aray = Session::get('cart');
foreach ($cart_aray as $c_array) {
foreach ($c_array as $cart_line) {
//on charge les données avant de créer une nouvelle ligne de commande
$data = array('id_client' => $user->id, 'id_produit' => $cart_line['id'], 'quantite' => 1, 'id_command' => $commande->id);
// pour chaque tour, on crée une nouvelle ligne de commande dans la base
$ligne_commande = LigneCommande::create($data);
}
}
//on supprime la session cart, et on la recrée vide.
Session::forget('cart');
Session::put('cart.items', '');
return View::make('confirmed_cart');
}
开发者ID:nitishpeeroo,项目名称:HiTechOnline,代码行数:25,代码来源:CartController.php
示例5: substitcommande
function substitcommande($texte)
{
global $commande;
if ($commande) {
$refs = $commande;
} else {
$refs = $_SESSION['navig']->commande->ref;
}
$texte = str_replace("#COMMANDE_TRANSPORT", $_SESSION['navig']->commande->transport, $texte);
$tcommande = new Commande();
$tcommande->charger_ref($refs);
$texte = str_replace("#COMMANDE_ID", $tcommande->id, $texte);
$texte = str_replace("#COMMANDE_REF", $tcommande->ref, $texte);
$texte = str_replace("#COMMANDE_TRANSACTION", $tcommande->transaction, $texte);
return $texte;
}
开发者ID:anti-conformiste,项目名称:thelia1,代码行数:16,代码来源:substitcommande.php
示例6: update
public function update(Commande $commande){
$query = $this->_db->prepare(
'UPDATE t_commande SET
idFournisseur=:idFournisseur, idProjet=:idProjet, dateCommande=:dateCommande,
numeroCommande=:numeroCommande, designation=:designation, updated=:updated,
updatedBy=:updatedBy
WHERE id=:id')
or die (print_r($this->_db->errorInfo()));
$query->bindValue(':id', $commande->id());
$query->bindValue(':idFournisseur', $commande->idFournisseur());
$query->bindValue(':idProjet', $commande->idProjet());
$query->bindValue(':dateCommande', $commande->dateCommande());
$query->bindValue(':numeroCommande', $commande->numeroCommande());
$query->bindValue(':designation', $commande->designation());
$query->bindValue(':updated', $commande->updated());
$query->bindValue(':updatedBy', $commande->updatedBy());
$query->execute();
$query->closeCursor();
}
开发者ID:aassou,项目名称:Annahda,代码行数:19,代码来源:CommandeManager.php
示例7: afficherListeCommandes
/**
* Affiche la liste de commandes
* @return renvoie true si le tableau n'est pas vide
*/
function afficherListeCommandes()
{
//requete sql
$fin_req = "";
if ($this->numclient) {
$fin_req .= " AND numclient='{$this->numclient}'";
}
if ($this->erreur_paiement) {
$fin_req .= " AND erreur_paiement='{$this->erreur_paiement}'";
}
if ($this->type_reg) {
$fin_req .= " AND tpereg='{$this->type_reg}'";
}
if ($this->date_du && $this->date_au) {
$fin_req .= " AND hcrea BETWEEN {$this->date_du} AND {$this->date_au}";
} else {
if ($this->date_du) {
$fin_req .= " AND hcrea >= {$this->date_du}";
} else {
if ($this->date_au) {
$fin_req .= " AND hcrea <= {$this->date_au}";
}
}
}
/*if ($this->formation) $result=mysql_query("SELECT if_bo_com.numcom FROM if_bo_com,if_bo_detail WHERE if_bo_com.numcom=if_bo_detail.numcom AND if_bo_detail.designation='Inscription formation' $fin_req ORDER BY hcrea DESC");
else $result=mysql_query("SELECT if_bo_com.numcom FROM if_bo_com,if_bo_detail WHERE etat $this->etat $fin_req AND if_bo_com.numcom=if_bo_detail.numcom ORDER BY hcrea DESC");*/
if ($this->formation) {
$result = mysql_query("SELECT if_bo_com.numcom FROM if_bo_com,if_bo_detail WHERE if_bo_com.numcom=if_bo_detail.numcom AND if_bo_detail.designation='Inscription formation' {$fin_req} ORDER BY hcrea DESC");
} else {
//$result=mysql_query("SELECT if_bo_com.numcom FROM if_bo_com,if_bo_detail WHERE etat $this->etat $fin_req AND if_bo_com.numcom=if_bo_detail.numcom ORDER BY hcrea DESC");
$result = mysql_query("SELECT if_bo_com.numcom FROM if_bo_com WHERE etat {$this->etat} {$fin_req} ORDER BY hcrea DESC");
}
// echo "SELECT numcom FROM if_bo_com WHERE etat $this->etat $fin_req ORDER BY hcrea DESC";
while ($row = mysql_fetch_row($result)) {
$uneCommande = new Commande();
$uneCommande->numcom = $row[0];
$uneCommande->infosCommande();
$this->commandes[] = $uneCommande;
}
if (count($this->commandes) >= 1) {
return true;
}
}
开发者ID:rcampistron,项目名称:ParagrapheCMS,代码行数:47,代码来源:ListeCommandes.inc.php
示例8: trad
?>
</th>
<th><?php
echo trad('MONTANT_euro', 'admin');
?>
</th>
<th><?php
echo trad('STATUT', 'admin');
?>
</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
$commande = new Commande();
$query = "SELECT * FROM " . Commande::TABLE . " WHERE client='" . $client->id . "' ORDER BY date DESC";
$resul = $commande->query($query);
while ($resul && ($cmd = $commande->fetch_object($resul, 'Commande'))) {
$statutdesc = new Statutdesc();
$statutdesc->charger($cmd->statut);
switch ($cmd->statut) {
case '1':
$trClass = 'warning';
break;
case '4':
$trClass = 'success';
break;
case '5':
$trClass = 'error';
break;
开发者ID:anti-conformiste,项目名称:thelia1,代码行数:31,代码来源:client_visualiser.php
示例9: create
//.........这里部分代码省略.........
$sql .= ", " . ($this->fk_project ? $this->fk_project : "null");
$sql .= ", " . $this->cond_reglement_id;
$sql .= ", " . $this->mode_reglement_id;
$sql .= ", '" . $this->db->idate($datelim) . "', '" . $this->db->escape($this->modelpdf) . "'";
$sql .= ", " . ($this->situation_cycle_ref ? "'" . $this->db->escape($this->situation_cycle_ref) . "'" : "null");
$sql .= ", " . ($this->situation_counter ? "'" . $this->db->escape($this->situation_counter) . "'" : "null");
$sql .= ", " . ($this->situation_final ? $this->situation_final : 0);
$sql .= ", " . (int) $this->fk_incoterms;
$sql .= ", '" . $this->db->escape($this->location_incoterms) . "'";
$sql .= ")";
dol_syslog(get_class($this) . "::create", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql) {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . 'facture');
// Update ref with new one
$this->ref = '(PROV' . $this->id . ')';
$sql = 'UPDATE ' . MAIN_DB_PREFIX . "facture SET facnumber='" . $this->ref . "' WHERE rowid=" . $this->id;
dol_syslog(get_class($this) . "::create", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
$error++;
}
// Add object linked
if (!$error && $this->id && is_array($this->linked_objects) && !empty($this->linked_objects)) {
foreach ($this->linked_objects as $origin => $origin_id) {
$ret = $this->add_object_linked($origin, $origin_id);
if (!$ret) {
dol_print_error($this->db);
$error++;
}
// TODO mutualiser
if ($origin == 'commande') {
// On recupere les differents contact interne et externe
$order = new Commande($this->db);
$order->id = $origin_id;
// On recupere le commercial suivi propale
$this->userid = $order->getIdcontact('internal', 'SALESREPFOLL');
if ($this->userid) {
//On passe le commercial suivi commande en commercial suivi paiement
$this->add_contact($this->userid[0], 'SALESREPFOLL', 'internal');
}
// On recupere le contact client facturation commande
$this->contactid = $order->getIdcontact('external', 'BILLING');
if ($this->contactid) {
//On passe le contact client facturation commande en contact client facturation
$this->add_contact($this->contactid[0], 'BILLING', 'external');
}
}
}
}
/*
* Insert lines of invoices into database
*/
if (count($this->lines) && is_object($this->lines[0])) {
$fk_parent_line = 0;
dol_syslog("There is " . count($this->lines) . " lines that are invoice lines objects");
foreach ($this->lines as $i => $val) {
$newinvoiceline = $this->lines[$i];
$newinvoiceline->fk_facture = $this->id;
$newinvoiceline->origin = $this->element;
$newinvoiceline->origin_id = $this->lines[$i]->id;
if ($result >= 0 && ($newinvoiceline->info_bits & 0x1) == 0) {
// Reset fk_parent_line for no child products and special product
if ($newinvoiceline->product_type != 9 && empty($newinvoiceline->fk_parent_line) || $newinvoiceline->product_type == 9) {
$fk_parent_line = 0;
}
开发者ID:Samara94,项目名称:dolibarr,代码行数:67,代码来源:facture.class.php
示例10: actionPaypalPayment
public function actionPaypalPayment()
{
$customer_model = new Customer();
$commande_model = new Commande();
$customer_model->attributes = Yii::app()->user->getState('Customer');
$commande_model->attributes = Yii::app()->user->getState('Commande');
if (sizeof($customer_model->search()->getData()) == 0) {
$customer_model->bilsignupip = CHttpRequest::getUserHostAddress();
$customer_model->save();
$commande_model->bilkey = $customer_model->bilkey;
$commande_model->comdebut = date("Y-m-d");
$commande_model->save();
} else {
$customerTemp = $customer_model->search()->getData();
$customer_model->bilkey = $customerTemp[0]->attributes['bilkey'];
}
if (isset($_POST['payment_status'])) {
if ($_POST['payment_status'] == "Completed" || $_POST['payment_status'] == "Pending") {
$city = Goodcity::model()->findByPk($_POST['item_number']);
$this->sendEmailConfirmation($customer_model, $city, $commande_model, $_POST['txn_id'], $this->getInvoiceTotals($customer_model, $commande_model));
$this->render('application/2-orderform', array('goodcity' => $city, 'thanks' => true, 'payment_type' => "paypal", 'payment_method' => "email", 'order_totals' => $this->getInvoiceTotals($customer_model, $commande_model), 'customer_model' => $customer_model, 'commande_model' => $commande_model, 'auth_code' => $_POST['txn_id']));
} else {
$this->redirect(array('user/order', 'transactionError' => true));
}
} else {
$city = Goodcity::model()->findByPk($commande_model['comgoodcitykey']);
$this->redirect(array('user/signup', 'city' => $commande_model['comgoodcitykey']));
}
}
开发者ID:E-SOFTinc,项目名称:Mailnetwork_Yii,代码行数:29,代码来源:UserController.php
示例11: Commande
$var=!$var;
print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("YourEMail");
print ' ('.$langs->trans("ToComplete").')';
print '</td><td class="CTableRow'.($var?'1':'2').'"><input class="flat" type="text" name="email" size="48" value="'.GETPOST("email").'"></td></tr>'."\n";
}
// Payment on customer order
if (GETPOST("source") == 'order')
{
$found=true;
$langs->load("orders");
require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
$order=new Commande($db);
$result=$order->fetch('',$_REQUEST["ref"]);
if ($result < 0)
{
$mesg=$order->error;
$error++;
}
else
{
$result=$order->fetch_thirdparty($order->socid);
}
$amount=$order->total_ttc;
if (GETPOST("amount",'int')) $amount=GETPOST("amount",'int');
$amount=price2num($amount);
开发者ID:remyyounes,项目名称:dolibarr,代码行数:30,代码来源:newpayment.php
示例12: Commande
$formmail->withtocc = $liste;
$formmail->withtoccc = $conf->global->MAIN_EMAIL_USECCC;
$formmail->withtopic = $outputlangs->trans('SendShippingRef', '__SHIPPINGREF__');
$formmail->withfile = 2;
$formmail->withbody = 1;
$formmail->withdeliveryreceipt = 1;
$formmail->withcancel = 1;
// Tableau des substitutions
$formmail->substit['__SHIPPINGREF__'] = $object->ref;
$formmail->substit['__SIGNATURE__'] = $user->signature;
$formmail->substit['__PERSONALIZED__'] = '';
$formmail->substit['__CONTACTCIVNAME__'] = '';
//Find the good contact adress
//Find the good contact adress
if ($typeobject == 'commande' && $object->{$typeobject}->id && !empty($conf->commande->enabled)) {
$objectsrc = new Commande($db);
$objectsrc->fetch($object->{$typeobject}->id);
}
if ($typeobject == 'propal' && $object->{$typeobject}->id && !empty($conf->propal->enabled)) {
$objectsrc = new Propal($db);
$objectsrc->fetch($object->{$typeobject}->id);
}
$custcontact = '';
$contactarr = array();
$contactarr = $objectsrc->liste_contact(-1, 'external');
if (is_array($contactarr) && count($contactarr) > 0) {
foreach ($contactarr as $contact) {
if ($contact['libelle'] == $langs->trans('TypeContact_commande_external_CUSTOMER')) {
require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
$contactstatic = new Contact($db);
$contactstatic->fetch($contact['id']);
开发者ID:NoisyBoy86,项目名称:Dolibarr_test,代码行数:31,代码来源:card.php
示例13: array
print '<td align="right">';
$liststatus = array('0' => $langs->trans("StatusOrderDraftShort"), '1' => $langs->trans("StatusOrderValidated"), '2' => $langs->trans("StatusOrderSentShort"), '3' => $langs->trans("StatusOrderDelivered"), '-1' => $langs->trans("StatusOrderCanceledShort"));
print $form->selectarray('viewstatut', $liststatus, $viewstatut, -4);
print '</td>';
print '<td align="center">';
print $form->selectyesno('billed', $billed, 1, 0, 1);
print '</td>';
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="' . img_picto($langs->trans("Search"), 'search.png', '', '', 1) . '" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">';
print '<input type="image" class="liste_titre" name="button_removefilter" src="' . img_picto($langs->trans("Search"), 'searchclear.png', '', '', 1) . '" value="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '" title="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '">';
print "</td></tr>\n";
$var = true;
$total = 0;
$subtotal = 0;
$productstat_cache = array();
$i = 0;
$generic_commande = new Commande($db);
$generic_product = new Product($db);
while ($i < min($num, $limit)) {
$objp = $db->fetch_object($resql);
$var = !$var;
print '<tr ' . $bc[$var] . '>';
print '<td class="nowrap">';
$generic_commande->id = $objp->rowid;
$generic_commande->ref = $objp->ref;
$generic_commande->statut = $objp->fk_statut;
$generic_commande->date_commande = $db->jdate($objp->date_commande);
$generic_commande->date_livraison = $db->jdate($objp->date_delivery);
$generic_commande->ref_client = $objp->ref_client;
$generic_commande->total_ht = $objp->total_ht;
$generic_commande->total_tva = $objp->total_tva;
$generic_commande->total_ttc = $objp->total_ttc;
开发者ID:Samara94,项目名称:dolibarr,代码行数:31,代码来源:list.php
示例14: createFromClone
/**
* Load an object from its id and create a new one in database
* @param fromid Id of object to clone
* @param invertdetail Reverse sign of amounts for lines
* @param socid Id of thirdparty
* @return int New id of clone
*/
function createFromClone($fromid, $invertdetail = 0, $socid = 0)
{
global $conf, $user, $langs;
$error = 0;
$object = new Commande($this->db);
// Instantiate hooks of thirdparty module
if (is_array($conf->hooks_modules) && !empty($conf->hooks_modules)) {
$object->callHooks('ordercard');
}
$this->db->begin();
// Load source object
$object->fetch($fromid);
$objFrom = $object;
// Change socid if needed
if (!empty($socid) && $socid != $object->socid) {
$objsoc = new Societe($this->db);
if ($objsoc->fetch($socid) > 0) {
$object->socid = $objsoc->id;
$object->cond_reglement_id = !empty($objsoc->cond_reglement_id) ? $objsoc->cond_reglement_id : 0;
$object->mode_reglement_id = !empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0;
$object->fk_project = '';
$object->fk_delivery_address = '';
}
// TODO Change product price if multi-prices
}
$object->id = 0;
$object->statut = 0;
// Clear fields
$object->user_author_id = $user->id;
$object->user_valid = '';
$object->date_creation = '';
$object->date_validation = '';
$object->ref_client = '';
// Create clone
$result = $object->create($user);
// Other options
if ($result < 0) {
$this->error = $object->error;
$error++;
}
if (!$error) {
// Hook of thirdparty module
if (!empty($object->hooks)) {
foreach ($object->hooks as $hook) {
if (!empty($hook['modules'])) {
foreach ($hook['modules'] as $module) {
if (method_exists($module, 'createfrom')) {
$result = $module->createfrom($objFrom, $result, $object->element);
if ($result < 0) {
$error++;
}
}
}
}
}
}
// Appel des triggers
include_once DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php";
$interface = new Interfaces($this->db);
$result = $interface->run_triggers('ORDER_CLONE', $object, $user, $langs, $conf);
if ($result < 0) {
$error++;
$this->errors = $interface->errors;
}
// Fin appel triggers
}
// End
if (!$error) {
$this->db->commit();
return $object->id;
} else {
$this->db->rollback();
return -1;
}
}
开发者ID:ripasch,项目名称:dolibarr,代码行数:82,代码来源:commande.class.php
示例15: dol_print_error
print '</tr>';
} else {
print '<tr ' . $bc[$var] . '><td colspan="5">' . $langs->trans("None") . '</td></tr>';
}
print "</table><br>";
$db->free($resql);
} else {
dol_print_error($db);
}
}
}
/*
* Customers orders to be billed
*/
if (!empty($conf->facture->enabled) && !empty($conf->commande->enabled) && $user->rights->commande->lire) {
$commandestatic = new Commande($db);
$langs->load("orders");
$sql = "SELECT sum(f.total) as tot_fht, sum(f.total_ttc) as tot_fttc,";
$sql .= " s.nom, s.rowid as socid,";
$sql .= " c.rowid, c.ref, c.facture, c.fk_statut, c.total_ht, c.total_ttc";
$sql .= " FROM " . MAIN_DB_PREFIX . "societe as s";
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc";
}
$sql .= ", " . MAIN_DB_PREFIX . "commande as c";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "element_element as el ON el.fk_source = c.rowid AND el.sourcetype = 'commande'";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture AS f ON el.fk_target = f.rowid AND el.targettype = 'facture'";
$sql .= " WHERE c.fk_soc = s.rowid";
$sql .= " AND c.entity = " . $conf->entity;
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . $user->id;
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:31,代码来源:index.php
示例16: Commande
print '<table class="border" width="100%">';
// Ref
print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';
print '<td colspan="3">'.$delivery->ref.'</td></tr>';
// Client
print '<tr><td width="20%">'.$langs->trans("Customer").'</td>';
print '<td align="3">'.$soc->getNomUrl(1).'</td>';
print "</tr>";
// Document origine
if ($typeobject == 'commande' && $expedition->origin_id && $conf->commande->enabled)
{
print '<tr><td>'.$langs->trans("RefOrder").'</td>';
$order=new Commande($db);
$order->fetch($expedition->origin_id);
print '<td colspan="3">';
print $order->getNomUrl(1,'commande');
print "</td>\n";
print '</tr>';
}
if ($typeobject == 'propal' && $expedition->origin_id && $conf->propal->enabled)
{
$propal=new Propal($db);
$propal->fetch($expedition->origin_id);
print '<tr><td>'.$langs->trans("RefProposal").'</td>';
print '<td colspan="3">';
print $propal->getNomUrl(1,'expedition');
print "</td>\n";
print '</tr>';
开发者ID:remyyounes,项目名称:dolibarr,代码行数:31,代码来源:fiche.php
示例17: catch
$prenom = $post['prenom'];
} else {
$prenom = null;
}
if (!empty($post['login'])) {
$login = $post['login'];
} else {
$login = null;
}
if (!empty($post['dateDeb'])) {
$date_com_deb = $post['dateDeb'];
} else {
$date_com_deb = null;
}
if (!empty($post['dateFin'])) {
$date_com_fin = $post['dateFin'];
} else {
$date_com_fin = null;
}
try {
$listeCom = Commande::getCommandesBy($id_com, $id_utilisateur, $nom, $prenom, $login, $date_com_deb, $date_com_fin);
$parameters['commande'] = $listeCom;
} catch (Exception $e) {
$parameters['error'] = $e->getMessage();
}
$smarty->assign('parameters', $parameters);
$ligneCom = array();
foreach ($parameters['commande'] as $key => $value) {
$ligneCom[] = Commande::getLigneCom($value['id_com']);
}
$smarty->assign('ligneCom', $ligneCom);
开发者ID:ThierryHund,项目名称:CCLeclour,代码行数:31,代码来源:gestionCommandes_select.php
示例18: initAsSpecimen
/**
* Initialise an instance with random values.
* Used to build previews or test instances.
* id must be 0 if object instance is a specimen.
*
* @return void
*/
function initAsSpecimen()
{
global $user, $langs, $conf;
$now = dol_now();
dol_syslog(get_class($this) . "::initAsSpecimen");
// Charge tableau des produits prodids
$prodids = array();
$sql = "SELECT rowid";
$sql .= " FROM " . MAIN_DB_PREFIX . "product";
$sql .= " WHERE entity IN (" . getEntity('product', 1) . ")";
$resql = $this->db->query($sql);
if ($resql) {
$num_prods = $this->db->num_rows($resql);
$i = 0;
while ($i < $num_prods) {
$i++;
$row = $this->db->fetch_row($resql);
$prodids[$i] = $row[0];
}
}
$order = new Commande($this->db);
$order->initAsSpecimen();
// Initialise parametres
$this->id = 0;
$this->ref = 'SPECIMEN';
$this->specimen = 1;
$this->statut = 1;
$this->livraison_id = 0;
$this->date = $now;
$this->date_creation = $now;
$this->date_valid = $now;
$this->date_delivery = $now;
$this->date_expedition = $now + 24 * 3600;
$this->entrepot_id = 0;
$this->fk_delivery_address = 0;
$this->socid = 1;
$this->commande_id = 0;
$this->commande = $order;
$this->origin_id = 1;
$this->origin = 'commande';
$this->note_private = 'Private note';
$this->note_public = 'Public note';
$nbp = 5;
$xnbp = 0;
while ($xnbp < $nbp) {
$line = new ExpeditionLigne($this->db);
$line->desc = $langs->trans("Description") . " " . $xnbp;
$line->libelle = $langs->trans("Description") . " " . $xnbp;
$line->qty = 10;
$line->qty_asked = 5;
$line->qty_shipped = 4;
$line->fk_product = $this->commande->lines[$xnbp]->fk_product;
$this->lines[] = $line;
$xnbp++;
}
}
开发者ID:Albertopf,项目名称:prueba,代码行数:63,代码来源:expedition.class.php
示例19: GETPOST
}
$langs->load('orders');
$langs->load('sendings');
$langs->load('companies');
$langs->load('bills');
$langs->load('propal');
$langs->load('deliveries');
$langs->load('products');
$id = GETPOST("id") ? GETPOST("id") : GETPOST("orderid");
$ref = GETPOST('ref');
$socid = GETPOST('socid');
$action = GETPOST('action');
$confirm = GETPOST('confirm');
$lineid = GETPOST('lineid');
$mesg = GETPOST('mesg');
$object = new Commande($db);
// Security check
if ($user->societe_id) {
$socid = $user->societe_id;
}
$result = restrictedArea($user, 'commande', $id, '');
// Instantiate hooks of thirdparty module
if (is_array($conf->hooks_modules) && !empty($conf->hooks_modules)) {
$object->callHooks('ordercard');
}
/******************************************************************************/
/* Actions */
/******************************************************************************/
// Hook of actions
if (!empty($object->hooks)) {
foreach ($object->hooks as $hook) {
开发者ID:ripasch,项目名称:dolibarr,代码行数:31,代码来源:fiche.php
示例20: _pagehead
/**
* Show top header of page.
*
* @param PDF &$pdf Object PDF
* @param Object $object Object to show
* @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output
* @return void
*/
function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
{
global $langs, $conf, $mysoc;
$default_font_size = pdf_getPDFFontSize($outputlangs);
pdf_pagehead($pdf, $outputlangs, $this->page_hauteur);
$pdf->SetTextColor(0, 0, 60);
$pdf->SetFont('', 'B', $default_font_size + 3);
$posx = $this->page_largeur - $this->marge_droite - 100;
$posy = $this->marge_haute;
$pdf->SetXY($this->marge_gauche, $posy);
// Logo
$logo = $conf->mycompany->dir_output . '/logos/' . $mysoc->logo;
if ($mysoc->logo) {
if (is_readable($logo)) {
$height = pdf_getHeightForLogo($logo);
$pdf->Image($logo, $this->marge_gauche, $posy, 0, $height);
// width=0 (auto)
} else {
$pdf->SetTextColor(200, 0, 0);
$pdf->SetFont('', 'B', $default_font_size - 2);
$pdf->MultiCell(100, 3, $langs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L');
$pdf->MultiCell(100, 3, $langs->transnoentities("ErrorGoToModuleSetup"), 0, 'L');
}
} else {
$pdf->MultiCell(100, 4, $this->emetteur->name, 0, 'L');
}
$pdf->SetFont('', 'B', $default_font_size + 2);
$pdf->SetXY($posx, $posy);
$pdf->SetTextColor(0, 0, 60);
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("DeliveryOrder") . " " . $outputlangs->convToOutputCharset($object->ref), '', 'R');
$pdf->SetFont('', '', $default_font_size + 2);
$posy += 5;
$pdf->SetXY($posx, $posy);
$pdf->SetTextColor(0, 0, 60);
if ($object->date_valid) {
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("Date") . " : " . dol_print_date($object->date_delivery ? $object->date_delivery : $date->valid, "%d %b %Y", false, $outputlangs, true), '', 'R');
} else {
$pdf->SetTextColor(255, 0, 0);
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("DeliveryNotValidated"), '', 'R');
$pdf->SetTextColor(0, 0, 60);
}
if ($object->client->code_client) {
$posy += 5;
$pdf->SetXY($posx, $posy);
$pdf->SetTextColor(0, 0, 60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode") . " : " . $outputlangs->transnoentities($object->client->code_client), '', 'R');
}
$pdf->SetTextColor(0, 0, 60);
// Add origin linked objects
// TODO extend to other objects
$object->fetchObjectLinked('', '', $object->id, 'delivery');
if (!empty($object->linkedObjects)) {
$outputlangs->load('orders');
foreach ($object->linkedObjects as $elementtype => $objects) {
$object->fetchObjectLinked('', '', $objects[0]->id, $objects[0]->element);
foreach ($object->linkedObjects as $elementtype => $objects) {
$num = count($objects);
for ($i = 0; $i < $num
|
请发表评论