From aca42cb11c444f036ad1d2d8c3905071edf6604c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 26 Aug 2006 23:00:42 +0000 Subject: [PATCH] New: Gestion des factures de remplacement et debut de gestion des avoirs --- htdocs/compta/facture.php | 89 +++++++++++++++++++++-------------- htdocs/langs/en_US/bills.lang | 3 +- htdocs/langs/fr_FR/bills.lang | 3 +- 3 files changed, 57 insertions(+), 38 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 56a26abc2ec..e6577b5bff1 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -975,7 +975,20 @@ if ($_GET['action'] == 'create') // Ref print ''.$langs->trans('Ref').''.$langs->trans('Draft').''; + // Societe + print ''.$langs->trans('Company').''; + print $soc->getNomUrl(1); + print ''; + print ''; + print ''; + // Type de facture + $facids=$facturestatic->list_replacable_invoices($soc->id); + $options=""; + foreach ($facids as $key => $value) + { + $options.=''; + } print ''.$langs->trans('Type').''; print ''; print ''; print '
'; @@ -985,18 +998,21 @@ if ($_GET['action'] == 'create') print $desc; print '
'; - print ''; + print ''; print ''; - $facids=$facturestatic->list_replacable_invoices($soc->id); - $options=""; - foreach ($facids as $key => $value) - { - $options.=''; - } $text=$langs->trans("InvoiceReplacementAsk").' '; $text.=''; $desc=$html->textwithhelp($text,$langs->transnoentities("InvoiceReplacementDesc"),1); print $desc; @@ -1010,13 +1026,6 @@ if ($_GET['action'] == 'create') print '
'; print ''; - // Societe - print ''.$langs->trans('Company').''; - print $soc->getNomUrl(1); - print ''; - print ''; - print ''; - // Ligne info remises tiers print ''.$langs->trans('Discounts').''; if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); @@ -1536,6 +1545,11 @@ else // Reference print ''.$langs->trans('Ref').''.$fac->ref.''; + // Société + print ''.$langs->trans('Company').''; + print ''.$soc->getNomUrl(1,'compta').''; + print ''; + // Type print ''.$langs->trans('Type').''; print $fac->getLibType(); @@ -1554,11 +1568,6 @@ else } print ''; - // Société - print ''.$langs->trans('Company').''; - print ''.$soc->getNomUrl(1,'compta').''; - print ''; - // Ligne info remises tiers print ''.$langs->trans('Discounts').''; if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); @@ -1687,6 +1696,7 @@ else print ''; + // Ref client /* \todo L'info "Reference commande client" est une carac de la commande et non de la facture. @@ -1695,21 +1705,28 @@ else */ if ($conf->global->FAC_USE_CUSTOMER_ORDER_REF) { - print ''.$langs->trans('RefCustomerOrder').''; - - if ($fac->brouillon == 1 && $user->rights->facture->creer) - { - print '
'; - print ''; - print ''; - print ''; - print '
'; - } - else - { - print ''.$fac->ref_client.''; - } - } + print ''; + print ''; + if ($_GET['action'] != 'RefCustomerOrder' && $fac->brouillon) print ''; + print '
'; + print $langs->trans('RefCustomer').''; + print ''.img_edit($langs->trans('Edit')).'
'; + print ''; + if ($user->rights->facture->creer && $_GET['action'] == 'RefCustomerOrder') + { + print '
'; + print ''; + print ''; + print ' '; + print '
'; + } + else + { + print $fac->ref_client; + } + print ''; + print ''; + } // Lit lignes de facture pour déterminer montant // On s'en sert pas mais ca sert pour debuggage diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 10956f8c8ee..359ed11843e 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -12,13 +12,14 @@ InvoiceStandard=Standard invoice InvoiceStandardAsk=Standard invoice InvoiceStandardDesc=This kind of invoice is the common invoice. InvoiceReplacement=Replacement invoice. Must replace invoice with reference -InvoiceReplacementAsk=Replacement invoice for following invoice +InvoiceReplacementAsk=Replacement invoice for invoice InvoiceReplacementDesc=Replacement invoice is used to cancel and replace completely an invoice with no paiement already recevided.
Reference of canceled invoice is required. InvoiceAvoir=Avoir invoice InvoiceAvoirAsk=Avoir invoice InvoiceAvoirDesc=La facture d'avoir est une facture négative destinée à compenser une facture comportant un montant supérieur à ce qui a été ou sera réellement payé (toutes causes possibles). ReplaceInvoice=Replace invoice %s ReplacedByInvoice=Replaced by invoice %s +NoReplacableInvoice=No replacable invoices CardBill=Invoice card Invoice=Invoice Invoices=Invoices diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang index b9012415c04..bc2eb33ad8d 100644 --- a/htdocs/langs/fr_FR/bills.lang +++ b/htdocs/langs/fr_FR/bills.lang @@ -12,13 +12,14 @@ InvoiceStandard=Facture standard InvoiceStandardAsk=Facture standard InvoiceStandardDesc=Ce type de facture est la facture traditionnelle. On l'appelle aussi facture de doit. InvoiceReplacement=Facture de remplacement -InvoiceReplacementAsk=Facture de remplacement de la facture suivante +InvoiceReplacementAsk=Facture de remplacement de la facture InvoiceReplacementDesc=La facture de remplacement sert à annuler et remplacer une facture existante sur laquelle aucun paiement n'a encore eu lieu.
La référence de la facture qui doit être annulée est obligatoire. InvoiceAvoir=Facture avoir InvoiceAvoirAsk=Facture avoir InvoiceAvoirDesc=La facture d'avoir est une facture négative destinée à compenser une facture comportant un montant supérieur à ce qui a été ou sera réellement payé (toutes causes possibles). ReplaceInvoice=Remplace la facture %s ReplacedByInvoice=Remplacée par la facture %s +NoReplacableInvoice=Pas de factures remplacables CardBill=Fiche facture Invoice=Facture Invoices=Factures