Multiple invoices and numbering invoices

Hello again.
Is there a way to numerically number invoices through Numbers? Also is it better to save multiple invoices separately in a folder or is it better/possible to have all the invoices throughout a year save in a single Numbers document?

Thanks
Stephen

Mac Pro Intel, Mac OS X (10.5.2)

Posted on Mar 3, 2008 2:58 AM

Reply
12 replies

Mar 3, 2008 8:05 AM in response to SUNNY0523

Hello

I wrote a script which may do that for Pages.

It will be usable if you put your Invoice in a table of a Pages document.

I will try to modify it to work on a Numbers document the day this application will be scriptable.

(*
Enregistrer le script en tant qu'Application ou Progiciel : numéroteur.app
déplacer l'application créée dans le dossier
<VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Pages:
Il vous faudra peut-être créer le dossier Pages et peut-être même le dossier Applications.

Quand vous voudrez créer une facture, allez en
menu Scripts > numéroteur

Le script créera une nouvelle facture à partir du modèle "ma_facture.template"
stocké dans le dossier "Modèles:Mes Modèles".
Il remplacera la balise "#erutcaf#" par un numéro de facture qu'il stockera
dans le fichier "le_numéro.txt" rangé dans le "paquet" du modèle.

+++++++

Save the script as an Application or an Application Bundle: numéroteur.app

Move the newly created application into the folder:
<startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Pages:
Maybe you would have to create the folder Pages and even the folder Applications by yourself.

When you want to create a new invoice
Go to

menu Scripts > numéroteur

The script will create a new invoice document from the template "ma_facture.template"
stored in "Templates:My templates"

It will replace the string "#erutcaf#" by an invoice number
and store it in the file "le_numéro.txt" in the template's package.

Yvan KOENIG le 1er mars 2008
*)
--(SCRIPT numéroteur.app]
property balise : "#erutcaf#"
property factName : "ma_facture.template" (*
Adapter à vos besoins
Put your preferred title *)
property fichierNum : "le_numéro.txt" (*
Adapter à vos besoins
Put your preferred title *)

set {chemin, numero} to my prepare()
set numero to text -5 thru -1 of ("0000" & numero) (* pour numéro de 5 chiffres *)
tell application "Pages"
open chemin
tell document 1
set tt to every text
set t1 to item 1 of tt
set i1 to offset of balise in t1
select text from character i1 to character (i1 + (length of balise) - 1) of body text
set the selection to numero
end tell -- to document 1
end tell -- to Pages

on prepare()
local d1, d2, p2d, f, p2n, n
tell application "Pages"
set d1 to localized string "Templates" (* nom local du dossier "Modèles" *)
set d2 to localized string "My Templates" (* nom local du dossier "Mes Modèles" *)
end tell
set p2d to (path to application support from user domain) as Unicode text
set f to p2d & "iWork:Pages:" & d1 & ":" & d2 & ":" & factName & ":"
set p2n to f & fichierNum
set f to f as alias
tell application "System Events"
if not (exists file p2n) then
make new file at end of f with properties {name:fichierNum}
write "100" to file p2n (* mettez le numéro de départ de votre choix *)
end if
end tell
set n to read file p2n
set n to ((n as integer) + 1) as text
write n to file p2n starting at 1
return {f, n}
end prepare
--[/SCRIPT]

It's available from my idisk:

<http://idisk.mac.com/koenigyvan-Public?view=web>

in the folder: For_Pages

in the archive: numérote_facture.zip

Yvan KOENIG (from FRANCE lundi 3 mars 2008 17:03:45)

Mar 6, 2008 3:21 AM in response to SUNNY0523

Hello

Are you sure that you read what is written at the beginning of the script ?


+Move the newly created application into the folder:+
+<startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Pages:+
+_Maybe you would have to create the folder Pages and even the folder Applications by yourself_.+

Yvan KOENIG (from FRANCE jeudi 6 mars 2008 12:21:11)

Mar 6, 2008 10:02 AM in response to SUNNY0523

Hello

OK, I forgot to edit something in the explanations.

I posted TWO scripts.

_One is named "numéroteur.app"_
explanations are OK:

Save the script as an Application or an Application Bundle: numéroteur.app

Move the newly created application into the folder:
<startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Pages:
Maybe you would have to create the folder Pages and even the folder Applications by yourself.

When you want to create a new invoice
Go to

menu Scripts > numéroteur

_The script will create a new invoice document from the template "ma facture.template"
_stored in "Templates:My templates"_

It will _replace the string "#erutcaf#"_ by an invoice number
and store it in the file "le_numéro.txt" in the template's package.

It seems that I must add that it's your duty to create the template. I can't do it for you.
Of course, don't forget to put the string "#erutcaf#" where you want that the script put the number.
Don't worry, "#erutcaf#" is just facture in reversed order 😉

_The second script is named : numérote Numbers.app
the explanations contains twice the word Pages in lieu of Numbers.

here is a corrected version:

Save the script as an Application or an Application Bundle: numérote_Numbers.app

Move the newly created application into the folder:
<startup Volume>:Users:<yourAccount>:Library:Scripts:Applications: Numbers :
Maybe you would have to create the folder Numbers and even the folder Applications by yourself.

When you want to create a new invoice
Go to

menu Scripts > numérote_Numbers

_The script will create a new invoice document from the template "ma facture.nmbtemplate"
_stored in "Templates:My templates"_

It will paste an invoice number
and store it in the file "le_numéro.txt" in the template's package.

It seems that it is useful to add that this time, the template is a Numbers's one as is clearly staded by the name extension nmbtemplate

With thy version dedicated to Numbers, there is no need for a string telling "put the number here".
As Numbers is not AppleScript's aware, I'm just able to paste the number in the cell which was selected when you saved the template.

I hope that this time all is clear.

Yvan KOENIG (from FRANCE jeudi 6 mars 2008 18:59:25)

Mar 8, 2008 5:30 AM in response to KOENIG Yvan

Hi again. This is all getting to complicated.
First off. Should I use Pages or Numbers to generate invoices?
2nd - I really hope an update to iWork 08 will give users a new invoicing section where we can easily create invoices which will give the following features:

1 - Display current date
2 - Automatically generate numbered invoices
3 - Arrange taxes in any way like required in PEi Canada http://www.gov.pe.ca/infopei/index.php3?lang=E&number=1010944
4 - Save all invoices in one multipaged file.

Perhaps Apple needs to have included in iWork 08 are the applications: NUMBERS, PAGES, KEYNOTE & INVOICE!

thanks for your efforts.

Mar 8, 2008 6:08 AM in response to SUNNY0523

Hello

Is my English so bad ?

I gave two scripts.

One allowing to use Pages for your invoices
and
one allowing to use Numbers.

I doubt that Apple will add what you asked for.

With my scripts, you have to create a template for an invoice in Pages:

A WP document with at least;
a string which will be replaced by a number when you will call the script
a table in which you will create the invoice.
I already sent you the formulas which are needed to match what appears in the linked site.

or

create a template of an invoice in Numbers.

This one must contain a table in which you will build your invoice with the already given formulas
Save the template with the cursor in the cell where you want that the script put the unique number.

My 8 years old grand-son is able to use them 😉

Yvan KOENIG (from FRANCE samedi 8 mars 2008 15:07:17)

Mar 8, 2008 4:10 PM in response to WWJD

Your English is very good!

It is not that I am unable to use them, but what bugs me is a program called "Number" needs to have someone like yourself creating scripts to use invoicing in an efficient manner. If you were not around what would we do?

There are $50 programs out there that do a great job of invoicing. I would think a multi billion dollar corporation could add the invoicing area to iWork 08.

Am I correct?

Stephen

Mar 9, 2008 3:45 AM in response to SUNNY0523

Hello

Your message claims that you respond to WWJD but it's not him who was afraid of his English.

We are users trying to help users.
If you take time to read the Terms of Uses ruling these forum (you MUST have already do that), you know that we are not allowed to discuss some subjects.

From my point of vue,
There are $50 programs out there that do a great job of invoicing. I would think a multi billion dollar corporation could add the invoicing area to iWork 08.


is one of them.

Yvan KOENIG (from FRANCE dimanche 9 mars 2008 11:45:37)

Mar 9, 2008 1:17 PM in response to SUNNY0523

I just downloaded it and looked through it (Invoices) I find it totally mystifying. If I can't figure out how to make a new invoice in fifteen minutes, even with watching the video... well... sorry.

I figured out in another thread how to create a new invoice and make it's number unique. It's a troublesome workaround in this thread:

http://discussions.apple.com/message.jspa?messageID=5975319#5975319

Just don't use the auto date insertion field. It doesn't stick to the date of creation, but updates whenever the invoice is opened.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Multiple invoices and numbering invoices

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.