本文整理汇总了PHP中Propal类的典型用法代码示例。如果您正苦于以下问题:PHP Propal类的具体用法?PHP Propal怎么用?PHP Propal使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Propal类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadBox
/**
* Load data into info_box_contents array to show array 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 . '/comm/propal/class/propal.class.php';
$propalstatic = new Propal($db);
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastPropals", $max));
if ($user->rights->propale->lire) {
$sql = "SELECT s.nom, s.rowid as socid,";
$sql .= " p.rowid, p.ref, p.fk_statut, p.datep as dp, p.datec, p.fin_validite, p.date_cloture";
$sql .= " FROM " . MAIN_DB_PREFIX . "societe as s";
$sql .= ", " . MAIN_DB_PREFIX . "propal as p";
if (!$user->rights->societe->client->voir && !$user->societe_id) {
$sql .= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc";
}
$sql .= " WHERE p.fk_soc = s.rowid";
$sql .= " AND p.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 p.datep DESC, p.ref DESC ";
$sql .= $db->plimit($max, 0);
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
$now = dol_now();
$i = 0;
while ($i < $num) {
$objp = $db->fetch_object($result);
$datec = $db->jdate($objp->datec);
$dateterm = $db->jdate($objp->fin_validite);
$dateclose = $db->jdate($objp->date_cloture);
$late = '';
if ($objp->fk_statut == 1 && $dateterm < $now - $conf->propal->cloture->warning_delay) {
$late = img_warning($langs->trans("Late"));
}
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, 'url' => DOL_URL_ROOT . "/comm/propal.php?id=" . $objp->rowid);
$this->info_box_contents[$i][1] = array('td' => 'align="left"', 'text' => $objp->ref, 'text2' => $late, 'url' => DOL_URL_ROOT . "/comm/propal.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' => dol_trunc($objp->nom, 40), 'url' => DOL_URL_ROOT . "/comm/fiche.php?socid=" . $objp->socid);
$this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => dol_print_date($datec, 'day'));
$this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"', 'text' => $propalstatic->LibStatut($objp->fk_statut, 3));
$i++;
}
if ($num == 0) {
$this->info_box_contents[$i][0] = array('td' => 'align="center"', 'text' => $langs->trans("NoRecordedProposals"));
}
$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('td' => 'align="left"', 'text' => $langs->trans("ReadPermissionNotAllowed"));
}
}
示例2: enteteexpedition
function enteteexpedition(&$expedition)
{
global $langs, $db, $user, $hookmanager, $conf;
$form = new Form($db);
$soc = new Societe($db);
$soc->fetch($expedition->socid);
if (!empty($expedition->origin)) {
$typeobject = $expedition->origin;
$origin = $expedition->origin;
$expedition->fetch_origin();
}
print '<table class="border" width="100%">';
$linkback = '<a href="' . DOL_URL_ROOT . '/expedition/liste.php">' . $langs->trans("BackToList") . '</a>';
// Ref
print '<tr><td width="20%">' . $langs->trans("Ref") . '</td>';
print '<td colspan="3">';
print $form->showrefnav($expedition, 'ref', $linkback, 1, 'ref', 'ref');
print '</td></tr>';
// Customer
print '<tr><td width="20%">' . $langs->trans("Customer") . '</td>';
print '<td colspan="3">' . $soc->getNomUrl(1) . '</td>';
print "</tr>";
// Linked documents
if ($typeobject == 'commande' && $expedition->{$typeobject}->id && !empty($conf->commande->enabled)) {
print '<tr><td>';
$objectsrc = new Commande($db);
$objectsrc->fetch($expedition->{$typeobject}->id);
print $langs->trans("RefOrder") . '</td>';
print '<td colspan="3">';
print $objectsrc->getNomUrl(1, 'commande');
print "</td>\n";
print '</tr>';
}
if ($typeobject == 'propal' && $expedition->{$typeobject}->id && !empty($conf->propal->enabled)) {
print '<tr><td>';
$objectsrc = new Propal($db);
$objectsrc->fetch($expedition->{$typeobject}->id);
print $langs->trans("RefProposal") . '</td>';
print '<td colspan="3">';
print $objectsrc->getNomUrl(1, 'expedition');
print "</td>\n";
print '</tr>';
}
// Ref customer
print '<tr><td>' . $langs->trans("RefCustomer") . '</td>';
print '<td colspan="3">' . $expedition->ref_customer . "</a></td>\n";
print '</tr>';
// Date creation
print '<tr><td>' . $langs->trans("DateCreation") . '</td>';
print '<td colspan="3">' . dol_print_date($expedition->date_creation, "day") . "</td>\n";
print '</tr>';
// Delivery date planed
print '<tr><td height="10">';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('DateDeliveryPlanned');
print '</td>';
print '</tr></table>';
print '</td><td colspan="2">';
print $expedition->date_delivery ? dol_print_date($expedition->date_delivery, 'dayhourtext') : ' ';
print '</td>';
print '</tr>';
// Status
print '<tr><td>' . $langs->trans("Status") . '</td>';
print '<td colspan="3">' . $expedition->getLibStatut(4) . "</td>\n";
print '</tr>';
// Sending method
print '<tr><td height="10">';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('SendingMethod');
print '</td>';
print '</tr></table>';
print '</td><td colspan="2">';
if ($expedition->shipping_method_id > 0) {
// Get code using getLabelFromKey
$code = $langs->getLabelFromKey($db, $expedition->shipping_method_id, 'c_shipment_mode', 'rowid', 'code');
print $langs->trans("SendingMethod" . strtoupper($code));
}
print '</td>';
print '</tr>';
print "</table>\n";
}
示例3: Propal
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . $search_sale;
}
if ($search_user > 0) {
$sql .= " AND c.fk_c_type_contact = tc.rowid AND tc.element='propal' AND tc.source='internal' AND c.element_id = p.rowid AND c.fk_socpeople = " . $search_user;
}
$sql .= ' ORDER BY ' . $sortfield . ' ' . $sortorder . ', p.ref DESC';
$nbtotalofrecords = 0;
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
}
//print $sql;
$sql .= $db->plimit($limit + 1, $offset);
$result = $db->query($sql);
if ($result) {
$objectstatic = new Propal($db);
$userstatic = new User($db);
$num = $db->num_rows($result);
if ($socid) {
$soc = new Societe($db);
$soc->fetch($socid);
}
$param = '&socid=' . $socid . '&viewstatut=' . $viewstatut;
if ($month) {
$param .= '&month=' . $month;
}
if ($year) {
$param .= '&year=' . $year;
}
if ($search_ref) {
$param .= '&search_ref=' . $search_ref;
示例4: Form
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bookmark WHERE rowid=".$_GET["bid"];
$result = $db->query($sql);
}
/*
* View
*/
$now=dol_now();
$html = new Form($db);
$formfile = new FormFile($db);
$companystatic=new Societe($db);
if ($conf->propal->enabled) $propalstatic=new Propal($db);
llxHeader();
print_fiche_titre($langs->trans("CustomerArea"));
print '<table border="0" width="100%" class="notopnoleftnoright">';
print '<tr>';
if (($conf->propal->enabled && $user->rights->propale->lire) ||
($conf->contrat->enabled && $user->rights->contrat->lire) ||
($conf->commande->enabled && $user->rights->commande->lire))
{
print '<td valign="top" width="30%" class="notopnoleft">';
}
示例5: Commande
$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']);
$custcontact = $contactstatic->getFullName($langs, 1);
}
}
if (!empty($custcontact)) {
示例6: classer_facturee
/**
* \brief Classe la commande comme facturee
* \return int <0 si ko, >0 si ok
*/
function classer_facturee()
{
global $conf;
$sql = 'UPDATE ' . MAIN_DB_PREFIX . 'commande SET facture = 1';
$sql .= ' WHERE rowid = ' . $this->id . ' AND fk_statut > 0 ;';
if ($this->db->query($sql)) {
if ($conf->global->PROPALE_CLASSIFIED_INVOICED_WITH_ORDER == 1 && $this->propale_id) {
$propal = new Propal($this->db);
$propal->fetch($this->propale_id);
$propal->classer_facturee();
}
return 1;
} else {
dol_print_error($this->db);
return -1;
}
}
示例7: GETPOST
$langs->load('compta');
// Security check
$socid = 0;
$id = GETPOST('id', 'int');
$ref = GETPOST("ref");
if ($user->societe_id) {
$socid = $user->societe_id;
}
$result = restrictedArea($user, 'propal', $id);
/*
* View Mode
*/
$form = new Form($db);
llxHeader();
if ($id > 0 || !empty($ref)) {
$object = new Propal($db);
if ($object->fetch($id, $ref) > 0) {
$soc = new Societe($db);
$soc->fetch($object->socid);
$head = propal_prepare_head($object);
dol_fiche_head($head, 'preview', $langs->trans('Proposal'), 0, 'propal');
/*
* Propal
*/
print '<table class="border" width="100%">';
$linkback = '<a href="' . DOL_URL_ROOT . '/comm/propal/list.php' . (!empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
// Ref
print '<tr><td>' . $langs->trans('Ref') . '</td><td colspan="5">';
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
print '</td></tr>';
// Ref client
示例8: elseif
} elseif ($tmp == 'NotConfigured') {
print $langs->trans($tmp);
} else {
print $tmp;
}
print '</td>' . "\n";
print '<td align="center">';
if ($conf->global->PROPALE_ADDON == "{$file}") {
print img_picto($langs->trans("Activated"), 'switch_on');
} else {
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setmod&value=' . $file . '">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a>';
}
print '</td>';
$propal = new Propal($db);
$propal->initAsSpecimen();
// Info
$htmltooltip = '';
$htmltooltip .= '' . $langs->trans("Version") . ': <b>' . $module->getVersion() . '</b><br>';
$propal->type = 0;
$nextval = $module->getNextValue($mysoc, $propal);
if ("{$nextval}" != $langs->trans("NotAvailable")) {
$htmltooltip .= '' . $langs->trans("NextValue") . ': ';
if ($nextval) {
$htmltooltip .= $nextval . '<br>';
} else {
$htmltooltip .= $langs->trans($module->error) . '<br>';
}
}
print '<td align="center">';
示例9: propale_delete_preview
/**
* Delete preview files
* @param db objet base de donnee
* @param propalid id de la propal a effacer
* @param propalref reference de la propal si besoin
*/
function propale_delete_preview($db, $propalid, $propalref = '')
{
global $langs, $conf;
require_once DOL_DOCUMENT_ROOT . "/lib/files.lib.php";
if (!$propalref) {
$propal = new Propal($db, "", $propalid);
$propal->fetch($propalid);
$propalref = $propal->ref;
}
if ($conf->propale->dir_output) {
$propalref = dol_sanitizeFileName($propalref);
$dir = $conf->propale->dir_output . "/" . $propalref;
$file = $dir . "/" . $propalref . ".pdf.png";
$multiple = $file . ".";
if (file_exists($file) && is_writable($file)) {
if (!dol_delete_file($file, 1)) {
$this->error = $langs->trans("ErrorFailedToOpenFile", $file);
return 0;
}
} else {
for ($i = 0; $i < 20; $i++) {
$preview = $multiple . $i;
if (file_exists($preview) && is_writable($preview)) {
if (!unlink($preview)) {
$this->error = $langs->trans("ErrorFailedToOpenFile", $preview);
return 0;
}
}
}
}
}
return 1;
}
示例10: Commande
// Number of customer orders a deal
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
include_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php';
$board = new Commande($db);
$dashboardlines[] = $board->load_board($user);
}
// Number of suppliers orders a deal
if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande->lire) {
include_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.commande.class.php';
$board = new CommandeFournisseur($db);
$dashboardlines[] = $board->load_board($user);
}
// Number of commercial proposals opened (expired)
if (!empty($conf->propal->enabled) && $user->rights->propale->lire) {
include_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php';
$board = new Propal($db);
$dashboardlines[] = $board->load_board($user, "opened");
// Number of commercial proposals CLOSED signed (billed)
$dashboardlines[] = $board->load_board($user, "signed");
}
// Number of services enabled (delayed)
if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) {
include_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php';
$board = new Contrat($db);
$dashboardlines[] = $board->load_board($user, "inactives");
// Number of active services (expired)
$dashboardlines[] = $board->load_board($user, "expired");
}
// Number of invoices customers (has paid)
if (!empty($conf->facture->enabled) && $user->rights->facture->lire) {
include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
示例11: GETPOST
* \brief Page d'affichage des infos d'une proposition commerciale
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/propal.lib.php';
$langs->load('propal');
$langs->load('compta');
$id = GETPOST('id', 'int');
$socid = GETPOST('socid', 'int');
// Security check
if (!empty($user->societe_id)) {
$socid = $user->societe_id;
}
$result = restrictedArea($user, 'propal', $id);
/*
* View
*/
llxHeader('', $langs->trans('Proposal'), 'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos');
$object = new Propal($db);
$object->fetch($id);
$object->fetch_thirdparty();
$head = propal_prepare_head($object);
dol_fiche_head($head, 'info', $langs->trans('Proposal'), 0, 'propal');
$object->info($object->id);
print '<table width="100%"><tr><td>';
dol_print_object_info($object);
print '</td></tr></table>';
print '</div>';
llxFooter();
$db->close();
示例12: loadBox
//.........这里部分代码省略.........
$j = 0;
while ($j < $num) {
$data[$j] = $db->fetch_object($result);
$j++;
}
if (!empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
dol_filecache($cachedir, $filename, $data);
}
$db->free($result);
} else {
dol_print_error($db);
}
} else {
$data = dol_readcachefile($cachedir, $filename);
}
$cumuldata = array_merge($cumuldata, $data);
if (!empty($data)) {
$j = 0;
while ($line < count($cumuldata)) {
$this->info_box_contents[$line][0] = array('td' => 'align="left" width="16"', 'url' => DOL_URL_ROOT . "/commande/list.php?mainmenu=commercial&leftmenu=orders&viewstatut=" . $data[$j]->fk_statut, 'tooltip' => $langs->trans("Orders") . " " . $commandestatic->LibStatut($data[$j]->fk_statut, 0, 0), 'logo' => 'object_order');
$this->info_box_contents[$line][1] = array('td' => 'align="left"', 'text' => $langs->trans("Orders") . " " . $commandestatic->LibStatut($data[$j]->fk_statut, 0, 0));
$this->info_box_contents[$line][2] = array('td' => 'align="right"', 'text' => $data[$j]->nb, 'tooltip' => $langs->trans("Orders") . " " . $commandestatic->LibStatut($data[$j]->fk_statut, 0, 0), 'url' => DOL_URL_ROOT . "/commande/list.php?mainmenu=commercial&leftmenu=orders&viewstatut=" . $data[$j]->fk_statut);
$totalnb += $data[$j]->nb;
$this->info_box_contents[$line][3] = array('td' => 'align="right"', 'text' => price($data[$j]->Mnttot, 1, $langs, 0, 0, -1, $conf->currency));
$totalMnt += $data[$j]->Mnttot;
$this->info_box_contents[$line][4] = array('td' => 'align="right" width="18"', 'text' => $commandestatic->LibStatut($data[$j]->fk_statut, 0, 3));
$line++;
$j++;
}
}
}
// list the summary of the propals
if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
include_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php';
$propalstatic = new Propal($db);
$cachedir = DOL_DATA_ROOT . '/propale/temp';
$filename = '/boxactivity-propal' . $fileid;
$refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
$data = array();
if ($refresh) {
$sql = "SELECT p.fk_statut, SUM(p.total) as Mnttot, COUNT(*) as nb";
$sql .= " FROM (" . MAIN_DB_PREFIX . "societe as s, " . MAIN_DB_PREFIX . "propal as p";
if (!$user->rights->societe->client->voir && !$user->societe_id) {
$sql .= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc";
}
$sql .= ")";
$sql .= " WHERE p.entity = " . $conf->entity;
$sql .= " AND p.fk_soc = s.rowid";
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 .= " AND p.datep >= '" . $db->idate($tmpdate) . "'";
$sql .= " AND p.date_cloture IS NULL";
// just unclosed
$sql .= " GROUP BY p.fk_statut";
$sql .= " ORDER BY p.fk_statut DESC";
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
$j = 0;
while ($j < $num) {
$data[$j] = $db->fetch_object($result);
$j++;
}
if (!empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
dol_filecache($cachedir, $filename, $data);
}
$db->free($result);
} else {
dol_print_error($db);
}
} else {
$data = dol_readcachefile($cachedir, $filename);
}
$cumuldata = array_merge($cumuldata, $data);
if (!empty($data)) {
$j = 0;
while ($line < count($cumuldata)) {
$this->info_box_contents[$line][0] = array('td' => 'align="left" width="16"', 'url' => DOL_URL_ROOT . "/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&viewstatut=" . $data[$j]->fk_statut, 'tooltip' => $langs->trans("Proposals") . " " . $propalstatic->LibStatut($data[$j]->fk_statut, 0), 'logo' => 'object_propal');
$this->info_box_contents[$line][1] = array('td' => 'align="left"', 'text' => $langs->trans("Proposals") . " " . $propalstatic->LibStatut($data[$j]->fk_statut, 0));
$this->info_box_contents[$line][2] = array('td' => 'align="right"', 'text' => $data[$j]->nb, 'tooltip' => $langs->trans("Proposals") . " " . $propalstatic->LibStatut($data[$j]->fk_statut, 0), 'url' => DOL_URL_ROOT . "/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&viewstatut=" . $data[$j]->fk_statut);
$totalnb += $data[$j]->nb;
$this->info_box_contents[$line][3] = array('td' => 'align="right"', 'text' => price($data[$j]->Mnttot, 1, $langs, 0, 0, -1, $conf->currency));
$totalMnt += $data[$j]->Mnttot;
$this->info_box_contents[$line][4] = array('td' => 'align="right" width="18"', 'text' => $propalstatic->LibStatut($data[$j]->fk_statut, 3));
$line++;
$j++;
}
}
}
// Add the sum in the bottom of the boxes
$this->info_box_contents[$line][0] = array('tr' => 'class="liste_total"');
$this->info_box_contents[$line][1] = array('td' => 'align="left" class="liste_total" ', 'text' => $langs->trans("Total") . " " . $textHead);
$this->info_box_contents[$line][2] = array('td' => 'align="right" class="liste_total" ', 'text' => $totalnb);
$this->info_box_contents[$line][3] = array('td' => 'align="right" class="liste_total" ', 'text' => '');
$this->info_box_contents[$line][4] = array('td' => 'align="right" class="liste_total" ', 'text' => "");
}
示例13: GETPOST
*/
require "../../main.inc.php";
require_once DOL_DOCUMENT_ROOT . "/comm/propal/class/propal.class.php";
require_once DOL_DOCUMENT_ROOT . "/core/lib/propal.lib.php";
$langs->load('propal');
$langs->load('compta');
$langs->load('bills');
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'alpha');
// Security check
if ($user->societe_id) {
$socid = $user->societe_id;
}
$result = restrictedArea($user, 'propale', $id, 'propal');
$object = new Propal($db);
/******************************************************************************/
/* Actions */
/******************************************************************************/
if ($action == 'setnote_public' && $user->rights->propale->creer) {
$object->fetch($id);
$result = $object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
if ($result < 0) {
dol_print_error($db, $object->error);
}
} else {
if ($action == 'setnote' && $user->rights->propale->creer) {
$object->fetch($id);
$result = $object->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES));
if ($result < 0) {
dol_print_error($db, $object->error);
示例14: loadBox
//.........这里部分代码省略.........
$this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => price($objp->Mnttot, 1, $langs, 0, 0, -1, $conf->currency));
$totalMnt += $objp->Mnttot;
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"', 'text' => $facturestatic->LibStatut(0, $objp->fk_statut, 3));
$i++;
}
if ($num == 0) {
$this->info_box_contents[$i][0] = array('td' => 'align="center"', 'text' => $langs->trans("NoRecordedInvoices"));
}
} else {
$this->info_box_contents[0][0] = array('td' => 'align="left"', 'maxlength' => 500, 'text' => $db->error() . ' sql=' . $sql);
}
}
// list the summary of the orders
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
include_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php';
$commandestatic = new Commande($db);
$sql = "SELECT c.fk_statut, sum(c.total_ttc) as Mnttot, count(*) as nb";
$sql .= " FROM (" . MAIN_DB_PREFIX . "societe as s, " . MAIN_DB_PREFIX . "commande as c";
if (!$user->rights->societe->client->voir && !$user->societe_id) {
$sql .= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc";
}
$sql .= ")";
$sql .= " WHERE c.entity = " . $conf->entity;
$sql .= " AND c.fk_soc = s.rowid";
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 .= " AND c.date_commande >= '" . $db->idate($tmpdate) . "'";
$sql .= " AND c.facture=0";
$sql .= " GROUP BY c.fk_statut";
$sql .= " ORDER BY c.fk_statut DESC";
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result) + $i;
while ($i < $num) {
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => 'object_order');
$objp = $db->fetch_object($result);
$this->info_box_contents[$i][1] = array('td' => 'align="left"', 'text' => $langs->trans("Orders") . " " . $commandestatic->LibStatut($objp->fk_statut, 0, 0));
$this->info_box_contents[$i][2] = array('td' => 'align="right"', 'text' => $objp->nb, 'url' => DOL_URL_ROOT . "/commande/liste.php?mainmenu=commercial&leftmenu=orders&viewstatut=" . $objp->fk_statut);
$totalnb += $objp->nb;
$this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => price($objp->Mnttot, 1, $langs, 0, 0, -1, $conf->currency));
$totalMnt += $objp->Mnttot;
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"', 'text' => $commandestatic->LibStatut($objp->fk_statut, 0, 3));
$i++;
}
} else {
dol_print_error($db);
}
}
// list the summary of the propals
if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
include_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php';
$propalstatic = new Propal($db);
$sql = "SELECT p.fk_statut, SUM(p.total) as Mnttot, COUNT(*) as nb";
$sql .= " FROM (" . MAIN_DB_PREFIX . "societe as s, " . MAIN_DB_PREFIX . "propal as p";
if (!$user->rights->societe->client->voir && !$user->societe_id) {
$sql .= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc";
}
$sql .= ")";
$sql .= " WHERE p.entity = " . $conf->entity;
$sql .= " AND p.fk_soc = s.rowid";
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 .= " AND p.datep >= '" . $db->idate($tmpdate) . "'";
$sql .= " AND p.date_cloture IS NULL";
// just unclosed
$sql .= " GROUP BY p.fk_statut";
$sql .= " ORDER BY p.fk_statut DESC";
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result) + $i;
while ($i < $num) {
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => 'object_propal');
$objp = $db->fetch_object($result);
$this->info_box_contents[$i][1] = array('td' => 'align="left"', 'text' => $langs->trans("Proposals") . " " . $propalstatic->LibStatut($objp->fk_statut, 0));
$this->info_box_contents[$i][2] = array('td' => 'align="right"', 'text' => $objp->nb, 'url' => DOL_URL_ROOT . "/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&viewstatut=" . $objp->fk_statut);
$totalnb += $objp->nb;
$this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => price($objp->Mnttot, 1, $langs, 0, 0, -1, $conf->currency));
$totalMnt += $objp->Mnttot;
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"', 'text' => $propalstatic->LibStatut($objp->fk_statut, 3));
$i++;
}
} else {
dol_print_error($db);
}
}
// Add the sum in the bottom of the boxes
$this->info_box_contents[$i][1] = array('td' => 'align="left" ', 'text' => $langs->trans("Total") . " " . $textHead);
$this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => price($totalnb, 1, $langs, 0, 0, -1, $conf->currency));
$this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => price($totalMnt, 1, $langs, 0, 0, -1, $conf->currency));
$this->info_box_contents[$i][4] = array('td' => 'align="right" ', 'text' => "");
$this->info_box_contents[$i][5] = array('td' => 'align="right"', 'text' => "");
}
示例15: Commande
/* *************************************************************************** */
if ($id > 0 || !empty($ref)) {
$object = new Commande($db);
if ($object->fetch($id, $ref) > 0) {
$soc = new Societe($db);
$soc->fetch($object->socid);
$head = commande_prepare_head($object);
dol_fiche_head($head, 'preview', $langs->trans("CustomerOrder"), 0, 'order');
print '<table class="border" width="100%">';
// Ref
print '<tr><td width="18%">' . $langs->trans("Ref") . "</td>";
print '<td colspan="2">' . $object->ref . '</td>';
print '<td width="50%">' . $langs->trans("Source") . ' : ' . $object->getLabelSource();
if ($object->source == 0) {
// Propale
$propal = new Propal($db);
$propal->fetch($object->propale_id);
print ' -> <a href="' . DOL_URL_ROOT . '/comm/propal.php?id=' . $propal->id . '">' . $propal->ref . '</a>';
}
print "</td></tr>";
// Ref cde client
print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td nowrap>';
print $langs->trans('RefCustomer') . '</td><td align="left">';
print '</td>';
print '</tr></table>';
print '</td>';
print '<td colspan="2">';
print $object->ref_client;
print '</td>';
$nbrow = 6;