Advertisement
storeporter

export script

Feb 16th, 2016
2,743
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. **** Copyright 2016, StorePorter LLC****
  2. * Module....:   exportproductsandfamilies.scp
  3. * Created by:   Patrick J. Murtaugh
  4. * Date......:   02/16/16
  5. * Client....:   Sportsmans Finest
  6. * Desc......:   Export all products and families
  7. * Export Fields: active, sku, upc, name, category, price, family
  8. * Changes...:
  9.  
  10. **** Copyright 2016, StorePorter LLC ****
  11.  
  12. local lcExportFile as string
  13.  
  14. lcExportFile = getfile('xls', 'Export', '', 0, 'Specify Products and Families List Export to XLS filename')
  15. if empty(lcExportFile)
  16.     return .f.
  17. endif empty(lcExportFile)
  18.  
  19. wait window nowait 'Querying Products and Families...'
  20.  
  21. select  active,                                   ;
  22.         sku,                                      ;
  23.         upc,                                      ;
  24.         product.name,                             ;
  25.         category2.name as Category,               ;
  26.         basePrice as Price,                       ;
  27.         .f. as Family                             ;
  28.     from swwebstore!product                       ;
  29.         join swwebstore!catlink                   ;
  30.             on product.pk = catlink.fkparent      ;
  31.         join swwebstore!category2                 ;
  32.             on catlink.fkcategory = category2.pk  ;
  33.     where catlink.parent = 'PRODUCT'              ;
  34.         and product.FKFamily = 0                  ;
  35.     union all                                     ;
  36.     select  active,                               ;
  37.         sku,                                      ;
  38.         upc,                                      ;
  39.         Family.name as name,                      ;
  40.         category2.name as Category,               ;
  41.         basePrice as Price,                       ;
  42.         .t. as Family                             ;
  43.     from swwebstore!Family                        ;
  44.         left join swwebstore!catlink              ;
  45.             on Family.pk = catlink.fkparent       ;
  46.         left join swwebstore!category2            ;
  47.             on catlink.fkcategory = category2.pk  ;
  48.     into cursor prodExport
  49.  
  50. wait window nowait 'Exporting...'
  51.  
  52. select prodExport
  53.  
  54. copy to(lcExportFile) type xl5
  55.  
  56. use in prodExpo
  57. * Module....:   exportproductsandfamilies.scp
  58. * Created by:   Patrick J. Murtaugh
  59. * Date......:   02/16/16
  60. * Client....:   Sportsmans Finest
  61. * Desc......:   Export all products and families
  62. * Export Fields: active, sku, upc, name, category, price, family
  63. * Changes...:
  64.  
  65. **** Copyright 2016, StorePorter LLC ****
  66.  
  67. local lcExportFile as string
  68.  
  69. lcExportFile = getfile('xls', 'Export', '', 0, 'Specify Products and Families List Export to XLS filename')
  70. if empty(lcExportFile)
  71.     return .f.
  72. endif empty(lcExportFile)
  73.  
  74. wait window nowait 'Querying Products and Families...'
  75.  
  76. select  active,                                   ;
  77.         sku,                                      ;
  78.         upc,                                      ;
  79.         product.name,                             ;
  80.         category2.name as Category,               ;
  81.         basePrice as Price,                       ;
  82.         .f. as Family                             ;
  83.     from swwebstore!product                       ;
  84.         join swwebstore!catlink                   ;
  85.             on product.pk = catlink.fkparent      ;
  86.         join swwebstore!category2                 ;
  87.             on catlink.fkcategory = category2.pk  ;
  88.     where catlink.parent = 'PRODUCT'              ;
  89.         and product.FKFamily = 0                  ;
  90.     union all                                     ;
  91.     select  active,                               ;
  92.         sku,                                      ;
  93.         upc,                                      ;
  94.         Family.name as name,                      ;
  95.         category2.name as Category,               ;
  96.         basePrice as Price,                       ;
  97.         .t. as Family                             ;
  98.     from swwebstore!Family                        ;
  99.         left join swwebstore!catlink              ;
  100.             on Family.pk = catlink.fkparent       ;
  101.         left join swwebstore!category2            ;
  102.             on catlink.fkcategory = category2.pk  ;
  103.     into cursor prodExport
  104.  
  105. wait window nowait 'Exporting...'
  106.  
  107. select prodExport
  108.  
  109. copy to(lcExportFile) type xl5
  110.  
  111. use in prodExpo
  112. * Created by:   Patrick J. Murtaugh
  113. * Date......:   02/16/16
  114. * Client....:   Sportsmans Finest
  115. * Desc......:   Export all products and families
  116. * Export Fields: active, sku, upc, name, category, price, family
  117. * Changes...:
  118.  
  119. **** Copyright 2016, StorePorter LLC ****
  120.  
  121. local lcExportFile as string
  122.  
  123. lcExportFile = getfile('xls', 'Export', '', 0, 'Specify Products and Families List Export to XLS filename')
  124. if empty(lcExportFile)
  125.     return .f.
  126. endif empty(lcExportFile)
  127.  
  128. wait window nowait 'Querying Products and Families...'
  129.  
  130. select  active,                                   ;
  131.         sku,                                      ;
  132.         upc,                                      ;
  133.         product.name,                             ;
  134.         category2.name as Category,               ;
  135.         basePrice as Price,                       ;
  136.         .f. as Family                             ;
  137.     from swwebstore!product                       ;
  138.         join swwebstore!catlink                   ;
  139.             on product.pk = catlink.fkparent      ;
  140.         join swwebstore!category2                 ;
  141.             on catlink.fkcategory = category2.pk  ;
  142.     where catlink.parent = 'PRODUCT'              ;
  143.         and product.FKFamily = 0                  ;
  144.     union all                                     ;
  145.     select  active,                               ;
  146.         sku,                                      ;
  147.         upc,                                      ;
  148.         Family.name as name,                      ;
  149.         category2.name as Category,               ;
  150.         basePrice as Price,                       ;
  151.         .t. as Family                             ;
  152.     from swwebstore!Family                        ;
  153.         left join swwebstore!catlink              ;
  154.             on Family.pk = catlink.fkparent       ;
  155.         left join swwebstore!category2            ;
  156.             on catlink.fkcategory = category2.pk  ;
  157.     into cursor prodExport
  158.  
  159. wait window nowait 'Exporting...'
  160.  
  161. select prodExport
  162.  
  163. copy to(lcExportFile) type xl5
  164.  
  165. use in prodExpo
  166. * Date......:   02/16/16
  167. * Client....:   Sportsmans Finest
  168. * Desc......:   Export all products and families
  169. * Export Fields: active, sku, upc, name, category, price, family
  170. * Changes...:
  171.  
  172. **** Copyright 2016, StorePorter LLC ****
  173.  
  174. local lcExportFile as string
  175.  
  176. lcExportFile = getfile('xls', 'Export', '', 0, 'Specify Products and Families List Export to XLS filename')
  177. if empty(lcExportFile)
  178.     return .f.
  179. endif empty(lcExportFile)
  180.  
  181. wait window nowait 'Querying Products and Families...'
  182.  
  183. select  active,                                   ;
  184.         sku,                                      ;
  185.         upc,                                      ;
  186.         product.name,                             ;
  187.         category2.name as Category,               ;
  188.         basePrice as Price,                       ;
  189.         .f. as Family                             ;
  190.     from swwebstore!product                       ;
  191.         join swwebstore!catlink                   ;
  192.             on product.pk = catlink.fkparent      ;
  193.         join swwebstore!category2                 ;
  194.             on catlink.fkcategory = category2.pk  ;
  195.     where catlink.parent = 'PRODUCT'              ;
  196.         and product.FKFamily = 0                  ;
  197.     union all                                     ;
  198.     select  active,                               ;
  199.         sku,                                      ;
  200.         upc,                                      ;
  201.         Family.name as name,                      ;
  202.         category2.name as Category,               ;
  203.         basePrice as Price,                       ;
  204.         .t. as Family                             ;
  205.     from swwebstore!Family                        ;
  206.         left join swwebstore!catlink              ;
  207.             on Family.pk = catlink.fkparent       ;
  208.         left join swwebstore!category2            ;
  209.             on catlink.fkcategory = category2.pk  ;
  210.     into cursor prodExport
  211.  
  212. wait window nowait 'Exporting...'
  213.  
  214. select prodExport
  215.  
  216. copy to(lcExportFile) type xl5
  217.  
  218. use in prodExpo
  219. * Client....:   Sportsmans Finest
  220. * Desc......:   Export all products and families
  221. * Export Fields: active, sku, upc, name, category, price, family
  222. * Changes...:
  223.  
  224. **** Copyright 2016, StorePorter LLC ****
  225.  
  226. local lcExportFile as string
  227.  
  228. lcExportFile = getfile('xls', 'Export', '', 0, 'Specify Products and Families List Export to XLS filename')
  229. if empty(lcExportFile)
  230.     return .f.
  231. endif empty(lcExportFile)
  232.  
  233. wait window nowait 'Querying Products and Families...'
  234.  
  235. select  active,                                   ;
  236.         sku,                                      ;
  237.         upc,                                      ;
  238.         product.name,                             ;
  239.         category2.name as Category,               ;
  240.         basePrice as Price,                       ;
  241.         .f. as Family                             ;
  242.     from swwebstore!product                       ;
  243.         join swwebstore!catlink                   ;
  244.             on product.pk = catlink.fkparent      ;
  245.         join swwebstore!category2                 ;
  246.             on catlink.fkcategory = category2.pk  ;
  247.     where catlink.parent = 'PRODUCT'              ;
  248.         and product.FKFamily = 0                  ;
  249.     union all                                     ;
  250.     select  active,                               ;
  251.         sku,                                      ;
  252.         upc,                                      ;
  253.         Family.name as name,                      ;
  254.         category2.name as Category,               ;
  255.         basePrice as Price,                       ;
  256.         .t. as Family                             ;
  257.     from swwebstore!Family                        ;
  258.         left join swwebstore!catlink              ;
  259.             on Family.pk = catlink.fkparent       ;
  260.         left join swwebstore!category2            ;
  261.             on catlink.fkcategory = category2.pk  ;
  262.     into cursor prodExport
  263.  
  264. wait window nowait 'Exporting...'
  265.  
  266. select prodExport
  267.  
  268. copy to(lcExportFile) type xl5
  269.  
  270. use in prodExpo
  271. * Desc......:   Export all products and families
  272. * Export Fields: active, sku, upc, name, category, price, family
  273. * Changes...:
  274.  
  275. **** Copyright 2016, StorePorter LLC ****
  276.  
  277. local lcExportFile as string
  278.  
  279. lcExportFile = getfile('xls', 'Export', '', 0, 'Specify Products and Families List Export to XLS filename')
  280. if empty(lcExportFile)
  281.     return .f.
  282. endif empty(lcExportFile)
  283.  
  284. wait window nowait 'Querying Products and Families...'
  285.  
  286. select  active,                                   ;
  287.         sku,                                      ;
  288.         upc,                                      ;
  289.         product.name,                             ;
  290.         category2.name as Category,               ;
  291.         basePrice as Price,                       ;
  292.         .f. as Family                             ;
  293.     from swwebstore!product                       ;
  294.         join swwebstore!catlink                   ;
  295.             on product.pk = catlink.fkparent      ;
  296.         join swwebstore!category2                 ;
  297.             on catlink.fkcategory = category2.pk  ;
  298.     where catlink.parent = 'PRODUCT'              ;
  299.         and product.FKFamily = 0                  ;
  300.     union all                                     ;
  301.     select  active,                               ;
  302.         sku,                                      ;
  303.         upc,                                      ;
  304.         Family.name as name,                      ;
  305.         category2.name as Category,               ;
  306.         basePrice as Price,                       ;
  307.         .t. as Family                             ;
  308.     from swwebstore!Family                        ;
  309.         left join swwebstore!catlink              ;
  310.             on Family.pk = catlink.fkparent       ;
  311.         left join swwebstore!category2            ;
  312.             on catlink.fkcategory = category2.pk  ;
  313.     into cursor prodExport
  314.  
  315. wait window nowait 'Exporting...'
  316.  
  317. select prodExport
  318.  
  319. copy to(lcExportFile) type xl5
  320.  
  321. use in prodExpo
  322. * Export Fields: active, sku, upc, name, category, price, family
  323. * Changes...:
  324.  
  325. **** Copyright 2016, StorePorter LLC ****
  326.  
  327. local lcExportFile as string
  328.  
  329. lcExportFile = getfile('xls', 'Export', '', 0, 'Specify Products and Families List Export to XLS filename')
  330. if empty(lcExportFile)
  331.     return .f.
  332. endif empty(lcExportFile)
  333.  
  334. wait window nowait 'Querying Products and Families...'
  335.  
  336. select  active,                                   ;
  337.         sku,                                      ;
  338.         upc,                                      ;
  339.         product.name,                             ;
  340.         category2.name as Category,               ;
  341.         basePrice as Price,                       ;
  342.         .f. as Family                             ;
  343.     from swwebstore!product                       ;
  344.         join swwebstore!catlink                   ;
  345.             on product.pk = catlink.fkparent      ;
  346.         join swwebstore!category2                 ;
  347.             on catlink.fkcategory = category2.pk  ;
  348.     where catlink.parent = 'PRODUCT'              ;
  349.         and product.FKFamily = 0                  ;
  350.     union all                                     ;
  351.     select  active,                               ;
  352.         sku,                                      ;
  353.         upc,                                      ;
  354.         Family.name as name,                      ;
  355.         category2.name as Category,               ;
  356.         basePrice as Price,                       ;
  357.         .t. as Family                             ;
  358.     from swwebstore!Family                        ;
  359.         left join swwebstore!catlink              ;
  360.             on Family.pk = catlink.fkparent       ;
  361.         left join swwebstore!category2            ;
  362.             on catlink.fkcategory = category2.pk  ;
  363.     into cursor prodExport
  364.  
  365. wait window nowait 'Exporting...'
  366.  
  367. select prodExport
  368.  
  369. copy to(lcExportFile) type xl5
  370.  
  371. use in prodExpo
  372. * Changes...:
  373. **** Copyright 2016, StorePorter LLC ****
  374.  
  375. local lcExportFile as string
  376.  
  377. lcExportFile = getfile('xls', 'Export', '', 0, 'Specify Products and Families List Export to XLS filename')
  378. if empty(lcExportFile)
  379.     return .f.
  380. endif empty(lcExportFile)
  381.  
  382. wait window nowait 'Querying Products and Families...'
  383.  
  384. select  active,                                   ;
  385.         sku,                                      ;
  386.         upc,                                      ;
  387.         product.name,                             ;
  388.         category2.name as Category,               ;
  389.         basePrice as Price,                       ;
  390.         .f. as Family                             ;
  391.     from swwebstore!product                       ;
  392.         join swwebstore!catlink                   ;
  393.             on product.pk = catlink.fkparent      ;
  394.         join swwebstore!category2                 ;
  395.             on catlink.fkcategory = category2.pk  ;
  396.     where catlink.parent = 'PRODUCT'              ;
  397.         and product.FKFamily = 0                  ;
  398.     union all                                     ;
  399.     select  active,                               ;
  400.         sku,                                      ;
  401.         upc,                                      ;
  402.         Family.name as name,                      ;
  403.         category2.name as Category,               ;
  404.         basePrice as Price,                       ;
  405.         .t. as Family                             ;
  406.     from swwebstore!Family                        ;
  407.         left join swwebstore!catlink              ;
  408.             on Family.pk = catlink.fkparent       ;
  409.         left join swwebstore!category2            ;
  410.             on catlink.fkcategory = category2.pk  ;
  411.     into cursor prodExport
  412.  
  413. wait window nowait 'Exporting...'
  414.  
  415. select prodExport
  416.  
  417. copy to(lcExportFile) type xl5
  418.  
  419. use in prodExpo
  420. **** Copyright 2016, StorePorter LLC ****
  421.  
  422. local lcExportFile as string
  423.  
  424. lcExportFile = getfile('xls', 'Export', '', 0, 'Specify Products and Families List Export to XLS filename')
  425. if empty(lcExportFile)
  426.     return .f.
  427. endif empty(lcExportFile)
  428.  
  429. wait window nowait 'Querying Products and Families...'
  430.  
  431. select  active,                                   ;
  432.         sku,                                      ;
  433.         upc,                                      ;
  434.         product.name,                             ;
  435.         category2.name as Category,               ;
  436.         basePrice as Price,                       ;
  437.         .f. as Family                             ;
  438.     from swwebstore!product                       ;
  439.         join swwebstore!catlink                   ;
  440.             on product.pk = catlink.fkparent      ;
  441.         join swwebstore!category2                 ;
  442.             on catlink.fkcategory = category2.pk  ;
  443.     where catlink.parent = 'PRODUCT'              ;
  444.         and product.FKFamily = 0                  ;
  445.     union all                                     ;
  446.     select  active,                               ;
  447.         sku,                                      ;
  448.         upc,                                      ;
  449.         Family.name as name,                      ;
  450.         category2.name as Category,               ;
  451.         basePrice as Price,                       ;
  452.         .t. as Family                             ;
  453.     from swwebstore!Family                        ;
  454.         left join swwebstore!catlink              ;
  455.             on Family.pk = catlink.fkparent       ;
  456.         left join swwebstore!category2            ;
  457.             on catlink.fkcategory = category2.pk  ;
  458.     into cursor prodExport
  459.  
  460. wait window nowait 'Exporting...'
  461.  
  462. select prodExport
  463.  
  464. copy to(lcExportFile) type xl5
  465.  
  466. use in prodExport
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement