Skip to content

Commit

Permalink
Minor Updates
Browse files Browse the repository at this point in the history
Updates here are needed to support offers and contract creation. Also unlocks the bundle on install for future customization.
  • Loading branch information
al3-team committed Nov 2, 2022
1 parent f6c866a commit 9ce9afd
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 32 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

.DS_Store
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
})
objNoteRecord.setValue('transaction', objSalesOrderRecord.id);
objNoteRecord.setValue('title', 'Extend Contract Create Error | Line ' + key);
objNoteRecord.setValue('note', JOSN.stringify(objExtendResponse));
objNoteRecord.setValue('note', JSON.stringify(objExtendResponse));
var stNoteId = objNoteRecord.save();
}
}
Expand Down Expand Up @@ -184,12 +184,12 @@
var objJSON = {
'transactionId': objValues.id,
'transactionDate': objValues.tran_date,
// 'transactionTotal': objValues.total_amount * 100,
'transactionTotal': objValues.total_amount * 100,

'transactionTotal': {
'currencyCode': objValues.currency,
'amount': parseInt(objValues.total_amount * 100)
},
// 'transactionTotal': {
// 'currencyCode': objValues.currency,
// 'amount': parseInt(objValues.total_amount * 100)
// },

'currency': objValues.currency,
'poNumber': objValues.order_number,
Expand All @@ -216,24 +216,23 @@
},
'product': {
'referenceId': objValues.refId,
// 'purchasePrice': objValues.purchase_price * 100,
'purchasePrice': objValues.purchase_price * 100,

'purchasePrice': {
'currencyCode': objValues.currency,
'amount': parseInt(objValues.purchase_price * 100),
}
// 'purchasePrice': {
// 'currencyCode': objValues.currency,
// 'amount': parseInt(objValues.purchase_price * 100),
// }

// 'serialNumber' : objValues.serial_number
},
'plan': {
// 'purchasePrice': objValues.plan_price * 100,

'purchasePrice': {
'currencyCode': objValues.currency,
'amount': parseInt(objValues.plan_price * 100),
},
'planId': objValues.extend_plan_id,
'purchasePrice': objValues.plan_price * 100,

'planId': objValues.extend_plan_id
// 'purchasePrice': {
// 'currencyCode': objValues.currency,
// 'amount': parseInt(objValues.plan_price * 100),
// },
}
};
return objJSON;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*@NScriptType Suitelet
*@NModuleScope Public
*/
define([
define([
'N/ui/serverWidget',
'N/runtime',
'N/http',
Expand Down Expand Up @@ -62,6 +62,7 @@ define([
objExtendItem.stItemId = objRequest.parameters.custpage_item_select;
objExtendItem.stItemName = objRequest.parameters.custpage_item_name.trim();
objExtendItem.stItemQty = objRequest.parameters.custpage_item_qty;
objExtendItem.stRefId = objRequest.parameters.custpage_item_ref_id;
objExtendItem.stPlanId = '';
objExtendItem.stPrice = 0;
objExtendItem.stDescription = '';
Expand Down Expand Up @@ -336,23 +337,14 @@ define([
try {
var objResponse = api.getPlansByItem(stItemRefId);
log.debug('OFFER MODAL SUITELET: Offers JSON Response', objResponse);

if (objResponse.code == 200) {
var objResponseBody = JSON.parse(objResponse.body);

log.debug('OFFER MODAL SUITELET: Offers JSON Response', objResponseBody);

var objPlans = objResponseBody.plans;
log.debug('OFFER MODAL SUITELET: objPlans', objPlans);

var arrPlans = objPlans.base;
var arrPlans = objResponseBody.plans;
log.debug('OFFER MODAL SUITELET: arrPlans', arrPlans);

if (arrPlans.length == 0) {
var arrPlans = objPlans.adh;
}

log.debug('arrPlans', arrPlans);

//Populate Sublist Values
for (var i = 0; i < arrPlans.length; i++) {
objPlanList.setSublistValue({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<!-- For more information, see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_1543865613.html -->

<preference type="LOCKING" defaultAction="UNLOCK">
<apply action="LOCK">
<!-- <apply action="LOCK"> -->
<!-- <object>custcontenttype_myobject</object> -->
<!-- <path>~/FileCabinet/SuiteApps/xxx.xxx.xxx/MyScript.js</path> -->
</apply>
<!-- </apply> -->
</preference>

0 comments on commit 9ce9afd

Please sign in to comment.