@@ -1336,7 +1336,9 @@ discard block |
||
| 1336 | 1336 | $deliverableQty = min($quantityToBeDelivered, $stock); |
| 1337 | 1337 | } |
| 1338 | 1338 | |
| 1339 | - if ($deliverableQty < 0) $deliverableQty = 0; |
|
| 1339 | + if ($deliverableQty < 0) { |
|
| 1340 | + $deliverableQty = 0; |
|
| 1341 | + } |
|
| 1340 | 1342 | |
| 1341 | 1343 | $tooltip = ''; |
| 1342 | 1344 | if (!empty($alreadyQtySetted[$line->fk_product][intval($warehouse_id)])) { |
@@ -1435,7 +1437,9 @@ discard block |
||
| 1435 | 1437 | $deliverableQty = min($quantityToBeDelivered, $batchStock); |
| 1436 | 1438 | } |
| 1437 | 1439 | |
| 1438 | - if ($deliverableQty < 0) $deliverableQty = 0; |
|
| 1440 | + if ($deliverableQty < 0) { |
|
| 1441 | + $deliverableQty = 0; |
|
| 1442 | + } |
|
| 1439 | 1443 | |
| 1440 | 1444 | $inputName = 'qtyl'.$indiceAsked.'_'.$subj; |
| 1441 | 1445 | if (GETPOSTISSET($inputName)) { |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | $stockLocation = "ent1".$i."_0"; |
| 262 | 262 | $qty = "qtyl".$i; |
| 263 | 263 | |
| 264 | - $is_batch_or_serial=0; |
|
| 264 | + $is_batch_or_serial = 0; |
|
| 265 | 265 | if (!empty($objectsrc->lines[$i]->fk_product)) { |
| 266 | 266 | $resultFetch = $product->fetch($objectsrc->lines[$i]->fk_product, '', '', '', 1, 1, 1); |
| 267 | 267 | if ($resultFetch < 0) { |
@@ -287,9 +287,9 @@ discard block |
||
| 287 | 287 | //var_dump($sub_qty[$j]['id_batch']); |
| 288 | 288 | |
| 289 | 289 | //var_dump($qty);var_dump($batch);var_dump($sub_qty[$j]['q']);var_dump($sub_qty[$j]['id_batch']); |
| 290 | - if ($is_batch_or_serial==2 && $sub_qty[$j]['q']>1) { |
|
| 290 | + if ($is_batch_or_serial == 2 && $sub_qty[$j]['q'] > 1) { |
|
| 291 | 291 | setEventMessages($langs->trans("TooManyQtyForSerialNumber", $product->ref, ''), null, 'errors'); |
| 292 | - $totalqty=0; |
|
| 292 | + $totalqty = 0; |
|
| 293 | 293 | break 2; |
| 294 | 294 | } |
| 295 | 295 | $j++; |
@@ -1494,7 +1494,7 @@ discard block |
||
| 1494 | 1494 | $nbofsuggested = 0; |
| 1495 | 1495 | foreach ($product->stock_warehouse as $warehouse_id => $stock_warehouse) { |
| 1496 | 1496 | if (($stock_warehouse->real > 0) && (count($stock_warehouse->detail_batch))) { |
| 1497 | - $nbofsuggested+=count($stock_warehouse->detail_batch); |
|
| 1497 | + $nbofsuggested += count($stock_warehouse->detail_batch); |
|
| 1498 | 1498 | } |
| 1499 | 1499 | } |
| 1500 | 1500 | |
@@ -2284,7 +2284,7 @@ discard block |
||
| 2284 | 2284 | // only show lot numbers from src warehouse when shipping from multiple warehouses |
| 2285 | 2285 | $line->fetch($detail_batch->fk_expeditiondet); |
| 2286 | 2286 | } |
| 2287 | - $entrepot_id = !empty($detail_batch->entrepot_id)?$detail_batch->entrepot_id:$lines[$i]->entrepot_id; |
|
| 2287 | + $entrepot_id = !empty($detail_batch->entrepot_id) ? $detail_batch->entrepot_id : $lines[$i]->entrepot_id; |
|
| 2288 | 2288 | print '<td>'.$formproduct->selectLotStock($detail_batch->fk_origin_stock, 'batchl'.$detail_batch->fk_expeditiondet.'_'.$detail_batch->fk_origin_stock, '', 1, 0, $lines[$i]->fk_product, $entrepot_id).'</td>'; |
| 2289 | 2289 | print '</tr>'; |
| 2290 | 2290 | } |
@@ -2502,7 +2502,7 @@ discard block |
||
| 2502 | 2502 | || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->shipping_advance->validate))) { |
| 2503 | 2503 | print dolGetButtonAction('', $langs->trans('Validate'), 'default', $_SERVER["PHP_SELF"].'?action=valid&token='.newToken().'&id='.$object->id, ''); |
| 2504 | 2504 | } else { |
| 2505 | - print dolGetButtonAction($langs->trans('NotAllowed'), $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF']. '#', '', false); |
|
| 2505 | + print dolGetButtonAction($langs->trans('NotAllowed'), $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF'].'#', '', false); |
|
| 2506 | 2506 | } |
| 2507 | 2507 | } |
| 2508 | 2508 | |
@@ -2522,7 +2522,7 @@ discard block |
||
| 2522 | 2522 | if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->expedition->shipping_advance->send) { |
| 2523 | 2523 | print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', ''); |
| 2524 | 2524 | } else { |
| 2525 | - print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER['PHP_SELF']. '#', '', false); |
|
| 2525 | + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER['PHP_SELF'].'#', '', false); |
|
| 2526 | 2526 | } |
| 2527 | 2527 | } |
| 2528 | 2528 | } |
@@ -2550,7 +2550,7 @@ discard block |
||
| 2550 | 2550 | $label = "ClassifyBilled"; |
| 2551 | 2551 | $paramaction = 'classifybilled'; |
| 2552 | 2552 | } |
| 2553 | - print dolGetButtonAction('', $langs->trans($label), 'default', $_SERVER["PHP_SELF"].'?action='. $paramaction .'&token='.newToken().'&id='.$object->id, ''); |
|
| 2553 | + print dolGetButtonAction('', $langs->trans($label), 'default', $_SERVER["PHP_SELF"].'?action='.$paramaction.'&token='.newToken().'&id='.$object->id, ''); |
|
| 2554 | 2554 | } |
| 2555 | 2555 | } |
| 2556 | 2556 | |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | */ |
| 302 | 302 | /* END MODULEBUILDER TOPMENU */ |
| 303 | 303 | |
| 304 | - $this->menu[$r++]=array( |
|
| 304 | + $this->menu[$r++] = array( |
|
| 305 | 305 | // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode |
| 306 | 306 | 'fk_menu'=>'fk_mainmenu=ticket', |
| 307 | 307 | // This is a Left menu entry |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | // 0=Menu for internal users, 1=external users, 2=both |
| 323 | 323 | 'user'=>2, |
| 324 | 324 | ); |
| 325 | - $this->menu[$r++]=array( |
|
| 325 | + $this->menu[$r++] = array( |
|
| 326 | 326 | // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode |
| 327 | 327 | 'fk_menu'=>'fk_mainmenu=ticket,fk_leftmenu=knowledgemanagement_knowledgerecord', |
| 328 | 328 | // This is a Left menu entry |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | // 0=Menu for internal users, 1=external users, 2=both |
| 343 | 343 | 'user'=>2, |
| 344 | 344 | ); |
| 345 | - $this->menu[$r++]=array( |
|
| 345 | + $this->menu[$r++] = array( |
|
| 346 | 346 | // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode |
| 347 | 347 | 'fk_menu'=>'fk_mainmenu=ticket,fk_leftmenu=knowledgemanagement_knowledgerecord', |
| 348 | 348 | // This is a Left menu entry |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | $search_date_endday = GETPOST('search_date_endday', 'int'); |
| 65 | 65 | $search_date_endmonth = GETPOST('search_date_endmonth', 'int'); |
| 66 | 66 | $search_date_endyear = GETPOST('search_date_endyear', 'int'); |
| 67 | -$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
| 67 | +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
| 68 | 68 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
| 69 | 69 | $search_company = GETPOST("search_company", 'alpha'); |
| 70 | 70 | $search_paymenttype = GETPOST("search_paymenttype"); |
@@ -227,10 +227,10 @@ discard block |
||
| 227 | 227 | $sql .= natural_search('p.ref', $search_ref); |
| 228 | 228 | } |
| 229 | 229 | if ($search_date_start) { |
| 230 | - $sql .= " AND p.datep >= '" . $db->idate($search_date_start) . "'"; |
|
| 230 | + $sql .= " AND p.datep >= '".$db->idate($search_date_start)."'"; |
|
| 231 | 231 | } |
| 232 | 232 | if ($search_date_end) { |
| 233 | - $sql .= " AND p.datep <= '" . $db->idate($search_date_end) . "'"; |
|
| 233 | + $sql .= " AND p.datep <= '".$db->idate($search_date_end)."'"; |
|
| 234 | 234 | } |
| 235 | 235 | if ($search_account > 0) { |
| 236 | 236 | $sql .= " AND b.fk_account=".((int) $search_account); |
@@ -51,7 +51,9 @@ |
||
| 51 | 51 | $userid = GETPOST('userid', 'int'); |
| 52 | 52 | |
| 53 | 53 | // Security check |
| 54 | -if ($user->socid) $socid = $user->socid; |
|
| 54 | +if ($user->socid) { |
|
| 55 | + $socid = $user->socid; |
|
| 56 | +} |
|
| 55 | 57 | $result = restrictedArea($user, 'facture', $facid, ''); |
| 56 | 58 | |
| 57 | 59 | $search_ref = GETPOST("search_ref", "alpha"); |
@@ -404,7 +404,7 @@ |
||
| 404 | 404 | include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; |
| 405 | 405 | // End add extra fields object |
| 406 | 406 | $this->export_sql_start[$r] = 'SELECT DISTINCT '; |
| 407 | - $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'societe as s'; |
|
| 407 | + $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'societe as s'; |
|
| 408 | 408 | if (is_object($user) && empty($user->rights->societe->client->voir)) { |
| 409 | 409 | $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; |
| 410 | 410 | } |
@@ -107,7 +107,7 @@ |
||
| 107 | 107 | $out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>'; |
| 108 | 108 | } else { |
| 109 | 109 | $disabled = 0; |
| 110 | - if (!$obj->fk_statut > 0 && ! $draftonly) { |
|
| 110 | + if (!$obj->fk_statut > 0 && !$draftonly) { |
|
| 111 | 111 | $disabled = 1; |
| 112 | 112 | $labeltoshow .= ' ('.$langs->trans("Draft").')'; |
| 113 | 113 | } |
@@ -81,7 +81,9 @@ discard block |
||
| 81 | 81 | $sql .= " AND f.fk_soc = ".((int) $socid); |
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | - if ($draftonly) $sql .= " AND f.fk_statut = 0"; |
|
| 84 | + if ($draftonly) { |
|
| 85 | + $sql .= " AND f.fk_statut = 0"; |
|
| 86 | + } |
|
| 85 | 87 | |
| 86 | 88 | dol_syslog(get_class($this)."::select_intervention", LOG_DEBUG); |
| 87 | 89 | $resql = $this->db->query($sql); |
@@ -89,8 +91,11 @@ discard block |
||
| 89 | 91 | $out .= '<select id="interventionid" class="flat" name="'.dol_escape_htmltag($htmlname).'">'; |
| 90 | 92 | if ($showempty) { |
| 91 | 93 | $out .= '<option value="0">'; |
| 92 | - if (!is_numeric($showempty)) $out .= $showempty; |
|
| 93 | - else $out .= ' '; |
|
| 94 | + if (!is_numeric($showempty)) { |
|
| 95 | + $out .= $showempty; |
|
| 96 | + } else { |
|
| 97 | + $out .= ' '; |
|
| 98 | + } |
|
| 94 | 99 | $out .= '</option>'; |
| 95 | 100 | } |
| 96 | 101 | $num = $this->db->num_rows($resql); |
@@ -136,7 +136,7 @@ |
||
| 136 | 136 | $dataseries = dol_sort_array($dataseries, 1, 'desc'); |
| 137 | 137 | |
| 138 | 138 | // Merge all entrie after the $KEEPNFIRST one into one entry called "Other..." (to avoid to have too much entries in graphic). |
| 139 | -$KEEPNFIRST = 7; // Keep first $KEEPNFIRST one + 1 with the remain |
|
| 139 | +$KEEPNFIRST = 7; // Keep first $KEEPNFIRST one + 1 with the remain |
|
| 140 | 140 | $i = 0; |
| 141 | 141 | if (count($dataseries) > ($KEEPNFIRST + 1)) { |
| 142 | 142 | foreach ($dataseries as $key => $val) { |
@@ -1764,14 +1764,14 @@ |
||
| 1764 | 1764 | } |
| 1765 | 1765 | |
| 1766 | 1766 | /** |
| 1767 | - * Export format : iSuite Expert |
|
| 1768 | - * |
|
| 1769 | - * by OpenSolus [https://opensolus.fr] |
|
| 1770 | - * |
|
| 1771 | - * @param array $objectLines data |
|
| 1772 | - * |
|
| 1773 | - * @return void |
|
| 1774 | - */ |
|
| 1767 | + * Export format : iSuite Expert |
|
| 1768 | + * |
|
| 1769 | + * by OpenSolus [https://opensolus.fr] |
|
| 1770 | + * |
|
| 1771 | + * @param array $objectLines data |
|
| 1772 | + * |
|
| 1773 | + * @return void |
|
| 1774 | + */ |
|
| 1775 | 1775 | public function exportiSuiteExpert($objectLines) |
| 1776 | 1776 | { |
| 1777 | 1777 | $this->separator = ';'; |
@@ -950,63 +950,63 @@ discard block |
||
| 950 | 950 | } |
| 951 | 951 | |
| 952 | 952 | // FEC:JournalCode |
| 953 | - print $line->code_journal . $separator; |
|
| 953 | + print $line->code_journal.$separator; |
|
| 954 | 954 | |
| 955 | 955 | // FEC:JournalLib |
| 956 | - print dol_string_unaccent($langs->transnoentities($line->journal_label)) . $separator; |
|
| 956 | + print dol_string_unaccent($langs->transnoentities($line->journal_label)).$separator; |
|
| 957 | 957 | |
| 958 | 958 | // FEC:EcritureNum |
| 959 | - print $line->piece_num . $separator; |
|
| 959 | + print $line->piece_num.$separator; |
|
| 960 | 960 | |
| 961 | 961 | // FEC:EcritureDate |
| 962 | - print $date_document . $separator; |
|
| 962 | + print $date_document.$separator; |
|
| 963 | 963 | |
| 964 | 964 | // FEC:CompteNum |
| 965 | - print $line->numero_compte . $separator; |
|
| 965 | + print $line->numero_compte.$separator; |
|
| 966 | 966 | |
| 967 | 967 | // FEC:CompteLib |
| 968 | - print dol_string_unaccent($line->label_compte) . $separator; |
|
| 968 | + print dol_string_unaccent($line->label_compte).$separator; |
|
| 969 | 969 | |
| 970 | 970 | // FEC:CompAuxNum |
| 971 | - print $line->subledger_account . $separator; |
|
| 971 | + print $line->subledger_account.$separator; |
|
| 972 | 972 | |
| 973 | 973 | // FEC:CompAuxLib |
| 974 | - print dol_string_unaccent($line->subledger_label) . $separator; |
|
| 974 | + print dol_string_unaccent($line->subledger_label).$separator; |
|
| 975 | 975 | |
| 976 | 976 | // FEC:PieceRef |
| 977 | - print $line->doc_ref . $separator; |
|
| 977 | + print $line->doc_ref.$separator; |
|
| 978 | 978 | |
| 979 | 979 | // FEC:PieceDate |
| 980 | - print dol_string_unaccent($date_creation) . $separator; |
|
| 980 | + print dol_string_unaccent($date_creation).$separator; |
|
| 981 | 981 | |
| 982 | 982 | // FEC:EcritureLib |
| 983 | 983 | // Clean label operation to prevent problem on export with tab separator & other character |
| 984 | 984 | $line->label_operation = str_replace(array("\t", "\n", "\r"), " ", $line->label_operation); |
| 985 | - print dol_string_unaccent($line->label_operation) . $separator; |
|
| 985 | + print dol_string_unaccent($line->label_operation).$separator; |
|
| 986 | 986 | |
| 987 | 987 | // FEC:Debit |
| 988 | - print price2fec($line->debit) . $separator; |
|
| 988 | + print price2fec($line->debit).$separator; |
|
| 989 | 989 | |
| 990 | 990 | // FEC:Credit |
| 991 | - print price2fec($line->credit) . $separator; |
|
| 991 | + print price2fec($line->credit).$separator; |
|
| 992 | 992 | |
| 993 | 993 | // FEC:EcritureLet |
| 994 | - print $line->lettering_code . $separator; |
|
| 994 | + print $line->lettering_code.$separator; |
|
| 995 | 995 | |
| 996 | 996 | // FEC:DateLet |
| 997 | - print $date_lettering . $separator; |
|
| 997 | + print $date_lettering.$separator; |
|
| 998 | 998 | |
| 999 | 999 | // FEC:ValidDate |
| 1000 | - print $date_validation . $separator; |
|
| 1000 | + print $date_validation.$separator; |
|
| 1001 | 1001 | |
| 1002 | 1002 | // FEC:Montantdevise |
| 1003 | - print $line->multicurrency_amount . $separator; |
|
| 1003 | + print $line->multicurrency_amount.$separator; |
|
| 1004 | 1004 | |
| 1005 | 1005 | // FEC:Idevise |
| 1006 | - print $line->multicurrency_code . $separator; |
|
| 1006 | + print $line->multicurrency_code.$separator; |
|
| 1007 | 1007 | |
| 1008 | 1008 | // FEC_suppl:DateLimitReglmt |
| 1009 | - print $date_limit_payment . $separator; |
|
| 1009 | + print $date_limit_payment.$separator; |
|
| 1010 | 1010 | |
| 1011 | 1011 | // FEC_suppl:NumFacture |
| 1012 | 1012 | // Clean ref invoice to prevent problem on export with tab separator & other character |
@@ -1081,63 +1081,63 @@ discard block |
||
| 1081 | 1081 | } |
| 1082 | 1082 | |
| 1083 | 1083 | // FEC:JournalCode |
| 1084 | - print $line->code_journal . $separator; |
|
| 1084 | + print $line->code_journal.$separator; |
|
| 1085 | 1085 | |
| 1086 | 1086 | // FEC:JournalLib |
| 1087 | - print dol_string_unaccent($langs->transnoentities($line->journal_label)) . $separator; |
|
| 1087 | + print dol_string_unaccent($langs->transnoentities($line->journal_label)).$separator; |
|
| 1088 | 1088 | |
| 1089 | 1089 | // FEC:EcritureNum |
| 1090 | - print $line->piece_num . $separator; |
|
| 1090 | + print $line->piece_num.$separator; |
|
| 1091 | 1091 | |
| 1092 | 1092 | // FEC:EcritureDate |
| 1093 | - print $date_creation . $separator; |
|
| 1093 | + print $date_creation.$separator; |
|
| 1094 | 1094 | |
| 1095 | 1095 | // FEC:CompteNum |
| 1096 | - print length_accountg($line->numero_compte) . $separator; |
|
| 1096 | + print length_accountg($line->numero_compte).$separator; |
|
| 1097 | 1097 | |
| 1098 | 1098 | // FEC:CompteLib |
| 1099 | - print dol_string_unaccent($line->label_compte) . $separator; |
|
| 1099 | + print dol_string_unaccent($line->label_compte).$separator; |
|
| 1100 | 1100 | |
| 1101 | 1101 | // FEC:CompAuxNum |
| 1102 | - print length_accounta($line->subledger_account) . $separator; |
|
| 1102 | + print length_accounta($line->subledger_account).$separator; |
|
| 1103 | 1103 | |
| 1104 | 1104 | // FEC:CompAuxLib |
| 1105 | - print dol_string_unaccent($line->subledger_label) . $separator; |
|
| 1105 | + print dol_string_unaccent($line->subledger_label).$separator; |
|
| 1106 | 1106 | |
| 1107 | 1107 | // FEC:PieceRef |
| 1108 | - print $line->doc_ref . $separator; |
|
| 1108 | + print $line->doc_ref.$separator; |
|
| 1109 | 1109 | |
| 1110 | 1110 | // FEC:PieceDate |
| 1111 | - print $date_document . $separator; |
|
| 1111 | + print $date_document.$separator; |
|
| 1112 | 1112 | |
| 1113 | 1113 | // FEC:EcritureLib |
| 1114 | 1114 | // Clean label operation to prevent problem on export with tab separator & other character |
| 1115 | 1115 | $line->label_operation = str_replace(array("\t", "\n", "\r"), " ", $line->label_operation); |
| 1116 | - print dol_string_unaccent($line->label_operation) . $separator; |
|
| 1116 | + print dol_string_unaccent($line->label_operation).$separator; |
|
| 1117 | 1117 | |
| 1118 | 1118 | // FEC:Debit |
| 1119 | - print price2fec($line->debit) . $separator; |
|
| 1119 | + print price2fec($line->debit).$separator; |
|
| 1120 | 1120 | |
| 1121 | 1121 | // FEC:Credit |
| 1122 | - print price2fec($line->credit) . $separator; |
|
| 1122 | + print price2fec($line->credit).$separator; |
|
| 1123 | 1123 | |
| 1124 | 1124 | // FEC:EcritureLet |
| 1125 | - print $line->lettering_code . $separator; |
|
| 1125 | + print $line->lettering_code.$separator; |
|
| 1126 | 1126 | |
| 1127 | 1127 | // FEC:DateLet |
| 1128 | - print $date_lettering . $separator; |
|
| 1128 | + print $date_lettering.$separator; |
|
| 1129 | 1129 | |
| 1130 | 1130 | // FEC:ValidDate |
| 1131 | - print $date_validation . $separator; |
|
| 1131 | + print $date_validation.$separator; |
|
| 1132 | 1132 | |
| 1133 | 1133 | // FEC:Montantdevise |
| 1134 | - print $line->multicurrency_amount . $separator; |
|
| 1134 | + print $line->multicurrency_amount.$separator; |
|
| 1135 | 1135 | |
| 1136 | 1136 | // FEC:Idevise |
| 1137 | - print $line->multicurrency_code . $separator; |
|
| 1137 | + print $line->multicurrency_code.$separator; |
|
| 1138 | 1138 | |
| 1139 | 1139 | // FEC_suppl:DateLimitReglmt |
| 1140 | - print $date_limit_payment . $separator; |
|
| 1140 | + print $date_limit_payment.$separator; |
|
| 1141 | 1141 | |
| 1142 | 1142 | // FEC_suppl:NumFacture |
| 1143 | 1143 | // Clean ref invoice to prevent problem on export with tab separator & other character |
@@ -1577,7 +1577,7 @@ discard block |
||
| 1577 | 1577 | } |
| 1578 | 1578 | } elseif ($line->doc_type == 'customer_invoice') { |
| 1579 | 1579 | if (($line->amount) < 0) { |
| 1580 | - $nature_piece = 'AC'; // Currently, only the sign of amount allows to know the type of invoice (standard or credit note). Other solution is to analyse debit/credit/role of account. TODO Add column doc_type_long or make amount mandatory with rule on sign. |
|
| 1580 | + $nature_piece = 'AC'; // Currently, only the sign of amount allows to know the type of invoice (standard or credit note). Other solution is to analyse debit/credit/role of account. TODO Add column doc_type_long or make amount mandatory with rule on sign. |
|
| 1581 | 1581 | } else { |
| 1582 | 1582 | $nature_piece = 'FC'; |
| 1583 | 1583 | } |
@@ -1764,8 +1764,8 @@ discard block |
||
| 1764 | 1764 | ($line->doc_type == 'supplier_invoice' && !isset($supplier_invoices_infos[$line->fk_doc]))) { |
| 1765 | 1765 | if ($line->doc_type == 'customer_invoice') { |
| 1766 | 1766 | // Get new customer invoice ref and company name |
| 1767 | - $sql = 'SELECT f.ref, s.nom FROM ' . MAIN_DB_PREFIX . 'facture as f'; |
|
| 1768 | - $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'societe AS s ON f.fk_soc = s.rowid'; |
|
| 1767 | + $sql = 'SELECT f.ref, s.nom FROM '.MAIN_DB_PREFIX.'facture as f'; |
|
| 1768 | + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe AS s ON f.fk_soc = s.rowid'; |
|
| 1769 | 1769 | $sql .= ' WHERE f.rowid = '.((int) $line->fk_doc); |
| 1770 | 1770 | $resql = $this->db->query($sql); |
| 1771 | 1771 | if ($resql) { |
@@ -1778,8 +1778,8 @@ discard block |
||
| 1778 | 1778 | } |
| 1779 | 1779 | } else { |
| 1780 | 1780 | // Get new supplier invoice ref and company name |
| 1781 | - $sql = 'SELECT ff.ref, s.nom FROM ' . MAIN_DB_PREFIX . 'facture_fourn as ff'; |
|
| 1782 | - $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'societe AS s ON ff.fk_soc = s.rowid'; |
|
| 1781 | + $sql = 'SELECT ff.ref, s.nom FROM '.MAIN_DB_PREFIX.'facture_fourn as ff'; |
|
| 1782 | + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe AS s ON ff.fk_soc = s.rowid'; |
|
| 1783 | 1783 | $sql .= ' WHERE ff.rowid = '.((int) $line->fk_doc); |
| 1784 | 1784 | $resql = $this->db->query($sql); |
| 1785 | 1785 | if ($resql) { |
@@ -1802,28 +1802,28 @@ discard block |
||
| 1802 | 1802 | } |
| 1803 | 1803 | } |
| 1804 | 1804 | |
| 1805 | - print $line->id . $this->separator; |
|
| 1806 | - print $date . $this->separator; |
|
| 1807 | - print substr($line->code_journal, 0, 4) . $this->separator; |
|
| 1805 | + print $line->id.$this->separator; |
|
| 1806 | + print $date.$this->separator; |
|
| 1807 | + print substr($line->code_journal, 0, 4).$this->separator; |
|
| 1808 | 1808 | |
| 1809 | 1809 | if ((substr($line->numero_compte, 0, 3) == '411') || (substr($line->numero_compte, 0, 3) == '401')) { |
| 1810 | - print length_accountg($line->subledger_account) . $this->separator; |
|
| 1810 | + print length_accountg($line->subledger_account).$this->separator; |
|
| 1811 | 1811 | } else { |
| 1812 | - print substr(length_accountg($line->numero_compte), 0, 15) . $this->separator; |
|
| 1812 | + print substr(length_accountg($line->numero_compte), 0, 15).$this->separator; |
|
| 1813 | 1813 | } |
| 1814 | 1814 | //Libellé Auto |
| 1815 | 1815 | print $this->separator; |
| 1816 | 1816 | //print '"'.dol_trunc(str_replace('"', '', $line->label_operation),40,'right','UTF-8',1).'"' . $this->separator; |
| 1817 | 1817 | //Libellé manuel |
| 1818 | - print dol_trunc(str_replace('"', '', $invoice_ref . (!empty($company_name) ? ' - ' : '') . $company_name), 40, 'right', 'UTF-8', 1) . $this->separator; |
|
| 1818 | + print dol_trunc(str_replace('"', '', $invoice_ref.(!empty($company_name) ? ' - ' : '').$company_name), 40, 'right', 'UTF-8', 1).$this->separator; |
|
| 1819 | 1819 | //Numéro de pièce |
| 1820 | - print dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1) . $this->separator; |
|
| 1820 | + print dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1).$this->separator; |
|
| 1821 | 1821 | //Devise |
| 1822 | - print 'EUR' . $this->separator; |
|
| 1822 | + print 'EUR'.$this->separator; |
|
| 1823 | 1823 | //Amount |
| 1824 | - print price2num(abs($line->debit - $line->credit)) . $this->separator; |
|
| 1824 | + print price2num(abs($line->debit - $line->credit)).$this->separator; |
|
| 1825 | 1825 | //Sens |
| 1826 | - print $line->sens . $this->separator; |
|
| 1826 | + print $line->sens.$this->separator; |
|
| 1827 | 1827 | //Code lettrage |
| 1828 | 1828 | print $this->separator; |
| 1829 | 1829 | //Date Echéance |
@@ -1851,21 +1851,21 @@ discard block |
||
| 1851 | 1851 | } else { |
| 1852 | 1852 | $date = dol_print_date($line->doc_date, '%d%m%Y'); |
| 1853 | 1853 | |
| 1854 | - print $line->id . $this->separator; |
|
| 1855 | - print $date . $this->separator; |
|
| 1856 | - print substr($line->code_journal, 0, 4) . $this->separator; |
|
| 1854 | + print $line->id.$this->separator; |
|
| 1855 | + print $date.$this->separator; |
|
| 1856 | + print substr($line->code_journal, 0, 4).$this->separator; |
|
| 1857 | 1857 | if ((substr($line->numero_compte, 0, 3) == '411') || (substr($line->numero_compte, 0, 3) == '401')) { // TODO No hard code value |
| 1858 | - print length_accountg($line->subledger_account) . $this->separator; |
|
| 1858 | + print length_accountg($line->subledger_account).$this->separator; |
|
| 1859 | 1859 | } else { |
| 1860 | - print substr(length_accountg($line->numero_compte), 0, 15) . $this->separator; |
|
| 1860 | + print substr(length_accountg($line->numero_compte), 0, 15).$this->separator; |
|
| 1861 | 1861 | } |
| 1862 | 1862 | print $this->separator; |
| 1863 | 1863 | //print '"'.dol_trunc(str_replace('"', '', $line->label_operation),40,'right','UTF-8',1).'"' . $this->separator; |
| 1864 | - print '"' . dol_trunc(str_replace('"', '', $line->doc_ref), 40, 'right', 'UTF-8', 1) . '"' . $this->separator; |
|
| 1865 | - print '"' . dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1) . '"' . $this->separator; |
|
| 1866 | - print price2num(abs($line->debit - $line->credit)) . $this->separator; |
|
| 1867 | - print $line->sens . $this->separator; |
|
| 1868 | - print $date . $this->separator; |
|
| 1864 | + print '"'.dol_trunc(str_replace('"', '', $line->doc_ref), 40, 'right', 'UTF-8', 1).'"'.$this->separator; |
|
| 1865 | + print '"'.dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1).'"'.$this->separator; |
|
| 1866 | + print price2num(abs($line->debit - $line->credit)).$this->separator; |
|
| 1867 | + print $line->sens.$this->separator; |
|
| 1868 | + print $date.$this->separator; |
|
| 1869 | 1869 | print $this->separator; |
| 1870 | 1870 | print $this->separator; |
| 1871 | 1871 | print 'EUR'; |
@@ -1926,7 +1926,7 @@ discard block |
||
| 1926 | 1926 | $tab[] = $line->code_journal; |
| 1927 | 1927 | |
| 1928 | 1928 | $separator = $this->separator; |
| 1929 | - print implode($separator, $tab) . $this->end_line; |
|
| 1929 | + print implode($separator, $tab).$this->end_line; |
|
| 1930 | 1930 | } |
| 1931 | 1931 | } |
| 1932 | 1932 | |
@@ -116,10 +116,10 @@ discard block |
||
| 116 | 116 | |
| 117 | 117 | if (!$error) { |
| 118 | 118 | setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); |
| 119 | - $action = ''; // To avoid to execute next actions |
|
| 119 | + $action = ''; // To avoid to execute next actions |
|
| 120 | 120 | } else { |
| 121 | 121 | setEventMessages($langs->trans("Error"), null, 'errors'); |
| 122 | - $action = ''; // To avoid to execute next actions |
|
| 122 | + $action = ''; // To avoid to execute next actions |
|
| 123 | 123 | } |
| 124 | 124 | } |
| 125 | 125 | |
@@ -134,10 +134,10 @@ discard block |
||
| 134 | 134 | |
| 135 | 135 | if (!$error) { |
| 136 | 136 | setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); |
| 137 | - $action = ''; // To avoid to execute next actions |
|
| 137 | + $action = ''; // To avoid to execute next actions |
|
| 138 | 138 | } else { |
| 139 | 139 | setEventMessages($langs->trans("Error"), null, 'errors'); |
| 140 | - $action = ''; // To avoid to execute next actions |
|
| 140 | + $action = ''; // To avoid to execute next actions |
|
| 141 | 141 | } |
| 142 | 142 | } |
| 143 | 143 | |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | $sql .= " AND entity = ".$conf->entity; |
| 92 | 92 | |
| 93 | 93 | $resql = $db->query($sql); |
| 94 | - if ($resql) { |
|
| 94 | + if ($resql) { |
|
| 95 | 95 | $obj = $db->fetch_object($resql); |
| 96 | 96 | if ($obj) { |
| 97 | 97 | $max = intval($obj->max); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | $sql .= " AND entity = ".$conf->entity; |
| 128 | 128 | |
| 129 | 129 | $resql = $db->query($sql); |
| 130 | - if ($resql) { |
|
| 130 | + if ($resql) { |
|
| 131 | 131 | $obj = $db->fetch_object($resql); |
| 132 | 132 | if ($obj) { |
| 133 | 133 | $max = intval($obj->max); |
@@ -143,8 +143,13 @@ |
||
| 143 | 143 | $date = dol_now(); |
| 144 | 144 | $yymm = strftime("%y%m", $date); |
| 145 | 145 | |
| 146 | - if ($max >= (pow(10, 4) - 1)) $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is |
|
| 147 | - else $num = sprintf("%04s", $max + 1); |
|
| 146 | + if ($max >= (pow(10, 4) - 1)) { |
|
| 147 | + $num = $max + 1; |
|
| 148 | + } |
|
| 149 | + // If counter > 9999, we do not format on 4 chars, we take number as it is |
|
| 150 | + else { |
|
| 151 | + $num = sprintf("%04s", $max + 1); |
|
| 152 | + } |
|
| 148 | 153 | |
| 149 | 154 | dol_syslog("mod_sn_standard::getNextValue return ".$this->prefix.$yymm."-".$num); |
| 150 | 155 | return $this->prefix.$yymm."-".$num; |