本文整理匯總了PHP中Facture::getNextNumRef方法的典型用法代碼示例。如果您正苦於以下問題:PHP Facture::getNextNumRef方法的具體用法?PHP Facture::getNextNumRef怎麽用?PHP Facture::getNextNumRef使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Facture
的用法示例。
在下文中一共展示了Facture::getNextNumRef方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: unserialize
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
$obj_facturation = unserialize($_SESSION['serObjFacturation']);
unset($_SESSION['serObjFacturation']);
$action = GETPOST('action');
$bankaccountid = GETPOST('cashdeskbank');
switch ($action) {
default:
$redirection = DOL_URL_ROOT . '/cashdesk/affIndex.php?menu=validation';
break;
case 'valide_achat':
$company = new Societe($db);
$company->fetch($conf->global->CASHDESK_ID_THIRDPARTY);
$invoice = new Facture($db);
$invoice->date = dol_now();
$invoice->type = 0;
$num = $invoice->getNextNumRef($company);
$obj_facturation->numInvoice($num);
$obj_facturation->getSetPaymentMode($_POST['hdnChoix']);
// Si paiement autre qu'en especes, montant encaisse = prix total
$mode_reglement = $obj_facturation->getSetPaymentMode();
if ($mode_reglement != 'ESP') {
$montant = $obj_facturation->prixTotalTtc();
} else {
$montant = $_POST['txtEncaisse'];
}
if ($mode_reglement != 'DIF') {
$obj_facturation->montantEncaisse($montant);
//Determination de la somme rendue
$total = $obj_facturation->prixTotalTtc();
$encaisse = $obj_facturation->montantEncaisse();
$obj_facturation->montantRendu($encaisse - $total);
示例2: CreateFacture
/**
*
* Create facture into Database
*
* @param array $aryTicket Ticket object
*/
private function CreateFacture($aryTicket)
{
global $db, $user, $conf;
$function = "CreateFacture";
$idFacture = -1;
$data = $aryTicket['data'];
$lines = $data['lines'];
$idTicket = $data["id"];
if ($data['idsource'] > 0) {
$prods_returned = self::testSourceFac($aryTicket);
if (sizeof($prods_returned) > 0) {
return -6;
}
$vater = new Facture($db);
$vater->fetch($data['idsource']);
$data['payment_type'] = $vater->mode_reglement_id;
}
$cash = new Cash($db);
$terminal = $data['cashId'];
$cash->fetch($terminal);
if (!$data['customerId']) {
$socid = $cash->fk_soc;
$data['customerId'] = $socid;
} else {
$socid = $data['customerId'];
}
if (!$data['employeeId']) {
$employee = $_SESSION['uid'];
} else {
$employee = $data['employeeId'];
}
if ($data['mode'] == 1) {
$object = new Facturesim($db);
} else {
$object = new Facture($db);
}
$object->type = $data['type'] == 0 ? 0 : 2;
$object->socid = $socid;
$object->statut = $data['state'];
$object->fk_cash = $terminal;
$object->remise_percent = $data['discount_percent'];
$object->remise_absolue = $data['discount_qty'];
if ($data['customerpay1'] > 0) {
$object->mode_reglement_id = $cash->fk_modepaycash;
} else {
if ($data['customerpay2'] > 0) {
$object->mode_reglement_id = $cash->fk_modepaybank;
} else {
$object->mode_reglement_id = $cash->fk_modepaybank_extra;
}
}
$object->fk_place = $data['id_place'];
$object->note_private = $data['note'];
$object->customer_pay = $data['customerpay'];
if ($object->customer_pay > 0) {
$object->diff_payment = $data['difpayment'];
} else {
$object->diff_payment = $data['total'];
}
$object->fk_facture_source = $data['idsource'];
$employ = new User($db);
$employ->fetch($employee);
$employ->getrights();
$now = dol_now();
$object->date = $now;
$db->begin;
$idFacture = $object->create($employ);
if ($object->statut == 1 || $object->type == 2) {
$res = $object->validate($employ);
if ($res < 0) {
$soc = new Societe($db);
$soc->fetch($socid);
$num = $object->getNextNumRef($soc);
// Validate
$sql = 'UPDATE ' . MAIN_DB_PREFIX . 'facture';
$sql .= " SET facnumber='" . $num . "', fk_statut = 1, fk_user_valid = " . $employ->id . ", date_valid = '" . $db->idate($now) . "'";
if (!empty($conf->global->FAC_FORCE_DATE_VALIDATION)) {
$sql .= ', datef=' . $db->idate($now);
$sql .= ', date_lim_reglement=' . $db->idate($now);
}
$sql .= ' WHERE rowid = ' . $object->id;
dol_syslog(get_class($this) . "::validate sql=" . $sql);
$resql = $db->query($sql);
$object->ref = $num;
}
}
$sql = 'INSERT INTO ' . MAIN_DB_PREFIX . 'pos_facture (fk_cash, fk_place,fk_facture,customer_pay) VALUES (' . $object->fk_cash . ',' . ($object->fk_place ? $object->fk_place : 'null') . ',' . $idFacture . ',' . $object->customer_pay . ')';
dol_syslog("pos_facture::update sql=" . $sql);
$resql = $db->query($sql);
if (!$resql) {
$this->db->rollback();
return -1;
}
$data['ref'] = $object->ref;
//.........這裏部分代碼省略.........