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


PHP Account::fetch方法代码示例

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


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

示例1: create

 /**
  *  Create in database
  *
  *  @param      User	$user       User that create
  *  @return     int      			<0 if KO, >0 if OK
  */
 function create($user)
 {
     global $conf, $langs;
     $error = 0;
     // Clean parameters
     $this->amount = price2num(trim($this->amount));
     $this->label = trim($this->label);
     $this->note = trim($this->note);
     $this->fk_bank = trim($this->fk_bank);
     $this->fk_user_creat = trim($this->fk_user_creat);
     $this->fk_user_modif = trim($this->fk_user_modif);
     // Check parameters
     if (!$this->label) {
         $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Label"));
         return -3;
     }
     if ($this->fk_user < 0 || $this->fk_user == '') {
         $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Employee"));
         return -4;
     }
     if ($this->amount < 0 || $this->amount == '') {
         $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount"));
         return -5;
     }
     if (!empty($conf->banque->enabled) && (empty($this->accountid) || $this->accountid <= 0)) {
         $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Account"));
         return -6;
     }
     if (!empty($conf->banque->enabled) && (empty($this->type_payment) || $this->type_payment <= 0)) {
         $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode"));
         return -7;
     }
     $this->db->begin();
     // Insert into llx_payment_salary
     $sql = "INSERT INTO " . MAIN_DB_PREFIX . "payment_salary (fk_user";
     $sql .= ", datep";
     $sql .= ", datev";
     $sql .= ", amount";
     $sql .= ", fk_typepayment";
     $sql .= ", num_payment";
     if ($this->note) {
         $sql .= ", note";
     }
     $sql .= ", label";
     $sql .= ", datesp";
     $sql .= ", dateep";
     $sql .= ", fk_user_creat";
     $sql .= ", fk_bank";
     $sql .= ", entity";
     $sql .= ") ";
     $sql .= " VALUES (";
     $sql .= "'" . $this->fk_user . "'";
     $sql .= ", '" . $this->db->idate($this->datep) . "'";
     $sql .= ", '" . $this->db->idate($this->datev) . "'";
     $sql .= ", '" . $this->amount . "'";
     $sql .= ", '" . $this->type_payment . "'";
     $sql .= ", '" . $this->num_payment . "'";
     if ($this->note) {
         $sql .= ", '" . $this->db->escape($this->note) . "'";
     }
     $sql .= ", '" . $this->db->escape($this->label) . "'";
     $sql .= ", '" . $this->db->idate($this->datesp) . "'";
     $sql .= ", '" . $this->db->idate($this->dateep) . "'";
     $sql .= ", '" . $user->id . "'";
     $sql .= ", NULL";
     $sql .= ", " . $conf->entity;
     $sql .= ")";
     dol_syslog(get_class($this) . "::create", LOG_DEBUG);
     $result = $this->db->query($sql);
     if ($result) {
         $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "payment_salary");
         if ($this->id > 0) {
             if (!empty($conf->banque->enabled) && !empty($this->amount)) {
                 // Insert into llx_bank
                 require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
                 $acc = new Account($this->db);
                 $result = $acc->fetch($this->accountid);
                 if ($result <= 0) {
                     dol_print_error($this->db);
                 }
                 // Insert payment into llx_bank
                 // Add link 'payment_salary' in bank_url between payment and bank transaction
                 $bank_line_id = $acc->addline($this->datep, $this->type_payment, $this->label, -abs($this->amount), $this->num_payment, '', $user);
                 // Update fk_bank into llx_paiement.
                 // So we know the payment which has generate the banking ecriture
                 if ($bank_line_id > 0) {
                     $this->update_fk_bank($bank_line_id);
                 } else {
                     $this->error = $acc->error;
                     $error++;
                 }
                 if (!$error) {
                     // Add link 'payment_salary' in bank_url between payment and bank transaction
                     $url = DOL_URL_ROOT . '/compta/salaries/card.php?id=';
//.........这里部分代码省略.........
开发者ID:ADDAdev,项目名称:Dolibarr,代码行数:101,代码来源:paymentsalary.class.php

示例2: setEventMessage

     setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")), "errors");
 }
 if (!GETPOST('account_from', 'int')) {
     $error = 1;
     setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentities("TransferFrom")), "errors");
 }
 if (!GETPOST('account_to', 'int')) {
     $error = 1;
     setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentities("TransferTo")), "errors");
 }
 if (!$error) {
     require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
     $accountfrom = new Account($db);
     $accountfrom->fetch($_POST["account_from"]);
     $accountto = new Account($db);
     $accountto->fetch($_POST["account_to"]);
     if ($accountto->id != $accountfrom->id) {
         $db->begin();
         $error = 0;
         $bank_line_id_from = 0;
         $bank_line_id_to = 0;
         $result = 0;
         // By default, electronic transfert from bank to bank
         $typefrom = 'PRE';
         $typeto = 'VIR';
         if ($accountto->courant == 2 || $accountfrom->courant == 2) {
             // This is transfert of change
             $typefrom = 'LIQ';
             $typeto = 'LIQ';
         }
         if (!$error) {
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:31,代码来源:transfers.php

示例3: elseif

 /**
  *   Show miscellaneous information (payment mode, payment term, ...)
  *
  *   @param		PDF			$pdf     		Object PDF
  *   @param		Object		$object			Object to show
  *   @param		int			$posy			Y
  *   @param		Translate	$outputlangs	Langs object
  *   @return	void
  */
 function _tableau_info(&$pdf, $object, $posy, $outputlangs)
 {
     global $conf;
     $default_font_size = pdf_getPDFFontSize($outputlangs);
     $pdf->SetFont('', '', $default_font_size - 1);
     // If France, show VAT mention if not applicable
     if ($this->emetteur->country_code == 'FR' && $this->franchise == 1) {
         $pdf->SetFont('', 'B', $default_font_size - 2);
         $pdf->SetXY($this->marge_gauche, $posy);
         $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0);
         $posy = $pdf->GetY() + 4;
     }
     $posxval = 52;
     // Show payments conditions
     if ($object->type != 2 && ($object->cond_reglement_code || $object->cond_reglement)) {
         $pdf->SetFont('', 'B', $default_font_size - 2);
         $pdf->SetXY($this->marge_gauche, $posy);
         $titre = $outputlangs->transnoentities("PaymentConditions") . ':';
         $pdf->MultiCell(80, 4, $titre, 0, 'L');
         $pdf->SetFont('', '', $default_font_size - 2);
         $pdf->SetXY($posxval, $posy);
         $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition" . $object->cond_reglement_code) != 'PaymentCondition' . $object->cond_reglement_code ? $outputlangs->transnoentities("PaymentCondition" . $object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc);
         $lib_condition_paiement = str_replace('\\n', "\n", $lib_condition_paiement);
         $pdf->MultiCell(80, 4, $lib_condition_paiement, 0, 'L');
         $posy = $pdf->GetY() + 3;
     }
     if ($object->type != 2) {
         // Check a payment mode is defined
         if (empty($object->mode_reglement_code) && empty($conf->global->FACTURE_CHQ_NUMBER) && empty($conf->global->FACTURE_RIB_NUMBER)) {
             $this->error = $outputlangs->transnoentities("ErrorNoPaiementModeConfigured");
         } elseif ($object->mode_reglement_code == 'CHQ' && empty($conf->global->FACTURE_CHQ_NUMBER) || $object->mode_reglement_code == 'VIR' && empty($conf->global->FACTURE_RIB_NUMBER)) {
             $outputlangs->load("errors");
             $pdf->SetXY($this->marge_gauche, $posy);
             $pdf->SetTextColor(200, 0, 0);
             $pdf->SetFont('', 'B', $default_font_size - 2);
             $this->error = $outputlangs->transnoentities("ErrorPaymentModeDefinedToWithoutSetup", $object->mode_reglement_code);
             $pdf->MultiCell(80, 3, $this->error, 0, 'L', 0);
             $pdf->SetTextColor(0, 0, 0);
             $posy = $pdf->GetY() + 1;
         }
         // Show payment mode
         if ($object->mode_reglement_code && $object->mode_reglement_code != 'CHQ' && $object->mode_reglement_code != 'VIR') {
             $pdf->SetFont('', 'B', $default_font_size - 2);
             $pdf->SetXY($this->marge_gauche, $posy);
             $titre = $outputlangs->transnoentities("PaymentMode") . ':';
             $pdf->MultiCell(80, 5, $titre, 0, 'L');
             $pdf->SetFont('', '', $default_font_size - 2);
             $pdf->SetXY($posxval, $posy);
             $lib_mode_reg = $outputlangs->transnoentities("PaymentType" . $object->mode_reglement_code) != 'PaymentType' . $object->mode_reglement_code ? $outputlangs->transnoentities("PaymentType" . $object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement);
             $pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L');
             $posy = $pdf->GetY() + 2;
         }
         // Show payment mode CHQ
         if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') {
             // Si mode reglement non force ou si force a CHQ
             if (!empty($conf->global->FACTURE_CHQ_NUMBER)) {
                 $diffsizetitle = empty($conf->global->PDF_DIFFSIZE_TITLE) ? 3 : $conf->global->PDF_DIFFSIZE_TITLE;
                 if ($conf->global->FACTURE_CHQ_NUMBER > 0) {
                     $account = new Account($this->db);
                     $account->fetch($conf->global->FACTURE_CHQ_NUMBER);
                     $pdf->SetXY($this->marge_gauche, $posy);
                     $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle);
                     $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $account->proprio), 0, 'L', 0);
                     $posy = $pdf->GetY() + 1;
                     if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS)) {
                         $pdf->SetXY($this->marge_gauche, $posy);
                         $pdf->SetFont('', '', $default_font_size - $diffsizetitle);
                         $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', 0);
                         $posy = $pdf->GetY() + 2;
                     }
                 }
                 if ($conf->global->FACTURE_CHQ_NUMBER == -1) {
                     $pdf->SetXY($this->marge_gauche, $posy);
                     $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle);
                     $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $this->emetteur->name), 0, 'L', 0);
                     $posy = $pdf->GetY() + 1;
                     if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS)) {
                         $pdf->SetXY($this->marge_gauche, $posy);
                         $pdf->SetFont('', '', $default_font_size - $diffsizetitle);
                         $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0);
                         $posy = $pdf->GetY() + 2;
                     }
                 }
             }
         }
         // If payment mode not forced or forced to VIR, show payment with BAN
         if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR') {
             if (!empty($object->fk_account) || !empty($object->fk_bank) || !empty($conf->global->FACTURE_RIB_NUMBER)) {
                 $bankid = empty($object->fk_account) ? $conf->global->FACTURE_RIB_NUMBER : $object->fk_account;
                 if (!empty($object->fk_bank)) {
                     $bankid = $object->fk_bank;
//.........这里部分代码省略.........
开发者ID:NoisyBoy86,项目名称:Dolibarr_test,代码行数:101,代码来源:pdf_crabe.modules.php

示例4: addPaymentToBank

 /**
  *      Add a record into bank for payment with links between this bank record and invoices of payment.
  *      All payment properties (this->amount, this->amounts, ...) must have been set first like after a call to create().
  *
  *      @param	User	$user               Object of user making payment
  *      @param  string	$mode               'payment', 'payment_supplier'
  *      @param  string	$label              Label to use in bank record
  *      @param  int		$accountid          Id of bank account to do link with
  *      @param  string	$emetteur_nom       Name of transmitter
  *      @param  string	$emetteur_banque    Name of bank
  *      @param	int		$notrigger			No trigger
  *      @return int                 		<0 if KO, bank_line_id if OK
  */
 function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque, $notrigger = 0)
 {
     global $conf, $langs, $user;
     $error = 0;
     $bank_line_id = 0;
     if (!empty($conf->banque->enabled)) {
         if ($accountid <= 0) {
             $this->error = 'Bad value for parameter accountid';
             dol_syslog(get_class($this) . '::addPaymentToBank ' . $this->error, LOG_ERR);
             return -1;
         }
         $this->db->begin();
         $this->fk_account = $accountid;
         require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
         dol_syslog("{$user->id},{$mode},{$label},{$this->fk_account},{$emetteur_nom},{$emetteur_banque}");
         $acc = new Account($this->db);
         $result = $acc->fetch($this->fk_account);
         $totalamount = $this->amount;
         if (empty($totalamount)) {
             $totalamount = $this->total;
         }
         // For backward compatibility
         if ($mode == 'payment_supplier') {
             $totalamount = -$totalamount;
         }
         // Insert payment into llx_bank
         $bank_line_id = $acc->addline($this->datepaye, $this->paiementid, $label, $totalamount, $this->num_paiement, '', $user, $emetteur_nom, $emetteur_banque);
         // Mise a jour fk_bank dans llx_paiement
         // On connait ainsi le paiement qui a genere l'ecriture bancaire
         if ($bank_line_id > 0) {
             $result = $this->update_fk_bank($bank_line_id);
             if ($result <= 0) {
                 $error++;
                 dol_print_error($this->db);
             }
             // Add link 'payment', 'payment_supplier' in bank_url between payment and bank transaction
             if (!$error) {
                 $url = '';
                 if ($mode == 'payment') {
                     $url = DOL_URL_ROOT . '/compta/paiement/card.php?id=';
                 }
                 if ($mode == 'payment_supplier') {
                     $url = DOL_URL_ROOT . '/fourn/paiement/card.php?id=';
                 }
                 if ($url) {
                     $result = $acc->add_url_line($bank_line_id, $this->id, $url, '(paiement)', $mode);
                     if ($result <= 0) {
                         $error++;
                         dol_print_error($this->db);
                     }
                 }
             }
             // Add link 'company' in bank_url between invoice and bank transaction (for each invoice concerned by payment)
             if (!$error && $label != '(WithdrawalPayment)') {
                 $linkaddedforthirdparty = array();
                 foreach ($this->amounts as $key => $value) {
                     if ($mode == 'payment') {
                         $fac = new Facture($this->db);
                         $fac->fetch($key);
                         $fac->fetch_thirdparty();
                         if (!in_array($fac->thirdparty->id, $linkaddedforthirdparty)) {
                             $result = $acc->add_url_line($bank_line_id, $fac->thirdparty->id, DOL_URL_ROOT . '/comm/card.php?socid=', $fac->thirdparty->name, 'company');
                             if ($result <= 0) {
                                 dol_syslog(get_class($this) . '::addPaymentToBank ' . $this->db->lasterror());
                             }
                             $linkaddedforthirdparty[$fac->thirdparty->id] = $fac->thirdparty->id;
                             // Mark as done for this thirdparty
                         }
                     }
                     if ($mode == 'payment_supplier') {
                         $fac = new FactureFournisseur($this->db);
                         $fac->fetch($key);
                         $fac->fetch_thirdparty();
                         if (!in_array($fac->thirdparty->id, $linkaddedforthirdparty)) {
                             $result = $acc->add_url_line($bank_line_id, $fac->thirdparty->id, DOL_URL_ROOT . '/fourn/card.php?socid=', $fac->thirdparty->name, 'company');
                             if ($result <= 0) {
                                 dol_syslog(get_class($this) . '::addPaymentToBank ' . $this->db->lasterror());
                             }
                             $linkaddedforthirdparty[$fac->thirdparty->id] = $fac->thirdparty->id;
                             // Mark as done for this thirdparty
                         }
                     }
                 }
             }
             if (!$error && !$notrigger) {
                 // Appel des triggers
                 $result = $this->call_trigger('PAYMENT_ADD_TO_BANK', $user);
//.........这里部分代码省略.........
开发者ID:Samara94,项目名称:dolibarr,代码行数:101,代码来源:paiement.class.php

示例5: Societe

 */
llxHeader();
$societestatic = new Societe($db);
$facturestatic = new Facture($db);
$facturefournstatic = new FactureFournisseur($db);
$socialcontribstatic = new ChargeSociales($db);
$form = new Form($db);
if ($_REQUEST["account"] || $_REQUEST["ref"]) {
    if ($vline) {
        $viewline = $vline;
    } else {
        $viewline = 20;
    }
    $acct = new Account($db);
    if ($_GET["account"]) {
        $result = $acct->fetch($_GET["account"]);
    }
    if ($_GET["ref"]) {
        $result = $acct->fetch(0, $_GET["ref"]);
        $_GET["account"] = $acct->id;
    }
    // Onglets
    $head = bank_prepare_head($acct);
    dol_fiche_head($head, 'cash', $langs->trans("FinancialAccount"), 0, 'account');
    print '<table class="border" width="100%">';
    $linkback = '<a href="' . DOL_URL_ROOT . '/compta/bank/index.php">' . $langs->trans("BackToList") . '</a>';
    // Ref
    print '<tr><td width="25%">' . $langs->trans("Ref") . '</td>';
    print '<td colspan="3">';
    print $form->showrefnav($acct, 'ref', $linkback, 1, 'ref');
    print '</td></tr>';
开发者ID:TAASA,项目名称:Dolibarr-ERP-3.8.1,代码行数:31,代码来源:treso.php

示例6: Account

dol_fiche_head($tabs, 0, $langs->trans('LineRecord'), 0, 'account');
$sql = "SELECT b.rowid,b.dateo as do,b.datev as dv, b.amount, b.label, b.rappro,";
$sql .= " b.num_releve, b.fk_user_author, b.num_chq, b.fk_type, b.fk_account, b.fk_bordereau as receiptid,";
$sql .= " b.emetteur,b.banque";
$sql .= " FROM " . MAIN_DB_PREFIX . "bank as b";
$sql .= " WHERE rowid=" . $rowid;
$sql .= " ORDER BY dateo ASC";
$result = $db->query($sql);
if ($result) {
    $i = 0;
    $total = 0;
    if ($db->num_rows($result)) {
        $objp = $db->fetch_object($result);
        $total = $total + $objp->amount;
        $acct = new Account($db);
        $acct->fetch($objp->fk_account);
        $account = $acct->id;
        $bankline = new AccountLine($db);
        $bankline->fetch($rowid, $ref);
        $links = $acct->get_url($rowid);
        $bankline->load_previous_next_ref('', 'rowid');
        // Confirmations
        if ($action == 'delete_categ') {
            print $form->formconfirm($_SERVER['PHP_SELF'] . "?rowid=" . $rowid . "&cat1=" . GETPOST("fk_categ") . "&orig_account=" . $orig_account, $langs->trans("RemoveFromRubrique"), $langs->trans("RemoveFromRubriqueConfirm"), "confirm_delete_categ", '', 'yes', 1);
        }
        print '<form name="update" method="POST" action="' . $_SERVER['PHP_SELF'] . '?rowid=' . $rowid . '">';
        print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
        print '<input type="hidden" name="action" value="update">';
        print '<input type="hidden" name="orig_account" value="' . $orig_account . '">';
        print '<input type="hidden" name="id" value="' . $acct->id . '">';
        print '<table class="border" width="100%">';
开发者ID:NoisyBoy86,项目名称:Dolibarr_test,代码行数:31,代码来源:ligne.php

示例7: Account

if ($account) {
    if (!preg_match('/,/', $account)) {
        $moreparam = '&month=' . $month . '&year=' . $year . ($mode == 'showalltime' ? '&mode=showalltime' : '');
        if ($_GET["option"] != 'all') {
            $morehtml = '<a href="' . $_SERVER["PHP_SELF"] . '?account=' . $account . '&option=all' . $moreparam . '">' . $langs->trans("ShowAllAccounts") . '</a>';
            print $form->showrefnav($acct, 'ref', $linkback, 1, 'ref', 'ref', '', $moreparam);
        } else {
            $morehtml = '<a href="' . $_SERVER["PHP_SELF"] . '?account=' . $account . $moreparam . '">' . $langs->trans("BackToAccount") . '</a>';
            print $langs->trans("All");
            //print $morehtml;
        }
    } else {
        $bankaccount = new Account($db);
        $listid = explode(',', $account);
        foreach ($listid as $key => $id) {
            $bankaccount->fetch($id);
            $bankaccount->label = $bankaccount->ref;
            print $bankaccount->getNomUrl(1);
            if ($key < count($listid) - 1) {
                print ', ';
            }
        }
    }
} else {
    print $langs->trans("All");
}
print '</td></tr>';
// Label
print '<tr><td>' . $langs->trans("Label") . '</td>';
print '<td colspan="3">';
if ($account && $_GET["option"] != 'all') {
开发者ID:Samara94,项目名称:dolibarr,代码行数:31,代码来源:graph.php

示例8: Account

	/**
	 *	\brief      Affiche infos divers
	 *	\param      pdf             Objet PDF
	 *	\param      object          Objet commande
	 *	\param		posy			Position depart
	 *	\param		outputlangs		Objet langs
	 *	\return     y               Position pour suite
	 */
	function _tableau_info(&$pdf, $object, $posy, $outputlangs)
	{
		global $conf;
		$default_font_size = pdf_getPDFFontSize($outputlangs);

		$pdf->SetFont('','', $default_font_size - 1);

        // If France, show VAT mention if not applicable
		if ($this->emetteur->pays_code == 'FR' && $this->franchise == 1)
		{
			$pdf->SetFont('','B', $default_font_size - 2);
			$pdf->SetXY($this->marge_gauche, $posy);
			$pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0);

			$posy=$pdf->GetY()+4;
		}

        // Show payments conditions
		if ($object->cond_reglement_code || $object->cond_reglement)
		{
			$pdf->SetFont('','B', $default_font_size - 2);
			$pdf->SetXY($this->marge_gauche, $posy);
			$titre = $outputlangs->transnoentities("PaymentConditions").':';
			$pdf->MultiCell(80, 4, $titre, 0, 'L');

			$pdf->SetFont('','', $default_font_size - 2);
			$pdf->SetXY(52, $posy);
			$lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement_doc);
			$lib_condition_paiement=str_replace('\n',"\n",$lib_condition_paiement);
			$pdf->MultiCell(80, 4, $lib_condition_paiement,0,'L');

			$posy=$pdf->GetY()+3;
		}

        // Check a payment mode is defined
        /* Not used with orders
        if (empty($object->mode_reglement_code)
        	&& ! $conf->global->FACTURE_CHQ_NUMBER
        	&& ! $conf->global->FACTURE_RIB_NUMBER)
		{
            $pdf->SetXY($this->marge_gauche, $posy);
            $pdf->SetTextColor(200,0,0);
            $pdf->SetFont('','B', $default_font_size - 2);
            $pdf->MultiCell(90, 3, $outputlangs->transnoentities("ErrorNoPaiementModeConfigured"),0,'L',0);
            $pdf->SetTextColor(0,0,0);

            $posy=$pdf->GetY()+1;
        }*/

      	// Show payment mode
        if ($object->mode_reglement_code
        	 && $object->mode_reglement_code != 'CHQ'
           	 && $object->mode_reglement_code != 'VIR')
           	 {
	            $pdf->SetFont('','B', $default_font_size - 2);
	            $pdf->SetXY($this->marge_gauche, $posy);
	            $titre = $outputlangs->transnoentities("PaymentMode").':';
	            $pdf->MultiCell(80, 5, $titre, 0, 'L');

				$pdf->SetFont('','', $default_font_size - 2);
	            $pdf->SetXY(50, $posy);
	            //print "xxx".$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code);exit;
	            $lib_mode_reg=$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code)!=('PaymentType'.$object->mode_reglement_code)?$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code):$outputlangs->convToOutputCharset($object->mode_reglement);
	            $pdf->MultiCell(80, 5, $lib_mode_reg,0,'L');

	            $posy=$pdf->GetY()+2;
           	 }

		// Show payment mode CHQ
        if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ')
        {
        	// Si mode reglement non force ou si force a CHQ
	        if ($conf->global->FACTURE_CHQ_NUMBER)
	        {
	            if ($conf->global->FACTURE_CHQ_NUMBER > 0)
	            {
	                $account = new Account($this->db);
	                $account->fetch($conf->global->FACTURE_CHQ_NUMBER);

	                $pdf->SetXY($this->marge_gauche, $posy);
					$pdf->SetFont('','B', $default_font_size - 2);
	                $pdf->MultiCell(90, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$account->proprio).':',0,'L',0);
		            $posy=$pdf->GetY()+1;

	                $pdf->SetXY($this->marge_gauche, $posy);
	                $pdf->SetFont('','', $default_font_size - 2);
	                $pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($account->adresse_proprio), 0, 'L', 0);
		            $posy=$pdf->GetY()+2;
	            }
	            if ($conf->global->FACTURE_CHQ_NUMBER == -1)
	            {
	                $pdf->SetXY($this->marge_gauche, $posy);
//.........这里部分代码省略.........
开发者ID:remyyounes,项目名称:dolibarr,代码行数:101,代码来源:pdf_edison.modules.php

示例9: addPaymentToBank

    /**
     *      Add record into bank for payment with links between this bank record and invoices of payment.
     *      All payment properties must have been set first like after a call to create().
     *      @param      user                Object of user making payment
     *      @param      mode                'payment_sc'
     *      @param      label               Label to use in bank record
     *      @param      accountid           Id of bank account to do link with
     *      @param      emetteur_nom        Name of transmitter
     *      @param      emetteur_banque     Name of bank
     *      @return     int                 <0 if KO, >0 if OK
     */
    function addPaymentToBank($user,$mode,$label,$accountid,$emetteur_nom,$emetteur_banque)
    {
        global $conf;

        $error=0;

        if ($conf->banque->enabled)
        {
            require_once(DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php');

            $acc = new Account($this->db);
            $acc->fetch($accountid);

            $total=$this->total;
            if ($mode == 'payment_sc') $total=-$total;

            // Insert payment into llx_bank
            $bank_line_id = $acc->addline($this->datepaye,
            $this->paiementtype,  // Payment mode id or code ("CHQ or VIR for example")
            $label,
            $total,
            $this->num_paiement,
            '',
            $user,
            $emetteur_nom,
            $emetteur_banque);

            // Mise a jour fk_bank dans llx_paiement.
            // On connait ainsi le paiement qui a genere l'ecriture bancaire
            if ($bank_line_id > 0)
            {
                $result=$this->update_fk_bank($bank_line_id);
                if ($result <= 0)
                {
                    $error++;
                    dol_print_error($this->db);
                }

                // Add link 'payment', 'payment_supplier', 'payment_sc' in bank_url between payment and bank transaction
                $url='';
                if ($mode == 'payment_sc') $url=DOL_URL_ROOT.'/compta/payment_sc/fiche.php?id=';
                if ($url)
                {
                    $result=$acc->add_url_line($bank_line_id, $this->id, $url, '(paiement)', $mode);
                    if ($result <= 0)
                    {
                        $error++;
                        dol_print_error($this->db);
                    }
                }

                // Add link 'company' in bank_url between invoice and bank transaction (for each invoice concerned by payment)
                $linkaddedforthirdparty=array();
                foreach ($this->amounts as $key => $value)
                {
                    if ($mode == 'payment_sc')
                    {
                        $socialcontrib = new ChargeSociales($this->db);
                        $socialcontrib->fetch($key);
                        $result=$acc->add_url_line($bank_line_id, $socialcontrib->id,
                        DOL_URL_ROOT.'/compta/charges.php?id=', $socialcontrib->type_libelle.(($socialcontrib->lib && $socialcontrib->lib!=$socialcontrib->type_libelle)?' ('.$socialcontrib->lib.')':''),'sc');
                        if ($result <= 0) dol_print_error($this->db);
                    }
                }
            }
            else
            {
                $this->error=$acc->error;
                $error++;
            }
        }

        if (! $error)
        {
            return 1;
        }
        else
        {
            return -1;
        }
    }
开发者ID:remyyounes,项目名称:dolibarr,代码行数:92,代码来源:paymentsocialcontribution.class.php

示例10: Account

     }
     $canbedeleted = $account->can_be_deleted();
     // Renvoi vrai si compte sans mouvements
     if ($user->rights->banque->configurer && $canbedeleted) {
         print '<a class="butActionDelete" href="' . $_SERVER["PHP_SELF"] . '?action=delete&id=' . $account->id . '">' . $langs->trans("Delete") . '</a>';
     }
     print '</div>';
 }
 /* ************************************************************************** */
 /*                                                                            */
 /* Edition                                                                    */
 /*                                                                            */
 /* ************************************************************************** */
 if (GETPOST('id', 'int') && $action == 'edit' && $user->rights->banque->configurer) {
     $account = new Account($db);
     $account->fetch(GETPOST('id', 'int'));
     print load_fiche_titre($langs->trans("EditFinancialAccount"), '', 'title_bank.png');
     if ($conf->use_javascript_ajax) {
         print "\n" . '<script type="text/javascript" language="javascript">';
         print 'jQuery(document).ready(function () {
                     jQuery("#selecttype").change(function() {
                         document.formsoc.action.value="edit";
                         document.formsoc.submit();
                     });
                })' . "\n";
         print 'jQuery(document).ready(function () {
                     jQuery("#selectaccount_country_id").change(function() {
                         document.formsoc.action.value="edit";
                         document.formsoc.submit();
                     });
                })';
开发者ID:Albertopf,项目名称:prueba,代码行数:31,代码来源:card.php

示例11: Account

if ($date_start && $date_end) {
    $sql .= " AND b.dateo >= '" . $db->idate($date_start) . "' AND b.dateo <= '" . $db->idate($date_end) . "'";
}
$sql .= " ORDER BY b.datev";
$object = new Account($db);
$paymentstatic = new Paiement($db);
$paymentsupplierstatic = new PaiementFourn($db);
$societestatic = new Societe($db);
$userstatic = new User($db);
$chargestatic = new ChargeSociales($db);
$paymentdonstatic = new PaymentDonation($db);
$paymentvatstatic = new TVA($db);
$paymentsalstatic = new PaymentSalary($db);
// Get code of finance journal
$bank_code_journal = new Account($db);
$result = $bank_code_journal->fetch($id_bank_account);
$journal = $bank_code_journal->accountancy_journal;
dol_syslog("accountancy/journal/bankjournal.php", LOG_DEBUG);
$result = $db->query($sql);
if ($result) {
    $num = $db->num_rows($result);
    // Variables
    $cptfour = !empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : $langs->trans("CodeNotDef");
    $cptcli = !empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) ? $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER : $langs->trans("CodeNotDef");
    $accountancy_account_salary = !empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) ? $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT : $langs->trans("CodeNotDef");
    $accountancy_account_pay_vat = !empty($conf->global->ACCOUNTING_VAT_PAY_ACCOUNT) ? $conf->global->ACCOUNTING_VAT_PAY_ACCOUNT : $langs->trans("CodeNotDef");
    $accountancy_account_pay_donation = !empty($conf->global->DONATION_ACCOUNTINGACCOUNT) ? $conf->global->DONATION_ACCOUNTINGACCOUNT : $langs->trans("CodeNotDef");
    $tabpay = array();
    $tabbq = array();
    $tabtp = array();
    $tabtype = array();
开发者ID:Albertopf,项目名称:prueba,代码行数:31,代码来源:bankjournal.php

示例12: generatePdf

 /**
  *	Build document
  *	@param 		model 			Model name
  *	@param 		outputlangs		Object langs
  * 	@return  	int        		<0 if KO, >0 if OK
  */
 function generatePdf($model = 'blochet', $outputlangs)
 {
     global $langs, $conf;
     if (empty($model)) {
         $model = 'blochet';
     }
     dol_syslog("RemiseCheque::generatePdf model=" . $model . " id=" . $this->id, LOG_DEBUG);
     $dir = DOL_DOCUMENT_ROOT . "/includes/modules/cheque/pdf/";
     // Charge le modele
     $file = "pdf_" . $model . ".class.php";
     if (file_exists($dir . $file)) {
         require_once DOL_DOCUMENT_ROOT . "/compta/bank/class/account.class.php";
         require_once $dir . $file;
         $classname = 'BordereauCheque' . ucfirst($model);
         $docmodel = new $classname($db);
         $sql = "SELECT b.banque, b.emetteur, b.amount, b.num_chq";
         $sql .= " FROM " . MAIN_DB_PREFIX . "bank as b";
         $sql .= ", " . MAIN_DB_PREFIX . "bank_account as ba";
         $sql .= ", " . MAIN_DB_PREFIX . "bordereau_cheque as bc";
         $sql .= " WHERE b.fk_account = ba.rowid";
         $sql .= " AND b.fk_bordereau = bc.rowid";
         $sql .= " AND bc.rowid = " . $this->id;
         $sql .= " AND bc.entity = " . $conf->entity;
         $sql .= " ORDER BY b.emetteur ASC, b.rowid ASC;";
         dol_syslog("RemiseCheque::generatePdf sql=" . $sql, LOG_DEBUG);
         $result = $this->db->query($sql);
         if ($result) {
             $i = 0;
             while ($objp = $this->db->fetch_object($result)) {
                 $docmodel->lines[$i]->bank_chq = $objp->banque;
                 $docmodel->lines[$i]->emetteur_chq = $objp->emetteur;
                 $docmodel->lines[$i]->amount_chq = $objp->amount;
                 $docmodel->lines[$i]->num_chq = $objp->num_chq;
                 $i++;
             }
         }
         $docmodel->nbcheque = $this->nbcheque;
         $docmodel->number = $this->number;
         $docmodel->amount = $this->amount;
         $docmodel->date = $this->date_bordereau;
         $account = new Account($this->db);
         $account->fetch($this->account_id);
         $docmodel->account =& $account;
         // We save charset_output to restore it because write_file can change it if needed for
         // output format that does not support UTF8.
         $sav_charset_output = $outputlangs->charset_output;
         $result = $docmodel->write_file($conf->banque->dir_output . '/bordereau', $this->number, $outputlangs);
         if ($result > 0) {
             $outputlangs->charset_output = $sav_charset_output;
             return 1;
         } else {
             $outputlangs->charset_output = $sav_charset_output;
             dol_syslog("Error");
             dol_print_error($db, $docmodel->error);
             return 0;
         }
     } else {
         $this->error = $langs->trans("ErrorFileDoesNotExists", $dir . $file);
         return -1;
     }
 }
开发者ID:netors,项目名称:dolibarr,代码行数:67,代码来源:remisecheque.class.php

示例13: Form

 * View
 */

$form=new Form($db);

llxHeader();

$societestatic=new Societe($db);
$chargestatic=new ChargeSociales($db);
$memberstatic=new Adherent($db);
$paymentstatic=new Paiement($db);
$paymentsupplierstatic=new PaiementFourn($db);
$paymentvatstatic=new TVA($db);

$acct = new Account($db);
$acct->fetch($_GET["account"]);

$now=dol_now();

$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type as type";
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
$sql.= " WHERE rappro=0 AND fk_account=".$_GET["account"];
$sql.= " ORDER BY dateo ASC";
$sql.= " LIMIT 1000";	// Limit to avoid page overload

$resql = $db->query($sql);
if ($resql)
{
    $var=True;
    $num = $db->num_rows($resql);
开发者ID:remyyounes,项目名称:dolibarr,代码行数:30,代码来源:rappro.php

示例14: Account

print '<tr class="liste_titre">';
print '<td width="30%">' . $langs->trans("SavingAccounts") . '</td>';
print '<td width="20%">' . $langs->trans("Bank") . '</td>';
print '<td align="left">' . $langs->trans("Numero") . '</td>';
print '<td align="center" width="100">' . $langs->trans("TransactionsToConciliate") . '</td>';
print '<td align="center" width="70">' . $langs->trans("Status") . '</td>';
print '<td align="right" width="100">' . $langs->trans("BankBalance") . '</td>';
print "</tr>\n";
$total = 0;
$found = 0;
$var = true;
foreach ($accounts as $key => $type) {
    if ($type == 0) {
        $found++;
        $acc = new Account($db);
        $acc->fetch($key);
        $var = !$var;
        $solde = $acc->solde(1);
        print "<tr " . $bc[$var] . ">";
        print '<td width="30%">' . $acc->getNomUrl(1) . '</td>';
        print '<td>' . $acc->bank . '</td>';
        print '<td>' . $acc->number . '</td>';
        print '<td align="center">';
        if ($acc->rappro) {
            $result = $acc->load_board($user, $acc->id);
            print $acc->nbtodo;
            if ($acc->nbtodolate) {
                print ' (' . $acc->nbtodolate . img_warning($langs->trans("Late")) . ')';
            }
        } else {
            print $langs->trans("FeatureDisabled");
开发者ID:nrjacker4,项目名称:crm-php,代码行数:31,代码来源:index.php

示例15: Account

dol_fiche_head($head, 'annual', $langs->trans("FinancialAccount"), 0, 'account');
$title = $langs->trans("FinancialAccount") . " : " . $acct->label;
$link = $year_start ? "<a href='" . $_SERVER["PHP_SELF"] . "?account=" . $acct->id . "&year_start=" . ($year_start - 1) . "'>" . img_previous() . "</a> " . $langs->trans("Year") . " <a href='" . $_SERVER["PHP_SELF"] . "?account=" . $acct->id . "&year_start=" . ($year_start + 1) . "'>" . img_next() . "</a>" : "";
print '<table class="border" width="100%">';
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/bank/index.php">' . $langs->trans("BackToList") . '</a>';
// Ref
print '<tr><td width="25%">' . $langs->trans("Ref") . '</td>';
print '<td colspan="3">';
if ($_GET["account"]) {
    if (!preg_match('/,/', $id)) {
        print $form->showrefnav($acct, 'ref', $linkback, 1, 'ref');
    } else {
        $bankaccount = new Account($db);
        $listid = explode(',', $id);
        foreach ($listid as $key => $aId) {
            $bankaccount->fetch($aId);
            $bankaccount->label = $bankaccount->ref;
            print $bankaccount->getNomUrl(1);
            if ($key < count($listid) - 1) {
                print ', ';
            }
        }
    }
} else {
    print $langs->trans("ALL");
}
print '</td></tr>';
// Label
print '<tr><td>' . $langs->trans("Label") . '</td>';
print '<td colspan="3">';
if (!empty($id)) {
开发者ID:Samara94,项目名称:dolibarr,代码行数:31,代码来源:annuel.php


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