本文整理汇总了PHP中Paiement::fetch方法的典型用法代码示例。如果您正苦于以下问题:PHP Paiement::fetch方法的具体用法?PHP Paiement::fetch怎么用?PHP Paiement::fetch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Paiement
的用法示例。
在下文中一共展示了Paiement::fetch方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
// Libelle
$reg = array();
preg_match('/\\((.+)\\)/i', $objp->label, $reg);
// Si texte entoure de parenthese on tente recherche de traduction
if ($reg[1] && $langs->transnoentitiesnoconv($reg[1]) != $reg[1]) {
$description = $langs->transnoentitiesnoconv($reg[1]);
} else {
$description = $objp->label;
}
/*
* Ajout les liens (societe, company...)
*/
$links = $acct->get_url($objp->rowid);
foreach ($links as $key => $val) {
if ($links[$key]['type'] == 'payment') {
$paymentstatic->fetch($links[$key]['url_id']);
$tmparray = $paymentstatic->getBillsArray('');
foreach ($tmparray as $key => $val) {
$invoicestatic->fetch($val);
if ($accountelem) {
$accountelem .= ', ';
}
$accountelem .= $invoicestatic->ref;
}
} elseif ($links[$key]['type'] == 'payment_supplier') {
$paymentsupplierstatic->fetch($links[$key]['url_id']);
$tmparray = $paymentsupplierstatic->getBillsArray('');
foreach ($tmparray as $key => $val) {
$invoicesupplierstatic->fetch($val);
if ($accountelem) {
$accountelem .= ', ';
示例2: GETPOST
// Security check
$id = GETPOST('id', 'int');
$action = GETPOST('action', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
if ($user->societe_id) {
$socid = $user->societe_id;
}
// TODO ajouter regle pour restreindre acces paiement
//$result = restrictedArea($user, 'facture', $id,'');
$object = new Paiement($db);
/*
* Actions
*/
if ($action == 'setnote' && $user->rights->facture->paiement) {
$db->begin();
$object->fetch($id);
$result = $object->update_note(GETPOST('note'));
if ($result > 0) {
$db->commit();
$action = '';
} else {
setEventMessage($object->error, 'errors');
$db->rollback();
}
}
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->facture->paiement) {
$db->begin();
$object->fetch($id);
$result = $object->delete();
if ($result > 0) {
$db->commit();
示例3: GETPOST
* \file htdocs/compta/paiement/info.php
* \ingroup facture
* \brief Onglet info d'un paiement
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/payments.lib.php';
$langs->load("bills");
$langs->load("companies");
$id = GETPOST('id');
/*
* View
*/
llxHeader();
$paiement = new Paiement($db);
$paiement->fetch($id);
$paiement->info($id);
$head = payment_prepare_head($paiement);
dol_fiche_head($head, 'info', $langs->trans("PaymentCustomerInvoice"), 0, 'payment');
print '<table class="border" width="100%">';
// Ref
print '<tr><td valign="top" width="140">' . $langs->trans('Ref') . '</td><td colspan="3">' . $paiement->id . '</td></tr>';
print '</table>';
print '<br>';
print '<table width="100%"><tr><td>';
dol_print_object_info($paiement);
print '</td></tr></table>';
print '</div>';
$db->close();
llxFooter();
示例4: Paiement
$object->set_unpaid('admin');
$sql = 'SELECT p.datep as dp, p.num_paiement, p.rowid, p.fk_bank,';
$sql .= ' c.code as payment_code, c.libelle as payment_label,';
$sql .= ' pf.amount,';
$sql .= ' ba.rowid as baid, ba.ref, ba.label';
$sql .= ' FROM ' . MAIN_DB_PREFIX . 'c_paiement as c, ' . MAIN_DB_PREFIX . 'paiement_facture as pf, ' . MAIN_DB_PREFIX . 'paiement as p';
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bank as b ON p.fk_bank = b.rowid';
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bank_account as ba ON b.fk_account = ba.rowid';
$sql .= ' WHERE pf.fk_facture = ' . $id . ' AND p.fk_paiement = c.id AND pf.fk_paiement = p.rowid';
$sql .= ' ORDER BY p.datep, p.tms';
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
$objp = $db->fetch_object($result);
$paiement = new Paiement($db);
$paiement->fetch($objp->rowid);
$paiement->delete();
}
if ($conf->stock->enabled) {
$object->delete(0, 0, $conf->global->POS_DEFAULT_WAREHOUSE);
} else {
$object->delete();
}
$sql = 'delete from ' . MAIN_DB_PREFIX . 'pos_facture where fk_facture=' . $id;
$db->query($sql);
}
//Get records from database
$sql = "SELECT rowid as iddet, facnumber, datec, fk_user_author as user, total_ttc as price FROM " . MAIN_DB_PREFIX . "facture order by rowid DESC limit 50";
$resql = $db->query($sql);
//Add all records to an array
$rows = array();
示例5: Paiement
/**
* \file htdocs/compta/paiement/info.php
* \ingroup facture
* \brief Onglet info d'un paiement
*/
require "../../main.inc.php";
require_once DOL_DOCUMENT_ROOT . "/core/lib/functions2.lib.php";
require_once DOL_DOCUMENT_ROOT . "/compta/paiement/class/paiement.class.php";
$langs->load("bills");
$langs->load("companies");
/*
* View
*/
llxHeader();
$paiement = new Paiement($db);
$paiement->fetch($_GET["id"], $user);
$paiement->info($_GET["id"]);
$h = 0;
$head[$h][0] = DOL_URL_ROOT . '/compta/paiement/fiche.php?id=' . $_GET["id"];
$head[$h][1] = $langs->trans("Card");
$h++;
$head[$h][0] = DOL_URL_ROOT . '/compta/paiement/info.php?id=' . $_GET["id"];
$head[$h][1] = $langs->trans("Info");
$hselected = $h;
$h++;
dol_fiche_head($head, $hselected, $langs->trans("PaymentCustomerInvoice"), 0, 'payment');
print '<table class="border" width="100%">';
// Ref
print '<tr><td valign="top" width="140">' . $langs->trans('Ref') . '</td><td colspan="3">' . $paiement->id . '</td></tr>';
print '</table>';
print '<br>';
示例6: rejectCheck
/**
* Check return management
* Reopen linked invoices and create a new negative payment.
*
* @param int $bank_id Id of bank transaction line concerned
* @param date $rejection_date Date to use on the negative payment
* @return int Id of negative payment line created
*/
function rejectCheck($bank_id, $rejection_date)
{
global $db, $user;
$payment = new Paiement($db);
$payment->fetch(0, 0, $bank_id);
$bankline = new AccountLine($db);
$bankline->fetch($bank_id);
/* Conciliation is allowed because when check is returned, a new line is created onto bank transaction log.
if ($bankline->rappro)
{
$this->error='ActionRefusedLineAlreadyConciliated';
return -1;
}*/
$this->db->begin();
// Not conciliated, we can delete it
//$bankline->delete($user); // We delete
$bankaccount = $payment->fk_account;
// Get invoices list to reopen them
$sql = 'SELECT pf.fk_facture, pf.amount';
$sql .= ' FROM ' . MAIN_DB_PREFIX . 'paiement_facture as pf';
$sql .= ' WHERE pf.fk_paiement = ' . $payment->id;
$resql = $db->query($sql);
if ($resql) {
$rejectedPayment = new Paiement($db);
$rejectedPayment->amounts = array();
$rejectedPayment->datepaye = $rejection_date;
$rejectedPayment->paiementid = dol_getIdFromCode($this->db, 'CHQ', 'c_paiement');
$rejectedPayment->num_paiement = $payment->numero;
while ($obj = $db->fetch_object($resql)) {
$invoice = new Facture($db);
$invoice->fetch($obj->fk_facture);
$invoice->set_unpaid($user);
$rejectedPayment->amounts[$obj->fk_facture] = price2num($obj->amount) * -1;
}
$result = $rejectedPayment->create($user);
if ($result > 0) {
// We created a negative payment, we also add the line as bank transaction
$result = $rejectedPayment->addPaymentToBank($user, 'payment', '(CheckRejected)', $bankaccount, '', '');
if ($result > 0) {
$result = $payment->reject();
if ($result > 0) {
$this->db->commit();
return $rejectedPayment->id;
} else {
$this->db->rollback();
return -1;
}
} else {
$this->error = $rejectedPayment->error;
$this->errors = $rejectedPayment->errors;
$this->db->rollback();
return -1;
}
} else {
$this->error = $rejectedPayment->error;
$this->errors = $rejectedPayment->errors;
$this->db->rollback();
return -1;
}
} else {
$this->error = $this->db->lasterror();
$this->db->rollback();
return -1;
}
}
示例7: Societe
$mesg='<div class="error">'.$langs->trans($paiement->error).'</div>';
$db->rollback();
}
}
/*
* View
*/
llxHeader();
$thirdpartystatic=new Societe($db);
$paiement = new Paiement($db);
$result=$paiement->fetch($id);
if ($result <= 0)
{
dol_print_error($db,'Payement '.$id.' not found in database');
exit;
}
$html = new Form($db);
$h=0;
$head[$h][0] = DOL_URL_ROOT.'/compta/paiement/fiche.php?id='.$id;
$head[$h][1] = $langs->trans("Card");
$hselected = $h;
$h++;