Duplicate one invoice
  • paulopaulo November 2008

    Hello,

    sometimes i have the same costumer doing the same payment for the same itens or with one or two differences after some time.

    Is there possible to "copy" one invoice and its content to a new invoice ?. Then we will be able to change the date and the rest of the information before proceding but that would help save a lot of time.

    Thank you,

    Paulo Santos

  • justinjustin November 2008

    Thansk Paulo for the suggestion

    its a good idea - currently this is not possible but i've added it into our 'dreamtime' roadmap
    http://simpleinvoices.org/roadmap/dreamtime

    Cheers

    Justin

    SmarterInvoices.com :: Simple Invoices hosting | Kelly.org.au :: Simple Invoices custom development | justin.kelly.org.au
  • ezbillingezbilling January 21

    Well, this seems to be a rather simple chore as it turns out. I started to fiddle around, examined the code, started to add lines when I stopped and tried this:

    In simpleinvoices/templates/default/invoices/details.tpl add a radio button to update/edit *or* insert
    {if $invoice.id == null}
    <input type="hidden" name="action" value="insert" />
    {else}
    <input type="hidden" name="id" value="{$invoice.id|htmlsafe}" />
    <input type="radio" name="action" value="edit" checked>{$LANG.update}&nbsp;<br>
    <input type="radio" name="action" value="insert">{$LANG.new}&nbsp;
    {/if}

    (The code is completely functional. But you will probably want to position the buttons neatly. To keep it brief I didn't post the table-formatting stuff. Also, "new" and "update" will have to be set in the language table(s). Something like "save as new" and "save changes")
    Notes/explanation:
    When the id is not yet set (new invoice) no radio buttons are shown. When you edit though (edit is preselected) you can now switch to action insert and voilà you've got a copy. Please report any problems. It seems to me everything works fine.

  • hadzohadzo January 24

    I guess you cold use recurring function for this?

  • ezbillingezbilling January 24

    That's not the same thing because there is nothing to edit before running api-cron. So you cannot pick up a record immediately and proceed from there. You'd have to

    1. replace the customer to make sure you don't accidently mail your invoice
    2. define a recurring invoice
    3. run api-cron
    4. delete the recurring invoice you just defined to make a copy

    Paulo and myself wanted to simply use an existing invoice as a template and modify it.

    Cheers,
    Rudy

  • hadzohadzo January 24

    I might not understand what you want. Recurring function copies the existing invoice into a new one which you can later edit....right?

  • ezbillingezbilling January 24

    I modified my posting above to express more clearly

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

Categories