Chech duplicate data in order

pesema

Avatar: pesema

2014-11-18 19:09

Hello,
I have problem with my last modification. In each order I need special field with number of invoice. But this field is another than order ID. Because I don“t need field with IP I made this field editable. Now I can edit this field and write a special number.

But I would like to check, that this number is unique, because each invoice must be with specifi number.

Can you help me with this problem?

Thank you very much
Ivan

» Quick.Cart v3.x

Ivan

deha

Avatar: deha

2014-11-19 13:41

It depends what pattern do you want to use for invoice numbering.
Generally you can create an invoice number when client sends the order, by adding aForm['iInvoice'] with the same method as the aForm['iOrder'] in addOrder function in core\orders.php
and adding variable iInvoice in db/orders.def.php

DEHA

boboo

Avatar: boboo

2014-11-19 14:29

@deha,
this method is good (i use it by myself) only in a country with normal (not stupid) financial officers.
there is no problem then (in such countries) when you cancel an order and have a gap between invoice numbers.

the solution to consider could be (i have it already in my head :-) ) :
by opening the order a small funtion (like throwLastId) creates a new invioce number (if not already exists) and gives it to dokument into a js variable.
a small button (only if wished) "invoice" put it into a field and by saving the order the invoice number will be saved (if in field of course) into own (DB_INVOICES) database [iInvoice, iOrder].
this "throwLastId" function will of course use the DB_INVOICE.
in this case you will have separate invoice numbers not necessery coresponding to order numbers.
the pattern of the invoice number is a secondary "five minutes" problem :-)

boboo :-)

deha

Avatar: deha

2014-11-20 11:12

@boboo
I didn't think about it, your solution solve this problem out. thanks

DEHA

pesema

Avatar: pesema

2014-11-21 17:01

Thank you for yours replies.

@boboo
If is it possible, can you help me with modification of all necessary file?

Thank you very much for your time

Ivan

boboo

Avatar: boboo

2014-11-21 19:37

contact me:
boboo(at)kimla.de

boboo :-)

Back to top
about us | contact