Re: Inserting item in a receipt from a list of items
Hi,
Hopefully this works for you (see attached).
Derek.
My Visual Database → General → Inserting item in a receipt from a list of items
Hi,
Hopefully this works for you (see attached).
Derek.
ti ho scritto su fb
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.
corretto
Grazie domebil, grazie molte ma mi dici perchè non sono riuscito a spostarlo? Doveva essere una cosa banale.
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.
Quindi c'è una consequenzialità obbligatoria da rispettare di elementi da inserire?
si si. puoi cercare un po di tutorial di come funziona FastReport giusto per farti un'idea!
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!
Si può fare dalla schermata degli articoli che è facile perche puoi inserire i campi di ricerca nel report, senno ce bisogno di uno script
Oppure in questo modo qui
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.
E molto semplice devi giocare con gli elementi con (true e false) come ho fatto in questo esempio
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.
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.
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.
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!
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
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.
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.
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.
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.
Hi derek, do you also speak Latin?
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
Hi, you thought you got rid of me but you don't
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.
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.
My Visual Database → General → Inserting item in a receipt from a list of items
Powered by PunBB, supported by Informer Technologies, Inc.
Theme Hydrogen by Kushi