当前位置: 首页>>代码示例>>PHP>>正文


PHP Place::fetch方法代码示例

本文整理汇总了PHP中Place::fetch方法的典型用法代码示例。如果您正苦于以下问题:PHP Place::fetch方法的具体用法?PHP Place::fetch怎么用?PHP Place::fetch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Place的用法示例。


在下文中一共展示了Place::fetch方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Ticket

if ($object->fk_cash == '9' || $object->fk_cash == '10') {
    echo "Moreno Valley #199 <br>San Juan de los Lagos, Jal.<br>01(395) 785 3005";
}
?>
<br><br>
		
		<?php 
// Variables
$object = new Ticket($db);
$result = $object->fetch($id, $ref);
$userstatic = new User($db);
$userstatic->fetch($object->user_close);
print $langs->trans("Vendor") . ': ' . $userstatic->firstname . ' ' . $userstatic->lastname . '<br><br>';
if (!empty($object->fk_place)) {
    $place = new Place($db);
    $place->fetch($object->fk_place);
    print $langs->trans("Place") . ': ' . $place->name . "</p>";
}
?>
	</div>
</div>

<div><?php 
// Recuperation et affichage de la date et de l'heure
$now = dol_now();
$label = $object->ref;
$facture = new Facture($db);
if ($object->fk_facture) {
    $facture->fetch($object->fk_facture);
    $label = $facture->ref;
}
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:31,代码来源:ticket.tpl.php

示例2: fillMailFactureBody

 /**
  * Fill the body of email's message with a facture
  *
  * @param int $id
  *
  * @return string		String with ticket data
  */
 public static function fillMailFactureBody($id)
 {
     global $db, $conf, $langs, $mysoc;
     $langs->Load("rewards@rewards");
     $facture = new Facture($db);
     $res = $facture->fetch($id);
     $mysoc = new Societe($db);
     $mysoc->fetch($facture->socid);
     $userstatic = new User($db);
     $userstatic->fetch($facture->user_valid);
     $label = $facture->ref;
     $message = $conf->global->MAIN_INFO_SOCIETE_NOM . " \n" . $conf->global->MAIN_INFO_SOCIETE_ADRESSE . " \n" . $conf->global->MAIN_INFO_SOCIETE_CP . ' ' . $conf->global->MAIN_INFO_SOCIETE_VILLE . " \n\n";
     $message .= $label . " \n" . dol_print_date($facture->date_creation, 'dayhourtext') . " \n";
     $message .= $langs->transnoentities("Vendor") . ': ' . $userstatic->fistname . " " . $userstatic->lastname . "\n";
     $sql = "SELECT fk_place,fk_cash FROM " . MAIN_DB_PREFIX . "pos_facture WHERE fk_facture =" . $facture->id;
     $result = $db->query($sql);
     if ($result) {
         $objp = $db->fetch_object($result);
         if ($objp->fk_place > 0) {
             $place = new Place($db);
             $place->fetch($objp->fk_place);
             $message .= $langs->trans("Place") . ': ' . $place->name . "\n";
         }
     }
     $message .= "\n";
     $message .= $langs->transnoentities("Label") . "\t\t\t\t\t\t" . $langs->transnoentities("Qty") . "/" . $langs->transnoentities("Price") . "\t\t" . $langs->transnoentities("Total") . "\n";
     //$facture->getLinesArray();
     if (!empty($facture->lines)) {
         $subtotal = 0;
         foreach ($facture->lines as $line) {
             $espacio = '';
             $totalline = $line->qty * $line->subprice;
             if (empty($line->libelle)) {
                 $line->libelle = $line->description;
             }
             while (dol_strlen(dol_trunc($line->libelle, 30) . $espacio) < 29) {
                 $espacio .= "    \t";
             }
             $message .= dol_trunc($line->libelle, 33) . $espacio;
             $message .= "\t\t" . $line->qty . " * " . price($line->subprice) . "\t\t" . price($line->total_ht) . ' ' . $langs->trans(currency_name($conf->currency)) . "\n";
             $subtotal[$line->tva_tx] += $line->total_ht;
             $subtotaltva[$line->tva_tx] += $line->total_tva;
             if (!empty($line->total_localtax1)) {
                 $localtax1 = $line->localtax1_tx;
             }
             if (!empty($line->total_localtax2)) {
                 $localtax2 = $line->localtax2_tx;
             }
         }
     } else {
         $message .= $langs->transnoentities("ErrNoArticles") . "\n";
     }
     $message .= $langs->transnoentities("TotalTTC") . ":\t" . price($facture->total_ttc) . " " . $langs->trans(currency_name($conf->currency)) . "\n";
     $message .= "\n" . $langs->trans("TotalHT") . "\t" . $langs->trans("VAT") . "\t" . $langs->trans("TotalVAT") . "\n";
     if (!empty($subtotal)) {
         foreach ($subtotal as $totkey => $totval) {
             if ($tvakey > 0) {
                 $message .= price($subtotal[$totkey], "", "", "", "", 2) . "\t\t\t" . price($totkey, "", "", "", "", 2) . "%\t" . price($subtotaltva[$totkey], "", "", "", "", 2) . "\n";
             }
         }
     }
     $message .= "-------------------------------\n";
     $message .= price($facture->total_ht, "", "", "", "", 2) . "\t\t\t----\t" . price($facture->total_tva, "", "", "", "", 2) . "\n";
     if ($facture->total_localtax1 != 0) {
         $message .= $langs->transcountrynoentities("TotalLT1", $mysoc->country_code) . " " . price($localtax1, "", "", "", "", 2) . "%\t" . price($facture->total_localtax1, "", "", "", "", 2) . " " . $langs->trans(currency_name($conf->currency)) . "\n";
     }
     if ($facture->total_localtax2 != 0) {
         $message .= $langs->transcountrynoentities("TotalLT2", $mysoc->country_code) . " " . price($localtax2, "", "", "", "", 2) . "%\t" . price($facture->total_localtax2, "", "", "", "", 2) . " " . $langs->trans(currency_name($conf->currency)) . "\n";
     }
     $message .= "\n\n";
     $terminal = new Cash($db);
     $sql = 'SELECT fk_cash, customer_pay FROM ' . MAIN_DB_PREFIX . 'pos_facture WHERE fk_facture = ' . $facture->id;
     $resql = $db->query($sql);
     $obj = $db->fetch_object($resql);
     $customer_pay = $obj->customer_pay;
     $terminal->fetch($obj > fk_cash);
     if (!empty($conf->rewards->enabled)) {
         $rewards = new Rewards($db);
         $points = $rewards->getInvoicePoints($facture->id);
     }
     if ($facture->type == 0) {
         $pay = $facture->getSommePaiement();
         if (!empty($conf->rewards->enabled)) {
             $usepoints = abs($rewards->getInvoicePoints($facture->id, 1));
             $moneypoints = abs($usepoints * $conf->global->REWARDS_DISCOUNT);
             //falta fer algo per aci
             if ($customer_pay > $pay - $moneypoints) {
                 $pay = $customer_pay;
             } else {
                 $pay = $pay - $moneypoints;
             }
         } else {
             if ($customer_pay > $pay) {
//.........这里部分代码省略.........
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:101,代码来源:pos.class.mañanero.php

示例3: Facture

 $facture = new Facture($db);
 if ($ticket->fk_facture) {
     $facture->fetch($ticket->fk_facture);
     $label = $facture->ref;
 }
 $json_data['type'] = $pending_print[0][0];
 $json_data['ref'] = $label;
 $json_data['mysoc_name'] = $mysoc->name ? $mysoc->name : "";
 $json_data['mysoc_address'] = $mysoc->address ? $mysoc->address : "";
 $json_data['mysoc_town'] = ($mysoc->zip ? $mysoc->zip : "") . ' ' . ($mysoc->town ? $mysoc->town : "");
 $json_data['mysoc_idprof'] = $mysoc->idprof1 ? $mysoc->idprof1 : "";
 $json_data['datetime'] = dol_print_date($facture->date_closed, 'dayhourtext');
 $json_data['vendor'] = $langs->transnoentities("Vendor") . ': ' . $userstatic->firstname . " " . $userstatic->lastname;
 if (!empty($ticket->fk_place)) {
     $place = new Place($db);
     $place->fetch($ticket->fk_place);
     $json_data['place'] = $langs->trans("Place") . ': ' . $place->name;
 } else {
     $json_data['place'] = "";
 }
 $json_data["gift"] = $langs->trans("GiftTicket");
 $json_data['header_lines'] = str_pad(substr($langs->transnoentities("Label"), 0, 23), 25, ' ', STR_PAD_RIGHT) . str_pad(substr($langs->transnoentities("Qty"), 0, 5), 6, ' ', STR_PAD_LEFT) . str_pad(substr($langs->transnoentities("Total"), 0, 5), 12, ' ', STR_PAD_LEFT);
 $rows = array();
 //$ticket->getLinesArray();
 if (!empty($ticket->lines)) {
     //$subtotal=0;
     foreach ($ticket->lines as $line) {
         $totalline = $line->qty * $line->subprice;
         if (empty($line->libelle)) {
             $line->libelle = $line->description;
         }
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:31,代码来源:checkprint.php

示例4: Societe

$userstatic->fetch($object->user_valid);
print $langs->trans("Vendor") . ': ' . $userstatic->firstname . ' ' . $userstatic->lastname . '<br><br>';
$client = new Societe($db);
$client->fetch($object->socid);
print $client->nom . '<br>';
print $client->idprof1 . '<br>';
print $client->address . '<br>';
print $client->zip . ' ' . $client->town . '<br>';
print $client->state . '</p>';
$sql = "SELECT fk_place,fk_cash FROM " . MAIN_DB_PREFIX . "pos_facture WHERE fk_facture =" . $object->id;
$result = $db->query($sql);
if ($result) {
    $objp = $db->fetch_object($result);
    if ($objp->fk_place > 0) {
        $place = new Place($db);
        $place->fetch($objp->fk_place);
        print $langs->trans("Place") . ': ' . $place->name . '</p>';
    }
}
?>
	</div>
</div>

<?php 
if ($result) {
    if (!empty($object->lines)) {
        $onediscount = false;
        foreach ($object->lines as $line) {
            if ($line->remise_percent) {
                $onediscount = true;
            }
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:31,代码来源:facture.tpl.php

示例5: GETPOST

}
//$result=restrictedArea($user,'banque',$id,'bank_account','','',$fieldid);
$year_start = GETPOST('year_start');
$year_current = strftime("%Y", time());
if (!$year_start) {
    $year_start = $year_current - 2;
    $year_end = $year_current;
} else {
    $year_end = $year_start + 2;
}
$helpurl = 'EN:Module_DoliPos|FR:Module_DoliPos_FR|ES:M&oacute;dulo_DoliPos';
llxHeader('', '', $helpurl);
$form = new Form($db);
// Get account informations
$acct = new Place($db);
$result = $acct->fetch($id, $ref);
# Ce rapport de tresorerie est base sur llx_bank (car doit inclure les transactions sans facture)
# plutot que sur llx_paiement + llx_paiementfourn
$sql = "SELECT SUM(total_ttc) as total";
$sql .= ", date_format(date_creation,'%Y-%m') as dm";
$sql .= " FROM " . MAIN_DB_PREFIX . "pos_ticket";
//$sql.= " WHERE fk_cash = ".$id;
$sql .= " WHERE entity = " . $conf->entity;
$sql .= " AND fk_statut in (1,2,3,4)";
if ($acct->id) {
    $sql .= " AND fk_place IN (" . $acct->id . ")";
}
$sql .= " GROUP BY dm";
$sql .= " UNION SELECT sum(fac.total_ttc) as total";
$sql .= ", date_format(datec,'%Y-%m') as dm";
$sql .= " FROM " . MAIN_DB_PREFIX . "facture as fac, " . MAIN_DB_PREFIX . "pos_facture as pf";
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:31,代码来源:annuel.php

示例6: asort

 }
 if ($sortfield == 'amount_ttc' && $sortorder == 'asc') {
     asort($amount);
     $arrayforsort = $amount;
 }
 if ($sortfield == 'amount_ttc' && $sortorder == 'desc') {
     arsort($amount);
     $arrayforsort = $amount;
 }
 foreach ($arrayforsort as $key => $value) {
     $var = !$var;
     print "<tr " . $bc[$var] . ">";
     // Place
     //$fullname=$name[$key];
     $place = new Place($db);
     $place->fetch($key);
     /*if ($key > 0) {
     			$linkname='<a href="'.DOL_URL_ROOT.'/societe/soc.php?socid='.$key.'">'.img_object($langs->trans("ShowCompany"),'company').' '.$fullname.'</a>';
     		}*/
     print "<td>" . $place->getNomUrl(1) . "</td>\n";
     // Amount
     print '<td align="right">';
     $url = dol_buildpath('/pos/backend/listefac.php?placeid=' . $key, 1);
     if ($key > 0) {
         print '<a href="' . $url . '">';
     } else {
         print '<a href="#">';
     }
     print price($amount[$key]);
     print '</a>';
     print '</td>';
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:31,代码来源:placefac.php

示例7: Place

 /**
  * Delete ticket and all the lines
  * @return number		<0 if KO, >0 if OK
  */
 function delete_ticket()
 {
     dol_include_once('/pos/class/place.class.php');
     global $user, $langs, $conf, $db;
     $sql = "DELETE FROM " . MAIN_DB_PREFIX . "pos_ticketdet WHERE fk_ticket=" . $this->id;
     $resql = $this->db->query($sql);
     if ($resql) {
         $sql = "DELETE FROM " . MAIN_DB_PREFIX . "pos_ticket";
         $sql .= " WHERE rowid= " . $this->id;
         $sql .= " AND entity = " . $conf->entity;
         $resql = $this->db->query($sql);
         if ($resql) {
             if ($this->statut == 0) {
                 $place = new Place($db);
                 $place->fetch($this->fk_place);
                 $place->free_place();
             }
             $this->db->commit();
             return 1;
         } else {
             $this->db->rollback();
             return -1;
         }
     } else {
         $this->db->rollback();
         return -1;
     }
 }
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:32,代码来源:ticket.class.php


注:本文中的Place::fetch方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。