Change-Id: Ie16265e57fa29748fa6c8a1e15ac15ff70786d1d
This commit is contained in:
parent
77956a5676
commit
0dbc73a6cc
@ -767,7 +767,9 @@ else if ($action == "addline" && $user->rights->propal->creer)
|
|||||||
|
|
||||||
// Margin
|
// Margin
|
||||||
$fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):'');
|
$fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):'');
|
||||||
|
dol_syslog('ssdfsd:: $fournprice:'.var_export($fournprice,true));
|
||||||
$buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):'');
|
$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_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'));
|
$date_end=dol_mktime(0, 0, 0, GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year'));
|
||||||
|
|||||||
@ -407,6 +407,7 @@ class Propal extends CommonObject
|
|||||||
$this->line->date_start=$date_start;
|
$this->line->date_start=$date_start;
|
||||||
$this->line->date_end=$date_end;
|
$this->line->date_end=$date_end;
|
||||||
|
|
||||||
|
|
||||||
// infos marge
|
// infos marge
|
||||||
$this->line->fk_fournprice = $fk_fournprice;
|
$this->line->fk_fournprice = $fk_fournprice;
|
||||||
$this->line->pa_ht = $pa_ht;
|
$this->line->pa_ht = $pa_ht;
|
||||||
@ -2817,7 +2818,7 @@ class PropaleLigne
|
|||||||
$sql.= " ".price2num($this->tva_tx).",";
|
$sql.= " ".price2num($this->tva_tx).",";
|
||||||
$sql.= " ".price2num($this->localtax1_tx).",";
|
$sql.= " ".price2num($this->localtax1_tx).",";
|
||||||
$sql.= " ".price2num($this->localtax2_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.= " ".price2num($this->remise_percent).",";
|
||||||
$sql.= " ".(isset($this->info_bits)?"'".$this->info_bits."'":"null").",";
|
$sql.= " ".(isset($this->info_bits)?"'".$this->info_bits."'":"null").",";
|
||||||
$sql.= " ".price2num($this->total_ht).",";
|
$sql.= " ".price2num($this->total_ht).",";
|
||||||
|
|||||||
@ -239,7 +239,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Ref").'</td>';
|
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
|
// Label
|
||||||
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("LabelBankCashAccount").'</td>';
|
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("LabelBankCashAccount").'</td>';
|
||||||
|
|||||||
@ -186,7 +186,7 @@ if (! empty($usemargins))
|
|||||||
}
|
}
|
||||||
options += '>'+this.label+'</option>';
|
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();
|
$("#buying_price").hide();
|
||||||
$("#fournprice").html(options).show();
|
$("#fournprice").html(options).show();
|
||||||
$("#fournprice").change(function() {
|
$("#fournprice").change(function() {
|
||||||
|
|||||||
@ -182,11 +182,11 @@ if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPr
|
|||||||
if ($id > 0)
|
if ($id > 0)
|
||||||
$sql.= " GROUP BY f.rowid";
|
$sql.= " GROUP BY f.rowid";
|
||||||
else
|
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 ";
|
$sql.= " ORDER BY $sortfield $sortorder ";
|
||||||
// TODO: calculate total to display then restore pagination
|
// TODO: calculate total to display then restore pagination
|
||||||
//$sql.= $db->plimit($conf->liste_limit +1, $offset);
|
//$sql.= $db->plimit($conf->liste_limit +1, $offset);
|
||||||
|
dol_syslog('margin::productMargin.php sql='.$sql,LOG_DEBUG);
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -144,7 +144,7 @@ if ($socid > 0)
|
|||||||
$sql .= " AND d.buy_price_ht IS NOT NULL";
|
$sql .= " AND d.buy_price_ht IS NOT NULL";
|
||||||
if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)
|
if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)
|
||||||
$sql .= " AND d.buy_price_ht <> 0";
|
$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 ";
|
$sql.= " ORDER BY $sortfield $sortorder ";
|
||||||
// TODO: calculate total to display then restore pagination
|
// TODO: calculate total to display then restore pagination
|
||||||
//$sql.= $db->plimit($conf->liste_limit +1, $offset);
|
//$sql.= $db->plimit($conf->liste_limit +1, $offset);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user