Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/comm/propal/list.php htdocs/commande/list.php
This commit is contained in:
commit
b24aac1e6b
@ -370,7 +370,7 @@ class BookKeeping extends CommonObject
|
|||||||
$sql .= ", ".(!empty($this->subledger_account) ? ("'".$this->db->escape($this->subledger_account)."'") : "NULL");
|
$sql .= ", ".(!empty($this->subledger_account) ? ("'".$this->db->escape($this->subledger_account)."'") : "NULL");
|
||||||
$sql .= ", ".(!empty($this->subledger_label) ? ("'".$this->db->escape($this->subledger_label)."'") : "NULL");
|
$sql .= ", ".(!empty($this->subledger_label) ? ("'".$this->db->escape($this->subledger_label)."'") : "NULL");
|
||||||
$sql .= ", '".$this->db->escape($this->numero_compte)."'";
|
$sql .= ", '".$this->db->escape($this->numero_compte)."'";
|
||||||
$sql .= ", ".(!empty($this->label_operation) ? ("'".$this->db->escape($this->label_operation)."'") : "NULL");
|
$sql .= ", ".(!empty($this->label_compte) ? ("'".$this->db->escape($this->label_compte)."'") : "NULL");
|
||||||
$sql .= ", '".$this->db->escape($this->label_operation)."'";
|
$sql .= ", '".$this->db->escape($this->label_operation)."'";
|
||||||
$sql .= ", ".$this->debit;
|
$sql .= ", ".$this->debit;
|
||||||
$sql .= ", ".$this->credit;
|
$sql .= ", ".$this->credit;
|
||||||
|
|||||||
@ -425,7 +425,7 @@ class Documents extends DolibarrApi
|
|||||||
throw new RestException(500, 'Error while fetching object: '.$object->error);
|
throw new RestException(500, 'Error while fetching object: '.$object->error);
|
||||||
}
|
}
|
||||||
|
|
||||||
$upload_dir = $conf->product->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 0, $object, 'product').dol_sanitizeFileName($object->ref);
|
$upload_dir = $conf->product->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, 'product');
|
||||||
}
|
}
|
||||||
elseif ($modulepart == 'agenda' || $modulepart == 'action' || $modulepart == 'event')
|
elseif ($modulepart == 'agenda' || $modulepart == 'action' || $modulepart == 'event')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -291,7 +291,7 @@ $help_url = 'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'
|
|||||||
//llxHeader('',$langs->trans('Proposal'),$help_url);
|
//llxHeader('',$langs->trans('Proposal'),$help_url);
|
||||||
|
|
||||||
$sql = 'SELECT';
|
$sql = 'SELECT';
|
||||||
if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
|
if ($sall || $search_product_category > 0 || $search_user > 0) $sql = 'SELECT DISTINCT';
|
||||||
$sql .= ' s.rowid as socid, s.nom as name, s.name_alias as alias, s.email, s.town, s.zip, s.fk_pays, s.client, s.code_client, ';
|
$sql .= ' s.rowid as socid, s.nom as name, s.name_alias as alias, s.email, s.town, s.zip, s.fk_pays, s.client, s.code_client, ';
|
||||||
$sql .= " typent.code as typent_code,";
|
$sql .= " typent.code as typent_code,";
|
||||||
$sql .= " ava.rowid as availability,";
|
$sql .= " ava.rowid as availability,";
|
||||||
|
|||||||
@ -282,7 +282,7 @@ $help_url = "EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_P
|
|||||||
// llxHeader('',$title,$help_url);
|
// llxHeader('',$title,$help_url);
|
||||||
|
|
||||||
$sql = 'SELECT';
|
$sql = 'SELECT';
|
||||||
if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
|
if ($sall || $search_product_category > 0 || $search_user > 0) $sql = 'SELECT DISTINCT';
|
||||||
$sql .= ' s.rowid as socid, s.nom as name, s.name_alias as name_alias, s.email, s.town, s.zip, s.fk_pays, s.client, s.code_client,';
|
$sql .= ' s.rowid as socid, s.nom as name, s.name_alias as name_alias, s.email, s.town, s.zip, s.fk_pays, s.client, s.code_client,';
|
||||||
$sql .= " typent.code as typent_code,";
|
$sql .= " typent.code as typent_code,";
|
||||||
$sql .= " state.code_departement as state_code, state.nom as state_name,";
|
$sql .= " state.code_departement as state_code, state.nom as state_name,";
|
||||||
|
|||||||
@ -416,7 +416,7 @@ $formcompany = new FormCompany($db);
|
|||||||
$thirdpartystatic = new Societe($db);
|
$thirdpartystatic = new Societe($db);
|
||||||
|
|
||||||
$sql = 'SELECT';
|
$sql = 'SELECT';
|
||||||
if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
|
if ($sall || $search_product_category > 0 || $search_user > 0) $sql = 'SELECT DISTINCT';
|
||||||
$sql .= ' f.rowid as id, f.ref, f.ref_client, f.type, f.note_private, f.note_public, f.increment, f.fk_mode_reglement, f.fk_cond_reglement, f.total as total_ht, f.tva as total_vat, f.total_ttc,';
|
$sql .= ' f.rowid as id, f.ref, f.ref_client, f.type, f.note_private, f.note_public, f.increment, f.fk_mode_reglement, f.fk_cond_reglement, f.total as total_ht, f.tva as total_vat, f.total_ttc,';
|
||||||
$sql .= ' f.localtax1 as total_localtax1, f.localtax2 as total_localtax2,';
|
$sql .= ' f.localtax1 as total_localtax1, f.localtax2 as total_localtax2,';
|
||||||
$sql .= ' f.fk_user_author,';
|
$sql .= ' f.fk_user_author,';
|
||||||
|
|||||||
@ -44,12 +44,12 @@ $nbofyear = 4;
|
|||||||
$year = GETPOST('year', 'int');
|
$year = GETPOST('year', 'int');
|
||||||
if (empty($year))
|
if (empty($year))
|
||||||
{
|
{
|
||||||
$year_current = strftime("%Y", dol_now());
|
$year_current = dol_print_date(dol_now(), "%Y");
|
||||||
$month_current = strftime("%m", dol_now());
|
$month_current = dol_print_date(dol_now(), "%m");
|
||||||
$year_start = $year_current - ($nbofyear - 1);
|
$year_start = $year_current - ($nbofyear - 1);
|
||||||
} else {
|
} else {
|
||||||
$year_current = $year;
|
$year_current = $year;
|
||||||
$month_current = strftime("%m", dol_now());
|
$month_current = dol_print_date(dol_now(), "%m");
|
||||||
$year_start = $year - ($nbofyear - 1);
|
$year_start = $year - ($nbofyear - 1);
|
||||||
}
|
}
|
||||||
$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear);
|
$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear);
|
||||||
@ -63,7 +63,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end
|
|||||||
{
|
{
|
||||||
// We define date_start and date_end
|
// We define date_start and date_end
|
||||||
$year_end = $year_start + ($nbofyear - 1);
|
$year_end = $year_start + ($nbofyear - 1);
|
||||||
$month_start = GETPOST("month") ?GETPOST("month") : ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
|
$month_start = GETPOSTISSET("month") ? GETPOST("month", 'int') : ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1);
|
||||||
if (!GETPOST('month'))
|
if (!GETPOST('month'))
|
||||||
{
|
{
|
||||||
if (!GETPOST("year") && $month_start > $month_current)
|
if (!GETPOST("year") && $month_start > $month_current)
|
||||||
@ -86,8 +86,10 @@ $userid = GETPOST('userid', 'int');
|
|||||||
$socid = GETPOST('socid', 'int');
|
$socid = GETPOST('socid', 'int');
|
||||||
|
|
||||||
$tmps = dol_getdate($date_start);
|
$tmps = dol_getdate($date_start);
|
||||||
|
$mothn_start = $tmps['mon'];
|
||||||
$year_start = $tmps['year'];
|
$year_start = $tmps['year'];
|
||||||
$tmpe = dol_getdate($date_end);
|
$tmpe = dol_getdate($date_end);
|
||||||
|
$month_end = $tmpe['mon'];
|
||||||
$year_end = $tmpe['year'];
|
$year_end = $tmpe['year'];
|
||||||
$nbofyear = ($year_end - $year_start) + 1;
|
$nbofyear = ($year_end - $year_start) + 1;
|
||||||
|
|
||||||
@ -306,7 +308,7 @@ $now = dol_now();
|
|||||||
$casenow = dol_print_date($now, "%Y-%m");
|
$casenow = dol_print_date($now, "%Y-%m");
|
||||||
|
|
||||||
// Loop on each month
|
// Loop on each month
|
||||||
$nb_mois_decalage = $conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START - 1) : 0;
|
$nb_mois_decalage = GETPOSTISSET('date_startmonth') ? (GETPOST('date_startmonth', 'int') - 1) : (empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? 0 : ($conf->global->SOCIETE_FISCAL_MONTH_START - 1));
|
||||||
for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++)
|
for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++)
|
||||||
{
|
{
|
||||||
$mois_modulo = $mois; // ajout
|
$mois_modulo = $mois; // ajout
|
||||||
@ -338,22 +340,23 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++)
|
|||||||
if ($annee >= $year_start) // We ignore $annee < $year_start, we loop on it to be able to make delta, nothing is output.
|
if ($annee >= $year_start) // We ignore $annee < $year_start, we loop on it to be able to make delta, nothing is output.
|
||||||
{
|
{
|
||||||
if ($modecompta == 'CREANCES-DETTES') {
|
if ($modecompta == 'CREANCES-DETTES') {
|
||||||
// Valeur CA du mois w/o VAT
|
// Value turnover of month w/o VAT
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
if ($cum_ht[$case])
|
if ($annee < $year_end || ($annee == $year_end && $mois <= $month_end)) {
|
||||||
{
|
if ($cum_ht[$case]) {
|
||||||
$now_show_delta = 1; // On a trouve le premier mois de la premiere annee generant du chiffre.
|
$now_show_delta = 1; // On a trouve le premier mois de la premiere annee generant du chiffre.
|
||||||
print '<a href="casoc.php?year='.$annee_decalage.'&month='.$mois_modulo.($modecompta ? '&modecompta='.$modecompta : '').'">'.price($cum_ht[$case], 1).'</a>';
|
print '<a href="casoc.php?year='.$annee_decalage.'&month='.$mois_modulo.($modecompta ? '&modecompta='.$modecompta : '').'">'.price($cum_ht[$case], 1).'</a>';
|
||||||
} else {
|
} else {
|
||||||
if ($minyearmonth < $case && $case <= max($maxyearmonth, $nowyearmonth)) { print '0'; } else { print ' '; }
|
if ($minyearmonth < $case && $case <= max($maxyearmonth, $nowyearmonth)) { print '0'; } else { print ' '; }
|
||||||
}
|
}
|
||||||
|
}
|
||||||
print "</td>";
|
print "</td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Valeur CA du mois
|
// Value turnover of month
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
if ($cum[$case])
|
if ($annee < $year_end || ($annee == $year_end && $mois <= $month_end)) {
|
||||||
{
|
if ($cum[$case]) {
|
||||||
$now_show_delta = 1; // On a trouve le premier mois de la premiere annee generant du chiffre.
|
$now_show_delta = 1; // On a trouve le premier mois de la premiere annee generant du chiffre.
|
||||||
if ($modecompta != 'BOOKKEEPING') print '<a href="casoc.php?year='.$annee_decalage.'&month='.$mois_modulo.($modecompta ? '&modecompta='.$modecompta : '').'">';
|
if ($modecompta != 'BOOKKEEPING') print '<a href="casoc.php?year='.$annee_decalage.'&month='.$mois_modulo.($modecompta ? '&modecompta='.$modecompta : '').'">';
|
||||||
print price($cum[$case], 1);
|
print price($cum[$case], 1);
|
||||||
@ -361,46 +364,52 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++)
|
|||||||
} else {
|
} else {
|
||||||
if ($minyearmonth < $case && $case <= max($maxyearmonth, $nowyearmonth)) { print '0'; } else { print ' '; }
|
if ($minyearmonth < $case && $case <= max($maxyearmonth, $nowyearmonth)) { print '0'; } else { print ' '; }
|
||||||
}
|
}
|
||||||
|
}
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
// Pourcentage du mois
|
// Percentage of month
|
||||||
|
print '<td class="borderrightlight right">';
|
||||||
|
//var_dump($annee.' '.$year_end.' '.$mois.' '.$month_end);
|
||||||
|
if ($annee < $year_end || ($annee == $year_end && $mois <= $month_end)) {
|
||||||
if ($annee_decalage > $minyear && $case <= $casenow)
|
if ($annee_decalage > $minyear && $case <= $casenow)
|
||||||
{
|
{
|
||||||
if ($cum[$caseprev] && $cum[$case])
|
if ($cum[$caseprev] && $cum[$case])
|
||||||
{
|
{
|
||||||
$percent = (round(($cum[$case] - $cum[$caseprev]) / $cum[$caseprev], 4) * 100);
|
$percent = (round(($cum[$case] - $cum[$caseprev]) / $cum[$caseprev], 4) * 100);
|
||||||
//print "X $cum[$case] - $cum[$caseprev] - $cum[$caseprev] - $percent X";
|
//print "X $cum[$case] - $cum[$caseprev] - $cum[$caseprev] - $percent X";
|
||||||
print '<td class="borderrightlight right">'.($percent >= 0 ? "+$percent" : "$percent").'%</td>';
|
print ($percent >= 0 ? "+$percent" : "$percent").'%';
|
||||||
}
|
}
|
||||||
if ($cum[$caseprev] && !$cum[$case])
|
if ($cum[$caseprev] && !$cum[$case])
|
||||||
{
|
{
|
||||||
print '<td class="borderrightlight right">-100%</td>';
|
print '-100%';
|
||||||
}
|
}
|
||||||
if (!$cum[$caseprev] && $cum[$case])
|
if (!$cum[$caseprev] && $cum[$case])
|
||||||
{
|
{
|
||||||
//print '<td class="right">+Inf%</td>';
|
//print '<td class="right">+Inf%</td>';
|
||||||
print '<td class="borderrightlight right">-</td>';
|
print '-';
|
||||||
}
|
}
|
||||||
if (isset($cum[$caseprev]) && !$cum[$caseprev] && !$cum[$case])
|
if (isset($cum[$caseprev]) && !$cum[$caseprev] && !$cum[$case])
|
||||||
{
|
{
|
||||||
print '<td class="borderrightlight right">+0%</td>';
|
print '+0%';
|
||||||
}
|
}
|
||||||
if (!isset($cum[$caseprev]) && !$cum[$case])
|
if (!isset($cum[$caseprev]) && !$cum[$case])
|
||||||
{
|
{
|
||||||
print '<td class="borderrightlight right">-</td>';
|
print '-';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print '<td class="borderrightlight right">';
|
|
||||||
if ($minyearmonth <= $case && $case <= $maxyearmonth) { print '-'; } else { print ' '; }
|
if ($minyearmonth <= $case && $case <= $maxyearmonth) { print '-'; } else { print ' '; }
|
||||||
print '</td>';
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
if ($annee_decalage < $year_end || ($annee_decalage == $year_end && $mois > 12 && $annee < $year_end)) print '<td width="15"> </td>';
|
if ($annee_decalage < $year_end || ($annee_decalage == $year_end && $mois > 12 && $annee < $year_end)) print '<td width="15"> </td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($annee < $year_end || ($annee == $year_end && $mois <= $month_end)) {
|
||||||
$total_ht[$annee] += ((!empty($cum_ht[$case])) ? $cum_ht[$case] : 0);
|
$total_ht[$annee] += ((!empty($cum_ht[$case])) ? $cum_ht[$case] : 0);
|
||||||
$total[$annee] += $cum[$case];
|
$total[$annee] += $cum[$case];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
@ -470,34 +479,37 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++)
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Affiche total
|
// Show total
|
||||||
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td>';
|
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td>';
|
||||||
for ($annee = $year_start; $annee <= $year_end; $annee++)
|
for ($annee = $year_start; $annee <= $year_end; $annee++)
|
||||||
{
|
{
|
||||||
if ($modecompta == 'CREANCES-DETTES') {
|
if ($modecompta == 'CREANCES-DETTES') {
|
||||||
// Montant total HT
|
// Montant total HT
|
||||||
if ($total_ht[$annee] || ($annee >= $minyear && $annee <= max($nowyear, $maxyear)))
|
if ($total_ht[$annee] || ($annee >= $minyear && $annee <= max($nowyear, $maxyear))) {
|
||||||
{
|
print '<td class="nowrap right">';
|
||||||
print '<td class="nowrap right">'.($total_ht[$annee] ?price($total_ht[$annee]) : "0")."</td>";
|
print ($total_ht[$annee] ?price($total_ht[$annee]) : "0");
|
||||||
|
print "</td>";
|
||||||
} else {
|
} else {
|
||||||
print '<td> </td>';
|
print '<td> </td>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Montant total
|
// Total amount
|
||||||
if ($total[$annee] || ($annee >= $minyear && $annee <= max($nowyear, $maxyear)))
|
if ($total[$annee] || ($annee >= $minyear && $annee <= max($nowyear, $maxyear))) {
|
||||||
{
|
print '<td class="nowrap right">';
|
||||||
print '<td class="nowrap right">'.($total[$annee] ?price($total[$annee]) : "0")."</td>";
|
print ($total[$annee] ?price($total[$annee]) : "0");
|
||||||
|
print "</td>";
|
||||||
} else {
|
} else {
|
||||||
print '<td> </td>';
|
print '<td> </td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pourcentage total
|
// Pourcentage total
|
||||||
if ($annee > $minyear && $annee <= max($nowyear, $maxyear))
|
if ($annee > $minyear && $annee <= max($nowyear, $maxyear)) {
|
||||||
{
|
|
||||||
if ($total[$annee - 1] && $total[$annee]) {
|
if ($total[$annee - 1] && $total[$annee]) {
|
||||||
$percent = (round(($total[$annee] - $total[$annee - 1]) / $total[$annee - 1], 4) * 100);
|
$percent = (round(($total[$annee] - $total[$annee - 1]) / $total[$annee - 1], 4) * 100);
|
||||||
print '<td class="nowrap borderrightlight right">'.($percent >= 0 ? "+$percent" : "$percent").'%</td>';
|
print '<td class="nowrap borderrightlight right">';
|
||||||
|
print ($percent >= 0 ? "+$percent" : "$percent").'%';
|
||||||
|
print '</td>';
|
||||||
}
|
}
|
||||||
if ($total[$annee - 1] && !$total[$annee])
|
if ($total[$annee - 1] && !$total[$annee])
|
||||||
{
|
{
|
||||||
|
|||||||
@ -5652,7 +5652,7 @@ function get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart = '
|
|||||||
$arrayforoldpath = array('cheque', 'category', 'holiday', 'supplier_invoice', 'invoice_supplier', 'mailing', 'supplier_payment');
|
$arrayforoldpath = array('cheque', 'category', 'holiday', 'supplier_invoice', 'invoice_supplier', 'mailing', 'supplier_payment');
|
||||||
if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) $arrayforoldpath[] = 'product';
|
if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) $arrayforoldpath[] = 'product';
|
||||||
if (!empty($level) && in_array($modulepart, $arrayforoldpath)) {
|
if (!empty($level) && in_array($modulepart, $arrayforoldpath)) {
|
||||||
// This part should be removed once all code is using "get_exdir" to forge path, with all parameters provided.
|
// This part should be removed once all code is using "get_exdir" to forge path, with parameter $object and $modulepart provided.
|
||||||
if (empty($alpha)) $num = preg_replace('/([^0-9])/i', '', $num);
|
if (empty($alpha)) $num = preg_replace('/([^0-9])/i', '', $num);
|
||||||
else $num = preg_replace('/^.*\-/i', '', $num);
|
else $num = preg_replace('/^.*\-/i', '', $num);
|
||||||
$num = substr("000".$num, -$level);
|
$num = substr("000".$num, -$level);
|
||||||
|
|||||||
@ -211,8 +211,9 @@ $helpurl = 'EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Ex
|
|||||||
llxHeader('', $langs->trans('ListOfSendings'), $helpurl);
|
llxHeader('', $langs->trans('ListOfSendings'), $helpurl);
|
||||||
|
|
||||||
$sql = 'SELECT';
|
$sql = 'SELECT';
|
||||||
if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
|
if ($sall || $search_product_category > 0 || $search_user > 0) $sql = 'SELECT DISTINCT';
|
||||||
$sql .= " e.rowid, e.ref, e.ref_customer, e.date_expedition as date_expedition, e.weight, e.weight_units, e.date_delivery as delivery_date, l.date_delivery as date_reception, e.fk_statut, e.billed, e.tracking_number,";
|
$sql .= " e.rowid, e.ref, e.ref_customer, e.date_expedition as date_expedition, e.weight, e.weight_units, e.date_delivery as delivery_date, e.fk_statut, e.billed, e.tracking_number,";
|
||||||
|
$sql .= " l.date_delivery as date_reception,";
|
||||||
$sql .= " s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, ";
|
$sql .= " s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, ";
|
||||||
$sql .= " typent.code as typent_code,";
|
$sql .= " typent.code as typent_code,";
|
||||||
$sql .= " state.code_departement as state_code, state.nom as state_name,";
|
$sql .= " state.code_departement as state_code, state.nom as state_name,";
|
||||||
@ -242,11 +243,12 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid =
|
|||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as ee ON e.rowid = ee.fk_source AND ee.sourcetype = 'shipping' AND ee.targettype = 'delivery'";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as ee ON e.rowid = ee.fk_source AND ee.sourcetype = 'shipping' AND ee.targettype = 'delivery'";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.rowid = ee.fk_target";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.rowid = ee.fk_target";
|
||||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON e.fk_user_author = u.rowid';
|
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON e.fk_user_author = u.rowid';
|
||||||
|
if ($search_user > 0) { // Get link to order to get the order id in eesource.fk_source
|
||||||
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as eesource ON eesource.fk_target = e.rowid AND eesource.targettype = 'shipping' AND eesource.sourcetype = 'commande'";
|
||||||
|
}
|
||||||
// We'll need this table joined to the select in order to filter by sale
|
// We'll need this table joined to the select in order to filter by sale
|
||||||
if ($search_sale > 0 || (!$user->rights->societe->client->voir && !$socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if ($search_sale > 0 || (!$user->rights->societe->client->voir && !$socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
if ($search_user > 0)
|
if ($search_user > 0) {
|
||||||
{
|
|
||||||
$sql .= ", ".MAIN_DB_PREFIX."element_contact as ec";
|
$sql .= ", ".MAIN_DB_PREFIX."element_contact as ec";
|
||||||
$sql .= ", ".MAIN_DB_PREFIX."c_type_contact as tc";
|
$sql .= ", ".MAIN_DB_PREFIX."c_type_contact as tc";
|
||||||
}
|
}
|
||||||
@ -274,6 +276,11 @@ if ($search_country) $sql .= " AND s.fk_pays IN (".$search_country.')';
|
|||||||
if ($search_tracking) $sql .= natural_search("e.tracking_number", $search_tracking);
|
if ($search_tracking) $sql .= natural_search("e.tracking_number", $search_tracking);
|
||||||
if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')';
|
if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')';
|
||||||
if ($search_sale > 0) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$search_sale;
|
if ($search_sale > 0) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$search_sale;
|
||||||
|
if ($search_user > 0)
|
||||||
|
{
|
||||||
|
// The contact on a shipment is also the contact of the order.
|
||||||
|
$sql .= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='commande' AND tc.source='internal' AND ec.element_id = eesource.fk_source AND ec.fk_socpeople = ".$db->escape($search_user);
|
||||||
|
}
|
||||||
if ($search_ref_exp) $sql .= natural_search('e.ref', $search_ref_exp);
|
if ($search_ref_exp) $sql .= natural_search('e.ref', $search_ref_exp);
|
||||||
if ($search_ref_liv) $sql .= natural_search('l.ref', $search_ref_liv);
|
if ($search_ref_liv) $sql .= natural_search('l.ref', $search_ref_liv);
|
||||||
if ($search_company) $sql .= natural_search('s.nom', $search_company);
|
if ($search_company) $sql .= natural_search('s.nom', $search_company);
|
||||||
|
|||||||
@ -535,7 +535,7 @@ $help_url = '';
|
|||||||
// llxHeader('',$title,$help_url);
|
// llxHeader('',$title,$help_url);
|
||||||
|
|
||||||
$sql = 'SELECT';
|
$sql = 'SELECT';
|
||||||
if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
|
if ($sall || $search_product_category > 0 || $search_user > 0) $sql = 'SELECT DISTINCT';
|
||||||
$sql .= ' s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, s.email,';
|
$sql .= ' s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, s.email,';
|
||||||
$sql .= " typent.code as typent_code,";
|
$sql .= " typent.code as typent_code,";
|
||||||
$sql .= " state.code_departement as state_code, state.nom as state_name,";
|
$sql .= " state.code_departement as state_code, state.nom as state_name,";
|
||||||
|
|||||||
@ -558,4 +558,3 @@ INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES
|
|||||||
ALTER TABLE llx_product_fournisseur_price ADD COLUMN packaging varchar(64);
|
ALTER TABLE llx_product_fournisseur_price ADD COLUMN packaging varchar(64);
|
||||||
|
|
||||||
ALTER TABLE llx_projet ADD COLUMN fk_opp_status_end integer DEFAULT NULL;
|
ALTER TABLE llx_projet ADD COLUMN fk_opp_status_end integer DEFAULT NULL;
|
||||||
|
|
||||||
|
|||||||
@ -59,6 +59,7 @@ ErrorDirNotFound=Directory <b>%s</b> not found (Bad path, wrong permissions or a
|
|||||||
ErrorFunctionNotAvailableInPHP=Function <b>%s</b> is required for this feature but is not available in this version/setup of PHP.
|
ErrorFunctionNotAvailableInPHP=Function <b>%s</b> is required for this feature but is not available in this version/setup of PHP.
|
||||||
ErrorDirAlreadyExists=A directory with this name already exists.
|
ErrorDirAlreadyExists=A directory with this name already exists.
|
||||||
ErrorFileAlreadyExists=A file with this name already exists.
|
ErrorFileAlreadyExists=A file with this name already exists.
|
||||||
|
ErrorDestinationAlreadyExists=Another file with the name <b>%s</b> already exists.
|
||||||
ErrorPartialFile=File not received completely by server.
|
ErrorPartialFile=File not received completely by server.
|
||||||
ErrorNoTmpDir=Temporary directy %s does not exists.
|
ErrorNoTmpDir=Temporary directy %s does not exists.
|
||||||
ErrorUploadBlockedByAddon=Upload blocked by a PHP/Apache plugin.
|
ErrorUploadBlockedByAddon=Upload blocked by a PHP/Apache plugin.
|
||||||
|
|||||||
@ -106,7 +106,7 @@ class Mo extends CommonObject
|
|||||||
'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61, 'notnull'=>-1,),
|
'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61, 'notnull'=>-1,),
|
||||||
'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>62, 'notnull'=>-1,),
|
'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>62, 'notnull'=>-1,),
|
||||||
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>500, 'notnull'=>1,),
|
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>500, 'notnull'=>1,),
|
||||||
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'position'=>501, 'notnull'=>-1,),
|
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'position'=>501, 'notnull'=>1,),
|
||||||
'date_valid' => array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-2, 'position'=>502,),
|
'date_valid' => array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-2, 'position'=>502,),
|
||||||
'fk_user_creat' => array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'position'=>510, 'notnull'=>1, 'foreignkey'=>'user.rowid',),
|
'fk_user_creat' => array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'position'=>510, 'notnull'=>1, 'foreignkey'=>'user.rowid',),
|
||||||
'fk_user_modif' => array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'position'=>511, 'notnull'=>-1,),
|
'fk_user_modif' => array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'position'=>511, 'notnull'=>-1,),
|
||||||
@ -1352,7 +1352,7 @@ class Mo extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public static function replaceThirdparty($db, $origin_id, $dest_id)
|
public static function replaceThirdparty($db, $origin_id, $dest_id)
|
||||||
{
|
{
|
||||||
$tables = array('mrp_production');
|
$tables = array('mrp_mo');
|
||||||
|
|
||||||
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);
|
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -249,7 +249,7 @@ $help_url = 'EN:Ask_Price_Supplier|FR:Demande_de_prix_fournisseur';
|
|||||||
//llxHeader('',$langs->trans('CommRequest'),$help_url);
|
//llxHeader('',$langs->trans('CommRequest'),$help_url);
|
||||||
|
|
||||||
$sql = 'SELECT';
|
$sql = 'SELECT';
|
||||||
if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
|
if ($sall || $search_product_category > 0 || $search_user > 0) $sql = 'SELECT DISTINCT';
|
||||||
$sql .= ' s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client,';
|
$sql .= ' s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client,';
|
||||||
$sql .= " typent.code as typent_code,";
|
$sql .= " typent.code as typent_code,";
|
||||||
$sql .= " state.code_departement as state_code, state.nom as state_name,";
|
$sql .= " state.code_departement as state_code, state.nom as state_name,";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user