Save pos_source with id of POS station
This commit is contained in:
parent
41f2289ffa
commit
35d5a495de
@ -474,7 +474,7 @@ class Facture extends CommonInvoice
|
|||||||
$sql.= ", ".($this->ref_int?"'".$this->db->escape($this->ref_int)."'":"null");
|
$sql.= ", ".($this->ref_int?"'".$this->db->escape($this->ref_int)."'":"null");
|
||||||
$sql.= ", ".($this->fk_account>0?$this->fk_account:'NULL');
|
$sql.= ", ".($this->fk_account>0?$this->fk_account:'NULL');
|
||||||
$sql.= ", ".($this->module_source ? "'".$this->db->escape($this->module_source)."'" : "null");
|
$sql.= ", ".($this->module_source ? "'".$this->db->escape($this->module_source)."'" : "null");
|
||||||
$sql.= ", ".($this->pos_source ? "'".$this->db->escape($this->pos_source)."'" : "null");
|
$sql.= ", ".($this->pos_source != '' ? "'".$this->db->escape($this->pos_source)."'" : "null");
|
||||||
$sql.= ", ".($this->fk_fac_rec_source?"'".$this->db->escape($this->fk_fac_rec_source)."'":"null");
|
$sql.= ", ".($this->fk_fac_rec_source?"'".$this->db->escape($this->fk_fac_rec_source)."'":"null");
|
||||||
$sql.= ", ".($this->fk_facture_source?"'".$this->db->escape($this->fk_facture_source)."'":"null");
|
$sql.= ", ".($this->fk_facture_source?"'".$this->db->escape($this->fk_facture_source)."'":"null");
|
||||||
$sql.= ", ".($user->id > 0 ? "'".$user->id."'":"null");
|
$sql.= ", ".($user->id > 0 ? "'".$user->id."'":"null");
|
||||||
|
|||||||
@ -77,16 +77,17 @@ if ($action == 'valid' && $user->rights->facture->creer){
|
|||||||
|
|
||||||
if (($action=="addline" || $action=="freezone") and $placeid==0)
|
if (($action=="addline" || $action=="freezone") and $placeid==0)
|
||||||
{
|
{
|
||||||
|
// $place is id of POS, $placeid is id of invoice
|
||||||
if ($placeid==0) {
|
if ($placeid==0) {
|
||||||
$invoice = new Facture($db);
|
$invoice = new Facture($db);
|
||||||
$invoice->socid=$conf->global->CASHDESK_ID_THIRDPARTY;
|
$invoice->socid=$conf->global->CASHDESK_ID_THIRDPARTY;
|
||||||
$invoice->date=dol_now();
|
$invoice->date=dol_now();
|
||||||
$invoice->ref="(PROV-POS)";
|
$invoice->ref="(PROV-POS)";
|
||||||
$invoice->module_source = 'takepos';
|
$invoice->module_source = 'takepos';
|
||||||
$invoice->pos_source = (string) $place;
|
$invoice->pos_source = (string) (empty($place)?'0':$place);
|
||||||
|
|
||||||
$placeid=$invoice->create($user);
|
$placeid=$invoice->create($user);
|
||||||
$sql="UPDATE ".MAIN_DB_PREFIX."facture set facnumber='(PROV-POS-".$placeid.")' where rowid=".$placeid;
|
$sql="UPDATE ".MAIN_DB_PREFIX."facture set facnumber='(PROV-POS-".$place.")' where rowid=".$placeid;
|
||||||
$db->query($sql);
|
$db->query($sql);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user