card_create.tpl.php 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <?php
  2. /* Copyright (C) 2010 Regis Houssin <regis.houssin@inodbox.com>
  3. * Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  17. */
  18. // Protection to avoid direct call of template
  19. if (empty($conf) || !is_object($conf)) {
  20. print "Error, template page can't be called as URL";
  21. exit;
  22. }
  23. ?>
  24. <!-- BEGIN PHP TEMPLATE CARD_CREATE.TPL.PHP COMPANY -->
  25. <?php echo $this->control->tpl['title']; ?>
  26. <?php echo $this->control->tpl['error']; ?>
  27. <?php if ($conf->use_javascript_ajax) { ?>
  28. <?php echo $this->control->tpl['ajax_selecttype']; ?>
  29. <br>
  30. <?php echo $langs->trans("ThirdPartyType") ?>: &nbsp;
  31. <input type="radio" id="radiocompany" class="flat" name="private" value="0" checked>
  32. <?php echo $langs->trans("CompanyFoundation"); ?> &nbsp; &nbsp;
  33. <input type="radio" id="radioprivate" class="flat" name="private" value="1"> <?php echo $langs->trans("Individual"); ?> (<?php echo $langs->trans("ToCreateContactWithSameName") ?>)
  34. <br>
  35. <br>
  36. <?php echo $this->control->tpl['ajax_selectcountry']; ?>
  37. <?php } ?>
  38. <?php if ($this->control->tpl['js_checkVatPopup']) {
  39. echo $this->control->tpl['js_checkVatPopup'];
  40. } ?>
  41. <form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="POST" name="formsoc">
  42. <input type="hidden" name="canvas" value="<?php echo $canvas ?>">
  43. <input type="hidden" name="action" value="add">
  44. <input type="hidden" name="token" value="<?php echo newToken(); ?>">
  45. <input type="hidden" name="private" value="<?php echo $this->control->tpl['particulier']; ?>">
  46. <?php if ($this->control->tpl['auto_customercode'] || $this->control->tpl['auto_suppliercode']) { ?>
  47. <input type="hidden" name="code_auto" value="1">
  48. <?php } ?>
  49. <table class="border allwidth">
  50. <tr>
  51. <td><span class="fieldrequired"><?php echo $langs->trans('ThirdPartyName'); ?></span></td>
  52. <td><input type="text" size="30" maxlength="60" name="nom" value="<?php echo $this->control->tpl['nom']; ?>"></td>
  53. <?php if (getDolGlobalString('SOCIETE_USEPREFIX')) { ?>
  54. <td><?php echo $langs->trans('Prefix'); ?></td>
  55. <td><input type="text" size="5" maxlength="5" name="prefix_comm" value="<?php echo $this->control->tpl['prefix_comm']; ?>"></td>
  56. <?php } ?>
  57. </tr>
  58. <tr>
  59. <td width="25%"><span class="fieldrequired"><?php echo $langs->trans('ProspectCustomer'); ?></span></td>
  60. <td width="25%"><?php echo $this->control->tpl['select_customertype']; ?></td>
  61. <td width="25%"><?php echo $langs->trans('CustomerCode'); ?></td>
  62. <td width="25%">
  63. <table class="nobordernopadding">
  64. <tr>
  65. <td><input type="text" name="code_client" size="16" value="<?php echo $this->control->tpl['customercode']; ?>" maxlength="24"></td>
  66. <td><?php echo $this->control->tpl['help_customercode']; ?></td>
  67. </tr>
  68. </table>
  69. </td>
  70. </tr>
  71. <?php if ($this->control->tpl['supplier_enabled']) { ?>
  72. <tr>
  73. <td><span class="fieldrequired"><?php echo $langs->trans('Supplier'); ?></span></td>
  74. <td><?php echo $this->control->tpl['yn_supplier']; ?></td>
  75. <td><?php echo $langs->trans('SupplierCode'); ?></td>
  76. <td>
  77. <table class="nobordernopadding">
  78. <tr>
  79. <td><input type="text" name="code_fournisseur" size="16" value="<?php echo $this->control->tpl['suppliercode']; ?>" maxlength="24"></td>
  80. <td><?php echo $this->control->tpl['help_suppliercode']; ?></td>
  81. </tr>
  82. </table>
  83. </td>
  84. </tr>
  85. <?php if (count($this->control->tpl['suppliercategory']) > 0) { ?>
  86. <tr>
  87. <td><?php echo $langs->trans('SupplierCategory'); ?></td>
  88. <td colspan="3"><?php echo $this->control->tpl['select_suppliercategory']; ?></td>
  89. </tr>
  90. <?php }
  91. }
  92. if (isModEnabled('barcode')) { ?>
  93. <tr>
  94. <td><?php echo $langs->trans('Gencod'); ?></td>
  95. <td colspan="3"><input type="text" name="barcode" value="<?php echo $this->control->tpl['barcode']; ?>"></td>
  96. </tr>
  97. <?php } ?>
  98. <tr>
  99. <td class="tdtop"><?php echo $langs->trans('Address'); ?></td>
  100. <td colspan="3"><textarea name="adress" cols="40" rows="3"><?php echo $this->control->tpl['address']; ?></textarea></td>
  101. </tr>
  102. <tr>
  103. <td><?php echo $langs->trans('Zip'); ?></td>
  104. <td><?php echo $this->control->tpl['select_zip']; ?></td>
  105. <td><?php echo $langs->trans('Town'); ?></td>
  106. <td><?php echo $this->control->tpl['select_town']; ?></td>
  107. </tr>
  108. <tr>
  109. <td width="25%"><?php echo $langs->trans('Country'); ?></td>
  110. <td colspan="3"><?php echo $this->control->tpl['select_country']; echo $this->control->tpl['info_admin']; ?></td>
  111. </tr>
  112. <tr>
  113. <td><?php echo $langs->trans('State'); ?></td>
  114. <td colspan="3"><?php echo $this->control->tpl['select_state']; ?></td>
  115. </tr>
  116. <tr>
  117. <td><?php echo $langs->trans('Phone'); ?></td>
  118. <td><input type="text" name="phone" value="<?php echo $this->control->tpl['phone']; ?>"></td>
  119. <td><?php echo $langs->trans('Fax'); ?></td>
  120. <td><input type="text" name="fax" value="<?php echo $this->control->tpl['fax']; ?>"></td>
  121. </tr>
  122. <tr>
  123. <td><?php echo $langs->trans('EMail').($conf->global->SOCIETE_EMAIL_MANDATORY ? '*' : ''); ?></td>
  124. <td><input type="text" name="email" size="32" value="<?php echo $this->control->tpl['email']; ?>"></td>
  125. <td><?php echo $langs->trans('Web'); ?></td>
  126. <td><input type="text" name="url" size="32" value="<?php echo $this->control->tpl['url']; ?>"></td>
  127. </tr>
  128. <tr>
  129. <td><?php echo $langs->trans('Capital'); ?></td>
  130. <td colspan="3"><input type="text" name="capital" size="10" value="<?php echo $this->control->tpl['capital']; ?>"> <?php echo $langs->trans("Currency".$conf->currency); ?></td>
  131. </tr>
  132. <?php
  133. for ($i = 1; $i <= 4; $i++) {
  134. if ($this->control->tpl['langprofid'.$i] != '-') {
  135. if ($i == 1 || $i == 3) {
  136. echo '<tr>';
  137. }
  138. echo '<td>'.$this->control->tpl['langprofid'.$i].'</td>';
  139. echo '<td>'.$this->control->tpl['showprofid'.$i].'</td>';
  140. if ($i == 2 || $i == 4) {
  141. echo '</tr>';
  142. }
  143. } else {
  144. if ($i == 1 || $i == 3) {
  145. echo '<tr>';
  146. }
  147. echo '<td>&nbsp;</td>';
  148. echo '<td>&nbsp;</td>';
  149. if ($i == 2 || $i == 4) {
  150. echo '</tr>';
  151. }
  152. }
  153. }
  154. ?>
  155. <tr>
  156. <td><?php echo $langs->trans('JuridicalStatus'); ?></td>
  157. <td colspan="3"><?php echo $this->control->tpl['select_juridicalstatus']; ?></td>
  158. </tr>
  159. <tr>
  160. <td><?php echo $langs->trans("ThirdPartyType"); ?></td>
  161. <td><?php echo $this->control->tpl['select_companytype']; echo $this->control->tpl['info_admin']; ?></td>
  162. <td><?php echo $langs->trans("Staff"); ?></td>
  163. <td><?php echo $this->control->tpl['select_workforce']; echo $this->control->tpl['info_admin']; ?></td>
  164. </tr>
  165. <?php if (getDolGlobalInt('MAIN_MULTILANGS')) { ?>
  166. <tr>
  167. <td><?php echo $langs->trans("DefaultLang"); ?></td>
  168. <td colspan="3"><?php echo $this->control->tpl['select_lang']; ?></td>
  169. </tr>
  170. <?php } ?>
  171. <tr>
  172. <td><?php echo $langs->trans('VATIsUsed'); ?></td>
  173. <td><?php echo $this->control->tpl['yn_assujtva']; ?></td>
  174. <td class="nowrap"><?php echo $langs->trans('VATIntra'); ?></td>
  175. <td class="nowrap"><?php echo $this->control->tpl['tva_intra']; ?></td>
  176. </tr>
  177. <?php if (!empty($this->control->tpl['localtax'])) {
  178. echo $this->control->tpl['localtax'];
  179. } ?>
  180. <?php if ($user->hasRight('societe', 'client', 'voir')) { ?>
  181. <tr>
  182. <td><?php echo $langs->trans("AllocateCommercial"); ?></td>
  183. <td colspan="3"><?php echo $this->control->tpl['select_users']; ?></td>
  184. </tr>
  185. <?php } ?>
  186. <tr>
  187. <td colspan="4" class="center"><input type="submit" class="button" value="<?php echo $langs->trans('AddThirdParty'); ?>"></td>
  188. </tr>
  189. </table>
  190. </form>
  191. <!-- END PHP TEMPLATE -->