forked from Wavyzz/dolibarr
Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/fourn/facture/card.php
This commit is contained in:
@@ -133,7 +133,7 @@ class box_factures_fourn extends ModeleBoxes
|
|||||||
|
|
||||||
$thirdpartystatic->id = $objp->socid;
|
$thirdpartystatic->id = $objp->socid;
|
||||||
$thirdpartystatic->name = $objp->name;
|
$thirdpartystatic->name = $objp->name;
|
||||||
//$thirdpartystatic->name_alias = $objp->name_alias;
|
$thirdpartystatic->name_alias = $objp->name_alias;
|
||||||
$thirdpartystatic->code_fournisseur = $objp->code_fournisseur;
|
$thirdpartystatic->code_fournisseur = $objp->code_fournisseur;
|
||||||
$thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
|
$thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
|
||||||
$thirdpartystatic->fournisseur = $objp->fournisseur;
|
$thirdpartystatic->fournisseur = $objp->fournisseur;
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ class box_factures_fourn_imp extends ModeleBoxes
|
|||||||
|
|
||||||
$thirdpartystatic->id = $objp->socid;
|
$thirdpartystatic->id = $objp->socid;
|
||||||
$thirdpartystatic->name = $objp->name;
|
$thirdpartystatic->name = $objp->name;
|
||||||
//$thirdpartystatic->name_alias = $objp->name_alias;
|
$thirdpartystatic->name_alias = $objp->name_alias;
|
||||||
$thirdpartystatic->code_fournisseur = $objp->code_fournisseur;
|
$thirdpartystatic->code_fournisseur = $objp->code_fournisseur;
|
||||||
$thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
|
$thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
|
||||||
$thirdpartystatic->fournisseur = $objp->fournisseur;
|
$thirdpartystatic->fournisseur = $objp->fournisseur;
|
||||||
|
|||||||
@@ -672,25 +672,25 @@ function checkVal($out = '', $check = 'alphanohtml', $filter = null, $options =
|
|||||||
if (preg_match('/[^a-z0-9_\-\.,]+/i', $out)) $out = '';
|
if (preg_match('/[^a-z0-9_\-\.,]+/i', $out)) $out = '';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'nohtml':
|
case 'nohtml': // No html
|
||||||
$out = dol_string_nohtmltag($out, 0);
|
$out = dol_string_nohtmltag($out, 0);
|
||||||
break;
|
break;
|
||||||
case 'alpha': // No html and no ../ and " replaced with ''
|
case 'alpha': // No html and no ../ and "
|
||||||
case 'alphanohtml': // Recommended for most scalar parameters and search parameters
|
case 'alphanohtml': // Recommended for most scalar parameters and search parameters
|
||||||
if (!is_array($out)) {
|
if (!is_array($out)) {
|
||||||
// '"' is dangerous because param in url can close the href= or src= and add javascript functions.
|
// '"' is dangerous because param in url can close the href= or src= and add javascript functions.
|
||||||
// '../' is dangerous because it allows dir transversals
|
// '../' is dangerous because it allows dir transversals
|
||||||
$out = str_replace(array('"', '"'), "''", trim($out));
|
$out = str_replace(array('"', '"'), '', trim($out));
|
||||||
$out = str_replace(array('../'), '', $out);
|
$out = str_replace(array('../'), '', $out);
|
||||||
// keep lines feed
|
// keep lines feed
|
||||||
$out = dol_string_nohtmltag($out, 0);
|
$out = dol_string_nohtmltag($out, 0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'alphawithlgt': // No " and no ../ but we keep < > tags
|
case 'alphawithlgt': // No " and no ../ but we keep < > tags. Can be used for email string like "Name <email>"
|
||||||
if (!is_array($out)) {
|
if (!is_array($out)) {
|
||||||
// '"' is dangerous because param in url can close the href= or src= and add javascript functions.
|
// '"' is dangerous because param in url can close the href= or src= and add javascript functions.
|
||||||
// '../' is dangerous because it allows dir transversals
|
// '../' is dangerous because it allows dir transversals
|
||||||
$out = str_replace(array('"', '"'), "", trim($out));
|
$out = str_replace(array('"', '"'), '', trim($out));
|
||||||
$out = str_replace(array('../'), '', $out);
|
$out = str_replace(array('../'), '', $out);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -656,10 +656,10 @@ if (empty($reshook))
|
|||||||
if ($ret < 0) $error++;
|
if ($ret < 0) $error++;
|
||||||
|
|
||||||
$dateinvoice = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
|
$dateinvoice = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
|
||||||
$datedue = dol_mktime(12, 0, 0, $_POST['echmonth'], $_POST['echday'], $_POST['echyear']);
|
$datedue = dol_mktime(12, 0, 0, GETPOST('echmonth', 'int'), GETPOST('echday', 'int'), GETPOST('echyear', 'int'));
|
||||||
|
|
||||||
// Replacement invoice
|
// Replacement invoice
|
||||||
if ($_POST['type'] == FactureFournisseur::TYPE_REPLACEMENT)
|
if (GETPOST('type') == FactureFournisseur::TYPE_REPLACEMENT)
|
||||||
{
|
{
|
||||||
if (empty($dateinvoice)) {
|
if (empty($dateinvoice)) {
|
||||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('DateInvoice')), null, 'errors');
|
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('DateInvoice')), null, 'errors');
|
||||||
@@ -713,7 +713,7 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Credit note invoice
|
// Credit note invoice
|
||||||
if ($_POST['type'] == FactureFournisseur::TYPE_CREDIT_NOTE)
|
if (GETPOST('type') == FactureFournisseur::TYPE_CREDIT_NOTE)
|
||||||
{
|
{
|
||||||
$sourceinvoice = GETPOST('fac_avoir', 'int');
|
$sourceinvoice = GETPOST('fac_avoir', 'int');
|
||||||
if (!($sourceinvoice > 0) && empty($conf->global->INVOICE_CREDIT_NOTE_STANDALONE))
|
if (!($sourceinvoice > 0) && empty($conf->global->INVOICE_CREDIT_NOTE_STANDALONE))
|
||||||
@@ -837,7 +837,7 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Standard or deposit
|
// Standard or deposit
|
||||||
if ($_POST['type'] == FactureFournisseur::TYPE_STANDARD || $_POST['type'] == FactureFournisseur::TYPE_DEPOSIT)
|
if (GETPOST('type') == FactureFournisseur::TYPE_STANDARD || GETPOST('type') == FactureFournisseur::TYPE_DEPOSIT)
|
||||||
{
|
{
|
||||||
if (GETPOST('socid', 'int') < 1)
|
if (GETPOST('socid', 'int') < 1)
|
||||||
{
|
{
|
||||||
@@ -869,11 +869,12 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
$tmpproject = GETPOST('projectid', 'int');
|
$tmpproject = GETPOST('projectid', 'int');
|
||||||
|
|
||||||
// Creation facture
|
// Creation invoice
|
||||||
$object->ref = $_POST['ref'];
|
$object->ref = GETPOST('ref', 'nohtml');
|
||||||
$object->ref_supplier = $_POST['ref_supplier'];
|
$object->ref_supplier = GETPOST('ref_supplier', 'nohtml');
|
||||||
$object->socid = $_POST['socid'];
|
$object->socid = GETPOST('socid', 'int');
|
||||||
$object->libelle = $_POST['label'];
|
$object->libelle = GETPOST('label', 'nohtml'); // deprecated
|
||||||
|
$object->label = GETPOST('label', 'nohtml');
|
||||||
$object->date = $dateinvoice;
|
$object->date = $dateinvoice;
|
||||||
$object->date_echeance = $datedue;
|
$object->date_echeance = $datedue;
|
||||||
$object->note_public = GETPOST('note_public', 'restricthtml');
|
$object->note_public = GETPOST('note_public', 'restricthtml');
|
||||||
@@ -894,7 +895,7 @@ if (empty($reshook))
|
|||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
|
|
||||||
// If creation from another object of another module
|
// If creation from another object of another module
|
||||||
if (!$error && $_POST['origin'] && $_POST['originid'])
|
if (!$error && GETPOST('origin', 'alpha') && GETPOST('originid'))
|
||||||
{
|
{
|
||||||
// Parse element/subelement (ex: project_task)
|
// Parse element/subelement (ex: project_task)
|
||||||
$element = $subelement = GETPOST('origin', 'alpha');
|
$element = $subelement = GETPOST('origin', 'alpha');
|
||||||
@@ -1385,7 +1386,9 @@ if (empty($reshook))
|
|||||||
|
|
||||||
$fk_unit = GETPOST('units', 'alpha');
|
$fk_unit = GETPOST('units', 'alpha');
|
||||||
|
|
||||||
$tva_tx = price2num($tva_tx); // When vat is text input field
|
if (!preg_match('/\((.*)\)/', $tva_tx)) {
|
||||||
|
$tva_tx = price2num($tva_tx); // $txtva can have format '5,1' or '5.1' or '5.1(XXX)', we must clean only if '5,1'
|
||||||
|
}
|
||||||
|
|
||||||
// Local Taxes
|
// Local Taxes
|
||||||
$localtax1_tx = get_localtax($tva_tx, 1, $mysoc, $object->thirdparty);
|
$localtax1_tx = get_localtax($tva_tx, 1, $mysoc, $object->thirdparty);
|
||||||
|
|||||||
@@ -339,6 +339,7 @@ foreach ($search as $key => $val)
|
|||||||
}
|
}
|
||||||
if ($search['fk_statut'] == 'openall' || in_array('openall', $search['fk_statut'])) {
|
if ($search['fk_statut'] == 'openall' || in_array('openall', $search['fk_statut'])) {
|
||||||
$newarrayofstatus[] = Ticket::STATUS_NOT_READ;
|
$newarrayofstatus[] = Ticket::STATUS_NOT_READ;
|
||||||
|
$newarrayofstatus[] = Ticket::STATUS_READ;
|
||||||
$newarrayofstatus[] = Ticket::STATUS_ASSIGNED;
|
$newarrayofstatus[] = Ticket::STATUS_ASSIGNED;
|
||||||
$newarrayofstatus[] = Ticket::STATUS_IN_PROGRESS;
|
$newarrayofstatus[] = Ticket::STATUS_IN_PROGRESS;
|
||||||
$newarrayofstatus[] = Ticket::STATUS_NEED_MORE_INFO;
|
$newarrayofstatus[] = Ticket::STATUS_NEED_MORE_INFO;
|
||||||
|
|||||||
Reference in New Issue
Block a user