A Google Apps Script project to automatically generate GRN (Good Receiving Note) Forms from spreadsheet data.
View Demo · Report Bug · Request Feature
The Google Apps Script - GRN Form Generator is a script that automates the process of generating GRN (Good Receiving Note) Forms from data in a Google Sheets spreadsheet. It allows you to create multiple GRN Forms for different suppliers and organize them in a designated destination folder.
The script reads data from a Google Sheets spreadsheet with specific column configurations:
- Column A: Date
- Column B: Supplier
- Column C: Customer
- Column D: Delivery Order Number (DONO)
- Column E: GRN Number
- Column F: Purchase Order Number (PO)
- Column G: Model Number
Please modify the code if you want to change anything about the column!!
Each row in the spreadsheet represents an item received, and the script generates a separate GRN Form for each supplier containing the relevant item details.
The generated GRN Forms are based on predefined Google Docs templates, stored in Google Drive, with placeholders like {{DATE}}, {{GRNNO}}, {{SUPPLIER}}, and others. The script replaces these placeholders with actual data from the spreadsheet.
If the number of items in a GRN Form exceeds a certain threshold, the script creates additional GRN Forms (e.g., "GRN Form (2)", "GRN Form (3)", etc.) and spreads the item details across these forms to avoid exceeding the Google Docs' document length limit.
-
Clone the repository:
git clone https://github.com/devHanif-git/GRN-Form-Generator-GAS.git
-
Open the
code.gsfile in the Google Apps Script editor. -
Set up your Google Sheets spreadsheet with the required column configurations mentioned in the "How it Works" section.
-
Create Google Docs templates for GRN Forms with placeholders for item details.
-
Obtain the ID of each template file from Google Drive and replace the template IDs in the
code.gsfile.
- Open your Google Sheets spreadsheet containing the item data.
- In the toolbar, click on "Form Generator" > "Generate GRN Form" (The menu name can be customized).
- The script will automatically generate GRN Forms based on the data in the spreadsheet and save them in the designated destination folder in Google Drive.
- The status column in the spreadsheet will be updated to "FINISHED" for each processed row.
- If the number of items in a GRN Form exceeds the limit, the script will create additional forms and spread the items across them.
Contributions are welcome! If you have any ideas, suggestions, or bug reports, please create an issue.
- Fork the project.
- Create your feature branch (
git checkout -b feature/YourFeature). - Commit your changes (
git commit -m 'Add some feature'). - Push to the branch (
git push origin feature/YourFeature). - Open a pull request.
This project is licensed under the MIT License.