本文整理匯總了PHP中Facture::setStatut方法的典型用法代碼示例。如果您正苦於以下問題:PHP Facture::setStatut方法的具體用法?PHP Facture::setStatut怎麽用?PHP Facture::setStatut使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Facture
的用法示例。
在下文中一共展示了Facture::setStatut方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Facture
//.........這裏部分代碼省略.........
// Local tax 2
$factline->subprice = $this->lines[$i]->subprice;
// P.U. HT (example 100)
$factline->remise_percent = $this->lines[$i]->remise_percent;
// % de la remise ligne (example 20%)
$factline->fk_remise_except = $this->lines[$i]->fk_remise_except;
// Link to line into llx_remise_except
$factline->rang = $this->lines[$i]->rang;
$factline->info_bits = $this->lines[$i]->info_bits;
// Liste d'options cumulables:
// Bit 0: 0 si TVA normal - 1 si TVA NPR
// Bit 1: 0 si ligne normal - 1 si bit discount (link to line into llx_remise_except)
$factline->special_code = $this->lines[$i]->special_code;
// Liste d'options non cumulabels:
// 1: frais de port
// 2: ecotaxe
// 3: ??
$factline->origin = $this->lines[$i]->origin;
$factline->origin_id = $this->lines[$i]->origin_id;
//! Total HT de la ligne toute quantite et incluant la remise ligne
$factline->total_ht = $this->lines[$i]->total_ht;
//! Total TVA de la ligne toute quantite et incluant la remise ligne
$factline->total_tva = $this->lines[$i]->total_tva;
$factline->total_localtax1 = $this->lines[$i]->total_localtax1;
//Total Local tax 1 de la ligne
$factline->total_localtax2 = $this->lines[$i]->total_localtax2;
//Total Local tax 2 de la ligne
//! Total TTC de la ligne toute quantite et incluant la remise ligne
$factline->total_ttc = $this->lines[$i]->total_ttc;
$factline->fk_code_ventilation = $this->lines[$i]->fk_code_ventilation;
$factline->fk_export_compta = $this->lines[$i]->fk_export_compta;
$factline->date_start = $this->lines[$i]->date_start;
$factline->date_end = $this->lines[$i]->date_end;
// From llx_product
$factline->ref = $this->lines[$i]->ref;
// Product ref (deprecated)
$factline->product_ref = $this->lines[$i]->product_ref;
// Product ref
$factline->libelle = $this->lines[$i]->libelle;
// Product label (deprecated)
$factline->product_label = $this->lines[$i]->product_label;
// Product label
$factline->product_desc = $this->lines[$i]->product_desc;
// Description produit
$factline->skip_update_total = $this->lines[$i]->skip_update_total;
// Skip update price total for special lines
$facture->lines[$i] = $factline;
}
$facture->create($user);
if ($facture->statut == 1 || $facture->type == 1) {
$facture->validate($user);
if ($this->diff_payment <= 0) {
$facture->set_paid($user);
}
if ($this->diff_payment > 0) {
$facture->setStatut(1);
}
}
$sql = 'UPDATE ' . MAIN_DB_PREFIX . "pos_ticket SET fk_facture='" . $facture->id . "' WHERE rowid=" . $this->id;
dol_syslog("Ticket::update sql=" . $sql);
$resql = $this->db->query($sql);
if (!$resql) {
$this->db->rollback();
return -1;
} else {
$this->db->commit();
$sql = 'INSERT INTO ' . MAIN_DB_PREFIX . 'pos_facture (fk_cash, fk_place,fk_facture) VALUES (' . $this->fk_cash . ',' . ($this->fk_place ? $this->fk_place : 'null') . ',' . $facture->id . ')';
dol_syslog("pos_facture::update sql=" . $sql);
$resql = $this->db->query($sql);
if (!$resql) {
$this->db->rollback();
return -1;
} else {
$this->db->commit();
}
$sql = 'SELECT fk_paiement, amount FROM ' . MAIN_DB_PREFIX . "pos_paiement_ticket WHERE fk_ticket=" . $this->id;
$resql = $this->db->query($sql);
if ($resql) {
$num = $db->num_rows($resql);
$i = 0;
$totalpaye = 0;
while ($i < $num) {
$objp = $db->fetch_object($resql);
$paye[$i]['fk_paiement'] = $objp->fk_paiement;
$paye[$i]['amount'] = $objp->amount;
$i++;
}
$i = 0;
while ($i < $num) {
$sql = 'INSERT INTO ' . MAIN_DB_PREFIX . 'paiement_facture (fk_paiement, fk_facture, amount) VALUES (' . $paye[$i]['fk_paiement'] . ',' . $facture->id . ',' . $paye[$i]['amount'] . ')';
$resql = $this->db->query($sql);
$i++;
}
} else {
return -1;
}
$facture->add_object_linked('ticket', $this->id);
return $facture->id;
}
}