New: [ task #314 ] Can define if prof id are mandatory or not
This commit is contained in:
parent
4f2f56fced
commit
c365dbc679
@ -62,10 +62,12 @@ For users:
|
|||||||
- New: Can choose menu entry to show with external site module.
|
- 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
|
- 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.
|
to force margins of generated PDF.
|
||||||
|
- New: [ task #314 ] Can define if prof id are mandatory or not
|
||||||
New experimental modules:
|
New experimental modules:
|
||||||
- New: Add margin management module.
|
- New: Add margin management module.
|
||||||
- New: Add commissions management module.
|
- New: Add commissions management module.
|
||||||
|
|
||||||
|
|
||||||
- Fix: [ bug #499 ]: Supplier order input method not translated
|
- Fix: [ bug #499 ]: Supplier order input method not translated
|
||||||
- Fix: No images into product description lines as PDF generation does
|
- Fix: No images into product description lines as PDF generation does
|
||||||
not work with this.
|
not work with this.
|
||||||
|
|||||||
@ -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 <b>espècie</b>.
|
ErrorCashAccountAcceptsOnlyCashMoney=Aquesta compte bancari és de tipus caixa i només accepta el mètode de pagament de tipus <b>espècie</b>.
|
||||||
ErrorFromToAccountsMustDiffers=El compte origen i destinació han de ser diferents.
|
ErrorFromToAccountsMustDiffers=El compte origen i destinació han de ser diferents.
|
||||||
ErrorBadThirdPartyName=Nom de tercer incorrecte
|
ErrorBadThirdPartyName=Nom de tercer incorrecte
|
||||||
|
ErrorProdIdIsMandatory=El %s es obligatori
|
||||||
ErrorBadCustomerCodeSyntax=La sintaxi del codi client és incorrecta
|
ErrorBadCustomerCodeSyntax=La sintaxi del codi client és incorrecta
|
||||||
ErrorCustomerCodeRequired=Codi client obligatori
|
ErrorCustomerCodeRequired=Codi client obligatori
|
||||||
ErrorCustomerCodeAlreadyUsed=Codi de client ja utilitzat
|
ErrorCustomerCodeAlreadyUsed=Codi de client ja utilitzat
|
||||||
|
|||||||
@ -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.
|
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.
|
ErrorFromToAccountsMustDiffers=Source and targets bank accounts must be different.
|
||||||
ErrorBadThirdPartyName=Bad value for third party name
|
ErrorBadThirdPartyName=Bad value for third party name
|
||||||
|
ErrorProdIdIsMandatory=The %s is mandatory
|
||||||
ErrorBadCustomerCodeSyntax=Bad syntax for customer code
|
ErrorBadCustomerCodeSyntax=Bad syntax for customer code
|
||||||
ErrorCustomerCodeRequired=Customer code required
|
ErrorCustomerCodeRequired=Customer code required
|
||||||
ErrorCustomerCodeAlreadyUsed=Customer code already used
|
ErrorCustomerCodeAlreadyUsed=Customer code already used
|
||||||
|
|||||||
@ -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 <b>especie</b>.
|
ErrorCashAccountAcceptsOnlyCashMoney=Esta cuenta bancaria es de tipo caja y solo acepta el método de pago de tipo <b>especie</b>.
|
||||||
ErrorFromToAccountsMustDiffers=La cuenta origen y destino deben ser diferentes.
|
ErrorFromToAccountsMustDiffers=La cuenta origen y destino deben ser diferentes.
|
||||||
ErrorBadThirdPartyName=Nombre de tercero incorrecto
|
ErrorBadThirdPartyName=Nombre de tercero incorrecto
|
||||||
|
ErrorProdIdIsMandatory=El %s es obligatorio
|
||||||
ErrorBadCustomerCodeSyntax=La sintaxis del código cliente es incorrecta
|
ErrorBadCustomerCodeSyntax=La sintaxis del código cliente es incorrecta
|
||||||
ErrorCustomerCodeRequired=Código cliente obligatorio
|
ErrorCustomerCodeRequired=Código cliente obligatorio
|
||||||
ErrorCustomerCodeAlreadyUsed=Código de cliente ya utilizado
|
ErrorCustomerCodeAlreadyUsed=Código de cliente ya utilizado
|
||||||
|
|||||||
@ -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 <b>espèce</b>.
|
ErrorCashAccountAcceptsOnlyCashMoney=Ce compte bancaire est de type caisse et n'accepte que les mode de règlement de type <b>espèce</b>.
|
||||||
ErrorFromToAccountsMustDiffers=Le compte source et destination doivent être différents.
|
ErrorFromToAccountsMustDiffers=Le compte source et destination doivent être différents.
|
||||||
ErrorBadThirdPartyName=Nom de tiers incorrect
|
ErrorBadThirdPartyName=Nom de tiers incorrect
|
||||||
|
ErrorProdIdIsMandatory=Le %s est obligatoire
|
||||||
ErrorBadCustomerCodeSyntax=La syntaxe du code client est incorrecte
|
ErrorBadCustomerCodeSyntax=La syntaxe du code client est incorrecte
|
||||||
ErrorCustomerCodeRequired=Code client obligatoire
|
ErrorCustomerCodeRequired=Code client obligatoire
|
||||||
ErrorCustomerCodeAlreadyUsed=Code client déjà utilisé
|
ErrorCustomerCodeAlreadyUsed=Code client déjà utilisé
|
||||||
|
|||||||
@ -550,6 +550,10 @@ $profid[2][0]=$langs->trans("ProfId3");
|
|||||||
$profid[2][1]=$langs->transcountry('ProfId3', $mysoc->country_code);
|
$profid[2][1]=$langs->transcountry('ProfId3', $mysoc->country_code);
|
||||||
$profid[3][0]=$langs->trans("ProfId4");
|
$profid[3][0]=$langs->trans("ProfId4");
|
||||||
$profid[3][1]=$langs->transcountry('ProfId4', $mysoc->country_code);
|
$profid[3][1]=$langs->transcountry('ProfId4', $mysoc->country_code);
|
||||||
|
$profid[4][0]=$langs->trans("ProfId5");
|
||||||
|
$profid[4][1]=$langs->transcountry('ProfId5', $mysoc->country_code);
|
||||||
|
$profid[5][0]=$langs->trans("ProfId6");
|
||||||
|
$profid[5][1]=$langs->transcountry('ProfId6', $mysoc->country_code);
|
||||||
|
|
||||||
$var = true;
|
$var = true;
|
||||||
$i=0;
|
$i=0;
|
||||||
@ -557,6 +561,8 @@ $i=0;
|
|||||||
$nbofloop=count($profid);
|
$nbofloop=count($profid);
|
||||||
while ($i < $nbofloop)
|
while ($i < $nbofloop)
|
||||||
{
|
{
|
||||||
|
if ($profid[$i][1]!='-')
|
||||||
|
{
|
||||||
$var = !$var;
|
$var = !$var;
|
||||||
|
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
@ -595,6 +601,7 @@ while ($i < $nbofloop)
|
|||||||
print '</a></td>';
|
print '</a></td>';
|
||||||
}
|
}
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
|
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||||
* Copyright (C) 2008 Patrick Raguin <patrick.raguin@auguria.net>
|
* Copyright (C) 2008 Patrick Raguin <patrick.raguin@auguria.net>
|
||||||
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -203,8 +203,17 @@ if (empty($reshook))
|
|||||||
$action = ($action=='add'?'create':'edit');
|
$action = ($action=='add'?'create':'edit');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for duplicate prof id
|
// We set country_id, country_code and country for the selected country
|
||||||
for ($i = 1; $i < 3; $i++)
|
$object->country_id=GETPOST('country_id')?GETPOST('country_id'):$mysoc->country_id;
|
||||||
|
if ($object->country_id)
|
||||||
|
{
|
||||||
|
$tmparray=getCountry($object->country_id,'all');
|
||||||
|
$object->country_code=$tmparray['code'];
|
||||||
|
$object->country=$tmparray['label'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check for duplicate or mandatory prof id
|
||||||
|
for ($i = 1; $i < 5; $i++)
|
||||||
{
|
{
|
||||||
$slabel="idprof".$i;
|
$slabel="idprof".$i;
|
||||||
$_POST[$slabel]=trim($_POST[$slabel]);
|
$_POST[$slabel]=trim($_POST[$slabel]);
|
||||||
@ -218,8 +227,18 @@ if (empty($reshook))
|
|||||||
$action = ($action=='add'?'create':'edit');
|
$action = ($action=='add'?'create':'edit');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY';
|
||||||
|
if (! $vallabel && ! empty($conf->global->$idprof_mandatory))
|
||||||
|
{
|
||||||
|
$langs->load("errors");
|
||||||
|
$error++;
|
||||||
|
$errors[] = $langs->trans("ErrorProdIdIsMandatory", $langs->transcountry('ProfId'.$i, $object->country_code));
|
||||||
|
$action = ($action=='add'?'create':'edit');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
if ($action == 'add')
|
if ($action == 'add')
|
||||||
@ -834,7 +853,13 @@ else
|
|||||||
if ($idprof!='-')
|
if ($idprof!='-')
|
||||||
{
|
{
|
||||||
if (($j % 2) == 0) print '<tr>';
|
if (($j % 2) == 0) print '<tr>';
|
||||||
|
|
||||||
|
$idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY';
|
||||||
|
if(empty($conf->global->$idprof_mandatory))
|
||||||
print '<td>'.$idprof.'</td><td>';
|
print '<td>'.$idprof.'</td><td>';
|
||||||
|
else
|
||||||
|
print '<td><span class="fieldrequired">'.$idprof.'</td><td>';
|
||||||
|
|
||||||
$key='idprof'.$i;
|
$key='idprof'.$i;
|
||||||
print $formcompany->get_input_id_prof($i,'idprof'.$i,$object->$key,$object->country_code);
|
print $formcompany->get_input_id_prof($i,'idprof'.$i,$object->$key,$object->country_code);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -1271,7 +1296,13 @@ else
|
|||||||
if ($idprof!='-')
|
if ($idprof!='-')
|
||||||
{
|
{
|
||||||
if (($j % 2) == 0) print '<tr>';
|
if (($j % 2) == 0) print '<tr>';
|
||||||
|
|
||||||
|
$idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY';
|
||||||
|
if(empty($conf->global->$idprof_mandatory))
|
||||||
print '<td>'.$idprof.'</td><td>';
|
print '<td>'.$idprof.'</td><td>';
|
||||||
|
else
|
||||||
|
print '<td><span class="fieldrequired">'.$idprof.'</td><td>';
|
||||||
|
|
||||||
$key='idprof'.$i;
|
$key='idprof'.$i;
|
||||||
print $formcompany->get_input_id_prof($i,'idprof'.$i,$object->$key,$object->country_code);
|
print $formcompany->get_input_id_prof($i,'idprof'.$i,$object->$key,$object->country_code);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user