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


PHP Societe::getAvailableDiscounts方法代码示例

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


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

示例1: OR

 // $resteapayer=bcadd($resteapayer,$totalavoir,$conf->global->MAIN_MAX_DECIMALS_TOT);
 $resteapayer = price2num($object->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits, 'MT');
 if ($object->paye) {
     $resteapayer = 0;
 }
 $resteapayeraffiche = $resteapayer;
 if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
     $filterabsolutediscount = "fk_facture_source IS NULL";
     // If we want deposit to be substracted to payments only and not to total of final invoice
     $filtercreditnote = "fk_facture_source IS NOT NULL";
     // If we want deposit to be substracted to payments only and not to total of final invoice
 } else {
     $filterabsolutediscount = "fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description='(DEPOSIT)')";
     $filtercreditnote = "fk_facture_source IS NOT NULL AND description <> '(DEPOSIT)'";
 }
 $absolute_discount = $soc->getAvailableDiscounts('', $filterabsolutediscount);
 $absolute_creditnote = $soc->getAvailableDiscounts('', $filtercreditnote);
 $absolute_discount = price2num($absolute_discount, 'MT');
 $absolute_creditnote = price2num($absolute_creditnote, 'MT');
 $author = new User($db);
 if ($object->user_author) {
     $author->fetch($object->user_author);
 }
 $objectidnext = $object->getIdReplacingInvoice();
 $head = facture_prepare_head($object);
 dol_fiche_head($head, 'compta', $langs->trans('InvoiceCustomer'), 0, 'bill');
 $formconfirm = '';
 // Confirmation de la conversion de l'avoir en reduc
 if ($action == 'converttoreduc') {
     $text = $langs->trans('ConfirmConvertToReduc');
     $formconfirm = $form->formconfirm($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $langs->trans('ConvertToReduc'), $text, 'confirm_converttoreduc', '', "yes", 2);
开发者ID:Samara94,项目名称:dolibarr,代码行数:31,代码来源:facture.php

示例2: User

        $totalpaye  = $fac->getSommePaiement();
        $totalcreditnotes = $fac->getSumCreditNotesUsed();
        $totaldeposits = $fac->getSumDepositsUsed();
        //print "totalpaye=".$totalpaye." totalcreditnotes=".$totalcreditnotes." totaldeposts=".$totaldeposits;

        // We can also use bcadd to avoid pb with floating points
        // For example print 239.2 - 229.3 - 9.9; does not return 0.
        //$resteapayer=bcadd($fac->total_ttc,$totalpaye,$conf->global->MAIN_MAX_DECIMALS_TOT);
        //$resteapayer=bcadd($resteapayer,$totalavoir,$conf->global->MAIN_MAX_DECIMALS_TOT);
        $resteapayer = price2num($fac->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits,'MT');

        if ($fac->paye) $resteapayer=0;
        $resteapayeraffiche=$resteapayer;

        $absolute_discount=$soc->getAvailableDiscounts('','fk_facture_source IS NULL');
        $absolute_creditnote=$soc->getAvailableDiscounts('','fk_facture_source IS NOT NULL');
        $absolute_discount=price2num($absolute_discount,'MT');
        $absolute_creditnote=price2num($absolute_creditnote,'MT');

        $author = new User($db);
        if ($fac->user_author)
        {
            $author->fetch($fac->user_author);
        }

        $head = facture_prepare_head($fac);

        dol_fiche_head($head, 'standingorders', $langs->trans('InvoiceCustomer'),0,'bill');

        /*
开发者ID:remyyounes,项目名称:dolibarr,代码行数:30,代码来源:prelevement.php

示例3:

	print '</tr></table>';
	print '</td><td colspan="5">';
	print $object->ref_client;
	print '</td>';
	print '</tr>';

	$rowspan=8;

	// Company
	print '<tr><td>'.$langs->trans('Company').'</td><td colspan="5">'.$societe->getNomUrl(1).'</td></tr>';

	// Ligne info remises tiers
	print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="5">';
	if ($societe->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$societe->remise_client);
	else print $langs->trans("CompanyHasNoRelativeDiscount");
	$absolute_discount=$societe->getAvailableDiscounts();
	print '. ';
	if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->monnaie));
	else print $langs->trans("CompanyHasNoAbsoluteDiscount");
	print '.';
	print '</td></tr>';

	// Dates
	print '<tr><td>'.$langs->trans('Date').'</td><td colspan="3">';
	print dol_print_date($object->date,'daytext');
	print '</td>';

	if ($conf->projet->enabled) $rowspan++;

	//Local taxes
	if ($mysoc->pays_code=='ES')
开发者ID:remyyounes,项目名称:dolibarr,代码行数:31,代码来源:propal.php

示例4: getConfig

 /**
  * 
  * Return POS Config
  * 
  * @return	array		Array with config
  */
 public static function getConfig()
 {
     global $db, $conf, $langs;
     $cash = new Cash($db);
     $terminal = $_SESSION['TERMINAL_ID'];
     $cash->fetch($terminal);
     $userstatic = new User($db);
     $userstatic->fetch($_SESSION['uid']);
     $soc = new Societe($db, $cash->fk_soc);
     $soc->fetch($cash->fk_soc);
     $name = $soc->name ? $soc->name : $soc->nom;
     $ret['error']['value'] = 0;
     $ret['error']['desc'] = '';
     $ret['data']['terminal']['id'] = $cash->id;
     $ret['data']['terminal']['name'] = $cash->name;
     $ret['data']['terminal']['tactil'] = $cash->tactil;
     $ret['data']['terminal']['warehouse'] = $cash->fk_warehouse;
     $ret['data']['terminal']['barcode'] = $cash->barcode;
     $ret['data']['terminal']['mode_info'] = 0;
     $ret['data']['terminal']['faclimit'] = $conf->global->POS_MAX_TTC;
     $ret['data']['module']['places'] = $conf->global->POS_PLACES;
     $ret['data']['module']['print'] = $conf->global->POS_PRINT;
     $ret['data']['module']['mail'] = $conf->global->POS_MAIL;
     $ret['data']['module']['points'] = $conf->global->REWARDS_DISCOUNT;
     $ret['data']['module']['ticket'] = $conf->global->POS_TICKET;
     $ret['data']['module']['facture'] = $conf->global->POS_FACTURE;
     $ret['data']['module']['print_mode'] = $conf->global->POS_PRINT_MODE;
     $ret['data']['user']['id'] = $userstatic->id;
     $ret['data']['user']['name'] = $userstatic->getFullName($langs);
     $dir = $conf->user->dir_output;
     if ($userstatic->photo) {
         $file = get_exdir($userstatic->id, 2) . $userstatic->photo;
     }
     if ($file && file_exists($dir . "/" . $file)) {
         $ret['data']['user']['photo'] = DOL_URL_ROOT . '/viewimage.php?modulepart=userphoto&entity=' . $userstatic->entity . '&file=' . urlencode($file);
     } else {
         $ret['data']['user']['photo'] = DOL_URL_ROOT . '/theme/common/nophoto.jpg';
     }
     $ret['data']['customer']['id'] = $soc->id;
     $ret['data']['customer']['name'] = $name;
     $ret['data']['customer']['remise'] = $soc->remise_percent;
     $ret['data']['customer']['coupon'] = $soc->getAvailableDiscounts();
     $ret['data']['customer']['points'] = null;
     if ($conf->global->REWARDS_POS && !empty($conf->rewards->enabled)) {
         $rew = new Rewards($db);
         $res = $rew->getCustomerReward($soc->id);
         if ($res) {
             $ret['data']['customer']['points'] = $rew->getCustomerPoints($soc->id);
         }
     }
     $ret['data']['decrange']['unit'] = $conf->global->MAIN_MAX_DECIMALS_UNIT;
     $ret['data']['decrange']['tot'] = $conf->global->MAIN_MAX_DECIMALS_TOT;
     $ret['data']['decrange']['maxshow'] = $conf->global->MAIN_MAX_DECIMALS_SHOWN;
     return $ret;
 }
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:61,代码来源:pos.class.mañanero.php


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