Nuovi moduli standard per IVA per cassa

git-svn-id: svn://10.65.10.50/branches/R_10_00@22762 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2012-11-30 14:42:15 +00:00
parent 885a21a2d1
commit e39175d953
11 changed files with 122 additions and 59 deletions

View File

@ -245,6 +245,20 @@ BEGIN
MESSAGE COPY,37
END
STRINGA 16 20
BEGIN
KEY "Liquidazione differita"
PROMPT 140 2 ""
MESSAGE _STREXPR,IF(33->LIQDIFF=="X","Liquidazione differita","")
END
STRINGA 17 20
BEGIN
KEY "IVA per cassa"
PROMPT 140 2 ""
MESSAGE _STREXPR,IF(33->IVAXCASSA=="X","IVA per cassa","")
END
SECTION H_RIGHE 3 0 2 GROUP
FLAGS "D"
STRINGA 1 20

View File

@ -100,6 +100,9 @@ public:
// GROUP
void group( const int g ) { _out << "GR " << g << "\n"; };
// MODULE
void module( const TString& m ) { _out << "MO " << m << "\n"; };
// PICTURE
void picture( const int p) { _out << "PI " << p << "\n"; };
// void picture( const TString & s) { _out << "PI " << '\"' << s << "\"\n"; };
@ -441,7 +444,7 @@ class TField : public TObject
int _size;
int _stato;
int _x, _y;
TString _prompt, _flag, _help, _warning, _fieldname;
TString _prompt, _flag, _help, _warning, _fieldname, _modules;
TToken_string _use, _input, _display, _output, _special, _items, _configs;
TToken_string _copy;
@ -478,12 +481,14 @@ public:
void help( const TString& help ){ _help = help; }
void warning( const TString& warning ){ _warning = warning; }
void fieldname( const TString& fieldname ){ _fieldname = fieldname; }
void modules( const TString& m ){ _modules = m; }
TString& nome( ){ return _nome; }
TString& prompt( ){ return _prompt; }
TString& flag( ){ return _flag; }
TString& help( ){ return _help; }
TString& warning( ){ return _warning; }
TString& fieldname( ){ return _fieldname; }
TString& modules( ){ return _modules; }
void use( TToken_string& use ){ _use = use; }
void input( TToken_string& input ){ _input = input; }
@ -603,7 +608,6 @@ static void genera_gruppo( const TObject& gruppo )
row_pos = line.find("%S");
const bool field = line.left(2) == "%F";
if (field && row > MAX_LINES_PER_PAGE)
{
// Passa alla pagina successiva
@ -694,12 +698,13 @@ TField::TField( TString& campo, TConfig& pro ) : _nome( campo )
_prompt = pro.get( "PROMPT", campo );
if( _prompt[ 0 ] == '\"' )
{
_prompt.ltrim( 1 );
_prompt.rtrim( 1 );
_prompt.rtrim(1);
_prompt.ltrim(1);
};
_flag = pro.get( "FLAG", campo );
_help = pro.get( "FLAG", campo );
_warning = pro.get( "FLAG", campo );
_help = pro.get( "HELP", campo );
_warning = pro.get( "WARNING", campo );
_modules = pro.get( "MODULE", campo ); _modules.strip("\"");
_use = pro.get( "USE", campo );
_use.separator( '~' );
_input = pro.get( "INPUT", campo );
@ -736,6 +741,7 @@ TField::TField( )
_flag = "";
_help = "";
_warning = "";
_modules = "";
_use = "";
_use.separator( '~' );
_input = "";
@ -770,6 +776,7 @@ TObject* TField::dup() const
f->_flag = _flag;
f->_help = _help;
f->_warning = _warning;
f->_modules = _modules;
f->_use = _use;
f->_id = _id;
f->_input = _input;
@ -858,9 +865,9 @@ void TField::genera( )
case S_OBBLIGATORIO :
case S_NOCHECK :
m.prompt( _x, _y + m.line( ), _prompt );
m.flag( _flag );
if (_flag.full()) m.flag( _flag );
break;
default:
default:
break;
}
if ((_type == T_DATA || _type == T_STRINGA ||
@ -868,16 +875,17 @@ void TField::genera( )
_type == T_GOLEM || _type == T_CURRENCY) &&
(_stato == S_OBBLIGATORIO || (!_use.blank())))
m.check( _stato );
if ( !_fieldname.blank( ) ) m.field( _fieldname );
if ( !_items.blank( ) ) m.item( _items );
if ( !_use.blank( ) ) m.use( _use );
if ( !_input.blank( ) ) m.input( _input );
if ( !_display.blank( ) ) m.display( _display );
if ( !_output.blank( ) ) m.output( _output );
if ( !_copy.blank( ) ) m.copy( _copy );
if ( !_help.blank( ) ) m.help( _help );
if ( !_warning.blank( ) ) m.warning( _warning );
if ( !_special.blank( ) ) m.outline( _special );
if ( _fieldname.full( ) ) m.field( _fieldname );
if ( _items.full( ) ) m.item( _items );
if ( _use.full( ) ) m.use( _use );
if ( _input.full( ) ) m.input( _input );
if ( _display.full( ) ) m.display( _display );
if ( _output.full( ) ) m.output( _output );
if ( _copy.full( ) ) m.copy( _copy );
if ( _help.full( ) ) m.help( _help );
if ( _warning.full( ) ) m.warning( _warning );
if ( _special.full( ) ) m.outline( _special );
if ( _modules.full()) m.module(_modules);
m.end( );
if ( ( m.line( ) > MAX_LINES_PER_PAGE ))
m.end( );
@ -996,6 +1004,8 @@ void TMask_generator::carica_dati_campi( const TFilename& fn, TAssoc_array& a )
campo->warning( value );
else if( key == "HELP" )
campo->help( value );
else if( key == "MODULE" )
campo->modules( value );
else if( key == "SPECIAL" )
campo->special( (TToken_string & )value );
else if( key == "ITEMS" )
@ -1063,7 +1073,7 @@ void TMask_generator::intestazione_pagina( const char* def_title)
_m->control( T_STRINGA, DLG_NULL, 4 );
_m->begin( );
_m->prompt( 2, 1, "Cod. num. " );
_m->prompt( 2, 1, "Cod. num. ");
_m->flag( "D" );
_m->group( 2 );
_m->end( );

View File

@ -102,6 +102,7 @@ FIELDNAME=IVAXCASSA
MSKID=F_IVAXCASSA
TYPE=T_CHECKBOX
PROMPT="IVA per cassa"
MODULE=IC
[STATOPAIV]
// il campo e' letto nel file 20 clifo

View File

@ -307,7 +307,7 @@ bool TDocumento_form::doc_arrange()
{
if (offset_x() != 0 || offset_y() != 0)
{
error_box(FR("Non e' possibile settare contemporaneamente gli offset"
error_box(FR("Non è possibile impostare contemporaneamente gli offset"
" e i parametri di posizionamento del modulo %s."), (const char*)name());
return false;
}
@ -381,14 +381,14 @@ void TDocumento_form::print_documento()
if (_doc->tipo().add_conai() && _doc->clifor().vendite().get_bool("CONAIASS"))
{
TRiga_documento last_row(_doc);
TConfig c(CONFIG_DITTA);
last_row = _rdocfile->curr();
_rdocfile->zero();
TString80 desc(c.get("DESCCONAIASS"));
if (desc.empty())
desc = TR("Contributo CONAI assolto");
_rdocfile->put(RDOC_DESCR, desc);
const TString& desc = ini_get_string(CONFIG_DITTA, "ve", "DESCCONAIASS");
if (desc.blank())
_rdocfile->put(RDOC_DESCR, TR("Contributo CONAI assolto"));
else
_rdocfile->put(RDOC_DESCR, desc);
body.update();
const word h = body.height();
if (pr.rows_left() <= h+1) // salto pagina
@ -1232,7 +1232,6 @@ enum behaviour
#define BY_NUM_KEY 1
#define BY_DATE_KEY 3
class TStampaDoc_application: public TSkeleton_application
{
TString _codnum; // codice di numerazione
@ -1967,13 +1966,13 @@ TStampaDoc_application::TOutput_mode TStampaDoc_application::key2mode(KEY k) con
switch (k)
{
case 'A': mode = out_preview; break;
case 'E': mode = out_mail; break;
case 'e': mode = out_signed_mail; break;
case 'P': mode = out_pdf; break;
case 'p': mode = out_signed_pdf; break;
case 'S':
default : mode = out_print; break;
case 'A': mode = out_preview; break;
case 'E': mode = out_mail; break;
case 'e': mode = out_signed_mail; break;
case 'P': mode = out_pdf; break;
case 'p': mode = out_signed_pdf; break;
case 'S':
default : mode = out_print; break;
}
return mode;
}
@ -1982,7 +1981,7 @@ bool TStampaDoc_application::create()
{
_firmrel= new TRelation(LF_NDITTE); // istanziamento e impostazione della relazione di gestione della ditta corrente
_firmrel->add(LF_ANAG, "TIPOA=TIPOA|CODANAGR=CODANAGR");
_firmrel->add(LF_UNLOC,"CODDITTA=CODDITTA"); // si posiziona sulla prima unita' locale della ditta
_firmrel->add(LF_UNLOC, "CODDITTA=CODDITTA"); // si posiziona sulla prima unita' locale della ditta
_firmrel->add(LF_COMUNI, "STATO=STATORES|COM=COMRES", 1, LF_ANAG, 100+LF_COMUNI);
_firmrel->add(LF_COMUNI, "STATO=STATORES|COM=COMRF", 1, LF_ANAG, 200+LF_COMUNI);
open_files(LF_TABCOM, LF_TAB, LF_OCCAS, LF_CLIFO, LF_INDSP, LF_CFVEN, LF_MOVMAG, LF_RMOVMAG, LF_CONDV, LF_ANAMAG , LF_SVRIEP, LF_AGENTI, LF_PERCPROV, LF_CAUSALI, 0);

View File

@ -2096,7 +2096,7 @@ int ve2400(int argc, char* argv[])
{
TAnagrafica_magazzino a;
a.run(argc, argv, "Anagrafica di magazzino");
a.run(argc, argv, TR("Anagrafica di magazzino"));
return 0;
}

View File

@ -175,11 +175,19 @@ MESSAGE APPEND,26</prescript>
<field border="1" x="40.5" y="53" type="Linea" height="6" pattern="1" />
<field border="1" x="75.25" y="53" type="Linea" height="6" pattern="1" />
<field border="1" x="0.75" y="59" type="Linea" width="92" height="0" pattern="1" />
<field border="1" radius="100" x="76" y="59.25" type="Rettangolo" bg_color="#E1E1E1" shade_offset="30" width="16" height="2.75" />
<field border="1" radius="100" x="76" y="59.25" type="Rettangolo" bg_color="#E0E0E0" shade_offset="30" width="16" height="2.75" />
<field border="1" x="0.75" y="62.25" type="Linea" width="92" height="0" pattern="1" />
<field x="1" y="62.5" type="Testo" width="50" pattern="1" text="CONTRIBUTO CONAI ASSOLTO OVE DOVUTO">
<font face="Arial" bold="1" size="10" />
</field>
<field x="1" y="63.5" type="Array" width="50" height="1" pattern="1">
<font face="Arial" bold="1" size="10" />
<source>33.IVAXCASSA</source>
<list>
<li Code = "" Value = "" />
<li Code = "X" Value = "Operazione con IVA per cassa, di cui all'art. 32-bis del D.L. 83/2012" />
</list>
</field>
<field border="1" radius="100" x="45.5" y="9.5" type="Rettangolo" shade_offset="50" width="47" height="8" id="50" />
<field x="49" y="9" type="Testo" width="16" id="53" pattern="2" text=" Intestatario Documento">
<font italic="1" face="Arial" size="8" />
@ -367,7 +375,7 @@ NEGATE
&#3C;
AND
IF
"Iva a esigibilt&#E0; differita ai sensi dell' art. 6 comma 5, del dpr n.633&#2F;2973 e dell' art.7 legge 2&#2F;2009"
"IVA a esigibilit&#E0; differita ai sensi dell'art. 6 comma 5, del dpr n.633&#2F;2973 e dell' art.7 legge 2&#2F;2009"
#THIS !
THEN</prescript>
</field>
@ -381,7 +389,7 @@ NEGATE
&#3C;
AND
IF
"Iva a esigibilt&#E0; differita ai sensi dell' art. 6 comma 5, del dpr n.633&#2F;2973 e dell' art.7 legge 2&#2F;2009"
"IVA a esigibilit&#E0; differita ai sensi dell'art. 6 comma 5, del dpr n.633&#2F;2973 e dell' art.7 legge 2&#2F;2009"
#THIS !
THEN</prescript>
</field>

View File

@ -1047,6 +1047,8 @@ public:
static bool numdocrif_search_handler( TMask_field& f, KEY key );
static bool ragsoc_search_handler( TMask_field& f, KEY key );
static bool datadocrif_handler(TMask_field& f, KEY key);
static bool liqdiff_handler( TMask_field& f, KEY key );
virtual void highlight_row(int row, COLOR back = COLOR_INVALID, COLOR fore = COLOR_INVALID, bool dirty = true, bool update = true);
void highlight();

View File

@ -1438,6 +1438,7 @@ error_type TContabilizzazione::compile_head_mov(TDocumento& doc)
mov_rec.put(MOV_DCODNUM, doc.get(DOC_CODNUM));
mov_rec.put(MOV_DNDOC, doc.get(DOC_NDOC));
mov_rec.put(MOV_LIQDIFF, doc.get(DOC_LIQDIFF));
mov_rec.put(MOV_IVAXCASSA, doc.get(DOC_IVAXCASSA));
mov_rec.put(MOV_CONTRATTO, doc.get(DOC_CONTRATTO));
mov_rec.put(MOV_MODPAG, doc.get(DOC_MODPAG));
mov_rec.put(MOV_CONTSEP, doc.get(DOC_CONTSEP));
@ -1624,6 +1625,7 @@ error_type TContabilizzazione::compile_head_mov_re(TDocumento& doc)
mov_rec.put(MOV_DCODNUM, doc.get(DOC_CODNUM));
mov_rec.put(MOV_DNDOC, doc.get(DOC_NDOC));
mov_rec.put(MOV_LIQDIFF, doc.get(DOC_LIQDIFF));
mov_rec.put(MOV_IVAXCASSA, doc.get(DOC_IVAXCASSA));
mov_rec.put(MOV_CONTRATTO, doc.get(DOC_CONTRATTO));
mov_rec.put(MOV_MODPAG, doc.get(DOC_MODPAG));
mov_rec.put(MOV_CONTSEP, doc.get(DOC_CONTSEP));
@ -1636,7 +1638,7 @@ error_type TContabilizzazione::search_costo_ricavo(TBill& conto, const TRiga_doc
{
const int items = _search_seq->items();
TLocalisamfile & cli_file = _clifo->lfile(); // YES, arriva qui dentro quando la relazione e' gia' posizionata
const bool is_cli = cli_file.get(CLI_TIPOCF) == "C";
const bool is_cli = cli_file.get_char(CLI_TIPOCF) != 'F';
bool skip_art_related = false;
bool skip_clifo = _clifo->bad();
TCodiceIVA codiva(r.get(RDOC_CODIVA));
@ -3088,7 +3090,7 @@ error_type TContabilizzazione::write_all(TDocumento& doc, TMovimentoPN_VE & movi
const bool has_sc = sc_enabled(head.get_date(MOV_DATAREG));
if (has_sc)
write_scadenze(doc, numreg == old_numreg); // Recontbilizing?
write_scadenze(doc, numreg == old_numreg); // Recontabilizing?
if (good() && in_enabled())
write_intra(doc);
@ -3199,8 +3201,8 @@ error_type TContabilizzazione::compile_head_anticipo(TDocumento& doc)
head.put(MOV_TIPODOC,_caus->tipo_doc());
head.put(MOV_CODCAUS,_caus->codice());
descr = doc.get_bool(DOC_ACCSALDO) ? TR("Saldo fattura") : TR("Acconto fattura");
descr << " n. " << doc.numero();
descr << " del " << doc.get_date(DOC_DATADOC).string();
descr << TR(" n. ") << doc.numero();
descr << TR(" del ") << doc.get_date(DOC_DATADOC).string();
head.put(MOV_DESCR,descr);
head.put(MOV_TIPOMOV,char(_caus->tipomov()+'0'));
head.zero(MOV_REG);
@ -3208,7 +3210,7 @@ error_type TContabilizzazione::compile_head_anticipo(TDocumento& doc)
head.zero(MOV_CODPAG);
head.zero(MOV_CORRLIRE);
head.zero(MOV_CORRVALUTA);
TString codval = head.get(MOV_CODVALI);
// TString4 codval = head.get(MOV_CODVALI);
// real cambio = head.get_real(MOV_CAMBIOI);
head.zero(MOV_CODVALI);
head.zero(MOV_CAMBIOI);
@ -3382,7 +3384,7 @@ error_type TContabilizzazione::write_pagamento_anticipo(TDocumento& doc)
const TRectype& mov = _anticipo->curr();
const int anno = mov.get_date(MOV_DATAREG).year();
const long numreg = mov.get_long(MOV_NUMREG);
const TString16 numpart(mov.get(MOV_NUMDOC)); // Nessun controllo se prot.iva o numdoc xche' tanto proviene dal mov precedentemente scritto
const TString8 numpart(mov.get(MOV_NUMDOC)); // Nessun controllo se prot.iva o numdoc xche' tanto proviene dal mov precedentemente scritto
TPartita* partita = new TPartita(_co_cliente,anno,numpart);
partita->allinea();
@ -3395,8 +3397,8 @@ error_type TContabilizzazione::write_pagamento_anticipo(TDocumento& doc)
TRiga_partite& rpart = partita->riga(r);
if (rpart.is_fattura())
{
TString16 s1 = rpart.get(PART_NUMDOC); s1.trim();
TString16 s2 = numpart; s2.trim();
TString8 s1 = rpart.get(PART_NUMDOC); s1.trim();
TString8 s2 = numpart; s2.trim();
if (s1 == s2) // Bisogna tener conto dell'allineamento!
{
nriga = r;
@ -3440,9 +3442,9 @@ error_type TContabilizzazione::write_pagamento_anticipo(TDocumento& doc)
TCurrency_documento impval(doc.get_real(DOC_IMPPAGATO), doc);
TCurrency_documento imp(impval); imp.change_to_firm_val();
real cambio = doc.get_real(DOC_CAMBIO);
TString16 val(doc.get(DOC_CODVAL));
TDate datacam(doc.get_date(DOC_DATACAMBIO));
const real cambio = doc.get_real(DOC_CAMBIO);
const TString4 val(doc.get(DOC_CODVAL));
const TDate datacam(doc.get_date(DOC_DATACAMBIO));
const bool valuta = val.not_empty();
riga_part.put(PART_IMPORTO,imp.get_num());
riga_part.put(PART_IMPORTOVAL,impval.get_num());

View File

@ -1,7 +1,6 @@
#include <colmask.h>
#include <dongle.h>
#include <execp.h>
#include <modaut.h>
#include <multirel.h>
#include <postman.h>
#include <recset.h>
@ -159,6 +158,7 @@ TDocumento_mask::TDocumento_mask(const char* td)
set_field_handler( F_CODVAL1, codval_handler );
set_field_handler( F_NUMDOCRIF, datadocrif_handler);
set_field_handler( F_DATADOCRIF, datadocrif_handler);
set_field_handler( F_LIQDIFF, liqdiff_handler);
set_handler( DLG_ELABORA, elabora_handler );
set_handler( DLG_PRINT, print_handler );
@ -1092,7 +1092,14 @@ void TDocumento_mask::cli2mask(bool force_load)
set(F_SPESEINC, ven_rec.get(CFV_PERCSPINC));
set(F_ADDBOLLI, ven_rec.get(CFV_ADDBOLLI));
set(F_CATVEN, ven_rec.get(CFV_CATVEN));
set(F_LIQDIFF, c.get_int(CLI_ALLEG) == 7 && ven_rec.get_bool(CFV_FATTSOSP) ? "X" : "");
const int alleg = c.get_int(CLI_ALLEG);
const bool ivadiff = alleg == 7 && ven_rec.get_bool(CFV_FATTSOSP);
set(F_LIQDIFF, ivadiff ? "X" : "");
const TDate datadoc = doc().get(DOC_DATADOC);
const bool IVAxCassa = !ivadiff && (alleg < 5 || alleg == 7) && gestione_IVAxCassa(datadoc);
set(F_IVAXCASSA, IVAxCassa ? "X" : "");
pos = id2pos(F_CODLIST);
@ -2096,7 +2103,7 @@ bool TDocumento_mask::clifo_handler( TMask_field& f, KEY key )
}
else
d.zero(DOC_OCFPI);
}
}
return true;
}
@ -3708,7 +3715,7 @@ bool TDocumento_mask::anno_handler( TMask_field& f, KEY key)
return true;
}
TString16 __codnum;
static TString4 __codnum;
bool tipodoc_ok(const TString & tipodoc)
{
@ -3746,8 +3753,8 @@ bool TDocumento_mask::num_handler( TMask_field& f, KEY key)
// Ottengo la maschera
TMask& m = f.mask();
const TString & codnum = f.get();
TCursor * cur = m.efield(F_TIPODOC).browse()->cursor();
TCursor * descur = m.efield(F_DESTIPODOC).browse()->cursor();
TCursor* cur = m.efield(F_TIPODOC).browse()->cursor();
TCursor* descur = m.efield(F_DESTIPODOC).browse()->cursor();
__codnum = codnum;
if (codnum.full())

View File

@ -23,6 +23,7 @@
#include "ve0100n.h"
#include "../cg/cg2103.h"
#include "../cg/cglib03.h"
#include "../db/dblib.h"
#include "../mg/mglib.h"
#include "../db/dblib.h"
@ -303,16 +304,25 @@ bool data_hndl( TMask_field& field, KEY key )
TDocumento_mask& m = (TDocumento_mask &) field.mask();
if (field.to_check(key))
{
if (m.id2pos(F_DATAINSC) >= 0)
if (m.id2pos(F_DATAINSC) > 0)
{
TEdit_field & e = m.efield(F_DATAINSC);
e.set_dirty();
e.on_hit();
}
if (m.id2pos(F_DATACAMBIO1) >= 0 && !m.get(F_CODVAL).empty())
if (m.id2pos(F_DATACAMBIO1) > 0 && !m.get(F_CODVAL).empty())
m.set(F_DATACAMBIO1, field.get(), true);
}
// Abilita IVA per cassa su modifica o inizializzazione DATADOC
if (key == K_TAB && m.id2pos(F_IVAXCASSA) > 0)
{
TDate d = field.get();
if (!d.ok()) d = TODAY;
m.enable(F_IVAXCASSA, gestione_IVAxCassa(d));
}
if (key == K_ENTER || field.to_check(key))
{
const TDate datadoc(m.get(F_DATADOC));
@ -2526,6 +2536,16 @@ bool TDocumento_mask::datadocrif_handler(TMask_field& f, KEY key)
return true;
}
bool TDocumento_mask::liqdiff_handler( TMask_field& f, KEY key )
{
if (key == K_ENTER && f.get().full())
{
if (f.mask().get_bool(F_IVAXCASSA))
return f.error_box(TR("Non è ammesso selezionare IVA per cassa e liquidazione differita"));
}
return true;
}
bool link_handler( TMask_field& f, KEY key )
{
if (key == K_SPACE)

View File

@ -1,11 +1,11 @@
#include "velib07.h"
#include <pconti.h>
#include "../cg/cgsaldac.h"
#include "../cg/cglib02.h"
#include "../db/dblib.h"
#include <pconti.h>
///////////////////////////////////////////////////////////
// TMateriali_base_recordset
///////////////////////////////////////////////////////////