Commit 065a478c656baeb37d636240d2a5372ee668cd4a

Authored by Darkjeff
1 parent e710f965
Exists in 3.5 and in 1 other branch 3.6

sales ventilation debug final

Showing 1 changed file with 12 additions and 8 deletions   Show diff stats
accountingex/customer/liste.php
... ... @@ -152,7 +152,7 @@ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product
152 152 $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON p.accountancy_code_sell = aa.account_number";
153 153 $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version";
154 154 $sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation = 0";
155   -$sql .= " AND (accsys.rowid='".$conf->global->CHARTOFACCOUNTS."' OR p.accountancy_code_sell IS NULL)";
  155 +//$sql .= " AND (accsys.rowid='".$conf->global->CHARTOFACCOUNTS."' OR p.accountancy_code_sell IS NULL)";
156 156 if (! empty($conf->multicompany->enabled)) {
157 157 $sql .= " AND f.entity = '" . $conf->entity . "'";
158 158 }
... ... @@ -202,18 +202,22 @@ if ($result) {
202 202 // issue : if we change product_type value in product DB it should differ from the value stored in facturedet DB !
203 203 $code_sell_notset = '';
204 204  
205   - if (empty($objp->fk_product)) {
  205 + if (empty($objp->code_sell)) {
206 206 $code_sell_notset = 'color:red';
207 207  
208   - if (! empty($objp->type)) {
  208 + }else {
  209 + $code_sell_notset = 'color:blue';
  210 +
  211 + }
  212 +
  213 +
209 214 if ($objp->type == 1) {
210 215 $objp->code_sell2 = (! empty($conf->global->COMPTA_SERVICE_SOLD_ACCOUNT) ? $conf->global->COMPTA_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
211 216  
212 217 } else {
213 218 $objp->code_sell2 = (! empty($conf->global->COMPTA_PRODUCT_SOLD_ACCOUNT) ? $conf->global->COMPTA_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
214 219 }
215   - } else {
216   - $code_sell_notset = 'color:blue';
  220 +
217 221  
218 222 if ($objp->type == 1) {
219 223 $objp->code_sell2 = (! empty($conf->global->COMPTA_SERVICE_SOLD_ACCOUNT) ? $conf->global->COMPTA_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
... ... @@ -221,8 +225,8 @@ $objp->code_sell2 = (! empty($conf->global->COMPTA_PRODUCT_SOLD_ACCOUNT) ? $conf
221 225 } else {
222 226 $objp->code_sell2 = (! empty($conf->global->COMPTA_PRODUCT_SOLD_ACCOUNT) ? $conf->global->COMPTA_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
223 227  
224   - }
225   - }
  228 +
  229 +
226 230 }
227 231  
228 232 print "<tr $bc[$var]>";
... ... @@ -261,7 +265,7 @@ $objp-&gt;code_sell2 = (! empty($conf-&gt;global-&gt;COMPTA_PRODUCT_SOLD_ACCOUNT) ? $conf
261 265 // Colonne choix du compte
262 266 print '<td align="center">';
263 267 //print $formventilation->select_account($objp->aarowid, 'codeventil[]', 1);
264   - print $form->selectarray("codeventil[]",$cgs, $cgn[$objp->code_sell]);
  268 + print $form->selectarray("codeventil[]",$cgs, $cgn[$objp->code_sell2]);
265 269 print '</td>';
266 270  
267 271 // Colonne choix ligne a ventiler
... ...