Commit e710f965f100d25be02e49a28d64caec776fb5fb
1 parent
a6fc66f8
Exists in
3.5
and in
1 other branch
sales ventilation debug
to do - blue si fk_produit red si pas de référence produit - dans la requete il manque les lignes de ventes ayant une référence produit mais pas de compte comptable sur la fiche produit
Showing
1 changed file
with
13 additions
and
6 deletions
Show diff stats
accountingex/customer/liste.php
... | ... | @@ -144,7 +144,7 @@ if (! empty($conf->global->ACCOUNTINGEX_LIMIT_LIST_VENTILATION)) { |
144 | 144 | $offset = $limit * $page; |
145 | 145 | |
146 | 146 | $sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.total_ht, l.rowid, l.fk_code_ventilation,"; |
147 | -$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell"; | |
147 | +$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, l.product_type as type, p.accountancy_code_sell as code_sell"; | |
148 | 148 | $sql .= " , aa.rowid as aarowid"; |
149 | 149 | $sql .= " FROM " . MAIN_DB_PREFIX . "facture as f"; |
150 | 150 | $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_facture"; |
... | ... | @@ -202,22 +202,25 @@ 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->code_sell)) { | |
205 | + if (empty($objp->fk_product)) { | |
206 | 206 | $code_sell_notset = 'color:red'; |
207 | 207 | |
208 | 208 | if (! empty($objp->type)) { |
209 | 209 | if ($objp->type == 1) { |
210 | - $objp->code_sell2 = (! empty($conf->global->COMPTA_PRODUCT_SOLD_ACCOUNT) ? $conf->global->COMPTA_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); | |
210 | + $objp->code_sell2 = (! empty($conf->global->COMPTA_SERVICE_SOLD_ACCOUNT) ? $conf->global->COMPTA_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); | |
211 | + | |
211 | 212 | } else { |
212 | - $objp->code_sell2 = (! empty($conf->global->COMPTA_SERVICE_SOLD_ACCOUNT) ? $conf->global->COMPTA_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); | |
213 | +$objp->code_sell2 = (! empty($conf->global->COMPTA_PRODUCT_SOLD_ACCOUNT) ? $conf->global->COMPTA_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); | |
213 | 214 | } |
214 | 215 | } else { |
215 | 216 | $code_sell_notset = 'color:blue'; |
216 | 217 | |
217 | 218 | if ($objp->type == 1) { |
218 | - $objp->code_sell2 = (! empty($conf->global->COMPTA_PRODUCT_SOLD_ACCOUNT) ? $conf->global->COMPTA_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); | |
219 | + $objp->code_sell2 = (! empty($conf->global->COMPTA_SERVICE_SOLD_ACCOUNT) ? $conf->global->COMPTA_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); | |
220 | + | |
219 | 221 | } else { |
220 | - $objp->code_sell2 = (! empty($conf->global->COMPTA_SERVICE_SOLD_ACCOUNT) ? $conf->global->COMPTA_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); | |
222 | + $objp->code_sell2 = (! empty($conf->global->COMPTA_PRODUCT_SOLD_ACCOUNT) ? $conf->global->COMPTA_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); | |
223 | + | |
221 | 224 | } |
222 | 225 | } |
223 | 226 | } |
... | ... | @@ -247,6 +250,10 @@ if ($result) { |
247 | 250 | print price($objp->total_ht); |
248 | 251 | print '</td>'; |
249 | 252 | |
253 | + print '<td align="right">'; | |
254 | + print $objp->type; | |
255 | + print '</td>'; | |
256 | + | |
250 | 257 | print '<td align="center" style="' . $code_sell_notset . '">'; |
251 | 258 | print $objp->code_sell2; |
252 | 259 | print '</td>'; | ... | ... |