150 |
|
|
151 |
if ($_GET["action"] == 'create' || $_POST["action"] == 'create') |
if ($_GET["action"] == 'create' || $_POST["action"] == 'create') |
152 |
{ |
{ |
153 |
if ($user->rights->societe->creer) |
if ($user->rights->societe->creer) |
154 |
{ |
{ |
155 |
/* |
/* |
156 |
* Fiche societe en mode création (Creation en 1 ou 2 temps selon COMPANY_CREATE_TWO_STEPS) |
* Fiche societe en mode création (Creation en 1 ou 2 temps selon COMPANY_CREATE_TWO_STEPS) |
157 |
*/ |
*/ |
158 |
$soc->fournisseur=0; |
$soc->fournisseur=0; |
159 |
if ($_GET["type"]=='f') { $soc->fournisseur=1; } |
if ($_GET["type"]=='f') { $soc->fournisseur=1; } |
160 |
if ($_GET["type"]=='c') { $soc->client=1; } |
if ($_GET["type"]=='c') { $soc->client=1; } |
161 |
if ($_GET["type"]=='p') { $soc->client=2; } |
if ($_GET["type"]=='p') { $soc->client=2; } |
162 |
if ($_POST["nom"]) { $soc->nom=$_POST["nom"]; } |
if ($_POST["nom"]) { $soc->nom=$_POST["nom"]; } |
163 |
|
|
164 |
print_titre($langs->trans("NewCompany")); |
print_titre($langs->trans("NewCompany")); |
165 |
print "<br>\n"; |
print "<br>\n"; |
166 |
|
|
167 |
if ($soc->error) |
if ($soc->error) |
168 |
{ |
{ |
169 |
print '<div class="error">'; |
print '<div class="error">'; |
170 |
print nl2br($soc->error); |
print nl2br($soc->error); |
171 |
print '</div>'; |
print '</div>'; |
172 |
} |
} |
173 |
|
|
174 |
include("./soc.js.php"); |
include("./soc.js.php"); |
175 |
|
|
176 |
print '<script language="javascript">'."\n"; |
print '<script language="javascript">'."\n"; |
177 |
print $js_OpenPopupWindow; |
print $js_OpenPopupWindow; |
178 |
print "\n</script>\n"; |
print "\n</script>\n"; |
179 |
|
|
180 |
print '<form action="soc.php" method="post" name="formsoc">'; |
print '<form action="soc.php" method="post" name="formsoc">'; |
181 |
|
|
182 |
print '<input type="hidden" name="codeclient_modifiable" value="1">'; |
print '<input type="hidden" name="codeclient_modifiable" value="1">'; |
183 |
print '<input type="hidden" name="codefournisseur_modifiable" value="1">'; |
print '<input type="hidden" name="codefournisseur_modifiable" value="1">'; |
184 |
|
|
185 |
print '<table class="border" width="100%">'; |
print '<table class="border" width="100%">'; |
186 |
|
|
187 |
print '<tr><td>'.$langs->trans('Name').'</td><td><input type="text" size="30" name="nom" value="'.$soc->nom.'"></td>'; |
print '<tr><td>'.$langs->trans('Name').'</td><td><input type="text" size="30" name="nom" value="'.$soc->nom.'"></td>'; |
188 |
print '<td>'.$langs->trans('Prefix').'</td><td><input type="text" size="5" name="prefix_comm" value="'.$soc->prefix_comm.'"></td></tr>'; |
print '<td>'.$langs->trans('Prefix').'</td><td><input type="text" size="5" name="prefix_comm" value="'.$soc->prefix_comm.'"></td></tr>'; |
189 |
|
|
190 |
// On positionne pays_id, pays_code et libelle du pays choisi |
// On positionne pays_id, pays_code et libelle du pays choisi |
191 |
$soc->pays_id=$_POST["pays_id"]?$_POST["pays_id"]:(defined(MAIN_INFO_SOCIETE_PAYS)?MAIN_INFO_SOCIETE_PAYS:''); |
$soc->pays_id=$_POST["pays_id"]?$_POST["pays_id"]:(defined(MAIN_INFO_SOCIETE_PAYS)?MAIN_INFO_SOCIETE_PAYS:''); |
192 |
if ($soc->pays_id) |
if ($soc->pays_id) |
193 |
{ |
{ |
194 |
$sql = "SELECT code, libelle from ".MAIN_DB_PREFIX."c_pays where rowid = ".$soc->pays_id; |
$sql = "SELECT code, libelle from ".MAIN_DB_PREFIX."c_pays where rowid = ".$soc->pays_id; |
195 |
$resql=$db->query($sql); |
$resql=$db->query($sql); |
196 |
if ($resql) |
if ($resql) |
197 |
{ |
{ |
198 |
$obj = $db->fetch_object($resql); |
$obj = $db->fetch_object($resql); |
199 |
} |
} |
200 |
else |
else |
201 |
{ |
{ |
202 |
dolibarr_print_error($db); |
dolibarr_print_error($db); |
203 |
} |
} |
204 |
$soc->pays_code=$obj->code; |
$soc->pays_code=$obj->code; |
205 |
$soc->pays=$obj->libelle; |
$soc->pays=$obj->libelle; |
206 |
} |
} |
207 |
|
|
208 |
if ($step==1 && defined("COMPANY_CREATE_TWO_STEPS")) |
if ($step==1 && defined("COMPANY_CREATE_TWO_STEPS")) |
209 |
{ |
{ |
210 |
print '<tr><td width="140">'.$langs->trans('Country').'</td><td colspan="3">'; |
print '<tr><td width="25%">'.$langs->trans('Country').'</td><td colspan="3">'; |
211 |
$form->select_pays($soc->pays_id); |
$form->select_pays($soc->pays_id); |
212 |
print '</td></tr>'; |
print '</td></tr>'; |
213 |
|
|
214 |
print '<input type="hidden" name="step" value="'.$step.'">'; |
print '<input type="hidden" name="step" value="'.$step.'">'; |
215 |
print '<input type="hidden" name="action" value="create">'; |
print '<input type="hidden" name="action" value="create">'; |
216 |
print '<tr><td colspan="4" align="center"><input type="submit" name="createnextstep" value="'.$langs->trans('NextStep').'"></td></tr>'."\n"; |
print '<tr><td colspan="4" align="center"><input type="submit" class="button" name="createnextstep" value="'.$langs->trans('NextStep').'"></td></tr>'."\n"; |
217 |
|
|
218 |
} |
} |
219 |
if ($step==2 || ! defined("COMPANY_CREATE_TWO_STEPS")) { |
if ($step==2 || ! defined("COMPANY_CREATE_TWO_STEPS")) { |
220 |
|
|
221 |
print '<tr><td>'.$langs->trans('CustomerCode').'</td><td colspan="3"><input size="16" type="text" name="code_client" maxlength="15" value="'.$soc->code_client.'"></td>'; |
// Client / Prospect |
222 |
print '<tr><td>'.$langs->trans('SupplierCode').'</td><td colspan="3"><input size="16" type="text" name="code_fournisseur" maxlength="15" value="'.$soc->code_fournisseur.'"></td>'; |
print '<tr><td width="25%">'.$langs->trans('ProspectCustomer').'</td><td width="25%"><select class="flat" name="client">'; |
223 |
|
print '<option value="2"'.($soc->client==2?' selected':'').'>'.$langs->trans('Prospect').'</option>'; |
224 |
if (defined("COMPANY_CREATE_TWO_STEPS")) |
print '<option value="1"'.($soc->client==1?' selected':'').'>'.$langs->trans('Customer').'</option>'; |
225 |
{ |
print '<option value="0"'.($soc->client==0?' selected':'').'>Ni client, ni prospect</option>'; |
226 |
print '<tr><td width="140">'.$langs->trans('Country').'</td><td colspan="3">'; |
print '</select></td>'; |
227 |
print $soc->pays; |
print '<td width="25%">'.$langs->trans('CustomerCode').'</td><td width="25%">'; |
228 |
print '<input type="hidden" name="pays_id" value="'.$soc->pays_id.'">'; |
print '<input type="text" name="code_client" size="16" value="'.$soc->code_client.'" maxlength="15">'; |
229 |
print '</td></tr>'; |
print '</td></tr>'; |
230 |
} |
|
231 |
else |
// Fournisseur |
232 |
{ |
print '<tr>'; |
233 |
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">'; |
print '<td>'.$langs->trans('Supplier').'</td><td>'; |
234 |
$form->select_pays($soc->pays_id); |
$form->selectyesnonum("fournisseur",$soc->fournisseur); |
235 |
print '</td></tr>'; |
print '</td>'; |
236 |
} |
print '<td>'.$langs->trans('SupplierCode').'</td><td>'; |
237 |
|
print '<input type="text" name="code_fournisseur" size="16" value="'.$soc->code_fournisseur.'" maxlength="15">'; |
238 |
print '<input type="hidden" name="step" value="'.$step.'">'; |
print '</td></tr>'; |
239 |
print '<input type="hidden" name="action" value="add">'; |
|
240 |
|
|
241 |
print '<tr><td>'.$langs->trans('Address').'</td><td colspan="3"><textarea name="adresse" cols="40" rows="3" wrap="soft">'; |
if (defined("COMPANY_CREATE_TWO_STEPS")) |
242 |
print $soc->adresse; |
{ |
243 |
print '</textarea></td></tr>'; |
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">'; |
244 |
|
print $soc->pays; |
245 |
print '<tr><td>'.$langs->trans('Zip').'</td><td><input size="6" type="text" name="cp" value="'.$soc->cp.'"'; |
print '<input type="hidden" name="pays_id" value="'.$soc->pays_id.'">'; |
246 |
if ($conf->filltownfromzip) print ' onblur="PopupPostalCode(cp.value,ville)"'; |
print '</td></tr>'; |
247 |
print '>'; |
} |
248 |
if ($conf->filltownfromzip) print ' <input type="button" name="searchpostalcode" value="'.$langs->trans('FillTownFromZip').'" onclick="PopupPostalCode(cp.value,ville)">'; |
else |
249 |
print '</td>'; |
{ |
250 |
print '<td>'.$langs->trans('Town').'</td><td><input type="text" name="ville" value="'.$soc->ville.'"></td></tr>'; |
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">'; |
251 |
|
$form->select_pays($soc->pays_id); |
252 |
print '<tr><td>'.$langs->trans('State').'</td><td colspan="3">'; |
print '</td></tr>'; |
253 |
$form->select_departement($soc->departement_id,(defined("COMPANY_CREATE_TWO_STEPS")?$soc->pays_code:0)); |
} |
254 |
print '</td></tr>'; |
|
255 |
|
print '<input type="hidden" name="step" value="'.$step.'">'; |
256 |
print '<tr><td>'.$langs->trans('Phone').'</td><td><input type="text" name="tel" value="'.$soc->tel.'"></td>'; |
print '<input type="hidden" name="action" value="add">'; |
257 |
print '<td>'.$langs->trans('Fax').'</td><td><input type="text" name="fax" value="'.$soc->fax.'"></td></tr>'; |
|
258 |
|
print '<tr><td>'.$langs->trans('Address').'</td><td colspan="3"><textarea name="adresse" cols="40" rows="3" wrap="soft">'; |
259 |
print '<tr><td>'.$langs->trans('Web').'</td><td colspan="3"><input type="text" name="url" size="40" value="'.$soc->url.'"></td></tr>'; |
print $soc->adresse; |
260 |
|
print '</textarea></td></tr>'; |
261 |
print '<tr><td>'.$langs->transcountry('ProfId1',$soc->pays_code).'</td><td><input type="text" name="siren" size="15" maxlength="9" value="'.$soc->siren.'"></td>'; |
|
262 |
print '<td>'.$langs->transcountry('ProfId2',$soc->pays_code).'</td><td><input type="text" name="siret" size="15" maxlength="14" value="'.$soc->siret.'"></td></tr>'; |
print '<tr><td>'.$langs->trans('Zip').'</td><td><input size="6" type="text" name="cp" value="'.$soc->cp.'"'; |
263 |
print '<tr><td>'.$langs->transcountry('ProfId3',$soc->pays_code).'</td><td><input type="text" name="ape" size="5" maxlength="4" value="'.$soc->ape.'"></td><td colspan="2"> </td></tr>'; |
if ($conf->filltownfromzip) print ' onblur="PopupPostalCode(cp.value,ville)"'; |
264 |
|
print '>'; |
265 |
print '<tr><td>'.$langs->trans('Capital').'</td><td colspan="3"><input type="text" name="capital" size="10" value="'.$soc->capital.'"> '.$langs->trans("Currency".$conf->monnaie).'</td></tr>'; |
if ($conf->filltownfromzip) print ' <input type="button" name="searchpostalcode" value="'.$langs->trans('FillTownFromZip').'" onclick="PopupPostalCode(cp.value,ville)">'; |
266 |
|
print '</td>'; |
267 |
print '<tr><td>'.$langs->trans('JuridicalStatus').'</td><td colspan="3">'; |
print '<td>'.$langs->trans('Town').'</td><td><input type="text" name="ville" value="'.$soc->ville.'"></td></tr>'; |
268 |
$form->select_forme_juridique($soc->forme_juridique_code,(defined("COMPANY_CREATE_TWO_STEPS")?$soc->pays_code:0)); |
|
269 |
print '</td></tr>'; |
print '<tr><td>'.$langs->trans('State').'</td><td colspan="3">'; |
270 |
|
$form->select_departement($soc->departement_id,(defined("COMPANY_CREATE_TWO_STEPS")?$soc->pays_code:0)); |
271 |
print '<tr><td>'.$langs->trans("Type").'</td><td>'; |
print '</td></tr>'; |
272 |
$form->select_array("typent_id",$soc->typent_array(), $soc->typent_id); |
|
273 |
print '</td>'; |
print '<tr><td>'.$langs->trans('Phone').'</td><td><input type="text" name="tel" value="'.$soc->tel.'"></td>'; |
274 |
print '<td>'.$langs->trans("Staff").'</td><td>'; |
print '<td>'.$langs->trans('Fax').'</td><td><input type="text" name="fax" value="'.$soc->fax.'"></td></tr>'; |
275 |
$form->select_array("effectif_id",$soc->effectif_array(), $soc->effectif_id); |
|
276 |
print '</td></tr>'; |
print '<tr><td>'.$langs->trans('Web').'</td><td colspan="3"><input type="text" name="url" size="40" value="'.$soc->url.'"></td></tr>'; |
277 |
|
|
278 |
print '<tr><td nowrap>'.$langs->trans('VATIntraShort').'</td><td colspan="3">'; |
print '<tr><td>'.$langs->transcountry('ProfId1',$soc->pays_code).'</td><td><input type="text" name="siren" size="15" maxlength="9" value="'.$soc->siren.'"></td>'; |
279 |
|
print '<td>'.$langs->transcountry('ProfId2',$soc->pays_code).'</td><td><input type="text" name="siret" size="15" maxlength="14" value="'.$soc->siret.'"></td></tr>'; |
280 |
print '<input type="text" name="tva_intra_code" size="3" maxlength="2" value="'.$soc->tva_intra_code.'">'; |
print '<tr><td>'.$langs->transcountry('ProfId3',$soc->pays_code).'</td><td><input type="text" name="ape" size="5" maxlength="4" value="'.$soc->ape.'"></td><td colspan="2"> </td></tr>'; |
281 |
print '<input type="text" name="tva_intra_num" size="18" maxlength="18" value="'.$soc->tva_intra_num.'">'; |
|
282 |
print ' '.$langs->trans("VATIntraCheckableOnEUSite"); |
print '<tr><td>'.$langs->trans('Capital').'</td><td colspan="3"><input type="text" name="capital" size="10" value="'.$soc->capital.'"> '.$langs->trans("Currency".$conf->monnaie).'</td></tr>'; |
283 |
print '</td></tr>'; |
|
284 |
|
print '<tr><td>'.$langs->trans('JuridicalStatus').'</td><td colspan="3">'; |
285 |
print '<tr><td>'.$langs->trans('ProspectCustomer').'</td><td><select class="flat" name="client">'; |
$form->select_forme_juridique($soc->forme_juridique_code,(defined("COMPANY_CREATE_TWO_STEPS")?$soc->pays_code:0)); |
286 |
print '<option value="2"'.($soc->client==2?' selected':'').'>'.$langs->trans('Prospect').'</option>'; |
print '</td></tr>'; |
287 |
print '<option value="1"'.($soc->client==1?' selected':'').'>'.$langs->trans('Customer').'</option>'; |
|
288 |
print '<option value="0"'.($soc->client==0?' selected':'').'>'.$langs->trans('NorProspectNorCustomer').'</option>'; |
print '<tr><td>'.$langs->trans("Type").'</td><td>'; |
289 |
print '</select></td>'."\n"; |
$form->select_array("typent_id",$soc->typent_array(), $soc->typent_id); |
290 |
|
print '</td>'; |
291 |
print '<td>'.$langs->trans('Supplier').'</td><td>'."\n"; |
print '<td>'.$langs->trans("Staff").'</td><td>'; |
292 |
$form->selectyesnonum("fournisseur",$soc->fournisseur); |
$form->select_array("effectif_id",$soc->effectif_array(), $soc->effectif_id); |
293 |
print '</td></tr>'."\n"; |
print '</td></tr>'; |
294 |
|
|
295 |
print '<tr><td colspan="4" align="center">'; |
print '<tr><td nowrap>'.$langs->trans('VATIntraShort').'</td><td colspan="3">'; |
296 |
if (defined("COMPANY_CREATE_TWO_STEPS")) |
|
297 |
{ |
print '<input type="text" name="tva_intra_code" size="3" maxlength="2" value="'.$soc->tva_intra_code.'">'; |
298 |
print '<input type="submit" name="createpreviousstep" value="'.$langs->trans('PreviousStep').'"> '; |
print '<input type="text" name="tva_intra_num" size="18" maxlength="18" value="'.$soc->tva_intra_num.'">'; |
299 |
} |
print ' '.$langs->trans("VATIntraCheckableOnEUSite"); |
300 |
print '<input type="submit" value="'.$langs->trans('AddCompany').'"></td></tr>'."\n"; |
print '</td></tr>'; |
301 |
|
|
302 |
} |
print '<tr><td colspan="4" align="center">'; |
303 |
|
if (defined("COMPANY_CREATE_TWO_STEPS")) |
304 |
print '</table>'."\n"; |
{ |
305 |
print '</form>'."\n"; |
print '<input type="submit" class="button" name="createpreviousstep" value="'.$langs->trans('PreviousStep').'"> '; |
306 |
|
} |
307 |
|
print '<input type="submit" class="button" value="'.$langs->trans('AddCompany').'"></td></tr>'."\n"; |
308 |
|
|
309 |
|
} |
310 |
|
|
311 |
|
print '</table>'."\n"; |
312 |
|
print '</form>'."\n"; |
313 |
|
|
314 |
} |
} |
315 |
} |
} |
316 |
elseif ($_GET["action"] == 'edit') |
elseif ($_GET["action"] == 'edit') |
317 |
{ |
{ |
318 |
/* |
/* |
319 |
* Fiche societe en mode edition |
* Fiche societe en mode edition |
320 |
*/ |
*/ |
321 |
|
|
322 |
print_titre($langs->trans("EditCompany")); |
print_titre($langs->trans("EditCompany")); |
323 |
|
|
324 |
if ($_GET["socid"]) |
if ($_GET["socid"]) |
325 |
{ |
{ |
326 |
if ($no_reload <> 1) |
if ($no_reload <> 1) |
327 |
{ |
{ |
328 |
$soc = new Societe($db); |
$soc = new Societe($db); |
329 |
$soc->id = $_GET["socid"]; |
$soc->id = $_GET["socid"]; |
330 |
$soc->fetch($_GET["socid"]); |
$soc->fetch($_GET["socid"]); |
331 |
} |
} |
332 |
|
|
333 |
if ($soc->error) |
if ($soc->error) |
334 |
{ |
{ |
335 |
print '<div class="error">'; |
print '<div class="error">'; |
336 |
print $soc->error; |
print $soc->error; |
337 |
print '</div>'; |
print '</div>'; |
338 |
} |
} |
339 |
|
|
340 |
print '<form action="soc.php?socid='.$soc->id.'" method="post">'; |
print '<form action="soc.php?socid='.$soc->id.'" method="post">'; |
341 |
print '<input type="hidden" name="action" value="update">'; |
print '<input type="hidden" name="action" value="update">'; |
342 |
print '<input type="hidden" name="codeclient_modifiable" value="'.$soc->codeclient_modifiable.'">'; |
print '<input type="hidden" name="codeclient_modifiable" value="'.$soc->codeclient_modifiable.'">'; |
343 |
print '<input type="hidden" name="codefournisseur_modifiable" value="'.$soc->codefournisseur_modifiable.'">'; |
print '<input type="hidden" name="codefournisseur_modifiable" value="'.$soc->codefournisseur_modifiable.'">'; |
344 |
|
|
345 |
print '<table class="border" width="100%">'; |
print '<table class="border" width="100%">'; |
346 |
|
|
347 |
print '<tr><td width="140">'.$langs->trans('Name').'</td><td colspan="3"><input type="text" size="40" name="nom" value="'.$soc->nom.'"></td></tr>'; |
print '<tr><td>'.$langs->trans('Name').'</td><td colspan="3"><input type="text" size="40" name="nom" value="'.$soc->nom.'"></td></tr>'; |
348 |
|
|
349 |
print '<td>'.$langs->trans("Prefix").'</td><td colspan="3">'; |
print '<td>'.$langs->trans("Prefix").'</td><td colspan="3">'; |
350 |
print '<input type="text" size="5" name="prefix_comm" value="'.$soc->prefix_comm.'">'; |
print '<input type="text" size="5" name="prefix_comm" value="'.$soc->prefix_comm.'">'; |
351 |
print '</td>'; |
print '</td>'; |
352 |
|
|
353 |
print '<tr><td>'.$langs->trans('CustomerCode').'</td><td colspan="3">'; |
// Client / Prospect |
354 |
if ($soc->codeclient_modifiable == 1) |
print '<tr><td width="25%">'.$langs->trans('ProspectCustomer').'</td><td width="25%"><select class="flat" name="client">'; |
355 |
{ |
print '<option value="2"'.($soc->client==2?' selected':'').'>'.$langs->trans('Prospect').'</option>'; |
356 |
print '<input type="text" name="code_client" size="16" value="'.$soc->code_client.'" maxlength="15">'; |
print '<option value="1"'.($soc->client==1?' selected':'').'>'.$langs->trans('Customer').'</option>'; |
357 |
} |
print '<option value="0"'.($soc->client==0?' selected':'').'>Ni client, ni prospect</option>'; |
358 |
else |
print '</select></td>'; |
359 |
{ |
print '<td width="25%">'.$langs->trans('CustomerCode').'</td><td width="25%">'; |
360 |
print $soc->code_client; |
if ($soc->codeclient_modifiable == 1) |
361 |
} |
{ |
362 |
print '</tr>'; |
print '<input type="text" name="code_client" size="16" value="'.$soc->code_client.'" maxlength="15">'; |
363 |
|
} |
364 |
|
else |
365 |
|
{ |
366 |
|
print $soc->code_client; |
367 |
|
} |
368 |
|
print '</td></tr>'; |
369 |
|
|
370 |
print '<tr><td>'.$langs->trans('SupplierCode').'</td><td colspan="3">'; |
// Fournisseur |
371 |
if ($soc->codefournisseur_modifiable == 1) |
print '<tr>'; |
372 |
{ |
print '<td>'.$langs->trans('Supplier').'</td><td>'; |
373 |
print '<input type="text" name="code_client" size="16" value="'.$soc->code_fournisseur.'" maxlength="15">'; |
$form->selectyesnonum("fournisseur",$soc->fournisseur); |
374 |
} |
print '</td>'; |
375 |
else |
print '<td>'.$langs->trans('SupplierCode').'</td><td>'; |
376 |
{ |
if ($soc->codefournisseur_modifiable == 1) |
377 |
print $soc->code_fournisseur; |
{ |
378 |
} |
print '<input type="text" name="code_fournisseur" size="16" value="'.$soc->code_fournisseur.'" maxlength="15">'; |
379 |
print '</tr>'; |
} |
380 |
|
else |
381 |
print '<tr><td valign="top">'.$langs->trans('Address').'</td><td colspan="3"><textarea name="adresse" cols="40" rows="3" wrap="soft">'; |
{ |
382 |
print $soc->adresse; |
print $soc->code_fournisseur; |
383 |
print '</textarea></td></tr>'; |
} |
384 |
|
print '</td></tr>'; |
385 |
print '<tr><td>'.$langs->trans('Zip').'</td><td><input size="6" type="text" name="cp" value="'.$soc->cp.'"></td>'; |
|
386 |
print '<td>'.$langs->trans('Town').'</td><td><input type="text" name="ville" value="'.$soc->ville.'"></td></tr>'; |
print '<tr><td valign="top">'.$langs->trans('Address').'</td><td colspan="3"><textarea name="adresse" cols="40" rows="3" wrap="soft">'; |
387 |
|
print $soc->adresse; |
388 |
print '<tr><td>'.$langs->trans('State').'</td><td colspan="3">'; |
print '</textarea></td></tr>'; |
389 |
$form->select_departement($soc->departement_id,0); |
|
390 |
print '</td></tr>'; |
print '<tr><td>'.$langs->trans('Zip').'</td><td><input size="6" type="text" name="cp" value="'.$soc->cp.'"></td>'; |
391 |
|
print '<td>'.$langs->trans('Town').'</td><td><input type="text" name="ville" value="'.$soc->ville.'"></td></tr>'; |
392 |
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">'; |
|
393 |
$form->select_pays($soc->pays_id); |
print '<tr><td>'.$langs->trans('State').'</td><td colspan="3">'; |
394 |
print '</td></tr>'; |
$form->select_departement($soc->departement_id,0); |
395 |
|
print '</td></tr>'; |
396 |
print '<tr><td>'.$langs->trans('Phone').'</td><td><input type="text" name="tel" value="'.$soc->tel.'"></td>'; |
|
397 |
print '<td>'.$langs->trans('Fax').'</td><td><input type="text" name="fax" value="'.$soc->fax.'"></td></tr>'; |
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">'; |
398 |
|
$form->select_pays($soc->pays_id); |
399 |
print '<tr><td>'.$langs->trans('Web').'</td><td colspan="3"><input type="text" name="url" size="40" value="'.$soc->url.'"></td></tr>'; |
print '</td></tr>'; |
400 |
|
|
401 |
print '<tr><td>'.$langs->transcountry('ProfId1',$soc->pays_code).'</td><td><input type="text" name="siren" size="10" maxlength="9" value="'.$soc->siren.'"></td>'; |
print '<tr><td>'.$langs->trans('Phone').'</td><td><input type="text" name="tel" value="'.$soc->tel.'"></td>'; |
402 |
print '<td>'.$langs->transcountry('ProfId2',$soc->pays_code).'</td><td><input type="text" name="siret" size="15" maxlength="14" value="'.$soc->siret.'"></td></tr>'; |
print '<td>'.$langs->trans('Fax').'</td><td><input type="text" name="fax" value="'.$soc->fax.'"></td></tr>'; |
403 |
print '<tr><td>'.$langs->transcountry('ProfId3',$soc->pays_code).'</td><td><input type="text" name="ape" size="5" maxlength="4" value="'.$soc->ape.'"></td><td colspan="2"> </td></tr>'; |
|
404 |
|
print '<tr><td>'.$langs->trans('Web').'</td><td colspan="3"><input type="text" name="url" size="40" value="'.$soc->url.'"></td></tr>'; |
405 |
print '<tr><td nowrap>'.$langs->trans('VATIntraShort').'</td><td colspan="3">'; |
|
406 |
print '<input type="text" name="tva_intra_code" size="3" maxlength="2" value="'.$soc->tva_intra_code.'">'; |
print '<tr><td>'.$langs->transcountry('ProfId1',$soc->pays_code).'</td><td><input type="text" name="siren" size="10" maxlength="9" value="'.$soc->siren.'"></td>'; |
407 |
print '<input type="text" name="tva_intra_num" size="18" maxlength="18" value="'.$soc->tva_intra_num.'">'; |
print '<td>'.$langs->transcountry('ProfId2',$soc->pays_code).'</td><td><input type="text" name="siret" size="15" maxlength="14" value="'.$soc->siret.'"></td></tr>'; |
408 |
print ' '.$langs->trans("VATIntraCheckableOnEUSite"); |
print '<tr><td>'.$langs->transcountry('ProfId3',$soc->pays_code).'</td><td><input type="text" name="ape" size="5" maxlength="4" value="'.$soc->ape.'"></td><td colspan="2"> </td></tr>'; |
409 |
print '</td></tr>'; |
|
410 |
|
print '<tr><td nowrap>'.$langs->trans('VATIntraShort').'</td><td colspan="3">'; |
411 |
print '<tr><td>'.$langs->trans("Capital").'</td><td colspan="3"><input type="text" name="capital" size="10" value="'.$soc->capital.'"> '.$langs->trans("Currency".$conf->monnaie).'</td></tr>'; |
print '<input type="text" name="tva_intra_code" size="3" maxlength="2" value="'.$soc->tva_intra_code.'">'; |
412 |
|
print '<input type="text" name="tva_intra_num" size="18" maxlength="18" value="'.$soc->tva_intra_num.'">'; |
413 |
print '<tr><td>'.$langs->trans('JuridicalStatus').'</td><td colspan="3">'; |
print ' '.$langs->trans("VATIntraCheckableOnEUSite"); |
414 |
$form->select_forme_juridique($soc->forme_juridique_code,0); |
print '</td></tr>'; |
415 |
print '</td></tr>'; |
|
416 |
|
print '<tr><td>'.$langs->trans("Capital").'</td><td colspan="3"><input type="text" name="capital" size="10" value="'.$soc->capital.'"> '.$langs->trans("Currency".$conf->monnaie).'</td></tr>'; |
417 |
print '<tr><td>'.$langs->trans("Type").'</td><td>'; |
|
418 |
$form->select_array("typent_id",$soc->typent_array(), $soc->typent_id); |
print '<tr><td>'.$langs->trans('JuridicalStatus').'</td><td colspan="3">'; |
419 |
print '</td>'; |
$form->select_forme_juridique($soc->forme_juridique_code,0); |
420 |
print '<td>'.$langs->trans("Staff").'</td><td>'; |
print '</td></tr>'; |
|
$form->select_array("effectif_id",$soc->effectif_array(), $soc->effectif_id); |
|
|
print '</td></tr>'; |
|
|
|
|
|
print '<tr><td>'.$langs->trans('ProspectCustomer').'</td><td><select class="flat" name="client">'; |
|
|
print '<option value="2"'.($soc->client==2?' selected':'').'>'.$langs->trans('Prospect').'</option>'; |
|
|
print '<option value="1"'.($soc->client==1?' selected':'').'>'.$langs->trans('Customer').'</option>'; |
|
|
print '<option value="0"'.($soc->client==0?' selected':'').'>Ni client, ni prospect</option>'; |
|
|
print '</select></td>'; |
|
|
|
|
|
print '<td>'.$langs->trans('Supplier').'</td><td>'; |
|
|
$form->selectyesnonum("fournisseur",$soc->fournisseur); |
|
|
print '</td></tr>'; |
|
|
|
|
|
print '<tr><td align="center" colspan="4"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td></tr>'; |
|
421 |
|
|
422 |
print '</table>'; |
print '<tr><td>'.$langs->trans("Type").'</td><td>'; |
423 |
print '</form>'; |
$form->select_array("typent_id",$soc->typent_array(), $soc->typent_id); |
424 |
|
print '</td>'; |
425 |
|
print '<td>'.$langs->trans("Staff").'</td><td>'; |
426 |
|
$form->select_array("effectif_id",$soc->effectif_array(), $soc->effectif_id); |
427 |
|
print '</td></tr>'; |
428 |
|
|
429 |
|
print '<tr><td align="center" colspan="4"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td></tr>'; |
430 |
|
|
431 |
|
print '</table>'; |
432 |
|
print '</form>'; |
433 |
} |
} |
434 |
} |
} |
435 |
else |
else |
436 |
{ |
{ |
437 |
|
/* |
438 |
|
* Fiche société en mode visu |
439 |
|
*/ |
440 |
|
|
441 |
if ($no_reload <> 1) |
if ($no_reload <> 1) |
442 |
{ |
{ |
443 |
$soc = new Societe($db); |
$soc = new Societe($db); |
493 |
|
|
494 |
dolibarr_fiche_head($head, 0, $soc->nom); |
dolibarr_fiche_head($head, 0, $soc->nom); |
495 |
|
|
|
/* |
|
|
* Fiche société en mode visu |
|
|
*/ |
|
496 |
|
|
497 |
// Confirmation de la suppression de la facture |
// Confirmation de la suppression de la facture |
498 |
if ($_GET["action"] == 'delete') |
if ($_GET["action"] == 'delete') |
534 |
|
|
535 |
print "<tr><td valign=\"top\">".$langs->trans('Address')."</td><td colspan=\"3\">".nl2br($soc->adresse)."</td></tr>"; |
print "<tr><td valign=\"top\">".$langs->trans('Address')."</td><td colspan=\"3\">".nl2br($soc->adresse)."</td></tr>"; |
536 |
|
|
537 |
print '<tr><td>'.$langs->trans('Zip').'</td><td>'.$soc->cp."</td>"; |
print '<tr><td width="25%">'.$langs->trans('Zip').'</td><td width="25%">'.$soc->cp."</td>"; |
538 |
print '<td>'.$langs->trans('Town').'</td><td>'.$soc->ville."</td></tr>"; |
print '<td width="25%">'.$langs->trans('Town').'</td><td width="25%">'.$soc->ville."</td></tr>"; |
539 |
|
|
540 |
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">'.$soc->pays.'</td>'; |
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">'.$soc->pays.'</td>'; |
541 |
|
|