• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP bankaccount函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中bankaccount函数的典型用法代码示例。如果您正苦于以下问题:PHP bankaccount函数的具体用法?PHP bankaccount怎么用?PHP bankaccount使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: main_form

 protected function main_form($x, $y)
 {
     $balance = $this->data['balance'] < 0 ? -$this->data['balance'] : $this->data['balance'];
     $font_size = 14;
     $lineh = 25;
     $x += ConfigHelper::getConfig('finances.leftmargin', 0, true);
     $y += ConfigHelper::getConfig('finances.bottommargin', 0, true);
     $y += 275;
     $this->backend->addText($x, $y, $font_size, $this->data['d_name']);
     $y -= $lineh;
     $this->backend->addText($x, $y, $font_size, trim($this->data['d_zip'] . ' ' . $this->data['d_city'] . ' ' . $this->data['d_address']));
     $y -= $lineh;
     $this->backend->addText($x, $y, $font_size, format_bankaccount(bankaccount($this->data['id'], $this->data['account'])));
     $y -= $lineh;
     $this->backend->addText($x + 220, $y, $font_size, sprintf('%.2f', $balance));
     $y -= $lineh;
     $this->backend->addText($x, $y, $font_size, trans('$a dollars $b cents', to_words(floor($balance)), to_words(round(($balance - floor($balance)) * 100))));
     $y -= $lineh;
     $this->backend->addText($x, $y, $font_size, $this->truncate($this->data['customername']));
     $y -= $lineh;
     $this->backend->addText($x, $y, $font_size, $this->truncate(trim($this->data['zip'] . ' ' . $this->data['city'] . ' ' . $this->data['address'])));
     $y -= $lineh;
     $this->backend->addText($x, $y, $font_size, ConfigHelper::getConfig('finances.pay_title', trans('Not set')));
     $y -= $lineh;
     $this->backend->addText($x, $y, $font_size, trans('Customer ID: $a', sprintf('%04d', $this->data['id'])));
 }
开发者ID:Akheon23,项目名称:lms,代码行数:26,代码来源:LMSEzpdfTransferForm.php


示例2: note_recipient

 public function note_recipient()
 {
     $oldy = $this->backend->GetY();
     $recipient = '<b>' . trans('Note recipient:') . '</b><br>';
     $recipient .= $this->data['name'] . '<br>';
     $recipient .= $this->data['address'] . '<br>';
     $recipient .= $this->data['zip'] . ' ' . $this->data['city'] . '<br>';
     if ($this->data['ten']) {
         $recipient .= trans('TEN') . ': ' . $this->data['ten'] . '<br>';
     } elseif ($this->data['ssn']) {
         $recipient .= trans('SSN') . ': ' . $this->data['ssn'] . '<br>';
     }
     $this->backend->SetFont('arial', '', 10);
     $this->backend->writeHTMLCell(80, '', 125, 50, $recipient, 0, 1, 0, true, 'L');
     $y = $this->backend->GetY();
     if (ConfigHelper::checkValue(ConfigHelper::getConfig('invoices.customer_bankaccount', true))) {
         $bankaccount = trans('Bank account:') . ' <b>' . format_bankaccount(bankaccount($this->data['customerid'], $this->data['account'])) . '</b>';
         $this->backend->SetFont('arial', 'B', 8);
         $this->backend->writeHTMLCell('', '', 125, $oldy + round(($y - $oldy - 8) / 2), $bankaccount, 0, 1, 0, true, 'L');
     }
     if (ConfigHelper::checkValue(ConfigHelper::getConfig('invoices.customer_credentials', true))) {
         $pin = '<b>' . trans('Customer ID: $a', sprintf('%04d', $this->data['customerid'])) . '</b><br>';
         $pin .= '<b>PIN: ' . sprintf('%04d', $this->data['customerpin']) . '</b><br>';
         $this->backend->SetFont('arial', 'B', 8);
         $this->backend->writeHTMLCell('', '', 125, $oldy + round(($y - $oldy) / 2), $pin, 0, 1, 0, true, 'L');
     }
     $this->backend->SetY($y);
 }
开发者ID:itav,项目名称:lms,代码行数:28,代码来源:LMSTcpdfDebitNote.php


示例3: main_form

function main_form($x, $y, $data)
{
    global $pdf;
    global $_TITLE, $_LMARGIN, $_BMARGIN;
    $balance = $data['balance'] < 0 ? -$data['balance'] : $data['balance'];
    $font_size = 14;
    $lineh = 25;
    $x += $_LMARGIN;
    $y += $_BMARGIN;
    $y += 275;
    $pdf->addtext($x, $y, $font_size, $data['d_name']);
    $y -= $lineh;
    $pdf->addtext($x, $y, $font_size, trim($data['d_zip'] . ' ' . $data['d_city'] . ' ' . $data['d_address']));
    $y -= $lineh;
    //    for($i=0; $i<26; $i++)
    //    {
    //	    $pdf->addtext($x+$i*14.6,$y,$font_size,$_ACCOUNT[$i]);
    //    }
    $pdf->addtext($x, $y, $font_size, bankaccount($data['id'], $data['account']));
    $y -= $lineh;
    $pdf->addtext($x + 220, $y, $font_size, sprintf('%.2f', $balance));
    $y -= $lineh;
    $pdf->addtext($x, $y, $font_size, trans('$a dollars $b cents', to_words(floor($balance)), to_words(round(($balance - floor($balance)) * 100))));
    $y -= $lineh;
    $pdf->addtext($x, $y, $font_size, truncate($data['customername']));
    $y -= $lineh;
    $pdf->addtext($x, $y, $font_size, truncate(trim($data['zip'] . ' ' . $data['city'] . ' ' . $data['address'])));
    $y -= $lineh;
    $pdf->addtext($x, $y, $font_size, $_TITLE);
    $y -= $lineh;
    $pdf->addtext($x, $y, $font_size, trans('Customer ID: $a', sprintf('%04d', $data['id'])));
}
开发者ID:kornelek,项目名称:lms,代码行数:32,代码来源:transferforms2.php


示例4: invoice_main_form_fill

function invoice_main_form_fill($x, $y, $scale)
{
    global $pdf, $invoice;
    $pdf->setlinestyle(1);
    $pdf->line(7 * $scale + $x, 724 * $scale + $y, 7 * $scale + $x, 694 * $scale + $y);
    $pdf->line(7 * $scale + $x, 724 * $scale + $y, 37 * $scale + $x, 724 * $scale + $y);
    $pdf->line(970 * $scale + $x, 724 * $scale + $y, 970 * $scale + $x, 694 * $scale + $y);
    $pdf->line(970 * $scale + $x, 724 * $scale + $y, 940 * $scale + $x, 724 * $scale + $y);
    $pdf->line(7 * $scale + $x, 172 * $scale + $y, 7 * $scale + $x, 202 * $scale + $y);
    $pdf->line(7 * $scale + $x, 172 * $scale + $y, 37 * $scale + $x, 172 * $scale + $y);
    $name = $invoice['division_name'];
    $address = $invoice['division_address'];
    $zip = $invoice['division_zip'];
    $city = $invoice['division_city'];
    $account = bankaccount($invoice['customerid'], $invoice['account']);
    text_autosize(15 * $scale + $x, 680 * $scale + $y, 30 * $scale, iconv("UTF-8", "ISO-8859-2//TRANSLIT", $name), 950 * $scale);
    text_autosize(15 * $scale + $x, 617 * $scale + $y, 30 * $scale, iconv("UTF-8", "ISO-8859-2//TRANSLIT", $address . " " . $zip . " " . $city), 950 * $scale);
    text_autosize(15 * $scale + $x, 555 * $scale + $y, 30 * $scale, format_bankaccount($account), 950 * $scale);
    $pdf->addtext(330 * $scale + $x, 495 * $scale + $y, 30 * $scale, 'X');
    text_autosize(550 * $scale + $x, 495 * $scale + $y, 30 * $scale, "*" . number_format($invoice['total'], 2, ',', '') . "*", 400 * $scale);
    text_autosize(15 * $scale + $x, 434 * $scale + $y, 30 * $scale, iconv("UTF-8", "ISO-8859-2//TRANSLIT", trans('$a dollars $b cents', to_words(floor($invoice['total'])), to_words(round(($invoice['total'] - floor($invoice['total'])) * 100)))), 950 * $scale);
    text_autosize(15 * $scale + $x, 372 * $scale + $y, 30 * $scale, iconv("UTF-8", "ISO-8859-2//TRANSLIT", $invoice['name']), 950 * $scale);
    text_autosize(15 * $scale + $x, 312 * $scale + $y, 30 * $scale, iconv("UTF-8", "ISO-8859-2//TRANSLIT", $invoice['address'] . " " . $invoice['zip'] . " " . $invoice['city']), 950 * $scale);
    $tmp = docnumber($invoice['number'], $invoice['template'], $invoice['cdate']);
    text_autosize(15 * $scale + $x, 250 * $scale + $y, 30 * $scale, iconv("UTF-8", "ISO-8859-2//TRANSLIT", trans('Payment for invoice No. $a', $tmp)), 950 * $scale);
}
开发者ID:repcio,项目名称:lms,代码行数:26,代码来源:invoice_pdf.inc.php


示例5: GetCustomer

    function GetCustomer($id)
    {
        if ($result = $this->DB->GetRow('SELECT c.*, ' . $this->DB->Concat('UPPER(c.lastname)', "' '", 'c.name') . ' AS customername
	                                FROM customers c WHERE c.id = ?', array($id))) {
            $result['balance'] = $this->GetCustomerBalance($result['id']);
            $result['bankaccount'] = bankaccount($result['id']);
            $result['messengers'] = $this->DB->GetAllByKey('SELECT uid, type FROM imessengers WHERE customerid = ? ORDER BY type', 'type', array($id));
            $result['contacts'] = $this->DB->GetAllByKey('SELECT id, phone, name FROM customercontacts WHERE customerid = ? ORDER BY id', 'id', array($id));
            return $result;
        } else {
            return NULL;
        }
    }
开发者ID:repcio,项目名称:lms,代码行数:13,代码来源:ULMS.class.php


示例6: GetCustomer

    public function GetCustomer($id, $short = false)
    {
        if ($result = $this->DB->GetRow('SELECT c.*, ' . $this->DB->Concat('UPPER(c.lastname)', "' '", 'c.name') . ' AS customername
			FROM customers c WHERE c.id = ?', array($id))) {
            $result['balance'] = $this->GetCustomerBalance($result['id']);
            $result['bankaccount'] = bankaccount($result['id']);
            $result['messengers'] = $this->DB->GetAllByKey('SELECT uid, type FROM imessengers WHERE customerid = ? ORDER BY type', 'type', array($id));
            $result['contacts'] = $this->DB->GetAllByKey('SELECT id, contact AS phone, name
				FROM customercontacts WHERE customerid = ? AND type < ? ORDER BY id', 'id', array($id, CONTACT_MOBILE));
            $result['emails'] = $this->DB->GetAllByKey('SELECT id, contact AS email, name
				FROM customercontacts WHERE customerid = ? AND (type & ? > 0) ORDER BY id', 'id', array($id, CONTACT_EMAIL | CONTACT_INVOICES | CONTACT_NOTIFICATIONS));
            return $result;
        } else {
            return NULL;
        }
    }
开发者ID:kornelek,项目名称:lms,代码行数:16,代码来源:ULMS.class.php


示例7: GetCustomer

    public function GetCustomer($id, $short = false)
    {
        if ($result = $this->DB->GetRow('SELECT c.*, ' . $this->DB->Concat('UPPER(c.lastname)', "' '", 'c.name') . ' AS customername
			FROM customeraddressview c WHERE c.id = ?', array($id))) {
            $result['balance'] = $this->GetCustomerBalance($result['id']);
            $result['bankaccount'] = bankaccount($result['id']);
            $result['messengers'] = $this->DB->GetAllByKey('SELECT uid, type FROM imessengers WHERE customerid = ? ORDER BY type', 'type', array($id));
            $result['contacts'] = $this->DB->GetAllByKey('SELECT id, contact AS phone, name
				FROM customercontacts WHERE customerid = ? AND (type & ?) > 0 AND (type & ?) = 0
				ORDER BY id', 'id', array($id, CONTACT_MOBILE | CONTACT_FAX | CONTACT_LANDLINE, CONTACT_DISABLED));
            $result['emails'] = $this->DB->GetAllByKey('SELECT id, contact AS email, name
				FROM customercontacts WHERE customerid = ? AND (type & ?) > 0 AND (type & ?) = 0
				ORDER BY id', 'id', array($id, CONTACT_EMAIL | CONTACT_DISABLED, CONTACT_DISABLED));
            $result['accounts'] = $this->DB->GetAllByKey('SELECT id, contact AS account, name
				FROM customercontacts WHERE customerid = ? AND (type & ?) = ? ORDER BY id', 'id', array($id, CONTACT_BANKACCOUNT | CONTACT_INVOICES | CONTACT_DISABLED, CONTACT_BANKACCOUNT | CONTACT_INVOICES));
            return $result;
        } else {
            return NULL;
        }
    }
开发者ID:Akheon23,项目名称:lms,代码行数:20,代码来源:ULMS.class.php


示例8: simple_fill_mip

function simple_fill_mip($x,$y,$scale)
{
    global $pdf,$_NAME,$_ADDRESS,$_ZIP,$_CITY,$_SHORT_NAME,$control_lines,$invoice;

    if ($control_lines) {
        $pdf->line(7*$scale+$x,180*$scale+$y,7*$scale+$x,210*$scale+$y);
	$pdf->line(7*$scale+$x,180*$scale+$y,37*$scale+$x,180*$scale+$y);
        $pdf->line(370*$scale+$x,180*$scale+$y,370*$scale+$x,210*$scale+$y);
	$pdf->line(370*$scale+$x,180*$scale+$y,340*$scale+$x,180*$scale+$y);
        $pdf->line(7*$scale+$x,726*$scale+$y,7*$scale+$x,696*$scale+$y);
	$pdf->line(7*$scale+$x,726*$scale+$y,37*$scale+$x,726*$scale+$y);
        $pdf->line(370*$scale+$x,726*$scale+$y,370*$scale+$x,696*$scale+$y);
	$pdf->line(370*$scale+$x,726*$scale+$y,340*$scale+$x,726*$scale+$y);
    }
    $pdf->addtext(15*$scale+$x,560*$scale+$y,30*$scale, iconv('UTF-8', 'ISO-8859-2',$_SHORT_NAME));
    $pdf->addtext(15*$scale+$x,525*$scale+$y,30*$scale, iconv('UTF-8', 'ISO-8859-2',$_ADDRESS));
    $pdf->addtext(15*$scale+$x,490*$scale+$y,30*$scale, iconv('UTF-8', 'ISO-8859-2',$_ZIP." ".$_CITY));
    $pdf->addtext(15*$scale+$x,680*$scale+$y,30*$scale, substr(bankaccount($invoice['customerid'], $invoice['account']),0,17));
    $pdf->addtext(15*$scale+$x,620*$scale+$y,30*$scale, substr(bankaccount($invoice['customerid'], $invoice['account']),18,200));
    $pdf->addtext(15*$scale+$x,435*$scale+$y,30*$scale,'**'.number_format($invoice['total'],2,',','').'**');
    //$pdf->addtext(15*$scale+$x,310*$scale+$y,30*$scale,$invoice['name']);

    $font_size=30;
    while ($pdf->getTextWidth($font_size*$scale, iconv('UTF-8', 'ISO-8859-2',$invoice['name']))>135)
	$font_size=$font_size-1;    
    $pdf->addtext(15*$scale+$x,310*$scale+$y,$font_size*$scale, iconv('UTF-8', 'ISO-8859-2',$invoice['name']));
    $font_size=30;
    while ($pdf->getTextWidth($font_size*$scale, iconv('UTF-8', 'ISO-8859-2',$invoice['address']))>135)
	$font_size=$font_size-1;    
    $pdf->addtext(15*$scale+$x,275*$scale+$y,$font_size*$scale, iconv('UTF-8', 'ISO-8859-2',$invoice['address']));
    $pdf->addtext(15*$scale+$x,240*$scale+$y,30*$scale, iconv('UTF-8', 'ISO-8859-2',$invoice['zip']." ".$invoice['city']));

    $font_size=30;
    while ($pdf->getTextWidth($font_size*$scale,trans('Invoice No. $a', $invoice['t_number']))>135)
	$font_size=$font_size-1;    
    $pdf->addtext(15*$scale+$x,385*$scale+$y,$font_size*$scale,trans('Invoice No. $a', $invoice['t_number']));

}
开发者ID:rzt,项目名称:lms,代码行数:38,代码来源:transferforms.php


示例9: simple_fill_mip

 protected function simple_fill_mip($x, $y, $scale)
 {
     if (ConfigHelper::checkConfig('finances.control_lines')) {
         $this->backend->line(7 * $scale + $x, 180 * $scale + $y, 7 * $scale + $x, 210 * $scale + $y);
         $this->backend->line(7 * $scale + $x, 180 * $scale + $y, 37 * $scale + $x, 180 * $scale + $y);
         $this->backend->line(370 * $scale + $x, 180 * $scale + $y, 370 * $scale + $x, 210 * $scale + $y);
         $this->backend->line(370 * $scale + $x, 180 * $scale + $y, 340 * $scale + $x, 180 * $scale + $y);
         $this->backend->line(7 * $scale + $x, 726 * $scale + $y, 7 * $scale + $x, 696 * $scale + $y);
         $this->backend->line(7 * $scale + $x, 726 * $scale + $y, 37 * $scale + $x, 726 * $scale + $y);
         $this->backend->line(370 * $scale + $x, 726 * $scale + $y, 370 * $scale + $x, 696 * $scale + $y);
         $this->backend->line(370 * $scale + $x, 726 * $scale + $y, 340 * $scale + $x, 726 * $scale + $y);
     }
     $this->backend->addtext(15 * $scale + $x, 560 * $scale + $y, 30 * $scale, $this->data['d_shortname']);
     $this->backend->addtext(15 * $scale + $x, 525 * $scale + $y, 30 * $scale, $this->data['d_address']);
     $this->backend->addtext(15 * $scale + $x, 490 * $scale + $y, 30 * $scale, $this->data['d_zip'] . ' ' . $this->data['d_city']);
     $this->backend->addtext(15 * $scale + $x, 680 * $scale + $y, 30 * $scale, substr(bankaccount($this->data['id'], $this->data['account']), 0, 17));
     $this->backend->addtext(15 * $scale + $x, 620 * $scale + $y, 30 * $scale, substr(bankaccount($this->data['id'], $this->data['account']), 18, 200));
     $this->backend->addtext(15 * $scale + $x, 435 * $scale + $y, 30 * $scale, '**' . number_format($this->data['total'], 2, ',', '') . '**');
     //		$this->backend->addtext(15 * $scale + $x, 310 * $scale+$y, 30 * $scale, $this->data['name']);
     $font_size = 30;
     while ($this->backend->getTextWidth($font_size * $scale, $this->data['name']) > 135) {
         $font_size -= 1;
     }
     $this->backend->addtext(15 * $scale + $x, 310 * $scale + $y, $font_size * $scale, $this->data['name']);
     $font_size = 30;
     while ($this->backend->getTextWidth($font_size * $scale, $this->data['address']) > 135) {
         $font_size -= 1;
     }
     $this->backend->addtext(15 * $scale + $x, 275 * $scale + $y, $font_size * $scale, $this->data['address']);
     $this->backend->addtext(15 * $scale + $x, 240 * $scale + $y, 30 * $scale, $this->data['zip'] . ' ' . $this->data['city']);
     $font_size = 30;
     while ($this->backend->getTextWidth($font_size * $scale, trans('Invoice No. $a', $this->data['t_number'])) > 135) {
         $font_size -= 1;
     }
     $this->backend->addtext(15 * $scale + $x, 385 * $scale + $y, $font_size * $scale, trans('Invoice No. $a', $this->data['t_number']));
 }
开发者ID:Akheon23,项目名称:lms,代码行数:36,代码来源:LMSEzpdfMipTransferForm.php


示例10: GetCustomer

    /**
     * Returns customer data
     * 
     * @global array $CONTACTTYPES
     * @param int $id Customer id
     * @param boolean $short Basic or expanded data
     * @return array|boolean Customer data or false on failure
     */
    public function GetCustomer($id, $short = false)
    {
        global $CONTACTTYPES;
        if ($result = $this->db->GetRow('SELECT c.*, ' . $this->db->Concat('UPPER(c.lastname)', "' '", 'c.name') . ' AS customername,
			d.shortname AS division, d.account
			FROM customers' . (defined('LMS-UI') ? 'view' : '') . ' c 
			LEFT JOIN divisions d ON (d.id = c.divisionid)
			WHERE c.id = ?', array($id))) {
            if (!$short) {
                $user_manager = new LMSUserManager($this->db, $this->auth, $this->cache, $this->syslog);
                $result['createdby'] = $user_manager->getUserName($result['creatorid']);
                $result['modifiedby'] = $user_manager->getUserName($result['modid']);
                $result['creationdateh'] = date('Y/m/d, H:i', $result['creationdate']);
                $result['moddateh'] = date('Y/m/d, H:i', $result['moddate']);
                $result['consentdate'] = $result['consentdate'] ? date('Y/m/d', $result['consentdate']) : '';
                $result['up_logins'] = $this->db->GetRow('SELECT lastlogindate, lastloginip, 
					failedlogindate, failedloginip
					FROM up_customers WHERE customerid = ?', array($result['id']));
                // Get country name
                if ($result['countryid']) {
                    $result['country'] = $this->db->GetOne('SELECT name FROM countries WHERE id = ?', array($result['countryid']));
                    if ($result['countryid'] == $result['post_countryid']) {
                        $result['post_country'] = $result['country'];
                    } else {
                        if ($result['post_countryid']) {
                            $result['country'] = $this->db->GetOne('SELECT name FROM countries WHERE id = ?', array($result['post_countryid']));
                        }
                    }
                }
                // Get state name
                if ($cstate = $this->db->GetRow('SELECT s.id, s.name
					FROM states s, zipcodes
					WHERE zip = ? AND stateid = s.id', array($result['zip']))) {
                    $result['stateid'] = $cstate['id'];
                    $result['cstate'] = $cstate['name'];
                }
                if ($result['zip'] == $result['post_zip']) {
                    $result['post_stateid'] = $result['stateid'];
                    $result['post_cstate'] = $result['cstate'];
                } else {
                    if ($result['post_zip'] && ($cstate = $this->db->GetRow('SELECT s.id, s.name
					FROM states s, zipcodes
					WHERE zip = ? AND stateid = s.id', array($result['post_zip'])))) {
                        $result['post_stateid'] = $cstate['id'];
                        $result['post_cstate'] = $cstate['name'];
                    }
                }
            }
            $result['balance'] = $this->getCustomerBalance($result['id']);
            $result['bankaccount'] = bankaccount($result['id'], $result['account']);
            $result['messengers'] = $this->db->GetAllByKey('SELECT uid, type 
					FROM imessengers WHERE customerid = ? ORDER BY type', 'type', array($result['id']));
            $result['contacts'] = $this->db->GetAll('SELECT contact AS phone, name, type
					FROM customercontacts
					WHERE customerid = ? AND type < ? ORDER BY id', array($result['id'], CONTACT_EMAIL));
            $result['emails'] = $this->db->GetAll('SELECT contact AS email, name
					FROM customercontacts
					WHERE customerid = ? AND type = ? ORDER BY id', array($result['id'], CONTACT_EMAIL));
            if (is_array($result['contacts'])) {
                foreach ($result['contacts'] as $idx => $row) {
                    $types = array();
                    foreach ($CONTACTTYPES as $tidx => $tname) {
                        if ($row['type'] & $tidx) {
                            $types[] = $tname;
                        }
                    }
                    if ($types) {
                        $result['contacts'][$idx]['typestr'] = implode('/', $types);
                    }
                }
            }
            return $result;
        } else {
            return false;
        }
    }
开发者ID:krzysztofpuchala,项目名称:lms-1,代码行数:84,代码来源:LMSCustomerManager.php


示例11: GetCustomer

    /**
     * Returns customer data
     *
     * @global array $CONTACTTYPES
     * @param int $id Customer id
     * @param boolean $short Basic or expanded data
     * @return array|boolean Customer data or false on failure
     */
    public function GetCustomer($id, $short = false)
    {
        global $CONTACTTYPES, $CUSTOMERCONTACTTYPES;
        require_once LIB_DIR . DIRECTORY_SEPARATOR . 'customercontacttypes.php';
        if ($result = $this->db->GetRow('SELECT c.*, ' . $this->db->Concat('UPPER(c.lastname)', "' '", 'c.name') . ' AS customername,
			d.shortname AS division, d.account
			FROM customer' . (defined('LMS-UI') ? '' : 'address') . 'view c
			LEFT JOIN divisions d ON (d.id = c.divisionid)
			WHERE c.id = ?', array($id))) {
            if (!$short) {
                $user_manager = new LMSUserManager($this->db, $this->auth, $this->cache, $this->syslog);
                $result['createdby'] = $user_manager->getUserName($result['creatorid']);
                $result['modifiedby'] = $user_manager->getUserName($result['modid']);
                $result['creationdateh'] = date('Y/m/d, H:i', $result['creationdate']);
                $result['moddateh'] = date('Y/m/d, H:i', $result['moddate']);
                $result['consentdate'] = $result['consentdate'] ? date('Y/m/d', $result['consentdate']) : '';
                $result['up_logins'] = $this->db->GetRow('SELECT lastlogindate, lastloginip,
					failedlogindate, failedloginip
					FROM up_customers WHERE customerid = ?', array($result['id']));
                // Get country name
                if ($result['countryid']) {
                    $result['country'] = $this->db->GetOne('SELECT name FROM countries WHERE id = ?', array($result['countryid']));
                    if ($result['countryid'] == $result['post_countryid']) {
                        $result['post_country'] = $result['country'];
                    } else {
                        if ($result['post_countryid']) {
                            $result['country'] = $this->db->GetOne('SELECT name FROM countries WHERE id = ?', array($result['post_countryid']));
                        }
                    }
                }
                // Get state name
                if ($cstate = $this->db->GetRow('SELECT s.id, s.name
					FROM states s, zipcodes
					WHERE zip = ? AND stateid = s.id', array($result['zip']))) {
                    $result['stateid'] = $cstate['id'];
                    $result['cstate'] = $cstate['name'];
                }
                if ($result['zip'] == $result['post_zip']) {
                    $result['post_stateid'] = $result['stateid'];
                    $result['post_cstate'] = $result['cstate'];
                } else {
                    if ($result['post_zip'] && ($cstate = $this->db->GetRow('SELECT s.id, s.name
					FROM states s, zipcodes
					WHERE zip = ? AND stateid = s.id', array($result['post_zip'])))) {
                        $result['post_stateid'] = $cstate['id'];
                        $result['post_cstate'] = $cstate['name'];
                    }
                }
            }
            $result['balance'] = $this->getCustomerBalance($result['id']);
            $result['bankaccount'] = bankaccount($result['id'], $result['account']);
            foreach ($CUSTOMERCONTACTTYPES as $contacttype => $properties) {
                $result[$contacttype . 's'] = $this->db->GetAll('SELECT contact AS ' . $contacttype . ',
						contact, name, type
					FROM customercontacts
					WHERE customerid = ? AND type & ? > 0 ORDER BY id', array($result['id'], $properties['flagmask']));
            }
            $result['sendinvoices'] = false;
            foreach (array_keys($CUSTOMERCONTACTTYPES) as $ctype) {
                $customercontacttype = $CUSTOMERCONTACTTYPES[$ctype];
                $ctype .= 's';
                if (is_array($result[$ctype])) {
                    foreach ($result[$ctype] as $idx => $row) {
                        $types = array();
                        foreach ($CONTACTTYPES as $tidx => $tname) {
                            if ($row['type'] & $tidx && isset($customercontacttype['ui']['flags'][$row['type'] & $tidx])) {
                                $types[] = $tname;
                            }
                        }
                        if (isset($customercontacttype['ui']['typeselectors'])) {
                            $result[$ctype][$idx]['typeselector'] = $tidx;
                        }
                        if ($ctype == 'emails' && ($row['type'] & (CONTACT_INVOICES | CONTACT_DISABLED)) == CONTACT_INVOICES) {
                            $result['sendinvoices'] = true;
                        }
                        if ($types) {
                            $result[$ctype][$idx]['typestr'] = implode('/', $types);
                        }
                    }
                }
            }
            $result['contacts'] = $result['phones'];
            if (empty($result['invoicenotice'])) {
                $result['sendinvoices'] = false;
            }
            return $result;
        } else {
            return false;
        }
    }
开发者ID:prezeskk,项目名称:lms,代码行数:98,代码来源:LMSCustomerManager.php


示例12: lms_current_user

			WHERE e.userid = lms_current_user() AND a.customerid = d.customerid)' . ' ORDER BY CEIL(d.cdate/86400), d.id', array($_GET['from'], $_GET['to'], DOC_DNOTE));
    if (!$ids) {
        $SESSION->close();
        die;
    }
    $count = sizeof($ids);
    $i = 0;
    foreach ($ids as $idx => $noteid) {
        $note = $LMS->GetNoteContent($noteid);
        if ($count == 1) {
            $docnumber = docnumber($note['number'], $note['template'], $note['cdate']);
        }
        $note['division_header'] = str_replace('%bankaccount', format_bankaccount(bankaccount($note['customerid'], $note['account'])), $note['division_header']);
        $document->Draw($note);
    }
} elseif ($note = $LMS->GetNoteContent($_GET['id'])) {
    $docnumber = $number = docnumber($note['number'], $note['template'], $note['cdate']);
    $layout['pagetitle'] = trans('Debit Note No. $a', $number);
    $note['last'] = TRUE;
    $note['division_header'] = str_replace('%bankaccount', format_bankaccount(bankaccount($note['customerid'], $note['account'])), $note['division_header']);
    $document->Draw($note);
} else {
    $SESSION->redirect('?m=notelist');
}
if (!is_null($attachment_name) && isset($docnumber)) {
    $attachment_name = str_replace('%number', $docnumber, $attachment_name);
    $attachment_name = preg_replace('/[^[:alnum:]_\\.]/i', '_', $attachment_name);
} else {
    $attachment_name = 'invoices.' . ($note_type == 'pdf' ? 'pdf' : 'html');
}
$document->WriteToBrowser($attachment_name);
开发者ID:itav,项目名称:lms,代码行数:31,代码来源:note.php


示例13: invoice_footnote_v2

function invoice_footnote_v2() {
	global $pdf, $invoice;
	if (!empty($invoice['division_footer'])) {
		$pdf->Ln(5);
		$tmp = $invoice['division_footer'];
		
		$account = format_bankaccount(bankaccount($invoice['customerid'], $invoice['account']));
		$tmp = str_replace('%bankaccount', $account, $tmp);

		$pdf->SetFont('arial', '', 7);
		$h = $pdf->getStringHeight(0, $tmp);
		$tmp = mb_ereg_replace('\r?\n', '<br>', $tmp);
		if ($invoice['templatefile']=='standard')
		    $pdf->writeHTMLCell(0, 0, '', '', $tmp, 0, 1, 0, true, 'C');
		else
		    $pdf->writeHTMLCell(0, 0, '', 188 - $h, $tmp, 0, 1, 0, true, 'C');
	}
}
开发者ID:pcela,项目名称:lms,代码行数:18,代码来源:invoice_tcpdf_v2.inc.php


示例14: invoice_footnote

 protected function invoice_footnote($x, $y, $width, $font_size)
 {
     if (!empty($this->data['division_footer'])) {
         $y = $y - $this->backend->getFontHeight($font_size);
         //$y = $y - $this->backend->text_align_left($x, $y, $font_size, '<b>' . trans('Notes:') . '</b>');
         $tmp = $this->data['division_footer'];
         $accounts = array(bankaccount($this->data['customerid'], $this->data['account']));
         if (ConfigHelper::checkConfig('invoices.show_all_accounts')) {
             $accounts = array_merge($accounts, $this->data['bankaccounts']);
         }
         foreach ($accounts as &$account) {
             $account = format_bankaccount($account);
         }
         $tmp = str_replace('%bankaccount', implode("\n", $accounts), $tmp);
         $tmp = preg_split('/\\r?\\n/', $tmp);
         foreach ($tmp as $line) {
             $y = $this->backend->text_wrap($x, $y, $width, $font_size, $line, "full");
         }
     }
 }
开发者ID:prezeskk,项目名称:lms,代码行数:20,代码来源:LMSEzpdfInvoice.php


示例15: GetInvoiceContent

    function GetInvoiceContent($invoiceid)
    {
        global $PAYTYPES;
        $result = $this->DB->GetRow('SELECT d.id, d.number, d.name, d.customerid, d.type, 
				d.userid, d.address, d.zip, d.city, d.countryid, cn.name AS country,
				d.ten, d.ssn, d.cdate, d.sdate, d.paytime, d.paytype, d.numberplanid,
				d.closed, d.reference, d.reason, d.divisionid, 
				(SELECT name FROM users WHERE id = d.userid) AS user, n.template,
				d.div_name AS division_name, d.div_name AS division_shortname, d.div_shortname AS division_shortnames,
				d.div_address AS division_address, d.div_zip AS division_zip,
				d.div_city AS division_city, d.div_countryid AS division_countryid, 
				d.div_ten AS division_ten, d.div_regon AS division_regon, d.div_account AS account,
				d.div_inv_header AS division_header, d.div_inv_footer AS division_footer,
				d.div_inv_author AS division_author, d.div_inv_cplace AS division_cplace,
				d.fullnumber AS fullnumber,d.version, d.templatetype, d.templatefile, d.sdateview, d.urllogofile, d.print_balance_info, 
				c.pin AS customerpin, c.divisionid AS current_divisionid,
				d.post_name, d.post_address, d.post_zip, d.post_city,
				c.invoice_name, c.invoice_address, c.invoice_zip, c.invoice_city, c.invoice_countryid, c.invoice_ten 
				FROM documents d
				JOIN customers c ON (c.id = d.customerid)
				LEFT JOIN countries cn ON (cn.id = d.countryid) 
				LEFT JOIN numberplans n ON (d.numberplanid = n.id)
				WHERE d.id = ? AND (d.type = ? OR d.type = ? OR d.type = ?)', array($invoiceid, DOC_INVOICE, DOC_CNOTE, DOC_INVOICE_PRO));
        if ($result) {
            $result['pdiscount'] = 0;
            $result['vdiscount'] = 0;
            $result['totalbase'] = 0;
            $result['totaltax'] = 0;
            $result['total'] = 0;
            if ($result['version'] != '2' && ($firma = $this->DB->getrow('SELECT shortname,name,address,city,zip,ten,account,inv_header,inv_footer,inv_author,inv_cplace 
				FROM divisions WHERE id = ? LIMIT 1;', array($result['divisionid'])))) {
                if (empty($result['division_name'])) {
                    $result['division_name'] = $firma['name'];
                }
                if (empty($result['division_shortname'])) {
                    $result['division_shortname'] = $firma['name'];
                }
                if (empty($result['division_address'])) {
                    $result['division_address'] = $firma['address'];
                }
                if (empty($result['division_zip'])) {
                    $result['division_zip'] = $firma['zip'];
                }
                if (empty($result['division_city'])) {
                    $result['division_city'] = $firma['city'];
                }
                if (empty($result['division_ten'])) {
                    $result['division_ten'] = $firma['ten'];
                }
                if (empty($result['account'])) {
                    $result['account'] = $firma['account'];
                }
                if (empty($result['division_header'])) {
                    $result['division_header'] = $firma['inv_header'];
                }
                if (empty($result['division_footer'])) {
                    $result['division_footer'] = $firma['inv_footer'];
                }
                if (empty($result['division_author'])) {
                    $result['division_author'] = $firma['inv_author'];
                }
                if (empty($result['division_cplace'])) {
                    $result['division_cplace'] = $firma['inv_cplace'];
                }
            }
            if ($result['reference'] && $result['type'] != DOC_INVOICE_PRO) {
                $result['invoice'] = $this->GetInvoiceContent($result['reference']);
            }
            if (!$result['division_header']) {
                $result['division_header'] = $result['division_name'] . "\n" . $result['division_address'] . "\n" . $result['division_zip'] . ' ' . $result['division_city'] . ($result['division_countryid'] && $result['countryid'] && $result['division_countryid'] != $result['countryid'] ? "\n" . trans($this->GetCountryName($result['division_countryid'])) : '') . ($result['division_ten'] != '' ? "\n" . trans('TEN') . ' ' . $result['division_ten'] : '') . ($result['account'] != '' ? "\n" . "Nr konta: " . format_bankaccount(bankaccount($result['customerid'], $result['account'])) : '');
            }
            if ($result['content'] = $this->DB->GetAll('SELECT invoicecontents.value AS value, 
						itemid, taxid, taxes.value AS taxvalue, taxes.label AS taxlabel, 
						prodid, content, count, invoicecontents.description AS description, 
						tariffid, itemid, pdiscount, vdiscount 
						FROM invoicecontents 
						LEFT JOIN taxes ON taxid = taxes.id 
						WHERE docid=? 
						ORDER BY itemid', array($invoiceid))) {
                foreach ($result['content'] as $idx => $row) {
                    if (isset($result['invoice'])) {
                        $row['value'] += $result['invoice']['content'][$idx]['value'];
                        $row['count'] += $result['invoice']['content'][$idx]['count'];
                    }
                    $result['content'][$idx]['basevalue'] = round($row['value'] / (100 + $row['taxvalue']) * 100, 2);
                    $result['content'][$idx]['total'] = round($row['value'] * $row['count'], 2);
                    $result['content'][$idx]['totalbase'] = round($result['content'][$idx]['total'] / (100 + $row['taxvalue']) * 100, 2);
                    $result['content'][$idx]['totaltax'] = round($result['content'][$idx]['total'] - $result['content'][$idx]['totalbase'], 2);
                    $result['content'][$idx]['value'] = $row['value'];
                    $result['content'][$idx]['count'] = $row['count'];
                    if (isset($result['taxest'][$row['taxvalue']])) {
                        $result['taxest'][$row['taxvalue']]['base'] += $result['content'][$idx]['totalbase'];
                        $result['taxest'][$row['taxvalue']]['total'] += $result['content'][$idx]['total'];
                        $result['taxest'][$row['taxvalue']]['tax'] += $result['content'][$idx]['totaltax'];
                    } else {
                        $result['taxest'][$row['taxvalue']]['base'] = $result['content'][$idx]['totalbase'];
                        $result['taxest'][$row['taxvalue']]['total'] = $result['content'][$idx]['total'];
                        $result['taxest'][$row['taxvalue']]['tax'] = $result['content'][$idx]['totaltax'];
                        $result['taxest'][$row['taxvalue']]['taxlabel'] = $row['taxlabel'];
                    }
//.........这里部分代码省略.........
开发者ID:bochniak,项目名称:lms,代码行数:101,代码来源:LMS.class.php


示例16: parse_customer_data

function parse_customer_data($data, $row)
{
    global $DB;
    $amount = -$row['balance'];
    $data = preg_replace("/\\%bankaccount/", format_bankaccount(bankaccount($row['id'], $row['account'])), $data);
    $data = preg_replace("/\\%b/", $amount, $data);
    $data = preg_replace("/\\%date-y/", strftime("%Y"), $data);
    $data = preg_replace("/\\%date-m/", strftime("%m"), $data);
    $data = preg_replace("/\\%date_month_name/", strftime("%B"), $data);
    $deadline = $row['cdate'] + $row['paytime'] * 86400;
    $data = preg_replace("/\\%deadline-y/", strftime("%Y", $deadline), $data);
    $data = preg_replace("/\\%deadline-m/", strftime("%m", $deadline), $data);
    $data = preg_replace("/\\%deadline-d/", strftime("%d", $deadline), $data);
    $data = preg_replace("/\\%B/", $row['balance'], $data);
    $data = preg_replace("/\\%saldo/", moneyf($row['balance']), $data);
    $data = preg_replace("/\\%pin/", $row['pin'], $data);
    $data = preg_replace("/\\%cid/", $row['id'], $data);
    if (preg_match("/\\%abonament/", $data)) {
        $saldo = $DB->GetOne("SELECT SUM(value)\n\t\t\tFROM assignments, tariffs\n\t\t\tWHERE tariffid = tariffs.id AND customerid = ?\n\t\t\t\tAND (datefrom <= {$currtime} OR datefrom = 0)\n\t\t\t\tAND (dateto > {$currtime} OR dateto = 0)\n\t\t\t\tAND ((datefrom < dateto) OR (datefrom = 0 AND datefrom = 0))", array($row['id']));
        $data = preg_replace("/\\%abonament/", $saldo, $data);
    }
    // invoices, debit notes
    $data = preg_replace("/\\%invoice/", $row['doc_number'], $data);
    $data = preg_replace("/\\%number/", $row['doc_number'], $data);
    $data = preg_replace("/\\%value/", $row['value'], $data);
    $data = preg_replace("/\\%cdate-y/", strftime("%Y", $row['cdate']), $data);
    $data = preg_replace("/\\%cdate-m/", strftime("%m", $row['cdate']), $data);
    $data = preg_replace("/\\%cdate-d/", strftime("%d", $row['cdate']), $data);
    list($now_y, $now_m) = explode('/', strftime("%Y/%m", time()));
    $data = preg_replace("/\\%lastday/", strftime("%d", mktime(12, 0, 0, $now_m + 1, 0, $now_y)), $data);
    return $data;
}
开发者ID:kornelek,项目名称:lms,代码行数:32,代码来源:lms-notify.php


示例17: GetCustomer

    function GetCustomer($id, $short = false)
    {
        global $CONTACTTYPES;
        if ($result = $this->DB->GetRow('SELECT c.*, ' . $this->DB->Concat('UPPER(c.lastname)', "' '", 'c.name') . ' AS customername,
			(SELECT co.name FROM customerorigin co WHERE co.id = c.origin) AS originname, 
			d.shortname AS division, d.account
			FROM customers' . (defined('LMS-UI') ? 'view' : '') . ' c 
			LEFT JOIN divisions d ON (d.id = c.divisionid)
			WHERE c.id = ?', array($id))) {
            if (!$short) {
                $result['createdby'] = $this->GetUserName($result['creatorid']);
                $result['modifiedby'] = $this->GetUserName($result['modid']);
                $result['creationdateh'] = date('Y/m/d, H:i', $result['creationdate']);
                $result['moddateh'] = date('Y/m/d, H:i', $result['moddate']);
                $result['consentdate'] = $result['consentdate'] ? date('Y/m/d', $result['consentdate']) : '';
                $result['up_logins'] = $this->DB->GetRow('SELECT lastlogindate, lastloginip, 
					failedlogindate, failedloginip
					FROM up_customers WHERE customerid = ?', array($result['id']));
                // Get country name
                if ($result['countryid']) {
                    $result['country'] = $this->DB->GetOne('SELECT name FROM countries WHERE id = ?', array($result['countryid']));
                    if ($result['countryid'] == $result['post_countryid']) {
                        $result['post_country'] = $result['country'];
                    } else {
                        if ($result['post_countryid']) {
                            $result['post_country'] = $this->DB->GetOne('SELECT name FROM countries WHERE id = ?', array($result['post_countryid']));
                        }
                    }
                    if ($result['countryid'] == $result['invoice_countryid']) {
                        $result['invoice_country'] = $result['country'];
                    } else {
                        if ($result['invoice_countryid']) {
                            $result['invoice_country'] = $this->DB->GetOne('SELECT name FROM countries WHERE id = ?', array($result['invoice_countryid']));
                        }
             

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP banner函数代码示例发布时间:2022-05-24
下一篇:
PHP bank_prepare_head函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap