From 89a4c51153846cc32cad413514595f95b4102e87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Mon, 10 Mar 2014 21:13:16 +0100 Subject: [PATCH 01/21] Added es_CL language --- ChangeLog | 1 + htdocs/langs/en_US/languages.lang | 1 + htdocs/langs/es_CL/admin.lang | 23 +++++++++++ htdocs/langs/es_CL/agenda.lang | 2 + htdocs/langs/es_CL/bills.lang | 1 + htdocs/langs/es_CL/boxes.lang | 5 +++ htdocs/langs/es_CL/commercial.lang | 4 ++ htdocs/langs/es_CL/companies.lang | 2 + htdocs/langs/es_CL/compta.lang | 1 + htdocs/langs/es_CL/ecm.lang | 2 + htdocs/langs/es_CL/install.lang | 1 + htdocs/langs/es_CL/main.lang | 1 + htdocs/langs/es_CL/members.lang | 1 + htdocs/langs/es_CL/orders.lang | 1 + htdocs/langs/es_CL/other.lang | 9 +++++ htdocs/langs/es_CL/products.lang | 3 ++ htdocs/langs/es_CL/projects.lang | 1 + htdocs/langs/es_CL/propal.lang | 62 ++++++++++++++++++++++++++++++ htdocs/langs/es_CL/workflow.lang | 3 ++ 19 files changed, 124 insertions(+) create mode 100644 htdocs/langs/es_CL/admin.lang create mode 100644 htdocs/langs/es_CL/agenda.lang create mode 100644 htdocs/langs/es_CL/bills.lang create mode 100644 htdocs/langs/es_CL/boxes.lang create mode 100644 htdocs/langs/es_CL/commercial.lang create mode 100644 htdocs/langs/es_CL/companies.lang create mode 100644 htdocs/langs/es_CL/compta.lang create mode 100644 htdocs/langs/es_CL/ecm.lang create mode 100644 htdocs/langs/es_CL/install.lang create mode 100644 htdocs/langs/es_CL/main.lang create mode 100644 htdocs/langs/es_CL/members.lang create mode 100644 htdocs/langs/es_CL/orders.lang create mode 100644 htdocs/langs/es_CL/other.lang create mode 100644 htdocs/langs/es_CL/products.lang create mode 100644 htdocs/langs/es_CL/projects.lang create mode 100644 htdocs/langs/es_CL/propal.lang create mode 100644 htdocs/langs/es_CL/workflow.lang diff --git a/ChangeLog b/ChangeLog index 90b6922d60b..84bf41116f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -22,6 +22,7 @@ Fix: Page load not ending when large number of thirdparies. We combo feature that is root cause of problem. Fix: [ bug #1231 ] PDF always generated in interventions Fix: Be sure there is no duplicate default rib. +New: Added es_CL language ***** ChangeLog for 3.5 compared to 3.4.* ***** For users: diff --git a/htdocs/langs/en_US/languages.lang b/htdocs/langs/en_US/languages.lang index 5bd2c698dce..741295ed69f 100644 --- a/htdocs/langs/en_US/languages.lang +++ b/htdocs/langs/en_US/languages.lang @@ -19,6 +19,7 @@ Language_en_US=English (United States) Language_en_ZA=English (South Africa) Language_es_ES=Spanish Language_es_AR=Spanish (Argentina) +Language_es_CL=Spanish (Chile) Language_es_HN=Spanish (Honduras) Language_es_MX=Spanish (Mexico) Language_es_PY=Spanish (Paraguay) diff --git a/htdocs/langs/es_CL/admin.lang b/htdocs/langs/es_CL/admin.lang new file mode 100644 index 00000000000..20f6fdfea33 --- /dev/null +++ b/htdocs/langs/es_CL/admin.lang @@ -0,0 +1,23 @@ +Module20Name=Cotizaciones +Module20Desc=Gestión de cotizaciones/propuestas comerciales +Permission21=Consultar cotizaciones +Permission22=Crear/modificar cotizaciones +Permission24=Validar cotizaciones +Permission25=Enviar las cotizaciones +Permission26=Cerrar cotizaciones +Permission27=Eliminar cotizaciones +Permission28=Exportar las cotizaciones +DictionnarySource=Orígenes de cotizaciones/pedidos +VATIsUsedDesc=El tipo de IVA propuesto por defecto en las creaciones de cotizaciones, facturas, pedidos, etc. Responde a la siguiente regla:
Si el vendedor no está sujeto a IVA, IVA por defecto=0. Final de regla.
Si el país del vendedor= país del comprador entonces IVA por defecto=IVA del producto vendido. Final de regla.
Si vendedor y comprador residen en la Comunidad Europea y el bien vendido= nuevo medio de transportes (auto, barco, avión), IVA por defecto=0 (el IVA debe ser pagado por comprador a la hacienda pública de su país y no al vendedor). Final de regla
Si vendedor y comprador residen en la Comunidad Europea y comprador= particular o empresa sin NIF intracomunitario entonces IVA por defecto=IVA del producto vendido. Final de regla.
Si vendedor y comprador residen en la Comunidad Europea y comprador= empresa con NIF intracomunitario entonces IVA por defecto=0. Final de regla.
Si no, IVA propuesto por defecto=0. Final de regla.
+VATIsNotUsedDesc=El tipo de IVA propuesto por defecto es 0. Este es el caso de asociaciones, particulares o algunas pequeñas sociedades. +VATIsUsedExampleFR=En Francia, se trata de las sociedades u organismos que eligen un régimen fiscal general (General simplificado o General normal), régimen en el cual se declara el IVA. +Delays_MAIN_DELAY_PROPALS_TO_CLOSE=Tolerancia de retraso antes de la alerta (en días) sobre cotizaciones a cerrar +Delays_MAIN_DELAY_PROPALS_TO_BILL=Tolerancia de retraso antes de la alerta (en días) sobre cotizaciones no facturadas +WebCalAddEventOnStatusPropal=Añadir evento en el calendario en el cambio de estado de las cotizaciones +PropalSetup=Configuración del módulo Cotizaciones +ProposalsNumberingModules=Módulos de numeración de cotizaciones +ProposalsPDFModules=Modelos de documentos de cotizaciones +HideTreadedPropal=Ocultar las cotizaciones procesados del listado +FreeLegalTextOnProposal=Texto libre en cotizaciones +WatermarkOnDraftProposal=Marca de agua en cotizaciones borrador (en caso de estar vacío) +FCKeditorForProductDetails=Creación/edición WYSIWIG de las líneas de detalle de los productos (en pedidos, cotizaciones, facturas, etc.) \ No newline at end of file diff --git a/htdocs/langs/es_CL/agenda.lang b/htdocs/langs/es_CL/agenda.lang new file mode 100644 index 00000000000..deefdc2275c --- /dev/null +++ b/htdocs/langs/es_CL/agenda.lang @@ -0,0 +1,2 @@ +PropalValidatedInDolibarr=Cotización %s validada +ProposalSentByEMail=Cotización %s enviada por e-mail \ No newline at end of file diff --git a/htdocs/langs/es_CL/bills.lang b/htdocs/langs/es_CL/bills.lang new file mode 100644 index 00000000000..63a78444437 --- /dev/null +++ b/htdocs/langs/es_CL/bills.lang @@ -0,0 +1 @@ +RelatedCommercialProposals=Cotizaciones asociadas \ No newline at end of file diff --git a/htdocs/langs/es_CL/boxes.lang b/htdocs/langs/es_CL/boxes.lang new file mode 100644 index 00000000000..970c91a8fe5 --- /dev/null +++ b/htdocs/langs/es_CL/boxes.lang @@ -0,0 +1,5 @@ +BoxLastProposals=Últimas cotizaciones +BoxTitleLastPropals=Las %s últimas cotizaciones registradas +NoRecordedProposals=Sin cotizaciones registradas +BoxProposalsPerMonth=Cotizaciones por mes +ForProposals=Cotizaciones \ No newline at end of file diff --git a/htdocs/langs/es_CL/commercial.lang b/htdocs/langs/es_CL/commercial.lang new file mode 100644 index 00000000000..d468d7d5f19 --- /dev/null +++ b/htdocs/langs/es_CL/commercial.lang @@ -0,0 +1,4 @@ +SendPropalRef=Envío de la cotización %s +ActionAC_PROP=Envío cotización por correo +DraftPropals=Cotizaciones borrador +SearchPropal=Buscar una cotización \ No newline at end of file diff --git a/htdocs/langs/es_CL/companies.lang b/htdocs/langs/es_CL/companies.lang new file mode 100644 index 00000000000..daef89c75cf --- /dev/null +++ b/htdocs/langs/es_CL/companies.lang @@ -0,0 +1,2 @@ +ContactForProposals=Contacto de cotizaciones +NoContactForAnyProposal=Este contacto no es contacto de ninguna cotización \ No newline at end of file diff --git a/htdocs/langs/es_CL/compta.lang b/htdocs/langs/es_CL/compta.lang new file mode 100644 index 00000000000..bf18ae78c5f --- /dev/null +++ b/htdocs/langs/es_CL/compta.lang @@ -0,0 +1 @@ +ProposalStats=Estadísticas de cotizaciones \ No newline at end of file diff --git a/htdocs/langs/es_CL/ecm.lang b/htdocs/langs/es_CL/ecm.lang new file mode 100644 index 00000000000..3e20b3e6628 --- /dev/null +++ b/htdocs/langs/es_CL/ecm.lang @@ -0,0 +1,2 @@ +DocsProposals=Documentos cotizaciones +ECMDocsByProposals=Documentos asociados a cotizaciones \ No newline at end of file diff --git a/htdocs/langs/es_CL/install.lang b/htdocs/langs/es_CL/install.lang new file mode 100644 index 00000000000..40d447b8653 --- /dev/null +++ b/htdocs/langs/es_CL/install.lang @@ -0,0 +1 @@ +MigrationProposal=Migración de datos de cotizaciones \ No newline at end of file diff --git a/htdocs/langs/es_CL/main.lang b/htdocs/langs/es_CL/main.lang new file mode 100644 index 00000000000..90e98cca31d --- /dev/null +++ b/htdocs/langs/es_CL/main.lang @@ -0,0 +1 @@ +CommercialProposalsShort=Cotizaciones \ No newline at end of file diff --git a/htdocs/langs/es_CL/members.lang b/htdocs/langs/es_CL/members.lang new file mode 100644 index 00000000000..59fd53dd993 --- /dev/null +++ b/htdocs/langs/es_CL/members.lang @@ -0,0 +1 @@ +TurnoverOrBudget=Volumen de ventas (empresa) o Cotización (asociación o colectivo) \ No newline at end of file diff --git a/htdocs/langs/es_CL/orders.lang b/htdocs/langs/es_CL/orders.lang new file mode 100644 index 00000000000..8810a19bcf8 --- /dev/null +++ b/htdocs/langs/es_CL/orders.lang @@ -0,0 +1 @@ +OrderSource0=Cotización \ No newline at end of file diff --git a/htdocs/langs/es_CL/other.lang b/htdocs/langs/es_CL/other.lang new file mode 100644 index 00000000000..f2b10a1a2d2 --- /dev/null +++ b/htdocs/langs/es_CL/other.lang @@ -0,0 +1,9 @@ +Notify_PROPAL_VALIDATE=Validación cotización cliente +Notify_PROPAL_SENTBYMAIL=Envío cotización por e-mail +PredefinedMailContentSendProposal=Buenos días, __CONTACTCIVNAME__ \n\n Nos ponemos en contacto con usted para facilitarle la cotización __PROPREF__\n\n Ante cualquier duda, consúltenos y será atendido a la mayor brevedad posible.\n\n __PERSONALIZED__Cordialmente\n\n__SIGNATURE__ +NumberOfProposals=Número de cotizaciones en los últimos 12 meses +NumberOfUnitsProposals=Número de unidades en las cotizaciones en los últimos 12 meses +EMailTextProposalValidated=La cotización %s que le concierne ha sido validado. +PropalClosedSignedInDolibarr=Cotización %s firmada en Dolibarr +PropalClosedRefusedInDolibarr=Cotización %s rechazada en Dolibarr +PropalValidatedInDolibarr=Cotización %s validada en Dolibarr \ No newline at end of file diff --git a/htdocs/langs/es_CL/products.lang b/htdocs/langs/es_CL/products.lang new file mode 100644 index 00000000000..cf82ea19c2b --- /dev/null +++ b/htdocs/langs/es_CL/products.lang @@ -0,0 +1,3 @@ +AddToMyProposals=Añadir a mis cotizaciones +AddToOtherProposals=Añadir a otras cotizaciones +NoteNotVisibleOnBill=Nota (no visible en las facturas, cotizaciones, etc.) \ No newline at end of file diff --git a/htdocs/langs/es_CL/projects.lang b/htdocs/langs/es_CL/projects.lang new file mode 100644 index 00000000000..a5ee33a39a4 --- /dev/null +++ b/htdocs/langs/es_CL/projects.lang @@ -0,0 +1 @@ +ListProposalsAssociatedProject=Listado de cotizaciones asociadas al proyecto \ No newline at end of file diff --git a/htdocs/langs/es_CL/propal.lang b/htdocs/langs/es_CL/propal.lang new file mode 100644 index 00000000000..8242c7d90a4 --- /dev/null +++ b/htdocs/langs/es_CL/propal.lang @@ -0,0 +1,62 @@ +Proposals=Cotizaciones +Proposal=Cotización +ProposalShort=Cotización +ProposalsDraft=Cotizaciones borrador +ProposalDraft=Cotización borrador +ProposalsOpened=Cotizaciones abiertas +Prop=Cotizaciones +CommercialProposal=Cotización +CommercialProposals=Cotizaciones +ProposalCard=Ficha cotización +NewProp=Nueva cotización +NewProposal=Nueva cotización +NewPropal=Nueva cotización +DeletePop=Eliminar cotización +ValidateProp=Validar cotización +AddProp=Crear cotización +ConfirmDeleteProp=¿Está seguro de querer eliminar esta cotización? +ConfirmValidateProp=¿Está seguro de querer validar esta cotización bajo la referencia %s ? +LastClosedProposals=Las %s últimas cotizaciones cerradas +LastModifiedProposals=Las %s últimas cotizaciones modificadas +AllPropals=Todas las cotizacioness +LastProposals=Últimas cotizaciones +SearchAProposal=Buscar una cotización +ProposalsStatistics=Estadísticas de cotizaciones +NumberOfUnitsProposals=Número de unidades en las cotizaciones en los últimos 12 meses +NbOfProposals=Número cotizaciones +ShowPropal=Ver cotización +PropalStatusValidated=Validado (cotización abierta) +PropalStatusOpened=Validado (cotización abierta) +PropalsToClose=Cotizaciones a cerrar +PropalsToBill=Cotizaciones firmadas a facturar +ListOfProposals=Listado de cotizaciones +ActionsOnPropal=Eventos sobre la cotización +NoOpenedPropals=Sin cotizaciones abiertos +NoOtherOpenedPropals=Ninguna otra cotización abierta +RefProposal=Ref. cotización +SendPropalByMail=Enviar cotización por e-mail +AssociatedDocuments=Documentos asociados a la cotizacion +DatePropal=Fecha cotización +ErrorPropalNotFound=Presupuesto %s inexistente +Estimate=Cotización: +EstimateShort=Cotización +OtherPropals=Otras cotizaciones +AddToDraftProposals=Añadir a cotización borrador +NoDraftProposals=Sin cotizaciones borrador +CopyPropalFrom=Crear cotización por copia de una existente +CreateEmptyPropal=Crear cotización vacía +UseCustomerContactAsPropalRecipientIfExist=Utilizar dirección contacto de seguimiento de cliente definido en vez de la dirección del tercero como destinatario de las cotizaciones +ClonePropal=Clonar cotización +ConfirmClonePropal=¿Está seguro de querer clonar la cotización %s? +ConfirmReOpenProp=¿Está seguro de querer reabrir la cotización %s ? +ProposalsAndProposalsLines=Cotizaciones a clientes y líneas de cotizaciones +ProposalLine=Línea de cotización +##### Types de contacts ##### +TypeContact_propal_internal_SALESREPFOLL=Comercial seguimiento cotización +TypeContact_propal_external_BILLING=Contacto cliente de facturación cotización +TypeContact_propal_external_CUSTOMER=Contacto cliente seguimiento cotización +# Document models +DocModelAzurDescription=Modelo de cotización completa (logo...) +DocModelJauneDescription=Modelo de cotización Jaune +DefaultModelPropalToBill=Modelo por defecto al cerrar una cotización (a facturar) +DefaultModelPropalClosed=Modelo por defecto al cerrar una cotización (no facturado) \ No newline at end of file diff --git a/htdocs/langs/es_CL/workflow.lang b/htdocs/langs/es_CL/workflow.lang new file mode 100644 index 00000000000..17b2915fc39 --- /dev/null +++ b/htdocs/langs/es_CL/workflow.lang @@ -0,0 +1,3 @@ +descWORKFLOW_PROPAL_AUTOCREATE_ORDER=Crear un pedido de cliente automáticamente a la firma de una cotización +descWORKFLOW_PROPAL_AUTOCREATE_INVOICE=Crear una factura a cliente automáticamente a la firma de una cotización +descWORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL=Clasificar como facturada la cotización cuando el pedido de cliente relacionado se clasifique como pagado \ No newline at end of file From c8f63d6160b0c1b43e24b36616b82ef203b6e9e6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 14 Mar 2014 00:17:39 +0100 Subject: [PATCH 02/21] Fix: Prepare for 3.5.2 --- build/debian/changelog | 7 +++++++ build/doxygen/dolibarr-doxygen.doxyfile | 2 +- build/exe/doliwamp/doliwamp.iss | 4 ++-- build/perl/virtualmin/dolibarr.pl | 2 +- build/rpm/dolibarr_fedora.spec | 3 +++ build/rpm/dolibarr_generic.spec | 3 +++ build/rpm/dolibarr_mandriva.spec | 3 +++ build/rpm/dolibarr_opensuse.spec | 3 +++ htdocs/filefunc.inc.php | 2 +- 9 files changed, 24 insertions(+), 5 deletions(-) diff --git a/build/debian/changelog b/build/debian/changelog index d07e7616ca2..a29f1b001f1 100644 --- a/build/debian/changelog +++ b/build/debian/changelog @@ -1,3 +1,10 @@ +dolibarr (3.5.2-3) unstable; urgency=low + + [ Laurent Destailleur (eldy) ] + * New upstream release. + + -- Laurent Destailleur (eldy) Fri, 14 March 2014 12:00:00 +0100 + dolibarr (3.5.1-3) unstable; urgency=low [ Laurent Destailleur (eldy) ] diff --git a/build/doxygen/dolibarr-doxygen.doxyfile b/build/doxygen/dolibarr-doxygen.doxyfile index 9c94d9db2ae..29c36793cfd 100644 --- a/build/doxygen/dolibarr-doxygen.doxyfile +++ b/build/doxygen/dolibarr-doxygen.doxyfile @@ -31,7 +31,7 @@ PROJECT_NAME = dolibarr # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 3.5.1 +PROJECT_NUMBER = 3.5.2 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss index 0db49fddac7..4ecf52cfb12 100644 --- a/build/exe/doliwamp/doliwamp.iss +++ b/build/exe/doliwamp/doliwamp.iss @@ -17,9 +17,9 @@ ; ----- Change this ----- AppName=DoliWamp ; DoliWamp-x.x.x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x -AppVerName=DoliWamp-3.5.1 +AppVerName=DoliWamp-3.5.2 ; DoliWamp-x.x x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x -OutputBaseFilename=DoliWamp-3.5.1 +OutputBaseFilename=DoliWamp-3.5.2 ; ----- End of change ;OutputManifestFile=build\doliwampbuild.log ; Define full path from which all relative path are defined diff --git a/build/perl/virtualmin/dolibarr.pl b/build/perl/virtualmin/dolibarr.pl index a9ef68da0c5..1cd5d1e3b54 100644 --- a/build/perl/virtualmin/dolibarr.pl +++ b/build/perl/virtualmin/dolibarr.pl @@ -30,7 +30,7 @@ return "Regis Houssin"; # script_dolibarr_versions() sub script_dolibarr_versions { -return ( "3.5.1", "3.5.0", "3.4.1", "3.4.0", "3.3.3", "3.3.2", "3.3.1", "3.3.0", "3.2.1", "3.1.1" ); +return ( "3.5.2", "3.5.1", "3.5.0", "3.4.1", "3.4.0", "3.3.3", "3.3.2", "3.3.1", "3.3.0", "3.2.1", "3.1.1" ); } sub script_dolibarr_category diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index 9dfcdb4aa98..20252507a9e 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -330,6 +330,9 @@ fi # version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release %changelog +* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3 +- Upstream release + * Fri Feb 7 2014 Laurent Destailleur 3.5.1-0.3 - Upstream release diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index 0b37ce61d88..8a9d4de92fb 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -558,6 +558,9 @@ fi # version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release %changelog +* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3 +- Upstream release + * Fri Feb 7 2014 Laurent Destailleur 3.5.1-0.3 - Upstream release diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index 923b5924f2d..74eb9d8c6db 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -335,6 +335,9 @@ fi # version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release %changelog +* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3 +- Upstream release + * Fri Feb 7 2014 Laurent Destailleur 3.5.1-0.3 - Upstream release diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index 93525e334f0..ae1f1668bd5 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -345,6 +345,9 @@ fi # version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release %changelog +* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3 +- Upstream release + * Fri Feb 7 2014 Laurent Destailleur 3.5.1-0.3 - Upstream release diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index daf4ddbdcfd..3a23aa79ad1 100755 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -29,7 +29,7 @@ * \brief File that include conf.php file and commons lib like functions.lib.php */ -if (! defined('DOL_VERSION')) define('DOL_VERSION','3.5.1'); +if (! defined('DOL_VERSION')) define('DOL_VERSION','3.5.2'); if (! defined('EURO')) define('EURO',chr(128)); // Define syslog constants From 561a1a1aacf1541b4245c04c4f8a9a98dd3f2177 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 14 Mar 2014 02:07:54 +0100 Subject: [PATCH 03/21] Fix: Miscellaneous problems on task tabs (withproject parameter lost and download fails). --- htdocs/core/class/html.formfile.class.php | 36 ++++++++++--------- .../tpl/document_actions_post_headers.tpl.php | 13 +++---- .../tpl/document_actions_pre_headers.tpl.php | 2 +- htdocs/projet/document.php | 3 +- htdocs/projet/tasks/document.php | 7 ++-- 5 files changed, 33 insertions(+), 28 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 1319ad766d0..5317d49c23c 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -764,8 +764,9 @@ class FormFile if (empty($relativepath)) { $relativepath=(! empty($object->ref)?dol_sanitizeFileName($object->ref):'').'/'; - if ($object->element == 'invoice_supplier') $relativepath=get_exdir($object->id,2).$relativepath; - if ($object->element == 'member') $relativepath=get_exdir($object->id,2).$relativepath; + if ($object->element == 'invoice_supplier') $relativepath=get_exdir($object->id,2).$relativepath; // TODO Call using a defined value for $relativepath + if ($object->element == 'member') $relativepath=get_exdir($object->id,2).$relativepath; // TODO Call using a defined value for $relativepath + if ($object->element == 'project_task') $relativepath='Call_not_supported_._Call_function_using_a_defined_relative_path_.'; } $var=!$var; @@ -1052,9 +1053,10 @@ class FormFile * @param int $permtodelete Deletion is allowed * @param string $action Action * @param string $selected ??? + * @param string $param More param to add into URL * @return int Number of links */ - public function listOfLinks($object, $permtodelete=1, $action=null, $selected=null) + public function listOfLinks($object, $permtodelete=1, $action=null, $selected=null, $param='') { global $user, $conf, $langs, $user; global $bc; @@ -1071,17 +1073,17 @@ class FormFile $sortfield = null; } $res = $link->fetchAll($links, $object->element, $object->id, $sortfield, $sortorder); - $param = (isset($object->id)?'&id=' . $object->id : ''); + $param .= (isset($object->id)?'&id=' . $object->id : ''); // Show list of associated links print_titre($langs->trans("LinkedFiles")); - print '
'; + print ''; print ''; print ''; print_liste_field_titre( - $langs->trans("Documents2"), + $langs->trans("Links"), $_SERVER['PHP_SELF'], "name", "", @@ -1135,34 +1137,34 @@ class FormFile print ''; print $langs->trans('Link') . ': '; print ''; - print ''; print ''; print ''; - print ''; } - else { + else + { print '\n"; + print ''."\n"; print ''; print ''; print ''; print '"; + print ''; } print "\n"; } diff --git a/htdocs/core/tpl/document_actions_post_headers.tpl.php b/htdocs/core/tpl/document_actions_post_headers.tpl.php index 2ae7b9ad595..a662bd5be3d 100644 --- a/htdocs/core/tpl/document_actions_post_headers.tpl.php +++ b/htdocs/core/tpl/document_actions_post_headers.tpl.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013 Laurent Destailleur +/* Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2013-2014 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 @@ -18,16 +18,17 @@ */ $langs->load("link"); +if (empty($relativepathwithnofile)) $relativepathwithnofile=''; /* - * Confirm suppression + * Confirm form to delete */ if ($action == 'delete') { $langs->load("companies"); // Need for string DeleteFile+ConfirmDeleteFiles $ret = $form->form_confirm( - $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode(GETPOST("urlfile")) . '&linkid=' . GETPOST('linkid', 'int'), + $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode(GETPOST("urlfile")) . '&linkid=' . GETPOST('linkid', 'int') . (empty($param)?'':$param), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', @@ -58,11 +59,11 @@ $formfile->list_of_documents( $modulepart, $param, 0, - '', + $relativepathwithnofile, // relative path with no file. For example "moduledir/0/1" $permission ); print "
"; //List of links -$formfile->listOfLinks($object, $permission, $action, GETPOST('linkid', 'int')); +$formfile->listOfLinks($object, $permission, $action, GETPOST('linkid', 'int'), $param); print "
"; diff --git a/htdocs/core/tpl/document_actions_pre_headers.tpl.php b/htdocs/core/tpl/document_actions_pre_headers.tpl.php index 989a3bcaf73..ca6929331ec 100644 --- a/htdocs/core/tpl/document_actions_pre_headers.tpl.php +++ b/htdocs/core/tpl/document_actions_pre_headers.tpl.php @@ -74,7 +74,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') setEventMessage($langs->trans("ErrorFailedToDeleteLink", $link->label), 'errors'); } } - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); + header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id.($withproject?'&withproject=1':'')); exit; } } diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php index 89fc9549156..8d545bf1e6a 100644 --- a/htdocs/projet/document.php +++ b/htdocs/projet/document.php @@ -144,9 +144,8 @@ if ($object->id > 0) print "
'; + print ''; print $langs->trans('Label') . ': '; print '' . dol_print_date(dol_now(), "dayhour", "tzuser") . ''; - print ''; + print ''; + print ''; + print ''; print ''; - print ''; + print ''; print $link->label; print ''; - print "' . dol_print_date($link->datea, "dayhour", "tzuser") . ''; - print '' . img_edit().''; + print '' . img_edit() . ''; // id= is included into $param if ($permtodelete) { - print '   ' . img_delete() . ''; + print '   ' . img_delete() . ''; // id= is included into $param } else { print ' '; } - print "
\n"; print "\n"; - $modulepart = 'projet'; + $modulepart = 'project'; $permission = ($userWrite > 0); - $param = '&id=' . $object->id; include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; } diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 8dd80223e6c..0b876d0490a 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -110,6 +110,7 @@ if ($id > 0 || ! empty($ref)) include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php'; + /* * View */ @@ -229,9 +230,11 @@ if ($object->id > 0) print '
'; - $modulepart = 'projet'; + $param=''; + if ($withproject) $param .= '&withproject=1'; + $modulepart = 'project_task'; $permission = $user->rights->projet->creer; - $param = '&id=' . $object->id; + $relativepathwithnofile=dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref).'/'; include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; } else From f9c48be2a91e160921ed8a4ac33af727eeb36e9b Mon Sep 17 00:00:00 2001 From: philippe grand Date: Fri, 14 Mar 2014 18:23:37 +0100 Subject: [PATCH 04/21] fix : display specimen --- .../modules/contract/doc/pdf_strato.modules.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 6976754285a..353b77ffaf7 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -116,15 +116,24 @@ class pdf_strato extends ModelePDFContract $outputlangs->load("dict"); $outputlangs->load("companies"); $outputlangs->load("contracts"); + $outputlangs->load("interventions"); if ($conf->contrat->dir_output) { $object->fetch_thirdparty(); - $objectref = dol_sanitizeFileName($object->ref); - $dir = $conf->contrat->dir_output; - if (! preg_match('/specimen/i',$objectref)) $dir.= "/" . $objectref; - $file = $dir . "/" . $objectref . ".pdf"; + // Definition of $dir and $file + if ($object->specimen) + { + $dir = $conf->contrat->dir_output; + $file = $dir . "/SPECIMEN.pdf"; + } + else + { + $objectref = dol_sanitizeFileName($object->ref); + $dir = $conf->contrat->dir_output . "/" . $objectref; + $file = $dir . "/" . $objectref . ".pdf"; + } if (! file_exists($dir)) { From e7791a3ade56b8a642d298070537765e66640c61 Mon Sep 17 00:00:00 2001 From: bouna Date: Fri, 14 Mar 2014 19:46:36 +0100 Subject: [PATCH 05/21] Update list.php to save the town filtre on prospect list, just i replace: $param='&stcomm='.$stcomm.'&search_nom='.urlencode($search_nom).'&search_zipcode='.urlencode($search_zipcode).'&search_ville ='.urlencode($search_ville ); search_ville by search_town --- htdocs/comm/prospect/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/prospect/list.php b/htdocs/comm/prospect/list.php index 43a800dec76..f0f58df9a08 100644 --- a/htdocs/comm/prospect/list.php +++ b/htdocs/comm/prospect/list.php @@ -241,7 +241,7 @@ if ($resql) llxHeader('',$langs->trans("ThirdParty"),$help_url); } - $param='&stcomm='.$stcomm.'&search_nom='.urlencode($search_nom).'&search_zipcode='.urlencode($search_zipcode).'&search_ville='.urlencode($search_ville); + $param='&stcomm='.$stcomm.'&search_nom='.urlencode($search_nom).'&search_zipcode='.urlencode($search_zipcode).'&search_town='.urlencode($search_town); // Store the status filter in the URL if (isSet($search_cstc)) { From 3f6b319d4107168b239d0c8d0dcf58eaaddc547f Mon Sep 17 00:00:00 2001 From: Florian Henry Date: Fri, 14 Mar 2014 23:42:45 +0100 Subject: [PATCH 06/21] Fix deposit invoice --- htdocs/compta/facture.php | 16 ++++++++-------- htdocs/compta/facture/class/facture.class.php | 4 ++-- htdocs/core/class/discount.class.php | 2 +- htdocs/core/modules/modSociete.class.php | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 059d8dffd4a..f8655c7c850 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -584,7 +584,7 @@ else if ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $user->righ $object->fetch_thirdparty(); $object->fetch_lines(); - if (! $object->paye) // protection against multiple submit + if (!empty($object->paye)) // protection against multiple submit { // Boucle sur chaque taux de tva $i=0; @@ -601,8 +601,7 @@ else if ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $user->righ if ($object->type == 2) $discount->description='(CREDIT_NOTE)'; elseif ($object->type == 3) $discount->description='(DEPOSIT)'; else { - $this->error="CantConvertToReducAnInvoiceOfThisType"; - return -1; + setEventMessage($langs->trans('CantConvertToReducAnInvoiceOfThisType'),'errors'); } $discount->tva_tx=abs($object->total_ttc); $discount->fk_soc=$object->socid; @@ -617,6 +616,7 @@ else if ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $user->righ $discount->tva_tx=abs($tva_tx); $result=$discount->create($user); + if ($result < 0) { $error++; @@ -624,24 +624,24 @@ else if ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $user->righ } } - if (! $error) + if (empty($error)) { // Classe facture $result=$object->set_paid($user); - if ($result > 0) + if ($result >= 0) { //$mesgs[]='OK'.$discount->id; $db->commit(); } else { - $mesgs[]='
'.$object->error.'
'; + setEventMessage($object->error,'errors'); $db->rollback(); } } else { - $mesgs[]='
'.$discount->error.'
'; + setEventMessage($discount->error,'errors'); $db->rollback(); } } @@ -3687,7 +3687,7 @@ else if ($id > 0 || ! empty($ref)) print ''; } // For deposit invoice - if ($object->type == 3 && $object->statut == 1 && $resteapayer == 0 && $user->rights->facture->creer) + if ($object->type == 3 && $object->statut == 2 && $resteapayer == 0 && $user->rights->facture->creer && empty($discount->id)) { print ''; } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 53adade47ab..76b54bbe613 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1471,6 +1471,7 @@ class Facture extends CommonInvoice if ($close_note) $sql.= ", close_note='".$this->db->escape($close_note)."'"; $sql.= ' WHERE rowid = '.$this->id; + dol_syslog(get_class($this)."::set_paid sql=".$sql, LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -1486,8 +1487,7 @@ class Facture extends CommonInvoice else { $error++; - $this->error=$this->db->error(); - dol_print_error($this->db); + $this->error=$this->db->lasterror(); } if (! $error) diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index 468530303b8..ede7615a65a 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -154,7 +154,7 @@ class DiscountAbsolute $sql.= " amount_ht, amount_tva, amount_ttc, tva_tx,"; $sql.= " fk_facture_source"; $sql.= ")"; - $sql.= " VALUES (".$this->db->idate($this->datec!=''?$this->datec:dol_now()).", ".$this->fk_soc.", ".$user->id.", '".$this->db->escape($this->description)."',"; + $sql.= " VALUES ('".$this->db->idate($this->datec!=''?$this->datec:dol_now())."', ".$this->fk_soc.", ".$user->id.", '".$this->db->escape($this->description)."',"; $sql.= " ".$this->amount_ht.", ".$this->amount_tva.", ".$this->amount_ttc.", ".$this->tva_tx.","; $sql.= " ".($this->fk_facture_source?"'".$this->fk_facture_source."'":"null"); $sql.= ")"; diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 28d83897b37..ea3be87aaee 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -270,7 +270,7 @@ class modSociete extends DolibarrModules $this->export_TypeFields_array[$r]=array('s.nom'=>"Text",'s.status'=>"Number",'s.client'=>"Boolean",'s.fournisseur'=>"Boolean",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text",'s.code_compta'=>"Text",'s.code_compta_fournisseur'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'p.libelle'=>"List:c_pays:libelle:libelle",'p.code'=>"Text",'s.phone'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.default_lang'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.idprof5'=>"Text",'s.idprof6'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Number",'s.note_private'=>"Text",'s.note_public'=>"Text",'t.libelle'=>"Text",'ce.code'=>"List:c_effectif:libelle:code","cfj.libelle"=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code','st.code'=>'List:c_stcomm:libelle:code','d.nom'=>'Text'); $this->export_entities_array[$r]=array(); // We define here only fields that use another picto // Add extra fields - $sql="SELECT name, label, type FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'societe'"; + $sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'societe'"; $resql=$this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) { From 1cb71674d70d58da1515e67c17e82126fd69679e Mon Sep 17 00:00:00 2001 From: kaos Date: Sat, 15 Mar 2014 11:06:50 +0100 Subject: [PATCH 07/21] fixes #1300 --- htdocs/holiday/fiche.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/fiche.php b/htdocs/holiday/fiche.php index 01c2e1fb5a1..959811aa5a2 100644 --- a/htdocs/holiday/fiche.php +++ b/htdocs/holiday/fiche.php @@ -1039,7 +1039,7 @@ else $idGroupValid = $cp->getConfCP('userGroup'); $validator = new UserGroup($db,$idGroupValid); - $valideur = $validator->listUsersForGroup(); + $valideur = $validator->listUsersForGroup(,'',1); print ''; $form->select_users($cp->fk_validator,"valideur",1,"",0,$valideur,''); From f55bdc64bd03d708f2d5731bad721de587baa979 Mon Sep 17 00:00:00 2001 From: kaos Date: Sat, 15 Mar 2014 11:10:20 +0100 Subject: [PATCH 08/21] fixes #1300 --- htdocs/holiday/fiche.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/fiche.php b/htdocs/holiday/fiche.php index 959811aa5a2..0ff0194d5cf 100644 --- a/htdocs/holiday/fiche.php +++ b/htdocs/holiday/fiche.php @@ -1039,7 +1039,7 @@ else $idGroupValid = $cp->getConfCP('userGroup'); $validator = new UserGroup($db,$idGroupValid); - $valideur = $validator->listUsersForGroup(,'',1); + $valideur = $validator->listUsersForGroup('',1); print ''; $form->select_users($cp->fk_validator,"valideur",1,"",0,$valideur,''); From 4db8af8a53ef0cf093e18d884727c189fc243038 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 15 Mar 2014 15:10:03 +0100 Subject: [PATCH 09/21] Fix: sql syntax error with pgsql --- scripts/contracts/email_expire_services_to_representatives.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/contracts/email_expire_services_to_representatives.php b/scripts/contracts/email_expire_services_to_representatives.php index 76489bebcf2..da16a328bcf 100755 --- a/scripts/contracts/email_expire_services_to_representatives.php +++ b/scripts/contracts/email_expire_services_to_representatives.php @@ -75,7 +75,7 @@ print $script_file." launched with mode ".$mode." default lang=".$langs->default if ($mode != 'confirm') $conf->global->MAIN_DISABLE_ALL_MAILS=1; -$sql = "SELECT DISTINCT c.ref, c.fk_soc, cd.date_fin_validite, cd.total_ttc, cd.description as description, p.label as plabel, s.nom as name, s.email, s.default_lang,"; +$sql = "SELECT DISTINCT c.ref, c.fk_soc, cd.date_fin_validite, cd.total_ttc, cd.description as description, p.label as plabel, s.rowid, s.nom as name, s.email, s.default_lang,"; $sql.= " u.rowid as uid, u.lastname, u.firstname, u.email, u.lang"; $sql.= " FROM ".MAIN_DB_PREFIX."societe AS s, ".MAIN_DB_PREFIX."contrat AS c, ".MAIN_DB_PREFIX."contratdet AS cd"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product AS p ON p.rowid = cd.fk_product, ".MAIN_DB_PREFIX."societe_commerciaux AS sc, ".MAIN_DB_PREFIX."user AS u"; From 18c4d890ddc468681f6cbffe4baad3f9d22c7bb3 Mon Sep 17 00:00:00 2001 From: Florian Henry Date: Sat, 15 Mar 2014 16:32:46 +0100 Subject: [PATCH 10/21] Fix [ bug #1283 ] ROUGET Shipment PDF --- htdocs/core/modules/expedition/doc/pdf_rouget.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 4394c3200f5..66f36e1b84f 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -240,7 +240,7 @@ class pdf_rouget extends ModelePdfExpedition $pageposbefore=$pdf->getPage(); // Description de la ligne produit - pdf_writelinedesc($pdf,$object,$i,$outputlangs,150,3,$this->posxdesc,$curY,0,1); + pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxqtyordered-10,3,$this->posxdesc,$curY,0,1); $nexY = $pdf->GetY(); $pageposafter=$pdf->getPage(); From 76256294913cd6e515d66f1bef48cdb37cf2f1ad Mon Sep 17 00:00:00 2001 From: Florian Henry Date: Sat, 15 Mar 2014 16:40:29 +0100 Subject: [PATCH 11/21] Fix [ bug #1294 ] Expedition model Merou having problems with long names --- htdocs/core/modules/expedition/doc/pdf_merou.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index c5662089e9e..fc3bd6281eb 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -474,7 +474,7 @@ class pdf_merou extends ModelePdfExpedition else { $text=$this->emetteur->name; - $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($text), 0, 'L'); + $pdf->MultiCell(70, 3, $outputlangs->convToOutputCharset($text), 0, 'L'); } //*********************Entete**************************** From 997e16fec7e171299dec07bd75dde66b8371cc57 Mon Sep 17 00:00:00 2001 From: Drosis Nikos Date: Sat, 15 Mar 2014 15:23:41 +0200 Subject: [PATCH 12/21] Update user.class.php String translated twice --- htdocs/user/class/user.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 25fc77311ac..62e7f792d66 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1496,7 +1496,7 @@ class User extends CommonObject $outputlangs->load("users"); $outputlangs->load("other"); - $subject = $outputlangs->trans("SubjectNewPassword"); + $subject = $outputlangs->transnoentitiesnoconv("SubjectNewPassword"); // Define $urlwithroot //$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); From ed4f7fd0837cbf4ac749dc874f593dd4488addf2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 16 Mar 2014 20:05:07 +0100 Subject: [PATCH 13/21] Fix: error --- htdocs/core/modules/DolibarrModules.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 62a54437cd6..be498b04413 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -114,7 +114,7 @@ abstract class DolibarrModules $sql=str_replace('__ENTITY__', $conf->entity, $sql); dol_syslog(get_class($this)."::_init ignoreerror=".$ignoreerror." sql=".$sql, LOG_DEBUG); - $result=$this->db->query($sql); + $result=$this->db->query($sql, $ignoreerror); if (! $result) { if (! $ignoreerror) From eb43bc4982ef3cb131ad948649028d686c4f9b1a Mon Sep 17 00:00:00 2001 From: Gauthier Date: Mon, 17 Mar 2014 15:38:12 +0100 Subject: [PATCH 14/21] Correction when adding line with price as '0' --- htdocs/fourn/commande/fiche.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index add5090e081..73a62207af1 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -219,8 +219,9 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer) setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), 'errors'); $error++; } - if (! GETPOST('addline_predefined') && (! GETPOST('pu') || GETPOST('pu')=='')) // Unit price can be 0 but not '' + if (! GETPOST('addline_predefined') && ( GETPOST('pu')==='')) // Unit price can be 0 but not '' { + setEventMessage($langs->trans($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('UnitPrice'))), 'errors'); $error++; } @@ -239,7 +240,7 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer) // Ecrase $pu par celui du produit // Ecrase $desc par celui du produit // Ecrase $txtva par celui du produit - if (GETPOST('addline_predefined') || GETPOST('idprodfournprice')) // With combolist idprodfournprice is > 0 or -1. With autocomplete, idprodfournprice is > 0 or '' + if ((GETPOST('addline_predefined') || GETPOST('idprodfournprice')) && ( GETPOST('pu')!=='')) // With combolist idprodfournprice is > 0 or -1. With autocomplete, idprodfournprice is > 0 or '' { $idprod=0; $productsupplier = new ProductFournisseur($db); @@ -299,7 +300,7 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer) setEventMessage($langs->trans("ErrorQtyTooLowForThisSupplier"), 'errors'); } } - else + else if( GETPOST('pu')!=='' || GETPOST('amountttc')!=='' ) { $type=$_POST["type"]; $desc=$_POST['dp_desc']; @@ -326,7 +327,7 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer) $ttc = price2num($_POST['amountttc']); $ht = $ttc / (1 + ($tauxtva / 100)); $price_base_type = 'HT'; - $result=$object->addline($desc, $ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, '', $remise_percent, $price_base_type, $ttc, $type); + $result=$object->addline($desc, $ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, '', $remise_percent, $price_base_type, $ttc, $type); } } } From ada22837a5188c2f1ec3fa79e0256d33a943e7ed Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Mar 2014 22:24:57 +0100 Subject: [PATCH 15/21] Fix: form to add images should not show link form --- htdocs/product/photos.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/photos.php b/htdocs/product/photos.php index 864b36c3149..34a2e836599 100644 --- a/htdocs/product/photos.php +++ b/htdocs/product/photos.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2009 Laurent Destailleur + * Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2005 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * @@ -162,7 +162,7 @@ if ($object->id) { // Affiche formulaire upload $formfile=new FormFile($db); - $formfile->form_attach_new_file($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("AddPhoto"), 1, 0, 1, 50, $object, '', false); // ajax=false for the moment. true may not work. + $formfile->form_attach_new_file($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("AddPhoto"), 1, 0, ($user->rights->produit->creer || $user->rights->service->creer), 50, $object, '', false, '', 0); // ajax=false for the moment. true may not work. } // Affiche photos From a05ea581813f7e3abd59c516f7152e992cd47e99 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Mar 2014 00:41:56 +0100 Subject: [PATCH 16/21] Fix: form to add images should not show link form --- htdocs/categories/photos.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index bbffe5865d3..1a71005ab8e 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -209,7 +209,7 @@ if ($object->id) { // Affiche formulaire upload $formfile=new FormFile($db); - $formfile->form_attach_new_file($_SERVER['PHP_SELF'].'?id='.$object->id.'&type='.$type,$langs->trans("AddPhoto"),1); + $formfile->form_attach_new_file($_SERVER['PHP_SELF'].'?id='.$object->id.'&type='.$type, $langs->trans("AddPhoto"), 1, '', $user->rights->categorie->creer, 50, $object, '', false, '', 0); } // Affiche photos From dbaea6fa423c3f72c2d554c885379662b1819ae2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 Mar 2014 11:40:23 +0100 Subject: [PATCH 17/21] Add clean sql requests into repair.sql --- htdocs/install/mysql/migration/repair.sql | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index e656799eb1f..0495171a9d0 100644 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -6,6 +6,11 @@ -- Requests to clean corrupted database +-- delete foreign key that should never exists +ALTER TABLE llx_propal DROP FOREIGN KEY fk_propal_fk_currency; +ALTER TABLE llx_commande DROP FOREIGN KEY fk_commande_fk_currency; +ALTER TABLE llx_facture DROP FOREIGN KEY fk_facture_fk_currency; + delete from llx_facturedet where fk_facture in (select rowid from llx_facture where facnumber in ('(PROV)','ErrorBadMask')); delete from llx_facture where facnumber in ('(PROV)','ErrorBadMask'); delete from llx_commandedet where fk_commande in (select rowid from llx_commande where ref in ('(PROV)','ErrorBadMask')); From bf735cacbe031c8a0a7d2095fb8ec8fafe93720a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 Mar 2014 13:32:54 +0100 Subject: [PATCH 18/21] Fix PDF: Page break was ko when breaking 2 pages or more. Fix PDF: pdf_canelle was missing code to manage pagebreak. Fix PDF: The width of picture was hardcoded into some templates. Fix PDF: The atleastonediscount was not used into some templates. --- .../commande/doc/pdf_einstein.modules.php | 19 ++++-- .../commande/doc/pdf_proforma.modules.php | 15 ++++- .../modules/facture/doc/pdf_crabe.modules.php | 17 ++++-- .../livraison/pdf/pdf_typhon.modules.php | 31 ++++++---- .../modules/propale/doc/pdf_azur.modules.php | 22 +++++-- .../pdf/pdf_canelle.modules.php | 59 ++++++++++++++++--- .../pdf/pdf_muscadet.modules.php | 15 ++++- 7 files changed, 138 insertions(+), 40 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 0126edd78d4..835a9ffa43b 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Raphael Bertrand * Copyright (C) 2010-2013 Juanjo Menent @@ -109,7 +109,7 @@ class pdf_einstein extends ModelePDFCommandes $this->posxdiscount=162; $this->postotalht=174; if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; - $this->posxpicture=$this->posxtva - 16; // width of images + $this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?16:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images if ($this->page_largeur < 210) // To work with US executive format { $this->posxpicture-=20; @@ -153,7 +153,7 @@ class pdf_einstein extends ModelePDFCommandes $outputlangs->load("products"); $outputlangs->load("orders"); $outputlangs->load("deliveries"); - + if ($conf->commande->dir_output) { $object->fetch_thirdparty(); @@ -228,6 +228,15 @@ class pdf_einstein extends ModelePDFCommandes $this->atleastonediscount++; } } + if (empty($this->atleastonediscount)) + { + $this->posxpicture+=($this->postotalht - $this->posxdiscount); + $this->posxtva+=($this->postotalht - $this->posxdiscount); + $this->posxup+=($this->postotalht - $this->posxdiscount); + $this->posxqty+=($this->postotalht - $this->posxdiscount); + $this->posxdiscount+=($this->postotalht - $this->posxdiscount); + //$this->postotalht; + } // New page $pdf->AddPage(); @@ -304,7 +313,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->AddPage('','',true); if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); - $pdf->setPage($pagenb+1); + $pdf->setPage($pageposafter+1); } } else @@ -589,7 +598,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetFont('','B', $default_font_size - 2); $text=$outputlangs->transnoentities("DeliveryDate").':'; $pdf->MultiCell(80, 3, $text, 0, 'L', 0); - + $pdf->SetFont('','', $default_font_size - 2); $pdf->SetXY($posxval, $posy); $text=dol_print_date($object->date_livraison,'day','',$outputlangs); diff --git a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php index 35d7dd3f9fc..848bbb92c64 100644 --- a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Raphael Bertrand * Copyright (C) 2010-2013 Juanjo Menent @@ -109,7 +109,7 @@ class pdf_proforma extends ModelePDFCommandes $this->posxdiscount=162; $this->postotalht=174; if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; - $this->posxpicture=$this->posxtva - 16; // width of images + $this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?16:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images if ($this->page_largeur < 210) // To work with US executive format { $this->posxpicture-=20; @@ -227,6 +227,15 @@ class pdf_proforma extends ModelePDFCommandes $this->atleastonediscount++; } } + if (empty($this->atleastonediscount)) + { + $this->posxpicture+=($this->postotalht - $this->posxdiscount); + $this->posxtva+=($this->postotalht - $this->posxdiscount); + $this->posxup+=($this->postotalht - $this->posxdiscount); + $this->posxqty+=($this->postotalht - $this->posxdiscount); + $this->posxdiscount+=($this->postotalht - $this->posxdiscount); + //$this->postotalht; + } // New page $pdf->AddPage(); @@ -303,7 +312,7 @@ class pdf_proforma extends ModelePDFCommandes $pdf->AddPage('','',true); if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); - $pdf->setPage($pagenb+1); + $pdf->setPage($pageposafter+1); } } else diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 0f2ac346e69..955f07a5b00 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Raphael Bertrand * Copyright (C) 2010-2013 Juanjo Menent @@ -109,7 +109,7 @@ class pdf_crabe extends ModelePDFFactures $this->posxdiscount=162; $this->postotalht=174; if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; - $this->posxpicture=$this->posxtva - 16; // width of images + $this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?16:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images if ($this->page_largeur < 210) // To work with US executive format { $this->posxpicture-=20; @@ -228,6 +228,15 @@ class pdf_crabe extends ModelePDFFactures $this->atleastonediscount++; } } + if (empty($this->atleastonediscount)) + { + $this->posxpicture+=($this->postotalht - $this->posxdiscount); + $this->posxtva+=($this->postotalht - $this->posxdiscount); + $this->posxup+=($this->postotalht - $this->posxdiscount); + $this->posxqty+=($this->postotalht - $this->posxdiscount); + $this->posxdiscount+=($this->postotalht - $this->posxdiscount); + //$this->postotalht; + } // New page $pdf->AddPage(); @@ -306,7 +315,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->AddPage('','',true); if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); - $pdf->setPage($pagenb+1); + $pdf->setPage($pageposafter+1); } } else @@ -378,7 +387,7 @@ class pdf_crabe extends ModelePDFFactures if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100; $vatrate=(string) $object->lines[$i]->tva_tx; - + // Retrieve type from database for backward compatibility with old records if ((! isset($localtax1_type) || $localtax1_type=='' || ! isset($localtax2_type) || $localtax2_type=='') // if tax type not defined && (! empty($localtax1_rate) || ! empty($localtax2_rate))) // and there is local tax diff --git a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php index bdb35d67fbe..febf66b5170 100644 --- a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2008 Chiptronik @@ -223,15 +223,24 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right /* - // Positionne $this->atleastonediscount si on a au moins une remise - for ($i = 0 ; $i < $nblines ; $i++) - { - if ($object->lines[$i]->remise_percent) - { - $this->atleastonediscount++; - } - } - */ + // Positionne $this->atleastonediscount si on a au moins une remise + for ($i = 0 ; $i < $nblines ; $i++) + { + if ($object->lines[$i]->remise_percent) + { + $this->atleastonediscount++; + } + } + if (empty($this->atleastonediscount)) + { + $this->posxpicture+=($this->postotalht - $this->posxdiscount); + $this->posxtva+=($this->postotalht - $this->posxdiscount); + $this->posxup+=($this->postotalht - $this->posxdiscount); + $this->posxqty+=($this->postotalht - $this->posxdiscount); + $this->posxdiscount+=($this->postotalht - $this->posxdiscount); + //$this->postotalht; + } + */ // New page $pdf->AddPage(); @@ -307,7 +316,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->AddPage('','',true); if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); - $pdf->setPage($pagenb+1); + $pdf->setPage($pageposafter+1); } } else diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index fbe3fb98bbf..60de9eca768 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Raphael Bertrand * Copyright (C) 2010-2013 Juanjo Menent @@ -153,7 +153,7 @@ class pdf_azur extends ModelePDFPropales $outputlangs->load("products"); $nblignes = count($object->lines); - + // Loop on each lines to detect if there is at least one image to show $realpatharray=array(); if (! empty($conf->global->MAIN_GENERATE_PROPOSALS_WITH_PICTURE)) @@ -161,7 +161,7 @@ class pdf_azur extends ModelePDFPropales for ($i = 0 ; $i < $nblignes ; $i++) { if (empty($object->lines[$i]->fk_product)) continue; - + $objphoto = new Product($this->db); $objphoto->fetch($object->lines[$i]->fk_product); @@ -185,7 +185,7 @@ class pdf_azur extends ModelePDFPropales if ($conf->propal->dir_output) { $object->fetch_thirdparty(); - + // $deja_regle = 0; // Definition of $dir and $file @@ -254,6 +254,15 @@ class pdf_azur extends ModelePDFPropales $this->atleastonediscount++; } } + if (empty($this->atleastonediscount)) + { + $this->posxpicture+=($this->postotalht - $this->posxdiscount); + $this->posxtva+=($this->postotalht - $this->posxdiscount); + $this->posxup+=($this->postotalht - $this->posxdiscount); + $this->posxqty+=($this->postotalht - $this->posxdiscount); + $this->posxdiscount+=($this->postotalht - $this->posxdiscount); + //$this->postotalht; + } // New page $pdf->AddPage(); @@ -320,7 +329,7 @@ class pdf_azur extends ModelePDFPropales $pdf->AddPage('','',true); if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); - $pdf->setPage($pagenb+1); + $pdf->setPage($pageposbefore+1); $curY = $tab_top_newpage; $showpricebeforepagebreak=0; @@ -358,7 +367,7 @@ class pdf_azur extends ModelePDFPropales $pdf->AddPage('','',true); if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); - $pdf->setPage($pagenb+1); + $pdf->setPage($pageposafter+1); } } else @@ -375,6 +384,7 @@ class pdf_azur extends ModelePDFPropales $nexY = $pdf->GetY(); $pageposafter=$pdf->getPage(); + $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index ccc3ed8c17b..fa1ef339185 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -1,6 +1,6 @@ - * Copyright (C) 2010-2012 Laurent Destailleur + * Copyright (C) 2010-2014 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 @@ -58,7 +58,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices * Constructor * * @param DoliDB $db Database handler - * @param Societe $object Supplier invoice + * @param Object $object Supplier invoice */ function __construct($db,$object) { @@ -105,7 +105,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $this->posxdiscount=162; $this->postotalht=174; //if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; - $this->posxpicture=$this->posxtva - 16; // width of images + $this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?16:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images if ($this->page_largeur < 210) // To work with US executive format { $this->posxpicture-=20; @@ -225,7 +225,16 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $this->atleastonediscount++; } } - + if (empty($this->atleastonediscount)) + { + $this->posxpicture+=($this->postotalht - $this->posxdiscount); + $this->posxtva+=($this->postotalht - $this->posxdiscount); + $this->posxup+=($this->postotalht - $this->posxdiscount); + $this->posxqty+=($this->postotalht - $this->posxdiscount); + $this->posxdiscount+=($this->postotalht - $this->posxdiscount); + //$this->postotalht; + } + // New page $pdf->AddPage(); if (! empty($tplidx)) $pdf->useTemplate($tplidx); @@ -279,8 +288,40 @@ class pdf_canelle extends ModelePDFSuppliersInvoices // Description of product line $curX = $this->posxdesc-1; - pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc,1); + $showpricebeforepagebreak=1; + $pdf->startTransaction(); + pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc,1); + $pageposafter=$pdf->getPage(); + if ($pageposafter > $pageposbefore) // There is a pagebreak + { + $pdf->rollbackTransaction(true); + $pageposafter=$pageposbefore; + //print $pageposafter.'-'.$pageposbefore;exit; + $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,4,$curX,$curY,$hideref,$hidedesc); + $posyafter=$pdf->GetY(); + if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text + { + if ($i == ($nblignes-1)) // No more lines, and no space left to show total, so we create a new page + { + $pdf->AddPage('','',true); + if (! empty($tplidx)) $pdf->useTemplate($tplidx); + if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); + $pdf->setPage($pageposafter+1); + } + } + else + { + // We found a page break + $showpricebeforepagebreak=0; + } + } + else // No pagebreak + { + $pdf->commitTransaction(); + } + $nexY = $pdf->GetY(); $pageposafter=$pdf->getPage(); $pdf->setPage($pageposbefore); @@ -288,7 +329,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description is moved completely on next page - if ($pageposafter > $pageposbefore) { + if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { $pdf->setPage($pageposafter); $curY = $tab_top_newpage; } @@ -299,7 +340,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices { $vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->posxtva, $curY); - $pdf->MultiCell($this->posxup-$this->posxtva-0.8, 3, $vat_rate, 0, 'R'); + $pdf->MultiCell($this->posxup-$this->posxtva-1, 3, $vat_rate, 0, 'R'); } // Unit price before discount @@ -320,7 +361,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices // Total HT line $total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs); $pdf->SetXY($this->postotalht, $curY); - $pdf->MultiCell(26, 3, $total_excl_tax, 0, 'R', 0); + $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalht, 3, $total_excl_tax, 0, 'R', 0); // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva $tvaligne=$object->lines[$i]->total_tva; @@ -366,6 +407,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pagenb++; $pdf->setPage($pagenb); $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); } if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak) { @@ -382,6 +424,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->AddPage(); if (! empty($tplidx)) $pdf->useTemplate($tplidx); $pagenb++; + if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); } } diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index efa93e17aec..ad380f7df50 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2010-2013 Juanjo Menent @@ -110,7 +110,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $this->posxdiscount=162; $this->postotalht=174; //if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; - $this->posxpicture=$this->posxtva - 16; // width of images + $this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?16:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images if ($this->page_largeur < 210) // To work with US executive format { $this->posxpicture-=20; @@ -233,6 +233,15 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $this->atleastonediscount++; } } + if (empty($this->atleastonediscount)) + { + $this->posxpicture+=($this->postotalht - $this->posxdiscount); + $this->posxtva+=($this->postotalht - $this->posxdiscount); + $this->posxup+=($this->postotalht - $this->posxdiscount); + $this->posxqty+=($this->postotalht - $this->posxdiscount); + $this->posxdiscount+=($this->postotalht - $this->posxdiscount); + //$this->postotalht; + } // New page $pdf->AddPage(); @@ -307,7 +316,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->AddPage('','',true); if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); - $pdf->setPage($pagenb+1); + $pdf->setPage($pageposafter+1); } } else From 2f101980649c85618cd10971892c9ee272377746 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 Mar 2014 16:36:12 +0100 Subject: [PATCH 19/21] Fix: Option MAIN_PDF_DASH_BETWEEN_LINES was not working when tcpdf was making a pagebreak higher than 2 pages. --- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 1 + htdocs/core/modules/commande/doc/pdf_proforma.modules.php | 1 + htdocs/core/modules/expedition/doc/pdf_merou.modules.php | 1 + htdocs/core/modules/expedition/doc/pdf_rouget.modules.php | 1 + htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 1 + htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php | 1 + htdocs/core/modules/project/pdf/pdf_baleine.modules.php | 3 +++ htdocs/core/modules/propale/doc/pdf_azur.modules.php | 1 + .../modules/supplier_invoice/pdf/pdf_canelle.modules.php | 5 +++-- .../core/modules/supplier_order/pdf/pdf_muscadet.modules.php | 1 + 10 files changed, 14 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 835a9ffa43b..11a5e271dde 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -409,6 +409,7 @@ class pdf_einstein extends ModelePDFCommandes // Add line if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) { + $pdf->setPage($pageposafter); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); diff --git a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php index 848bbb92c64..b6021d17c0d 100644 --- a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php @@ -408,6 +408,7 @@ class pdf_proforma extends ModelePDFCommandes // Add line if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) { + $pdf->setPage($pageposafter); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index fc3bd6281eb..dafff8b81ea 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -267,6 +267,7 @@ class pdf_merou extends ModelePdfExpedition // Add line if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) { + $pdf->setPage($pageposafter); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 66f36e1b84f..d924da16785 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -264,6 +264,7 @@ class pdf_rouget extends ModelePdfExpedition // Add line if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) { + $pdf->setPage($pageposafter); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 955f07a5b00..7d3c1f35154 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -410,6 +410,7 @@ class pdf_crabe extends ModelePDFFactures // Add line if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) { + $pdf->setPage($pageposafter); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); diff --git a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php index febf66b5170..b9d61ec1049 100644 --- a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php @@ -379,6 +379,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder // Add line if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblines - 1)) { + $pdf->setPage($pageposafter); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); diff --git a/htdocs/core/modules/project/pdf/pdf_baleine.modules.php b/htdocs/core/modules/project/pdf/pdf_baleine.modules.php index cca049cba92..881b112688e 100644 --- a/htdocs/core/modules/project/pdf/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/pdf/pdf_baleine.modules.php @@ -222,12 +222,15 @@ class pdf_baleine extends ModelePDFProjects $pdf->MultiCell(20, 3, $dateend, 0, 'L'); + $pageposafter=$pdf->getPage(); + $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut $nexY = $pdf->GetY(); // Add line if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) { + $pdf->setPage($pageposafter); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 60de9eca768..4aea9af7085 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -466,6 +466,7 @@ class pdf_azur extends ModelePDFPropales // Add line if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) { + $pdf->setPage($pageposafter); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index fa1ef339185..4ecaa978123 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -234,7 +234,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $this->posxdiscount+=($this->postotalht - $this->posxdiscount); //$this->postotalht; } - + // New page $pdf->AddPage(); if (! empty($tplidx)) $pdf->useTemplate($tplidx); @@ -321,7 +321,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices { $pdf->commitTransaction(); } - + $nexY = $pdf->GetY(); $pageposafter=$pdf->getPage(); $pdf->setPage($pageposbefore); @@ -383,6 +383,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices // Add line if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) { + $pdf->setPage($pageposafter); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index ad380f7df50..cf8af3e6e7c 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -410,6 +410,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders // Add line if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) { + $pdf->setPage($pageposafter); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); From 212deb9e1c05d091b04477cf1bfbfc05b1f51abb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 Mar 2014 17:15:18 +0100 Subject: [PATCH 20/21] Fix: fails to import when value is 'AUTO' because compare was case sensitive. --- htdocs/core/modules/import/import_csv.modules.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index f0766e271e5..dcac5cf6a91 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -443,7 +443,7 @@ class ImportCsv extends ModeleImports } elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='getcustomercodeifnull') { - if (empty($newval) || $newval=='auto') + if (empty($newval) || strtolower($newval) == 'auto') { $this->thirpartyobject->get_codeclient(0,0); $newval=$this->thirpartyobject->code_client; @@ -452,7 +452,7 @@ class ImportCsv extends ModeleImports } elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='getsuppliercodeifnull') { - if (empty($newval) || $newval=='auto') + if (empty($newval) || strtolower($newval) == 'auto') { $newval=$this->thirpartyobject->get_codefournisseur(0,1); $newval=$this->thirpartyobject->code_fournisseur; @@ -461,7 +461,7 @@ class ImportCsv extends ModeleImports } elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='getcustomeraccountancycodeifnull') { - if (empty($newval) || $newval=='auto') + if (empty($newval) || strtolower($newval) == 'auto') { $this->thirpartyobject->get_codecompta('customer'); $newval=$this->thirpartyobject->code_compta; @@ -470,7 +470,7 @@ class ImportCsv extends ModeleImports } elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='getsupplieraccountancycodeifnull') { - if (empty($newval) || $newval=='auto') + if (empty($newval) || strtolower($newval) == 'auto') { $this->thirpartyobject->get_codecompta('supplier'); $newval=$this->thirpartyobject->code_compta_fournisseur; @@ -653,7 +653,7 @@ function cleansep($value) function tablewithentity($table) { global $db; - + $resql=$db->DDLDescTable($table,'entity'); if ($resql) { @@ -662,7 +662,7 @@ function tablewithentity($table) if ($obj) return 1; else return 0; } - else return -1; + else return -1; } ?> From 062c150bc1662c92099cb8ab780db0e59cc7244d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 Mar 2014 19:33:43 +0100 Subject: [PATCH 21/21] Fix: import of fields with value "auto" --- htdocs/core/modules/import/import_csv.modules.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index e0741c26cef..439fac7aaaa 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -250,7 +250,7 @@ class ImportCsv extends ModeleImports /** * Return array of next record in input file. * - * @return Array Array of field values. Data are UTF8 encoded. [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=string) + * @return Array Array of field values. Data are UTF8 encoded. [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=not empty string) */ function import_read_record() { @@ -383,7 +383,7 @@ class ImportCsv extends ModeleImports { // Set $newval with value to insert and set $listvalues with sql request part for insert $newval=''; - if ($arrayrecord[($key-1)]['type'] > 0) $newval=$arrayrecord[($key-1)]['val']; // If type of field is not null or '' but string + if ($arrayrecord[($key-1)]['type'] > 0) $newval=$arrayrecord[($key-1)]['val']; // If type of field into input file is not empty string (so defined into input file), we get value // Make some tests on $newval @@ -447,6 +447,7 @@ class ImportCsv extends ModeleImports { $this->thirpartyobject->get_codeclient(0,0); $newval=$this->thirpartyobject->code_client; + if (empty($newval)) $arrayrecord[($key-1)]['type']=-1; // If we get empty value, we will use "null" //print 'code_client='.$newval; } } @@ -456,6 +457,7 @@ class ImportCsv extends ModeleImports { $newval=$this->thirpartyobject->get_codefournisseur(0,1); $newval=$this->thirpartyobject->code_fournisseur; + if (empty($newval)) $arrayrecord[($key-1)]['type']=-1; // If we get empty value, we will use "null" //print 'code_fournisseur='.$newval; } } @@ -465,6 +467,7 @@ class ImportCsv extends ModeleImports { $this->thirpartyobject->get_codecompta('customer'); $newval=$this->thirpartyobject->code_compta; + if (empty($newval)) $arrayrecord[($key-1)]['type']=-1; // If we get empty value, we will use "null" //print 'code_compta='.$newval; } } @@ -474,6 +477,7 @@ class ImportCsv extends ModeleImports { $this->thirpartyobject->get_codecompta('supplier'); $newval=$this->thirpartyobject->code_compta_fournisseur; + if (empty($newval)) $arrayrecord[($key-1)]['type']=-1; // If we get empty value, we will use "null" //print 'code_compta_fournisseur='.$newval; } } @@ -540,6 +544,7 @@ class ImportCsv extends ModeleImports if ($listfields) { $listfields.=', '; $listvalues.=', '; } $listfields.=$fieldname; + // Note: arrayrecord (and 'type') is filled with ->import_read_record called by import.php page before calling import_insert if (empty($newval) && $arrayrecord[($key-1)]['type'] < 0) $listvalues.=($newval=='0'?$newval:"null"); elseif (empty($newval) && $arrayrecord[($key-1)]['type'] == 0) $listvalues.="''"; else $listvalues.="'".$this->db->escape($newval)."'"; @@ -653,7 +658,7 @@ function cleansep($value) function tablewithentity($table) { global $db; - + $resql=$db->DDLDescTable($table,'entity'); if ($resql) { @@ -662,7 +667,7 @@ function tablewithentity($table) if ($obj) return 1; else return 0; } - else return -1; + else return -1; } ?>