';
+
+ // Ligne de titre tableau des ecritures
+ print '';
+ print '| '.$langs->trans("DateDue").' | ';
+ print ''.$langs->trans("Description").' | ';
+ if ($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED) {
+ print ''.$langs->trans("Entity").' | ';
+ }
+ print ''.$langs->trans("ThirdParty").' | ';
+ print ''.$langs->trans("Debit").' | ';
+ print ''.$langs->trans("Credit").' | ';
+ print ''.$langs->trans("BankBalance").' | ';
+ print '
';
+
+ // Current balance
+ print '';
+ print '| '.$langs->trans("CurrentBalance").' | ';
+ print ''.price($solde).' | ';
+ print '
';
+
// Sort array
if (!$error) {
array_multisort($tab_sqlobjOrder, $tab_sqlobj);
@@ -220,60 +226,60 @@ if (GETPOST("account") || GETPOST("ref")) {
$refcomp = '';
$totalpayment = '';
- $obj = array_shift($tab_sqlobj);
+ $tmpobj = array_shift($tab_sqlobj);
- if ($obj->family == 'invoice_supplier') {
+ if ($tmpobj->family == 'invoice_supplier') {
$showline = 1;
// Uncomment this line to avoid to count suppliers credit note (ff.type = 2)
- //$showline=(($obj->total_ttc < 0 && $obj->type != 2) || ($obj->total_ttc > 0 && $obj->type == 2))
+ //$showline=(($tmpobj->total_ttc < 0 && $tmpobj->type != 2) || ($tmpobj->total_ttc > 0 && $tmpobj->type == 2))
if ($showline) {
- $ref = $obj->ref;
+ $ref = $tmpobj->ref;
$facturefournstatic->ref = $ref;
- $facturefournstatic->id = $obj->objid;
- $facturefournstatic->type = $obj->type;
+ $facturefournstatic->id = $tmpobj->objid;
+ $facturefournstatic->type = $tmpobj->type;
$ref = $facturefournstatic->getNomUrl(1, '');
- $societestatic->id = $obj->socid;
- $societestatic->name = $obj->name;
+ $societestatic->id = $tmpobj->socid;
+ $societestatic->name = $tmpobj->name;
$refcomp = $societestatic->getNomUrl(1, '', 24);
$totalpayment = -1 * $facturefournstatic->getSommePaiement(); // Payment already done
}
}
- if ($obj->family == 'invoice') {
- $facturestatic->ref = $obj->ref;
- $facturestatic->id = $obj->objid;
- $facturestatic->type = $obj->type;
+ if ($tmpobj->family == 'invoice') {
+ $facturestatic->ref = $tmpobj->ref;
+ $facturestatic->id = $tmpobj->objid;
+ $facturestatic->type = $tmpobj->type;
$ref = $facturestatic->getNomUrl(1, '');
- $societestatic->id = $obj->socid;
- $societestatic->name = $obj->name;
+ $societestatic->id = $tmpobj->socid;
+ $societestatic->name = $tmpobj->name;
$refcomp = $societestatic->getNomUrl(1, '', 24);
$totalpayment = $facturestatic->getSommePaiement(); // Payment already done
$totalpayment += $facturestatic->getSumDepositsUsed();
$totalpayment += $facturestatic->getSumCreditNotesUsed();
}
- if ($obj->family == 'social_contribution') {
- $socialcontribstatic->ref = $obj->ref;
- $socialcontribstatic->id = $obj->objid;
- $socialcontribstatic->label = $obj->type;
+ if ($tmpobj->family == 'social_contribution') {
+ $socialcontribstatic->ref = $tmpobj->ref;
+ $socialcontribstatic->id = $tmpobj->objid;
+ $socialcontribstatic->label = $tmpobj->type;
$ref = $socialcontribstatic->getNomUrl(1, 24);
$totalpayment = -1 * $socialcontribstatic->getSommePaiement(); // Payment already done
}
- $parameters = array('obj' => $obj, 'ref' => $ref, 'refcomp' => $refcomp, 'totalpayment' => $totalpayment);
- $reshook = $hookmanager->executeHooks('moreFamily', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
+ $parameters = array('obj' => $tmpobj, 'ref' => $ref, 'refcomp' => $refcomp, 'totalpayment' => $totalpayment);
+ $reshook = $hookmanager->executeHooks('moreFamily', $parameters, $tmpobject, $action); // Note that $action and $tmpobject may have been modified by hook
if (empty($reshook)) {
$ref = isset($hookmanager->resArray['ref']) ? $hookmanager->resArray['ref'] : $ref;
$refcomp = isset($hookmanager->resArray['refcomp']) ? $hookmanager->resArray['refcomp'] : $refcomp;
$totalpayment = isset($hookmanager->resArray['totalpayment']) ? $hookmanager->resArray['totalpayment'] : $totalpayment;
}
- $total_ttc = $obj->total_ttc;
+ $total_ttc = $tmpobj->total_ttc;
if ($totalpayment) {
- $total_ttc = $obj->total_ttc - $totalpayment;
+ $total_ttc = $tmpobj->total_ttc - $totalpayment;
}
$solde += $total_ttc;
@@ -282,26 +288,26 @@ if (GETPOST("account") || GETPOST("ref")) {
// Show line
print '';
print '| ';
- if ($obj->dlr) {
- print dol_print_date($db->jdate($obj->dlr), "day");
+ if ($tmpobj->dlr) {
+ print dol_print_date($tmpobj->dlr, "day");
} else {
print $langs->trans("NotDefined");
}
print " | ";
print "".$ref." | ";
if ($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED) {
- if ($obj->family == 'invoice') {
- $mc->getInfo($obj->entity);
+ if ($tmpobj->family == 'invoice') {
+ $mc->getInfo($tmpobj->entity);
print "".$mc->label." | ";
} else {
print " | ";
}
}
print "".$refcomp." | ";
- if ($obj->total_ttc < 0) {
+ if ($tmpobj->total_ttc < 0) {
print ''.price(abs($total_ttc))." | | ";
};
- if ($obj->total_ttc >= 0) {
+ if ($tmpobj->total_ttc >= 0) {
print ' | '.price($total_ttc)." | ";
};
print ''.price($solde).' | ';
diff --git a/htdocs/fourn/ajax/getSupplierPrices.php b/htdocs/fourn/ajax/getSupplierPrices.php
index e0cd9beff0c..889484cec44 100644
--- a/htdocs/fourn/ajax/getSupplierPrices.php
+++ b/htdocs/fourn/ajax/getSupplierPrices.php
@@ -43,7 +43,7 @@ $idprod = GETPOST('idprod', 'int');
$prices = array();
// Load translation files required by the page
-$langs->loadLangs(array("stocks", "margins"));
+$langs->loadLangs(array("stocks", "margins", "products"));
/*
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index 7d8d29b307c..6b67d0a2dcf 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -2739,14 +2739,17 @@ if ($action == 'create') {
// Label
print '
';
- print '| '.$form->editfieldkey("Label", 'label', $object->label, $object, ($usercancreate)).' | ';
- print ''.$form->editfieldval("Label", 'label', $object->label, $object, ($usercancreate)).' | ';
+ print ''.$form->editfieldkey("Label", 'label', $object->label, $object, $usercancreate).' | ';
+ print ''.$form->editfieldval("Label", 'label', $object->label, $object, $usercancreate).' | ';
print '
';
$form_permission = ($object->statut < FactureFournisseur::STATUS_CLOSED) && $usercancreate && ($object->getSommePaiement() <= 0);
+ $form_permission2 = ($object->statut < FactureFournisseur::STATUS_CLOSED) && $usercancreate;
// Date
- print '| '.$form->editfieldkey("DateInvoice", 'datef', $object->datep, $object, $form_permission, 'datepicker').' | ';
+ print ' |
| ';
+ print $form->editfieldkey("DateInvoice", 'datef', $object->datep, $object, $form_permission, 'datepicker');
+ print ' | ';
print $form->editfieldval("Date", 'datef', $object->datep, $object, $form_permission, 'datepicker');
print ' | ';
@@ -2756,11 +2759,11 @@ if ($action == 'create') {
print '';
- print '';
+ print ' | ';
if ($action == 'editconditions') {
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'cond_reglement_id');
} else {
@@ -2770,8 +2773,10 @@ if ($action == 'create') {
print ' |
';
// Due date
- print '| '.$form->editfieldkey("DateMaxPayment", 'date_lim_reglement', $object->date_echeance, $object, $form_permission, 'datepicker').' | ';
- print $form->editfieldval("DateMaxPayment", 'date_lim_reglement', $object->date_echeance, $object, $form_permission, 'datepicker');
+ print ' |
| ';
+ print $form->editfieldkey("DateMaxPayment", 'date_lim_reglement', $object->date_echeance, $object, $form_permission2, 'datepicker');
+ print ' | ';
+ print $form->editfieldval("DateMaxPayment", 'date_lim_reglement', $object->date_echeance, $object, $form_permission2, 'datepicker');
if ($action != 'editdate_lim_reglement' && $object->hasDelay()) {
print img_warning($langs->trans('Late'));
}
@@ -2783,11 +2788,11 @@ if ($action == 'create') {
print '';
- print ' | ';
+ print ' | ';
if ($action == 'editmode') {
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', 'DBIT', 1, 1);
} else {
@@ -2807,7 +2812,7 @@ if ($action == 'create') {
print ' | id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).' | ';
}
print '
';
print '';
- print '| ';
+ print '';
- print ' | ';
+ print ' | ';
if ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') {
if ($action == 'actualizemulticurrencyrate') {
list($object->fk_multicurrency, $object->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($object->db, $object->multicurrency_code);
@@ -2854,7 +2859,7 @@ if ($action == 'create') {
print ' | id.'">'.img_edit($langs->trans('SetBankAccount'), 1).' | ';
}
print ' ';
- print ' | ';
+ print ' | ';
if ($action == 'editbankaccount') {
$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1);
} else {
@@ -2877,7 +2882,7 @@ if ($action == 'create') {
}
print ' |