diff --git a/ChangeLog b/ChangeLog
index 361cd1145ba..803703caf9d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -62,10 +62,12 @@ For users:
- New: Can choose menu entry to show with external site module.
- New: Add hidden option MAIN_PDF_MARGIN_LEFT, MAIN_PDF_MARGIN_RIGHT, MAIN_PDF_MARGIN_TOP, MAIN_PDF_MARGIN_BOTTOM
to force margins of generated PDF.
+- New: [ task #314 ] Can define if prof id are mandatory or not
New experimental modules:
- New: Add margin management module.
- New: Add commissions management module.
+
- Fix: [ bug #499 ]: Supplier order input method not translated
- Fix: No images into product description lines as PDF generation does
not work with this.
diff --git a/htdocs/langs/ca_ES/admin.lang b/htdocs/langs/ca_ES/admin.lang
index 06873ef9f89..c5dce9389a6 100644
--- a/htdocs/langs/ca_ES/admin.lang
+++ b/htdocs/langs/ca_ES/admin.lang
@@ -949,6 +949,7 @@ DocumentModelOdt=Generació des dels documents amb format OpenDocument (Arxiu .O
WatermarkOnDraft=Marca d'aigua en els documents esborrany
CompanyIdProfChecker=Id Professional únic
MustBeUnique=Ha de ser únic?
+MustBeMandatory=Ha de ser obligatori?
Miscellanous=Miscel·lània
##### Webcal setup #####
WebCalSetup=Configuració d'enllaç amb el calendari webcalendar
diff --git a/htdocs/langs/ca_ES/companies.lang b/htdocs/langs/ca_ES/companies.lang
index caa0cfe0174..63ae033cd98 100644
--- a/htdocs/langs/ca_ES/companies.lang
+++ b/htdocs/langs/ca_ES/companies.lang
@@ -108,42 +108,49 @@ ProfId2AR=Ingressos bruts
ProfId3AR=-
ProfId4AR=-
ProfId5AR=-
+ProfId6AR=-
ProfId1AU=ABN
ProfId2AU=-
ProfId3AU=-
ProfId4AU=-
ProfId5AU=-
+ProfId6AU=-
ProfId1BE=N° col·legiat
ProfId2BE=-
ProfId3BE=-
ProfId4BE=-
ProfId5BE=-
-ProfId1BR=CNPJ
+ProfId6BE=-
+ProfId1BR=-
ProfId2BR=IE (Inscricao Estadual)
ProfId3BR=IM (Inscricao Municipal)
ProfId4BR=CPF
-#ProfId5BR=CNAE=
-#ProfId6BR=INSS=
+#ProfId5BR=CNAE
+#ProfId6BR=INSS
ProfId1CH=-
ProfId2CH=-
ProfId3CH=Número federat
ProfId4CH=Num registre de comerç
ProfId5CH=-
+ProfId6CH=-
ProfId1CL=R.U.T.
ProfId2CL=-
ProfId3CL=-
ProfId4CL=-
ProfId5CL=-
+ProfId6CL=-
ProfId1CO=R.U.T.
ProfId2CO=-
ProfId3CO=-
ProfId4CO=-
ProfId5CO=-
+ProfId6CO=-
ProfId1DE=Id prof. 1 (USt.-IdNr)
ProfId2DE=Id prof. 2 (USt.-Nr)
ProfId3DE=Id prof. 3 (Handelsregister-Nr.)
ProfId4DE=-
ProfId5DE=-
+ProfId6DE=-
ProfId1ES=CIF/NIF
ProfId2ES=Núm seguretat social
ProfId3ES=CNAE
@@ -161,51 +168,61 @@ ProfId2GB=-
ProfId3GB=SIC
ProfId4GB=-
ProfId5GB=-
+ProfId6GB=-
ProfId1HN=RTN
ProfId2HN=-
ProfId3HN=-
ProfId4HN=-
ProfId5HN=-
+ProfId6HN=-
ProfId1IN=Id prof. 1 (TIN)
-ProfId2IN=Id prof. 2
-ProfId3IN=Id prof. 3
+ProfId2IN=Id prof. 2 (PAN)
+ProfId3IN=Id prof. 3 (SRVC TAX)
ProfId4IN=Id prof. 4
ProfId5IN=Id prof. 5
+ProfId6IN=-
ProfId1MA=Id prof. 1 (R.C.)
ProfId2MA=Id prof. 2 (Patente)
ProfId3MA=Id prof. 3 (I.F.)
ProfId4MA=Id prof. 4 (C.N.S.S.)
ProfId5MA=-
+ProfId6MA=-
ProfId1MX=R.F.C.
ProfId2MX=Registre Patronal IMSS
ProfId3MX=Cèdula Professional
ProfId4MX=-
ProfId5MX=-
+ProfId6MX=-
ProfId1NL=Número KVK
ProfId2NL=-
ProfId3NL=-
ProfId4NL=-
ProfId5NL=-
+ProfId6NL=-
ProfId1PT=NIPC
ProfId2PT=Núm seguretat social
ProfId3PT=Num reg. comercial
ProfId4PT=Conservatori
ProfId5PT=-
+ProfId6PT=-
ProfId1RU=OGRN
ProfId2RU=INN
ProfId3RU=KPP
ProfId4RU=OKPO
ProfId5RU=-
+ProfId6RU=-
ProfId1SN=RC
ProfId2SN=NINEA
ProfId3SN=-
ProfId4SN=-
ProfId5SN=-
+ProfId6SN=-
ProfId1TN=RC
ProfId2TN=Matrícula fiscal
ProfId3TN=Codi en aduana
ProfId4TN=CCC
ProfId5TN=-
+ProfId6TN=-
VATIntra=NIF intracomunitari
VATIntraShort=NIF intra.
VATIntraVeryShort=NIF intra.
diff --git a/htdocs/langs/ca_ES/errors.lang b/htdocs/langs/ca_ES/errors.lang
index fd43de81c10..ec04e3ff9ce 100644
--- a/htdocs/langs/ca_ES/errors.lang
+++ b/htdocs/langs/ca_ES/errors.lang
@@ -21,6 +21,7 @@ ErrorThisContactIsAlreadyDefinedAsThisType=Aquest contacte ja està definit com
ErrorCashAccountAcceptsOnlyCashMoney=Aquesta compte bancari és de tipus caixa i només accepta el mètode de pagament de tipus espècie.
ErrorFromToAccountsMustDiffers=El compte origen i destinació han de ser diferents.
ErrorBadThirdPartyName=Nom de tercer incorrecte
+ErrorProdIdIsMandatory=El %s es obligatori
ErrorBadCustomerCodeSyntax=La sintaxi del codi client és incorrecta
ErrorCustomerCodeRequired=Codi client obligatori
ErrorCustomerCodeAlreadyUsed=Codi de client ja utilitzat
diff --git a/htdocs/langs/ca_ES/margins.lang b/htdocs/langs/ca_ES/margins.lang
index f502a3274bf..62bb253a587 100644
--- a/htdocs/langs/ca_ES/margins.lang
+++ b/htdocs/langs/ca_ES/margins.lang
@@ -46,4 +46,8 @@ MargeNette=Marge net
MARGIN_TYPE_DETAILS=Marge brut: Preu de venda sense IVA - Preu de compra sense IVA
Marge net: Preu de venda sense IVA - Costos
BuyingCost=Costos
-UnitCharges=Càrrega unitària
\ No newline at end of file
+UnitCharges=Càrrega unitària
+Charges=Càrreges
+
+AgentContactType=Tipus de contacte comissionat
+AgentContactTypeDetails=Indica el tipus de contacte enllaçat a les factures que seran associats als agents comercials
\ No newline at end of file
diff --git a/htdocs/langs/ca_ES/products.lang b/htdocs/langs/ca_ES/products.lang
index f1c0fbb0616..71d8d426d2c 100644
--- a/htdocs/langs/ca_ES/products.lang
+++ b/htdocs/langs/ca_ES/products.lang
@@ -146,6 +146,8 @@ ProductSpecial=Especial
QtyMin=Quantitat mínima
PriceQty=Preu per la quantitat
PriceQtyMin=Preu quantitat min.
+DiscountQtyMin=Descompte per defecte quantitat min.
+VATRateForSupplierProduct=Taxa IVA (per aquest producte/proveïdor)
NoPriceDefinedForThisSupplier=Cap preu/quant. definit per a aquest proveïdor/producte
NoSupplierPriceDefinedForThisProduct=Cap preu/quant. proveïdor definit per a aquest producte
RecordedProducts=Productes en venda
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 6a50d4b087a..b07c69d7259 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -939,6 +939,7 @@ DocumentModelOdt=Generate documents from OpenDocuments templates (.ODT files for
WatermarkOnDraft=Watermark on draft document
CompanyIdProfChecker=Professional Id unique
MustBeUnique=Must be unique ?
+MustBeMandatory=Must be mandatory ?
Miscellanous=Miscellaneous
##### Webcal setup #####
WebCalSetup=Webcalendar link setup
diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang
index 19a36f64c22..f2f537453e7 100644
--- a/htdocs/langs/en_US/errors.lang
+++ b/htdocs/langs/en_US/errors.lang
@@ -25,6 +25,7 @@ ErrorThisContactIsAlreadyDefinedAsThisType=This contact is already defined as co
ErrorCashAccountAcceptsOnlyCashMoney=This bank account is a cash account, so it accepts payments of type cash only.
ErrorFromToAccountsMustDiffers=Source and targets bank accounts must be different.
ErrorBadThirdPartyName=Bad value for third party name
+ErrorProdIdIsMandatory=The %s is mandatory
ErrorBadCustomerCodeSyntax=Bad syntax for customer code
ErrorCustomerCodeRequired=Customer code required
ErrorCustomerCodeAlreadyUsed=Customer code already used
diff --git a/htdocs/langs/en_US/margins.lang b/htdocs/langs/en_US/margins.lang
index 41203847ba5..10a8112f87e 100644
--- a/htdocs/langs/en_US/margins.lang
+++ b/htdocs/langs/en_US/margins.lang
@@ -47,6 +47,7 @@ MARGIN_TYPE_DETAILS=Raw margin : Selling price - Buying price
Net margin : S
BuyingCost=Cost price
UnitCharges=Unit charges
+Charges=Charges
AgentContactType=Contact type used for commissioning
AgentContactTypeDetails=Défine what contact type (linked on invoices) will be associated with commercial agents
\ No newline at end of file
diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang
index d5a9df404a9..3a43d9c67b3 100644
--- a/htdocs/langs/es_ES/admin.lang
+++ b/htdocs/langs/es_ES/admin.lang
@@ -952,6 +952,7 @@ DocumentModelOdt=Generación desde los documentos OpenDocument (Archivo .ODT Ope
WatermarkOnDraft=Marca de agua en los documentos borrador
CompanyIdProfChecker=Id Profesional único
MustBeUnique=¿Debe ser único?
+MustBeMandatory=¿Debe ser obligatorio?
Miscellanous=Miscelánea
##### Webcal setup #####
WebCalSetup=Configuración de enlace con el calendario Webcalendar
diff --git a/htdocs/langs/es_ES/companies.lang b/htdocs/langs/es_ES/companies.lang
index 9313df97434..511921a014b 100644
--- a/htdocs/langs/es_ES/companies.lang
+++ b/htdocs/langs/es_ES/companies.lang
@@ -109,17 +109,20 @@ ProfId2AR=Ingresos brutos
ProfId3AR=-
ProfId4AR=-
ProfId5AR=-
+ProfId6AR=-
ProfId1AU=ABN
ProfId2AU=-
ProfId3AU=-
ProfId4AU=-
ProfId5AU=-
+ProfId6AU=-
ProfId1BE=N° colegiado
ProfId2BE=-
ProfId3BE=-
ProfId4BE=-
ProfId5BE=-
-ProfId1BR=CNPJ
+ProfId6BE=-
+ProfId1BR=-
ProfId2BR=IE (Inscricao Estadual)
ProfId3BR=IM (Inscricao Municipal)
ProfId4BR=CPF
@@ -130,21 +133,25 @@ ProfId2CH=-
ProfId3CH=Número federado
ProfId4CH=Num registro de comercio
ProfId5CH=-
+ProfId6CH=-
ProfId1CL=R.U.T.
ProfId2CL=-
ProfId3CL=-
ProfId4CL=-
ProfId5CL=-
+ProfId6CL=-
ProfId1CO=R.U.T.
ProfId2CO=-
ProfId3CO=-
ProfId4CO=-
ProfId5CO=-
+ProfId6CO=-
ProfId1DE=Id prof. 1 (USt.-IdNr)
ProfId2DE=Id prof. 2 (USt.-Nr)
ProfId3DE=Id prof. 3 (Handelsregister-Nr.)
ProfId4DE=-
ProfId5DE=-
+ProfId6DE=-
ProfId1ES=CIF/NIF
ProfId2ES=Núm seguridad social
ProfId3ES=CNAE
@@ -162,51 +169,61 @@ ProfId2GB=-
ProfId3GB=SIC
ProfId4GB=-
ProfId5GB=-
+ProfId6GB=-
ProfId1HN=RTN
ProfId2HN=-
ProfId3HN=-
ProfId4HN=-
ProfId5HN=-
+ProfId6HN=-
ProfId1IN=Id prof. 1 (TIN)
ProfId2IN=Id prof. 2
ProfId3IN=Id prof. 3
ProfId4IN=Id prof. 4
ProfId5IN=Id prof. 5
+ProfId6IN=-
ProfId1MA=Id prof. 1 (R.C.)
ProfId2MA=Id prof. 2 (Patente)
ProfId3MA=Id prof. 3 (I.F.)
ProfId4MA=Id prof. 4 (C.N.S.S.)
-ProfId5MA=Id prof. 5
+ProfId5MA=-
+ProfId6MA=-
ProfId1MX=R.F.C.
ProfId2MX=Registro Patronal IMSS
ProfId3MX=Cédula Profesional
ProfId4MX=-
ProfId5MX=-
+ProfId6MX=-
ProfId1NL=Número KVK
ProfId2NL=-
ProfId3NL=-
ProfId4NL=-
ProfId5NL=-
+ProfId6NL=-
ProfId1PT=NIPC
ProfId2PT=Núm. seguridad social
ProfId3PT=Num reg. comercial
ProfId4PT=Conservatorio
ProfId5PT=-
+ProfId6PT=-
ProfId1RU=OGRN
ProfId2RU=INN
ProfId3RU=KPP
ProfId4RU=OKPO
ProfId5RU=-
+ProfId6RU=-
ProfId1SN=RC
ProfId2SN=NINEA
ProfId3SN=-
ProfId4SN=-
ProfId5SN=-
+ProfId6SN=-
ProfId1TN=RC
ProfId2TN=Matrícula fiscal
ProfId3TN=Código en aduana
ProfId4TN=CCC
ProfId5TN=-
+ProfId6TN=-
VATIntra=NIF intracomunitario
VATIntraShort=NIF intra.
VATIntraVeryShort=NIF intra.
diff --git a/htdocs/langs/es_ES/errors.lang b/htdocs/langs/es_ES/errors.lang
index 580627e6cab..d723910a5bd 100644
--- a/htdocs/langs/es_ES/errors.lang
+++ b/htdocs/langs/es_ES/errors.lang
@@ -21,6 +21,7 @@ ErrorThisContactIsAlreadyDefinedAsThisType=Este contacto ya está definido como
ErrorCashAccountAcceptsOnlyCashMoney=Esta cuenta bancaria es de tipo caja y solo acepta el método de pago de tipo especie.
ErrorFromToAccountsMustDiffers=La cuenta origen y destino deben ser diferentes.
ErrorBadThirdPartyName=Nombre de tercero incorrecto
+ErrorProdIdIsMandatory=El %s es obligatorio
ErrorBadCustomerCodeSyntax=La sintaxis del código cliente es incorrecta
ErrorCustomerCodeRequired=Código cliente obligatorio
ErrorCustomerCodeAlreadyUsed=Código de cliente ya utilizado
diff --git a/htdocs/langs/es_ES/margins.lang b/htdocs/langs/es_ES/margins.lang
index 5ff7b74b7d4..0dc08481c46 100644
--- a/htdocs/langs/es_ES/margins.lang
+++ b/htdocs/langs/es_ES/margins.lang
@@ -46,4 +46,8 @@ MargeNette=Margen neto
MARGIN_TYPE_DETAILS=Margen bruto : Precio de venta sin IVA - Precio de compra sin IVA
Margen neto : Precio de venta sin IVA - Costos
BuyingCost=Costos
-UnitCharges=Carga unitaria
\ No newline at end of file
+UnitCharges=Carga unitaria
+Charges=Cargas
+
+AgentContactType=Tipo de contacto comisionado
+AgentContactTypeDetails=Indica el tipo de contacto enlazado a las facturas que serán asociados a los agentes comerciales
\ No newline at end of file
diff --git a/htdocs/langs/es_ES/products.lang b/htdocs/langs/es_ES/products.lang
index 97d4586bae6..a3c2bf41eb7 100644
--- a/htdocs/langs/es_ES/products.lang
+++ b/htdocs/langs/es_ES/products.lang
@@ -146,6 +146,8 @@ ProductSpecial=Especial
QtyMin=Cantidad mínima
PriceQty=Precio para la cantidad
PriceQtyMin=Precio cantidad mín.
+DiscountQtyMin=Descuento por defecto cantidad mín.
+VATRateForSupplierProduct=Tasa IVA (para este producto/proveedor)
NoPriceDefinedForThisSupplier=Ningún precio/cant. definido para este proveedor/producto
NoSupplierPriceDefinedForThisProduct=Ningún precio/cant. proveedor definida para este producto
RecordedProducts=Productos en venta
diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang
index 6afab6c47ab..000a58860f9 100644
--- a/htdocs/langs/fr_FR/admin.lang
+++ b/htdocs/langs/fr_FR/admin.lang
@@ -946,6 +946,7 @@ DocumentModelOdt=Genération depuis des modèles OpenDocument (Fichier .ODT Open
WatermarkOnDraft=Filigrane sur les documents brouillons
CompanyIdProfChecker=Id professionel unique
MustBeUnique=Doit être unique ?
+MustBeMandatory=Doit être obligatoire?
Miscellanous=Divers
##### Webcal setup #####
WebCalSetup= Configuration du lien vers le calendrier Webcalendar
diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang
index 87715bea1fe..b6fcbb6611b 100644
--- a/htdocs/langs/fr_FR/errors.lang
+++ b/htdocs/langs/fr_FR/errors.lang
@@ -26,6 +26,7 @@ ErrorThisContactIsAlreadyDefinedAsThisType=Ce contact est déjà défini comme c
ErrorCashAccountAcceptsOnlyCashMoney=Ce compte bancaire est de type caisse et n'accepte que les mode de règlement de type espèce.
ErrorFromToAccountsMustDiffers=Le compte source et destination doivent être différents.
ErrorBadThirdPartyName=Nom de tiers incorrect
+ErrorProdIdIsMandatory=Le %s est obligatoire
ErrorBadCustomerCodeSyntax=La syntaxe du code client est incorrecte
ErrorCustomerCodeRequired=Code client obligatoire
ErrorCustomerCodeAlreadyUsed=Code client déjà utilisé
diff --git a/htdocs/langs/fr_FR/margins.lang b/htdocs/langs/fr_FR/margins.lang
index 02dfedbbe9a..3c81a9a1e4d 100644
--- a/htdocs/langs/fr_FR/margins.lang
+++ b/htdocs/langs/fr_FR/margins.lang
@@ -47,6 +47,7 @@ MARGIN_TYPE_DETAILS=Marge brute : Prix de vente HT - Prix d'achat HT
Marge n
BuyingCost=Coût de revient
UnitCharges=Charge unitaire
+Charges=Charges
AgentContactType=Type de contact commissionné
AgentContactTypeDetails=Permet de définir le type de contact associé aux factures qui sera associé aux agents commerciaux
\ No newline at end of file
diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php
index ce68665cb69..443b0bc4be4 100644
--- a/htdocs/product/fiche.php
+++ b/htdocs/product/fiche.php
@@ -1380,7 +1380,7 @@ print "\n
\n";
* All the "Add to" areas
*/
-if ($id && ($action == '' || $action == 'view') && $object->status)
+if ($object->id && ($action == '' || $action == 'view') && $object->status)
{
print '
| '.$langs->trans("Name").' | '; print ''.$langs->trans("Description").' | '; print ''.$langs->trans("MustBeUnique").' | '; +print ''.$langs->trans("MustBeMandatory").' | '; print "||
| '.$profid[$i][0]." | \n"; - print $profid[$i][1]; - print ' | '; - - switch($i) + if ($profid[$i][1]!='-') { - case 0: - $verif=(empty($conf->global->SOCIETE_IDPROF1_UNIQUE)?false:true); - break; - case 1: - $verif=(empty($conf->global->SOCIETE_IDPROF2_UNIQUE)?false:true); - break; - case 2: - $verif=(empty($conf->global->SOCIETE_IDPROF3_UNIQUE)?false:true); - break; - case 3: - $verif=(empty($conf->global->SOCIETE_IDPROF4_UNIQUE)?false:true); - break; + $var = !$var; + + print '||||
| '.$profid[$i][0]." | \n"; + print $profid[$i][1]; + print ' | '; + + $idprof_unique ='SOCIETE_IDPROF'.($i+1).'_UNIQUE'; + $idprof_mandatory ='SOCIETE_IDPROF'.($i+1).'_MANDATORY'; + $verif=(empty($conf->global->$idprof_unique)?false:true); + $mandatory=(empty($conf->global->$idprof_mandatory)?false:true); + + if ($verif) + { + print ''; + print img_picto($langs->trans("Activated"),'switch_on'); + print ' | '; + } + else + { + print ''; + print img_picto($langs->trans("Disabled"),'switch_off'); + print ' | '; + } + + if ($mandatory) + { + print ''; + print img_picto($langs->trans("Activated"),'switch_on'); + print ' | '; + } + else + { + print ''; + print img_picto($langs->trans("Disabled"),'switch_off'); + print ' | '; + } + print "'; - print img_picto($langs->trans("Activated"),'switch_on'); - print ' | '; - } - else - { - print ''; - print img_picto($langs->trans("Disabled"),'switch_off'); - print ' | '; - } - print "\n"; $i++; } diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 45caee823b1..26c453607ec 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -5,7 +5,7 @@ * Copyright (C) 2005 Eric Seigne
| '.$idprof.' | '; + + $idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY'; + if(empty($conf->global->$idprof_mandatory)) + print ' | '.$idprof.' | '; + else + print ' | '.$idprof.' | '; + $key='idprof'.$i; print $formcompany->get_input_id_prof($i,'idprof'.$i,$object->$key,$object->country_code); print ' | '; @@ -1271,7 +1296,13 @@ else if ($idprof!='-') { if (($j % 2) == 0) print '
| '.$idprof.' | '; + + $idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY'; + if(empty($conf->global->$idprof_mandatory)) + print ' | '.$idprof.' | '; + else + print ' | '.$idprof.' | '; + $key='idprof'.$i; print $formcompany->get_input_id_prof($i,'idprof'.$i,$object->$key,$object->country_code); print ' | ';