diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index 67321b5c2db..ee712008ba2 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -1,7 +1,7 @@ * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2004-2009 Laurent Destailleur * * 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 @@ -112,7 +112,7 @@ if ($_POST["action"] == "builddoc" && $user->rights->facture->lire) } else { - $mesg='
'.$langs->trans('UnpayedNotChecked').'
' ; + $mesg='
'.$langs->trans('InvoiceNotChecked').'
' ; } } @@ -264,7 +264,6 @@ if ($result) print ''; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"f.facnumber","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Generate"),$_SERVER["PHP_SELF"],"","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"f.datef","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"f.date_lim_reglement","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder); @@ -272,18 +271,19 @@ if ($result) print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Received"),$_SERVER["PHP_SELF"],"am","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"fk_statut,paye,am","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Merge"),$_SERVER["PHP_SELF"],"","",$param,'align="center"',$sortfield,$sortorder); print "\n"; // Lignes des champs de filtre print '
'; print ''; + // Ref print ''; print ''; - print ''; print ' '; print ' '; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -291,6 +291,7 @@ if ($result) print ''; print ''; print ''; + print ''; print "\n"; print '
'; @@ -323,33 +324,32 @@ if ($result) $facturestatic->type=$objp->type; print ''; + + // Ref print ''; + // Warning picto print ''; + // PDF Picto print '
'; print $facturestatic->getNomUrl(1); print ''; if ($objp->datelimite < ($now - $conf->facture->client->warning_delay) && ! $objp->paye && $objp->fk_statut == 1) print img_warning($langs->trans("Late")); print ''; - $filename=sanitizeFileName($objp->facnumber); $filedir=$conf->facture->dir_output . '/' . sanitizeFileName($objp->facnumber); $foundpdf=$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','','','',1,$param); - print '
'; + print ''; - // Checkbox - print ''; - if ($foundpdf) print ''; - else print ' '; - print '' ; + print ''; print "\n"; - print "".dol_print_date($objp->df)."\n"; - print "".dol_print_date($objp->datelimite)."\n"; + print "".dol_print_date($objp->df,'day')."\n"; + print "".dol_print_date($objp->datelimite,'day')."\n"; - print ''.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,32).''; + print ''.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,28).''; print "".price($objp->total_ht).""; print "".price($objp->total_ttc).""; @@ -360,6 +360,12 @@ if ($result) print $facturestatic->LibStatut($objp->paye,$objp->fk_statut,5,$objp->am); print ''; + // Checkbox + print ''; + if ($foundpdf) print ''; + else print ' '; + print '' ; + print "\n"; $total_ht+=$objp->total_ht; $total_ttc+=$objp->total_ttc; @@ -394,7 +400,7 @@ if ($result) print '
'; print ''; - $formfile->show_documents('unpayed','',$filedir,$urlsource,$genallowed,$delallowed,'','',0,0,48,1,$param); + $formfile->show_documents('unpayed','',$filedir,$urlsource,$genallowed,$delallowed,'','',0,0,48,1,$param,'',$langs->trans("PDFMerge")); print ''; $db->free(); diff --git a/htdocs/compta/paiement/liste.php b/htdocs/compta/paiement/liste.php index 80415b31bf2..50ba64f93ec 100644 --- a/htdocs/compta/paiement/liste.php +++ b/htdocs/compta/paiement/liste.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2004-2009 Laurent Destailleur * * 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 @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - + /** * \file htdocs/compta/paiement/liste.php * \ingroup compta @@ -50,16 +50,16 @@ llxHeader('',$langs->trans("ListPayment")); $page=$_GET["page"]; $sortorder=$_GET["sortorder"]; $sortfield=$_GET["sortfield"]; - + $limit = $conf->liste_limit; $offset = $limit * $page ; if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="p.rowid"; - + $sql = "SELECT DISTINCT p.rowid,".$db->pdate("p.datep")." as dp, p.amount,"; $sql.= " p.statut, p.num_paiement,"; //$sql.= " c.libelle as paiement_type,"; -$sql.= " c.code as paiement_code,"; +$sql.= " c.code as paiement_code,"; $sql.= " ba.rowid as bid, ba.label,"; $sql.= " s.rowid as socid, s.nom"; //$sql.= " f.facnumber"; @@ -119,12 +119,12 @@ if ($resql) print '
'; print ''; print ''; - print_liste_field_titre($langs->trans("Ref"),"liste.php","p.rowid","",$paramlist,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("RefPayment"),"liste.php","p.rowid","",$paramlist,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Date"),"liste.php","dp","",$paramlist,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("ThirdParty"),"liste.php","c.nom","",$paramlist,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Type"),"liste.php","c.libelle","",$paramlist,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Account"),"liste.php","ba.label","",$paramlist,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("AmountTTC"),"liste.php","p.amount","",$paramlist,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Amount"),"liste.php","p.amount","",$paramlist,'align="right"',$sortfield,$sortorder); //print_liste_field_titre($langs->trans("Invoices"),"","","",$paramlist,'align="left"',$sortfield,$sortorder); if ($conf->global->BILL_ADD_PAYMENT_VALIDATION) { @@ -192,9 +192,9 @@ if ($resql) if ($objp->statut == 0) print ''; print ''; } - + print ''; - + $i++; } print "
\n"; diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 0d9759ad7e3..7a4ccd5b1f6 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -1,7 +1,7 @@ * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2004 Christophe Combelles * Copyright (C) 2005 Marc Barilley / Ocebo * @@ -117,66 +117,66 @@ if ($action == 'add_paiement') $paiement_id = $paiement->create($user); if ($paiement_id > 0) { - if ($conf->banque->enabled) - { - // Insertion dans llx_bank - $label = "(SupplierInvoicePayment)"; - $acc = new Account($db, $_POST['accountid']); - //paiementid contient "CHQ ou VIR par exemple" - $bank_line_id = $acc->addline($paiement->datepaye, - $paiement->paiementid, - $label, - 0.0 - $paiement->total, - $paiement->num_paiement, - '', - $user); + if ($conf->banque->enabled) + { + // Insertion dans llx_bank + $label = "(SupplierInvoicePayment)"; + $acc = new Account($db, $_POST['accountid']); + //paiementid contient "CHQ ou VIR par exemple" + $bank_line_id = $acc->addline($paiement->datepaye, + $paiement->paiementid, + $label, + 0.0 - $paiement->total, + $paiement->num_paiement, + '', + $user); - // Mise a jour fk_bank dans llx_paiement. - // On connait ainsi le paiement qui a genere l'ecriture bancaire - if ($bank_line_id > 0) - { - $paiement->update_fk_bank($bank_line_id); - // Mise a jour liens (pour chaque facture concernees par le paiement) - foreach ($paiement->amounts as $key => $value) - { - $facid = $key; - $fac = new FactureFournisseur($db); - $fac->fetch($facid); - $fac->fetch_fournisseur(); - $acc->add_url_line($bank_line_id, - $paiement_id, - DOL_URL_ROOT.'/fourn/paiement/fiche.php?id=', - '(paiement)', - 'payment_supplier'); - $acc->add_url_line($bank_line_id, - $fac->fournisseur->id, - DOL_URL_ROOT.'/fourn/fiche.php?socid=', - $fac->fournisseur->nom, - 'company'); - } - } - else - { - $error++; - } - } + // Mise a jour fk_bank dans llx_paiement. + // On connait ainsi le paiement qui a genere l'ecriture bancaire + if ($bank_line_id > 0) + { + $paiement->update_fk_bank($bank_line_id); + // Mise a jour liens (pour chaque facture concernees par le paiement) + foreach ($paiement->amounts as $key => $value) + { + $facid = $key; + $fac = new FactureFournisseur($db); + $fac->fetch($facid); + $fac->fetch_fournisseur(); + $acc->add_url_line($bank_line_id, + $paiement_id, + DOL_URL_ROOT.'/fourn/paiement/fiche.php?id=', + '(paiement)', + 'payment_supplier'); + $acc->add_url_line($bank_line_id, + $fac->fournisseur->id, + DOL_URL_ROOT.'/fourn/fiche.php?socid=', + $fac->fournisseur->nom, + 'company'); + } + } + else + { + $error++; + } + } } else { - $mesg = '
'.$langs->trans($paiement->error).'
'; - $error++; + $mesg = '
'.$langs->trans($paiement->error).'
'; + $error++; } if ($error == 0) { - $loc = DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$paiement_id; - $db->commit(); - Header('Location: '.$loc); - exit; + $loc = DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$paiement_id; + $db->commit(); + Header('Location: '.$loc); + exit; } else { - $db->rollback(); + $db->rollback(); } } } @@ -185,6 +185,8 @@ if ($action == 'add_paiement') * View */ +$invoicesupplierstatic = new FactureFournisseur($db); + llxHeader(); $html=new Form($db); @@ -389,42 +391,49 @@ if (! $_GET['action'] && ! $_POST['action']) print ''; print ''; print_liste_field_titre($langs->trans('RefPayment'),'paiement.php','rowid','','','',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('Invoice'),'paiement.php','facnumber','','','',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('Date'),'paiement.php','dp','','','',$sortfield,$sortorder); + print_liste_field_titre($langs->trans('Date'),'paiement.php','dp','','','align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('ThirdParty'),'paiement.php','s.nom','','','',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Type'),'paiement.php','c.libelle','','','',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Account'),'paiement.php','ba.label','','','',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('AmountTTC'),'paiement.php','f.amount','','','align="right"',$sortfield,$sortorder); - print ''; + print_liste_field_titre($langs->trans('Amount'),'paiement.php','f.amount','','','align="right"',$sortfield,$sortorder); + //print_liste_field_titre($langs->trans('Invoice'),'paiement.php','facnumber','','','',$sortfield,$sortorder); print "\n"; while ($i < min($num,$limit)) { - $objp = $db->fetch_object($resql); - $var=!$var; - print ''; + $objp = $db->fetch_object($resql); + $var=!$var; + print ''; - // Ref payment - print ''; + // Ref payment + print ''; - // Ref invoice - print ''; + // Date + print '\n"; - // Date - print '\n"; + print ''; - print ''; - print '\n"; - print ''; - print ''; - print ''; - $i++; + print '\n"; + + print ''; + + print ''; + + // Ref invoice + /*$invoicesupplierstatic->ref=$objp->facnumber; + $invoicesupplierstatic->id=$objp->facid; + print '';*/ + + print ''; + $i++; } print "
 
'.img_object($langs->trans('ShowPayment'),'payment').' '.$objp->pid.''.img_object($langs->trans('ShowPayment'),'payment').' '.$objp->pid.''.dol_trunc($objp->facnumber,12).''.dol_print_date($objp->dp,'day')."'.dol_print_date($objp->dp,'day')."'; + if ($objp->socid) print ''.img_object($langs->trans('ShowCompany'),'company').' '.dol_trunc($objp->nom,32).''; + else print ' '; + print ''; - if ($objp->socid) print ''.img_object($langs->trans('ShowCompany'),'company').' '.dol_trunc($objp->nom,32).''; - else print ' '; - print ''.dol_trunc($objp->paiement_type.' '.$objp->num_paiement,32)."'; - if ($objp->bid) print ''.img_object($langs->trans("ShowAccount"),'account').' '.dol_trunc($objp->label,24).''; - else print ' '; - print ''.price($objp->pamount).' 
'.dol_trunc($objp->paiement_type.' '.$objp->num_paiement,32)."'; + if ($objp->bid) print ''.img_object($langs->trans("ShowAccount"),'account').' '.dol_trunc($objp->label,24).''; + else print ' '; + print ''.price($objp->pamount).''; + print $invoicesupplierstatic->getNomUrl(1); + print '
"; } diff --git a/htdocs/html.formfile.class.php b/htdocs/html.formfile.class.php index 6cf5a40005c..f8e443e7bed 100644 --- a/htdocs/html.formfile.class.php +++ b/htdocs/html.formfile.class.php @@ -134,11 +134,13 @@ class FormFile * \param maxfilenamelength Max length for filename shown * \param noform Do not output html form start and end * \param param More param on http links + * \param title Title to show on top of form + * \param buttonlabel Label on submit button * \remarks Le fichier de facture detaillee est de la forme * REFFACTURE-XXXXXX-detail.pdf ou XXXXX est une forme diverse * \return int <0 si ko, nbre de fichiers affiches si ok */ - function show_documents($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$modelliste=array(),$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='',$title='') + function show_documents($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$modelliste=array(),$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='',$title='',$buttonlabel='') { // filedir = conf->...dir_ouput."/".get_exdir(id) include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php'); @@ -287,7 +289,8 @@ class FormFile $headershown=1; $html = new Form($db); - $texte=$langs->trans('Generate'); + $buttonlabeltoshow=$buttonlabel; + if (empty($buttonlabel)) $buttonlabel=$langs->trans('Generate'); if (empty($noform)) print ''; print ''; @@ -321,7 +324,7 @@ class FormFile } print ''; print ''; - print ''; + print ''; print ''; } diff --git a/htdocs/langs/ca_ES/bills.lang b/htdocs/langs/ca_ES/bills.lang index ff90d4006ad..af6c669fa73 100644 --- a/htdocs/langs/ca_ES/bills.lang +++ b/htdocs/langs/ca_ES/bills.lang @@ -258,7 +258,7 @@ InvoicePayed = Factura pagada PaymentNumber = Número de pagament RemoveDiscount = Eliminar descompte WatermarkOnDraftBill = Marca d'aigua en factures esborrany (res si està buida) -UnpayedNotChecked = Cap factura pendent està seleccionada +InvoiceNotChecked = Cap factura pendent està seleccionada CloneInvoice = Clonar factura ConfirmCloneInvoice = Esteu segur de voler clonar aquesta factura? DisabledBecauseReplacedInvoice = Acció desactivada perquè és una factura reemplaçada diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 8db25c1507e..8acb42e887d 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -337,6 +337,7 @@ ChequeDeposits=Cheques deposits Cheques=Cheques CreditNoteConvertedIntoDiscount=This credit note or deposit invoice has been converted into %s UsBillingContactAsIncoiveRecipientIfExist=Use customer billing contact address instead of third party address as recipient for invoices +ShowUnpayedLateOnly=Show late unpayed invoice only PaymentInvoiceRef=Payment invoice %s # oursin PDF model Of=du diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index b85bafcb45c..c8c56d9f84e 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -503,6 +503,8 @@ Notes=Notes AddNewLine=Add new line FreeZone=Free text CloneMainAttributes=Clone object with its main attributes +PDFMerge=PDF Merge +Merge=Merge # Week day Day1=Monday Day2=Tuesday diff --git a/htdocs/langs/es_ES/bills.lang b/htdocs/langs/es_ES/bills.lang index 776df1b08cb..475ccc4cf7a 100644 --- a/htdocs/langs/es_ES/bills.lang +++ b/htdocs/langs/es_ES/bills.lang @@ -258,7 +258,7 @@ InvoicePayed = Factura pagada PaymentNumber = Número de pago RemoveDiscount = Eliminar descuento WatermarkOnDraftBill = Marca de agua en facturas borrador (nada si está vacía) -UnpayedNotChecked = Ninguna factura pendiente está seleccionada +InvoiceNotChecked = Ninguna factura está seleccionada CloneInvoice = Clonar factura ConfirmCloneInvoice = ¿Está seguro de querer clonar esta factura? DisabledBecauseReplacedInvoice = Acción desactivada porque es una factura reemplazada diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang index c972e2ce443..b24eff8663f 100644 --- a/htdocs/langs/fr_FR/bills.lang +++ b/htdocs/langs/fr_FR/bills.lang @@ -259,7 +259,7 @@ InvoicePayed=Facture payée PaymentNumber=Numéro paiement RemoveDiscount=Supprimer remise WatermarkOnDraftBill=Filigrane sur les brouillons de factures (aucun si vide) -UnpayedNotChecked=Aucune facture impayées n'a été sélectionnée +InvoiceNotChecked=Aucune facture n'a été sélectionnée CloneInvoice=Cloner facture ConfirmCloneInvoice=Etes-vous sur de vouloir cloner cette facture %s ? DisabledBecauseReplacedInvoice=Action désactivée car facture remplacée diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index cc158e550d1..0c5e1418630 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -503,6 +503,8 @@ Notes=Notes AddNewLine=Ajout nouvelle ligne FreeZone=Zone libre CloneMainAttributes=Cloner l'objet avec ces attributs principaux +PDFMerge=Fusion PDF +Merge=Fusion # Week day Day1=Lundi Day2=Mardi