uruguay_858_1.cif 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function uruguay_install() {
  7. // Make the entry in the country table.
  8. // VALUES = Country ID, Country Name, 2-digit Code, 3-digit Code, File Version
  9. db_insert('uc_countries')
  10. ->fields(array(
  11. 'country_id' => 858,
  12. 'country_name' => 'Uruguay',
  13. 'country_iso_code_2' => 'UY',
  14. 'country_iso_code_3' => 'URY',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(858, 'AR', 'Artigas'),
  21. array(858, 'CA', 'Canelones'),
  22. array(858, 'CL', 'Cerro Largo'),
  23. array(858, 'CO', 'Colonia'),
  24. array(858, 'DU', 'Durazno'),
  25. array(858, 'FS', 'Flores'),
  26. array(858, 'FD', 'Florida'),
  27. array(858, 'LA', 'Lavalleja'),
  28. array(858, 'MA', 'Maldonado'),
  29. array(858, 'MO', 'Montevideo'),
  30. array(858, 'PA', 'Paysandu'),
  31. array(858, 'RN', 'Rio Negro'),
  32. array(858, 'RV', 'Rivera'),
  33. array(858, 'RO', 'Rocha'),
  34. array(858, 'SA', 'Salto'),
  35. array(858, 'SJ', 'San Jose'),
  36. array(858, 'SO', 'Soriano'),
  37. array(858, 'TA', 'Tacuarembo'),
  38. array(858, 'TT', 'Treinta y Tres'),
  39. );
  40. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  41. foreach ($zones as $zone) {
  42. $query->values($zone);
  43. }
  44. $query->execute();
  45. // Set address format
  46. uc_set_address_format(
  47. 858,
  48. "!company\r\n" .
  49. "!first_name !last_name\r\n" .
  50. "!street1\r\n" .
  51. "!street2\r\n" .
  52. "!city !zone_code !postal_code\r\n" .
  53. "!country_name_if"
  54. );
  55. }