浏览代码

MMICompta : Quadra export : Use lib_alpha = 1st char of name only if customer not pro

Mathieu Moulin 1 年之前
父节点
当前提交
f292be43d0
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      htdocs/accountancy/class/accountancyexport.class.php

+ 6 - 2
htdocs/accountancy/class/accountancyexport.class.php

@@ -602,8 +602,12 @@ class AccountancyExport
 					$Tab['lib_compte'] = str_pad(self::trunc(dol_string_unaccent($data->subledger_label), 30), 30);
 
 				if ($data->doc_type == 'customer_invoice') {
-					if (!empty($conf->global->MMI_COMPTA_EXPORT_LIBALPHA_USE_1STLETTER))
-						$Tab['lib_alpha'] = strtoupper(str_pad('C'.self::trunc(dol_string_unaccent($data->subledger_label), 1), 6));
+					if (!empty($conf->global->MMI_COMPTA_EXPORT_LIBALPHA_USE_1STLETTER)) {
+						if (substr($Tab['num_compte'], 0, 7)=='0CLIENT')
+							$Tab['lib_alpha'] = strtoupper(str_pad('C'.substr($data->subledger_account, 7, 1), 6));
+						else
+							$Tab['lib_alpha'] = strtoupper(str_pad('C'.self::trunc(dol_string_unaccent($data->subledger_label), 6), 6));
+					}
 					else
 						$Tab['lib_alpha'] = strtoupper(str_pad('C'.self::trunc(dol_string_unaccent($data->subledger_label), 6), 6));
 					$Tab['filler'] = str_repeat(' ', 52);