diff --git a/ChangeLog b/ChangeLog
index 6cecbc2b75274..768165604fa31 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -38,6 +38,10 @@ For users:
- New: Intervention documents are now available in ECM module
- New: Add attachments on user card + in ECM module
- New: Can add __PROJECT_REF__ and __TIHRPARTY_NAME__ into email topic or content template.
+- New: [ task #1204 ] add a External reference to contract
+- New: [ task #1204 ] add Numering contrat module free (like leopard in product module)
+- New: [ task #712 ] Add warning when creating invoice from proposal or order, when there is already one invoice
+- New: Enable supplier price log table
- Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action
- Fix: [ bug #1470, #1472, #1473] User trigger problem
- Fix: [ bug #1489, #1491 ] Intervention trigger problem
@@ -55,9 +59,6 @@ For users:
- Fix: [ bug #1506, #1507 ] ECM trigger error problem
- Fix: [ bug #1469 ] Triggers CONTACT_MODIFY and CONTACT_DELETE duplicates error message
- Fix: [ bug #1537 ] Difference between societe.nom and adherent.societe.
-- New: [ task #1204 ] add a External reference to contract
-- New: [ task #1204 ] add Numering contrat module free (like leopard in product module)
-- New: Enable supplier price log table
For translators:
- Update language files.
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 53a607eac57ae..cc45226b9a08b 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -2304,7 +2304,16 @@
elseif ($newclassname == 'Fichinter')
$newclassname = 'Intervention';
- print '
' . $langs->trans($newclassname) . ' | ' . $objectsrc->getNomUrl(1) . ' |
';
+ print '' . $langs->trans($newclassname) . ' | ' . $objectsrc->getNomUrl(1);
+ //We check if Origin document has already an invoice attached to it
+ $objectsrc->fetchObjectLinked($originid,'','','facture');
+ $cntinvoice=count($objectsrc->linkedObjects['facture']);
+ if ($cntinvoice>=1)
+ {
+ setEventMessage('WarningBillExist','warnings');
+ echo ' ('.$langs->trans('LatestRelatedBill').end($objectsrc->linkedObjects['facture'])->getNomUrl(1).')';
+ }
+ echo ' |
';
print '' . $langs->trans('TotalHT') . ' | ' . price($objectsrc->total_ht) . ' |
';
print '' . $langs->trans('TotalVAT') . ' | ' . price($objectsrc->total_tva) . " |
";
if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0) // Localtax1
diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang
index 9f8353acfda75..ededbf9cbdc5e 100644
--- a/htdocs/langs/en_US/bills.lang
+++ b/htdocs/langs/en_US/bills.lang
@@ -295,6 +295,8 @@ TotalOfTwoDiscountMustEqualsOriginal=Total of two new discount must be equal to
ConfirmRemoveDiscount=Are you sure you want to remove this discount ?
RelatedBill=Related invoice
RelatedBills=Related invoices
+LatestRelatedBill=Latest related invoice
+WarningBillExist=Warning, one or more invoice already exist
# PaymentConditions
PaymentConditionShortRECEP=Immediate
diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang
index c4bf33c56cc2e..aaea4122b2224 100644
--- a/htdocs/langs/fr_FR/bills.lang
+++ b/htdocs/langs/fr_FR/bills.lang
@@ -295,6 +295,8 @@ TotalOfTwoDiscountMustEqualsOriginal=La somme du montant des 2 nouvelles réduct
ConfirmRemoveDiscount=Êtes-vous sûr de vouloir supprimer cette réduction ?
RelatedBill=Facture associée
RelatedBills=Factures associées
+LatestRelatedBill=Dernière facture associée
+WarningBillExist=Attention, il existe déjà une ou plusieurs factures
# PaymentConditions
PaymentConditionShortRECEP=A réception