Google Sheets Purchase Order Generator: Using Purchase Order Template and Google Apps Script
ฝัง
- เผยแพร่เมื่อ 14 ก.ค. 2020
- In this video, we take the Google Sheets Template and populate the data needed for a Purchase Order using Google Apps Script.
Video, Code, and Documentation can be found at:
codewithcurt.com/how-to-creat...
Google Apps Script Code in Video Below:
function AddItem()
{
//DEFINE ALL ACTIVE SHEETS
var ss = SpreadsheetApp.getActiveSpreadsheet();
//DEFINE MENU SHEET
var poSheet = ss.getSheetByName("POS");
var itemSheet = ss.getSheetByName("ITEMS");
//GET NEXT ROW OF PO SHEET
var lastrowPO = poSheet.getLastRow() + 1;
//GET LAST ROW OF ITEM SHEET
var lastrowItem = itemSheet.getLastRow();
// GET VALUE OF PART AND QUANTITY
var part = poSheet.getRange('B13').getValue();
var quantity = poSheet.getRange('B14').getValue();
// GET UNIT PRICE FROM ITEM SHEET
for(var i = 2; i
How can I copy this script
How to copy this script
No one youtuber seen good as you, You explain well and provide all the needs to a programmer and learner and needed person, heartly Salute to you sir
Hi, thanks for the super useful and clearly explained video! The only issue I have is that for some reason the total price does not compute on PRINTPO, but the rest of the script works fine.
Thank you for this great tool, one question, in case I would like to store on the PO LOG the list of items purchased to run some analytics, how can I do that? if there is another way of analyzing this also open to suggestions. Regards!
Great video and thanks for the script, buddy! Is it possible to add the order details with item name and qty in the PO log for each PO?
Curt - thank you so much. This is great. I am hoping you can help guide me through one additional coding. My product has the same Item Name but different description. I was hoping you could help me add/recode the portion of the code that pulls the unit price. I was wanting to have the code look at item and then description and pull the price based on those two variables. Is that possible?
Hey Curt how about logging PO including all the Items, like your retrieving the Items in the PO?
Thank you so much, really useful. One question, is it possible to use payment gates in google web apps?
Super need this knowledge
Thanks, great Video!! and is it possible to add code to keep track of the items ordered with PO, Vendor, order by, etc?
Excellent
If I want to transfer data from sheet PO print to PO Log by item by item, how can I do it? That is, if PO has 5 items, I needs 5 rows in PO log and each row is different based on item but other information (e.g., vendor name, PO number, issue date) are similar. Thanks you
while adding item B17 is coming with no value but for succesive addition of item B18,b19,... are show ing qty ,only B17 no entery is coming after adding
is there a way to get the sheet from you without needing to make my own i dont know how to fix the error i kept popping up when i tried to get ready to get the script on
thanks
Can you please share this Google sheet for copy
PO total in PO Log does not reflect the tax and shipping
Which version is suitable for this
will this be able to save the data base of the order??
I'd very much like to use this in my office. Are you selling the completed version you created?
Can I send this PRINT PO to an email with a confirmation button??
Thank you for the video. Appreciate it. Btw is there any way to change the currency. I managed to change in the print PObut couldn't change where unit price is generated in POS.
go to script and and go to line no: 35
setNumberFormat("$#,###.00");
change this to
setNumberFormat("₹#,###.00");
do u have a work order or job order generator?
Hi there, new version of sheets does not show the code 😢
HI Curt, Would it be possible to share the code for this?
Hello sir kudos to you
i get an error while add item, unit price showing indivisual instead of showing multiply by qty
please asnwer iam stuck on a project
where to check previously made p.o
Will you share this spreadsheet or is it available for purchase
@codeWithCurt I am getting this error message and I am not sure why? ReferenceError: companyName is not defined
Hey Curt or anyone else, I'm confused at 10:50 of the video when you copy in the code? where do you get this?
There’s a link in the video description that takes you to his website, you can copy the code from there
@@MelKate07 Yes thank you. I found it and tried to work through the script but am getting lots of errors because I am changing Curt's Purchase Order template. I do not write script so I'm a little confused.
Hi Curt, can be possible to send the info to a separate LOG spreadsheet? and how?
You could open your spreadsheet by URL. The URL of the spreadsheet. Then set the spreadsheet as active. Then declare your sheet.
var ss = SpreadsheetApp.openByUrl(
'docs.google.com/spreadsheets/d/abc1234567/edit');
SpreadsheetApp.setActiveSpreadsheet(ss);
var nameSheet = ss.getSheetByName('SHEETNAME');
Hello, everything is functioning correctly, but something I did to the sheet is now affecting the quantities added when I click the add items button. Cell C17 doesn't grab the quantities at all, and the cells after in Column C the quantities are off. Not grabbing the correct quantities I entered in Cell B14, seems to be deducting units?? Any advice? Or start over?
I'm experiencing the same issue. Everything else seems to be working up to that point.
Can you share the apps script code?
Hello Curt, Great Video thank you for sharing. I follow step by step all the video's instruction and at the end it didn't run. I got a bunch of red comments like this. TypeError: Cannot read property 'getRange' of null (line 211, file "Code") TypeError: Cannot read property 'getLastRow' of null (line 12, file "Code")Dismiss TypeError: Cannot read property 'getRange' of null (line 210, file "Code")Dismiss. Can you kindly help?
Make sure the Google Sheet names match up exactly from the video
can you share your sheet?
Hi I follow the step by step on how you create the sheets, but when I click the add item there is a context that appears in my screen that says a TypeError: Cannot read property 'getLastRow' of null, so I do I need to do to fix it thank you.
Hello Ezra, did you ever get an answer ? I don't see or find an response back. I'm having the same issue too
Hello Ezra, I was able to fix the same error message you received. If you need further details on how to fix, let me know.
@@fabulover1 how did you fix this error?
@@fabulover1 can you advise how you fixed this error? Thank you
Turns out I has a space at the end of my sheet name!!
When i do this i am getting type error and it is with getlastrow null details
Do you know the statement it is getting the error from.
Hello. Is there a link to download (copy) the file ?
Thanks
Indeed. It's faster for me to just open the file and see if it does what I want, copy scripts and functions, etc, rather than watching a 23 minute video about how to do it.
You do see the script in the video description? I think for a function and script that you're getting for free, you gotta be ready to put in some effort and at least create the spreadsheet yourself, buddy.
Hi Curt, do you have a suggestion or if possible for the purchase order once generated could automatically be PDF and then put in a google folder?
Also is there a way to make
This iPad capable?
May I have the code?
Hello Curt, Great Video! I tried all step by step, Clear PO and Add Item script is working perfectly well. But getting error while creating PO, "TypeError: Cannot read property 'getLastRow' of null
at createPO(Code:88:33)
Can you please help?
Make sure the Sheet Names match up with the Apps Script
I know nothing about google script and have coded anything in about 30 years. Tried to copy past this script but when I go to save I get an error msg "Syntax error: SyntaxError: Unexpected token '}' line: 37 file: Code.gs" ("are mine) Line 37 is a right side bracket with a red underline. This is at the end of the // populate PO sheet. Please help an old fart
I found the problem. There is a missing bracket on the Populate PO Sheet section
HI Its giving me the error on "Create PO" button TypeError: Cannot read property 'getLastRow' of null
Did you get an Answer? I have the same issue and for the life of me, I can't fix it! I have found that this is the Code issue but really need help: var lastrowPrint = printSheet.getLastRow();
Turns out I had a space at the end of my sheet name
How can i clear it
The next PO will replace the previous PO.
Give me link to download this sheet
I posted the code in the comments.
Please share me Script. its help for me
DOESNT WORK, DONT WASTE YOUR TIME
If I want to transfer data from sheet PO print to PO Log by item by item, how can I do it? That is, if PO has 5 items, I needs 5 rows in PO log and each row is different based on item but other information (e.g., vendor name, PO number, issue date) are similar. Thanks you
Bro did u manage to figure out. I need the formula on this. Can anyone help? Pls thanks
hi, did you got the solution?
@@mrbillion2074 you got?