Skip to content

Instantly share code, notes, and snippets.

@richiejd
Last active August 29, 2015 14:17
Show Gist options
  • Save richiejd/ac0854a7423c62a02629 to your computer and use it in GitHub Desktop.
Save richiejd/ac0854a7423c62a02629 to your computer and use it in GitHub Desktop.
Test 6 export

set the import file to be BBOX-5087_t6_import.csv

subscription_id,box_product_id,shipping_method_code,country_code
973666,13274,SP,US
934390,13225,SP,US
1266647,13252,SP,US

where 973666 has two gws, 934390 has one gws and 1266647 has one bbp

then reset allocation for these subscriptions:

update box_history set shipment_id = null where subscription_id in (973666, 934390, 1266647) and shipping_cycle_id = 57;
update box_history set box_id = null where subscription_id in (973666, 934390, 1266647) and shipping_cycle_id = 57;

Now I run

sudo ./run.sh -a BBOX-5087_t6_import.csv -cc US -T 2014-06-10 -C 57
sudo ./run.sh -cc US -o -e BBXORD_BBOX-5087_t6.txt

the output is BBXORD_BBOX-5087_t6.txt

BB12462344      2015/3/27       1036470 Gwen Flamberg   1290 Avenue of the Americas     2nd Floor       New York        NY      10104   US      555-555-5555                    Gwen Flamberg   1290 Avenue of the Americas     2nd Floor       New York        NY      10104   US      555-555-5555            13274   1       SP                      0       0       0                                               0       0       0                                                                                                                                               09                                                      Wenner Media    Wenner Media                                                                                                                                                            BBX     S       EA      0.05
BB12462344      2015/3/27       1036470 Gwen Flamberg   1290 Avenue of the Americas     2nd Floor       New York        NY      10104   US      555-555-5555                    Gwen Flamberg   1290 Avenue of the Americas     2nd Floor       New York        NY      10104   US      555-555-5555            10002   1       SP                      0       0       0                                               0       0       0                                                                                                                                               09                                                      Wenner Media    Wenner Media                                                                                                                                                            BBX     S       EA      0.05
BB12462344      2015/3/27       1036470 Gwen Flamberg   1290 Avenue of the Americas     2nd Floor       New York        NY      10104   US      555-555-5555                    Gwen Flamberg   1290 Avenue of the Americas     2nd Floor       New York        NY      10104   US      555-555-5555            10002   1       SP                      0       0       0                                               0       0       0                                                                                                                                               09                                                      Wenner Media    Wenner Media                                                                                                                                                            BBX     S       EA      0.05
BB12462345      2015/3/27       994013  Kaitlin Carpenter       4605 Twinbrook Road             Fairfax VA      22032   US      512-557-00                      Kaitlin Carpenter       4605 Twinbrook Road             Fairfax VA      22032   US      512-557-00              13225   1       SP                      0       0       0                                               0       0       0                                                                                                                                               09                                                                                                                                                                                                                              BBX     S       EA      0.05
BB12462345      2015/3/27       994013  Kaitlin Carpenter       4605 Twinbrook Road             Fairfax VA      22032   US      512-557-00                      Kaitlin Carpenter       4605 Twinbrook Road             Fairfax VA      22032   US      512-557-00              10002   1       SP                      0       0       0                                               0       0       0                                                                                                                                               09                                                                                                                                                                                                                              BBX     S       EA      0.05
BB12462346      2015/3/27       1270701 Anne Iovinelli  2698 Valley Forge Road          Lisle   IL      60532   US      630-885-08                      Anne Iovinelli  2698 Valley Forge Road          Lisle   IL      60532   US      630-885-08              13252   1       SP                      0       0       0                                               0       0       0                                                                                                                                               09                                                                                                                                                                                                                              BBX     S       EA      0.05
BB12462346      2015/3/27       1270701 Anne Iovinelli  2698 Valley Forge Road          Lisle   IL      60532   US      630-885-08                      Anne Iovinelli  2698 Valley Forge Road          Lisle   IL      60532   US      630-885-08              12767   1       SP                      0       0       0                                               0       0       0                                                                                                                                               09                                                                                                                                                                                                                              BBX     S       EA      0.05
BB12462346      2015/3/27       1270701 Anne Iovinelli  2698 Valley Forge Road          Lisle   IL      60532   US      630-885-08                      Anne Iovinelli  2698 Valley Forge Road          Lisle   IL      60532   US      630-885-08              C12766  1       SP                      0       0       0                                               0       0       0                                                                                                                                               09                                                                                                                                                                                                                              BBX     S       EA      0.05

and the output matches giving the correct gws and bbp for all customers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment