Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/3.8' into 3.9
Browse files Browse the repository at this point in the history
Conflicts:
	htdocs/core/modules/askpricesupplier/doc/pdf_aurore.modules.php
	htdocs/core/modules/commande/doc/pdf_proforma.modules.php
  • Loading branch information
eldy committed Mar 18, 2016
2 parents dc78cc7 + b023aa3 commit 7fa7121
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 15 deletions.
2 changes: 2 additions & 0 deletions htdocs/comm/propal/class/propal.class.php
Expand Up @@ -2780,6 +2780,8 @@ function getNomUrl($withpicto=0,$option='', $get_params='')
*/
function getLinesArray()
{
// For other object, here we call fetch_lines. But fetch_lines does not exists on proposal

$sql = 'SELECT pt.rowid, pt.label as custom_label, pt.description, pt.fk_product, pt.fk_remise_except,';
$sql.= ' pt.qty, pt.tva_tx, pt.remise_percent, pt.subprice, pt.info_bits,';
$sql.= ' pt.total_ht, pt.total_tva, pt.total_ttc, pt.fk_product_fournisseur_price as fk_fournprice, pt.buy_price_ht as pa_ht, pt.special_code, pt.localtax1_tx, pt.localtax2_tx,';
Expand Down
12 changes: 7 additions & 5 deletions htdocs/commande/class/commande.class.php
Expand Up @@ -1674,7 +1674,7 @@ function fetch_lines($only_product=0)
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON (p.rowid = l.fk_product)';
$sql.= ' WHERE l.fk_commande = '.$this->id;
if ($only_product) $sql .= ' AND p.fk_product_type = 0';
$sql .= ' ORDER BY l.rang';
$sql .= ' ORDER BY l.rang, l.rowid';

dol_syslog(get_class($this)."::fetch_lines", LOG_DEBUG);
$result = $this->db->query($sql);
Expand Down Expand Up @@ -3212,12 +3212,14 @@ function load_state_board()
}

/**
* Return an array of order lines
*
* @return array Lines of order
* Create an array of order lines
*
* @return int >0 if OK, <0 if KO
*/
function getLinesArray()
{
return $this->fetch_lines();
/*
$lines = array();
$sql = 'SELECT l.rowid, l.fk_product, l.product_type, l.label as custom_label, l.description, l.price, l.qty, l.tva_tx, ';
Expand Down Expand Up @@ -3287,7 +3289,7 @@ function getLinesArray()
{
$this->error=$this->db->error();
return -1;
}
}*/
}

/**
Expand Down
17 changes: 12 additions & 5 deletions htdocs/compta/facture/class/facture.class.php
Expand Up @@ -1065,7 +1065,7 @@ function fetch_lines()
$this->lines=array();

$sql = 'SELECT l.rowid, l.fk_product, l.fk_parent_line, l.label as custom_label, l.description, l.product_type, l.price, l.qty, l.tva_tx, ';
$sql .= ' l.situation_percent, l.fk_prev_id,';
$sql.= ' l.situation_percent, l.fk_prev_id,';
$sql.= ' l.localtax1_tx, l.localtax2_tx, l.localtax1_type, l.localtax2_type, l.remise_percent, l.fk_remise_except, l.subprice,';
$sql.= ' l.rang, l.special_code,';
$sql.= ' l.date_start as date_start, l.date_end as date_end,';
Expand All @@ -1075,7 +1075,7 @@ function fetch_lines()
$sql.= ' FROM '.MAIN_DB_PREFIX.'facturedet as l';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid';
$sql.= ' WHERE l.fk_facture = '.$this->id;
$sql.= ' ORDER BY l.rang';
$sql.= ' ORDER BY l.rang, l.rowid';

dol_syslog(get_class($this).'::fetch_lines', LOG_DEBUG);
$result = $this->db->query($sql);
Expand Down Expand Up @@ -3441,6 +3441,8 @@ function load_state_board()
*/
function getLinesArray()
{
return $this->fetch_lines();
/*
$sql = 'SELECT l.rowid, l.label as custom_label, l.description, l.fk_product, l.product_type, l.qty, l.tva_tx,';
$sql.= ' l.fk_remise_except, l.localtax1_tx, l.localtax2_tx,';
$sql .= ' l.situation_percent, l.fk_prev_id,';
Expand Down Expand Up @@ -3473,11 +3475,12 @@ function getLinesArray()
$this->lines[$i]->description = $obj->description;
$this->lines[$i]->fk_product = $obj->fk_product;
$this->lines[$i]->ref = $obj->product_ref;
$this->lines[$i]->entity = $obj->entity; // Product entity
$this->lines[$i]->product_label = $obj->product_label;
$this->lines[$i]->product_ref = $obj->product_ref;
$this->lines[$i]->product_label = $obj->product_label;
$this->lines[$i]->product_desc = $obj->product_desc;
$this->lines[$i]->fk_product_type = $obj->fk_product_type;
$this->lines[$i]->product_type = $obj->product_type;
$this->lines[$i]->entity = $obj->entity; // Product entity
$this->lines[$i]->qty = $obj->qty;
$this->lines[$i]->subprice = $obj->subprice;
$this->lines[$i]->fk_remise_except = $obj->fk_remise_except;
Expand All @@ -3487,6 +3490,10 @@ function getLinesArray()
$this->lines[$i]->total_ht = $obj->total_ht;
$this->lines[$i]->total_tva = $obj->total_tva;
$this->lines[$i]->total_ttc = $obj->total_ttc;
$this->lines[$i]->localtax1_tx = $obj->localtax1_tx;
$this->lines[$i]->localtax2_tx = $obj->localtax2_tx;
$this->lines[$i]->localtax1_type = $obj->localtax1_type;
$this->lines[$i]->localtax2_type = $obj->localtax2_type;
$this->lines[$i]->fk_parent_line = $obj->fk_parent_line;
$this->lines[$i]->situation_percent = $obj->situation_percent;
$this->lines[$i]->fk_prev_id = $obj->fk_prev_id;
Expand All @@ -3511,7 +3518,7 @@ function getLinesArray()
{
$this->error=$this->db->error();
return -1;
}
}*/
}

/**
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/modules/commande/doc/pdf_einstein.modules.php
Expand Up @@ -911,7 +911,7 @@ function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
// VAT
foreach($this->tva as $tvakey => $tvaval)
{
if ($tvakey > 0) // On affiche pas taux 0
if ($tvakey != 0) // On affiche pas taux 0
{
$this->atleastoneratenotnull++;

Expand Down
1 change: 0 additions & 1 deletion htdocs/core/modules/commande/doc/pdf_proforma.modules.php
Expand Up @@ -57,7 +57,6 @@ function __construct($db)
}



/**
* Show top header of page.
*
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/modules/facture/doc/pdf_crabe.modules.php
Expand Up @@ -1109,7 +1109,7 @@ function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
// VAT
foreach($this->tva as $tvakey => $tvaval)
{
if ($tvakey > 0) // On affiche pas taux 0
if ($tvakey != 0) // On affiche pas taux 0
{
$this->atleastoneratenotnull++;

Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/modules/propale/doc/pdf_azur.modules.php
Expand Up @@ -1073,7 +1073,7 @@ function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
// VAT
foreach($this->tva as $tvakey => $tvaval)
{
if ($tvakey > 0) // On affiche pas taux 0
if ($tvakey != 0) // On affiche pas taux 0
{
$this->atleastoneratenotnull++;

Expand Down
3 changes: 2 additions & 1 deletion htdocs/product/ajax/products.php
Expand Up @@ -48,6 +48,7 @@
$action = GETPOST('action', 'alpha');
$id = GETPOST('id', 'int');
$price_by_qty_rowid = GETPOST('pbq', 'int');
$finished = GETPOST('finished', 'int');

/*
* View
Expand Down Expand Up @@ -180,7 +181,7 @@

$form = new Form($db);
if (empty($mode) || $mode == 1) {
$arrayresult = $form->select_produits_list("", $htmlname, $type, "", $price_level, $searchkey, $status, 2, $outjson, $socid);
$arrayresult = $form->select_produits_list("", $htmlname, $type, "", $price_level, $searchkey, $status, $finished, $outjson, $socid);
} elseif ($mode == 2) {
$arrayresult = $form->select_produits_fournisseurs_list($socid, "", $htmlname, $type, "", $searchkey, $status, $outjson, $socid);
}
Expand Down

0 comments on commit 7fa7121

Please sign in to comment.