Re: Inserting item in a receipt from a list of items

Hi,
Hopefully this works for you (see attached).
Derek.

Post's attachments

Attachment icon moony corretto3.zip 359.22 kb, 308 downloads since 2020-09-17 

Re: Inserting item in a receipt from a list of items

ti ho scritto su fb

Domebil

28 (edited by reteinformatica 2020-09-21 13:22:38)

Re: Inserting item in a receipt from a list of items

Thank you so much I don't know how to thank you. The settings and functions are perfect and the finishing touches have been completed. Everything went well except for the printing of the quantities in stock for the end of the year, which can be accessed by clicking on the "Inventario" button. I thought it was stupid but I just can't believe what's happening to me: I can't move the "MasterData" band under the title. I also tried to change the value of the "Top" property but it always returns to 0.5.
Sorry but I've been trying to do everything for two hours.

Post's attachments

Attachment icon moony corretto3.zip 362.51 kb, 273 downloads since 2020-09-21 

29 (edited by domebil 2020-09-21 14:48:22)

Re: Inserting item in a receipt from a list of items

corretto

Post's attachments

Attachment icon moony corretto4.rar 327.87 kb, 309 downloads since 2020-09-21 

Domebil

Re: Inserting item in a receipt from a list of items

Grazie domebil, grazie molte ma mi dici perchè non sono riuscito a spostarlo? Doveva essere una cosa banale.

Re: Inserting item in a receipt from a list of items

Perchè prima di MasterData1 ho messo Report Title1 che automaticamente va prima di MasterData1 è li ho inserito il titolo
Sempre da dove hai preso MasterData1 ci sono gli altri componenti come ReportSummary1 e ecc.

Domebil

Re: Inserting item in a receipt from a list of items

Quindi c'è una consequenzialità obbligatoria da rispettare di elementi da inserire?

Re: Inserting item in a receipt from a list of items

si si. puoi cercare un po di tutorial di come funziona FastReport giusto per farti un'idea!

Domebil

Re: Inserting item in a receipt from a list of items

Good morning,
I have made some changes and I am faced with another problem which is the last one: I would like to filter the inventory, accessible from the first window, for the season, that is, I should only do the inventory of a specific season or Summer (Estate) and Winter (Inverno), fields found in the "Stagioni" table. What should be done because I tried but have not been able to understand how. Thank you!

Post's attachments

Attachment icon moon.zip 368.83 kb, 259 downloads since 2020-09-24 

35 (edited by domebil 2020-09-25 06:11:39)

Re: Inserting item in a receipt from a list of items

Si può fare dalla schermata degli articoli che è facile perche puoi inserire i campi di ricerca nel report, senno ce bisogno di uno script

Post's attachments

Attachment icon moon corretto.rar 333.97 kb, 272 downloads since 2020-09-25 

Domebil

36 (edited by domebil 2020-09-25 06:44:22)

Re: Inserting item in a receipt from a list of items

Oppure in questo modo qui

Post's attachments

Attachment icon moon corretto2.rar 334.36 kb, 282 downloads since 2020-09-25 

Domebil

37 (edited by reteinformatica 2020-09-25 10:07:09)

Re: Inserting item in a receipt from a list of items

Grazie domebil, ci avevo pensato ad usare la stessa finestra degli articoli ma volendo essere un po' pignoli, se volessi aprire direttamente un report con filtrata la stagione come dovrebbe essere lo script. Sai mi aiuta anche ad imparare un po'.

ENGLISH
I thought about using the same article window but wanting to be a little fussy, if I wanted to directly open a report with the season filtered as the script should be. You know it also helps me to learn a little.

38 (edited by domebil 2020-09-26 06:37:21)

Re: Inserting item in a receipt from a list of items

E molto semplice devi giocare con gli elementi con  (true e false) come ho fatto in questo esempio

Post's attachments

Attachment icon moon con inventatio buono.rar 334.9 kb, 284 downloads since 2020-09-26 

Domebil

39 (edited by reteinformatica 2020-09-28 16:01:21)

Re: Inserting item in a receipt from a list of items

Ciao domebil, ci ho messo un po' a rispondere perchè ho studiato le tue correzioni, più  o meno ho capito. Ti ringrazio molto per l'aiuto e ringrazio molto anche derek persona squisita e sempre disponibile, non è la prima volta che mi da una mano.

40 (edited by reteinformatica 2020-09-28 20:17:08)

Re: Inserting item in a receipt from a list of items

Buongiorno,
rieccomi di nuovo qui, ho notato una piccola imperfezione: quando clicco sul tasto "Aggiungi articolo" del form "frmScontrino" si può vedere nella finestra sotto (form "frmListascontrini" componente "TableGrid2") che genera un nuovo scontrino automaticamente senza che abbia cliccato sul tasto "Salva" del form "frmScontrino". In questa maniera se ci si ripenserebbe e si volesse annullare lo scontrino ci ritroviamo comunque uno scontrino creato. Riaggiungo il progetto perchè ho fatto alcune modifiche senza toccare il codice però.


ENGLISH
Good morning,
here I am again, I noticed a small imperfection: when I click on the "Aggiungi articolo" button of the form "frmScontrino" you can see in the window below (form "frmListascontrini" component "TableGrid2") that generates a new receipt automatically without having clicked on the "Salva" button of the "frmScontrino" form. In this way, if we think about it and want to cancel the receipt, we still find ourselves a receipt created.

41 (edited by derek 2020-09-29 00:18:08)

Re: Inserting item in a receipt from a list of items

Hi Fabio, Domebil,
I've added a line in the script to check that if there are no items on the receipt (scontrinodetail), then the receipt (scontrino) is deleted (line 54 in the script).
Hope this fixes your problem.
Derek.

Post's attachments

Attachment icon moon con inventatio buono 2.zip 388.81 kb, 285 downloads since 2020-09-29 

42 (edited by reteinformatica 2020-09-29 11:07:58)

Re: Inserting item in a receipt from a list of items

Hi derek and thanks as always for your resolutions and availability.
I tried and strange but true I understood the script, but this inconsistency remains: if I insert an item in the receipt, the receipt will not be canceled, but let's assume that I think about it and even if I had added items to the receipt I wanted to cancel it, when I have entered an item, the receipt will be created unless I first delete the items from the receipt, but if I want to use a cancel button to cancel the receipt and therefore not save it even though there are articles inserted, what should I do?
You could use a script that, when you press the "Cancel" button, first deletes all the items from the receipt but I don't understand what to write to us.
Thanks a lot!

Re: Inserting item in a receipt from a list of items

Hi Fabio,
Please see the attached.
I think it is best to use 2 delete buttons on frmscontrino - one to delete an individual item on the receipt and one to delete the whole receipt.  So now you can
1.  add a new receipt and delete it without adding any items
2.  add a new receipt, add item(s) and then delete items
3.  add a new receipt, add items(s) and then delete all items and the receipt itself
4.  add a new item to an existing receipt
5   delete an item from an existing receipt
6.  delete all items from an existing receipt and the receipt itself.
Derek

Post's attachments

Attachment icon moon con inventatio buono 3.zip 389.4 kb, 272 downloads since 2020-09-29 

44 (edited by reteinformatica 2020-09-29 19:42:06)

Re: Inserting item in a receipt from a list of items

Hi derek and thank you so much,
your ideas are wonderful and you did just what I wanted.
Too bad, however, that despite having studied the code and reproposed it in my project, which I am attaching, I can't get it to work, while yours works fine, where am I wrong? It seems to me to do all well but I don't understand.

Post's attachments

Attachment icon moon.zip 375.07 kb, 264 downloads since 2020-09-29 

Re: Inserting item in a receipt from a list of items

Hi Fabio,
I think you had renamed frmscontrino.edit2 to frmscontrino.edeliminascontrino and that seemed to cause a problem (not really sure why). 
So I deleted frmscontrino.edeliminascontrino,  then added it again and called it frmscontrino.edeliminascontrino and it was okay. 
I have seen that sort of thing happen before (but very infrequently), so I try to use the default names (edit1, edit2 etc) rather than renaming them, just in case.
You can now also delete a complete receipt using frmlistascontrini.button4 (elimina) - before, you would have been getting a 'foreign key violation' error message.
Derek.

Post's attachments

Attachment icon moon4.zip 389.52 kb, 251 downloads since 2020-09-30 

46 (edited by reteinformatica 2020-09-30 10:46:16)

Re: Inserting item in a receipt from a list of items

Hi derek and thanks always so much, the idea of being able to cancel a receipt with the items inside without having to delete item by item and then having the error is great.
I noticed this particular:

in theory if I delete a receipt the quantity of items should go back to stock and this seems to me to do so but if I look in "TableGrid3" (frmListascontrini), an element created by your great idea, the items always remain the same, also deleting all the receipts, always in "TableGrid3" the stocks cells are all empty.
The same in "TableGrid1" of "frmscontrinodetails" until I make a new receipt and insert an item, then the stocks are visible and there is no empty cell in the table.

Re: Inserting item in a receipt from a list of items

Mea culpa - scuse!
There was an mistake in the calculated field, and frmlisascontrini.tablegrid3 needed to be refreshed.
I think it should be okay now.
Derek.

Post's attachments

Attachment icon moon5.zip 389.56 kb, 277 downloads since 2020-09-30 

Re: Inserting item in a receipt from a list of items

Hi derek, do you also speak Latin? smile
That's fine! Now I do some tests but I believe that at this point there is nothing more to do and I can say that it is all over.
Thank you very, very, very much

49 (edited by reteinformatica 2020-10-07 15:46:19)

Re: Inserting item in a receipt from a list of items

Hi, you thought you got rid of me but you don't smile
here I am with a new problem from which I cannot get out, it seems a stupid thing but I just don't understand: as you can see in frmInsinserArticolo, in the Edit edAliquotaivavendita I set 22 as defaulvalue.
In the "Calcoli" script there is the instruction "frmInsinserArticolo.edIvavendita.Value: = frmInsinserArticolo.edPrezzonettovendita.value * frmInsinserArticolo.edAliquotaivavendita.value / 100;"
When I go to create an article (frmInsinserettore) in the Edit "edIvavendita" it should give me the result of "edPrezzonettovendita" for "edAliquotaivavendita" divided by 100 but it gives me a different value. If, on the other hand, I always write 22 manually then the calculation is correct.

If, for example, when the program has started, I enter 10 in "Prezzo netto di acquisto" and enter 30 in "Percentuale di ricarico", "Iva vendita" is 2.27 instead it should be 2.86. When I manually write in "Aliquota iva vendita" 22 then the account becomes right.

Re: Inserting item in a receipt from a list of items

Caio Fabio,
Please find attached your project with the correction (io spero!!).
Generally, in scripts it isn't important in what sequence you write your procedures.
But WITHIN each individual procedure, each line of code will execute from the first line to the last line within that procedure, so the order in which you write your instructions is significant.
Your problem was that, in the 'calcoli' procedure,  edivavendita was being calculated at the beginning of the procedure before some of the calculations that edivavendita depends on which is why you were getting an incorrect result.
All you need to do is move the line
  frmInserimentoArticolo.edIvavendita.Value := frmInserimentoArticolo.edPrezzonettovendita.value * frmInserimentoArticolo.edAliquotaivavendita.value / 100;
to the end of the 'calcoli' procedure and it should be okay.
Hope I've explained that clearly.
Derek.

Post's attachments

Attachment icon moon5 fixed.zip 389.6 kb, 268 downloads since 2020-10-07