diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 831eb3f52ad..937db3e4cd9 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -504,7 +504,7 @@ else if ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $user->righ
{
$object->fetch($id);
$object->fetch_thirdparty();
- $object->fetch_lines();
+ //$object->fetch_lines(); // Already done into fetch
// Check if there is already a discount (protection to avoid duplicate creation when resubmit post)
$discountcheck=new DiscountAbsolute($db);
@@ -677,13 +677,14 @@ else if ($action == 'add' && $user->rights->facture->creer)
$id = $object->create($user);
- if(GETPOST('invoiceAvoirWithLines', 'int')==1 && $id>0) {
-
+ if (GETPOST('invoiceAvoirWithLines', 'int')==1 && $id>0)
+ {
$facture_source = new Facture($db); // fetch origin object
- if($facture_source->fetch($object->fk_facture_source)>0) {
-
- foreach($facture_source->lines as $line) {
+ if ($facture_source->fetch($object->fk_facture_source)>0)
+ {
+ foreach($facture_source->lines as $line)
+ {
$line->fk_facture = $object->id;
$line->subprice =-$line->subprice; // invert price for object
@@ -733,14 +734,16 @@ else if ($action == 'add' && $user->rights->facture->creer)
}
// Standard invoice or Deposit invoice created from a Predefined invoice
- if (($_POST['type'] == 0 || $_POST['type'] == 3) && $_POST['fac_rec'] > 0) {
+ if (($_POST['type'] == 0 || $_POST['type'] == 3) && $_POST['fac_rec'] > 0)
+ {
$datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
if (empty($datefacture)) {
$error ++;
setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), 'errors');
}
- if (! $error) {
+ if (! $error)
+ {
$object->socid = GETPOST('socid', 'int');
$object->type = $_POST['type'];
$object->number = $_POST['facnumber'];
@@ -759,8 +762,10 @@ else if ($action == 'add' && $user->rights->facture->creer)
}
// Standard or deposit or proforma invoice
- if (($_POST['type'] == 0 || $_POST['type'] == 3 || $_POST['type'] == 4) && $_POST['fac_rec'] <= 0) {
- if (GETPOST('socid', 'int') < 1) {
+ if (($_POST['type'] == 0 || $_POST['type'] == 3 || $_POST['type'] == 4) && $_POST['fac_rec'] <= 0)
+ {
+ if (GETPOST('socid', 'int') < 1)
+ {
$error ++;
setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), 'errors');
}
@@ -771,7 +776,8 @@ else if ($action == 'add' && $user->rights->facture->creer)
setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), 'errors');
}
- if (! $error) {
+ if (! $error)
+ {
// Si facture standard
$object->socid = GETPOST('socid', 'int');
$object->type = GETPOST('type');
@@ -2014,7 +2020,7 @@ if ($action == 'create')
// Standard invoice
print '
| ';
- print '';
+ print '';
print ' | ';
$desc = $form->textwithpicto($langs->trans("InvoiceStandardAsk"), $langs->transnoentities("InvoiceStandardDesc"), 1);
print $desc;
@@ -2101,10 +2107,18 @@ if ($action == 'create')
print ' disabled="disabled"';
print '>';
print ' | ';
+ // Show credit note options only if we checked credit note
print '';
@@ -2124,9 +2138,11 @@ if ($action == 'create')
$desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1);
print $desc;
+ print ' ';
print ' 0 ? 'checked="checked"':'').' /> ";
- print ' 0 ? 'checked="checked"':'').' /> ";
-
+ print ' 0 ? 'checked="checked"':'').' /> ";
+ print ' ';
+
print ' |
' . "\n";
}
else
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index babf0257d7c..d446e1ca826 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -866,7 +866,6 @@ class Facture extends CommonInvoice
$this->datem = $this->db->jdate($obj->datem);
$this->remise_percent = $obj->remise_percent;
$this->remise_absolue = $obj->remise_absolue;
- //$this->remise = $obj->remise;
$this->total_ht = $obj->total;
$this->total_tva = $obj->tva;
$this->total_localtax1 = $obj->localtax1;
@@ -947,7 +946,7 @@ class Facture extends CommonInvoice
$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.localtax1_tx, l.localtax2_tx, l.localtax1_type, l.localtax2_type, l.remise, l.remise_percent, l.fk_remise_except, l.subprice,';
+ $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,';
$sql.= ' l.info_bits, l.total_ht, l.total_tva, l.total_localtax1, l.total_localtax2, l.total_ttc, l.fk_code_ventilation, l.fk_product_fournisseur_price as fk_fournprice, l.buy_price_ht as pa_ht,';
@@ -1007,10 +1006,6 @@ class Facture extends CommonInvoice
$line->special_code = $objp->special_code;
$line->fk_parent_line = $objp->fk_parent_line;
- // Ne plus utiliser
- //$line->price = $objp->price;
- //$line->remise = $objp->remise;
-
$this->lines[$i] = $line;
$i++;
@@ -1069,7 +1064,6 @@ class Facture extends CommonInvoice
$sql.= " paye=".(isset($this->paye)?$this->paye:"null").",";
$sql.= " remise_percent=".(isset($this->remise_percent)?$this->remise_percent:"null").",";
$sql.= " remise_absolue=".(isset($this->remise_absolue)?$this->remise_absolue:"null").",";
- //$sql.= " remise=".(isset($this->remise)?$this->remise:"null").",";
$sql.= " close_code=".(isset($this->close_code)?"'".$this->db->escape($this->close_code)."'":"null").",";
$sql.= " close_note=".(isset($this->close_note)?"'".$this->db->escape($this->close_note)."'":"null").",";
$sql.= " tva=".(isset($this->total_tva)?$this->total_tva:"null").",";
@@ -2223,16 +2217,6 @@ class Facture extends CommonInvoice
$pu_tva = $tabprice[4];
$pu_ttc = $tabprice[5];
- // Old properties: $price, $remise (deprecated)
- $price = $pu;
- $remise = 0;
- if ($remise_percent > 0)
- {
- $remise = round(($pu * $remise_percent / 100),2);
- $price = ($pu - $remise);
- }
- $price = price2num($price);
-
// Update line into database
$this->line=new FactureLigne($this->db);
@@ -2276,10 +2260,6 @@ class Facture extends CommonInvoice
$this->line->fk_fournprice = $fk_fournprice;
$this->line->pa_ht = $pa_ht;
- // A ne plus utiliser
- //$this->line->price=$price;
- //$this->line->remise=$remise;
-
if (is_array($array_option) && count($array_option)>0) {
$this->line->array_options=$array_option;
}
@@ -2391,7 +2371,7 @@ class Facture extends CommonInvoice
$sql = 'UPDATE '.MAIN_DB_PREFIX.'facture';
$sql.= ' SET remise_percent = '.$remise;
$sql.= ' WHERE rowid = '.$this->id;
- $sql.= ' AND fk_statut = 0 ;';
+ $sql.= ' AND fk_statut = 0';
if ($this->db->query($sql))
{
@@ -2426,7 +2406,7 @@ class Facture extends CommonInvoice
$sql = 'UPDATE '.MAIN_DB_PREFIX.'facture';
$sql.= ' SET remise_absolue = '.$remise;
$sql.= ' WHERE rowid = '.$this->id;
- $sql.= ' AND fk_statut = 0 ;';
+ $sql.= ' AND fk_statut = 0';
dol_syslog(get_class($this)."::set_remise_absolue sql=$sql");
diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php
index 5654ff08507..751361559a1 100644
--- a/htdocs/theme/amarok/style.css.php
+++ b/htdocs/theme/amarok/style.css.php
@@ -217,7 +217,7 @@ a:hover, a:active {
input, input.flat, textarea, textarea.flat, form.flat select, select.flat {
- padding: 1px;
+ padding: 2px;
}
input, textarea {
font-size:px;
@@ -1003,13 +1003,14 @@ a.tab:hover {color:#333333;}
/* ============================================================================== */
#id-container {
- display: table;
- table-layout: fixed;
+ margin-bottom: 6px;
+ display: table;
+ table-layout: fixed;
}
#id-right, #id-left {
- display: table-cell;
- float: none;
- vertical-align: top;
+ display: table-cell;
+ float: none;
+ vertical-align: top;
}
#id- {
width: 100%;
@@ -1942,7 +1943,7 @@ a.none, a.none:active, a.none:visited, a.none:hover {
.ui-button-icon-only .ui-button-text { height:8px; }
.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding:2px 0px 6px 0px; }
.ui-button-text { line-height:1em !important; }
-.ui-autocomplete-input { margin:0; padding:1px; }
+.ui-autocomplete-input { margin:0; }
/* ============================================================================== */
diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php
index d088034c18a..d4dff44211a 100644
--- a/htdocs/theme/auguria/style.css.php
+++ b/htdocs/theme/auguria/style.css.php
@@ -270,14 +270,15 @@ td.showDragHandle {
/* ============================================================================== */
#id-container {
- display: table;
- table-layout: fixed;
- margin-top: 6px;
+ display: table;
+ table-layout: fixed;
+ margin-top: 6px;
+ margin-bottom: 6px;
}
#id-right, #id-left {
- display: table-cell;
- float: none;
- vertical-align: top;
+ display: table-cell;
+ float: none;
+ vertical-align: top;
}
#id- {
width: 100%;
diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php
index 973fe5cb889..178a36081ce 100644
--- a/htdocs/theme/bureau2crea/style.css.php
+++ b/htdocs/theme/bureau2crea/style.css.php
@@ -143,7 +143,7 @@ input, input.flat, textarea, textarea.flat, form.flat select, select.flat {
font-family: ;
background: #FDFDFD;
border: 1px solid #ACBCBB;
- padding: 0px 0px 0px 0px;
+ padding: 1px;
margin: 0px 0px 0px 0px;
}
select.flat, form.flat select {
@@ -294,13 +294,14 @@ td.showDragHandle {
/* ============================================================================== */
#id-container {
- display: table;
- table-layout: fixed;
+ margin-bottom: 8px;
+ display: table;
+ table-layout: fixed;
}
#id-right, #id-left {
- display: table-cell;
- float: none;
- vertical-align: top;
+ display: table-cell;
+ float: none;
+ vertical-align: top;
}
#id- {
width: 100%;
diff --git a/htdocs/theme/cameleo/style.css.php b/htdocs/theme/cameleo/style.css.php
index fe8fd71cdb9..442fac09b3b 100644
--- a/htdocs/theme/cameleo/style.css.php
+++ b/htdocs/theme/cameleo/style.css.php
@@ -108,7 +108,7 @@ input, input.flat, textarea, textarea.flat, form.flat select, select.flat {
font-family: ;
background: #FDFDFD;
border: 1px solid #ACBCBB;
- padding: 1px 1px 1px 1px;
+ padding: 2px;
margin: 0px 0px 0px 0px;
}
@@ -269,13 +269,14 @@ td.showDragHandle {
/* ============================================================================== */
#id-container {
- display: table;
- table-layout: fixed;
+ margin-bottom: 8px;
+ display: table;
+ table-layout: fixed;
}
#id-right, #id-left {
- display: table-cell;
- float: none;
- vertical-align: top;
+ display: table-cell;
+ float: none;
+ vertical-align: top;
}
#id- {
width: 100%;
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index f91b548c2ba..f0885c24673 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -437,6 +437,7 @@ td.showDragHandle {
#id-container {
margin-top: 8px;
+ margin-bottom: 8px;
display: table;
table-layout: fixed;
}
@@ -2483,7 +2484,7 @@ A.none, A.none:active, A.none:visited, A.none:hover {
{
line-height: 1em !important;
}
-.ui-autocomplete-input { margin: 0; padding: 1px; }
+.ui-autocomplete-input { margin: 0; }
/* ============================================================================== */
@@ -2513,6 +2514,11 @@ a.cke_dialog_ui_button
{
vertical-align: bottom ! important;
}
+.cke_editable
+{
+ line-height: 1.4 !important;
+ margin: 6px !important;
+}
/* ============================================================================== */