/**
* @NApiVersion 2.x
* @NScriptType ClientScript
* @NModuleScope SameAccount
*
* 05/12/2022 Tim Pedersen - Adding functionality where the previous week's hours are collected and added to the current week's hours.
* Unlike the other client script running on this recrd, this script is intended to also add the hours and memo from the previous week to the current week
* This script will fire when a button is pressed, and only work in edit mode (not view mode).
*
*/
define(['N/currentRecord', 'N/search', 'N/format'],
function(currentRecord, search, format) {
var isEdit = false;
function pageInit(scriptContext) {
if (scriptContext.mode == 'edit')
isEdit = true;
}
function copyPreviousWeekAll() {
var rec = currentRecord.get();
var employee = rec.getValue('employee');
var date = rec.getValue('trandate');
log.debug('employee', employee);
log.debug('date', date);
return true;
};
return {
pageInit: pageInit,
copyPreviousWeekAll: copyPreviousWeekAll
};
});