feat: 💩 Update Matricule format on employees import and order export
This commit is contained in:
parent
895843eccf
commit
f156dd62ef
2 changed files with 8 additions and 9 deletions
|
|
@ -87,8 +87,8 @@ class CsvOrderWrite extends CsvJobs
|
|||
$product = $orderline->product;
|
||||
// COLIS, KGM, PCE (faut il introduire un nouveau champs type unité de commande).
|
||||
$unité_commande = $product->order_unit ?? 'PCE';
|
||||
// Matricule rh transmis sans les lettres de l'identifiant windows.
|
||||
$code_client = preg_replace('/[^\d]/', '', $customer->salarie->matricule);
|
||||
// Matricule RH avec 6 caractères numériques, préfixé de deux zéros.
|
||||
$code_client = sprintf("00%s", $customer->salarie->matricule);
|
||||
|
||||
$oneline = [
|
||||
$product->foodProduct->no_art,
|
||||
|
|
|
|||
|
|
@ -108,14 +108,13 @@ class CsvSalariesReader extends CsvJobs
|
|||
$end_date = $line[$header['Date fin']] ?
|
||||
$line[$header['Date fin']] : $line[$header['Date fin prévue']];
|
||||
|
||||
if ($end_date != '') {
|
||||
$end_date = Carbon::createFromFormat('d/m/Y', $end_date);
|
||||
} else {
|
||||
$end_date = null;
|
||||
}
|
||||
$end_date = !empty($end_date) ? Carbon::createFromFormat('d/m/Y', $end_date) : null;
|
||||
|
||||
$salarie = Salarie::firstOrNew(['matricule' => $line[$header['Matricule']]]);
|
||||
$salarie->matricule = $line[$header['Matricule']];
|
||||
// Matricule RH avec 6 caractères numériques.
|
||||
$matricule = substr($line[$header['Matricule']], -6);
|
||||
|
||||
$salarie = Salarie::firstOrNew(['matricule' => $matricule]);
|
||||
$salarie->matricule = $matricule;
|
||||
$salarie->nom = $line[$header['Nom']];
|
||||
$salarie->prenom = $line[$header['Prénom']];
|
||||
$salarie->start_date = Carbon::createFromFormat('d/m/Y', $line[$header['Date début']]);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue