Restore some broken features
This commit is contained in:
parent
31b7546cb8
commit
eee4350867
@ -193,7 +193,7 @@ switch ( $_GET['action'] )
|
||||
$invoiceline->total_ht=$tab_liste[$i]['total_ht'];
|
||||
$invoiceline->total_ttc=$tab_liste[$i]['total_ttc'];
|
||||
$invoiceline->total_tva=($tab_liste[$i]['total_ttc']-$tab_liste[$i]['total_ht']);
|
||||
$invoice->lignes[]=$invoiceline;
|
||||
$invoice->lines[]=$invoiceline;
|
||||
}
|
||||
|
||||
$invoice->socid=$conf_fksoc;
|
||||
|
||||
@ -694,8 +694,8 @@ if ($_POST['action'] == 'add' && $user->rights->facture->creer)
|
||||
// TODO mutualiser
|
||||
$lines = $srcobject->lignes;
|
||||
if (sizeof($lines)) $lines = $srcobject->lines;
|
||||
if (empty($lines) && method_exists($object,'fetch_lignes')) $lines = $srcobject->fetch_lignes();
|
||||
if (empty($lines) && method_exists($object,'fetch_lines')) $lines = $srcobject->fetch_lines();
|
||||
if (empty($lines) && method_exists($srcobject,'fetch_lignes')) $lines = $srcobject->fetch_lignes();
|
||||
if (empty($lines) && method_exists($srcobject,'fetch_lines')) $lines = $srcobject->fetch_lines();
|
||||
|
||||
for ($i = 0 ; $i < sizeof($lines) ; $i++)
|
||||
{
|
||||
@ -1371,7 +1371,7 @@ if ($_GET['action'] == 'create')
|
||||
{
|
||||
$projectid=$_GET['originid'];
|
||||
}
|
||||
else if (in_array($element,array('order','propal','contract')))
|
||||
else if (in_array($element,array('order','commande','propal','contrat','contract')))
|
||||
{
|
||||
// For compatibility
|
||||
if ($element == 'order') { $element = $subelement = 'commande'; }
|
||||
@ -1772,7 +1772,7 @@ if ($_GET['action'] == 'create')
|
||||
$sql.= ' p.label as product, p.ref, p.fk_product_type, p.rowid as prodid';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'propaldet as pt';
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON pt.fk_product = p.rowid';
|
||||
$sql.= ' WHERE pt.fk_propal = '.$object->id;
|
||||
$sql.= ' WHERE pt.fk_propal = '.$objectsrc->id;
|
||||
$sql.= ' ORDER BY pt.rang ASC, pt.rowid';
|
||||
}
|
||||
// TODO deplacer dans la classe
|
||||
@ -1786,7 +1786,7 @@ if ($_GET['action'] == 'create')
|
||||
$sql.= ' p.label as product, p.ref, p.fk_product_type, p.rowid as prodid';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'commandedet as pt';
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON pt.fk_product = p.rowid';
|
||||
$sql.= ' WHERE pt.fk_commande = '.$object->id;
|
||||
$sql.= ' WHERE pt.fk_commande = '.$objectsrc->id;
|
||||
$sql.= ' ORDER BY pt.rowid ASC';
|
||||
}
|
||||
// TODO deplacer dans la classe
|
||||
@ -1801,7 +1801,7 @@ if ($_GET['action'] == 'create')
|
||||
$sql.= ' p.label as product, p.ref, p.fk_product_type, p.rowid as prodid';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'contratdet as pt';
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON pt.fk_product = p.rowid';
|
||||
$sql.= ' WHERE pt.fk_contrat = '.$object->id;
|
||||
$sql.= ' WHERE pt.fk_contrat = '.$objectsrc->id;
|
||||
$sql.= ' ORDER BY pt.rowid ASC';
|
||||
}
|
||||
|
||||
|
||||
@ -269,59 +269,65 @@ class Facture extends CommonObject
|
||||
}
|
||||
|
||||
/*
|
||||
* Insert lines of invoices in database
|
||||
* Insert lines of invoices into database
|
||||
*/
|
||||
//dol_syslog("There is ".sizeof($this->lignes)." lines");
|
||||
/*
|
||||
foreach ($this->lines as $i => $val)
|
||||
if (sizeof($this->lines) && is_object($this->lines[0]))
|
||||
{
|
||||
$newinvoiceline=new FactureLigne($this->db);
|
||||
$newinvoiceline=$this->lines[$i];
|
||||
$newinvoiceline->fk_facture=$this->id;
|
||||
if ($result >= 0 && ($newinvoiceline->info_bits & 0x01) == 0) // We keep only lines with first bit = 0
|
||||
{
|
||||
$result=$newinvoiceline->insert();
|
||||
}
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
dol_syslog("There is ".sizeof($this->lines)." lines that are invoice lines objects");
|
||||
foreach ($this->lines as $i => $val)
|
||||
{
|
||||
$newinvoiceline=new FactureLigne($this->db);
|
||||
$newinvoiceline=$this->lines[$i];
|
||||
$newinvoiceline->fk_facture=$this->id;
|
||||
if ($result >= 0 && ($newinvoiceline->info_bits & 0x01) == 0) // We keep only lines with first bit = 0
|
||||
{
|
||||
$result=$newinvoiceline->insert();
|
||||
}
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error=$newinvoiceline->error;
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
for ($i = 0 ; $i < sizeof($this->lines) ; $i++)
|
||||
else
|
||||
{
|
||||
if (($this->lines[$i]->info_bits & 0x01) == 0) // We keep only lines with first bit = 0
|
||||
{
|
||||
$result = $this->addline(
|
||||
$this->id,
|
||||
$this->lines[$i]->desc,
|
||||
$this->lines[$i]->subprice,
|
||||
$this->lines[$i]->qty,
|
||||
$this->lines[$i]->tva_tx,
|
||||
$this->lines[$i]->localtax1_tx,
|
||||
$this->lines[$i]->localtax2_tx,
|
||||
$this->lines[$i]->fk_product,
|
||||
$this->lines[$i]->remise_percent,
|
||||
$this->lines[$i]->date_start,
|
||||
$this->lines[$i]->date_end,
|
||||
$this->lines[$i]->fk_code_ventilation,
|
||||
$this->lines[$i]->info_bits,
|
||||
$this->lines[$i]->fk_remise_except,
|
||||
'HT',
|
||||
0,
|
||||
$this->lines[$i]->product_type,
|
||||
$this->lines[$i]->rang,
|
||||
$this->lines[$i]->special_code
|
||||
);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error=$this->db->lasterror();
|
||||
dol_print_error($this->db);
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
dol_syslog("There is ".sizeof($this->lines)." lines that are array lines");
|
||||
for ($i = 0 ; $i < sizeof($this->lines) ; $i++)
|
||||
{
|
||||
if (($this->lines[$i]->info_bits & 0x01) == 0) // We keep only lines with first bit = 0
|
||||
{
|
||||
$result = $this->addline(
|
||||
$this->id,
|
||||
$this->lines[$i]->desc,
|
||||
$this->lines[$i]->subprice,
|
||||
$this->lines[$i]->qty,
|
||||
$this->lines[$i]->tva_tx,
|
||||
$this->lines[$i]->localtax1_tx,
|
||||
$this->lines[$i]->localtax2_tx,
|
||||
$this->lines[$i]->fk_product,
|
||||
$this->lines[$i]->remise_percent,
|
||||
$this->lines[$i]->date_start,
|
||||
$this->lines[$i]->date_end,
|
||||
$this->lines[$i]->fk_code_ventilation,
|
||||
$this->lines[$i]->info_bits,
|
||||
$this->lines[$i]->fk_remise_except,
|
||||
'HT',
|
||||
0,
|
||||
$this->lines[$i]->product_type,
|
||||
$this->lines[$i]->rang,
|
||||
$this->lines[$i]->special_code
|
||||
);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error=$this->db->lasterror();
|
||||
dol_print_error($this->db);
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@ -92,7 +92,7 @@ class DolibarrModules
|
||||
|
||||
// Insert activation triggers
|
||||
if (! $err) $err+=$this->insert_triggers();
|
||||
|
||||
|
||||
// Insert activation login method
|
||||
if (! $err) $err+=$this->insert_login_method();
|
||||
|
||||
@ -190,7 +190,7 @@ class DolibarrModules
|
||||
|
||||
// Remove activation of module's triggers (MAIN_MODULE_MYMODULE_TRIGGERS in llx_const)
|
||||
if (! $err) $err+=$this->delete_triggers();
|
||||
|
||||
|
||||
// Remove activation of module's authentification method (MAIN_MODULE_MYMODULE_LOGIN_METHOD in llx_const)
|
||||
if (! $err) $err+=$this->delete_login_method();
|
||||
|
||||
@ -1270,7 +1270,7 @@ class DolibarrModules
|
||||
|
||||
return $err;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Insert activation login method from modules in llx_const
|
||||
* \return int Number of errors (0 if ok)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user