Module: ErpTools::Id
- Defined in:
- lib/erp_tools/id.rb
Defined Under Namespace
Classes: InvalidIdentifier
Constant Summary
collapse
- DELIMITER =
'-'
- ADDRESS_PREFIX =
'CI-ADDR'
- CUSTOMER_DEPOSIT_PREFIX =
'CI-CD'
- CUSTOMER_PREFIX =
'CI-CUS'
- INVENTORY_RECEIPT_PREFIX =
'CI-IR'
- ITEM_FULFILLMENT_PREFIX =
'CI-IF'
- JOB_PREFIX =
'CI-JOB'
- MMS_FINISHED_GOOD_SUFFIX =
'F'
- MMS_SKU_PREFIX =
'INVITM-MMS'
- PURCHASE_ORDER_PREFIX =
'CI-PO'
- SALES_ORDER_PREFIX =
'CI-SO'
- WORK_ORDER_PREFIX =
'CI-WO'
Class Method Summary
collapse
Class Method Details
.address(address_composite_id) ⇒ Object
21
22
23
24
25
|
# File 'lib/erp_tools/id.rb', line 21
def address(address_composite_id)
raise_if_empty!(address_composite_id)
[ADDRESS_PREFIX, address_composite_id.to_s].join(DELIMITER)
end
|
.blank_mms_sku(skuable) ⇒ Object
57
58
59
60
61
|
# File 'lib/erp_tools/id.rb', line 57
def blank_mms_sku(skuable)
raise_if_empty!(mms_sku_to_param(skuable))
[MMS_SKU_PREFIX, mms_sku_to_param(skuable).to_s].join(DELIMITER)
end
|
.customer(account_id) ⇒ Object
33
34
35
36
37
|
# File 'lib/erp_tools/id.rb', line 33
def customer(account_id)
raise_if_empty!(account_id)
[CUSTOMER_PREFIX, account_id.to_s].join(DELIMITER)
end
|
.customer_deposit(payment_id) ⇒ Object
27
28
29
30
31
|
# File 'lib/erp_tools/id.rb', line 27
def customer_deposit(payment_id)
raise_if_empty!(payment_id)
[CUSTOMER_DEPOSIT_PREFIX, payment_id.to_s].join(DELIMITER)
end
|
.decorated_mms_sku(skuable) ⇒ Object
.inventory_receipt(inventory_receipt_id) ⇒ Object
39
40
41
42
43
|
# File 'lib/erp_tools/id.rb', line 39
def inventory_receipt(inventory_receipt_id)
raise_if_empty!(inventory_receipt_id)
[INVENTORY_RECEIPT_PREFIX, inventory_receipt_id.to_s].join(DELIMITER)
end
|
.item_fulfillment(item_fulfillment_id) ⇒ Object
45
46
47
48
49
|
# File 'lib/erp_tools/id.rb', line 45
def item_fulfillment(item_fulfillment_id)
raise_if_empty!(item_fulfillment_id)
[ITEM_FULFILLMENT_PREFIX, item_fulfillment_id.to_s].join(DELIMITER)
end
|
.job_order(ci_order_id) ⇒ Object
51
52
53
54
55
|
# File 'lib/erp_tools/id.rb', line 51
def job_order(ci_order_id)
raise_if_empty!(ci_order_id)
[JOB_PREFIX, ci_order_id.to_s].join(DELIMITER)
end
|
.purchase_order(purchase_order_id) ⇒ Object
69
70
71
72
73
|
# File 'lib/erp_tools/id.rb', line 69
def purchase_order(purchase_order_id)
raise_if_empty!(purchase_order_id)
[PURCHASE_ORDER_PREFIX, purchase_order_id.to_s].join(DELIMITER)
end
|
.sales_order(sales_order_id) ⇒ Object
75
76
77
78
79
|
# File 'lib/erp_tools/id.rb', line 75
def sales_order(sales_order_id)
raise_if_empty!(sales_order_id)
[SALES_ORDER_PREFIX, sales_order_id.to_s].join(DELIMITER)
end
|
.work_order(work_order_id) ⇒ Object
81
82
83
84
85
|
# File 'lib/erp_tools/id.rb', line 81
def work_order(work_order_id)
raise_if_empty!(work_order_id)
[WORK_ORDER_PREFIX, work_order_id.to_s].join(DELIMITER)
end
|