Change-Id: Ie16265e57fa29748fa6c8a1e15ac15ff70786d1d

This commit is contained in:
fhenry
2013-05-02 22:57:42 +02:00
parent 77956a5676
commit 0dbc73a6cc
6 changed files with 9 additions and 6 deletions

View File

@@ -767,7 +767,9 @@ else if ($action == "addline" && $user->rights->propal->creer)
// Margin
$fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):'');
dol_syslog('ssdfsd:: $fournprice:'.var_export($fournprice,true));
$buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):'');
dol_syslog('ssdfsd:: $$buyingprice='.$buyingprice);
$date_start=dol_mktime(0, 0, 0, GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year'));
$date_end=dol_mktime(0, 0, 0, GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year'));

View File

@@ -407,6 +407,7 @@ class Propal extends CommonObject
$this->line->date_start=$date_start;
$this->line->date_end=$date_end;
// infos marge
$this->line->fk_fournprice = $fk_fournprice;
$this->line->pa_ht = $pa_ht;
@@ -2817,7 +2818,7 @@ class PropaleLigne
$sql.= " ".price2num($this->tva_tx).",";
$sql.= " ".price2num($this->localtax1_tx).",";
$sql.= " ".price2num($this->localtax2_tx).",";
$sql.= " ".($this->subprice?price2num($this->subprice):'null').",";
$sql.= " ".($this->subprice?price2num($this->subprice):"null").",";
$sql.= " ".price2num($this->remise_percent).",";
$sql.= " ".(isset($this->info_bits)?"'".$this->info_bits."'":"null").",";
$sql.= " ".price2num($this->total_ht).",";

View File

@@ -239,7 +239,7 @@ if ($action == 'create')
// Ref
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Ref").'</td>';
print '<td colspan="3"><input size="8" type="text" class="flat" name="ref" value="'.($_POST["ref"]?$_POST["ref"]:$account->ref).'"></td></tr>';
print '<td colspan="3"><input size="8" type="text" class="flat" name="ref" value="'.($_POST["ref"]?$_POST["ref"]:$account->ref).'" maxlength="12"></td></tr>';
// Label
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("LabelBankCashAccount").'</td>';

View File

@@ -186,7 +186,7 @@ if (! empty($usemargins))
}
options += '>'+this.label+'</option>';
});
options += '<option value=null><?php echo $langs->trans("InputPrice"); ?></option>';
options += '<option value=""><?php echo $langs->trans("InputPrice"); ?></option>';
$("#buying_price").hide();
$("#fournprice").html(options).show();
$("#fournprice").change(function() {

View File

@@ -182,11 +182,11 @@ if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPr
if ($id > 0)
$sql.= " GROUP BY f.rowid";
else
$sql.= " GROUP BY d.fk_product";
$sql.= " GROUP BY d.fk_product, p.label, p.rowid, p.fk_product_type, p.ref, f.facnumber, f.total, f.datef, f.paye, f.fk_statut, f.rowid";
$sql.= " ORDER BY $sortfield $sortorder ";
// TODO: calculate total to display then restore pagination
//$sql.= $db->plimit($conf->liste_limit +1, $offset);
dol_syslog('margin::productMargin.php sql='.$sql,LOG_DEBUG);
$result = $db->query($sql);
if ($result)
{

View File

@@ -144,7 +144,7 @@ if ($socid > 0)
$sql .= " AND d.buy_price_ht IS NOT NULL";
if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)
$sql .= " AND d.buy_price_ht <> 0";
$sql.= " GROUP BY f.rowid";
$sql.= " GROUP BY f.rowid, s.nom, s.rowid, s.code_client, f.facnumber, f.total, f.datef, f.paye, f.fk_statut";
$sql.= " ORDER BY $sortfield $sortorder ";
// TODO: calculate total to display then restore pagination
//$sql.= $db->plimit($conf->liste_limit +1, $offset);