29 |
|
|
30 |
require("./pre.inc.php"); |
require("./pre.inc.php"); |
31 |
require_once(DOL_DOCUMENT_ROOT."/contact.class.php"); |
require_once(DOL_DOCUMENT_ROOT."/contact.class.php"); |
32 |
require("../actioncomm.class.php"); |
require_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php"); |
33 |
include_once(DOL_DOCUMENT_ROOT."/facture.class.php"); |
require_once(DOL_DOCUMENT_ROOT."/facture.class.php"); |
34 |
|
|
35 |
$langs->load("companies"); |
$langs->load("companies"); |
36 |
if ($conf->facture->enabled) $langs->load("bills"); |
if ($conf->facture->enabled) $langs->load("bills"); |
206 |
print ($societe->prefix_comm?$societe->prefix_comm:' '); |
print ($societe->prefix_comm?$societe->prefix_comm:' '); |
207 |
print '</td>'; |
print '</td>'; |
208 |
|
|
209 |
if ($societe->client) { |
if ($societe->client) |
210 |
print '<tr>'; |
{ |
211 |
print '<td nowrap width="100">'.$langs->trans("CustomerCode"). '</td><td colspan="3">'. $societe->code_client . '</td>'; |
print '<tr>'; |
212 |
print '</tr>'; |
print '<td nowrap width="100">'.$langs->trans("CustomerCode"). '</td><td colspan="3">'. $societe->code_client . '</td>'; |
213 |
print '<tr>'; |
print '</tr>'; |
214 |
print '<td nowrap>'.$langs->trans("CustomerAccountancyCode").'</td><td colspan="3">'.$societe->code_compta.'</td>'; |
print '<tr>'; |
215 |
print '</tr>'; |
print '<td nowrap>'.$langs->trans("CustomerAccountancyCode").'</td><td colspan="3">'.$societe->code_compta.'</td>'; |
216 |
|
print '</tr>'; |
217 |
} |
} |
218 |
|
|
219 |
if ($societe->fournisseur) { |
if ($societe->fournisseur) |
220 |
print '<tr>'; |
{ |
221 |
print '<td nowrap>'.$langs->trans("SupplierCode"). '</td><td colspan="3">'. $societe->code_fournisseur . '</td>'; |
print '<tr>'; |
222 |
print '</tr>'; |
print '<td nowrap>'.$langs->trans("SupplierCode"). '</td><td colspan="3">'. $societe->code_fournisseur . '</td>'; |
223 |
print '<tr>'; |
print '</tr>'; |
224 |
print '<td nowrap>'.$langs->trans("SupplierAccountancyCode").'</td><td colspan="3">'.$societe->code_compta_fournisseur.'</td>'; |
print '<tr>'; |
225 |
print '</tr>'; |
print '<td nowrap>'.$langs->trans("SupplierAccountancyCode").'</td><td colspan="3">'.$societe->code_compta_fournisseur.'</td>'; |
226 |
|
print '</tr>'; |
227 |
} |
} |
228 |
|
|
229 |
print '<tr><td valign="top">'.$langs->trans("Address").'</td><td colspan="3">'.nl2br($societe->adresse)."</td></tr>"; |
print '<tr><td valign="top">'.$langs->trans("Address").'</td><td colspan="3">'.nl2br($societe->adresse)."</td></tr>"; |
248 |
$societe->typent= $arr[$societe->typent_id]; |
$societe->typent= $arr[$societe->typent_id]; |
249 |
print '<tr><td>'.$langs->trans("Type").'</td><td>'.$societe->typent.'</td><td>'.$langs->trans("Staff").'</td><td>'.$societe->effectif.'</td></tr>'; |
print '<tr><td>'.$langs->trans("Type").'</td><td>'.$societe->typent.'</td><td>'.$langs->trans("Staff").'</td><td>'.$societe->effectif.'</td></tr>'; |
250 |
|
|
251 |
// Remise permanente |
if ($societe->client == 1) |
252 |
print '<tr><td nowrap>'; |
{ |
253 |
print '<table width="100%" class="nobordernopadding"><tr><td nowrap>'; |
// Remise permanente |
254 |
print $langs->trans("CustomerRelativeDiscount"); |
print '<tr><td nowrap>'; |
255 |
print '<td><td align="right">'; |
print '<table width="100%" class="nobordernopadding"><tr><td nowrap>'; |
256 |
print '<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$societe->id.'">'.img_edit($langs->trans("Modify")).'</a>'; |
print $langs->trans("CustomerRelativeDiscount"); |
257 |
print '</td></tr></table>'; |
print '<td><td align="right">'; |
258 |
print '</td><td colspan="3">'.$societe->remise_client." %</td>"; |
print '<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$societe->id.'">'.img_edit($langs->trans("Modify")).'</a>'; |
259 |
print '</tr>'; |
print '</td></tr></table>'; |
260 |
|
print '</td><td colspan="3">'.$societe->remise_client." %</td>"; |
261 |
// Remise avoirs |
print '</tr>'; |
262 |
print '<tr><td nowrap>'; |
|
263 |
print '<table width="100%" class="nobordernopadding">'; |
// Remise avoirs |
264 |
print '<tr><td nowrap>'; |
print '<tr><td nowrap>'; |
265 |
print $langs->trans("CustomerAbsoluteDiscount"); |
print '<table width="100%" class="nobordernopadding">'; |
266 |
print '<td><td align="right">'; |
print '<tr><td nowrap>'; |
267 |
print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$societe->id.'">'.img_edit($langs->trans("Modify")).'</a>'; |
print $langs->trans("CustomerAbsoluteDiscount"); |
268 |
print '</td></tr></table>'; |
print '<td><td align="right">'; |
269 |
print '</td>'; |
print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$societe->id.'">'.img_edit($langs->trans("Modify")).'</a>'; |
270 |
print '<td colspan="3">'; |
print '</td></tr></table>'; |
271 |
$sql = "SELECT rc.amount_ht,".$db->pdate("rc.datec")." as dc"; |
print '</td>'; |
272 |
$sql .= " FROM ".MAIN_DB_PREFIX."societe_remise_except as rc"; |
print '<td colspan="3">'; |
273 |
$sql .= " WHERE rc.fk_soc =". $societe->id; |
$sql = "SELECT rc.amount_ht,".$db->pdate("rc.datec")." as dc"; |
274 |
$sql .= " AND rc.fk_user = ".$user->id." AND fk_facture IS NULL"; |
$sql .= " FROM ".MAIN_DB_PREFIX."societe_remise_except as rc"; |
275 |
$resql=$db->query($sql); |
$sql .= " WHERE rc.fk_soc =". $societe->id; |
276 |
if ($resql) |
$sql .= " AND rc.fk_user = ".$user->id." AND fk_facture IS NULL"; |
277 |
{ |
$resql=$db->query($sql); |
278 |
$obj = $db->fetch_object($resql); |
if ($resql) |
279 |
if ($obj->amount_ht) print $obj->amount_ht.' '.$langs->trans("Currency".$conf->monnaie); |
{ |
280 |
else print $langs->trans("None"); |
$obj = $db->fetch_object($resql); |
281 |
|
if ($obj->amount_ht) print $obj->amount_ht.' '.$langs->trans("Currency".$conf->monnaie); |
282 |
|
else print $langs->trans("None"); |
283 |
|
} |
284 |
|
print '</td>'; |
285 |
|
print '</tr>'; |
286 |
} |
} |
287 |
print '</td>'; |
|
|
print '</tr>'; |
|
|
|
|
288 |
print "</table>"; |
print "</table>"; |
289 |
|
|
290 |
print "</td>\n"; |
print "</td>\n"; |
296 |
$MAXLIST=5; |
$MAXLIST=5; |
297 |
$tableaushown=0; |
$tableaushown=0; |
298 |
|
|
299 |
/* |
/** |
300 |
* Dernieres factures |
* Dernieres factures |
301 |
*/ |
*/ |
302 |
if ($conf->facture->enabled && $user->rights->facture->lire) |
if ($conf->facture->enabled && $user->rights->facture->lire) |
343 |
print "</tr>\n"; |
print "</tr>\n"; |
344 |
$i++; |
$i++; |
345 |
} |
} |
346 |
$db->free(); |
$db->free($resql); |
347 |
} |
} |
348 |
else |
else |
349 |
{ |
{ |