Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
This commit is contained in:
commit
36ae81c749
@ -693,6 +693,9 @@ if (empty($reshook))
|
||||
$amount_ht[$line->tva_tx] += $line->total_ht;
|
||||
$amount_tva[$line->tva_tx] += $line->total_tva;
|
||||
$amount_ttc[$line->tva_tx] += $line->total_ttc;
|
||||
$multicurrency_amount_ht[$line->tva_tx] += $line->multicurrency_total_ht;
|
||||
$multicurrency_amount_tva[$line->tva_tx] += $line->multicurrency_total_tva;
|
||||
$multicurrency_amount_ttc[$line->tva_tx] += $line->multicurrency_total_ttc;
|
||||
$i ++;
|
||||
}
|
||||
}
|
||||
@ -748,6 +751,9 @@ if (empty($reshook))
|
||||
$discount->amount_ht = abs($amount_ht[$tva_tx]);
|
||||
$discount->amount_tva = abs($amount_tva[$tva_tx]);
|
||||
$discount->amount_ttc = abs($amount_ttc[$tva_tx]);
|
||||
$discount->multicurrency_amount_ht = abs($multicurrency_amount_ht[$tva_tx]);
|
||||
$discount->multicurrency_amount_tva = abs($multicurrency_amount_tva[$tva_tx]);
|
||||
$discount->multicurrency_amount_ttc = abs($multicurrency_amount_ttc[$tva_tx]);
|
||||
$discount->tva_tx = abs($tva_tx);
|
||||
|
||||
$result = $discount->create($user);
|
||||
|
||||
@ -1700,9 +1700,9 @@ class Facture extends CommonInvoice
|
||||
$facligne->total_ttc = -$remise->amount_ttc;
|
||||
|
||||
$facligne->multicurrency_subprice = -$remise->multicurrency_subprice;
|
||||
$facligne->multicurrency_total_ht = -$remise->multicurrency_total_ht;
|
||||
$facligne->multicurrency_total_tva = -$remise->multicurrency_total_tva;
|
||||
$facligne->multicurrency_total_ttc = -$remise->multicurrency_total_ttc;
|
||||
$facligne->multicurrency_total_ht = -$remise->multicurrency_amount_ht;
|
||||
$facligne->multicurrency_total_tva = -$remise->multicurrency_amount_tva;
|
||||
$facligne->multicurrency_total_ttc = -$remise->multicurrency_amount_ttc;
|
||||
|
||||
$lineid=$facligne->insert();
|
||||
if ($lineid > 0)
|
||||
|
||||
@ -4459,6 +4459,7 @@ abstract class CommonObject
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$this->array_options = array();
|
||||
$numrows=$this->db->num_rows($resql);
|
||||
if ($numrows)
|
||||
{
|
||||
|
||||
@ -103,7 +103,7 @@ class DiscountAbsolute
|
||||
$this->amount_tva = $obj->amount_tva;
|
||||
$this->amount_ttc = $obj->amount_ttc;
|
||||
|
||||
$this->multicurrency_amount_ht = $obj->multicurrency_amount_ht;
|
||||
$this->multicurrency_amount_ht = $this->multicurrency_subprice = $obj->multicurrency_amount_ht;
|
||||
$this->multicurrency_amount_tva = $obj->multicurrency_amount_tva;
|
||||
$this->multicurrency_amount_ttc = $obj->multicurrency_amount_ttc;
|
||||
|
||||
@ -161,10 +161,12 @@ class DiscountAbsolute
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_remise_except";
|
||||
$sql.= " (entity, datec, fk_soc, fk_user, description,";
|
||||
$sql.= " amount_ht, amount_tva, amount_ttc, tva_tx,";
|
||||
$sql.= " multicurrency_amount_ht, multicurrency_amount_tva, multicurrency_amount_ttc,";
|
||||
$sql.= " fk_facture_source";
|
||||
$sql.= ")";
|
||||
$sql.= " VALUES (".$conf->entity.", '".$this->db->idate($this->datec!=''?$this->datec:dol_now())."', ".$this->fk_soc.", ".$user->id.", '".$this->db->escape($this->description)."',";
|
||||
$sql.= " ".$this->amount_ht.", ".$this->amount_tva.", ".$this->amount_ttc.", ".$this->tva_tx.",";
|
||||
$sql.= " ".$this->multicurrency_amount_ht.", ".$this->multicurrency_amount_tva.", ".$this->multicurrency_amount_ttc.", ";
|
||||
$sql.= " ".($this->fk_facture_source ? "'".$this->db->escape($this->fk_facture_source)."'":"null");
|
||||
$sql.= ")";
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -136,7 +137,7 @@ function getOnlinePaymentUrl($mode, $type, $ref='', $amount='9.99', $freetag='yo
|
||||
else $out.='&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2);
|
||||
}
|
||||
}
|
||||
if ($type == 'order')
|
||||
elseif ($type == 'order')
|
||||
{
|
||||
$out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=order&ref='.($mode?'<font color="#666666">':'');
|
||||
if ($mode == 1) $out.='order_ref';
|
||||
@ -154,7 +155,7 @@ function getOnlinePaymentUrl($mode, $type, $ref='', $amount='9.99', $freetag='yo
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($type == 'invoice')
|
||||
elseif ($type == 'invoice')
|
||||
{
|
||||
$out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=invoice&ref='.($mode?'<font color="#666666">':'');
|
||||
if ($mode == 1) $out.='invoice_ref';
|
||||
@ -172,7 +173,7 @@ function getOnlinePaymentUrl($mode, $type, $ref='', $amount='9.99', $freetag='yo
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($type == 'contractline')
|
||||
elseif ($type == 'contractline')
|
||||
{
|
||||
$out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=contractline&ref='.($mode?'<font color="#666666">':'');
|
||||
if ($mode == 1) $out.='contractline_ref';
|
||||
@ -190,7 +191,7 @@ function getOnlinePaymentUrl($mode, $type, $ref='', $amount='9.99', $freetag='yo
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($type == 'membersubscription')
|
||||
elseif ($type == 'membersubscription')
|
||||
{
|
||||
$out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=membersubscription&ref='.($mode?'<font color="#666666">':'');
|
||||
if ($mode == 1) $out.='member_ref';
|
||||
@ -289,14 +290,14 @@ function htmlPrintOnlinePaymentFooter($fromcompany,$langs,$addformmessage=0,$suf
|
||||
|
||||
$parammessageform='ONLINE_PAYMENT_MESSAGE_FORM_'.$suffix;
|
||||
if (! empty($conf->global->$parammessageform)) print $langs->transnoentities($conf->global->$parammessageform);
|
||||
else if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_FORM)) print $langs->transnoentities($conf->global->ONLINE_PAYMENT_MESSAGE_FORM);
|
||||
elseif (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_FORM)) print $langs->transnoentities($conf->global->ONLINE_PAYMENT_MESSAGE_FORM);
|
||||
|
||||
// Add other message if VAT exists
|
||||
if ($object->total_vat != 0 || $object->total_tva != 0)
|
||||
{
|
||||
$parammessageform='ONLINE_PAYMENT_MESSAGE_FORMIFVAT_'.$suffix;
|
||||
if (! empty($conf->global->$parammessageform)) print $langs->transnoentities($conf->global->$parammessageform);
|
||||
else if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_FORMIFVAT)) print $langs->transnoentities($conf->global->ONLINE_PAYMENT_MESSAGE_FORMIFVAT);
|
||||
elseif (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_FORMIFVAT)) print $langs->transnoentities($conf->global->ONLINE_PAYMENT_MESSAGE_FORMIFVAT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -273,7 +273,7 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||
*/
|
||||
$max=15;
|
||||
$sql = "SELECT p.rowid, p.label, p.price, p.ref, p.fk_product_type, p.tosell, p.tobuy, p.fk_price_expression,";
|
||||
$sql.= " p.entity,";
|
||||
$sql.= " p.entity, p.tobatch,";
|
||||
$sql.= " p.tms as datem";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||
$sql.= " WHERE p.entity IN (".getEntity($product_static->element, 1).")";
|
||||
@ -337,6 +337,7 @@ if ($result)
|
||||
$product_static->label = $objp->label;
|
||||
$product_static->type=$objp->fk_product_type;
|
||||
$product_static->entity = $objp->entity;
|
||||
$product_static->status_batch = $objp->tobatch;
|
||||
print $product_static->getNomUrl(1,'',16);
|
||||
print "</td>\n";
|
||||
print '<td>'.dol_trunc($objp->label,32).'</td>';
|
||||
|
||||
@ -700,6 +700,7 @@ else
|
||||
$product_static->status = $obj->tosell;
|
||||
$product_static->entity = $obj->entity;
|
||||
$product_static->pmp = $obj->pmp;
|
||||
$product_static->status_batch = $obj->tobatch;
|
||||
|
||||
if ((! empty($conf->stock->enabled) && $user->rights->stock->lire && $search_type != 1) || ! empty($conf->global->STOCK_DISABLE_OPTIM_LOAD)) // To optimize call of load_stock
|
||||
{
|
||||
|
||||
@ -343,6 +343,7 @@ if ($resql)
|
||||
$product_static->label = $objp->label;
|
||||
$product_static->type=$objp->fk_product_type;
|
||||
$product_static->entity=$objp->entity;
|
||||
$product_static->status_batch=$objp->tobatch;
|
||||
|
||||
$product_lot_static->batch=$objp->batch;
|
||||
$product_lot_static->product_id=$objp->rowid;
|
||||
|
||||
@ -217,7 +217,8 @@ $sql.= " t.fk_user_modif,";
|
||||
$sql.= " t.import_key,";
|
||||
$sql.= " p.fk_product_type as product_type,";
|
||||
$sql.= " p.ref as product_ref,";
|
||||
$sql.= " p.label as product_label";
|
||||
$sql.= " p.label as product_label,";
|
||||
$sql.= " p.tobatch";
|
||||
// Add fields for extrafields
|
||||
foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key;
|
||||
// Add fields from hooks
|
||||
@ -431,6 +432,7 @@ if ($resql)
|
||||
$productstatic->type=$obj->product_type;
|
||||
$productstatic->ref=$obj->product_ref;
|
||||
$productstatic->label=$obj->product_label;
|
||||
$productstatic->status_batch = $obj->tobatch;
|
||||
print '<td>'.$productstatic->getNomUrl(1).'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
@ -609,6 +609,10 @@ foreach ($listofreferent as $key => $value)
|
||||
{
|
||||
if (! empty($element->close_code) && $element->close_code == 'replaced') $qualifiedfortotal=false; // Replacement invoice, do not include into total
|
||||
}
|
||||
if ($key == 'propal')
|
||||
{
|
||||
if ($element->statut == Propal::STATUS_NOTSIGNED) $qualifiedfortotal=false; // Refused proposal must not be included in total
|
||||
}
|
||||
|
||||
if ($qualifiedfortotal) $total_ht = $total_ht + $total_ht_by_line;
|
||||
|
||||
|
||||
@ -1680,9 +1680,9 @@ class Societe extends CommonObject
|
||||
|
||||
$discount = new DiscountAbsolute($this->db);
|
||||
$discount->fk_soc=$this->id;
|
||||
$discount->amount_ht=price2num($remise,'MT');
|
||||
$discount->amount_tva=price2num($remise*$tva_tx/100,'MT');
|
||||
$discount->amount_ttc=price2num($discount->amount_ht+$discount->amount_tva,'MT');
|
||||
$discount->amount_ht=$discount->multicurrency_amount_ht=price2num($remise,'MT');
|
||||
$discount->amount_tva=$discount->multicurrency_amount_tva=price2num($remise*$tva_tx/100,'MT');
|
||||
$discount->amount_ttc=$discount->multicurrency_amount_ttc=price2num($discount->amount_ht+$discount->amount_tva,'MT');
|
||||
$discount->tva_tx=price2num($tva_tx,'MT');
|
||||
$discount->description=$desc;
|
||||
$result=$discount->create($user);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user