diff --git a/build/AgaLib01.vcxproj b/build/AgaLib01.vcxproj index d821b5c33..798ec7753 100644 --- a/build/AgaLib01.vcxproj +++ b/build/AgaLib01.vcxproj @@ -12,7 +12,7 @@ {2D38A763-3D74-4338-9362-B891784EC90E} - 10.0.17763.0 + 10.0.19041.0 AgaLib01 diff --git a/build/Cg0.vcxproj b/build/Cg0.vcxproj index 3b7d50c01..16645e19b 100644 --- a/build/Cg0.vcxproj +++ b/build/Cg0.vcxproj @@ -13,7 +13,7 @@ {6F2EAB30-4FD7-41DE-BCE3-8CD5D4C880B4} cg0 - 10.0.17763.0 + 10.0.19041.0 diff --git a/build/Cg1.vcxproj b/build/Cg1.vcxproj index 9e4aa1f11..a30664adf 100644 --- a/build/Cg1.vcxproj +++ b/build/Cg1.vcxproj @@ -13,7 +13,7 @@ {9B42C6FD-9B50-42E6-A215-B641B44A931E} cg1 - 10.0.17763.0 + 10.0.19041.0 diff --git a/build/Cg2.vcxproj b/build/Cg2.vcxproj index 3415e8a0c..153a5b5a8 100644 --- a/build/Cg2.vcxproj +++ b/build/Cg2.vcxproj @@ -13,7 +13,7 @@ {9304E774-E631-495D-A29D-774222BBF8C9} cg2 - 10.0.17763.0 + 10.0.19041.0 diff --git a/build/Cg3.vcxproj b/build/Cg3.vcxproj index ab79f7090..feae96f33 100644 --- a/build/Cg3.vcxproj +++ b/build/Cg3.vcxproj @@ -13,7 +13,7 @@ {8F1FD835-004E-4BFA-A754-42A87AFA5343} cg3 - 10.0.17763.0 + 10.0.19041.0 diff --git a/build/Cg4.vcxproj b/build/Cg4.vcxproj index b1848b397..9026a7490 100644 --- a/build/Cg4.vcxproj +++ b/build/Cg4.vcxproj @@ -13,7 +13,7 @@ {F1589A59-C3AC-430E-88EC-925461405E57} cg4 - 10.0.17763.0 + 10.0.19041.0 diff --git a/build/Cg5.vcxproj b/build/Cg5.vcxproj index 83aed91ed..c330148ab 100644 --- a/build/Cg5.vcxproj +++ b/build/Cg5.vcxproj @@ -13,7 +13,7 @@ {4661E972-5AAC-4B3E-92C7-C267D5070793} cg5 - 10.0.17763.0 + 10.0.19041.0 diff --git a/build/Cg6.vcxproj b/build/Cg6.vcxproj index 56a32296d..64d34c010 100644 --- a/build/Cg6.vcxproj +++ b/build/Cg6.vcxproj @@ -13,7 +13,7 @@ {4FD17D56-D966-4F85-A04A-28EC6E0824CF} cg6 - 10.0.17763.0 + 10.0.19041.0 diff --git a/build/Cg7.vcxproj b/build/Cg7.vcxproj index abfe794ce..f0c160d8f 100644 --- a/build/Cg7.vcxproj +++ b/build/Cg7.vcxproj @@ -13,7 +13,7 @@ {95FED395-F24E-4E5B-95B5-227A99CA255F} cg7 - 10.0.17763.0 + 10.0.19041.0 diff --git a/build/Cg7.vcxproj.filters b/build/Cg7.vcxproj.filters index 2cdb734d2..c5e0a0f95 100644 --- a/build/Cg7.vcxproj.filters +++ b/build/Cg7.vcxproj.filters @@ -91,11 +91,6 @@ png - - - Resource Files - - Mask Files @@ -279,4 +274,7 @@ Sfondi PNG + + + \ No newline at end of file diff --git a/build/cg_masktab.vcxproj b/build/cg_masktab.vcxproj index fae3db5a5..068b63774 100644 --- a/build/cg_masktab.vcxproj +++ b/build/cg_masktab.vcxproj @@ -13,7 +13,7 @@ {97368DC9-8B0D-4F75-A89F-9A58701226B6} cg_masktab - 10.0.17763.0 + 10.0.19041.0 diff --git a/build/f1lib.vcxproj b/build/f1lib.vcxproj index eeb076f29..4d071b9c0 100644 --- a/build/f1lib.vcxproj +++ b/build/f1lib.vcxproj @@ -13,7 +13,7 @@ {41F4C25F-6BD2-4FC9-A0D3-A68CD1C9E4FC} fp - 10.0.17763.0 + 10.0.19041.0 diff --git a/build/fplib.vcxproj b/build/fplib.vcxproj index af90eef80..ba7b005b3 100644 --- a/build/fplib.vcxproj +++ b/build/fplib.vcxproj @@ -13,7 +13,7 @@ {C575788B-0BE4-4F68-B9C9-3C204EC04E07} fp - 10.0.17763.0 + 10.0.19041.0 diff --git a/build/lilib.vcxproj b/build/lilib.vcxproj index 12dee11c6..2dc85eba6 100644 --- a/build/lilib.vcxproj +++ b/build/lilib.vcxproj @@ -13,7 +13,7 @@ {B61F0AD4-0CCE-4371-8E92-85A26CAF1A7C} li0 - 10.0.17763.0 + 10.0.19041.0 diff --git a/build/pdflibwrap.vcxproj b/build/pdflibwrap.vcxproj index a38f1c009..8f22a258e 100644 --- a/build/pdflibwrap.vcxproj +++ b/build/pdflibwrap.vcxproj @@ -1,4 +1,4 @@ - + @@ -46,6 +46,9 @@ $(ProjectName) $(ProjectName) + + false + Disabled diff --git a/build/vedoc.vcxproj b/build/vedoc.vcxproj index 6121d748e..d399597c8 100644 --- a/build/vedoc.vcxproj +++ b/build/vedoc.vcxproj @@ -12,7 +12,7 @@ {A1CE9743-A597-4F92-B55A-345A366C9E55} - 10.0.17763.0 + 10.0.19041.0 diff --git a/build/vedocext.vcxproj b/build/vedocext.vcxproj index 9f66411f7..2a587854a 100644 --- a/build/vedocext.vcxproj +++ b/build/vedocext.vcxproj @@ -12,7 +12,7 @@ {0042619A-6B7C-4D3D-9CD9-9BDD8D200C15} - 10.0.17763.0 + 10.0.19041.0 diff --git a/build/xi01.vcxproj b/build/xi01.vcxproj index f9bbc0806..980202a00 100644 --- a/build/xi01.vcxproj +++ b/build/xi01.vcxproj @@ -12,7 +12,7 @@ {3A5B0119-6DAD-4407-9EE1-3B739B0581E8} - 10.0.17763.0 + 10.0.19041.0 diff --git a/build/xvaga01.vcxproj b/build/xvaga01.vcxproj index 3647b822a..3c8369215 100644 --- a/build/xvaga01.vcxproj +++ b/build/xvaga01.vcxproj @@ -13,7 +13,7 @@ {4A2FC619-2461-4F58-8F1D-92FA153E39A2} xvaga - 10.0.17763.0 + 10.0.19041.0 diff --git a/build/xvapp01.vcxproj b/build/xvapp01.vcxproj index 27cc23572..d9605ed46 100644 --- a/build/xvapp01.vcxproj +++ b/build/xvapp01.vcxproj @@ -12,7 +12,7 @@ {153C04B0-1F72-4DA9-8AC1-7DF76FFACFD2} - 10.0.17763.0 + 10.0.19041.0 diff --git a/build/xvslt.vcxproj b/build/xvslt.vcxproj index a1d1b64e0..ea83c3c85 100644 --- a/build/xvslt.vcxproj +++ b/build/xvslt.vcxproj @@ -13,7 +13,7 @@ {7ECF3959-40CC-4BAA-A5E1-8699789AC386} xvslt - 10.0.17763.0 + 10.0.19041.0 diff --git a/src/cg/cg1300l.h b/src/cg/cg1300l.h index c88e33fa4..0e4531c31 100755 --- a/src/cg/cg1300l.h +++ b/src/cg/cg1300l.h @@ -2,6 +2,8 @@ #define F_CLIFO 202 #define F_SORT 203 #define F_RESET 204 +#define F_IBAN 205 +#define F_PROG 206 #define S_DIRTY 101 #define S_CODCF 102 diff --git a/src/cg/cg1300l.uml b/src/cg/cg1300l.uml index b9b3bc7e7..17c1efbb2 100755 --- a/src/cg/cg1300l.uml +++ b/src/cg/cg1300l.uml @@ -13,6 +13,12 @@ BEGIN PICTURE TOOL_SAVEREC END +BUTTON DLG_ELABORA 10 2 +BEGIN + PROMPT -23 -11 "Aggiorna IBAN" + PICTURE TOOL_ELABORA +END + #include ENDPAGE @@ -35,9 +41,20 @@ BEGIN ITEM "3|Codice" END +STRING F_IBAN 27 +BEGIN + PROMPT 1 3 "IBAN " + VALIDATE VAL_IBAN_FUNC +END + +NUMBER F_PROG 2 +BEGIN + PROMPT 44 3 "Progressivo " +END + SPREADSHEET F_CLIFO 0 -1 BEGIN - PROMPT 0 3 "" + PROMPT 0 4 "" ITEM "@1" ITEM "Codice@7" ITEM "Ragione Sociale@50" @@ -150,4 +167,4 @@ END ENDPAGE -ENDMASK +ENDMASK \ No newline at end of file diff --git a/src/cg/cg1309.cpp b/src/cg/cg1309.cpp index fdfc0e3e7..d092c8551 100755 --- a/src/cg/cg1309.cpp +++ b/src/cg/cg1309.cpp @@ -3,11 +3,14 @@ #include #include #include +#include #include +#include #include #include "cg1300l.h" #include +#include "cfban.h" /////////////////////////////////////////////////////////// // TCheck_PIVA_mask @@ -25,6 +28,7 @@ protected: bool save_sheet(); void update_sheet(); void dirty_sheet_row(); + void aggiorna_iban(); public: @@ -235,6 +239,105 @@ void TCheck_PIVA_mask::dirty_sheet_row() s.force_update(s.selected()); } +void TCheck_PIVA_mask::aggiorna_iban() +{ + const TString iban(get(F_IBAN)); + const TString abi(iban.mid(5, 5)); + const TString cab(iban.mid(10, 5)); + const TString cc(iban.mid(15)); + const int prog = get_int(F_PROG); + TLog_report log("Aggiornamento IBAN"); + TISAM_recordset clifo("USE CLIFO\nFROM TIPOCF=#TIPO\nTO TIPOCF=#TIPO"); + + clifo.set_var("#TIPO", TVariant(get(F_TIPO))); + + TProgind pi(clifo.items(), TR("Aggiornamento IBAN")); + TRectype paiv_rec(LF_CLIFO); + TRectype cofi_rec(LF_CLIFO); + long updated = 0L; + + for (bool ok = clifo.move_first(); pi.addstatus() && ok; ok = clifo.move_next()) + { + TToken_string key; + + key.add(clifo.get_string(CLI_TIPOCF)); + key.add(clifo.get_long(CLI_CODCF)); + key.add("N"); + + TRecord_array ns_ban(key, LF_CFBAN); + bool found = false; + + for (int i = 1; !found && i <= ns_ban.rows(); i++) + { + const TString & iban_found = ns_ban.row(i).get(CFBAN_IBAN); + + found = (iban == iban_found); + + const TString abi_found = ns_ban.row(i).get(CFBAN_ABI); + const TString cab_found = ns_ban.row(i).get(CFBAN_CAB); + + if (!found && abi == abi_found && cab == cab_found) + { + ns_ban.row(i, false).put(CFBAN_PROGPR, prog); + ns_ban.row(i, false).put(CFBAN_IBAN, iban); + + int err = ns_ban.write(true); + TString msg; + + if (err == NOERR) + msg << TR("Aggiornamento"); + else + msg << format(FR("Errore %d nell'aggiornamento della"), err); + msg << TR(" banca del "); + if (clifo.get_string(CLI_TIPOCF) == "C") + msg << TR("Cliente "); + else + msg << TR("Fornitore "); + msg << clifo.get_long(CLI_CODCF); + log.log(err == NOERR ? 0 : 2, msg); + updated++; + } + } + if (!found) + { + const int nrow = ns_ban.rows() + 1; + + ns_ban.row(nrow, true).put(CFBAN_ABI, abi); + ns_ban.row(nrow, false).put(CFBAN_CAB, cab); + ns_ban.row(nrow, false).put(CFBAN_PROGPR, prog); + ns_ban.row(nrow, false).put(CFBAN_NUMCC, cc); + ns_ban.row(nrow, false).put(CFBAN_IBAN, iban); + + int err = ns_ban.write(true); + TString msg; + + if (err == NOERR) + msg << TR("Aggiornamento"); + else + msg << format(FR("Errore %d nell'aggiornamento della"), err); + msg << TR(" banca del "); + if (clifo.get_string(CLI_TIPOCF) == "C") + msg << TR("Cliente "); + else + msg << TR("Fornitore "); + msg << clifo.get_long(CLI_CODCF); + log.log(err == NOERR ? 0 : 2, msg); + updated++; + } + } + + TString msg("Aggiornati "); + + msg << updated; + if (get(F_TIPO) == "C") + msg << TR(" Clienti."); + else + msg << TR(" Fornitori."); + log.log(0, msg); + if (log.full()) + log.preview(); +} + bool TCheck_PIVA_mask::on_field_event(TOperable_field& o, TField_event e, long jolly) { switch (o.dlg()) @@ -287,7 +390,10 @@ bool TCheck_PIVA_mask::on_field_event(TOperable_field& o, TField_event e, long j if (e == fe_close) save_sheet(); break; - case S_PAIV: + case DLG_ELABORA: + aggiorna_iban(); + break; + case S_PAIV: if (e == fe_modify) { if (!pi_check("", o.get()))